PageSourceSearch

https://titrain.re/assets/index-BWJV7LQC.js

js titrain.re collected 2026-10-07 16:40:50 UTC 1,584,537 bytes, 673 lines download raw bytes

vendor: 4,593 bytes, lines 1-9
1var fH=Object.defineProperty;var p3=n=>{throw TypeError(n)};var pH=(n,e,t)=>e in n?fH(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>pH(n,typeof e!="symbol"?e+"":e,t),nA=(n,e,t)=>e.has(n)||p3("Cannot "+t);var m=(n,e,t)=>(nA(n,e,"read from private field"),t?t.call(n):e.get(n)),q=(n,e,t)=>e.has(n)?p3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),M=(n,e,t,r)=>(nA(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),U=(n,e,t)=>(nA(n,e,"access private method"),t);var Xr=(n,e,t,r)=>({set _(i){M(n,e,i,t)},get _(){return m(n,e,r)}});function o6(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function a5(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Nb(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var l6={exports:{}},o5={},c6={exports:{}},Jt={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var kb=Symbol.for("react.element"),mH=Symbol.for("react.portal"),gH=Symbol.for("react.fragment"),vH=Symbol.for("react.strict_mode"),yH=Symbol.for("react.profiler"),bH=Symbol.for("react.provider"),wH=Symbol.for("react.context"),xH=Symbol.for("react.forward_ref"),_H=Symbol.for("react.suspense"),SH=Symbol.for("react.memo"),AH=Symbol.for("react.lazy"),m3=Symbol.iterator;function EH(n){return n===null||typeof n!="object"?null:(n=m3&&n[m3]||n["@@iterator"],typeof n=="function"?n:null)}var u6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d6=Object.assign,h6={};function C0(n,e,t){this.props=n,this.context=e,this.refs=h6,this.updater=t||u6}C0.prototype.isReactComponent={};C0.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};C0.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function f6(){}f6.prototype=C0.prototype;function n4(n,e,t){this.props=n,this.context=e,this.refs=h6,this.updater=t||u6}var r4=n4.prototype=new f6;r4.constructor=n4;d6(r4,C0.prototype);r4.isPureReactComponent=!0;var g3=Array.isArray,p6=Object.prototype.hasOwnProperty,i4={current:null},m6={key:!0,ref:!0,__self:!0,__source:!0};function g6(n,e,t){var r,i={},s=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)p6.call(e,r)&&!m6.hasOwnProperty(r)&&(i[r]=e[r]);var o=arguments.length-2;if(o===1)i.children=t;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(n&&n.defaultProps)for(r in o=n.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:kb,type:n,key:s,ref:a,props:i,_owner:i4.current}}function NH(n,e){return{$$typeof:kb,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}
vendor: 9,365 bytes, lines 9-25
9function s4(n){return typeof n=="object"&&n!==null&&n.$$typeof===kb}function kH(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var v3=/\/+/g;function rA(n,e){return typeof n=="object"&&n!==null&&n.key!=null?kH(""+n.key):e.toString(36)}function O2(n,e,t,r,i){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var a=!1;if(n===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(n.$$typeof){case kb:case mH:a=!0}}if(a)return a=n,i=i(a),n=r===""?"."+rA(a,0):r,g3(i)?(t="",n!=null&&(t=n.replace(v3,"$&/")+"/"),O2(i,e,t,"",function(c){return c})):i!=null&&(s4(i)&&(i=NH(i,t+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(v3,"$&/")+"/")+n)),e.push(i)),1;if(a=0,r=r===""?".":r+":",g3(n))for(var o=0;o<n.length;o++){s=n[o];var l=r+rA(s,o);a+=O2(s,e,t,l,i)}else if(l=EH(n),typeof l=="function")for(n=l.call(n),o=0;!(s=n.next()).done;)s=s.value,l=r+rA(s,o++),a+=O2(s,e,t,l,i);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function Dw(n,e,t){if(n==null)return n;var r=[],i=0;return O2(n,r,"","",function(s){return e.call(t,s,i++)}),r}function CH(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var os={current:null},M2={transition:null},TH={ReactCurrentDispatcher:os,ReactCurrentBatchConfig:M2,ReactCurrentOwner:i4};function v6(){throw Error("act(...) is not supported in production builds of React.")}Jt.Children={map:Dw,forEach:function(n,e,t){Dw(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return Dw(n,function(){e++}),e},toArray:function(n){return Dw(n,function(e){return e})||[]},only:function(n){if(!s4(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Jt.Component=C0;Jt.Fragment=gH;Jt.Profiler=yH;Jt.PureComponent=n4;Jt.StrictMode=vH;Jt.Suspense=_H;Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TH;Jt.act=v6;Jt.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var r=d6({},n.props),i=n.key,s=n.ref,a=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=i4.current),e.key!==void 0&&(i=""+e.key),n.type&&n.type.defaultProps)var o=n.type.defaultProps;for(l in e)p6.call(e,l)&&!m6.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=t;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:kb,type:n.type,key:i,ref:s,props:r,_owner:a}};Jt.createContext=function(n){return n={$$typeof:wH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:bH,_context:n},n.Consumer=n};Jt.createElement=g6;Jt.createFactory=function(n){var e=g6.bind(null,n);return e.type=n,e};Jt.createRef=function(){return{current:null}};Jt.forwardRef=function(n){return{$$typeof:xH,render:n}};Jt.isValidElement=s4;Jt.lazy=function(n){return{$$typeof:AH,_payload:{_status:-1,_result:n},_init:CH}};Jt.memo=function(n,e){return{$$typeof:SH,type:n,compare:e===void 0?null:e}};Jt.startTransition=function(n){var e=M2.transition;M2.transition={};try{n()}finally{M2.transition=e}};Jt.unstable_act=v6;Jt.useCallback=function(n,e){return os.current.useCallback(n,e)};Jt.useContext=function(n){return os.current.useContext(n)};Jt.useDebugValue=function(){};Jt.useDeferredValue=function(n){return os.current.useDeferredValue(n)};Jt.useEffect=function(n,e){return os.current.useEffect(n,e)};Jt.useId=function(){return os.current.useId()};Jt.useImperativeHandle=function(n,e,t){return os.current.useImperativeHandle(n,e,t)};Jt.useInsertionEffect=function(n,e){return os.current.useInsertionEffect(n,e)};Jt.useLayoutEffect=function(n,e){return os.current.useLayoutEffect(n,e)};Jt.useMemo=function(n,e){return os.current.useMemo(n,e)};Jt.useReducer=function(n,e,t){return os.current.useReducer(n,e,t)};Jt.useRef=function(n){return os.current.useRef(n)};Jt.useState=function(n){return os.current.useState(n)};Jt.useSyncExternalStore=function(n,e,t){return os.current.useSyncExternalStore(n,e,t)};Jt.useTransition=function(){return os.current.useTransition()};Jt.version="18.3.1";c6.exports=Jt;var E=c6.exports;const Ie=a5(E),a4=o6({__proto__:null,default:Ie},[E]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var PH=E,jH=Symbol.for("react.element"),RH=Symbol.for("react.fragment"),LH=Object.prototype.hasOwnProperty,IH=PH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,OH={key:!0,ref:!0,__self:!0,__source:!0};function y6(n,e,t){var r,i={},s=null,a=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)LH.call(e,r)&&!OH.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:jH,type:n,key:s,ref:a,props:i,_owner:IH.current}}o5.Fragment=RH;o5.jsx=y6;o5.jsxs=y6;l6.exports=o5;var d=l6.exports,b6={exports:{}},oa={},w6={exports:{}},x6={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(n){function e(O,te){var he=O.length;O.push(te);e:for(;0<he;){var ge=he-1>>>1,D=O[ge];if(0<i(D,te))O[ge]=te,O[he]=D,he=ge;else break e}}function t(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var te=O[0],he=O.pop();if(he!==te){O[0]=he;e:for(var ge=0,D=O.length,G=D>>>1;ge<G;){var ee=2*(ge+1)-1,ae=O[ee],X=ee+1,Q=O[X];if(0>i(ae,he))X<D&&0>i(Q,ae)?(O[ge]=Q,O[X]=he,ge=X):(O[ge]=ae,O[ee]=he,ge=ee);else if(X<D&&0>i(Q,he))O[ge]=Q,O[X]=he,ge=X;else break e}}return te}function i(O,te){var he=O.sortIndex-te.sortIndex;return he!==0?he:O.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,f=null,p=3,h=!1,b=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(O){for(var te=t(c);te!==null;){if(te.callback===null)r(c);else if(te.startTime<=O)r(c),te.sortIndex=te.expirationTime,e(l,te);else break;te=t(c)}}function A(O){if(g=!1,S(O),!b)if(t(l)!==null)b=!0,oe(C);else{var te=t(c);te!==null&&se(A,te.startTime-O)}}function C(O,te){b=!1,g&&(g=!1,y(I),I=-1),h=!0;var he=p;try{for(S(te),f=t(l);f!==null&&(!(f.expirationTime>te)||O&&!j());){var ge=f.callback;if(typeof ge=="function"){f.callback=null,p=f.priorityLevel;var D=ge(f.expirationTime<=te);te=n.unstable_now(),typeof D=="function"?f.callback=D:f===t(l)&&r(l),S(te)}else r(l);f=t(l)}if(f!==null)var G=!0;else{var ee=t(c);ee!==null&&se(A,ee.startTime-te),G=!1}return G}finally{f=null,p=he,h=!1}}var T=!1,R=null,I=-1,L=5,V=-1;function j(){return!(n.unstable_now()-V<L)}function $(){if(R!==null){var O=n.unstable_now();V=O;var te=!0;try{te=R(!0,O)}finally{te?J():(T=!1,R=null)}}else T=!1}var J;if(typeof x=="function")J=function(){x($)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,le=H.port2;H.port1.onmessage=$,J=function(){le.postMessage(null)}}else J=function(){w($,0)};function oe(O){R=O,T||(T=!0,J())}function se(O,te){I=w(function(){O(n.unstable_now())},te)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_continueExecution=function(){b||h||(b=!0,oe(C))},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(O){switch(p){case 1:case 2:case 3:var te=3;break;default:te=p}var he=p;p=te;try{return O()}finally{p=he}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(O,te){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var he=p;p=O;try{return te()}finally{p=he}},n.unstable_scheduleCallback=function(O,te,he){var ge=n.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?ge+he:ge):he=ge,O){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}
vendor: 4,629 bytes, lines 25-33
25return D=he+D,O={id:u++,callback:te,priorityLevel:O,startTime:he,expirationTime:D,sortIndex:-1},he>ge?(O.sortIndex=he,e(c,O),t(l)===null&&O===t(c)&&(g?(y(I),I=-1):g=!0,se(A,he-ge))):(O.sortIndex=D,e(l,O),b||h||(b=!0,oe(C))),O},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(O){var te=p;return function(){var he=p;p=te;try{return O.apply(this,arguments)}finally{p=he}}}})(x6);w6.exports=x6;var MH=w6.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var DH=E,sa=MH;function Me(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var _6=new Set,A1={};function Sp(n,e){l0(n,e),l0(n+"Capture",e)}function l0(n,e){for(A1[n]=e,n=0;n<e.length;n++)_6.add(e[n])}var Gc=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),LE=Object.prototype.hasOwnProperty,FH=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y3={},b3={};function BH(n){return LE.call(b3,n)?!0:LE.call(y3,n)?!1:FH.test(n)?b3[n]=!0:(y3[n]=!0,!1)}function $H(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function UH(n,e,t,r){if(e===null||typeof e>"u"||$H(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ls(n,e,t,r,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var Ni={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Ni[n]=new ls(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Ni[e]=new ls(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Ni[n]=new ls(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Ni[n]=new ls(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Ni[n]=new ls(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Ni[n]=new ls(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Ni[n]=new ls(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Ni[n]=new ls(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Ni[n]=new ls(n,5,!1,n.toLowerCase(),null,!1,!1)});var o4=/[\-:]([a-z])/g;function l4(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
33-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(o4,l4);Ni[e]=new ls(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(o4,l4);Ni[e]=new ls(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(o4,l4);Ni[e]=new ls(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Ni[n]=new ls(n,1,!1,n.toLowerCase(),null,!1,!1)});Ni.xlinkHref=new ls("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Ni[n]=new ls(n,1,!1,n.toLowerCase(),null,!0,!0)});function c4(n,e,t,r){var i=Ni.hasOwnProperty(e)?Ni[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(UH(e,t,i,r)&&(t=null),r||i===null?BH(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var nu=DH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fw=Symbol.for("react.element"),bm=Symbol.for("react.portal"),wm=Symbol.for("react.fragment"),u4=Symbol.for("react.strict_mode"),IE=Symbol.for("react.profiler"),S6=Symbol.for("react.provider"),A6=Symbol.for("react.context"),d4=Symbol.for("react.forward_ref"),OE=Symbol.for("react.suspense"),ME=Symbol.for("react.suspense_list"),h4=Symbol.for("react.memo"),Iu=Symbol.for("react.lazy"),E6=Symbol.for("react.offscreen"),w3=Symbol.iterator;function bv(n){return n===null||typeof n!="object"?null:(n=w3&&n[w3]||n["@@iterator"],typeof n=="function"?n:null)}var ir=Object.assign,iA;function Ov(n){if(iA===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);iA=e&&e[1]||""}return`
34`+iA+n}var sA=!1;function aA(n,e){if(!n||sA)return"";sA=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){r=c}n.call(e.prototype)}else{try{throw Error()}catch(c){r=c}n()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35`),s=r.stack.split(`
36`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var l=`
37`+i[a].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=a&&0<=o);break}}}finally{sA=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ov(n):""}function zH(n){switch(n.tag){case 5:return Ov(n.type);case 16:return Ov("Lazy");case 13:return Ov("Suspense");case 19:return Ov("SuspenseList");case 0:case 2:case 15:return n=aA(n.type,!1),n;case 11:return n=aA(n.type.render,!1),n;case 1:return n=aA(n.type,!0),n;default:return""}}function DE(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case wm:return"Fragment";case bm:return"Portal";case IE:return"Profiler";case u4:return"StrictMode";case OE:return"Suspense";case ME:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case A6:return(n.displayName||"Context")+".Consumer";case S6:return(n._context.displayName||"Context")+".Provider";case d4:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case h4:return e=n.displayName||null,e!==null?e:DE(n.type)||"Memo";case Iu:e=n._payload,n=n._init;try{return DE(n(e))}catch{}}return null}function qH(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return DE(e);case 8:return e===u4?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Dd(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function N6(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function HH(n){var e=N6(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Bw(n){n._valueTracker||(n._valueTracker=HH(n))}function k6(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=N6(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function Bx(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function FE(n,e){var t=e.checked;return ir({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function x3(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Dd(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function C6(n,e){e=e.checked,e!=null&&c4(n,"checked",e,!1)}function BE(n,e){C6(n,e);var t=Dd(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?$E(n,e.type,t):e.hasOwnProperty("defaultValue")&&$E(n,e.type,Dd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function _3(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function $E(n,e,t){(e!=="number"||Bx(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Mv=Array.isArray;function Lm(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+Dd(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function UE(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Me(91));return ir({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function S3(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Me(92));if(Mv(t)){if(1<t.length)throw Error(Me(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Dd(t)}}function T6(n,e){var t=Dd(e.value),r=Dd(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function A3(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function P6(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zE(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?P6(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var $w,j6=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for($w=$w||document.createElement("div"),$w.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=$w.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function E1(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var a1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},WH=["Webkit","ms","Moz","O"];
vendor: 6,781 bytes, line 37
37Object.keys(a1).forEach(function(n){WH.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),a1[e]=a1[n]})});function R6(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||a1.hasOwnProperty(n)&&a1[n]?(""+e).trim():e+"px"}function L6(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=R6(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var VH=ir({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qE(n,e){if(e){if(VH[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Me(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Me(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Me(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Me(62))}}function HE(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var WE=null;function f4(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var VE=null,Im=null,Om=null;function E3(n){if(n=Pb(n)){if(typeof VE!="function")throw Error(Me(280));var e=n.stateNode;e&&(e=h5(e),VE(n.stateNode,n.type,e))}}function I6(n){Im?Om?Om.push(n):Om=[n]:Im=n}function O6(){if(Im){var n=Im,e=Om;if(Om=Im=null,E3(n),e)for(n=0;n<e.length;n++)E3(e[n])}}function M6(n,e){return n(e)}function D6(){}var oA=!1;function F6(n,e,t){if(oA)return n(e,t);oA=!0;try{return M6(n,e,t)}finally{oA=!1,(Im!==null||Om!==null)&&(D6(),O6())}}function N1(n,e){var t=n.stateNode;if(t===null)return null;var r=h5(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Me(231,e,typeof t));return t}var GE=!1;if(Gc)try{var wv={};Object.defineProperty(wv,"passive",{get:function(){GE=!0}}),window.addEventListener("test",wv,wv),window.removeEventListener("test",wv,wv)}catch{GE=!1}function GH(n,e,t,r,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var o1=!1,$x=null,Ux=!1,KE=null,KH={onError:function(n){o1=!0,$x=n}};function YH(n,e,t,r,i,s,a,o,l){o1=!1,$x=null,GH.apply(KH,arguments)}function XH(n,e,t,r,i,s,a,o,l){if(YH.apply(this,arguments),o1){if(o1){var c=$x;o1=!1,$x=null}else throw Error(Me(198));Ux||(Ux=!0,KE=c)}}function Ap(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function B6(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function N3(n){if(Ap(n)!==n)throw Error(Me(188))}function JH(n){var e=n.alternate;if(!e){if(e=Ap(n),e===null)throw Error(Me(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return N3(i),n;if(s===r)return N3(i),e;s=s.sibling}throw Error(Me(188))}if(t.return!==r.return)t=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===t){a=!0,t=i,r=s;break}if(o===r){a=!0,r=i,t=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===t){a=!0,t=s,r=i;break}if(o===r){a=!0,r=s,t=i;break}o=o.sibling}if(!a)throw Error(Me(189))}}if(t.alternate!==r)throw Error(Me(190))}if(t.tag!==3)throw Error(Me(188));return t.stateNode.current===t?n:e}function $6(n){return n=JH(n),n!==null?U6(n):null}function U6(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=U6(n);if(e!==null)return e;n=n.sibling}return null}var z6=sa.unstable_scheduleCallback,k3=sa.unstable_cancelCallback,QH=sa.unstable_shouldYield,ZH=sa.unstable_requestPaint,wr=sa.unstable_now,eW=sa.unstable_getCurrentPriorityLevel,p4=sa.unstable_ImmediatePriority,q6=sa.unstable_UserBlockingPriority,zx=sa.unstable_NormalPriority,tW=sa.unstable_LowPriority,H6=sa.unstable_IdlePriority,l5=null,Pl=null;function nW(n){if(Pl&&typeof Pl.onCommitFiberRoot=="function")try{Pl.onCommitFiberRoot(l5,n,void 0,(n.current.flags&128)===128)}catch{}}var Co=Math.clz32?Math.clz32:sW,rW=Math.log,iW=Math.LN2;function sW(n){return n>>>=0,n===0?32:31-(rW(n)/iW|0)|0}var Uw=64,zw=4194304;function Dv(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function qx(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,a=t&268435455;if(a!==0){var o=a&~i;o!==0?r=Dv(o):(s&=a,s!==0&&(r=Dv(s)))}else a=t&~i,a!==0?r=Dv(a):s!==0&&(r=Dv(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-Co(e),i=1<<t,r|=n[t],e&=~i;return r}function aW(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oW(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var a=31-Co(s),o=1<<a,l=i[a];l===-1?(!(o&t)||o&r)&&(i[a]=aW(o,e)):l<=e&&(n.expiredLanes|=o),s&=~o}}function YE(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function W6(){var n=Uw;return Uw<<=1,!(Uw&4194240)&&(Uw=64),n}function lA(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function Cb(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Co(e),n[e]=t}function lW(n,e){var t=n.pendingLanes&~e;
vendor: 4,148 bytes, line 37
37n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-Co(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function m4(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-Co(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var xn=0;function V6(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var G6,g4,K6,Y6,X6,XE=!1,qw=[],Ed=null,Nd=null,kd=null,k1=new Map,C1=new Map,Mu=[],cW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function C3(n,e){switch(n){case"focusin":case"focusout":Ed=null;break;case"dragenter":case"dragleave":Nd=null;break;case"mouseover":case"mouseout":kd=null;break;case"pointerover":case"pointerout":k1.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":C1.delete(e.pointerId)}}function xv(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Pb(e),e!==null&&g4(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function uW(n,e,t,r,i){switch(e){case"focusin":return Ed=xv(Ed,n,e,t,r,i),!0;case"dragenter":return Nd=xv(Nd,n,e,t,r,i),!0;case"mouseover":return kd=xv(kd,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return k1.set(s,xv(k1.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,C1.set(s,xv(C1.get(s)||null,n,e,t,r,i)),!0}return!1}function J6(n){var e=zh(n.target);if(e!==null){var t=Ap(e);if(t!==null){if(e=t.tag,e===13){if(e=B6(t),e!==null){n.blockedOn=e,X6(n.priority,function(){K6(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function D2(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=JE(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);WE=r,t.target.dispatchEvent(r),WE=null}else return e=Pb(t),e!==null&&g4(e),n.blockedOn=t,!1;e.shift()}return!0}function T3(n,e,t){D2(n)&&t.delete(e)}function dW(){XE=!1,Ed!==null&&D2(Ed)&&(Ed=null),Nd!==null&&D2(Nd)&&(Nd=null),kd!==null&&D2(kd)&&(kd=null),k1.forEach(T3),C1.forEach(T3)}function _v(n,e){n.blockedOn===e&&(n.blockedOn=null,XE||(XE=!0,sa.unstable_scheduleCallback(sa.unstable_NormalPriority,dW)))}function T1(n){function e(i){return _v(i,n)}if(0<qw.length){_v(qw[0],n);for(var t=1;t<qw.length;t++){var r=qw[t];r.blockedOn===n&&(r.blockedOn=null)}}for(Ed!==null&&_v(Ed,n),Nd!==null&&_v(Nd,n),kd!==null&&_v(kd,n),k1.forEach(e),C1.forEach(e),t=0;t<Mu.length;t++)r=Mu[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<Mu.length&&(t=Mu[0],t.blockedOn===null);)J6(t),t.blockedOn===null&&Mu.shift()}var Mm=nu.ReactCurrentBatchConfig,Hx=!0;function hW(n,e,t,r){var i=xn,s=Mm.transition;Mm.transition=null;try{xn=1,v4(n,e,t,r)}finally{xn=i,Mm.transition=s}}function fW(n,e,t,r){var i=xn,s=Mm.transition;Mm.transition=null;try{xn=4,v4(n,e,t,r)}finally{xn=i,Mm.transition=s}}function v4(n,e,t,r){if(Hx){var i=JE(n,e,t,r);if(i===null)yA(n,e,r,Wx,t),C3(n,r);else if(uW(i,n,e,t,r))r.stopPropagation();else if(C3(n,r),e&4&&-1<cW.indexOf(n)){for(;i!==null;){var s=Pb(i);if(s!==null&&G6(s),s=JE(n,e,t,r),s===null&&yA(n,e,r,Wx,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else yA(n,e,r,null,t)}}var Wx=null;function JE(n,e,t,r){if(Wx=null,n=f4(r),n=zh(n),n!==null)if(e=Ap(n),e===null)n=null;else if(t=e.tag,t===13){if(n=B6(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Wx=n,null}function Q6(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invali
37d":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eW()){case p4:return 1;case q6:return 4;case zx:case tW:return 16;case H6:return 536870912;default:return 16}default:return 16}}var wd=null,y4=null,F2=null;function Z6(){if(F2)return F2;var n,e=y4,t=e.length,r,i="value"in wd?wd.value:wd.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var a=t-n;for(r=1;r<=a&&e[t-r]===i[s-r];r++);return F2=i.slice(n,1<r?1-r:void 0)}function B2(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Hw(){return!0}function P3(){return!1}function la(n){function e(t,r,i,s,a){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],this[o]=t?t(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Hw:P3,this.isPropagationStopped=P3,this}return ir(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Hw)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Hw)},persist:function(){},isPersistent:Hw}),e}var T0={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},b4=la(T0),Tb=ir({},T0,{view:0,detail:0}),pW=la(Tb),cA,uA,Sv,c5=ir({},Tb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:w4,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Sv&&(Sv&&n.type==="mousemove"?(cA=n.screenX-Sv.screenX,uA=n.screenY-Sv.screenY):uA=cA=0,Sv=n),cA)},movementY:function(n){return"movementY"in n?n.movementY:uA}}),j3=la(c5),mW=ir({},c5,{dataTransfer:0}),gW=la(mW),vW=ir({},Tb,{relatedTarget:0}),dA=la(vW),yW=ir({},T0,{animationName:0,elapsedTime:0,pseudoElement:0}),bW=la(yW),wW=ir({},T0,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),xW=la(wW),_W=ir({},T0,{data:0}),R3=la(_W),SW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AW={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},EW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NW(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=EW[n])?!!e[n]:!1}function w4(){return NW}var kW=ir({},Tb,{key:function(n){if(n.key){var e=SW[n.key]||n.key;if(e!=="Unidentified")return e}
vendor: 6,028 bytes, line 37
37return n.type==="keypress"?(n=B2(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?AW[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:w4,charCode:function(n){return n.type==="keypress"?B2(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?B2(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),CW=la(kW),TW=ir({},c5,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),L3=la(TW),PW=ir({},Tb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:w4}),jW=la(PW),RW=ir({},T0,{propertyName:0,elapsedTime:0,pseudoElement:0}),LW=la(RW),IW=ir({},c5,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),OW=la(IW),MW=[9,13,27,32],x4=Gc&&"CompositionEvent"in window,l1=null;Gc&&"documentMode"in document&&(l1=document.documentMode);var DW=Gc&&"TextEvent"in window&&!l1,eO=Gc&&(!x4||l1&&8<l1&&11>=l1),I3=" ",O3=!1;function tO(n,e){switch(n){case"keyup":return MW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nO(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var xm=!1;function FW(n,e){switch(n){case"compositionend":return nO(e);case"keypress":return e.which!==32?null:(O3=!0,I3);case"textInput":return n=e.data,n===I3&&O3?null:n;default:return null}}function BW(n,e){if(xm)return n==="compositionend"||!x4&&tO(n,e)?(n=Z6(),F2=y4=wd=null,xm=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return eO&&e.locale!=="ko"?null:e.data;default:return null}}var $W={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function M3(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!$W[n.type]:e==="textarea"}function rO(n,e,t,r){I6(r),e=Vx(e,"onChange"),0<e.length&&(t=new b4("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var c1=null,P1=null;function UW(n){pO(n,0)}function u5(n){var e=Am(n);if(k6(e))return n}function zW(n,e){if(n==="change")return e}var iO=!1;if(Gc){var hA;if(Gc){var fA="oninput"in document;if(!fA){var D3=document.createElement("div");D3.setAttribute("oninput","return;"),fA=typeof D3.oninput=="function"}hA=fA}else hA=!1;iO=hA&&(!document.documentMode||9<document.documentMode)}function F3(){c1&&(c1.detachEvent("onpropertychange",sO),P1=c1=null)}function sO(n){if(n.propertyName==="value"&&u5(P1)){var e=[];rO(e,P1,n,f4(n)),F6(UW,e)}}function qW(n,e,t){n==="focusin"?(F3(),c1=e,P1=t,c1.attachEvent("onpropertychange",sO)):n==="focusout"&&F3()}function HW(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return u5(P1)}function WW(n,e){if(n==="click")return u5(e)}function VW(n,e){if(n==="input"||n==="change")return u5(e)}function GW(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Lo=typeof Object.is=="function"?Object.is:GW;function j1(n,e){if(Lo(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!LE.call(e,i)||!Lo(n[i],e[i]))return!1}return!0}function B3(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $3(n,e){var t=B3(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=B3(t)}}function aO(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?aO(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function oO(){for(var n=window,e=Bx();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Bx(n.document)}return e}function _4(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function KW(n){var e=oO(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&aO(t.ownerDocument.documentElement,t)){if(r!==null&&_4(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=$3(t,s);var a=$3(t,r);i&&a&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==a.node||n.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var YW=Gc&&"documentMode"in document&&11>=document.documentMode,_m=null,QE=null,u1=null,ZE=!1;function U3(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;ZE||_m==null||_m!==Bx(r)||(r=_m,"selectionStart"in r&&_4(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),u1&&j1(u1,r)||(u1=r,r=Vx(QE,"onSelect"),0<r.length&&(e=new b4("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=_m)))}function Ww(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Sm={animationend:Ww("Animation","AnimationEnd"),animationiteration:Ww("Animation","AnimationIteration"),animationstart:Ww("Animation","AnimationStart"),transitionend:Ww("Transition","TransitionEnd")},pA={},lO={};Gc&&(lO=document.createElement("div").style,"AnimationEvent"in window||(delete Sm.animationend.animation,delete Sm.animationiteration.animation,delete Sm.animationstart.animation),"TransitionEvent"in window||delete Sm.transitionend.transition);function d5(n){if(pA[n])return pA[n];if(!Sm[n])return n;var e=Sm[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in lO)return pA[n]=e[t];return n}var cO=d5("animationend"),uO=d5("animationiteration"),dO=d5("animationstart"),hO=d5("transitionend"),fO=new Map,z3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Yd(n,e){fO.set(n,e),Sp(e,[n])}for(var mA=0;mA<z3.length;mA++){var gA=z3[mA],XW=gA.toLowerCase(),JW=gA[0].toUpperCase()+gA.slice(1);Yd(XW,"on"+JW)}Yd(cO,"onAnimationEnd");Yd(uO,"onAnimationIteration");Yd(dO,"onAnimationStart");Yd("dblclick","onDoubleClick");Yd("focusin","onFocus");Yd("focusout","onBlur");Yd(hO,"onTransitionEnd");l0("onMouseEnter",["mouseout","mouseover"]);l0("onMouseLeave",["mouseout","mouseover"]);l0("onPointerEnter",["pointerout","pointerover"]);l0("onPointerLeave",["pointerout","pointerover"]);Sp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sp("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fv="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),QW=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fv));function q3(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,XH(r,e,void 0,n),n.currentTarget=null}function pO(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;q3(i,o,c),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;q3(i,o,c),s=l}}}if(Ux)throw n=KE,Ux=!1,KE=null,n}function Bn(n,e){var t=e[iN];t===void 0&&(t=e[iN]=new Set);var r=n+"__bubble";t.has(r)||(mO(e,n,2,!1),t.add(r))}function vA(n,e,t){var r=0;e&&(r|=4),mO(t,n,r,e)}var Vw="_reactListening"+Math.random().toString(36).slice(2);function R1(n){if(!n[Vw]){n[Vw]=!0,_6.forEach(function(t){t!=="selectionchange"&&(QW.has(t)||vA(t,!1,n),vA(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Vw]||(e[Vw]=!0,vA("selectionchange",!1,e))}}function mO(n,e,t,r){switch(Q6(e)){case 1:var i=hW;break;case 4:i=fW;break;default:i=v4}t=i.bind(null,e,t,n),i=void 0,!GE||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function yA(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;
vendor: 10,880 bytes, lines 37-38
37if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;o!==null;){if(a=zh(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}F6(function(){var c=s,u=f4(t),f=[];e:{var p=fO.get(n);if(p!==void 0){var h=b4,b=n;switch(n){case"keypress":if(B2(t)===0)break e;case"keydown":case"keyup":h=CW;break;case"focusin":b="focus",h=dA;break;case"focusout":b="blur",h=dA;break;case"beforeblur":case"afterblur":h=dA;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=j3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=gW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=jW;break;case cO:case uO:case dO:h=bW;break;case hO:h=LW;break;case"scroll":h=pW;break;case"wheel":h=OW;break;case"copy":case"cut":case"paste":h=xW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=L3}var g=(e&4)!==0,w=!g&&n==="scroll",y=g?p!==null?p+"Capture":null:p;g=[];for(var x=c,S;x!==null;){S=x;var A=S.stateNode;if(S.tag===5&&A!==null&&(S=A,y!==null&&(A=N1(x,y),A!=null&&g.push(L1(x,A,S)))),w)break;x=x.return}0<g.length&&(p=new h(p,b,null,t,u),f.push({event:p,listeners:g}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",h=n==="mouseout"||n==="pointerout",p&&t!==WE&&(b=t.relatedTarget||t.fromElement)&&(zh(b)||b[Kc]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(b=t.relatedTarget||t.toElement,h=c,b=b?zh(b):null,b!==null&&(w=Ap(b),b!==w||b.tag!==5&&b.tag!==6)&&(b=null)):(h=null,b=c),h!==b)){if(g=j3,A="onMouseLeave",y="onMouseEnter",x="mouse",(n==="pointerout"||n==="pointerover")&&(g=L3,A="onPointerLeave",y="onPointerEnter",x="pointer"),w=h==null?p:Am(h),S=b==null?p:Am(b),p=new g(A,x+"leave",h,t,u),p.target=w,p.relatedTarget=S,A=null,zh(u)===c&&(g=new g(y,x+"enter",b,t,u),g.target=S,g.relatedTarget=w,A=g),w=A,h&&b)t:{for(g=h,y=b,x=0,S=g;S;S=Gp(S))x++;for(S=0,A=y;A;A=Gp(A))S++;for(;0<x-S;)g=Gp(g),x--;for(;0<S-x;)y=Gp(y),S--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=Gp(g),y=Gp(y)}g=null}else g=null;h!==null&&H3(f,p,h,g,!1),b!==null&&w!==null&&H3(f,w,b,g,!0)}}e:{if(p=c?Am(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var C=zW;else if(M3(p))if(iO)C=VW;else{C=HW;var T=qW}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=WW);if(C&&(C=C(n,c))){rO(f,C,t,u);break e}T&&T(n,p,c),n==="focusout"&&(T=p._wrapperState)&&T.controlled&&p.type==="number"&&$E(p,"number",p.value)}switch(T=c?Am(c):window,n){case"focusin":(M3(T)||T.contentEditable==="true")&&(_m=T,QE=c,u1=null);break;case"focusout":u1=QE=_m=null;break;case"mousedown":ZE=!0;break;case"contextmenu":case"mouseup":case"dragend":ZE=!1,U3(f,t,u);break;case"selectionchange":if(YW)break;case"keydown":case"keyup":U3(f,t,u)}var R;if(x4)e:{switch(n){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else xm?tO(n,t)&&(I="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(I="onCompositionStart");I&&(eO&&t.locale!=="ko"&&(xm||I!=="onCompositionStart"?I==="onCompositionEnd"&&xm&&(R=Z6()):(wd=u,y4="value"in wd?wd.value:wd.textContent,xm=!0)),T=Vx(c,I),0<T.length&&(I=new R3(I,n,null,t,u),f.push({event:I,listeners:T}),R?I.data=R:(R=nO(t),R!==null&&(I.data=R)))),(R=DW?FW(n,t):BW(n,t))&&(c=Vx(c,"onBeforeInput"),0<c.length&&(u=new R3("onBeforeInput","beforeinput",null,t,u),f.push({event:u,listeners:c}),u.data=R))}pO(f,e)})}function L1(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Vx(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=N1(n,t),s!=null&&r.unshift(L1(n,s,i)),s=N1(n,e),s!=null&&r.push(L1(n,s,i))),n=n.return}return r}function Gp(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function H3(n,e,t,r,i){for(var s=e._reactName,a=[];t!==null&&t!==r;){var o=t,l=o.alternate,c=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&c!==null&&(o=c,i?(l=N1(t,s),l!=null&&a.unshift(L1(t,l,o))):i||(l=N1(t,s),l!=null&&a.push(L1(t,l,o)))),t=t.return}a.length!==0&&n.push({event:e,listeners:a})}var ZW=/\r\n?/g,eV=/\u0000|\uFFFD/g;function W3(n){return(typeof n=="string"?n:""+n).replace(ZW,`
38`).replace(eV,"")}function Gw(n,e,t){if(e=W3(e),W3(n)!==e&&t)throw Error(Me(425))}function Gx(){}var eN=null,tN=null;function nN(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var rN=typeof setTimeout=="function"?setTimeout:void 0,tV=typeof clearTimeout=="function"?clearTimeout:void 0,V3=typeof Promise=="function"?Promise:void 0,nV=typeof queueMicrotask=="function"?queueMicrotask:typeof V3<"u"?function(n){return V3.resolve(null).then(n).catch(rV)}:rN;function rV(n){setTimeout(function(){throw n})}function bA(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),T1(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);T1(e)}function Cd(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function G3(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var P0=Math.random().toString(36).slice(2),Sl="__reactFiber$"+P0,I1="__reactProps$"+P0,Kc="__reactContainer$"+P0,iN="__reactEvents$"+P0,iV="__reactListeners$"+P0,sV="__reactHandles$"+P0;function zh(n){var e=n[Sl];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Kc]||t[Sl]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=G3(n);n!==null;){if(t=n[Sl])return t;n=G3(n)}return e}n=t,t=n.parentNode}return null}function Pb(n){return n=n[Sl]||n[Kc],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Am(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Me(33))}function h5(n){return n[I1]||null}var sN=[],Em=-1;function Xd(n){return{current:n}}function qn(n){0>Em||(n.current=sN[Em],sN[Em]=null,Em--)}function In(n,e){Em++,sN[Em]=n.current,n.current=e}var Fd={},Wi=Xd(Fd),Es=Xd(!1),rp=Fd;function c0(n,e){var t=n.type.contextTypes;if(!t)return Fd;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Ns(n){return n=n.childContextTypes,n!=null}function Kx(){qn(Es),qn(Wi)}function K3(n,e,t){if(Wi.current!==Fd)throw Error(Me(168));In(Wi,e),In(Es,t)}function gO(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Me(108,qH(n)||"Unknown",i));return ir({},t,r)}function Yx(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Fd,rp=Wi.current,In(Wi,n),In(Es,Es.current),!0}function Y3(n,e,t){var r=n.stateNode;if(!r)throw Error(Me(169));t?(n=gO(n,e,rp),r.__reactInternalMemoizedMergedChildContext=n,qn(Es),qn(Wi),In(Wi,n)):qn(Es),In(Es,t)}var hc=null,f5=!1,wA=!1;function vO(n){hc===null?hc=[n]:hc.push(n)}function aV(n){f5=!0,vO(n)}function Jd(){if(!wA&&hc!==null){wA=!0;var n=0,e=xn;try{var t=hc;for(xn=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}hc=null,f5=!1}catch(i){throw hc!==null&&(hc=hc.slice(n+1)),z6(p4,Jd),i}finally{xn=e,wA=!1}}return null}var Nm=[],km=0,Xx=null,Jx=0,Aa=[],Ea=0,ip=null,Uc=1,zc="";function Nh(n,e){Nm[km++]=Jx,Nm[km++]=Xx,Xx=n,Jx=e}function yO(n,e,t){Aa[Ea++]=Uc,Aa[Ea++]=zc,Aa[Ea++]=ip,ip=n;var r=Uc;n=zc;var i=32-Co(r)-1;r&=~(1<<i),t+=1;var s=32-Co(e)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Uc=1<<32-Co(e)+i|t<<i|r,zc=s+n}else Uc=1<<s|t<<i|r,zc=n}function S4(n){n.return!==null&&(Nh(n,1),yO(n,1,0))}function A4(n){for(;n===Xx;)Xx=Nm[--km],Nm[km]=null,Jx=Nm[--km],Nm[km]=null;for(;n===ip;)ip=Aa[--Ea],Aa[Ea]=null,zc=Aa[--Ea],Aa[Ea]=null,Uc=Aa[--Ea],Aa[Ea]=null}var na=null,Zs=null,Yn=!1,No=null;function bO(n,e){var t=Pa(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function X3(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,na=n,Zs=Cd(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,na=n,Zs=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=ip!==null?{id:Uc,overflow:zc}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=Pa(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,na=n,Zs=null,!0):!1;default:return!1}}function aN(n){return(n.mode&1)!==0&&(n.flags&128)===0}function oN(n){if(Yn){var e=Zs;if(e){var t=e;if(!X3(n,e)){if(aN(n))throw Error(Me(418));e=Cd(t.nextSibling);var r=na;e&&X3(n,e)?bO(r,t):(n.flags=n.flags&-4097|2,Yn=!1,na=n)}}else{if(aN(n))throw Error(Me(418));n.flags=n.flags&-4097|2,Yn=!1,na=n}}}function J3(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;na=n}function Kw(n){if(n!==na)return!1;if(!Yn)return J3(n),Yn=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!nN(n.type,n.memoizedProps)),e&&(e=Zs)){if(aN(n))throw wO(),Error(Me(418));for(;e;)bO(n,e),e=Cd(e.nextSibling)}if(J3(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Me(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Zs=Cd(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Zs=null}}else Zs=na?Cd(n.stateNode.nextSibling):null;return!0}function wO(){for(var n=Zs;n;)n=Cd(n.nextSibling)}function u0(){Zs=na=null,Yn=!1}function E4(n){No===null?No=[n]:No.push(n)}var oV=nu.ReactCurrentBatchConfig;function Av(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Me(309));var r=t.stateNode}if(!r)throw Error(Me(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},e._stringRef=s,e)}
vendor: 2,628 bytes, line 38
38if(typeof n!="string")throw Error(Me(284));if(!t._owner)throw Error(Me(290,n))}return n}function Yw(n,e){throw n=Object.prototype.toString.call(e),Error(Me(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function Q3(n){var e=n._init;return e(n._payload)}function xO(n){function e(y,x){if(n){var S=y.deletions;S===null?(y.deletions=[x],y.flags|=16):S.push(x)}}function t(y,x){if(!n)return null;for(;x!==null;)e(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=Rd(y,x),y.index=0,y.sibling=null,y}function s(y,x,S){return y.index=S,n?(S=y.alternate,S!==null?(S=S.index,S<x?(y.flags|=2,x):S):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return n&&y.alternate===null&&(y.flags|=2),y}function o(y,x,S,A){return x===null||x.tag!==6?(x=kA(S,y.mode,A),x.return=y,x):(x=i(x,S),x.return=y,x)}function l(y,x,S,A){var C=S.type;return C===wm?u(y,x,S.props.children,A,S.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Iu&&Q3(C)===x.type)?(A=i(x,S.props),A.ref=Av(y,x,S),A.return=y,A):(A=V2(S.type,S.key,S.props,null,y.mode,A),A.ref=Av(y,x,S),A.return=y,A)}function c(y,x,S,A){return x===null||x.tag!==4||x.stateNode.containerInfo!==S.containerInfo||x.stateNode.implementation!==S.implementation?(x=CA(S,y.mode,A),x.return=y,x):(x=i(x,S.children||[]),x.return=y,x)}function u(y,x,S,A,C){return x===null||x.tag!==7?(x=ep(S,y.mode,A,C),x.return=y,x):(x=i(x,S),x.return=y,x)}function f(y,x,S){if(typeof x=="string"&&x!==""||typeof x=="number")return x=kA(""+x,y.mode,S),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Fw:return S=V2(x.type,x.key,x.props,null,y.mode,S),S.ref=Av(y,null,x),S.return=y,S;case bm:return x=CA(x,y.mode,S),x.return=y,x;case Iu:var A=x._init;return f(y,A(x._payload),S)}if(Mv(x)||bv(x))return x=ep(x,y.mode,S,null),x.return=y,x;Yw(y,x)}return null}function p(y,x,S,A){var C=x!==null?x.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return C!==null?null:o(y,x,""+S,A);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Fw:return S.key===C?l(y,x,S,A):null;case bm:return S.key===C?c(y,x,S,A):null;case Iu:return C=S._init,p(y,x,C(S._payload),A)}if(Mv(S)||bv(S))return C!==null?null:u(y,x,S,A,null);Yw(y,S)}return null}function h(y,x,S,A,C){if(typeof A=="string"&&A!==""||typeof A=="number")return y=y.get(S)||null,o(x,y,""+A,C);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case Fw:return y=y.get(A.key===null?S:A.key)||null,l(x,y,A,C);case bm:return y=y.get(A.key===null?S:A.key)||null,c(x,y,A,C);
vendor: 8,988 bytes, line 38
38case Iu:var T=A._init;return h(y,x,S,T(A._payload),C)}if(Mv(A)||bv(A))return y=y.get(S)||null,u(x,y,A,C,null);Yw(x,A)}return null}function b(y,x,S,A){for(var C=null,T=null,R=x,I=x=0,L=null;R!==null&&I<S.length;I++){R.index>I?(L=R,R=null):L=R.sibling;var V=p(y,R,S[I],A);if(V===null){R===null&&(R=L);break}n&&R&&V.alternate===null&&e(y,R),x=s(V,x,I),T===null?C=V:T.sibling=V,T=V,R=L}if(I===S.length)return t(y,R),Yn&&Nh(y,I),C;if(R===null){for(;I<S.length;I++)R=f(y,S[I],A),R!==null&&(x=s(R,x,I),T===null?C=R:T.sibling=R,T=R);return Yn&&Nh(y,I),C}for(R=r(y,R);I<S.length;I++)L=h(R,y,I,S[I],A),L!==null&&(n&&L.alternate!==null&&R.delete(L.key===null?I:L.key),x=s(L,x,I),T===null?C=L:T.sibling=L,T=L);return n&&R.forEach(function(j){return e(y,j)}),Yn&&Nh(y,I),C}function g(y,x,S,A){var C=bv(S);if(typeof C!="function")throw Error(Me(150));if(S=C.call(S),S==null)throw Error(Me(151));for(var T=C=null,R=x,I=x=0,L=null,V=S.next();R!==null&&!V.done;I++,V=S.next()){R.index>I?(L=R,R=null):L=R.sibling;var j=p(y,R,V.value,A);if(j===null){R===null&&(R=L);break}n&&R&&j.alternate===null&&e(y,R),x=s(j,x,I),T===null?C=j:T.sibling=j,T=j,R=L}if(V.done)return t(y,R),Yn&&Nh(y,I),C;if(R===null){for(;!V.done;I++,V=S.next())V=f(y,V.value,A),V!==null&&(x=s(V,x,I),T===null?C=V:T.sibling=V,T=V);return Yn&&Nh(y,I),C}for(R=r(y,R);!V.done;I++,V=S.next())V=h(R,y,I,V.value,A),V!==null&&(n&&V.alternate!==null&&R.delete(V.key===null?I:V.key),x=s(V,x,I),T===null?C=V:T.sibling=V,T=V);return n&&R.forEach(function($){return e(y,$)}),Yn&&Nh(y,I),C}function w(y,x,S,A){if(typeof S=="object"&&S!==null&&S.type===wm&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Fw:e:{for(var C=S.key,T=x;T!==null;){if(T.key===C){if(C=S.type,C===wm){if(T.tag===7){t(y,T.sibling),x=i(T,S.props.children),x.return=y,y=x;break e}}else if(T.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Iu&&Q3(C)===T.type){t(y,T.sibling),x=i(T,S.props),x.ref=Av(y,T,S),x.return=y,y=x;break e}t(y,T);break}else e(y,T);T=T.sibling}S.type===wm?(x=ep(S.props.children,y.mode,A,S.key),x.return=y,y=x):(A=V2(S.type,S.key,S.props,null,y.mode,A),A.ref=Av(y,x,S),A.return=y,y=A)}return a(y);case bm:e:{for(T=S.key;x!==null;){if(x.key===T)if(x.tag===4&&x.stateNode.containerInfo===S.containerInfo&&x.stateNode.implementation===S.implementation){t(y,x.sibling),x=i(x,S.children||[]),x.return=y,y=x;break e}else{t(y,x);break}else e(y,x);x=x.sibling}x=CA(S,y.mode,A),x.return=y,y=x}return a(y);case Iu:return T=S._init,w(y,x,T(S._payload),A)}if(Mv(S))return b(y,x,S,A);if(bv(S))return g(y,x,S,A);Yw(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,x!==null&&x.tag===6?(t(y,x.sibling),x=i(x,S),x.return=y,y=x):(t(y,x),x=kA(S,y.mode,A),x.return=y,y=x),a(y)):t(y,x)}return w}var d0=xO(!0),_O=xO(!1),Qx=Xd(null),Zx=null,Cm=null,N4=null;function k4(){N4=Cm=Zx=null}function C4(n){var e=Qx.current;qn(Qx),n._currentValue=e}function lN(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function Dm(n,e){Zx=n,N4=Cm=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(_s=!0),n.firstContext=null)}function Oa(n){var e=n._currentValue;if(N4!==n)if(n={context:n,memoizedValue:e,next:null},Cm===null){if(Zx===null)throw Error(Me(308));Cm=n,Zx.dependencies={lanes:0,firstContext:n}}else Cm=Cm.next=n;return e}var qh=null;function T4(n){qh===null?qh=[n]:qh.push(n)}function SO(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,T4(e)):(t.next=i.next,i.next=t),e.interleaved=t,Yc(n,r)}function Yc(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Ou=!1;function P4(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AO(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function qc(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Td(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,on&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Yc(n,t)}return i=r.interleaved,i===null?(e.next=e,T4(r)):(e.next=i.next,i.next=e),r.interleaved=e,Yc(n,t)}function $2(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,m4(n,t)}}function Z3(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var a={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=a:s=s.next=a,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function e_(n,e,t,r){var i=n.updateQueue;Ou=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=n.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;a=0,u=c=l=null,o=s;do{var p=o.lane,h=o.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var b=n,g=o;switch(p=e,h=t,g.tag){case 1:if(b=g.payload,typeof b=="function"){f=b.call(h,f,p);break e}f=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,p=typeof b=="function"?b.call(h,f,p):b,p==null)break e;f=ir({},f,p);break e;case 2:Ou=!0}}o.callback!==null&&o.lane!==0&&(n.flags|=64,p=i.effects,p===null?i.effects=[o]:p.push(o))}else h={eventTime:h,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,a|=p;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ap|=a,n.lanes=a,n.memoizedState=f}}function ej(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(Me(191,i));i.call(r)}}}var jb={},jl=Xd(jb),O1=Xd(jb),M1=Xd(jb);function Hh(n){if(n===jb)throw Error(Me(174));return n}function j4(n,e){switch(In(M1,e),In(O1,n),In(jl,jb),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:zE(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=zE(e,n)}qn(jl),In(jl,e)}function h0(){qn(jl),qn(O1),qn(M1)}function EO(n){Hh(M1.current);var e=Hh(jl.current),t=zE(e,n.type);e!==t&&(In(O1,n),In(jl,t))}function R4(n){O1.current===n&&(qn(jl),qn(O1))}var tr=Xd(0);function t_(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var xA=[];function L4(){for(var n=0;n<xA.length;n++)xA[n]._workInProgressVersionPrimary=null;xA.length=0}var U2=nu.ReactCurrentDispatcher,_A=nu.ReactCurrentBatchConfig,sp=0,nr=null,Hr=null,si=null,n_=!1,d1=!1,D1=0,lV=0;function Ci(){throw Error(Me(321))}function I4(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Lo(n[t],e[t]))return!1;return!0}function O4(n,e,t,r,i,s){if(sp=s,nr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,U2.current=n===null||n.memoizedState===null?hV:fV,n=t(r,i),d1){s=0;do{if(d1=!1,D1=0,25<=s)throw Error(Me(301));s+=1,si=Hr=null,e.updateQueue=null,U2.current=pV,n=t(r,i)}while(d1)}if(U2.current=r_,e=Hr!==null&&Hr.next!==null,sp=0,si=Hr=nr=null,n_=!1,e)throw Error(Me(300));return n}function M4(){var n=D1!==0;return D1=0,n}function el(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?nr.memoizedState=si=n:si=si.next=n,si}function Ma(){if(Hr===null){var n=nr.alternate;n=n!==null?n.memoizedState:null}else n=Hr.next;var e=si===null?nr.memoizedState:si.next;if(e!==null)si=e,Hr=n;else{if(n===null)throw Error(Me(310));Hr=n,n={memoizedState:Hr.memoizedState,baseState:Hr.baseState,baseQueue:Hr.baseQueue,queue:Hr.queue,next:null},si===null?nr.memoizedState=si=n:si=si.next=n}return si}
vendor: 4,374 bytes, line 38
38function F1(n,e){return typeof e=="function"?e(n):e}function SA(n){var e=Ma(),t=e.queue;if(t===null)throw Error(Me(311));t.lastRenderedReducer=n;var r=Hr,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,c=s;do{var u=c.lane;if((sp&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:n(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=f,a=r):l=l.next=f,nr.lanes|=u,ap|=u}c=c.next}while(c!==null&&c!==s);l===null?a=r:l.next=o,Lo(r,e.memoizedState)||(_s=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=l,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,nr.lanes|=s,ap|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function AA(n){var e=Ma(),t=e.queue;if(t===null)throw Error(Me(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var a=i=i.next;do s=n(s,a.action),a=a.next;while(a!==i);Lo(s,e.memoizedState)||(_s=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function NO(){}function kO(n,e){var t=nr,r=Ma(),i=e(),s=!Lo(r.memoizedState,i);if(s&&(r.memoizedState=i,_s=!0),r=r.queue,D4(PO.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||si!==null&&si.memoizedState.tag&1){if(t.flags|=2048,B1(9,TO.bind(null,t,r,i,e),void 0,null),oi===null)throw Error(Me(349));sp&30||CO(t,e,i)}return i}function CO(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=nr.updateQueue,e===null?(e={lastEffect:null,stores:null},nr.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function TO(n,e,t,r){e.value=t,e.getSnapshot=r,jO(e)&&RO(n)}function PO(n,e,t){return t(function(){jO(e)&&RO(n)})}function jO(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Lo(n,t)}catch{return!0}}function RO(n){var e=Yc(n,1);e!==null&&To(e,n,1,-1)}function tj(n){var e=el();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:F1,lastRenderedState:n},e.queue=n,n=n.dispatch=dV.bind(null,nr,n),[e.memoizedState,n]}function B1(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=nr.updateQueue,e===null?(e={lastEffect:null,stores:null},nr.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function LO(){return Ma().memoizedState}function z2(n,e,t,r){var i=el();nr.flags|=n,i.memoizedState=B1(1|e,t,void 0,r===void 0?null:r)}function p5(n,e,t,r){var i=Ma();r=r===void 0?null:r;var s=void 0;if(Hr!==null){var a=Hr.memoizedState;if(s=a.destroy,r!==null&&I4(r,a.deps)){i.memoizedState=B1(e,t,s,r);return}}nr.flags|=n,i.memoizedState=B1(1|e,t,s,r)}function nj(n,e){return z2(8390656,8,n,e)}function D4(n,e){return p5(2048,8,n,e)}function IO(n,e){return p5(4,2,n,e)}function OO(n,e){return p5(4,4,n,e)}function MO(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function DO(n,e,t){return t=t!=null?t.concat([n]):null,p5(4,4,MO.bind(null,e,n),t)}function F4(){}function FO(n,e){var t=Ma();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&I4(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function BO(n,e){var t=Ma();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&I4(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function $O(n,e,t){return sp&21?(Lo(t,e)||(t=W6(),nr.lanes|=t,ap|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,_s=!0),n.memoizedState=t)}function cV(n,e){var t=xn;xn=t!==0&&4>t?t:4,n(!0);var r=_A.transition;_A.transition={};try{n(!1),e()}finally{xn=t,_A.transition=r}}function UO(){return Ma().memoizedState}function uV(n,e,t){var r=jd(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},zO(n))qO(e,t);else if(t=SO(n,e,t,r),t!==null){var i=rs();To(t,n,r,i),HO(t,e,r)}}function dV(n,e,t){var r=jd(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(zO(n))qO(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,t);
vendor: 10,240 bytes, lines 38-40
38if(i.hasEagerState=!0,i.eagerState=o,Lo(o,a)){var l=e.interleaved;l===null?(i.next=i,T4(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}t=SO(n,e,i,r),t!==null&&(i=rs(),To(t,n,r,i),HO(t,e,r))}}function zO(n){var e=n.alternate;return n===nr||e!==null&&e===nr}function qO(n,e){d1=n_=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function HO(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,m4(n,t)}}var r_={readContext:Oa,useCallback:Ci,useContext:Ci,useEffect:Ci,useImperativeHandle:Ci,useInsertionEffect:Ci,useLayoutEffect:Ci,useMemo:Ci,useReducer:Ci,useRef:Ci,useState:Ci,useDebugValue:Ci,useDeferredValue:Ci,useTransition:Ci,useMutableSource:Ci,useSyncExternalStore:Ci,useId:Ci,unstable_isNewReconciler:!1},hV={readContext:Oa,useCallback:function(n,e){return el().memoizedState=[n,e===void 0?null:e],n},useContext:Oa,useEffect:nj,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,z2(4194308,4,MO.bind(null,e,n),t)},useLayoutEffect:function(n,e){return z2(4194308,4,n,e)},useInsertionEffect:function(n,e){return z2(4,2,n,e)},useMemo:function(n,e){var t=el();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=el();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=uV.bind(null,nr,n),[r.memoizedState,n]},useRef:function(n){var e=el();return n={current:n},e.memoizedState=n},useState:tj,useDebugValue:F4,useDeferredValue:function(n){return el().memoizedState=n},useTransition:function(){var n=tj(!1),e=n[0];return n=cV.bind(null,n[1]),el().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=nr,i=el();if(Yn){if(t===void 0)throw Error(Me(407));t=t()}else{if(t=e(),oi===null)throw Error(Me(349));sp&30||CO(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,nj(PO.bind(null,r,s,n),[n]),r.flags|=2048,B1(9,TO.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=el(),e=oi.identifierPrefix;if(Yn){var t=zc,r=Uc;t=(r&~(1<<32-Co(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=D1++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=lV++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},fV={readContext:Oa,useCallback:FO,useContext:Oa,useEffect:D4,useImperativeHandle:DO,useInsertionEffect:IO,useLayoutEffect:OO,useMemo:BO,useReducer:SA,useRef:LO,useState:function(){return SA(F1)},useDebugValue:F4,useDeferredValue:function(n){var e=Ma();return $O(e,Hr.memoizedState,n)},useTransition:function(){var n=SA(F1)[0],e=Ma().memoizedState;return[n,e]},useMutableSource:NO,useSyncExternalStore:kO,useId:UO,unstable_isNewReconciler:!1},pV={readContext:Oa,useCallback:FO,useContext:Oa,useEffect:D4,useImperativeHandle:DO,useInsertionEffect:IO,useLayoutEffect:OO,useMemo:BO,useReducer:AA,useRef:LO,useState:function(){return AA(F1)},useDebugValue:F4,useDeferredValue:function(n){var e=Ma();return Hr===null?e.memoizedState=n:$O(e,Hr.memoizedState,n)},useTransition:function(){var n=AA(F1)[0],e=Ma().memoizedState;return[n,e]},useMutableSource:NO,useSyncExternalStore:kO,useId:UO,unstable_isNewReconciler:!1};function io(n,e){if(n&&n.defaultProps){e=ir({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}function cN(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:ir({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var m5={isMounted:function(n){return(n=n._reactInternals)?Ap(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=rs(),i=jd(n),s=qc(r,i);s.payload=e,t!=null&&(s.callback=t),e=Td(n,s,i),e!==null&&(To(e,n,i,r),$2(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=rs(),i=jd(n),s=qc(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Td(n,s,i),e!==null&&(To(e,n,i,r),$2(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=rs(),r=jd(n),i=qc(t,r);i.tag=2,e!=null&&(i.callback=e),e=Td(n,i,r),e!==null&&(To(e,n,r,t),$2(e,n,r))}};function rj(n,e,t,r,i,s,a){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,a):e.prototype&&e.prototype.isPureReactComponent?!j1(t,r)||!j1(i,s):!0}function WO(n,e,t){var r=!1,i=Fd,s=e.contextType;return typeof s=="object"&&s!==null?s=Oa(s):(i=Ns(e)?rp:Wi.current,r=e.contextTypes,s=(r=r!=null)?c0(n,i):Fd),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=m5,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function ij(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&m5.enqueueReplaceState(e,e.state,null)}function uN(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs={},P4(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Oa(s):(s=Ns(e)?rp:Wi.current,i.context=c0(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(cN(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&m5.enqueueReplaceState(i,i.state,null),e_(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function f0(n,e){try{var t="",r=e;do t+=zH(r),r=r.return;while(r);var i=t}catch(s){i=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:n,source:e,stack:i,digest:null}}function EA(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function dN(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var mV=typeof WeakMap=="function"?WeakMap:Map;function VO(n,e,t){t=qc(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){s_||(s_=!0,xN=r),dN(n,e)},t}function GO(n,e,t){t=qc(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){dN(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){dN(n,e),typeof r!="function"&&(Pd===null?Pd=new Set([this]):Pd.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),t}function sj(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new mV;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=TV.bind(null,n,e,t),e.then(n,n))}function aj(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function oj(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=qc(-1,1),e.tag=2,Td(t,e,1))),t.lanes|=1),n)}var gV=nu.ReactCurrentOwner,_s=!1;function Zi(n,e,t,r){e.child=n===null?_O(e,null,t,r):d0(e,n.child,t,r)}function lj(n,e,t,r,i){t=t.render;var s=e.ref;return Dm(e,i),r=O4(n,e,t,r,s,i),t=M4(),n!==null&&!_s?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Xc(n,e,i)):(Yn&&t&&S4(e),e.flags|=1,Zi(n,e,r,i),e.child)}function cj(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!V4(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,KO(n,e,s,r,i)):(n=V2(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var a=s.memoizedProps;if(t=t.compare,t=t!==null?t:j1,t(a,r)&&n.ref===e.ref)return Xc(n,e,i)}return e.flags|=1,n=Rd(s,r),n.ref=e.ref,n.return=e,e.child=n}function KO(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(j1(s,r)&&n.ref===e.ref)if(_s=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(_s=!0);else return e.lanes=n.lanes,Xc(n,e,i)}return hN(n,e,t,r,i)}function YO(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},In(Pm,Ys),Ys|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,In(Pm,Ys),Ys|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,In(Pm,Ys),Ys|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,In(Pm,Ys),Ys|=r;return Zi(n,e,i,t),e.child}function XO(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function hN(n,e,t,r,i){var s=Ns(t)?rp:Wi.current;return s=c0(e,s),Dm(e,i),t=O4(n,e,t,r,s,i),r=M4(),n!==null&&!_s?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Xc(n,e,i)):(Yn&&r&&S4(e),e.flags|=1,Zi(n,e,t,i),e.child)}function uj(n,e,t,r,i){if(Ns(t)){var s=!0;Yx(e)}else s=!1;if(Dm(e,i),e.stateNode===null)q2(n,e),WO(e,t,r),uN(e,t,r,i),r=!0;else if(n===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=t.contextType;typeof c=="object"&&c!==null?c=Oa(c):(c=Ns(t)?rp:Wi.current,c=c0(e,c));var u=t.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&ij(e,a,r,c),Ou=!1;var p=e.memoizedState;a.state=p,e_(e,r,a,i),l=e.memoizedState,o!==r||p!==l||Es.current||Ou?(typeof u=="function"&&(cN(e,t,u,r),l=e.memoizedState),(o=Ou||rj(e,t,o,r,p,l,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.
vendor: 7,169 bytes, line 40
40context=c,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,AO(n,e),o=e.memoizedProps,c=e.type===e.elementType?o:io(e.type,o),a.props=c,f=e.pendingProps,p=a.context,l=t.contextType,typeof l=="object"&&l!==null?l=Oa(l):(l=Ns(t)?rp:Wi.current,l=c0(e,l));var h=t.getDerivedStateFromProps;(u=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||p!==l)&&ij(e,a,r,l),Ou=!1,p=e.memoizedState,a.state=p,e_(e,r,a,i);var b=e.memoizedState;o!==f||p!==b||Es.current||Ou?(typeof h=="function"&&(cN(e,t,h,r),b=e.memoizedState),(c=Ou||rj(e,t,c,r,p,b,l)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=b),a.props=r,a.state=b,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),r=!1)}return fN(n,e,t,r,s,i)}function fN(n,e,t,r,i,s){XO(n,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&Y3(e,t,!1),Xc(n,e,s);r=e.stateNode,gV.current=e;var o=a&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&a?(e.child=d0(e,n.child,null,s),e.child=d0(e,null,o,s)):Zi(n,e,o,s),e.memoizedState=r.state,i&&Y3(e,t,!0),e.child}function JO(n){var e=n.stateNode;e.pendingContext?K3(n,e.pendingContext,e.pendingContext!==e.context):e.context&&K3(n,e.context,!1),j4(n,e.containerInfo)}function dj(n,e,t,r,i){return u0(),E4(i),e.flags|=256,Zi(n,e,t,r),e.child}var pN={dehydrated:null,treeContext:null,retryLane:0};function mN(n){return{baseLanes:n,cachePool:null,transitions:null}}function QO(n,e,t){var r=e.pendingProps,i=tr.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=n!==null&&n.memoizedState===null?!1:(i&2)!==0),o?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),In(tr,i&1),n===null)return oN(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,n=r.fallback,s?(r=e.mode,s=e.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=y5(a,r,0,null),n=ep(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=mN(t),e.memoizedState=pN,n):B4(e,a));if(i=n.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return vV(n,e,a,r,o,i,t);if(s){s=r.fallback,a=e.mode,i=n.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Rd(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=Rd(o,s):(s=ep(s,a,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,a=n.child.memoizedState,a=a===null?mN(t):{baseLanes:a.baseLanes|t,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=n.childLanes&~t,e.memoizedState=pN,r}return s=n.child,n=s.sibling,r=Rd(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function B4(n,e){return e=y5({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Xw(n,e,t,r){return r!==null&&E4(r),d0(e,n.child,null,t),n=B4(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function vV(n,e,t,r,i,s,a){if(t)return e.flags&256?(e.flags&=-257,r=EA(Error(Me(422))),Xw(n,e,a,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=y5({mode:"visible",children:r.children},i,0,null),s=ep(s,i,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&d0(e,n.child,null,a),e.child.memoizedState=mN(a),e.memoizedState=pN,s);if(!(e.mode&1))return Xw(n,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(Me(419)),r=EA(s,r,void 0),Xw(n,e,a,r)}if(o=(a&n.childLanes)!==0,_s||o){if(r=oi,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Yc(n,i),To(r,n,i,-1))}return W4(),r=EA(Error(Me(421))),Xw(n,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=PV.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Zs=Cd(i.nextSibling),na=e,Yn=!0,No=null,n!==null&&(Aa[Ea++]=Uc,Aa[Ea++]=zc,Aa[Ea++]=ip,Uc=n.id,zc=n.overflow,ip=e),e=B4(e,r.children),e.flags|=4096,e)}function hj(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),lN(n.return,e,t)}function NA(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function ZO(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Zi(n,e,r.children,t),r=tr.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&hj(n,t,e);else if(n.tag===19)hj(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(In(tr,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&t_(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),NA(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&t_(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}NA(e,!0,t,null,s);break;case"together":NA(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function q2(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Xc(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ap|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Me(153));if(e.child!==null){for(n=e.child,t=Rd(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Rd(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function yV(n,e,t){switch(e.tag){case 3:JO(e),u0();break;case 5:EO(e);break;case 1:Ns(e.type)&&Yx(e);break;case 4:j4(e,e.stateNode.containerInfo);break;
vendor: 4,089 bytes, line 40
40case 10:var r=e.type._context,i=e.memoizedProps.value;In(Qx,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(In(tr,tr.current&1),e.flags|=128,null):t&e.child.childLanes?QO(n,e,t):(In(tr,tr.current&1),n=Xc(n,e,t),n!==null?n.sibling:null);In(tr,tr.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return ZO(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),In(tr,tr.current),r)break;return null;case 22:case 23:return e.lanes=0,YO(n,e,t)}return Xc(n,e,t)}var eM,gN,tM,nM;eM=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};gN=function(){};tM=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Hh(jl.current);var s=null;switch(t){case"input":i=FE(n,i),r=FE(n,r),s=[];break;case"select":i=ir({},i,{value:void 0}),r=ir({},r,{value:void 0}),s=[];break;case"textarea":i=UE(n,i),r=UE(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=Gx)}qE(t,r);var a;t=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(t||(t={}),t[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(A1.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(t||(t={}),t[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(t||(t={}),t[a]=l[a])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(A1.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Bn("scroll",n),s||o===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};nM=function(n,e,t,r){t!==r&&(e.flags|=4)};function Ev(n,e){if(!Yn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Ti(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function bV(n,e,t){var r=e.pendingProps;switch(A4(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ti(e),null;case 1:return Ns(e.type)&&Kx(),Ti(e),null;case 3:return r=e.stateNode,h0(),qn(Es),qn(Wi),L4(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(Kw(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,No!==null&&(AN(No),No=null))),gN(n,e),Ti(e),null;case 5:R4(e);var i=Hh(M1.current);if(t=e.type,n!==null&&e.stateNode!=null)tM(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Me(166));return Ti(e),null}if(n=Hh(jl.current),Kw(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[Sl]=e,r[I1]=s,n=(e.mode&1)!==0,t){case"dialog":Bn("cancel",r),Bn("close",r);break;case"iframe":case"object":case"embed":Bn("load",r);break;case"video":case"audio":for(i=0;i<Fv.length;i++)Bn(Fv[i],r);break;case"source":Bn("error",r);break;
vendor: 29,163 bytes, line 40
40case"img":case"image":case"link":Bn("error",r),Bn("load",r);break;case"details":Bn("toggle",r);break;case"input":x3(r,s),Bn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Bn("invalid",r);break;case"textarea":S3(r,s),Bn("invalid",r)}qE(t,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&Gw(r.textContent,o,n),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&Gw(r.textContent,o,n),i=["children",""+o]):A1.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Bn("scroll",r)}switch(t){case"input":Bw(r),_3(r,s,!0);break;case"textarea":Bw(r),A3(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Gx)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=P6(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=a.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=a.createElement(t,{is:r.is}):(n=a.createElement(t),t==="select"&&(a=n,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):n=a.createElementNS(n,t),n[Sl]=e,n[I1]=r,eM(n,e,!1,!1),e.stateNode=n;e:{switch(a=HE(t,r),t){case"dialog":Bn("cancel",n),Bn("close",n),i=r;break;case"iframe":case"object":case"embed":Bn("load",n),i=r;break;case"video":case"audio":for(i=0;i<Fv.length;i++)Bn(Fv[i],n);i=r;break;case"source":Bn("error",n),i=r;break;case"img":case"image":case"link":Bn("error",n),Bn("load",n),i=r;break;case"details":Bn("toggle",n),i=r;break;case"input":x3(n,r),i=FE(n,r),Bn("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=ir({},r,{value:void 0}),Bn("invalid",n);break;case"textarea":S3(n,r),i=UE(n,r),Bn("invalid",n);break;default:i=r}qE(t,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?L6(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&j6(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&E1(n,l):typeof l=="number"&&E1(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(A1.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Bn("scroll",n):l!=null&&c4(n,s,l,a))}switch(t){case"input":Bw(n),_3(n,r,!1);break;case"textarea":Bw(n),A3(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Dd(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?Lm(n,!!r.multiple,s,!1):r.defaultValue!=null&&Lm(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=Gx)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ti(e),null;case 6:if(n&&e.stateNode!=null)nM(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Me(166));if(t=Hh(M1.current),Hh(jl.current),Kw(e)){if(r=e.stateNode,t=e.memoizedProps,r[Sl]=e,(s=r.nodeValue!==t)&&(n=na,n!==null))switch(n.tag){case 3:Gw(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Gw(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[Sl]=e,e.stateNode=r}return Ti(e),null;case 13:if(qn(tr),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Yn&&Zs!==null&&e.mode&1&&!(e.flags&128))wO(),u0(),e.flags|=98560,s=!1;else if(s=Kw(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(Me(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Me(317));s[Sl]=e}else u0(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ti(e),s=!1}else No!==null&&(AN(No),No=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||tr.current&1?Vr===0&&(Vr=3):W4())),e.updateQueue!==null&&(e.flags|=4),Ti(e),null);case 4:return h0(),gN(n,e),n===null&&R1(e.stateNode.containerInfo),Ti(e),null;case 10:return C4(e.type._context),Ti(e),null;case 17:return Ns(e.type)&&Kx(),Ti(e),null;case 19:if(qn(tr),s=e.memoizedState,s===null)return Ti(e),null;if(r=(e.flags&128)!==0,a=s.rendering,a===null)if(r)Ev(s,!1);else{if(Vr!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(a=t_(n),a!==null){for(e.flags|=128,Ev(s,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,n=a.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return In(tr,tr.current&1|2),e.child}n=n.sibling}s.tail!==null&&wr()>p0&&(e.flags|=128,r=!0,Ev(s,!1),e.lanes=4194304)}else{if(!r)if(n=t_(a),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ev(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Yn)return Ti(e),null}else 2*wr()-s.renderingStartTime>p0&&t!==1073741824&&(e.flags|=128,r=!0,Ev(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(t=s.last,t!==null?t.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=wr(),e.sibling=null,t=tr.current,In(tr,r?t&1|2:t&1),e):(Ti(e),null);case 22:case 23:return H4(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ys&1073741824&&(Ti(e),e.subtreeFlags&6&&(e.flags|=8192)):Ti(e),null;case 24:return null;case 25:return null}throw Error(Me(156,e.tag))}function wV(n,e){switch(A4(e),e.tag){case 1:return Ns(e.type)&&Kx(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return h0(),qn(Es),qn(Wi),L4(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return R4(e),null;case 13:if(qn(tr),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Me(340));u0()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return qn(tr),null;case 4:return h0(),null;case 10:return C4(e.type._context),null;case 22:case 23:return H4(),null;case 24:return null;default:return null}}var Jw=!1,Ui=!1,xV=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function Tm(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){fr(n,e,r)}else t.current=null}function vN(n,e,t){try{t()}catch(r){fr(n,e,r)}}var fj=!1;function _V(n,e){if(eN=Hx,n=oO(),_4(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var a=0,o=-1,l=-1,c=0,u=0,f=n,p=null;t:for(;;){for(var h;f!==t||i!==0&&f.nodeType!==3||(o=a+i),f!==s||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===n)break t;if(p===t&&++c===i&&(o=a),p===s&&++u===r&&(l=a),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}t=o===-1||l===-1?null:{start:o,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(tN={focusedElem:n,selectionRange:t},Hx=!1,Ge=e;Ge!==null;)if(e=Ge,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ge=n;else for(;Ge!==null;){e=Ge;try{var b=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,w=b.memoizedState,y=e.stateNode,x=y.getSnapshotBeforeUpdate(e.elementType===e.type?g:io(e.type,g),w);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(A){fr(e,e.return,A)}if(n=e.sibling,n!==null){n.return=e.return,Ge=n;break}Ge=e.return}return b=fj,fj=!1,b}function h1(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&vN(e,t,s)}i=i.next}while(i!==r)}}function g5(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function yN(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function rM(n){var e=n.alternate;e!==null&&(n.alternate=null,rM(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Sl],delete e[I1],delete e[iN],delete e[iV],delete e[sV])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function iM(n){return n.tag===5||n.tag===3||n.tag===4}function pj(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||iM(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function bN(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Gx));else if(r!==4&&(n=n.child,n!==null))for(bN(n,e,t),n=n.sibling;n!==null;)bN(n,e,t),n=n.sibling}function wN(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(wN(n,e,t),n=n.sibling;n!==null;)wN(n,e,t),n=n.sibling}var _i=null,Ao=!1;function Au(n,e,t){for(t=t.child;t!==null;)sM(n,e,t),t=t.sibling}function sM(n,e,t){if(Pl&&typeof Pl.onCommitFiberUnmount=="function")try{Pl.onCommitFiberUnmount(l5,t)}catch{}switch(t.tag){case 5:Ui||Tm(t,e);case 6:var r=_i,i=Ao;_i=null,Au(n,e,t),_i=r,Ao=i,_i!==null&&(Ao?(n=_i,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):_i.removeChild(t.stateNode));break;case 18:_i!==null&&(Ao?(n=_i,t=t.stateNode,n.nodeType===8?bA(n.parentNode,t):n.nodeType===1&&bA(n,t),T1(n)):bA(_i,t.stateNode));break;case 4:r=_i,i=Ao,_i=t.stateNode.containerInfo,Ao=!0,Au(n,e,t),_i=r,Ao=i;break;case 0:case 11:case 14:case 15:if(!Ui&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&vN(t,e,a),i=i.next}while(i!==r)}Au(n,e,t);break;case 1:if(!Ui&&(Tm(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(o){fr(t,e,o)}Au(n,e,t);break;case 21:Au(n,e,t);break;case 22:t.mode&1?(Ui=(r=Ui)||t.memoizedState!==null,Au(n,e,t),Ui=r):Au(n,e,t);break;default:Au(n,e,t)}}function mj(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new xV),e.forEach(function(r){var i=jV.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Ja(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:_i=o.stateNode,Ao=!1;break e;case 3:_i=o.stateNode.containerInfo,Ao=!0;break e;case 4:_i=o.stateNode.containerInfo,Ao=!0;break e}o=o.return}if(_i===null)throw Error(Me(160));sM(s,a,i),_i=null,Ao=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){fr(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)aM(e,n),e=e.sibling}function aM(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Ja(e,n),Xo(n),r&4){try{h1(3,n,n.return),g5(3,n)}catch(g){fr(n,n.return,g)}try{h1(5,n,n.return)}catch(g){fr(n,n.return,g)}}break;case 1:Ja(e,n),Xo(n),r&512&&t!==null&&Tm(t,t.return);break;case 5:if(Ja(e,n),Xo(n),r&512&&t!==null&&Tm(t,t.return),n.flags&32){var i=n.stateNode;try{E1(i,"")}catch(g){fr(n,n.return,g)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,a=t!==null?t.memoizedProps:s,o=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&C6(i,s),HE(o,a);var c=HE(o,s);for(a=0;a<l.length;a+=2){var u=l[a],f=l[a+1];u==="style"?L6(i,f):u==="dangerouslySetInnerHTML"?j6(i,f):u==="children"?E1(i,f):c4(i,u,f,c)}switch(o){case"input":BE(i,s);break;case"textarea":T6(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Lm(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?Lm(i,!!s.multiple,s.defaultValue,!0):Lm(i,!!s.multiple,s.multiple?[]:"",!1))}i[I1]=s}catch(g){fr(n,n.return,g)}}break;case 6:if(Ja(e,n),Xo(n),r&4){if(n.stateNode===null)throw Error(Me(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(g){fr(n,n.return,g)}}break;case 3:if(Ja(e,n),Xo(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{T1(e.containerInfo)}catch(g){fr(n,n.return,g)}break;case 4:Ja(e,n),Xo(n);break;case 13:Ja(e,n),Xo(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(z4=wr())),r&4&&mj(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Ui=(c=Ui)||u,Ja(e,n),Ui=c):Ja(e,n),Xo(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(Ge=n,u=n.child;u!==null;){for(f=Ge=u;Ge!==null;){switch(p=Ge,h=p.child,p.tag){case 0:case 11:case 14:case 15:h1(4,p,p.return);break;case 1:Tm(p,p.return);var b=p.stateNode;if(typeof b.componentWillUnmount=="function"){r=p,t=p.return;try{e=r,b.props=e.memoizedProps,b.state=e.memoizedState,b.componentWillUnmount()}catch(g){fr(r,t,g)}}break;case 5:Tm(p,p.return);break;case 22:if(p.memoizedState!==null){vj(f);continue}}h!==null?(h.return=p,Ge=h):vj(f)}u=u.sibling}e:for(u=null,f=n;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=f.stateNode,l=f.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=R6("display",a))}catch(g){fr(n,n.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){fr(n,n.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===n)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===n)break e;for(;f.sibling===null;){if(f.return===null||f.return===n)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ja(e,n),Xo(n),r&4&&mj(n);break;case 21:break;default:Ja(e,n),Xo(n)}}function Xo(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(iM(t)){var r=t;break e}t=t.return}throw Error(Me(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(E1(i,""),r.flags&=-33);var s=pj(n);wN(n,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=pj(n);bN(n,o,a);break;default:throw Error(Me(161))}}catch(l){fr(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function SV(n,e,t){Ge=n,oM(n)}function oM(n,e,t){for(var r=(n.mode&1)!==0;Ge!==null;){var i=Ge,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Jw;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Ui;o=Jw;var c=Ui;if(Jw=a,(Ui=l)&&!c)for(Ge=i;Ge!==null;)a=Ge,l=a.child,a.tag===22&&a.memoizedState!==null?yj(i):l!==null?(l.return=a,Ge=l):yj(i);for(;s!==null;)Ge=s,oM(s),s=s.sibling;Ge=i,Jw=o,Ui=c}gj(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Ge=s):gj(n)}}function gj(n){for(;Ge!==null;){var e=Ge;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ui||g5(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Ui)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:io(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&ej(e,s,r);break;case 3:var a=e.updateQueue;if(a!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}ej(e,a,t)}break;case 5:var o=e.stateNode;if(t===null&&e.flags&4){t=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&T1(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Me(163))}Ui||e.flags&512&&yN(e)}catch(p){fr(e,e.return,p)}}if(e===n){Ge=null;break}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function vj(n){for(;Ge!==null;){var e=Ge;if(e===n){Ge=null;break}var t=e.sibling;if(t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function yj(n){for(;Ge!==null;){var e=Ge;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{g5(4,e)}catch(l){fr(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){fr(e,i,l)}}var s=e.return;try{yN(e)}catch(l){fr(e,s,l)}break;case 5:var a=e.return;try{yN(e)}catch(l){fr(e,a,l)}}}catch(l){fr(e,e.return,l)}if(e===n){Ge=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Ge=o;break}Ge=e.return}}var AV=Math.ceil,i_=nu.ReactCurrentDispatcher,$4=nu.ReactCurrentOwner,ja=nu.ReactCurrentBatchConfig,on=0,oi=null,Rr=null,Ai=0,Ys=0,Pm=Xd(0),Vr=0,$1=null,ap=0,v5=0,U4=0,f1=null,ws=null,z4=0,p0=1/0,cc=null,s_=!1,xN=null,Pd=null,Qw=!1,xd=null,a_=0,p1=0,_N=null,H2=-1,W2=0;function rs(){return on&6?wr():H2!==-1?H2:H2=wr()}function jd(n){return n.mode&1?on&2&&Ai!==0?Ai&-Ai:oV.transition!==null?(W2===0&&(W2=W6()),W2):(n=xn,n!==0||(n=window.event,n=n===void 0?16:Q6(n.type)),n):1}function To(n,e,t,r){if(50<p1)throw p1=0,_N=null,Error(Me(185));Cb(n,t,r),(!(on&2)||n!==oi)&&(n===oi&&(!(on&2)&&(v5|=t),Vr===4&&Du(n,Ai)),ks(n,r),t===1&&on===0&&!(e.mode&1)&&(p0=wr()+500,f5&&Jd()))}function ks(n,e){var t=n.callbackNode;oW(n,e);var r=qx(n,n===oi?Ai:0);if(r===0)t!==null&&k3(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&k3(t),e===1)n.tag===0?aV(bj.bind(null,n)):vO(bj.bind(null,n)),nV(function(){!(on&6)&&Jd()}),t=null;else{switch(V6(r)){case 1:t=p4;break;case 4:t=q6;break;case 16:t=zx;break;case 536870912:t=H6;break;default:t=zx}t=mM(t,lM.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function lM(n,e){if(H2=-1,W2=0,on&6)throw Error(Me(327));var t=n.callbackNode;if(Fm()&&n.callbackNode!==t)return null;var r=qx(n,n===oi?Ai:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=o_(n,r);else{e=r;var i=on;on|=2;var s=uM();(oi!==n||Ai!==e)&&(cc=null,p0=wr()+500,Zf(n,e));do try{kV();break}catch(o){cM(n,o)}while(!0);k4(),i_.current=s,on=i,Rr!==null?e=0:(oi=null,Ai=0,e=Vr)}if(e!==0){if(e===2&&(i=YE(n),i!==0&&(r=i,e=SN(n,i))),e===1)throw t=$1,Zf(n,0),Du(n,r),ks(n,wr()),t;if(e===6)Du(n,r);else{if(i=n.current.alternate,!(r&30)&&!EV(i)&&(e=o_(n,r),e===2&&(s=YE(n),s!==0&&(r=s,e=SN(n,s))),e===1))throw t=$1,Zf(n,0),Du(n,r),ks(n,wr()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(Me(345));case 2:kh(n,ws,cc);break;case 3:if(Du(n,r),(r&130023424)===r&&(e=z4+500-wr(),10<e)){if(qx(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){rs(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=rN(kh.bind(null,n,ws,cc),e);break}kh(n,ws,cc);break;case 4:if(Du(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var a=31-Co(r);s=1<<a,a=e[a],a>i&&(i=a),r&=~s}if(r=i,r=wr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*AV(r/1960))-r,10<r){n.timeoutHandle=rN(kh.bind(null,n,ws,cc),r);break}kh(n,ws,cc);break;case 5:kh(n,ws,cc);break;default:throw Error(Me(329))}}}return ks(n,wr()),n.callbackNode===t?lM.bind(null,n):null}function SN(n,e){var t=f1;return n.current.memoizedState.isDehydrated&&(Zf(n,e).flags|=256),n=o_(n,e),n!==2&&(e=ws,ws=t,e!==null&&AN(e)),n}function AN(n){ws===null?ws=n:ws.push.apply(ws,n)}function EV(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!Lo(s(),i))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Du(n,e){for(e&=~U4,e&=~v5,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Co(e),r=1<<t;n[t]=-1,e&=~r}}function bj(n){if(on&6)throw Error(Me(327));Fm();var e=qx(n,0);if(!(e&1))return ks(n,wr()),null;var t=o_(n,e);if(n.tag!==0&&t===2){var r=YE(n);r!==0&&(e=r,t=SN(n,r))}if(t===1)throw t=$1,Zf(n,0),Du(n,e),ks(n,wr()),t;if(t===6)throw Error(Me(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,kh(n,ws,cc),ks(n,wr()),null}function q4(n,e){var t=on;on|=1;try{return n(e)}finally{on=t,on===0&&(p0=wr()+500,f5&&Jd())}}function op(n){xd!==null&&xd.tag===0&&!(on&6)&&Fm();var e=on;on|=1;var t=ja.transition,r=xn;try{if(ja.transition=null,xn=1,n)return n()}finally{xn=r,ja.transition=t,on=e,!(on&6)&&Jd()}}function H4(){Ys=Pm.current,qn(Pm)}function Zf(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,tV(t)),Rr!==null)for(t=Rr.return;t!==null;){var r=t;switch(A4(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Kx();break;case 3:h0(),qn(Es),qn(Wi),L4();break;case 5:R4(r);break;case 4:h0();break;case 13:qn(tr);break;case 19:qn(tr);break;case 10:C4(r.type._context);break;case 22:case 23:H4()}t=t.return}if(oi=n,Rr=n=Rd(n.current,null),Ai=Ys=e,Vr=0,$1=null,U4=v5=ap=0,ws=f1=null,qh!==null){for(e=0;e<qh.length;e++)if(t=qh[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}t.pending=r}qh=null}return n}function cM(n,e){do{var t=Rr;try{if(k4(),U2.current=r_,n_){for(var r=nr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}n_=!1}if(sp=0,si=Hr=nr=null,d1=!1,D1=0,$4.current=null,t===null||t.return===null){Vr=1,$1=e,Rr=null;break}e:{var s=n,a=t.return,o=t,l=e;if(e=Ai,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=o,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=aj(a);if(h!==null){h.flags&=-257,oj(h,a,o,s,e),h.mode&1&&sj(s,c,e),e=h,l=c;var b=e.updateQueue;if(b===null){var g=new Set;g.add(l),e.updateQueue=g}else b.add(l);break e}else{if(!(e&1)){sj(s,c,e),W4();break e}l=Error(Me(426))}}else if(Yn&&o.mode&1){var w=aj(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),oj(w,a,o,s,e),E4(f0(l,o));break e}}s=l=f0(l,o),Vr!==4&&(Vr=2),f1===null?f1=[s]:f1.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var y=VO(s,l,e);Z3(s,y);break e;case 1:o=l;var x=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Pd===null||!Pd.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var A=GO(s,o,e);Z3(s,A);break e}}s=s.return}while(s!==null)}hM(t)}catch(C){e=C,Rr===t&&t!==null&&(Rr=t=t.return);continue}break}while(!0)}function uM(){var n=i_.current;return i_.current=r_,n===null?r_:n}function W4(){(Vr===0||Vr===3||Vr===2)&&(Vr=4),oi===null||!(ap&268435455)&&!(v5&268435455)||Du(oi,Ai)}function o_(n,e){var t=on;on|=2;var r=uM();(oi!==n||Ai!==e)&&(cc=null,Zf(n,e));do try{NV();break}catch(i){cM(n,i)}while(!0);if(k4(),on=t,i_.current=r,Rr!==null)throw Error(Me(261));return oi=null,Ai=0,Vr}function NV(){for(;Rr!==null;)dM(Rr)}function kV(){for(;Rr!==null&&!QH();)dM(Rr)}function dM(n){var e=pM(n.alternate,n,Ys);n.memoizedProps=n.pendingProps,e===null?hM(n):Rr=e,$4.current=null}function hM(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=wV(t,e),t!==null){t.flags&=32767,Rr=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Vr=6,Rr=null;return}}else if(t=bV(t,e,Ys),t!==null){Rr=t;return}if(e=e.sibling,e!==null){Rr=e;return}Rr=e=n}while(e!==null);Vr===0&&(Vr=5)}function kh(n,e,t){var r=xn,i=ja.transition;try{ja.transition=null,xn=1,CV(n,e,t,r)}finally{ja.transition=i,xn=r}return null}function CV(n,e,t,r){do Fm();while(xd!==null);if(on&6)throw Error(Me(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Me(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(lW(n,s),n===oi&&(Rr=oi=null,Ai=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Qw||(Qw=!0,mM(zx,function(){return Fm(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=ja.transition,ja.transition=null;var a=xn;xn=1;var o=on;on|=4,$4.current=null,_V(n,t),aM(t,n),KW(tN),Hx=!!eN,tN=eN=null,n.current=t,SV(t),ZH(),on=o,xn=a,ja.transition=s}else n.current=t;if(Qw&&(Qw=!1,xd=n,a_=i),s=n.pendingLanes,s===0&&(Pd=null),nW(t.stateNode),ks(n,wr()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(s_)throw s_=!1,n=xN,xN=null,n;return a_&1&&n.tag!==0&&Fm(),s=n.pendingLanes,s&1?n===_N?p1++:(p1=0,_N=n):p1=0,Jd(),null}function Fm(){if(xd!==null){var n=V6(a_),e=ja.transition,t=xn;try{if(ja.transition=null,xn=16>n?16:n,xd===null)var r=!1;else{if(n=xd,xd=null,a_=0,on&6)throw Error(Me(331));var i=on;for(on|=4,Ge=n.current;Ge!==null;){var s=Ge,a=s.child;if(Ge.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(Ge=c;Ge!==null;){var u=Ge;switch(u.tag){case 0:case 11:case 15:h1(8,u,s)}var f=u.child;if(f!==null)f.return=u,Ge=f;else for(;Ge!==null;){u=Ge;var p=u.sibling,h=u.return;if(rM(u),u===c){Ge=null;break}if(p!==null){p.return=h,Ge=p;break}Ge=h}}}var b=s.alternate;if(b!==null){var g=b.child;if(g!==null){b.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}Ge=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Ge=a;else e:for(;Ge!==null;){if(s=Ge,s.flags&2048)switch(s.tag){case 0:case 11:case 15:h1(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,Ge=y;break e}Ge=s.return}}var x=n.current;for(Ge=x;Ge!==null;){a=Ge;var S=a.child;if(a.subtreeFlags&2064&&S!==null)S.return=a,Ge=S;else e:for(a=x;Ge!==null;){if(o=Ge,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:g5(9,o)}}catch(C){fr(o,o.return,C)}if(o===a){Ge=null;break e}var A=o.sibling;if(A!==null){A.return=o.return,Ge=A;break e}Ge=o.return}}if(on=i,Jd(),Pl&&typeof Pl.onPostCommitFiberRoot=="function")try{Pl.onPostCommitFiberRoot(l5,n)}catch{}r=!0}return r}finally{xn=t,ja.transition=e}}return!1}function wj(n,e,t){e=f0(t,e),e=VO(n,e,1),n=Td(n,e,1),e=rs(),n!==null&&(Cb(n,1,e),ks(n,e))}function fr(n,e,t){if(n.tag===3)wj(n,n,t);else for(;e!==null;){if(e.tag===3){wj(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Pd===null||!Pd.has(r))){n=f0(t,n),n=GO(e,n,1),e=Td(e,n,1),n=rs(),e!==null&&(Cb(e,1,n),ks(e,n));break}}e=e.return}}function TV(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=rs(),n.pingedLanes|=n.suspendedLanes&t,oi===n&&(Ai&t)===t&&(Vr===4||Vr===3&&(Ai&130023424)===Ai&&500>wr()-z4?Zf(n,0):U4|=t),ks(n,e)}function fM(n,e){e===0&&(n.mode&1?(e=zw,zw<<=1,!(zw&130023424)&&(zw=4194304)):e=1);var t=rs();n=Yc(n,e),n!==null&&(Cb(n,e,t),ks(n,t))}function PV(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),fM(n,t)}function jV(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Me(314))}r!==null&&r.delete(e),fM(n,t)}var pM;pM=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Es.current)_s=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return _s=!1,yV(n,e,t);_s=!!(n.flags&131072)}else _s=!1,Yn&&e.flags&1048576&&yO(e,Jx,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;q2(n,e),n=e.pendingProps;var i=c0(e,Wi.current);Dm(e,t),i=O4(null,e,r,n,i,t);var s=M4();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ns(r)?(s=!0,Yx(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,P4(e),i.updater=m5,e.stateNode=i,i._reactInternals=e,uN(e,r,n,t),e=fN(null,e,r,!0,s,t)):(e.tag=0,Yn&&s&&S4(e),Zi(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(q2(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=LV(r),n=io(r,n),i){case 0:e=hN(null,e,r,n,t);break e;case 1:e=uj(null,e,r,n,t);break e;case 11:e=lj(null,e,r,n,t);break e;case 14:e=cj(null,e,r,io(r.type,n),t);break e}throw Error(Me(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:io(r,
vendor: 7,051 bytes, line 40
40i),hN(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:io(r,i),uj(n,e,r,i,t);case 3:e:{if(JO(e),n===null)throw Error(Me(387));r=e.pendingProps,s=e.memoizedState,i=s.element,AO(n,e),e_(e,r,null,t);var a=e.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=f0(Error(Me(423)),e),e=dj(n,e,r,t,i);break e}else if(r!==i){i=f0(Error(Me(424)),e),e=dj(n,e,r,t,i);break e}else for(Zs=Cd(e.stateNode.containerInfo.firstChild),na=e,Yn=!0,No=null,t=_O(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(u0(),r===i){e=Xc(n,e,t);break e}Zi(n,e,r,t)}e=e.child}return e;case 5:return EO(e),n===null&&oN(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,a=i.children,nN(r,i)?a=null:s!==null&&nN(r,s)&&(e.flags|=32),XO(n,e),Zi(n,e,a,t),e.child;case 6:return n===null&&oN(e),null;case 13:return QO(n,e,t);case 4:return j4(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=d0(e,null,r,t):Zi(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:io(r,i),lj(n,e,r,i,t);case 7:return Zi(n,e,e.pendingProps,t),e.child;case 8:return Zi(n,e,e.pendingProps.children,t),e.child;case 12:return Zi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,In(Qx,r._currentValue),r._currentValue=a,s!==null)if(Lo(s.value,a)){if(s.children===i.children&&!Es.current){e=Xc(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=qc(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),lN(s.return,t,e),o.lanes|=t;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(Me(341));a.lanes|=t,o=a.alternate,o!==null&&(o.lanes|=t),lN(a,t,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Zi(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Dm(e,t),i=Oa(i),r=r(i),e.flags|=1,Zi(n,e,r,t),e.child;case 14:return r=e.type,i=io(r,e.pendingProps),i=io(r.type,i),cj(n,e,r,i,t);case 15:return KO(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:io(r,i),q2(n,e),e.tag=1,Ns(r)?(n=!0,Yx(e)):n=!1,Dm(e,t),WO(e,r,i),uN(e,r,i,t),fN(null,e,r,!0,n,t);case 19:return ZO(n,e,t);case 22:return YO(n,e,t)}throw Error(Me(156,e.tag))};function mM(n,e){return z6(n,e)}function RV(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pa(n,e,t,r){return new RV(n,e,t,r)}function V4(n){return n=n.prototype,!(!n||!n.isReactComponent)}function LV(n){if(typeof n=="function")return V4(n)?1:0;if(n!=null){if(n=n.$$typeof,n===d4)return 11;if(n===h4)return 14}return 2}function Rd(n,e){var t=n.alternate;return t===null?(t=Pa(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function V2(n,e,t,r,i,s){var a=2;if(r=n,typeof n=="function")V4(n)&&(a=1);else if(typeof n=="string")a=5;else e:switch(n){case wm:return ep(t.children,i,s,e);case u4:a=8,i|=8;break;case IE:return n=Pa(12,t,e,i|2),n.elementType=IE,n.lanes=s,n;case OE:return n=Pa(13,t,e,i),n.elementType=OE,n.lanes=s,n;case ME:return n=Pa(19,t,e,i),n.elementType=ME,n.lanes=s,n;case E6:return y5(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case S6:a=10;break e;case A6:a=9;break e;case d4:a=11;break e;case h4:a=14;break e;case Iu:a=16,r=null;break e}throw Error(Me(130,n==null?n:typeof n,""))}return e=Pa(a,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function ep(n,e,t,r){return n=Pa(7,n,r,e),n.lanes=t,n}function y5(n,e,t,r){return n=Pa(22,n,r,e),n.elementType=E6,n.lanes=t,n.stateNode={isHidden:!1},n}function kA(n,e,t){return n=Pa(6,n,null,e),n.lanes=t,n}function CA(n,e,t){return e=Pa(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function IV(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lA(0),this.expirationTimes=lA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lA(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function G4(n,e,t,r,i,s,a,o,l){return n=new IV(n,e,t,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Pa(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},P4(s),n}function OV(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bm,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function gM(n){if(!n)return Fd;n=n._reactInternals;e:{if(Ap(n)!==n||n.tag!==1)throw Error(Me(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ns(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Me(171))}if(n.tag===1){var t=n.type;if(Ns(t))return gO(n,t,e)}return e}function vM(n,e,t,r,i,s,a,o,l){return n=G4(t,r,!0,n,i,s,a,o,l),n.context=gM(null),t=n.current,r=rs(),i=jd(t),s=qc(r,i),s.callback=e??null,Td(t,s,i),n.current.lanes=i,Cb(n,i,r),ks(n,r),n}function b5(n,e,t,r){var i=e.current,s=rs(),a=jd(i);return t=gM(t),e.context===null?e.context=t:e.pendingContext=t,e=qc(s,a),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Td(i,e,a),n!==null&&(To(n,i,a,s),$2(n,i,a)),a}function l_(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function xj(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}
vendor: 5,833 bytes, line 40
40function K4(n,e){xj(n,e),(n=n.alternate)&&xj(n,e)}function MV(){return null}var yM=typeof reportError=="function"?reportError:function(n){console.error(n)};function Y4(n){this._internalRoot=n}w5.prototype.render=Y4.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Me(409));b5(n,e,null,null)};w5.prototype.unmount=Y4.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;op(function(){b5(null,n,null,null)}),e[Kc]=null}};function w5(n){this._internalRoot=n}w5.prototype.unstable_scheduleHydration=function(n){if(n){var e=Y6();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Mu.length&&e!==0&&e<Mu[t].priority;t++);Mu.splice(t,0,n),t===0&&J6(n)}};function X4(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function x5(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function _j(){}function DV(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=l_(a);s.call(c)}}var a=vM(e,r,n,0,null,!1,!1,"",_j);return n._reactRootContainer=a,n[Kc]=a.current,R1(n.nodeType===8?n.parentNode:n),op(),a}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=l_(l);o.call(c)}}var l=G4(n,0,!1,null,null,!1,!1,"",_j);return n._reactRootContainer=l,n[Kc]=l.current,R1(n.nodeType===8?n.parentNode:n),op(function(){b5(e,l,t,r)}),l}function _5(n,e,t,r,i){var s=t._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=l_(a);o.call(l)}}b5(e,a,n,i)}else a=DV(t,e,n,i,r);return l_(a)}G6=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=Dv(e.pendingLanes);t!==0&&(m4(e,t|1),ks(e,wr()),!(on&6)&&(p0=wr()+500,Jd()))}break;case 13:op(function(){var r=Yc(n,1);if(r!==null){var i=rs();To(r,n,1,i)}}),K4(n,1)}};g4=function(n){if(n.tag===13){var e=Yc(n,134217728);if(e!==null){var t=rs();To(e,n,134217728,t)}K4(n,134217728)}};K6=function(n){if(n.tag===13){var e=jd(n),t=Yc(n,e);if(t!==null){var r=rs();To(t,n,e,r)}K4(n,e)}};Y6=function(){return xn};X6=function(n,e){var t=xn;try{return xn=n,e()}finally{xn=t}};VE=function(n,e,t){switch(e){case"input":if(BE(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=h5(r);if(!i)throw Error(Me(90));k6(r),BE(r,i)}}}break;case"textarea":T6(n,t);break;case"select":e=t.value,e!=null&&Lm(n,!!t.multiple,e,!1)}};M6=q4;D6=op;var FV={usingClientEntryPoint:!1,Events:[Pb,Am,h5,I6,O6,q4]},Nv={findFiberByHostInstance:zh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},BV={bundleType:Nv.bundleType,version:Nv.version,rendererPackageName:Nv.rendererPackageName,rendererConfig:Nv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:nu.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=$6(n),n===null?null:n.stateNode},findFiberByHostInstance:Nv.findFiberByHostInstance||MV,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zw.isDisabled&&Zw.supportsFiber)try{l5=Zw.inject(BV),Pl=Zw}catch{}}oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FV;oa.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!X4(e))throw Error(Me(200));return OV(n,e,null,t)};oa.createRoot=function(n,e){if(!X4(n))throw Error(Me(299));var t=!1,r="",i=yM;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=G4(n,1,!1,null,null,t,!1,r,i),n[Kc]=e.current,R1(n.nodeType===8?n.parentNode:n),new Y4(e)};oa.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Me(188)):(n=Object.keys(n).join(","),Error(Me(268,n)));return n=$6(e),n=n===null?null:n.stateNode,n};oa.flushSync=function(n){return op(n)};oa.hydrate=function(n,e,t){if(!x5(e))throw Error(Me(200));return _5(null,n,e,!0,t)};oa.hydrateRoot=function(n,e,t){if(!X4(n))throw Error(Me(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",a=yM;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),e=vM(e,null,n,1,t??null,i,!1,s,a),n[Kc]=e.current,R1(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new w5(e)};oa.render=function(n,e,t){if(!x5(e))throw Error(Me(200));return _5(null,n,e,!1,t)};oa.unmountComponentAtNode=function(n){if(!x5(n))throw Error(Me(40));return n._reactRootContainer?(op(function(){_5(null,null,n,!1,function(){n._reactRootContainer=null,n[Kc]=null})}),!0):!1};oa.unstable_batchedUpdates=q4;oa.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!x5(t))throw Error(Me(200));if(n==null||n._reactInternals===void 0)throw Error(Me(38));return _5(n,e,t,!1,r)};oa.version="18.3.1-next-f1338f8080-20240426";function bM(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bM)}catch(n){console.error(n)}}bM(),b6.exports=oa;var Ep=b6.exports;
40const wM=a5(Ep);var xM,Sj=Ep;xM=Sj.createRoot,Sj.hydrateRoot;const $V=1,UV=1e6;let TA=0;function zV(){return TA=(TA+1)%Number.MAX_SAFE_INTEGER,TA.toString()}const PA=new Map,Aj=n=>{if(PA.has(n))return;const e=setTimeout(()=>{PA.delete(n),m1({type:"REMOVE_TOAST",toastId:n})},UV);PA.set(n,e)},qV=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,$V)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?Aj(t):n.toasts.forEach(r=>{Aj(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},G2=[];let K2={toasts:[]};function m1(n){K2=qV(K2,n),G2.forEach(e=>{e(K2)})}function HV({...n}){const e=zV(),t=i=>m1({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>m1({type:"DISMISS_TOAST",toastId:e});return m1({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:t}}function Qd(){const[n,e]=E.useState(K2);return E.useEffect(()=>(G2.push(e),()=>{const t=G2.indexOf(e);t>-1&&G2.splice(t,1)}),[n]),{...n,toast:HV,dismiss:t=>m1({type:"DISMISS_TOAST",toastId:t})}}function rt(n,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(n==null||n(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Ej(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function _M(...n){return e=>{let t=!1;const r=n.map(i=>{const s=Ej(i,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Ej(n[i],null)}}}}function Xt(...n){return E.useCallback(_M(...n),n)}function WV(n,e){const t=E.createContext(e),r=s=>{const{children:a,...o}=s,l=E.useMemo(()=>o,Object.values(o));return d.jsx(t.Provider,{value:l,children:a})};r.displayName=n+"Provider";function i(s){const a=E.useContext(t);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${n}\``)}return[r,i]}function cs(n,e=[]){let t=[];function r(s,a){const o=E.createContext(a),l=t.length;t=[...t,a];const c=f=>{var y;const{scope:p,children:h,...b}=f,g=((y=p==null?void 0:p[n])==null?void 0:y[l])||o,w=E.useMemo(()=>b,Object.values(b));return d.jsx(g.Provider,{value:w,children:h})};c.displayName=s+"Provider";function u(f,p){var g;const h=((g=p==null?void 0:p[n])==null?void 0:g[l])||o,b=E.useContext(h);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,u]}const i=()=>{const s=t.map(a=>E.createContext(a));return function(o){const l=(o==null?void 0:o[n])||s;return E.useMemo(()=>({[`__scope${n}`]:{...o,[n]:l}}),[o,l])}};return i.scopeName=n,[r,VV(i,...e)]}function VV(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...o,...f}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return t.scopeName=e.scopeName,t}function lp(n){const e=KV(n),t=E.forwardRef((r,i)=>{const{children:s,...a}=r,o=E.Children.toArray(s),l=o.find(YV);if(l){const c=l.props.children,u=o.map(f=>f===l?E.Children.count(c)>1?E.Children.only(null):E.isValidElement(c)?c.props.children:null:f);return d.jsx(e,{...a,ref:i,children:E.isValidElement(c)?E.cloneElement(c,void 0,u):null})}return d.jsx(e,{...a,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}var GV=lp("Slot");function KV(n){const e=E.forwardRef((t,r)=>{const{children:i,...s}=t;if(E.isValidElement(i)){const a=JV(i),o=XV(s,i.props);return i.type!==E.Fragment&&(o.ref=r?_M(r,a):a),E.cloneElement(i,o)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var SM=Symbol("radix.slottable");function AM(n){const e=({children:t})=>d.jsx(d.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=SM,e}function YV(n){return E.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===SM}function XV(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}
vendor: 10,767 bytes, line 40
40:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}function JV(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}function S5(n){const e=n+"CollectionProvider",[t,r]=cs(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:w,children:y}=g,x=Ie.useRef(null),S=Ie.useRef(new Map).current;return d.jsx(i,{scope:w,itemMap:S,collectionRef:x,children:y})};a.displayName=e;const o=n+"CollectionSlot",l=lp(o),c=Ie.forwardRef((g,w)=>{const{scope:y,children:x}=g,S=s(o,y),A=Xt(w,S.collectionRef);return d.jsx(l,{ref:A,children:x})});c.displayName=o;const u=n+"CollectionItemSlot",f="data-radix-collection-item",p=lp(u),h=Ie.forwardRef((g,w)=>{const{scope:y,children:x,...S}=g,A=Ie.useRef(null),C=Xt(w,A),T=s(u,y);return Ie.useEffect(()=>(T.itemMap.set(A,{ref:A,...S}),()=>void T.itemMap.delete(A))),d.jsx(p,{[f]:"",ref:C,children:x})});h.displayName=u;function b(g){const w=s(n+"CollectionConsumer",g);return Ie.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const S=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((T,R)=>S.indexOf(T.ref.current)-S.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:c,ItemSlot:h},b,r]}var QV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yt=QV.reduce((n,e)=>{const t=lp(`Primitive.${e}`),r=E.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...o,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function EM(n,e){n&&Ep.flushSync(()=>n.dispatchEvent(e))}function Da(n){const e=E.useRef(n);return E.useEffect(()=>{e.current=n}),E.useMemo(()=>(...t)=>{var r;return(r=e.current)==null?void 0:r.call(e,...t)},[])}function ZV(n,e=globalThis==null?void 0:globalThis.document){const t=Da(n);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var eG="DismissableLayer",EN="dismissableLayer.update",tG="dismissableLayer.pointerDownOutside",nG="dismissableLayer.focusOutside",Nj,NM=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j0=E.forwardRef((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=n,c=E.useContext(NM),[u,f]=E.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=E.useState({}),b=Xt(e,R=>f(R)),g=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(w),x=u?g.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,A=x>=y,C=iG(R=>{const I=R.target,L=[...c.branches].some(V=>V.contains(I));!A||L||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},p),T=sG(R=>{const I=R.target;[...c.branches].some(V=>V.contains(I))||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},p);return ZV(R=>{x===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},p),E.useEffect(()=>{if(u)return t&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Nj=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),kj(),()=>{t&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Nj)}},[u,p,t,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),kj())},[u,c]),E.useEffect(()=>{const R=()=>h({});return document.addEventListener(EN,R),()=>document.removeEventListener(EN,R)},[]),d.jsx(yt.div,{...l,ref:b,style:{pointerEvents:S?A?"auto":"none":void 0,...n.style},onFocusCapture:rt(n.onFocusCapture,T.onFocusCapture),onBlurCapture:rt(n.onBlurCapture,T.onBlurCapture),onPointerDownCapture:rt(n.onPointerDownCapture,C.onPointerDownCapture)})});j0.displayName=eG;var rG="DismissableLayerBranch",kM=E.forwardRef((n,e)=>{const t=E.useContext(NM),r=E.useRef(null),i=Xt(e,r);return E.useEffect(()=>{const s=r.current;if(s)return t.branches.add(s),()=>{t.branches.delete(s)}},[t.branches]),d.jsx(yt.div,{...n,ref:i})});kM.displayName=rG;function iG(n,e=globalThis==null?void 0:globalThis.document){const t=Da(n),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){CM(tG,t,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function sG(n,e=globalThis==null?void 0:globalThis.document){const t=Da(n),r=E.useRef(!1);return E.useEffect(()=>{const i=s=>{s.target&&!r.current&&CM(nG,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kj(){const n=new CustomEvent(EN);document.dispatchEvent(n)}function CM(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?EM(i,s):i.dispatchEvent(s)}var aG=j0,oG=kM,li=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},lG="Portal",Rb=E.forwardRef((n,e)=>{var o;const{container:t,...r}=n,[i,s]=E.useState(!1);li(()=>s(!0),[]);const a=t||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?wM.createPortal(d.jsx(yt.div,{...r,ref:e}),a):null});Rb.displayName=lG;function cG(n,e){return E.useReducer((t,r)=>e[t][r]??t,n)}var Do=n=>{const{present:e,children:t}=n,r=uG(e),i=typeof t=="function"?t({present:r.isPresent}):E.Children.only(t),s=Xt(r.ref,dG(i));return typeof t=="function"||r.isPresent?E.cloneElement(i,{ref:s}):null};Do.displayName="Presence";function uG(n){const[e,t]=E.useState(),r=E.useRef(null),i=E.useRef(n),s=E.useRef("none"),a=n?"mounted":"unmounted",[o,l]=cG(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=e2(r.current);s.current=o==="mounted"?c:"none"},[o]),li(()=>{const c=r.current,u=i.current;if(u!==n){const p=s.current,h=e2(c);n?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,l]),li(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,f=h=>{const g=e2(r.current).includes(h.animationName);if(h.target===e&&g&&(l("ANIMATION_END"),!i.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},p=h=>{h.target===e&&(s.current=e2(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:E.useCallback(c=>{r.current=c?getComputedStyle(c):null,t(c)},[])}}function e2(n){return(n==null?void 0:n.animationName)||"none"}function dG(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var hG=a4[" useInsertionEffect ".trim().toString()]||li;function Fa({prop:n,defaultProp:e,onChange:t=()=>{},caller:r}){const[i,s,a]=fG({defaultProp:e,onChange:t}),o=n!==void 0,l=o?n:i;{const u=E.useRef(n!==void 0);E.useEffect(()=>{const f=u.current;f!==o&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=o},[o,r])}const c=E.useCallback(u=>{var f;if(o){const p=pG(u)?u(n):u;p!==n&&((f=a.current)==null||f.call(a,p))}else s(u)},[o,n,s,a]);return[l,c]}function fG({defaultProp:n,onChange:e}){const[t,r]=E.useState(n),i=E.useRef(t),s=E.useRef(e);return hG(()=>{s.current=e},[e]),E.useEffect(()=>{var a;i.current!==t&&((a=s.current)==null||a.call(s,t),i.current=t)},[t,i]),[t,r,s]}function pG(n){return typeof n=="function"}var TM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),mG="VisuallyHidden",Lb=E.forwardRef((n,e)=>d.jsx(yt.span,{...n,ref:e,style:{...TM,...n.style}}));Lb.displayName=mG;var gG=Lb,J4="ToastProvider",[Q4,vG,yG]=S5("Toast"),[PM,Dpe]=cs("Toast",[yG]),[bG,A5]=PM(J4),jM=n=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=n,[o,l]=E.useState(null),[c,u]=E.useState(0),f=E.useRef(!1),p=E.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${J4}\`. Expected non-empty \`string\`.`),d.jsx(Q4.Provider,{scope:e,children:d.jsx(bG,{scope:e,label:t,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:o,onViewportChange:l,onToastAdd:E.useCallback(()=>u(h=>h+1),[]),onToastRemove:E.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};jM.displayName=J4;var RM="ToastViewport",wG=["F8"],NN="toast.viewportPause",kN="toast.viewportResume",LM=E.forwardRef((n,e)=>{const{__scopeToast:t,hotkey:r=wG,label:i="Notifications ({hotkey})",...s}=n,a=A5(RM,t),o=vG(t),l=E.useRef(null),c=E.useRef(null),u=E.useRef(null),f=E.useRef(null),p=Xt(e,f,a.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;E.useEffect(()=>{const w=y=>{var S;r.length!==0&&r.every(A=>y[A]||y.code===A)&&((S=f.current)==null||S.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),E.useEffect(()=>{const w=l.current,y=f.current;if(b&&w&&y){const x=()=>
40{if(!a.isClosePausedRef.current){const T=new CustomEvent(NN);y.dispatchEvent(T),a.isClosePausedRef.current=!0}},S=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(kN);y.dispatchEvent(T),a.isClosePausedRef.current=!1}},A=T=>{!w.contains(T.relatedTarget)&&S()},C=()=>{w.contains(document.activeElement)||S()};return w.addEventListener("focusin",x),w.addEventListener("focusout",A),w.addEventListener("pointermove",x),w.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",S),()=>{w.removeEventListener("focusin",x),w.removeEventListener("focusout",A),w.removeEventListener("pointermove",x),w.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",S)}}},[b,a.isClosePausedRef]);const g=E.useCallback(({tabbingDirection:w})=>{const x=o().map(S=>{const A=S.ref.current,C=[A,...LG(A)];return w==="forwards"?C:C.reverse()});return(w==="forwards"?x.reverse():x).flat()},[o]);return E.useEffect(()=>{const w=f.current;if(w){const y=x=>{var C,T,R;const S=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!S){const I=document.activeElement,L=x.shiftKey;if(x.target===w&&L){(C=c.current)==null||C.focus();return}const $=g({tabbingDirection:L?"backwards":"forwards"}),J=$.findIndex(H=>H===I);jA($.slice(J+1))?x.preventDefault():L?(T=c.current)==null||T.focus():(R=u.current)==null||R.focus()}};return w.addEventListener("keydown",y),()=>w.removeEventListener("keydown",y)}},[o,g]),d.jsxs(oG,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&d.jsx(CN,{ref:c,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});jA(w)}}),d.jsx(Q4.Slot,{scope:t,children:d.jsx(yt.ol,{tabIndex:-1,...s,ref:p})}),b&&d.jsx(CN,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});jA(w)}})]})});LM.displayName=RM;var IM="ToastFocusProxy",CN=E.forwardRef((n,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...i}=n,s=A5(IM,t);return d.jsx(Lb,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const o=a.relatedTarget;!((c=s.viewport)!=null&&c.contains(o))&&r()}})});CN.displayName=IM;var Ib="Toast",xG="toast.swipeStart",_G="toast.swipeMove",SG="toast.swipeCancel",AG="toast.swipeEnd",OM=E.forwardRef((n,e)=>{const{forceMount:t,open:r,defaultOpen:i,onOpenChange:s,...a}=n,[o,l]=Fa({prop:r,defaultProp:i??!0,onChange:s,caller:Ib});return d.jsx(Do,{present:t||o,children:d.jsx(kG,{open:o,...a,ref:e,onClose:()=>l(!1),onPause:Da(n.onPause),onResume:Da(n.onResume),onSwipeStart:rt(n.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:rt(n.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:rt(n.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:rt(n.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});OM.displayName=Ib;var[EG,NG]=PM(Ib,{onClose(){}}),kG=E.forwardRef((n,e)=>{const{__scopeToast:t,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:h,...b}=n,g=A5(Ib,t),[w,y]=E.useState(null),x=Xt(e,H=>y(H)),S=E.useRef(null),A=E.useRef(null),C=i||g.duration,T=E.useRef(0),R=E.useRef(C),I=E.useRef(0),{onToastAdd:L,onToastRemove:V}=g,j=Da(()=>{var le;(w==null?void 0:w.contains(document.activeElement))&&((le=g.viewport)==null||le.focus()),a()}),$=E.useCallback(H=>
40{!H||H===1/0||(window.clearTimeout(I.current),T.current=new Date().getTime(),I.current=window.setTimeout(j,H))},[j]);E.useEffect(()=>{const H=g.viewport;if(H){const le=()=>{$(R.current),c==null||c()},oe=()=>{const se=new Date().getTime()-T.current;R.current=R.current-se,window.clearTimeout(I.current),l==null||l()};return H.addEventListener(NN,oe),H.addEventListener(kN,le),()=>{H.removeEventListener(NN,oe),H.removeEventListener(kN,le)}}},[g.viewport,C,l,c,$]),E.useEffect(()=>{s&&!g.isClosePausedRef.current&&$(C)},[s,C,g.isClosePausedRef,$]),E.useEffect(()=>(L(),()=>V()),[L,V]);const J=E.useMemo(()=>w?zM(w):null,[w]);return g.viewport?d.jsxs(d.Fragment,{children:[J&&d.jsx(CG,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:J}),d.jsx(EG,{scope:t,onClose:j,children:Ep.createPortal(d.jsx(Q4.ItemSlot,{scope:t,children:d.jsx(aG,{asChild:!0,onEscapeKeyDown:rt(o,()=>{g.isFocusedToastEscapeKeyDownRef.current||j(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(yt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:x,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:rt(n.onKeyDown,H=>{H.key==="Escape"&&(o==null||o(H.nativeEvent),H.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:rt(n.onPointerDown,H=>{H.button===0&&(S.current={x:H.clientX,y:H.clientY})}),onPointerMove:rt(n.onPointerMove,H=>{if(!S.current)return;const le=H.clientX-S.current.x,oe=H.clientY-S.current.y,se=!!A.current,O=["left","right"].includes(g.swipeDirection),te=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,he=O?te(0,le):0,ge=O?0:te(0,oe),D=H.pointerType==="touch"?10:2,G={x:he,y:ge},ee={originalEvent:H,delta:G};se?(A.current=G,t2(_G,f,ee,{discrete:!1})):Cj(G,g.swipeDirection,D)?(A.current=G,t2(xG,u,ee,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(le)>D||Math.abs(oe)>D)&&(S.current=null)}),onPointerUp:rt(n.onPointerUp,H=>{const le=A.current,oe=H.target;if(oe.hasPointerCapture(H.pointerId)&&oe.releasePointerCapture(H.pointerId),A.current=null,S.current=null,le){const se=H.currentTarget,O={originalEvent:H,delta:le};Cj(le,g.swipeDirection,g.swipeThreshold)?t2(AG,h,O,{discrete:!0}):t2(SG,p,O,{discrete:!0}),se.addEventListener("click",te=>te.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),CG=n=>{const{__scopeToast:e,children:t,...r}=n,i=A5(Ib,e),[s,a]=E.useState(!1),[o,l]=E.useState(!1);return jG(()=>a(!0)),E.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),o?null:d.jsx(Rb,{asChild:!0,children:d.jsx(Lb,{...r,children:s&&d.jsxs(d.Fragment,{children:[i.label," ",t]})})})},TG="ToastTitle",MM=E.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return d.jsx(yt.div,{...r,ref:e})});MM.displayName=TG;var PG="ToastDescription",DM=E.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return d.jsx(yt.div,{...r,ref:e})});DM.displayName=PG;var FM="ToastAction",BM=E.forwardRef((n,e)=>{const{altText:t,...r}=n;return t.trim()?d.jsx(UM,{altText:t,asChild:!0,children:d.jsx(Z4,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${FM}\`. Expected non-empty \`string\`.`),null)});BM.displayName=FM;var $M="ToastClose",Z4=E.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n,i=NG($M,t);return d.jsx(UM,{asChild:!0,children:d.jsx(yt.button,{type:"button",...r,ref:e,onClick:rt(n.onClick,i.onClose)})})});Z4.displayName=$M;var UM=E.forwardRef((n,e)=>{const{__scopeToast:t,altText:r,...i}=n;return d.jsx(yt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function zM(n){const e=[];return Array.from(n.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),RG(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...zM(r))}}),e}function t2(n,e,t,{discrete:r}){const i=t.originalEvent.currentTarget,s=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?EM(i,s):i.dispatchEvent(s)}var Cj=(n,e,t=0)=>{const r=Math.abs(n.x),i=Math.abs(n.y),s=r>i;return e==="left"||e==="right"?s&&r>t:!s&&i>t};function jG(n=()=>{}){const e=Da(n);li(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function RG(n){return n.nodeType===n.ELEMENT_NODE}function LG(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function jA(n){const e=document.activeElement;return n.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var IG=jM,qM=LM,HM=OM,WM=MM,VM=DM,GM=BM,KM=Z4;function YM(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=YM(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function R0(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=YM(n))&&(r&&(r+=" "),r+=e);return r}const Tj=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Pj=R0,Ob=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return Pj(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(c=>{const u=t==null?void 0:t[c],f=s==null?void 0:s[c];if(u===null)return null;const p=Tj(u)||Tj(f);return i[c][p]}),o=t&&Object.entries(t).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...h}=u;return Object.entries(h).every(b=>{let[g,w]=b;return Array.isArray(w)?w.includes({...s,...o}[g]):{...s,...o}[g]===w})?[...c,f,p]:c},[]);return Pj(n,a,l,t==null?void 0:t.class,t==null?void 0:t.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const OG=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XM=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var MG={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const DG=E.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>E.createElement("svg",{ref:l,...MG,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:XM("lucide",i),...o},[...a.map(([c,u])=>E.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const et=(n,e)=>{const t=E.forwardRef(({className:r,...i},s)=>E.createElement(DG,{ref:s,iconNode:e,className:XM(`lucide-${OG(n)}`,r),...i}));return t.displayName=`${n}`,t};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const jj=et("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const m0=et("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const TN=et("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const FG=et("Bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}
80],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const BG=et("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const Ml=et("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const $G=et("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const JM=et("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const eT=et("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const PN=et("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const jN=et("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const UG=et("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const zG=et("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const qG=et("CircleParking",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9 17V7h4a3 3 0 0 1 0 6H9",key:"1dfk2c"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const HG=et("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const WG=et("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const QM=et("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const VG=et("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const RN=et("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const GG=et("Euro",[["path",{d:"M4 10h12",key:"1y6xl8"}],["path",{d:"M4 14h9",key:"1loblj"}],["path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",key:"1j6lzo"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const KG=et("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const LN=et("EyeOff",[["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"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const IN=et("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"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const YG=et("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const E5=et("FileText",[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const XG=et("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"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const ZM=et("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const e8=et("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const JG=et("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Rl=et("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const QG=et("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const ZG=et("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const eK=et("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const U1=et("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const tK=et("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const nK=et("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const N5=et("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const tT=et("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const t8=et("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const rK=et("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const iK=et("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const g0=et("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const nT=et("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const n8=et("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const v0=et("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const sK=et("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const aK=et("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const oK=et("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const lK=et("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const k5=et("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const cK=et("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}
315],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const uK=et("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const dK=et("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const C5=et("TramFront",[["rect",{width:"16",height:"16",x:"4",y:"3",rx:"2",key:"1wxw4b"}],["path",{d:"M4 11h16",key:"mpoxn0"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"m8 19-2 3",key:"13i0xs"}],["path",{d:"m18 22-2-3",key:"1p0ohu"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M16 15h.01",key:"rnfrdf"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const tp=et("Trash2",[["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"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const ON=et("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const Mb=et("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const c_=et("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const hK=et("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const fK=et("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const Ba=et("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 9,258 bytes, lines 365-380
365],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const pK=et("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const r8=et("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const mK=et("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),rT="-",gK=n=>{const e=yK(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:a=>{const o=a.split(rT);return o[0]===""&&o.length!==1&&o.shift(),i8(o,e)||vK(a)},getConflictingClassGroupIds:(a,o)=>{const l=t[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},i8=(n,e)=>{var a;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?i8(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=n.join(rT);return(a=e.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},Rj=/^\[(.+)\]$/,vK=n=>{if(Rj.test(n)){const e=Rj.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},yK=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return wK(Object.entries(n.classGroups),t).forEach(([s,a])=>{MN(a,r,s,e)}),r},MN=(n,e,t,r)=>{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:Lj(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(bK(i)){MN(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,a])=>{MN(a,Lj(e,s),t,r)})})},Lj=(n,e)=>{let t=n;return e.split(rT).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},bK=n=>n.isThemeGetter,wK=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[e+a,o])):s);return[t,i]}):n,xK=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,a)=>{t.set(s,a),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let a=t.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){t.has(s)?t.set(s,a):i(s,a)}}},s8="!",_K=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,a=o=>{const l=[];let c=0,u=0,f;for(let w=0;w<o.length;w++){let y=o[w];if(c===0){if(y===i&&(r||o.slice(w,w+s)===e)){l.push(o.slice(u,w)),u=w+s;continue}if(y==="/"){f=w;continue}}y==="["?c++:y==="]"&&c--}const p=l.length===0?o:o.substring(u),h=p.startsWith(s8),b=h?p.substring(1):p,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:g}};return t?o=>t({className:o,parseClassName:a}):a},SK=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},AK=n=>({cache:xK(n.cacheSize),parseClassName:_K(n),...gK(n)}),EK=/\s+/,NK=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],a=n.trim().split(EK);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=t(c);let b=!!h,g=r(b?p.substring(0,h):p);if(!g){if(!b){o=c+(o.length>0?" "+o:o);continue}if(g=r(p),!g){o=c+(o.length>0?" "+o:o);continue}b=!1}const w=SK(u).join(":"),y=f?w+s8:w,x=y+g;if(s.includes(x))continue;s.push(x);const S=i(g,b);for(let A=0;A<S.length;++A){const C=S[A];s.push(y+C)}o=c+(o.length>0?" "+o:o)}return o};function kK(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=a8(e))&&(r&&(r+=" "),r+=t);return r}const a8=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=a8(n[r]))&&(t&&(t+=" "),t+=e);return t};function CK(n,...e){let t,r,i,s=a;function a(l){const c=e.reduce((u,f)=>f(u),n());return t=AK(c),r=t.cache.get,i=t.cache.set,s=o,o(l)}function o(l){const c=r(l);if(c)return c;const u=NK(l,t);return i(l,u),u}return function(){return s(kK.apply(null,arguments))}}const Fn=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},o8=/^\[(?:([a-z-]+):)?(.+)\]$/i,TK=/^\d+\/\d+$/,PK=new Set(["px","full","screen"]),jK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RK=/\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$/,LK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,IK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nc=n=>Bm(n)||PK.has(n)||TK.test(n),Eu=n=>L0(n,"length",qK),Bm=n=>!!n&&!Number.isNaN(Number(n)),RA=n=>L0(n,"number",Bm),kv=n=>!!n&&Number.isInteger(Number(n)),MK=n=>n.endsWith("%")&&Bm(n.slice(0,-1)),qt=n=>o8.test(n),Nu=n=>jK.test(n),DK=new Set(["length","size","percentage"]),FK=n=>L0(n,DK,l8),BK=n=>L0(n,"position",l8),$K=new Set(["image","url"]),UK=n=>L0(n,$K,WK),zK=n=>L0(n,"",HK),Cv=()=>!0,L0=(n,e,t)=>{const r=o8.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},qK=n=>RK.test(n)&&!LK.test(n),l8=()=>!1,HK=n=>IK.test(n),WK=n=>OK.test(n),VK=()=>{const n=Fn("colors"),e=Fn("spacing"),t=Fn("blur"),r=Fn("brightness"),i=Fn("borderColor"),s=Fn("borderRadius"),a=Fn("borderSpacing"),o=Fn("borderWidth"),l=Fn("contrast"),c=Fn("grayscale"),u=Fn("hueRotate"),f=Fn("invert"),p=Fn("gap"),h=Fn("gradientColorStops"),b=Fn("gradientColorStopPositions"),g=Fn("inset"),w=Fn("margin"),y=Fn("opacity"),x=Fn("padding"),S=Fn("saturate"),A=Fn("scale"),C=Fn("sepia"),T=Fn("skew"),R=Fn("space"),I=Fn("translate"),L=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",qt,e],$=()=>[qt,e],J=()=>["",nc,Eu],H=()=>["auto",Bm,qt],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",qt],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ge=()=>[Bm,qt];return{cacheSize:500,separator:":",theme:{colors:[Cv],spacing:[nc,Eu],blur:["none","",Nu,qt],brightness:ge(),borderColor:[n],borderRadius:["none","","full",Nu,qt],borderSpacing:$(),borderWidth:J(),contrast:ge(),grayscale:te(),hueRotate:ge(),invert:te(),gap:$(),gradientColorStops:[n],gradientColorStopPositions:[MK,Eu],inset:j(),margin:j(),opacity:ge(),padding:$(),saturate:ge(),scale:ge(),sepia:te(),skew:ge(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",qt]}],container:["container"],columns:[{columns:[Nu]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"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:[...le(),qt]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kv,qt]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qt]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",kv,qt]}],"grid-cols":[{"grid-cols":[Cv]}],"col-start-end":[{col:["auto",{span:["full",kv,qt]},qt]}],"col-start":[{"col-start":H()}
vendor: 9,429 bytes, line 380
380],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Cv]}],"row-start-end":[{row:["auto",{span:[kv,qt]},qt]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qt,e]}],"min-w":[{"min-w":[qt,e,"min","max","fit"]}],"max-w":[{"max-w":[qt,e,"none","full","min","max","fit","prose",{screen:[Nu]},Nu]}],h:[{h:[qt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Nu,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",RA]}],"font-family":[{font:[Cv]}],"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",qt]}],"line-clamp":[{"line-clamp":["none",Bm,RA]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nc,qt]}],"list-image":[{"list-image":["none",qt]}],"list-style-type":[{list:["none","disc","decimal",qt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nc,Eu]}],"underline-offset":[{"underline-offset":["auto",nc,qt]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qt]}],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",qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...le(),BK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UK]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:oe()}],"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:["",...oe()]}],"outline-offset":[{"outline-offset":[nc,qt]}],"outline-w":[{outline:[nc,Eu]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nc,Eu]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Nu,zK]}],"shadow-color":[{shadow:[Cv]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Nu,qt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qt]}],duration:[{duration:ge()}],ease:[{ease:["linear","in","out","in-out",qt]}],delay:[{delay:ge()}],animate:[{animate:["none","spin","ping","pulse","bounce",qt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[kv,qt]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qt]}],accent:[{accent:["auto",n]}],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",qt]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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"]}
vendor: 4,647 bytes, line 380
380],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",qt]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[nc,Eu,RA]}],stroke:[{stroke:[n,"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"]}}},GK=CK(VK);function We(...n){return GK(R0(n))}const KK=IG,c8=E.forwardRef(({className:n,...e},t)=>d.jsx(qM,{ref:t,className:We("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...e}));c8.displayName=qM.displayName;const YK=Ob("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),u8=E.forwardRef(({className:n,variant:e,...t},r)=>d.jsx(HM,{ref:r,className:We(YK({variant:e}),n),...t}));u8.displayName=HM.displayName;const XK=E.forwardRef(({className:n,...e},t)=>d.jsx(GM,{ref:t,className:We("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",n),...e}));XK.displayName=GM.displayName;const d8=E.forwardRef(({className:n,...e},t)=>d.jsx(KM,{ref:t,className:We("absolute right-2 top-2 rounded-md p-1 text-foreground
380/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...e,children:d.jsx(Ba,{className:"h-4 w-4"})}));d8.displayName=KM.displayName;const h8=E.forwardRef(({className:n,...e},t)=>d.jsx(WM,{ref:t,className:We("text-sm font-semibold",n),...e}));h8.displayName=WM.displayName;const f8=E.forwardRef(({className:n,...e},t)=>d.jsx(VM,{ref:t,className:We("text-sm opacity-90",n),...e}));f8.displayName=VM.displayName;function JK(){const{toasts:n}=Qd();return d.jsxs(KK,{children:[n.map(function({id:e,title:t,description:r,action:i,...s}){return d.jsxs(u8,{...s,children:[d.jsxs("div",{className:"grid gap-1",children:[t&&d.jsx(h8,{children:t}),r&&d.jsx(f8,{children:r})]}),i,d.jsx(d8,{})]},e)}),d.jsx(c8,{})]})}var Ij=["light","dark"],QK="(prefers-color-scheme: dark)",ZK=E.createContext(void 0),eY={setTheme:n=>{},themes:[]},tY=()=>{var n;return(n=E.useContext(ZK))!=null?n:eY};E.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:l})=>{let c=s==="system",u=t==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${t}',s='setAttribute';`,f=i?Ij.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(b,g=!1,w=!0)=>{let y=a?a[b]:b,x=g?b+"|| ''":`'${y}'`,S="";return i&&w&&!g&&Ij.includes(b)&&(S+=`d.style.colorScheme = '${b}';`),t==="class"?g||y?S+=`c.add(${x})`:S+="null":y&&(S+=`d[s](n,${x})`),S},h=n?`!function(){${u}${p(n)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${QK}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${c?"":"else{"+p(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(s,!1,!1)};}${f}}catch(t){}}();`;return E.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var nY=n=>{switch(n){case"success":return sY;case"info":return oY;case"warning":return aY;case"error":return lY;default:return null}},rY=Array(12).fill(0),iY=({visible:n,className:e})=>Ie.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":n},Ie.createElement("div",{className:"sonner-spinner"},rY.map((t,r)=>Ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sY=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),aY=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),oY=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lY=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cY=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),uY=()=>{let[n,e]=Ie.useState(document.hidden);return Ie.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),n},DN=1,dY=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
vendor: 1,050 bytes, line 380
380{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:DN++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...i,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
380this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let i=e instanceof Promise?e:e(),s=r!==void 0,a,o=i.then(async c=>{if(a=["resolve",c],Ie.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(fY(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:f})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:f})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:f})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||DN++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ys=new dY,hY=(n,e)=>{let t=(e==null?void 0:e.id)||DN++;return ys.addToast({title:n,...e,id:t}),t},fY=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",pY=hY,mY=()=>ys.toasts,gY=()=>ys.getActiveToasts(),to=Object.assign(pY,{success:ys.success,info:ys.info,warning:ys.warning,error:ys.error,custom:ys.custom,message:ys.message,promise:ys.promise,dismiss:ys.dismiss,loading:ys.loading},{getHistory:mY,getToasts:gY});function vY(n,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}vY(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
380left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
380:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
380--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
381`);function n2(n){return n.label!==void 0}var yY=3,bY="32px",wY="16px",Oj=4e3,xY=356,_Y=14,SY=20,AY=200;function Qa(...n){return n.filter(Boolean).join(" ")}function EY(n){let[e,t]=n.split("-"),r=[];return e&&r.push(e),t&&r.push(t),r}var NY=n=>{var e,t,r,i,s,a,o,l,c,u,f;let{invert:p,toast:h,unstyled:b,interacting:g,setHeights:w,visibleToasts:y,heights:x,index:S,toasts:A,expanded:C,removeToast:T,defaultRichColors:R,closeButton:I,style:L,cancelButtonStyle:V,actionButtonStyle:j,className:$="",descriptionClassName:J="",duration:H,position:le,gap:oe,loadingIcon:se,expandByDefault:O,classNames:te,icons:he,closeButtonAriaLabel:ge="Close toast",pauseWhenPageIsHidden:D}=n,[G,ee]=Ie.useState(null),[ae,X]=Ie.useState(null),[Q,ue]=Ie.useState(!1),[pe,me]=Ie.useState(!1),[_e,Ee]=Ie.useState(!1),[ye,Re]=Ie.useState(!1),[Y,Te]=Ie.useState(!1),[it,He]=Ie.useState(0),[Ce,Je]=Ie.useState(0),De=Ie.useRef(h.duration||H||Oj),Qe=Ie.useRef(null),ze=Ie.useRef(null),Vt=S===0,Ct=S+1<=y,dt=h.type,St=h.dismissible!==!1,Ot=h.className||"",Ve=h.descriptionClassName||"",wt=Ie.useMemo(()=>x.findIndex(xt=>xt.toastId===h.id)||0,[x,h.id]),lt=Ie.useMemo(()=>{var xt;return(xt=h.closeButton)!=null?xt:I},[h.closeButton,I]),Hn=Ie.useMemo(()=>h.duration||H||Oj,[h.duration,H]),Yt=Ie.useRef(0),Et=Ie.useRef(0),Dt=Ie.useRef(0),cn=Ie.useRef(null),[gt,_n]=le.split("-"),bt=Ie.useMemo(()=>x.reduce((xt,Tt,nn)=>nn>=wt?xt:xt+Tt.height,0),[x,wt]),Nt=uY(),Tn=h.invert||p,Ft=dt==="loading";Et.current=Ie.useMemo(()=>wt*oe+bt,[wt,bt]),Ie.useEffect(()=>{De.current=Hn},[Hn]),Ie.useEffect(()=>{ue(!0)},[]),Ie.useEffect(()=>{let xt=ze.current;if(xt){let Tt=xt.getBoundingClientRect().height;return Je(Tt),w(nn=>[{toastId:h.id,height:Tt,position:h.position},...nn]),()=>w(nn=>nn.filter(sr=>sr.toastId!==h.id))}},[w,h.id]),Ie.useLayoutEffect(()=>{if(!Q)return;let xt=ze.current,Tt=xt.style.height;xt.style.height="auto";let nn=xt.getBoundingClientRect().height;xt.style.height=Tt,Je(nn),w(sr=>sr.find(nt=>nt.toastId===h.id)?sr.map(nt=>nt.toastId===h.id?{...nt,height:nn}:nt):[{toastId:h.id,height:nn,position:h.position},...sr])},[Q,h.title,h.description,w,h.id]);let ct=Ie.useCallback(()=>{me(!0),He(Et.current),w(xt=>xt.filter(Tt=>Tt.toastId!==h.id)),setTimeout(()=>{T(h)},AY)},[h,T,w,Et]);Ie.useEffect(()=>{if(h.promise&&dt==="loading"||h.duration===1/0||h.type==="loading")return;let xt;return C||g||D&&Nt?(()=>{if(Dt.current<Yt.current){let Tt=new Date().getTime()-Yt.current;De.current=De.current-Tt}
381Dt.current=new Date().getTime()})():De.current!==1/0&&(Yt.current=new Date().getTime(),xt=setTimeout(()=>{var Tt;(Tt=h.onAutoClose)==null||Tt.call(h,h),ct()},De.current)),()=>clearTimeout(xt)},[C,g,h,dt,D,Nt,ct]),Ie.useEffect(()=>{h.delete&&ct()},[ct,h.delete]);function ln(){var xt,Tt,nn;return he!=null&&he.loading?Ie.createElement("div",{className:Qa(te==null?void 0:te.loader,(xt=h==null?void 0:h.classNames)==null?void 0:xt.loader,"sonner-loader"),"data-visible":dt==="loading"},he.loading):se?Ie.createElement("div",{className:Qa(te==null?void 0:te.loader,(Tt=h==null?void 0:h.classNames)==null?void 0:Tt.loader,"sonner-loader"),"data-visible":dt==="loading"},se):Ie.createElement(iY,{className:Qa(te==null?void 0:te.loader,(nn=h==null?void 0:h.classNames)==null?void 0:nn.loader),visible:dt==="loading"})}return Ie.createElement("li",{tabIndex:0,ref:ze,className:Qa($,Ot,te==null?void 0:te.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,te==null?void 0:te.default,te==null?void 0:te[dt],(t=h==null?void 0:h.classNames)==null?void 0:t[dt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:R,"data-styled":!(h.jsx||h.unstyled||b),"data-mounted":Q,"data-promise":!!h.promise,"data-swiped":Y,"data-removed":pe,"data-visible":Ct,"data-y-position":gt,"data-x-position":_n,"data-index":S,"data-front":Vt,"data-swiping":_e,"data-dismissible":St,"data-type":dt,"data-invert":Tn,"data-swipe-out":ye,"data-swipe-direction":ae,"data-expanded":!!(C||O&&Q),style:{"--index":S,"--toasts-before":S,"--z-index":A.length-S,"--offset":`${pe?it:Et.current}px`,"--initial-height":O?"auto":`${Ce}px`,...L,...h.style},onDragEnd:()=>{Ee(!1),ee(null),cn.current=null},onPointerDown:xt=>{Ft||!St||(Qe.current=new Date,He(Et.current),xt.target.setPointerCapture(xt.pointerId),xt.target.tagName!=="BUTTON"&&(Ee(!0),cn.current={x:xt.clientX,y:xt.clientY}))},onPointerUp:()=>{var xt,Tt,nn,sr;if(ye||!St)return;cn.current=null;let nt=Number(((xt=ze.current)==null?void 0:xt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kr=Number(((Tt=ze.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ci=new Date().getTime()-((nn=Qe.current)==null?void 0:nn.getTime()),Wn=G==="x"?nt:Kr,pr=Math.abs(Wn)/ci;if(Math.abs(Wn)>=SY||pr>.11){He(Et.current),(sr=h.onDismiss)==null||sr.call(h,h),X(G==="x"?nt>0?"right":"left":Kr>0?"down":"up"),ct(),Re(!0),Te(!1);return}Ee(!1),ee(null)},onPointerMove:xt=>{var Tt,nn,sr,nt;if(!cn.current||!St||((Tt=window.getSelection())==null?void 0:Tt.toString().length)>0)return;let Kr=xt.clientY-cn.current.y,ci=xt.clientX-cn.current.x,Wn=(nn=n.swipeDirections)!=null?nn:EY(le);!G&&(Math.abs(ci)>1||Math.abs(Kr)>1)&&ee(Math.abs(ci)>Math.abs(Kr)?"x":"y");let pr={x:0,y:0};G==="y"?(Wn.includes("top")||Wn.includes("bottom"))&&(Wn.includes("top")&&Kr<0||Wn.includes("bottom")&&Kr>0)&&(pr.y=Kr):G==="x"&&(Wn.includes("left")||Wn.includes("right"))&&(Wn.includes("left")&&ci<0||Wn.includes("right")&&ci>0)&&(pr.x=ci),(Math.abs(pr.x)>0||Math.abs(pr.y)>0)&&Te(!0),(sr=ze.current)==null||sr.style.setProperty("--swipe-amount-x",`${pr.x}px`),(nt=ze.current)==null||nt.style.setProperty("--swipe-amount-y",`${pr.y}px`)}},lt&&!h.jsx?Ie.createElement("button",{"aria-label":ge,"data-disabled":Ft,"data-close-button":!0,onClick:Ft||!St?()=>{}:()=>{var xt;ct(),(xt=h.onDismiss)==null||xt.call(h,h)},className:Qa(te==null?void 0:te.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},(s=he==null?void 0:he.close)!=null?s:cY):null,h.jsx||E.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:Ie.createElement(Ie.Fragment,null,dt||h.icon||h.promise?Ie.createElement("div",{"data-icon":"",className:Qa(te==null?void 0:te.icon,(a=h==null?void 0:h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ln():null,h.type!=="loading"?h.icon||(he==null?void 0:he[dt])||nY(dt):null):null,Ie.createElement("div",{"data-content":"",className:Qa(te==null?void 0:te.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},Ie.createElement("div",{"data-title":"",className:Qa(te==null?void 0:te.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?Ie.createElement("div",{"data-description":"",className:Qa(J,Ve,te==null?void 0:te.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),E.isValidElement(h.cancel)?h.cancel:h.cancel&&n2(h.cancel)?Ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||V,onClick:xt=>{var Tt,nn;n2(h.cancel)&&St&&((nn=(Tt=h.cancel).onClick)==null||nn.call(Tt,xt),ct())},className:Qa(te==null?void 0:te.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,E.isValidElement(h.action)?h.action:h.action&&n2(h.action)?Ie.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:xt=>{var Tt,nn;n2(h.action)&&((nn=(Tt=h.action).onClick)==null||nn.call(Tt,xt),!xt.defaultPrevented&&ct())},className:Qa(te==null?void 0:te.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function Mj(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function kY(n,e){let t={};return[n,e].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?wY:bY;function l(c){["top","right","bottom","left"].forEach(u=>{t[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?t[`${a}-${c}`]=o:t[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(o)}),t}var CY=E.forwardRef(function(n,e){let{invert:t,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,mobileOffset:c,theme:u="light",richColors:f,duration:p,style:h,visibleToasts:b=yY,toastOptions:g,dir:w=Mj(),gap:y=_Y,loadingIcon:x,icons:S,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:C}=n,[T,R]=Ie.useState([]),I=Ie.useMemo(()=>Array.from(new Set([r].concat(T.filter(D=>D.position).map(D=>D.position)))),[T,r]),[L,V]=Ie.useState([]),[j,$]=Ie.useState(!1),[J,H]=Ie.useState(!1),[le,oe]=Ie.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
381k":"light"),se=Ie.useRef(null),O=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=Ie.useRef(null),he=Ie.useRef(!1),ge=Ie.useCallback(D=>{R(G=>{var ee;return(ee=G.find(ae=>ae.id===D.id))!=null&&ee.delete||ys.dismiss(D.id),G.filter(({id:ae})=>ae!==D.id)})},[]);return Ie.useEffect(()=>ys.subscribe(D=>{if(D.dismiss){R(G=>G.map(ee=>ee.id===D.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{wM.flushSync(()=>{R(G=>{let ee=G.findIndex(ae=>ae.id===D.id);return ee!==-1?[...G.slice(0,ee),{...G[ee],...D},...G.slice(ee+1)]:[D,...G]})})})}),[]),Ie.useEffect(()=>{if(u!=="system"){oe(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?oe("dark"):oe("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:G})=>{oe(G?"dark":"light")})}catch{D.addListener(({matches:ee})=>{try{oe(ee?"dark":"light")}catch(ae){console.error(ae)}})}},[u]),Ie.useEffect(()=>{T.length<=1&&$(!1)},[T]),Ie.useEffect(()=>{let D=G=>{var ee,ae;i.every(X=>G[X]||G.code===X)&&($(!0),(ee=se.current)==null||ee.focus()),G.code==="Escape"&&(document.activeElement===se.current||(ae=se.current)!=null&&ae.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[i]),Ie.useEffect(()=>{if(se.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,he.current=!1)}},[se.current]),Ie.createElement("section",{ref:e,"aria-label":`${A} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((D,G)=>{var ee;let[ae,X]=D.split("-");return T.length?Ie.createElement("ol",{key:D,dir:w==="auto"?Mj():w,tabIndex:-1,ref:se,className:o,"data-sonner-toaster":!0,"data-theme":le,"data-y-position":ae,"data-lifted":j&&T.length>1&&!s,"data-x-position":X,style:{"--front-toast-height":`${((ee=L[0])==null?void 0:ee.height)||0}px`,"--width":`${xY}px`,"--gap":`${y}px`,...h,...kY(l,c)},onBlur:Q=>{he.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(he.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||he.current||(he.current=!0,te.current=Q.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{J||$(!1)},onDragEnd:()=>$(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},T.filter(Q=>!Q.position&&G===0||Q.position===D).map((Q,ue)=>{var pe,me;return Ie.createElement(NY,{key:Q.id,icons:S,index:ue,toast:Q,defaultRichColors:f,duration:(pe=g==null?void 0:g.duration)!=null?pe:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:b,closeButton:(me=g==null?void 0:g.closeButton)!=null?me:a,interacting:J,position:D,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ge,toasts:T.filter(_e=>_e.position==Q.position),heights:L.filter(_e=>_e.position==Q.position),setHeights:V,expandByDefault:s,gap:y,loadingIcon:x,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:n.swipeDirections})})):null}))});const TY=({...n})=>{const{theme:e="system"}=tY();return d.jsx(CY,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})};var PY=a4[" useId ".trim().toString()]||(()=>{}),jY=0;function Po(n){const[e,t]=E.useState(PY());return li(()=>{t(r=>r??String(jY++))},[n]),e?`radix-${e}`:""}const RY=["top","right","bottom","left"],Bd=Math.min,Xs=Math.max,u_=Math.round,r2=Math.floor,Ll=n=>({x:n,y:n}
vendor: 24,778 bytes, line 381
381),LY={left:"right",right:"left",bottom:"top",top:"bottom"},IY={start:"end",end:"start"};function FN(n,e,t){return Xs(n,Bd(e,t))}function Jc(n,e){return typeof n=="function"?n(e):n}function Qc(n){return n.split("-")[0]}function I0(n){return n.split("-")[1]}function iT(n){return n==="x"?"y":"x"}function sT(n){return n==="y"?"height":"width"}const OY=new Set(["top","bottom"]);function Cl(n){return OY.has(Qc(n))?"y":"x"}function aT(n){return iT(Cl(n))}function MY(n,e,t){t===void 0&&(t=!1);const r=I0(n),i=aT(n),s=sT(i);let a=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=d_(a)),[a,d_(a)]}function DY(n){const e=d_(n);return[BN(n),e,BN(e)]}function BN(n){return n.replace(/start|end/g,e=>IY[e])}const Dj=["left","right"],Fj=["right","left"],FY=["top","bottom"],BY=["bottom","top"];function $Y(n,e,t){switch(n){case"top":case"bottom":return t?e?Fj:Dj:e?Dj:Fj;case"left":case"right":return e?FY:BY;default:return[]}}function UY(n,e,t,r){const i=I0(n);let s=$Y(Qc(n),t==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(BN)))),s}function d_(n){return n.replace(/left|right|bottom|top/g,e=>LY[e])}function zY(n){return{top:0,right:0,bottom:0,left:0,...n}}function p8(n){return typeof n!="number"?zY(n):{top:n,right:n,bottom:n,left:n}}function h_(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function Bj(n,e,t){let{reference:r,floating:i}=n;const s=Cl(e),a=aT(e),o=sT(a),l=Qc(e),c=s==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[o]/2-i[o]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(I0(e)){case"start":h[a]-=p*(t&&c?-1:1);break;case"end":h[a]+=p*(t&&c?-1:1);break}return h}const qY=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:n,floating:e,strategy:i}),{x:u,y:f}=Bj(c,r,l),p=r,h={},b=0;for(let g=0;g<o.length;g++){const{name:w,fn:y}=o[g],{x,y:S,data:A,reset:C}=await y({x:u,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:n,floating:e}});u=x??u,f=S??f,h={...h,[w]:{...h[w],...A}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:n,floating:e,strategy:i}):C.rects),{x:u,y:f}=Bj(c,p,l)),g=-1)}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};async function z1(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Jc(e,n),b=p8(h),w=o[p?f==="floating"?"reference":"floating":f],y=h_(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(w)))==null||t?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),A=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},C=h_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:S,strategy:l}):x);return{top:(y.top-C.top+b.top)/A.y,bottom:(C.bottom-y.bottom+b.bottom)/A.y,left:(y.left-C.left+b.left)/A.x,right:(C.right-y.right+b.right)/A.x}}const HY=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=Jc(n,e)||{};if(c==null)return{};const f=p8(u),p={x:t,y:r},h=aT(i),b=sT(h),g=await a.getDimensions(c),w=h==="y",y=w?"top":"left",x=w?"bottom":"right",S=w?"clientHeight":"clientWidth",A=s.reference[b]+s.reference[h]-p[h]-s.floating[b],C=p[h]-s.reference[h],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=T?T[S]:0;(!R||!await(a.isElement==null?void 0:a.isElement(T)))&&(R=o.floating[S]||s.floating[b]);const I=A/2-C/2,L=R/2-g[b]/2-1,V=Bd(f[y],L),j=Bd(f[x],L),$=V,J=R-g[b]-j,H=R/2-g[b]/2+I,le=FN($,H,J),oe=!l.arrow&&I0(i)!=null&&H!==le&&s.reference[b]/2-(H<$?V:j)-g[b]/2<0,se=oe?H<$?H-$:H-J:0;return{[h]:p[h]+se,data:{[h]:le,centerOffset:H-le-se,...oe&&{alignmentOffset:se}},reset:oe}}}),WY=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...w}=Jc(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const y=Qc(i),x=Cl(o),S=Qc(o)===o,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(S||!g?[d_(o)]:DY(o)),T=b!=="none";!p&&T&&C.push(...UY(o,g,b,A));const R=[o,...C],I=await z1(e,w),L=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&L.push(I[y]),f){const H=MY(i,a,A);L.push(I[H[0]],I[H[1]])}if(V=[...V,{placement:i,overflows:L}],!L.every(H=>H<=0)){var j,$;const H=(((j=s.flip)==null?void 0:j.index)||0)+1,le=R[H];if(le&&(!(f==="alignment"?x!==Cl(le):!1)||V.every(O=>O.overflows[0]>0&&Cl(O.placement)===x)))return{data:{index:H,overflows:V},reset:{placement:le}};let oe=($=V.filter(se=>se.overflows[0]<=0).sort((se,O)=>se.overflows[1]-O.overflows[1])[0])==null?void 0:$.placement;if(!oe)switch(h){case"bestFit":{var J;const se=(J=V.filter(O=>{if(T){const te=Cl(O.placement);return te===x||te==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(te=>te>0).reduce((te,he)=>te+he,0)]).sort((O,te)=>O[1]-te[1])[0])==null?void 0:J[0];se&&(oe=se);break}case"initialPlacement":oe=o;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};function $j(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Uj(n){return RY.some(e=>n[e]>=0)}const VY=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Jc(n,e);switch(r){case"referenceHidden":{const s=await z1(e,{...i,elementContext:"reference"}),a=$j(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Uj(a)}}}case"escaped":{const s=await z1(e,{...i,altBoundary:!0}),a=$j(s,t.floating);return{data:{escapedOffsets:a,escaped:Uj(a)}}}default:return{}}}}},m8=new Set(["left","top"]);async function GY(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Qc(t),o=I0(t),l=Cl(t)==="y",c=m8.has(a)?-1:1,u=s&&l?-1:1,f=Jc(e,n);let{mainAxis:p,crossAxis:h,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof b=="number"&&(h=o==="end"?b*-1:b),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const KY=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:a,middlewareData:o}=e,l=await GY(e,n);return a===((t=o.offset)==null?void 0:t.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},YY=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:w=>{let{x:y,y:x}=w;return{x:y,y:x}}},...l}=Jc(n,e),c={x:t,y:r},u=await z1(e,l),f=Cl(Qc(i)),p=iT(f);let h=c[p],b=c[f];if(s){const w=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=h+u[w],S=h-u[y];h=FN(x,h,S)}if(a){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=b+u[w],S=b-u[y];b=FN(x,b,S)}const g=o.fn({...e,[p]:h,[f]:b});return{...g,data:{x:g.x-t,y:g.y-r,enabled:{[p]:s,[f]:a}}}}}},XY=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Jc(n,e),u={x:t,y:r},f=Cl(i),p=iT(f);let h=u[p],b=u[f];const g=Jc(o,e),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const S=p==="y"?"height":"width",A=s.reference[p]-s.floating[S]+w.mainAxis,C=s.reference[p]+s.reference[S]-w.mainAxis;h<A?h=A:h>C&&(h=C)}if(c){var y,x;const S=p==="y"?"width":"height",A=m8.has(Qc(i)),C=s.reference[f]-s.floating[S]+(A&&((y=a.offset)==null?void 0:y[f])||0)+(A?0:w.crossAxis),T=s.reference[f]+s.reference[S]+(A?0:((x=a.offset)==null?void 0:x[f])||0)-(A?w.crossAxis:0);b<C?b=C:b>T&&(b=T)}return{[p]:h,[f]:b}}}},JY=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:l=()=>{},...c}=Jc(n,e),u=await z1(e,c),f=Qc(i),p=I0(i),h=Cl(i)==="y",{width:b,height:g}=s.floating;let w,y;f==="top"||f==="bottom"?(w=f,y=p===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=f,w=p==="end"?"top":"bottom");const x=g-u.top-u.bottom,S=b-u.left-u.right,A=Bd(g-u[w],x),C=Bd(b-u[y],S),T=!e.middlewareData.shift;let R=A,I=C;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(I=S),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=x),T&&!p){const V=Xs(u.left,0),j=Xs(u.right,0),$=Xs(u.top,0),J=Xs(u.bottom,0);h?I=b-2*(V!==0||j!==0?V+j:Xs(u.left,u.right)):R=g-2*($!==0||J!==0?$+J:Xs(u.top,u.bottom))}await l({...e,availableWidth:I,availableHeight:R});const L=await a.getDimensions(o.floating);return b!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function T5(){return typeof window<"u"}function O0(n){return g8(n)?(n.nodeName||"").toLowerCase():"#document"}function ra(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Bl(n){var e;return(e=(g8(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function g8(n){return T5()?n instanceof Node||n instanceof ra(n).Node:!1}function Io(n){return T5()?n instanceof Element||n instanceof ra(n).Element:!1}function Dl(n){return T5()?n instanceof HTMLElement||n instanceof ra(n).HTMLElement:!1}function zj(n){return!T5()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof ra(n).ShadowRoot}const QY=new Set(["inline","contents"]);function Db(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=Oo(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!QY.has(i)}const ZY=new Set(["table","td","th"]);function eX(n){return ZY.has(O0(n))}const tX=[":popover-open",":modal"];function P5(n){return tX.some(e=>{try{return n.matches(e)}catch{return!1}})}const nX=["transform","translate","scale","rotate","perspective"],rX=["transform","translate","scale","rotate","perspective","filter"],iX=["paint","layout","strict","content"];function oT(n){const e=lT(),t=Io(n)?Oo(n):n;return nX.some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||rX.some(r=>(t.willChange||"").includes(r))||iX.some(r=>(t.contain||"").includes(r))}function sX(n){let e=$d(n);for(;Dl(e)&&!y0(e);){if(oT(e))return e;if(P5(e))return null;e=$d(e)}return null}function lT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aX=new Set(["html","body","#document"]);function y0(n){return aX.has(O0(n))}function Oo(n){return ra(n).getComputedStyle(n)}function j5(n){return Io(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function $d(n){if(O0(n)==="html")return n;const e=n.assignedSlot||n.parentNode||zj(n)&&n.host||Bl(n);return zj(e)?e.host:e}function v8(n){const e=$d(n);return y0(e)?n.ownerDocument?n.ownerDocument.body:n.body:Dl(e)&&Db(e)?e:v8(e)}function q1(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=v8(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),a=ra(i);if(s){const o=$N(a);return e.concat(a,a.visualViewport||[],Db(i)?i:[],o&&t?q1(o):[])}return e.concat(i,q1(i,[],t))}function $N(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function y8(n){const e=Oo(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Dl(n),s=i?n.offsetWidth:t,a=i?n.offsetHeight:r,o=u_(t)!==s||u_(r)!==a;return o&&(t=s,r=a),{width:t,height:r,$:o}}function cT(n){return Io(n)?n:n.contextElement}function $m(n){const e=cT(n);if(!Dl(e))return Ll(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=y8(e);let a=(s?u_(t.width):t.width)/r,o=(s?u_(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const oX=Ll(0);function b8(n){const e=ra(n);return!lT()||!e.visualViewport?oX:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lX(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==ra(n)?!1:e}function cp(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=cT(n);let a=Ll(1);e&&(r?Io(r)&&(a=$m(r)):a=$m(n));const o=lX(s,t,r)?b8(s):Ll(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,u=i.width/a.x,f=i.height/a.y;if(s){const p=ra(s),h=r&&Io(r)?ra(r):r;let b=p,g=$N(b);for(;g&&r&&h!==b;){const w=$m(g),y=g.getBoundingClientRect(),x=Oo(g),S=y.left+(g.clientLeft+parseFloat(x.paddingLeft))*w.x,A=y.top+(g.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,f*=w.y,l+=S,c+=A,b=ra(g),g=$N(b)}}return h_({width:u,height:f,x:l,y:c})}function uT(n,e){const t=j5(n).scrollLeft;return e?e.left+t:cp(Bl(n)).left+t}function w8(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:uT(n,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function cX(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=i==="fixed",a=Bl(r),o=e?P5(e.floating):!1;if(r===a||o&&s)return t;let l={scrollLeft:0,scrollTop:0},c=Ll(1);const u=Ll(0),f=Dl(r);if((f||!f&&!s)&&((O0(r)!=="body"||Db(a))&&(l=j5(r)),Dl(r))){const h=cp(r);c=$m(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=a&&!f&&!s?w8(a,l,!0):Ll(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:t.y*c.y-l.scrollTop*c.y+u.y+p.y}}function uX(n){return Array.from(n.getClientRects())}function dX(n){const e=Bl(n),t=j5(n),r=n.ownerDocument.body,i=Xs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Xs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-t.scrollLeft+uT(n);const o=-t.scrollTop;return Oo(r).direction==="rtl"&&(a+=Xs(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function hX(n,e){const t=ra(n),r=Bl(n),i=t.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const c=lT();(!c||c&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}const fX=new Set(["absolute","fixed"]);function pX(n,e){const t=cp(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=Dl(n)?$m(n):Ll(1),a=n.clientWidth*s.x,o=n.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:a,height:o,x:l,y:c}}function qj(n,e,t){let r;if(e==="viewport")r=hX(n,t);else if(e==="document")r=dX(Bl(n));else if(Io(e))r=pX(e,t);else{const i=b8(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return h_(r)}function x8(n,e){const t=$d(n);return t===e||!Io(t)||y0(t)?!1:Oo(t).position==="fixed"||x8(t,e)}function mX(n,e){const t=e.get(n);if(t)return t;let r=q1(n,[],!1).filter(o=>Io(o)&&O0(o)!=="body"),i=null;const s=Oo(n).position==="fixed";let a=s?$d(n):n;for(;Io(a)&&!y0(a);){const o=Oo(a),l=oT(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&fX.has(i.position)||Db(a)&&!l&&x8(n,a))?r=r.filter(u=>u!==a):i=o,a=$d(a)}return e.set(n,r),r}function gX(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const a=[...t==="clippingAncestors"?P5(e)?[]:mX(e,this._c):[].concat(t),r],o=a[0],l=a.reduce((c,u)=>{const f=qj(e,u,i);return c.top=Xs(f.top,c.top),c.right=Bd(f.right,c.right),c.bottom=Bd(f.bottom,c.bottom),c.left=Xs(f.left,c.left),c},qj(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vX(n){const{width:e,height:t}=y8(n);return{width:e,height:t}}function yX(n,e,t){const r=Dl(e),i=Bl(e),s=t==="fixed",a=cp(n,!0,s,e);let o={scrollLeft:0,scrollTop:0};const l=Ll(0);function c(){l.x=uT(i)}if(r||!r&&!s)if((O0(e)!=="body"||Db(i))&&(o=j5(e)),r){const h=cp(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();s&&!r&&i&&c();const u=i&&!r&&!s?w8(i,o):Ll(0),f=a.left+o.scrollLeft-l.x-u.x,p=a.top+o.scrollTop-l.y-u.y;return{x:f,y:p,width:a.width,height:a.height}}function LA(n){return Oo(n).position==="static"}function Hj(n,e){if(!Dl(n)||Oo(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Bl(n)===t&&(t=t.ownerDocument.body),t}function _8(n,e){const t=ra(n);if(P5(n))return t;if(!Dl(n)){let i=$d(n);for(;i&&!y0(i);){if(Io(i)&&!LA(i))return i;i=$d(i)}return t}let r=Hj(n,e);for(;r&&eX(r)&&LA(r);)r=Hj(r,e);return r&&y0(r)&&LA(r)&&!oT(r)?t:r||sX(n)||t}const bX=async function(n){const e=this.getOffsetParent||_8,t=this.getDimensions,r=await t(n.floating);return{reference:yX(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wX(n){return Oo(n).direction==="rtl"}const xX={convertOffsetParentRelativeRectToViewportRelativeRect:cX,getDocumentElement:Bl,getClippingRect:gX,getOffsetParent:_8,getElementRects:bX,getClientRects:uX,getDimensions:vX,getScale:$m,isElement:Io,isRTL:wX};function S8(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function _X(n,e){let t=null,r;const i=Bl(n);function s(){var o;clearTimeout(r),(o=t)==null||o.disconnect(),t=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const c=n.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(o||e(),!p||!h)return;const b=r2(f),g=r2(i.clientWidth-(u+p)),w=r2(i.clientHeight-(f+h)),y=r2(u),S={rootMargin:-b+"px "+-g+"px "+-w+"px "+-y+"px",threshold:Xs(0,Bd(1,l))||1};let A=!0;function C(T){const R=T[0].intersectionRatio;if(R!==l){if(!A)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!S8(c,n.getBoundingClientRect())&&a(),A=!1}try{t=new IntersectionObserver(C,{...S,root:i.ownerDocument})}catch{t=new IntersectionObserver(C,S)}t.observe(n)}return a(!0),s}function SX(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=cT(n),u=i||s?[...c?q1(c):[],...q1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",t,{passive:!0}),s&&y.addEventListener("resize",t)});const f=c&&o?_X(c,t):null;let p=-1,h=null;a&&(h=new ResizeObserver(y=>{let[x]=y;x&&x.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),t()}),c&&!l&&h.observe(c),h.observe(e));let b,g=l?cp(n):null;l&&w();function w(){const y=cp(n);g&&!S8(g,y)&&t(),g=y,b=requestAnimationFrame(w)}return t(),()=>{var y;u.forEach(x=>{i&&x.removeEventListener("scroll",t),s&&x.removeEventListener("resize",t)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(b)}}const AX=KY,EX=YY,NX=WY,kX=JY,CX=VY,Wj=HY,TX=XY,PX=(n,e,t)=>{const r=new Map,i={platform:xX,...t},s={...i.platform,_c:r};return qY(n,e,{...i,platform:s})};var jX=typeof document<"u",RX=function(){},Y2=jX?E.useLayoutEffect:RX;function f_(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!f_(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!f_(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function A8(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Vj(n,e){const t=A8(n);return Math.round(e*t)/t}function IA(n){const e=E.useRef(n);return Y2(()=>{e.current=n}),e}function LX(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=n,[u,f]=E.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,h]=E.useState(r);f_(p,r)||h(r);const[b,g]=E.useState(null),[w,y]=E.useState(null),x=E.useCallback(O=>{O!==T.current&&(T.current=O,g(O))},[]),S=E.useCallback(O=>{O!==R.current&&(R.current=O,y(O))},[]),A=s||b,C=a||w,T=E.useRef(null),R=E.useRef(null),I=E.useRef(u),L=l!=null,V=IA(l),j=IA(i),$=IA(c),J=E.useCallback(()=>{if(!T.current||!R.current)return;const O={placement:e,strategy:t,middleware:p};j.current&&(O.platform=j.current),PX(T.current,R.current,O).then(te=>{const he={...te,isPositioned:$.current!==!1};H.current&&!f_(I.current,he)&&(I.current=he,Ep.flushSync(()=>{f(he)}))})},[p,e,t,j,$]);Y2(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[c]);const H=E.useRef(!1);Y2(()=>(H.current=!0,()=>{H.current=!1}),[]),Y2(()=>{if(A&&(T.current=A),C&&(R.current=C),A&&C){if(V.current)return V.current(A,C,J);J()}},[A,C,J,V,L]);const le=E.useMemo(()=>({reference:T,floating:R,setReference:x,setFloating:S}),[x,S]),oe=E.useMemo(()=>({reference:A,floating:C}),[A,C]),se=E.useMemo(()=>{const O={position:t,left:0,top:0};if(!oe.floating)return O;const te=Vj(oe.floating,u.x),he=Vj(oe.floating,u.y);return o?{...O,transform:"translate("+te+"px, "+he+"px)",...A8(oe.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:te,top:he}},[t,o,oe.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:J,refs:le,elements:oe,floatingStyles:se}),[u,J,le,oe,se])}const IX=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:i}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?Wj({element:r.current,padding:i}).fn(t):{}:r?Wj({element:r,padding:i}).fn(t):{}}}},OX=(n,e)=>({...AX(n),options:[n,e]}),MX=(n,e)=>({...EX(n),options:[n,e]}),DX=(n,e)=>({...TX(n),options:[n,e]}),FX=(n,e)=>({...NX(n),options:[n,e]}),BX=(n,e)=>({...kX(n),options:[n,e]}),$X=(n,e)=>({...CX(n),options:[n,e]}),UX=(n,e)=>({...IX(n),options:[n,e]});var zX="Arrow",E8=E.forwardRef((n,e)=>{const{children:t,width:r=10,height:i=5,...s}=n;return d.jsx(yt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});E8.displayName=zX;var qX=E8;function dT(n){const[e,t]=E.useState(void 0);return li(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=n.offsetWidth,o=n.offsetHeight;t({width:a,height:o})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}var hT="Popper",[N8,M0]=cs(hT),[HX,k8]=N8(hT),C8=n=>{const{__scopePopper:e,children:t}=n,[r,i]=E.useState(null);return d.jsx(HX,{scope:e,anchor:r,onAnchorChange:i,children:t})};C8.displayName=hT;var T8="PopperAnchor",P8=E.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,s=k8(T8,t),a=E.useRef(null),o=Xt(e,a);return E.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:d.jsx(yt.div,{...i,ref:o})});P8.displayName=T8;var fT="PopperContent",[WX,VX]=N8(fT),j8=E.forwardRef((n,e)=>{var Q,ue,pe,me,_e,Ee;const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:b,...g}=n,w=k8(fT,t),[y,x]=E.useState(null),S=Xt(e,ye=>x(ye)),[A,C]=E.useState(null),T=dT(A),R=(T==null?void 0:T.width)??0,I=(T==null?void 0:T.height)??0,L=r+(s!=="center"?"-"+s:""),V=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],$=j.length>0,J={padding:V,boundary:j.filter(KX),altBoundary:$},{refs:H,floatingStyles:le,placement:oe,isPositioned:se,middlewareData:O}=LX({strategy:"fixed",placement:L,whileElementsMounted:(...ye)=>SX(...ye,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[OX({mainAxis:i+I,alignmentAxis:a}),l&&MX({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?DX():void 0,...J}),l&&FX({...J}),BX({...J,apply:({elements:ye,rects:Re,availableWidth:Y,availableHeight:Te})=>{const{width:it,height:He}=Re.reference,Ce=ye.floating.style;Ce.setProperty("--radix-popper-available-width",`${Y}px`),Ce.setProperty("--radix-popper-available-height",`${Te}px`),Ce.setProperty("--radix-popper-anchor-width",`${it}
381px`),Ce.setProperty("--radix-popper-anchor-height",`${He}px`)}}),A&&UX({element:A,padding:o}),YX({arrowWidth:R,arrowHeight:I}),p&&$X({strategy:"referenceHidden",...J})]}),[te,he]=I8(oe),ge=Da(b);li(()=>{se&&(ge==null||ge())},[se,ge]);const D=(Q=O.arrow)==null?void 0:Q.x,G=(ue=O.arrow)==null?void 0:ue.y,ee=((pe=O.arrow)==null?void 0:pe.centerOffset)!==0,[ae,X]=E.useState();return li(()=>{y&&X(window.getComputedStyle(y).zIndex)},[y]),d.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:se?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(me=O.transformOrigin)==null?void 0:me.x,(_e=O.transformOrigin)==null?void 0:_e.y].join(" "),...((Ee=O.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:d.jsx(WX,{scope:t,placedSide:te,onArrowChange:C,arrowX:D,arrowY:G,shouldHideArrow:ee,children:d.jsx(yt.div,{"data-side":te,"data-align":he,...g,ref:S,style:{...g.style,animation:se?void 0:"none"}})})})});j8.displayName=fT;var R8="PopperArrow",GX={top:"bottom",right:"left",bottom:"top",left:"right"},L8=E.forwardRef(function(e,t){const{__scopePopper:r,...i}=e,s=VX(R8,r),a=GX[s.placedSide];return d.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:d.jsx(qX,{...i,ref:t,style:{...i.style,display:"block"}})})});L8.displayName=R8;function KX(n){return n!==null}var YX=n=>({name:"transformOrigin",options:n,fn(e){var w,y,x;const{placement:t,rects:r,middlewareData:i}=e,a=((w=i.arrow)==null?void 0:w.centerOffset)!==0,o=a?0:n.arrowWidth,l=a?0:n.arrowHeight,[c,u]=I8(t),f={start:"0%",center:"50%",end:"100%"}[u],p=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,h=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let b="",g="";return c==="bottom"?(b=a?f:`${p}px`,g=`${-l}px`):c==="top"?(b=a?f:`${p}px`,g=`${r.floating.height+l}px`):c==="right"?(b=`${-l}px`,g=a?f:`${h}px`):c==="left"&&(b=`${r.floating.width+l}px`,g=a?f:`${h}px`),{data:{x:b,y:g}}}});function I8(n){const[e,t="center"]=n.split("-");return[e,t]}var O8=C8,R5=P8,pT=j8,mT=L8,[L5,Bpe]=cs("Tooltip",[M0]),gT=M0(),M8="TooltipProvider",XX=700,Gj="tooltip.open",[JX,D8]=L5(M8),F8=n=>{const{__scopeTooltip:e,delayDuration:t=XX,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=n,a=E.useRef(!0),o=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(JX,{scope:e,isOpenDelayedRef:a,delayDuration:t,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:E.useCallback(c=>{o.current=c},[]),disableHoverableContent:i,children:s})};F8.displayName=M8;var B8="Tooltip",[$pe,I5]=L5(B8),UN="TooltipTrigger",QX=E.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=I5(UN,t),s=D8(UN,t),a=gT(t),o=E.useRef(null),l=Xt(e,o,i.onTriggerChange),c=E.useRef(!1),u=E.useRef(!1),f=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(R5,{asChild:!0,...a,children:d.jsx(yt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:rt(n.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:rt(n.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:rt(n.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:rt(n.onFocus,()=>{c.current||i.onOpen()}),onBlur:rt(n.onBlur,i.onClose),onClick:rt(n.onClick,i.onClose)})})});QX.displayName=UN;var ZX="TooltipPortal",[Upe,eJ]=L5(ZX,{forceMount:void 0}),b0="TooltipContent",$8=E.forwardRef((n,e)=>
vendor: 4,259 bytes, line 381
381{const t=eJ(b0,n.__scopeTooltip),{forceMount:r=t.forceMount,side:i="top",...s}=n,a=I5(b0,n.__scopeTooltip);return d.jsx(Do,{present:r||a.open,children:a.disableHoverableContent?d.jsx(U8,{side:i,...s,ref:e}):d.jsx(tJ,{side:i,...s,ref:e})})}),tJ=E.forwardRef((n,e)=>{const t=I5(b0,n.__scopeTooltip),r=D8(b0,n.__scopeTooltip),i=E.useRef(null),s=Xt(e,i),[a,o]=E.useState(null),{trigger:l,onClose:c}=t,u=i.current,{onPointerInTransitChange:f}=r,p=E.useCallback(()=>{o(null),f(!1)},[f]),h=E.useCallback((b,g)=>{const w=b.currentTarget,y={x:b.clientX,y:b.clientY},x=aJ(y,w.getBoundingClientRect()),S=oJ(y,x),A=lJ(g.getBoundingClientRect()),C=uJ([...S,...A]);o(C),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.useEffect(()=>{if(l&&u){const b=w=>h(w,u),g=w=>h(w,l);return l.addEventListener("pointerleave",b),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",g)}}},[l,u,h,p]),E.useEffect(()=>{if(a){const b=g=>{const w=g.target,y={x:g.clientX,y:g.clientY},x=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),S=!cJ(y,a);x?p():S&&(p(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,u,a,c,p]),d.jsx(U8,{...n,ref:s})}),[nJ,rJ]=L5(B8,{isInside:!1}),iJ=AM("TooltipContent"),U8=E.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=n,l=I5(b0,t),c=gT(t),{onClose:u}=l;return E.useEffect(()=>(document.addEventListener(Gj,u),()=>document.removeEventListener(Gj,u)),[u]),E.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),d.jsx(j0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(pT,{"data-state":l.stateAttribute,...c,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(iJ,{children:r}),d.jsx(nJ,{scope:t,isInside:!0,children:d.jsx(gG,{id:l.contentId,role:"tooltip",children:i||r})})]})})});$8.displayName=b0;var z8="TooltipArrow",sJ=E.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=gT(t);return rJ(z8,t).isInside?null:d.jsx(mT,{...i,...r,ref:e})});sJ.displayName=z8;function aJ(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),i=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,i,s)){case s:return"left";case i:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function oJ(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function lJ(n){const{top:e,right:t,bottom:r,left:i}=n;return[{x:i,y:e},{x:t,y:e},{x:t,y:r},{x:i,y:r}]}function cJ(n,e){const{x:t,y:r}=n;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],l=e[a],c=o.x,u=o.y,f=l.x,p=l.y;u>r!=p>r&&t<(f-c)*(r-u)/(p-u)+c&&(i=!i)}return i}function uJ(n){const e=n.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),dJ(e)}function dJ(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r<n.length;r++){const i=n[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const i=n[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var hJ=F8,q8=$8;const fJ=hJ,pJ=E.forwardRef(({className:n,sideOffset:e=4,...t},r)=>
vendor: 19,526 bytes, line 381
381d.jsx(q8,{ref:r,sideOffset:e,className:We("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...t}));pJ.displayName=q8.displayName;var O5=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},M5=typeof window>"u"||"Deno"in globalThis;function so(){}function mJ(n,e){return typeof n=="function"?n(e):n}function gJ(n){return typeof n=="number"&&n>=0&&n!==1/0}function vJ(n,e){return Math.max(n+(e||0)-Date.now(),0)}function zN(n,e){return typeof n=="function"?n(e):n}function yJ(n,e){return typeof n=="function"?n(e):n}function Kj(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=n;if(a){if(r){if(e.queryHash!==vT(a,e.options))return!1}else if(!W1(e.queryKey,a))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function Yj(n,e){const{exact:t,status:r,predicate:i,mutationKey:s}=n;if(s){if(!e.options.mutationKey)return!1;if(t){if(H1(e.options.mutationKey)!==H1(s))return!1}else if(!W1(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function vT(n,e){return((e==null?void 0:e.queryKeyHashFn)||H1)(n)}function H1(n){return JSON.stringify(n,(e,t)=>qN(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function W1(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>W1(n[t],e[t])):!1}function H8(n,e){if(n===e)return n;const t=Xj(n)&&Xj(e);if(t||qN(n)&&qN(e)){const r=t?n:Object.keys(n),i=r.length,s=t?e:Object.keys(e),a=s.length,o=t?[]:{},l=new Set(r);let c=0;for(let u=0;u<a;u++){const f=t?u:s[u];(!t&&l.has(f)||t)&&n[f]===void 0&&e[f]===void 0?(o[f]=void 0,c++):(o[f]=H8(n[f],e[f]),o[f]===n[f]&&n[f]!==void 0&&c++)}return i===a&&c===i?n:o}return e}function Xj(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function qN(n){if(!Jj(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!Jj(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function Jj(n){return Object.prototype.toString.call(n)==="[object Object]"}function bJ(n){return new Promise(e=>{setTimeout(e,n)})}function wJ(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?H8(n,e):e}function xJ(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function _J(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var yT=Symbol();function W8(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===yT?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var Xh,zu,ng,JI,SJ=(JI=class extends O5{constructor(){super();q(this,Xh);q(this,zu);q(this,ng);M(this,ng,e=>{if(!M5&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){m(this,zu)||this.setEventListener(m(this,ng))}onUnsubscribe(){var e;this.hasListeners()||((e=m(this,zu))==null||e.call(this),M(this,zu,void 0))}setEventListener(e){var t;M(this,ng,e),(t=m(this,zu))==null||t.call(this),M(this,zu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){m(this,Xh)!==e&&(M(this,Xh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof m(this,Xh)=="boolean"?m(this,Xh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Xh=new WeakMap,zu=new WeakMap,ng=new WeakMap,JI),V8=new SJ,rg,qu,ig,QI,AJ=(QI=class extends O5{constructor(){super();q(this,rg,!0);q(this,qu);q(this,ig);M(this,ig,e=>{if(!M5&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){m(this,qu)||this.setEventListener(m(this,ig))}onUnsubscribe(){var e;this.hasListeners()||((e=m(this,qu))==null||e.call(this),M(this,qu,void 0))}setEventListener(e){var t;M(this,ig,e),(t=m(this,qu))==null||t.call(this),M(this,qu,e(this.setOnline.bind(this)))}setOnline(e){m(this,rg)!==e&&(M(this,rg,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return m(this,rg)}},rg=new WeakMap,qu=new WeakMap,ig=new WeakMap,QI),p_=new AJ;function EJ(){let n,e;const t=new Promise((i,s)=>{n=i,e=s});t.status="pending",t.catch(()=>{});function r(i){Object.assign(t,i),delete t.resolve,delete t.reject}return t.resolve=i=>{r({status:"fulfilled",value:i}),n(i)},t.reject=i=>{r({status:"rejected",reason:i}),e(i)},t}function NJ(n){return Math.min(1e3*2**n,3e4)}function G8(n){return(n??"online")==="online"?p_.isOnline():!0}var K8=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function OA(n){return n instanceof K8}function Y8(n){let e=!1,t=0,r=!1,i;const s=EJ(),a=g=>{var w;r||(p(new K8(g)),(w=n.abort)==null||w.call(n))},o=()=>{e=!0},l=()=>{e=!1},c=()=>V8.isFocused()&&(n.networkMode==="always"||p_.isOnline())&&n.canRun(),u=()=>G8(n.networkMode)&&n.canRun(),f=g=>{var w;r||(r=!0,(w=n.onSuccess)==null||w.call(n,g),i==null||i(),s.resolve(g))},p=g=>{var w;r||(r=!0,(w=n.onError)==null||w.call(n,g),i==null||i(),s.reject(g))},h=()=>new Promise(g=>{var w;i=y=>{(r||c())&&g(y)},(w=n.onPause)==null||w.call(n)}).then(()=>{var g;i=void 0,r||(g=n.onContinue)==null||g.call(n)}),b=()=>{if(r)return;let g;const w=t===0?n.initialPromise:void 0;try{g=w??n.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(f).catch(y=>{var T;if(r)return;const x=n.retry??(M5?0:3),S=n.retryDelay??NJ,A=typeof S=="function"?S(t,y):S,C=x===!0||typeof x=="number"&&t<x||typeof x=="function"&&x(t,y);if(e||!C){p(y);return}t++,(T=n.onFail)==null||T.call(n,t,y),bJ(A).then(()=>c()?void 0:h()).then(()=>{e?p(y):b()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:l,canStart:u,start:()=>(u()?b():h().then(b),s)}}var kJ=n=>setTimeout(n,0);function CJ(){let n=[],e=0,t=o=>{o()},r=o=>{o()},i=kJ;const s=o=>{e?n.push(o):i(()=>{t(o)})},a=()=>{const o=n;n=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var es=CJ(),Jh,ZI,X8=(ZI=class{constructor(){q(this,Jh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gJ(this.gcTime)&&M(this,Jh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(M5?1/0:5*60*1e3))}clearGcTimeout(){m(this,Jh)&&(clearTimeout(m(this,Jh)),M(this,Jh,void 0))}},Jh=new WeakMap,ZI),sg,Qh,ya,Zh,Mi,cy,ef,lo,oc,e6,TJ=(e6=class extends X8{constructor(e){super();q(this,lo);q(this,sg);q(this,Qh);q(this,ya);q(this,Zh);q(this,Mi);q(this,cy);q(this,ef);M(this,ef,!1),M(this,cy,e.defaultOptions),this.setOptions(e.options),this.observers=[],M(this,Zh,e.client),M(this,ya,m(this,Zh).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,M(this,sg,jJ(this.options)),this.state=e.state??m(this,sg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=m(this,Mi))==null?void 0:e.promise}setOptions(e){this.options={...m(this,cy),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&m(this,ya).remove(this)}setData(e,t){const r=wJ(this.state.data,e,this.options);return U(this,lo,oc).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){U(this,lo,oc).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r,i;const t=(r=m(this,Mi))==null?void 0:r.promise;return(i=m(this,Mi))==null||i.cancel(e),t?t.then(so).catch(so):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(m(this,sg))}isActive(){return this.observers.some(e=>yJ(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zN(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!vJ(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=m(this,Mi))==null||t.continue()}onOnline(){var t;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=m(this,Mi))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),m(this,ya).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(m(this,Mi)&&(m(this,ef)?m(this,Mi).cancel({revert:!0}):m(this,Mi).cancelRetry()),this.scheduleGc()),m(this,ya).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||U(this,lo,oc).call(this,{type:"invalidate"})}fetch(e,t){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(m(this,Mi))return m(this,Mi).continueRetry(),m(this,Mi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(h=>h.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(M(this,ef,!0),r.signal)})},s=()=>{const p=W8(this.options,t),b=(()=>{const g={client:m(this,Zh),queryKey:this.queryKey,meta:this.meta};return i(g),g})();return M(this,ef,!1),this.options.persister?this.options.persister(p,b,this):p(b)},o=(()=>{const p={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:m(this,Zh),state:this.state,fetchFn:s};return i(p),p})();(c=this.options.behavior)==null||c.onFetch(o,this),M(this,Qh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&U(this,lo,oc).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=p=>{var h,b,g,w;OA(p)&&p.silent||U(this,lo,oc).call(this,{type:"error",error:p}),OA(p)||((b=(h=m(this,ya).config).onError)==null||b.call(h,p,this),(w=(g=m(this,ya).config).onSettled)==null||w.call(g,this.state.data,p,this)),this.scheduleGc()};return M(this,Mi,Y8({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var h,b,g,w;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(y){l(y);return}(b=(h=m(this,ya).config).onSuccess)==null||b.call(h,p,this),(w=(g=m(this,ya).config).onSettled)==null||w.call(g,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,h)=>{U(this,lo,oc).call(this,{type:"failed",failureCount:p,error:h})},onPause:()=>{U(this,lo,oc).call(this,{type:"pause"})},onContinue:()=>{U(this,lo,oc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),m(this,Mi).start()}},sg=new WeakMap,Qh=new WeakMap,ya=new WeakMap,Zh=new WeakMap,Mi=new WeakMap,cy=new WeakMap,ef=new WeakMap,lo=new WeakSet,oc=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...PJ(r.data,this.options),fetchMeta:e.meta??null};case"success":return M(this,Qh,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return OA(i)&&i.revert&&m(this,Qh)?{...m(this,Qh),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),es.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),m(this,ya).notify({query:this,type:"updated",action:e})})},e6);function PJ(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G8(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function jJ(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var nl,t6,RJ=(t6=class extends O5{constructor(e={}){super();q(this,nl);this.config=e,M(this,nl,new Map)}build(e,t,r){const i=t.queryKey,s=t.queryHash??vT(i,t);let a=this.get(s);return a||(a=new TJ({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){m(this,nl).has(e.queryHash)||(m(this,nl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=m(this,nl).get(e.queryHash);t&&(e.destroy(),t===e&&m(this,nl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){es.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return m(this,nl).get(e)}getAll(){return[...m(this,nl).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Kj(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Kj(e,r)):t}notify(e){es.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){es.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){es.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nl=new WeakMap,t6),rl,Qi,tf,il,Pu,n6,LJ=(n6=class extends X8{constructor(e){super();q(this,il);q(this,rl);q(this,Qi);q(this,tf);this.mutationId=e.mutationId,M(this,Qi,e.mutationCache),M(this,rl,[]),this.state=e.state||IJ(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){m(this,rl).includes(e)||(m(this,rl).push(e),this.clearGcTimeout(),m(this,Qi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){M(this,rl,m(this,rl).filter(t=>t!==e)),this.scheduleGc(),m(this,Qi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){m(this,rl).length||(this.state.status==="pending"?this.scheduleGc():m(this,Qi).remove(this))}continue(){var e;return((e=m(this,tf))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,a,o,l,c,u,f,p,h,b,g,w,y,x,S,A,C,T,R,I;const t=()=>{U(this,il,Pu).call(this,{type:"continue"})};M(this,tf,Y8({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{U(this,il,Pu).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{U(this,il,Pu).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>m(this,Qi).canRun(this)}));const r=this.state.status==="pending",i=!m(this,tf).canStart();try{if(r)t();else{U(this,il,Pu).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(s=m(this,Qi).config).onMutate)==null?void 0:a.call(s,e,this));const V=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e));V!==this.state.context&&U(this,il,Pu).call(this,{type:"pending",context:V,variables:e,isPaused:i})}const L=await m(this,tf).start();return await((u=(c=m(this,Qi).config).onSuccess)==null?void 0:u.call(c,L,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,L,e,this.state.context)),await((b=(h=m(this,Qi).config).onSettled)==null?void 0:b.call(h,L,null,this.state.variables,this.state.context,this)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,L,null,e,this.state.context)),U(this,il,Pu).call(this,{type:"success",data:L}),L}catch(L){try{throw await((x=(y=m(this,Qi).config).onError)==null?void 0:x.call(y,L,e,this.state.context,this)),await((A=(S=this.options).onError)==null?void 0:A.call(S,L,e,this.state.context)),await((T=(C=m(this,Qi).config).onSettled)==null?void 0:T.call(C,void 0,L,this.state.variables,this.state.context,this)),await((I=(R=this.options).onSettled)==null?void 0:I.call(R,void 0,L,e,this.state.context)),L}finally{U(this,il,Pu).call(this,{type:"error",error:L})}}finally{m(this,Qi).runNext(this)}}},rl=new WeakMap,Qi=new WeakMap,tf=new WeakMap,il=new WeakSet,Pu=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),es.batch(()=>{m(this,rl).forEach(r=>{r.onMutationUpdate(e)}),m(this,Qi).notify({mutation:this,type:"updated",action:e})})},n6);function IJ(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mc,co,uy,r6,OJ=(r6=class extends O5{constructor(e={}){super();q(this,mc);q(this,co);q(this,uy);this.config=e,M(this,mc,new Set),M(this,co,new Map),M(this,uy,0)}build(e,t,r){const i=new LJ({mutationCache:this,mutationId:++Xr(this,uy)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){m(this,mc).add(e);const t=i2(e);if(typeof t=="string"){const r=m(this,co).get(t);r?r.push(e):m(this,co).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(m(this,mc).delete(e)){const t=i2(e);if(typeof t=="string"){const r=m(this,co).get(t);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&m(this,co).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=i2(e);if(typeof t=="string"){const r=m(this,co).get(t),i=r==null?void 0:r.find(s=>
381s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const t=i2(e);if(typeof t=="string"){const i=(r=m(this,co).get(t))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){es.batch(()=>{m(this,mc).forEach(e=>{this.notify({type:"removed",mutation:e})}),m(this,mc).clear(),m(this,co).clear()})}getAll(){return Array.from(m(this,mc))}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Yj(t,r))}findAll(e={}){return this.getAll().filter(t=>Yj(e,t))}notify(e){es.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return es.batch(()=>Promise.all(e.map(t=>t.continue().catch(so))))}},mc=new WeakMap,co=new WeakMap,uy=new WeakMap,r6);function i2(n){var e;return(e=n.options.scope)==null?void 0:e.id}function Qj(n){return{onFetch:(e,t)=>{var u,f,p,h,b;const r=e.options,i=(p=(f=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],a=((b=e.state.data)==null?void 0:b.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const w=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},y=W8(e.options,e.fetchOptions),x=async(S,A,C)=>{if(g)return Promise.reject();if(A==null&&S.pages.length)return Promise.resolve(S);const R=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:A,direction:C?"backward":"forward",meta:e.options.meta};return w(j),j})(),I=await y(R),{maxPages:L}
vendor: 4,207 bytes, line 381
381=e.options,V=C?_J:xJ;return{pages:V(S.pages,I,L),pageParams:V(S.pageParams,A,L)}};if(i&&s.length){const S=i==="backward",A=S?MJ:Zj,C={pages:s,pageParams:a},T=A(r,C);o=await x(C,T,S)}else{const S=n??s.length;do{const A=l===0?a[0]??r.initialPageParam:Zj(r,o);if(l>0&&A==null)break;o=await x(o,A),l++}while(l<S)}return o};e.options.persister?e.fetchFn=()=>{var g,w;return(w=(g=e.options).persister)==null?void 0:w.call(g,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=c}}}function Zj(n,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,t[r],t):void 0}function MJ(n,{pages:e,pageParams:t}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t):void 0}var cr,Hu,Wu,ag,og,Vu,lg,cg,i6,DJ=(i6=class{constructor(n={}){q(this,cr);q(this,Hu);q(this,Wu);q(this,ag);q(this,og);q(this,Vu);q(this,lg);q(this,cg);M(this,cr,n.queryCache||new RJ),M(this,Hu,n.mutationCache||new OJ),M(this,Wu,n.defaultOptions||{}),M(this,ag,new Map),M(this,og,new Map),M(this,Vu,0)}mount(){Xr(this,Vu)._++,m(this,Vu)===1&&(M(this,lg,V8.subscribe(async n=>{n&&(await this.resumePausedMutations(),m(this,cr).onFocus())})),M(this,cg,p_.subscribe(async n=>{n&&(await this.resumePausedMutations(),m(this,cr).onOnline())})))}unmount(){var n,e;Xr(this,Vu)._--,m(this,Vu)===0&&((n=m(this,lg))==null||n.call(this),M(this,lg,void 0),(e=m(this,cg))==null||e.call(this),M(this,cg,void 0))}isFetching(n){return m(this,cr).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return m(this,Hu).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=m(this,cr).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=m(this,cr).build(this,e),r=t.state.data;return r===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(zN(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(n){return m(this,cr).findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=this.defaultQueryOptions({queryKey:n}),i=m(this,cr).get(r.queryHash),s=i==null?void 0:i.state.data,a=mJ(e,s);if(a!==void 0)return m(this,cr).build(this,r).setData(a,{...t,manual:!0})}setQueriesData(n,e,t){return es.batch(()=>m(this,cr).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=m(this,cr).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=m(this,cr);es.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=m(this,cr);return es.batch(()=>(t.findAll(n).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},r=es.batch(()=>m(this,cr).findAll(n).map(i=>i.cancel(t)));return Promise.all(r).then(so).catch(so)}invalidateQueries(n,e={}){return es.batch(()=>(m(this,cr).findAll(n).forEach(t=>{t.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},r=es.batch(()=>m(this,cr).findAll(n).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,t);return t.throwOnError||(s=s.catch(so)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(so)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=m(this,cr).build(this,e);return t.isStaleByTime(zN(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(so).catch(so)}fetchInfiniteQuery(n){return n.behavior=Qj(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(so).catch(so)}ensureInfiniteQueryData(n){return n.behavior=Qj(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return p_.isOnline()?m(this,Hu).resumePausedMutations():Promise.resolve()}getQueryCache(){return m(this,cr)}getMutationCache(){return m(this,Hu)}getDefaultOptions(){return m(this,Wu)}setDefaultOptions(n){M(this,Wu,n)}
381setQueryDefaults(n,e){m(this,ag).set(H1(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...m(this,ag).values()],t={};return e.forEach(r=>{W1(n,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(n,e){m(this,og).set(H1(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...m(this,og).values()],t={};return e.forEach(r=>{W1(n,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...m(this,Wu).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=vT(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===yT&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...m(this,Wu).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){m(this,cr).clear(),m(this,Hu).clear()}},cr=new WeakMap,Hu=new WeakMap,Wu=new WeakMap,ag=new WeakMap,og=new WeakMap,Vu=new WeakMap,lg=new WeakMap,cg=new WeakMap,i6),FJ=E.createContext(void 0),BJ=({client:n,children:e})=>(E.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),d.jsx(FJ.Provider,{value:n,children:e}));/**
382 * @remix-run/router v1.23.0
383 *
384 * Copyright (c) Remix Software Inc.
385 *
386 * This source code is licensed under the MIT license found in the
387 * LICENSE.md file in the root directory of this source tree.
388 *
389 * @license MIT
390 */function V1(){return V1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},V1.apply(this,arguments)}var _d;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(_d||(_d={}));const eR="popstate";function $J(n){n===void 0&&(n={});function e(r,i){let{pathname:s,search:a,hash:o}=r.location;return HN("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:m_(i)}return zJ(e,t,null,n)}function rr(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function J8(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function UJ(){return Math.random().toString(36).substr(2,8)}function tR(n,e){return{usr:n.state,key:n.key,idx:e}}function HN(n,e,t,r){return t===void 0&&(t=null),V1({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?D0(e):e,{state:t,key:e&&e.key||r||UJ()})}function m_(n){let{pathname:e="/",search:t="",hash:r=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function D0(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function zJ(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=_d.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(V1({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function f(){o=_d.Pop;let w=u(),y=w==null?null:w-c;c=w,l&&l({action:o,location:g.location,delta:y})}function p(w,y){o=_d.Push;let x=HN(g.location,w,y);c=u()+1;let S=tR(x,c),A=g.createHref(x);try{a.pushState(S,"",A)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(A)}s&&l&&l({action:o,location:g.location,delta:1})}function h(w,y){o=_d.Replace;let x=HN(g.location,w,y);c=u();let S=tR(x,c),A=g.createHref(x);a.replaceState(S,"",A),s&&l&&l({action:o,location:g.location,delta:0})}function b(w){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof w=="string"?w:m_(w);return x=x.replace(/ $/,"%20"),rr(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return o},get location(){return n(i,a)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(eR,f),l=w,()=>{i.removeEventListener(eR,f),l=null}},createHref(w){return e(i,w)},createURL:b,encodeLocation(w){let y=b(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(w){return a.go(w)}};return g}var nR;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(nR||(nR={}));function qJ(n,e,t){return t===void 0&&(t="/"),HJ(n,e,t,!1)}function HJ(n,e,t,r){let i=typeof e=="string"?D0(e):e,s=w0(i.pathname||"/",t);if(s==null)return null;let a=Q8(n);WJ(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let c=nQ(s);o=eQ(a[l],c,r)}return o}function Q8(n,e,t,r){e===void 0&&(e=[]),t===void 0&&(t=[]),r===void 0&&(r="");let i=(s,a,o)=>{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(rr(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
390id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Ld([r,l.relativePath]),u=t.concat(l);s.children&&s.children.length>0&&(rr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Q8(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:QJ(c,s.index),routesMeta:u})};return n.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of Z8(s.path))i(s,a,l)}),e}function Z8(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=Z8(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>n.startsWith("/")&&l===""?"/":l)}function WJ(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:ZJ(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}const VJ=/^:[\w-]+$/,GJ=3,KJ=2,YJ=1,XJ=10,JJ=-2,rR=n=>n==="*";function QJ(n,e){let t=n.split("/"),r=t.length;return t.some(rR)&&(r+=JJ),e&&(r+=KJ),t.filter(i=>!rR(i)).reduce((i,s)=>i+(VJ.test(s)?GJ:s===""?YJ:XJ),r)}function ZJ(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function eQ(n,e,t){let{routesMeta:r}=n,i={},s="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],c=o===r.length-1,u=s==="/"?e:e.slice(s.length)||"/",f=g_({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),p=l.route;if(!f&&c&&t&&!r[r.length-1].route.index&&(f=g_({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!f)return null;
vendor: 6,917 bytes, lines 390-399
390Object.assign(i,f.params),a.push({params:i,pathname:Ld([s,f.pathname]),pathnameBase:aQ(Ld([s,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(s=Ld([s,f.pathnameBase]))}return a}function g_(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=tQ(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,u,f)=>{let{paramName:p,isOptional:h}=u;if(p==="*"){let g=o[f]||"";a=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const b=o[f];return h&&!b?c[p]=void 0:c[p]=(b||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:n}}function tQ(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),J8(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(r.push({paramName:"*"}),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function nQ(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return J8(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function w0(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}function rQ(n,e){e===void 0&&(e="/");let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?D0(n):n;return{pathname:t?t.startsWith("/")?t:iQ(t,e):e,search:oQ(r),hash:lQ(i)}}function iQ(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function MA(n,e,t,r){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function sQ(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function bT(n,e){let t=sQ(n);return e?t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):t.map(r=>r.pathnameBase)}function wT(n,e,t,r){r===void 0&&(r=!1);let i;typeof n=="string"?i=D0(n):(i=V1({},n),rr(!i.pathname||!i.pathname.includes("?"),MA("?","pathname","search",i)),rr(!i.pathname||!i.pathname.includes("#"),MA("#","pathname","hash",i)),rr(!i.search||!i.search.includes("#"),MA("#","search","hash",i)));let s=n===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=t;else{let f=e.length-1;if(!r&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}o=f>=0?e[f]:"/"}let l=rQ(i,o),c=a&&a!=="/"&&a.endsWith("/"),u=(s||a===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ld=n=>n.join("/").replace(/\/\/+/g,"/"),aQ=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),oQ=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,lQ=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function cQ(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const eD=["post","put","patch","delete"];new Set(eD);const uQ=["get",...eD];new Set(uQ);/**
391 * React Router v6.30.1
392 *
393 * Copyright (c) Remix Software Inc.
394 *
395 * This source code is licensed under the MIT license found in the
396 * LICENSE.md file in the root directory of this source tree.
397 *
398 * @license MIT
399 */function G1(){return G1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},G1.apply(this,arguments)}const D5=E.createContext(null),tD=E.createContext(null),ru=E.createContext(null),F5=E.createContext(null),iu=E.createContext({outlet:null,matches:[],isDataRoute:!1}),nD=E.createContext(null);function dQ(n,e){let{relative:t}=e===void 0?{}:e;F0()||rr(!1);let{basename:r,navigator:i}=E.useContext(ru),{hash:s,pathname:a,search:o}=B5(n,{relative:t}),l=a;return r!=="/"&&(l=a==="/"?r:Ld([r,a])),i.createHref({pathname:l,search:o,hash:s})}function F0(){return E.useContext(F5)!=null}function su(){return F0()||rr(!1),E.useContext(F5).location}function rD(n){E.useContext(ru).static||E.useLayoutEffect(n)}function Np(){let{isDataRoute:n}=E.useContext(iu);return n?EQ():hQ()}function hQ(){F0()||rr(!1);let n=E.useContext(D5),{basename:e,future:t,navigator:r}=E.useContext(ru),{matches:i}=E.useContext(iu),{pathname:s}=su(),a=JSON.stringify(bT(i,t.v7_relativeSplatPath)),o=E.useRef(!1);return rD(()=>{o.current=!0}),E.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let f=wT(c,JSON.parse(a),s,u.relative==="path");n==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Ld([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,a,s,n])}function fQ(){let{matches:n}=E.useContext(iu),e=n[n.length-1];return e?e.params:{}}function B5(n,e){let{relative:t}=e===void 0?{}:e,{future:r}=E.useContext(ru),{matches:i}=E.useContext(iu),{pathname:s}=su(),a=JSON.stringify(bT(i,r.v7_relativeSplatPath));return E.useMemo(()=>wT(n,JSON.parse(a),s,t==="path"),[n,a,s,t])}function pQ(n,e){return mQ(n,e)}function mQ(n,e,t,r){F0()||rr(!1);let{navigator:i}=E.useContext(ru),{matches:s}=E.useContext(iu),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=su(),u;if(e){var f;let w=typeof e=="string"?D0(e):e;l==="/"||(f=w.pathname)!=null&&f.startsWith(l)||rr(!1),u=w}else u=c;let p=u.pathname||"/",h=p;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=qJ(n,{pathname:h}),g=wQ(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:Ld([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Ld([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,t,r);return e&&g?E.createElement(F5.Provider,{value:{location:G1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:_d.Pop}},g):g}function gQ(){let n=AQ(),e=cQ(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application 
399Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),t?E.createElement("pre",{style:i},t):null,null)}const vQ=E.createElement(gQ,null);class yQ extends E.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?E.createElement(iu.Provider,{value:this.props.routeContext},E.createElement(nD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function bQ(n){let{routeContext:e,match:t,children:r}=n,i=E.useContext(D5);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),E.createElement(iu.Provider,{value:e},r)}function wQ(n,e,t,r){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),r===void 0&&(r=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let a=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let u=a.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);u>=0||rr(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(t&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let f=a[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=u),f.route.id){let{loaderData:p,errors:h}=t,b=f.route.loader&&p[f.route.id]===void 0&&(!h||h[f.route.id]===void 0);if(f.route.lazy||b){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,f,p)=>{let h,b=!1,g=null,w=null;t&&(h=o&&f.route.id?o[f.route.id]:void 0,g=f.route.errorElement||vQ,l&&(c<0&&p===0?(b=!0,w=null):c===p&&(b=!0,w=f.route.hydrateFallbackElement||null)));let y=e.concat(a.slice(0,p+1)),x=()=>{let S;return h?S=g:b?S=w:f.route.Component?S=E.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=u,E.createElement(bQ,{match:f,routeContext:{outlet:u,matches:y,isDataRoute:t!=null},children:S})};return t&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?E.createElement(yQ,{location:t.location,revalidation:t.revalidation,component:g,error:h,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var iD=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(iD||{}),v_=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(v_||{});function xQ(n){let e=E.useContext(D5);return e||rr(!1),e}function _Q(n){let e=E.useContext(tD);return e||rr(!1),e}function SQ(n){let e=E.useContext(iu);return e||rr(!1),e}function sD(n){let e=SQ(),t=e.matches[e.matches.length-1];return t.route.id||rr(!1),t.route.id}function AQ(){var n;let e=E.useContext(nD),t=_Q(v_.UseRouteError),r=sD(v_.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function EQ(){let{router:n}=xQ(iD.UseNavigateStable),e=sD(v_.UseNavigateStable),t=E.useRef(!1);return rD(()=>{t.current=!0}),E.useCallback(function(i,s){s===void 0&&(s={}),t.current&&(typeof i=="number"?n.navigate(i):n.navigate(i,G1({fromRouteId:e},s)))},[n,e])}function NQ(n,e){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function kQ(n){let{to:e,replace:t,state:r,relative:i}=n;F0()||rr(!1);let{future:s,static:a}=E.useContext(ru),{matches:o}=E.useContext(iu),{pathname:l}=su(),c=Np(),u=wT(e,bT(o,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return E.useEffect(()=>c(JSON.parse(f),{replace:t,state:r,relative:i}),[c,f,i,t,r]),null}function ii(n){rr(!1)}function CQ(n){let{basename:e="/",children:t=null,location:r,navigationType:i=_d.Pop,navigator:s,static:a=!1,future:o}=n;F0()&&rr(!1);let l=e.replace(/^\/*/,"/"),c=E.useMemo(()=>({basename:l,navigator:s,static:a,future:G1({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=D0(r));
399let{pathname:u="/",search:f="",hash:p="",state:h=null,key:b="default"}=r,g=E.useMemo(()=>{let w=w0(u,l);return w==null?null:{location:{pathname:w,search:f,hash:p,state:h,key:b},navigationType:i}},[l,u,f,p,h,b,i]);return g==null?null:E.createElement(ru.Provider,{value:c},E.createElement(F5.Provider,{children:t,value:g}))}function aD(n){let{children:e,location:t}=n;return pQ(WN(e),t)}new Promise(()=>{});function WN(n,e){e===void 0&&(e=[]);let t=[];return E.Children.forEach(n,(r,i)=>{if(!E.isValidElement(r))return;let s=[...e,i];if(r.type===E.Fragment){t.push.apply(t,WN(r.props.children,s));return}r.type!==ii&&rr(!1),!r.props.index||!r.props.children||rr(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=WN(r.props.children,s)),t.push(a)}),t}/**
400 * React Router DOM v6.30.1
401 *
402 * Copyright (c) Remix Software Inc.
403 *
404 * This source code is licensed under the MIT license found in the
405 * LICENSE.md file in the root directory of this source tree.
406 *
407 * @license MIT
408 */function y_(){return y_=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},y_.apply(this,arguments)}function oD(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function TQ(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function PQ(n,e){return n.button===0&&(!e||e==="_self")&&!TQ(n)}function VN(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let r=n[t];return e.concat(Array.isArray(r)?r.map(i=>[t,i]):[[t,r]])},[]))}function jQ(n,e){let t=VN(n);return e&&e.forEach((r,i)=>{t.has(i)||e.getAll(i).forEach(s=>{t.append(i,s)})}),t}const RQ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],LQ=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],IQ="6";try{window.__reactRouterVersion=IQ}catch{}const OQ=E.createContext({isTransitioning:!1}),MQ="startTransition",iR=a4[MQ];function DQ(n){let{basename:e,children:t,future:r,window:i}=n,s=E.useRef();s.current==null&&(s.current=$J({window:i,v5Compat:!0}));let a=s.current,[o,l]=E.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=E.useCallback(f=>{c&&iR?iR(()=>l(f)):l(f)},[l,c]);return E.useLayoutEffect(()=>a.listen(u),[a,u]),E.useEffect(()=>NQ(r),[r]),E.createElement(CQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,future:r})}const FQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$n=E.forwardRef(function(e,t){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:c,preventScrollReset:u,viewTransition:f}=e,p=oD(e,RQ),{basename:h}=E.useContext(ru),b,g=!1;if(typeof c=="string"&&BQ.test(c)&&(b=c,FQ))try{let S=new URL(window.location.href),A=c.startsWith("//")?new URL(S.protocol+c):new URL(c),C=w0(A.pathname,h);A.origin===S.origin&&C!=null?c=C+A.search+A.hash:g=!0}catch{}let w=dQ(c,{relative:i}),y=zQ(c,{replace:a,state:o,target:l,preventScrollReset:u,relative:i,viewTransition:f});function x(S){r&&r(S),S.defaultPrevented||y(S)}return E.createElement("a",y_({},p,{href:b||w,onClick:g||s?r:x,ref:t,target:l}))}),$Q=E.forwardRef(function(e,t){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:l,viewTransition:c,children:u}=e,f=oD(e,LQ),p=B5(l,{relative:f.relative}),h=su(),b=E.useContext(tD),{navigator:g,basename:w}=E.useContext(ru),y=b!=null&&HQ(p)&&c===!0,x=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,S=h.pathname,A=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;i||(S=S.toLowerCase(),A=A?A.toLowerCase():null,x=x.toLowerCase()),A&&w&&(A=w0(A,w)||A);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let T=S===x||!a&&S.startsWith(x)&&S.charAt(C)==="/",R=A!=null&&(A===x||!a&&A.startsWith(x)&&A.charAt(x.length)==="/"),I={isActive:T,isPending:R,isTransitioning:y},L=T?r:void 0,V;typeof s=="function"?V=s(I):V=[s,T?"active":null,R?"pending":null,y?"transitioning":null].filter(
vendor: 8,194 bytes, line 408
408Boolean).join(" ");let j=typeof o=="function"?o(I):o;return E.createElement($n,y_({},f,{"aria-current":L,className:V,ref:t,style:j,to:l,viewTransition:c}),typeof u=="function"?u(I):u)});var GN;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(GN||(GN={}));var sR;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(sR||(sR={}));function UQ(n){let e=E.useContext(D5);return e||rr(!1),e}function zQ(n,e){let{target:t,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=e===void 0?{}:e,l=Np(),c=su(),u=B5(n,{relative:a});return E.useCallback(f=>{if(PQ(f,t)){f.preventDefault();let p=r!==void 0?r:m_(c)===m_(u);l(n,{replace:p,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[c,l,u,r,i,t,n,s,a,o])}function qQ(n){let e=E.useRef(VN(n)),t=E.useRef(!1),r=su(),i=E.useMemo(()=>jQ(r.search,t.current?null:e.current),[r.search]),s=Np(),a=E.useCallback((o,l)=>{const c=VN(typeof o=="function"?o(i):o);t.current=!0,s("?"+c,l)},[s,i]);return[i,a]}function HQ(n,e){e===void 0&&(e={});let t=E.useContext(OQ);t==null&&rr(!1);let{basename:r}=UQ(GN.useViewTransitionState),i=B5(n,{relative:e.relative});if(!t.isTransitioning)return!1;let s=w0(t.currentLocation.pathname,r)||t.currentLocation.pathname,a=w0(t.nextLocation.pathname,r)||t.nextLocation.pathname;return g_(i.pathname,a)!=null||g_(i.pathname,s)!=null}var xT={},b_={},KN=function(n,e){return KN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},KN(n,e)};function lD(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");KN(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Na=function(){return Na=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Na.apply(this,arguments)};function Zd(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function cD(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var o=n.length-1;o>=0;o--)(a=n[o])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function uD(n,e){return function(t,r){e(t,r,n)}}function dD(n,e,t,r,i,s){function a(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var o=r.kind,l=o==="getter"?"get":o==="setter"?"set":"value",c=!e&&n?r.static?n:n.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f,p=!1,h=t.length-1;h>=0;h--){var b={};for(var g in r)b[g]=g==="access"?{}:r[g];for(var g in r.access)b.access[g]=r.access[g];b.addInitializer=function(y){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(y||null))};var w=(0,t[h])(o==="accessor"?{get:u.get,set:u.set}:u[l],b);if(o==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(f=a(w.get))&&(u.get=f),(f=a(w.set))&&(u.set=f),(f=a(w.init))&&i.unshift(f)}else(f=a(w))&&(o==="field"?i.unshift(f):u[l]=f)}c&&Object.defineProperty(c,r.name,u),p=!0}function hD(n,e,t){for(var r=arguments.length>2,i=0;i<e.length;i++)t=r?e[i].call(n,t):e[i].call(n);return r?t:void 0}function fD(n){return typeof n=="symbol"?n:"".concat(n)}function pD(n,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function mD(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function Ye(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((r=r.apply(n,e||[])).next())})}function gD(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var $5=Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function vD(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$5(e,n,t)}function w_(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _T(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return s}function yD(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(_T(arguments[e]));return n}function bD(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,i++)r[i]=s[a];return r}function ST(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function x0(n){return this instanceof x0?(this.v=n,this):new x0(n)}function wD(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(h){return function(b){return Promise.resolve(b).then(h,f)}}function o(h,b){r[h]&&(i[h]=function(g){return new Promise(function(w,y){s.push([h,g,w,y])>1||l(h,g)})},b&&(i[h]=b(i[h])))}function l(h,b){try{c(r[h](b))}catch(g){p(s[0][3],g)}}function c(h){h.value instanceof x0?Promise.resolve(h.value.v).then(u,f):p(s[0][2],h)}function u(h){l("next",h)}function f(h){l("throw",h)}function p(h,b){h(b),s.shift(),s.length&&l(s[0][0],s[0][1])}}function xD(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(a){return(t=!t)?{value:x0(n[i](a)
vendor: 3,741 bytes, line 408
408),done:!1}:s?s(a):a}:s}}function _D(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof w_=="function"?w_(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(a){return new Promise(function(o,l){a=n[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}function SD(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var WQ=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},YN=function(n){return YN=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},YN(n)};function AD(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=YN(n),r=0;r<t.length;r++)t[r]!=="default"&&$5(e,n,t[r]);return WQ(e,n),e}function ED(n){return n&&n.__esModule?n:{default:n}}function ND(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function kD(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t}function CD(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}function TD(n,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),n.stack.push({value:e,dispose:r,async:t})}else t&&n.stack.push({async:!0});return e}var VQ=typeof SuppressedError=="function"?SuppressedError:function(n,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=n,r.suppressed=e,r};function PD(n){function e(s){n.error=n.hasError?new VQ(s,n.error,"An error was suppressed during disposal."):s,n.hasError=!0}var t,r=0;function i(){for(;t=n.stack.pop();)try{if(!t.async&&r===1)return r=0,n.stack.push(t),Promise.resolve().then(i);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(s).then(i,function(a){return e(a),i()})}else r|=1}catch(a){e(a)}if(r===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return i()}function jD(n,e){return typeof n=="string"&&/^\.\.?\//.test(n)?n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,i,s,a){return r?e?".jsx":".js":i&&(!s||!a)?t:i+s+"."+a.toLowerCase()+"js"}):n}const GQ={__extends:lD,__assign:Na,__rest:Zd,__decorate:cD,__param:uD,__esDecorate:dD,__runInitializers:hD,__propKey:fD,__setFunctionName:pD,__metadata:mD,__awaiter:Ye,__generator:gD,__createBinding:$5,__exportStar:vD,__values:w_,__read:_T,__spread:yD,__spreadArrays:bD,__spreadArray:ST,__await:x0,__asyncGenerator:wD,__asyncDelegator:xD,__asyncValues:_D,__makeTemplateOb
408ject:SD,__importStar:AD,__importDefault:ED,__classPrivateFieldGet:ND,__classPrivateFieldSet:kD,__classPrivateFieldIn:CD,__addDisposableResource:TD,__disposeResources:PD,__rewriteRelativeImportExtension:jD},KQ=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:TD,get __assign(){return Na},__asyncDelegator:xD,__asyncGenerator:wD,__asyncValues:_D,__await:x0,__awaiter:Ye,__classPrivateFieldGet:ND,__classPrivateFieldIn:CD,__classPrivateFieldSet:kD,__createBinding:$5,__decorate:cD,__disposeResources:PD,__esDecorate:dD,__exportStar:vD,__extends:lD,__generator:gD,__importDefault:ED,__importStar:AD,__makeTemplateObject:SD,__metadata:mD,__param:uD,__propKey:fD,__read:_T,__rest:Zd,__rewriteRelativeImportExtension:jD,__runInitializers:hD,__setFunctionName:pD,__spread:yD,__spreadArray:ST,__spreadArrays:bD,__values:w_,default:GQ},Symbol.toStringTag,{value:"Module"})),YQ=n=>n?(...e)=>n(...e):(...e)=>fetch(...e);let U5=class extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}},RD=class extends U5{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},XN=class extends U5{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},JN=class extends U5{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};var x_;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(x_||(x_={}));class XQ{constructor(e,{headers:t={},customFetch:r,region:i=x_.Any}={}){this.url=e,this.headers=t,this.region=i,this.fetch=YQ(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Ye(this,arguments,void 0,function*(t,r={}){var i;let s,a;try{const{headers:o,method:l,body:c,signal:u,timeout:f}=r;let p={},{region:h}=r;h||(h=this.region);const b=new URL(`${this.url}/${t}`);h&&h!=="any"&&(p["x-region"]=h,b.searchParams.set("forceFunctionRegion",h));let g;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(p["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(p["Content-Type"]="application/json",g=JSON.stringify(c)):g=c;let w=u;f&&(a=new AbortController,s=setTimeout(()=>a.abort(),f),u?(w=a.signal,u.addEventListener("abort",()=>a.abort())):w=a.signal);const y=yield this.fetch(b.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),o),body:g,signal:w}).catch(C=>{throw new RD(C)}),x=y.headers.get("x-relay-error");if(x&&x==="true")throw new XN(y);if(!y.ok)throw new JN(y);let S=((i=y.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),A;return S==="application/json"?A=yield y.json():S==="application/octet-stream"||S==="application/pdf"?A=yield y.blob():S==="text/event-stream"?A=y:S==="multipart/form-data"?A=yield y.formData():A=yield y.text(),{data:A,error:null,response:y}}catch(o){return{data:null,error:o,response:o instanceof JN||o instanceof XN?o.context:void 0}}finally{s&&clearTimeout(s)}})}}const JQ=Object.freeze(Object.defineProperty({__proto__:null,get FunctionRegion(){return x_},FunctionsClient:XQ,FunctionsError:U5,FunctionsFetchError:RD,FunctionsHttpError:JN,FunctionsRelayError:XN},Symbol.toStringTag,{value:"Module"})),LD=Nb(JQ);var zi={};const B0=Nb(KQ);var s2={},a2={},o2={},l2={},c2={},u2={},aR;function ID(){if(aR)return u2;aR=1,Object.defineProperty(u2,"__esModule",{value:!0});class n extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
408de=t.code}}return u2.default=n,u2}var oR;function OD(){if(oR)return c2;oR=1,Object.defineProperty(c2,"__esModule",{value:!0});const e=B0.__importDefault(ID());let t=class{constructor(i){var s,a;this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(s=i.shouldThrowOnError)!==null&&s!==void 0?s:!1,this.signal=i.signal,this.isMaybeSingle=(a=i.isMaybeSingle)!==null&&a!==void 0?a:!1,i.fetch?this.fetch=i.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,s){return this.headers=new Headers(this.headers),this.headers.set(i,s),this}then(i,s){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const a=this.fetch;let o=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var c,u,f,p;let h=null,b=null,g=null,w=l.status,y=l.statusText;if(l.ok){if(this.method!=="HEAD"){const C=await l.text();C===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((c=this.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?b=C:b=JSON.parse(C))}const S=(u=this.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),A=(f=l.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");S&&A&&A.length>1&&(g=parseInt(A[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(b)&&(b.length>1?(h={code:"PGRST116",details:`Results contain ${b.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},b=null,g=null,w=406,y="Not Acceptable"):b.length===1?b=b[0]:b=null)}else{const S=await l.text();try{h=JSON.parse(S),Array.isArray(h)&&l.status===404&&(b=[],h=null,w=200,y="OK")}catch{l.status===404&&S===""?(w=204,y="No Content"):h={message:S}}if(h&&this.isMaybeSingle&&(!((p=h==null?void 0:h.details)===null||p===void 0)&&p.includes("0 rows"))&&(h=null,w=200,y="OK"),h&&this.shouldThrowOnError)throw new e.default(h)}return{error:h,data:b,count:g,status:w,statusText:y}});return this.shouldThrowOnError||(o=o.catch(l=>{var c,u,f,p,h,b;let g="";const w=l==null?void 0:l.cause;if(w){const y=(c=w==null?void 0:w.message)!==null&&c!==void 0?c:"",x=(u=w==null?void 0:w.code)!==null&&u!==void 0?u:"";g=`${(f=l==null?void 0:l.name)!==null&&f!==void 0?f:"FetchError"}: ${l==null?void 0:l.message}`,g+=`
409
410Caused by: ${(p=w==null?void 0:w.name)!==null&&p!==void 0?p:"Error"}: ${y}`,x&&(g+=` (${x})`),w!=null&&w.stack&&(g+=`
411${w.stack}`)}else g=(h=l==null?void 0:l.stack)!==null&&h!==void 0?h:"";return{error:{message:`${(b=l==null?void 0:l.name)!==null&&b!==void 0?b:"FetchError"}: ${l==null?void 0:l.message}`,details:g,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(i,s)}returns(){return this}overrideTypes(){return this}};return c2.default=t,c2}var lR;function MD(){if(lR)return l2;lR=1,Object.defineProperty(l2,"__esModule",{value:!0});const e=B0.__importDefault(OD());let t=class extends e.default{select(i){let s=!1;const a=(i??"*").split("").map(o=>/\s/.test(o)&&!s?"":(o==='"'&&(s=!s),o)).join("");return this.url.searchParams.set("select",a),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:s=!0,nullsFirst:a,foreignTable:o,referencedTable:l=o}={}){const c=l?`${l}.order`:"order",u=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${u?`${u},`:""}${i}.${s?"asc":"desc"}${a===void 0?"":a?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:s,referencedTable:a=s}={}){const o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(o,`${i}`),this}range(i,s,{foreignTable:a,referencedTable:o=a}={}){const l=typeof o>"u"?"offset":`${o}.offset`,c=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${i}`),this.url.searchParams.set(c,`${s-i+1}`),this}abortSignal(i){return this.signal=i,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
411explain({analyze:i=!1,verbose:s=!1,settings:a=!1,buffers:o=!1,wal:l=!1,format:c="text"}={}){var u;const f=[i?"analyze":null,s?"verbose":null,a?"settings":null,o?"buffers":null,l?"wal":null].filter(Boolean).join("|"),p=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${p}"; options=${f};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}};return l2.default=t,l2}var cR;function AT(){if(cR)return o2;cR=1,Object.defineProperty(o2,"__esModule",{value:!0});const e=B0.__importDefault(MD()),t=new RegExp("[,()]");let r=class extends e.default{eq(s,a){return this.url.searchParams.append(s,`eq.${a}`),this}neq(s,a){return this.url.searchParams.append(s,`neq.${a}`),this}gt(s,a){return this.url.searchParams.append(s,`gt.${a}`),this}gte(s,a){return this.url.searchParams.append(s,`gte.${a}`),this}lt(s,a){return this.url.searchParams.append(s,`lt.${a}`),this}lte(s,a){return this.url.searchParams.append(s,`lte.${a}`),this}like(s,a){return this.url.searchParams.append(s,`like.${a}`),this}likeAllOf(s,a){return this.url.searchParams.append(s,`like(all).{${a.join(",")}}`),this}likeAnyOf(s,a){return this.url.searchParams.append(s,`like(any).{${a.join(",")}}`),this}ilike(s,a){return this.url.searchParams.append(s,`ilike.${a}`),this}ilikeAllOf(s,a){return this.url.searchParams.append(s,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(s,a){return this.url.searchParams.append(s,`ilike(any).{${a.join(",")}}`),this}regexMatch(s,a){return this.url.searchParams.append(s,`match.${a}`),this}regexIMatch(s,a){return this.url.searchParams.append(s,`imatch.${a}`),this}is(s,a){return this.url.searchParams.append(s,`is.${a}`),this}isDistinct(s,a){return this.url.searchParams.append(s,`isdistinct.${a}`),this}in(s,a){const o=Array.from(new Set(a)).map(l=>typeof l=="string"&&t.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(s,`in.(${o})`),this}contains(s,a){return typeof a=="string"?this.url.searchParams.append(s,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(s,`cs.{${a.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(a)}`),this}containedBy(s,a){return typeof a=="string"?this.url.searchParams.append(s,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(s,`cd.{${a.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(a)}`),this}rangeGt(s,a){return this.url.searchParams.append(s,`sr.${a}`),this}rangeGte(s,a){return this.url.searchParams.append(s,`nxl.${a}`),this}rangeLt(s,a){return this.url.searchParams.append(s,`sl.${a}`),this}rangeLte(s,a){return this.url.searchParams.append(s,`nxr.${a}`),this}rangeAdjacent(s,a){return this.url.searchParams.append(s,`adj.${a}`),this}overlaps(s,a){return typeof a=="string"?this.url.searchParams.append(s,`ov.${a}`):this.url.searchParams.append(s,`ov.{${a.join(",")}}`),this}textSearch(s,a,{config:o,type:l}={}){let c="";l==="plain"?c="pl":l==="phrase"?c="ph":l==="websearch"&&(c="w");const u=o===void 0?"":`(${o})`;return this.url.searchParams.append(s,`${c}fts${u}.${a}`),this}match(s){return Object.entries(s).forEach(([a,o])=>{this.url.searchParams.append(a,`eq.${o}`)}),this}not(s,a,o){return this.url.searchParams.append(s,`not.${a}.${o}`),this}or(s,{foreignTable:a,referencedTable:o=a}={}){const l=o?`${o}.or`:"or";return this.url.searchParams.append(l,`(${s})`),this}filter(s,a,o){return this.url.searchParams.append(s,`${a}.${o}`),this}};return o2.default=r,o2}var uR;function DD(){if(uR)return a2;uR=1,Object.defineProperty(a2,"__esModule",{value:!0});const e=B0.__importDefault(AT());let t=class{constructor(i,{headers:s={},schema:a,fetch:o}){this.url=i,this.headers=new Headers(s),this.schema=a,this.fetch=o}select(i,s){const{head:a=!1,count:o}=s??{},l=a?"HEAD":"GET";let c=!1;const u=(i??"*").split("").map(f=>/\s/.test(f)&&!c?"":(f==='"'&&(c=!c),f)).join("");return this.url.searchParams.set("select",u),o&&this.headers.append("Prefer",`count=${o}`),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(i,{count:s,defaultToNull:a=!0}={}){var o;const l="POST";if(s&&this.headers.append("Prefer",`count=${s}`),a||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const c=i.reduce((u,f)=>u.concat(Object.keys(f)),[]);if(c.length>0){const u=[...new Set(c)].map(f=>`"${f}"`);this.url.searchParams.set("columns",u.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(i,{onConflict:s,ignoreDuplicates:a=!1,count:o,defaultToNull:l=!0}={}){var c;const u="POST";if(this.headers.append("Prefer",`resolution=${a?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),o&&this.headers.append("Prefer",`count=${o}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const f=i.reduce((p,h)=>p.concat(Object.keys(h)),[]);if(f.length>0){const p=[...new Set(f)].map(h=>`"${h}"`);this.url.searchParams.set("columns",p.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}update(i,{count:s}={}){var a;const o="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}delete({count:i}={}){var s;const a="DELETE";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};return a2.default=t,a2}var dR;function QQ(){if(dR)return s2;
411dR=1,Object.defineProperty(s2,"__esModule",{value:!0});const n=B0,e=n.__importDefault(DD()),t=n.__importDefault(AT());let r=class FD{constructor(s,{headers:a={},schema:o,fetch:l}={}){this.url=s,this.headers=new Headers(a),this.schemaName=o,this.fetch=l}from(s){if(!s||typeof s!="string"||s.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const a=new URL(`${this.url}/${s}`);return new e.default(a,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(s){return new FD(this.url,{headers:this.headers,schema:s,fetch:this.fetch})}rpc(s,a={},{head:o=!1,get:l=!1,count:c}={}){var u;let f;const p=new URL(`${this.url}/rpc/${s}`);let h;o||l?(f=o?"HEAD":"GET",Object.entries(a).filter(([g,w])=>w!==void 0).map(([g,w])=>[g,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([g,w])=>{p.searchParams.append(g,w)})):(f="POST",h=a);const b=new Headers(this.headers);return c&&b.set("Prefer",`count=${c}`),new t.default({method:f,url:p,headers:b,schema:this.schemaName,body:h,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};return s2.default=r,s2}Object.defineProperty(zi,"__esModule",{value:!0});zi.PostgrestError=zi.PostgrestBuilder=zi.PostgrestTransformBuilder=zi.PostgrestFilterBuilder=zi.PostgrestQueryBuilder=zi.PostgrestClient=void 0;const $0=B0,BD=$0.__importDefault(QQ());zi.PostgrestClient=BD.default;const $D=$0.__importDefault(DD());zi.PostgrestQueryBuilder=$D.default;const UD=$0.__importDefault(AT());zi.PostgrestFilterBuilder=UD.default;const zD=$0.__importDefault(MD());zi.PostgrestTransformBuilder=zD.default;const qD=$0.__importDefault(OD());zi.PostgrestBuilder=qD.default;const HD=$0.__importDefault(ID());zi.PostgrestError=HD.default;zi.default={PostgrestClient:BD.default,PostgrestQueryBuilder:$D.default,PostgrestFilterBuilder:UD.default,PostgrestTransformBuilder:zD.default,PostgrestBuilder:qD.default,PostgrestError:HD.default};class WD{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const t=process.versions;if(t&&t.node){const r=t.node,i=parseInt(r.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
412import ws from "ws"
413new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
414
415Suggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){const r=this.getWebSocketConstructor();return new r(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const ZQ="2.86.2",eZ=`realtime-js/${ZQ}
415`,VD="1.0.0",tZ="2.0.0",hR=VD,QN=1e4,nZ=1e3,rZ=100;var Dh;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(Dh||(Dh={}));var Tr;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(Tr||(Tr={}));var Eo;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(Eo||(Eo={}));var ZN;(function(n){n.websocket="websocket"})(ZN||(ZN={}));var Fh;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(Fh||(Fh={}));class iZ{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return t(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer((t=e.payload)===null||t===void 0?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;const i=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var t,r;const i=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,t,r){var i,s;const a=e.topic,o=(i=e.ref)!==null&&i!==void 0?i:"",l=(s=e.join_ref)!==null&&s!==void 0?s:"",c=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+c.length+f.length,h=new ArrayBuffer(this.HEADER_LENGTH+p);let b=new DataView(h),g=0;b.setUint8(g++,this.KINDS.userBroadcastPush),b.setUint8(g++,l.length),b.setUint8(g++,o.length),b.setUint8(g++,a.length),b.setUint8(g++,c.length),b.setUint8(g++,f.length),b.setUint8(g++,t),Array.from(l,y=>b.setUint8(g++,y.charCodeAt(0))),Array.from(o,y=>b.setUint8(g++,y.charCodeAt(0))),Array.from(a,y=>b.setUint8(g++,y.charCodeAt(0))),Array.from(c,y=>b.setUint8(g++,y.charCodeAt(0))),Array.from(f,y=>b.setUint8(g++,y.charCodeAt(0)));var w=new Uint8Array(h.byteLength+r.byteLength);return w.set(new Uint8Array(h),0),w.set(new Uint8Array(r),h.byteLength),w.buffer}decode(e,t){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return t(r)}if(typeof e=="string"){const r=JSON.parse(e),[i,s,a,o,l]=r;return t({join_ref:i,ref:s,topic:a,event:o,payload:l})}return t({})}_binaryDecode(e){const t=new DataView(e),r=t.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,i)}}_decodeUserBroadcast(e,t,r){const i=t.getUint8(1),s=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4);let l=this.HEADER_LENGTH+4;const c=r.decode(e.slice(l,l+i));l=l+i;const u=r.decode(e.slice(l,l+s));l=l+s;const f=r.decode(e.slice(l,l+a));l=l+a;const p=e.slice(l,e.byteLength),h=o===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,b={type:this.BROADCAST_EVENT,event:u,payload:h};return a>0&&(b.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>t.includes(r)))}}class GD{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Rn;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(Rn||(Rn={}));const fR=(n,e,t={})=>{var r;const i=(r=t.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=sZ(a,n,e,i),s),{}):{}},sZ=(n,e,t,r)=>{const i=e.find(o=>o.name===n),s=i==null?void 0:i.type,a=t[n];return s&&!r.includes(s)?KD(s,a):ek(a)},KD=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return cZ(e,t)}switch(n){case Rn.bool:return aZ(e);case Rn.float4:case Rn.float8:case Rn.int2:case Rn.int4:case Rn.int8:case Rn.numeric:case Rn.oid:return oZ(e);case Rn.json:case Rn.jsonb:return lZ(e);case Rn.timestamp:return uZ(e);case Rn.abstime:case Rn.date:case Rn.daterange:case Rn.int4range:case Rn.int8range:case Rn.money:case Rn.reltime:case Rn.text:case Rn.time:case Rn.timestamptz:case Rn.timetz:case Rn.tsrange:case Rn.tstzrange:return ek(e);default:return ek(e)}},ek=n=>n,aZ=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},oZ=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},lZ=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},cZ=(n,e)=>
415{if(typeof n!="string")return n;const t=n.length-1,r=n[t];if(n[0]==="{"&&r==="}"){let s;const a=n.slice(1,t);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>KD(e,o))}return n},uZ=n=>typeof n=="string"?n.replace(" ","T"):n,YD=n=>{const e=new URL(n);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class DA{constructor(e,t,r={},i=QN){this.channel=e,this.event=t,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var tk;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(tk||(tk={}));let XD=class X2{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=X2.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=X2.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=X2.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,i){const s=this.cloneDeep(e),a=this.transformState(t),o={},l={};return this.map(s,(c,u)=>{a[c]||(l[c]=u)}),this.map(a,(c,u)=>{const f=s[c];if(f){const p=u.map(w=>w.presence_ref),h=f.map(w=>w.presence_ref),b=u.filter(w=>h.indexOf(w.presence_ref)<0),g=f.filter(w=>p.indexOf(w.presence_ref)<0);b.length>0&&(o[c]=b),g.length>0&&(l[c]=g)}else o[c]=u}),this.syncDiff(s,{joins:o,leaves:l},r,i)}static syncDiff(e,t,r,i){const{joins:s,leaves:a}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(o,l)=>{var c;const u=(c=e[o])!==null&&c!==void 0?c:[];if(e[o]=this.cloneDeep(l),u.length>0){const f=e[o].map(h=>h.presence_ref),p=u.filter(h=>f.indexOf(h.presence_ref)<0);e[o].unshift(...p)}r(o,u,l)}),this.map(a,(o,l)=>{let c=e[o];if(!c)return;const u=l.map(f=>f.presence_ref);c=c.filter(f=>u.indexOf(f.presence_ref)<0),e[o]=c,i(o,c,l),c.length===0&&delete e[o]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const i=e[r];return"metas"in i?t[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):t[r]=i,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var nk;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(nk||(nk={}));var Um;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(Um||(Um={}));var tl;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(tl||(tl={}));const dZ=Tr;let JD=class QD{constructor(e,t={config:{}},r){var i,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=Tr.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new DA(this,Eo.join,this.params,this.timeout),this.rejoinTimer=new GD(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Tr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Tr.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Tr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Tr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Tr.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Eo.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new XD(this),this.broadcastEndpointURL=YD(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,t=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Tr.closed){const{config:{broadcast:a,presence:o,private:l}}=this.params,c=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&i!==void 0?i:[],u=!!this.bindings[Um.PRESENCE]&&this.bindings[Um.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,f={},p={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>e==null?void 0:e(tl.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(tl.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:h})=>{var b;if(this.socket.setAuth(),h===void 0){e==null||e(tl.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,w=(b=g==null?void 0:g.length)!==null&&b!==void 0?b:0,y=[];for(let x=0;x<w;x++){const S=g[x],{filter:{event:A,schema:C,table:T,filter:R}}=S,I=h&&h[x];if(I&&I.event===A&&I.schema===C&&I.table===T&&I.filter===R)y.push(Object.assign(Object.assign({},S),{id:I.id}));else{this.unsubscribe(),this.state=Tr.errored,e==null||e(tl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,e&&e(tl.SUBSCRIBED);return}}).receive("error",h=>{this.state=Tr.errored,e==null||e(tl.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(tl.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){return this.state===Tr.joined&&e===Um.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,t,r)}async httpSend(e,t,r={}){var i;const s=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(t==null)return Promise.reject("Payload is required for httpSend()");const a={method:"POST",headers:{Authorization:s,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;
415try{const c=await o.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(e,t={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:a}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,l;const c=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),c.receive("ok",()=>s("ok")),c.receive("error",()=>s("error")),c.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Tr.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Eo.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new DA(this,Eo.leave,{},e),r.receive("ok",()=>{t(),i("ok")}).receive("timeout",()=>{t(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Tr.closed,this.bindings={}}async _fetchWithTimeout(e,t,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:i.signal}));return clearTimeout(s),a}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new DA(this,e,t,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>rZ){const t=this.pushBuffer.shift();t&&(t.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${t.event}`,t.payload))}}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var i,s;const a=e.toLocaleLowerCase(),{close:o,error:l,leave:c,join:u}=Eo;if(r&&[o,l,c,u].indexOf(a)>=0&&r!==this._joinRef())return;let p=this._onMessage(a,t,r);if(t&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(h=>{var b,g,w;return((b=h.filter)===null||b===void 0?void 0:b.event)==="*"||((w=(g=h.filter)===null||g===void 0?void 0:g.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===a}).map(h=>h.callback(p,r)):(s=this.bindings[a])===null||s===void 0||s.filter(h=>{var b,g,w,y,x,S;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in h){const A=h.id,C=(b=h.filter)===null||b===void 0?void 0:b.event;return A&&((g=t.ids)===null||g===void 0?void 0:g.includes(A))&&(C==="*"||(C==null?void 0:C.toLocaleLowerCase())===((w=t.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))}else{const A=(x=(y=h==null?void 0:h.filter)===null||y===void 0?void 0:y.event)===null||x===void 0?void 0:x.toLocaleLowerCase();return A==="*"||A===((S=t==null?void 0:t.event)===null||S===void 0?void 0:S.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===a}).map(h=>{if(typeof p=="object"&&"ids"in p){const b=p.data,{schema:g,table:w,commit_timestamp:y,type:x,errors:S}=b;p=Object.assign(Object.assign({},{schema:g,table:w,commit_timestamp:y,eventType:x,new:{},old:{},errors:S}),this._getPayloadRecords(b))}h.callback(p,r)})}_isClosed(){return this.state===Tr.closed}_isJoined(){return this.state===Tr.joined}_isJoining(){return this.state===Tr.joining}_isLeaving(){return this.state===Tr.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){const i=e.toLocaleLowerCase(),s={type:i,filter:t,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(e,t){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&QD.isEqual(i.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Eo.close,{},e)}_onError(e){this._on(Eo.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Tr.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=fR(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=fR(e.columns,e.old_record)),t}};const FA=()=>{},d2={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},hZ=[1e3,2e3,5e3,1e4],fZ=1e4,pZ=`
416  addEventListener("message", (e) => {
417    if (e.data.event === "start") {
418      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
419    }
420  });`;let mZ=class{constructor(e,t){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=QN,this.transport=null,this.heartbeatIntervalMs=d2.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=FA,this.ref=0,this.reconnectTimer=null,this.vsn=hR,this.logger=FA,this.conn=null,this.sendBuffer=[],this.serializer
420=new iZ,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=i=>i?(...s)=>i(...s):(...s)=>fetch(...s),!(!((r=t==null?void 0:t.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${ZN.websocket}`,this.httpEndpoint=YD(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(t==null?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=WD.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;throw t.includes("Node.js")?new Error(`${t}
421
422To use Realtime in Node.js, you need to provide a WebSocket implementation:
423
424Option 1: Use Node.js 22+ which has native WebSocket support
425Option 2: Install and provide the "ws" package:
426
427  npm install ws
428
429  import ws from "ws"
430  const client = new RealtimeClient(url, {
431    ...options,
432    transport: ws
433  })`):new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,t??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Dh.connecting:return Fh.Connecting;case Dh.open:return Fh.Open;case Dh.closing:return Fh.Closing;default:return Fh.Closed}}isConnected(){return this.connectionState()===Fh.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,t={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new JD(`realtime:${e}`,t,this);return this.channels.push(s),s}}push(e){const{topic:t,event:r,payload:i,ref:s}=e,a=()=>{this.encode(e,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${t} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(nZ,"heartbeat timeout"),setTimeout(()=>{var t;this.isConnected()||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout()},d2.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
4330&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,t=>{if(t.topic==="phoenix"&&t.event==="phx_reply")try{this.heartbeatCallback(t.payload.status==="ok"?"ok":"error")}catch(c){this.log("error","error in heartbeat callback",c)}t.ref&&t.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:i,payload:s,ref:a}=t,o=a?`(${a})`:"",l=s.status||"";this.log("receive",`${l} ${r} ${i} ${o}`.trim(),s),this.channels.filter(c=>c._isMember(r)).forEach(c=>c._trigger(i,s,a)),this._triggerStateCallbacks("message",t)})}_clearTimer(e){var t;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((t=this.reconnectTimer)===null||t===void 0||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===Dh.open||this.conn.readyState===Dh.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(t=>{this.log("error","error waiting for auth on connect",t),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Eo.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(t);return`${e}${r}${i}`}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([pZ],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}_setConnectionState(e,t=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t;e?t=e:this.accessToken?t=await this.accessToken():t=this.accessTokenValue,this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(r=>{const i={access_token:t,version:eZ};t&&r.updateJoinPayload(i),r.joinedOnce&&r._isJoined()&&r._push(Eo.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(t=>{this.log("error",`error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(t)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new GD(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},d2.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var t,r,i,s,a,o,l,c,u,f,p,h;switch(this.transport=(t=e==null?void 0:e.transport)!==null&&t!==void 0?t:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:QN,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:d2.HEARTBEAT_INTERVAL,this.worker=(s=e==null?void 0:e.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=e==null?void 0:e.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:FA,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:hR,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:b=>hZ[b-1]||fZ,this.vsn){case VD:this.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:(b,g)=>g(JSON.stringify(b)),this.decode=(f=e==null?void 0:e.decode)!==null&&f!==void 0?f:(b,g)=>g(JSON.parse(b));break;case tZ:this.encode=(p=e==null?void 0:e.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}};const gZ=Object.freeze(Object.defineProperty({__proto__:null,REALTIME_CHANNEL_STATES:dZ,get REALTIME_LISTEN_TYPES(){return Um},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return nk},get REALTIME_PRESENCE_LISTEN_EVENTS(){return tk},get REALTIME_SUBSCRIBE_STATES(){return tl},RealtimeChannel:JD,RealtimeClient:mZ,RealtimePresence:XD,WebSocketFactory:WD},Symbol.toStringTag,{value:"Module"})),ZD=Nb(gZ);
433class Fb extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Kn(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class eF extends Fb{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class __ extends Fb{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}const ET=n=>n?(...e)=>n(...e):(...e)=>fetch(...e),vZ=()=>Response,rk=n=>{if(Array.isArray(n))return n.map(t=>rk(t));if(typeof n=="function"||n!==Object(n))return n;const e={};return Object.entries(n).forEach(([t,r])=>{const i=t.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=rk(r)}),e},yZ=n=>{if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},bZ=n=>!n||typeof n!="string"||n.length===0||n.length>100||n.trim()!==n||n.includes("/")||n.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(n),BA=n=>{var e;return n.msg||n.message||n.error_description||(typeof n.error=="string"?n.error:(e=n.error)===null||e===void 0?void 0:e.message)||JSON.stringify(n)},wZ=(n,e,t)=>Ye(void 0,void 0,void 0,function*(){const r=yield vZ();n instanceof r&&!(t!=null&&t.noResolveJson)?n.json().then(i=>{const s=n.status||500,a=(i==null?void 0:i.statusCode)||s+"";e(new eF(BA(i),s,a))}).catch(i=>{e(new __(BA(i),i))}):e(new __(BA(n),n))}),xZ=(n,e,t,r)=>{const i={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"||!r?i:(yZ(r)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,e!=null&&e.duplex&&(i.duplex=e.duplex),Object.assign(Object.assign({},i),t))};function Bb(n,e,t,r,i,s){return Ye(this,void 0,void 0,function*(){return new Promise((a,o)=>{n(t,xZ(e,r,i,s)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>a(l)).catch(l=>wZ(l,o,r))})})}function K1(n,e,t,r){return Ye(this,void 0,void 0,function*(){return Bb(n,"GET",e,t,r)})}function ao(n,e,t,r,i){return Ye(this,void 0,void 0,function*(){return Bb(n,"POST",e,r,i,t)})}function ik(n,e,t,r,i){return Ye(this,void 0,void 0,function*(){return Bb(n,"PUT",e,r,i,t)})}function _Z(n,e,t,r){return Ye(this,void 0,void 0,function*(){return Bb(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),r)})}function NT(n,e,t,r,i){return Ye(this,void 0,void 0,function*(){return Bb(n,"DELETE",e,r,i,t)})}class SZ{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}execute(){return Ye(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Kn(e))return{data:null,error:e};throw e}})}}var tF;class AZ{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[tF]="BlobDownloadBuilder",this.promise=null}asStream(){return new SZ(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return Ye(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Kn(e))return{data:null,error:e};throw e}})}}tF=Symbol.toStringTag;const EZ={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},pR={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class NZ{constructor(e,t={},r,i){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=ET(i)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,t,r,i){return Ye(this,void 0,void 0,function*(){try{let s;const a=Object.assign(Object.assign({},pR),i);let o=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",this.encodeMetadata(l)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),l&&!s.has("metadata")&&s.append("metadata",this.encodeMetadata(l))):(s=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),i!=null&&i.headers&&(o=Object.assign(Object.assign({},o),i.headers));const c=this._removeEmptyFolders(t),u=this._getFinalPath(c),f=yield(e=="PUT"?ik:ao)(this.fetch,`${this.url}/object/${u}`,s,Object.assign({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{data:{path:c,id:f.Id,fullPath:f.Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Kn(s))return{data:null,error:s};throw s}})}upload(e,t,r){return Ye(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}
433uploadToSignedUrl(e,t,r,i){return Ye(this,void 0,void 0,function*(){const s=this._removeEmptyFolders(e),a=this._getFinalPath(s),o=new URL(this.url+`/object/upload/sign/${a}`);o.searchParams.set("token",t);try{let l;const c=Object.assign({upsert:pR.upsert},i),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",c.cacheControl)):(l=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType);const f=yield ik(this.fetch,o.toString(),l,{headers:u});return{data:{path:s,fullPath:f.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(Kn(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,t){return Ye(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const i=Object.assign({},this.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const s=yield ao(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(this.url+s.url),o=a.searchParams.get("token");if(!o)throw new Fb("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:o},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Kn(r))return{data:null,error:r};throw r}})}update(e,t,r){return Ye(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t,r){return Ye(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,de
433stinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}copy(e,t,r){return Ye(this,void 0,void 0,function*(){try{return{data:{path:(yield ao(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}createSignedUrl(e,t,r){return Ye(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),s=yield ao(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${a}`)},{data:s,error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}createSignedUrls(e,t,r){return Ye(this,void 0,void 0,function*(){try{const i=yield ao(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${s}`):null})),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}download(e,t){const i=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=s?`?${s}`:"",o=this._getFinalPath(e),l=()=>K1(this.fetch,`${this.url}/${i}/${o}${a}`,{headers:this.headers,noResolveJson:!0});return new AZ(l,this.shouldThrowOnError)}info(e){return Ye(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const r=yield K1(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:rk(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Kn(r))return{data:null,error:r};throw r}})}exists(e){return Ye(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield _Z(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Kn(r)&&r instanceof __){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,t){const r=this._getFinalPath(e),i=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&i.push(s);const o=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});l!==""&&i.push(l);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${c}`)}}}remove(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield NT(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}list(e,t,r){return Ye(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},EZ),t),{prefix:e||""});return{data:yield ao(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}listV2(e,t){return Ye(this,void 0,void 0,function*(){try{const r=Object.assign({},e);return{data:yield ao(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},t),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Kn(r))return{data:null,error:r};throw r}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const nF="2.86.2",rF={"X-Client-Info":`storage-js/${nF}`};class kZ{constructor(e,t={},r,i){this.shouldThrowOnError=!1;const s=new URL(e);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),this.url=s.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},rF),t),this.fetch=ET(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return Ye(this,void 0,void 0,function*(){try{const t=this.listBucketOptionsToQueryString(e);return{data:yield K1(this.fetch,`${this.url}/bucket${t}`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}getBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield K1(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}createBucket(e){return Ye(this,arguments,void 0,function*(t,r={public:!1}){try{return{data:yield ao(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Kn(i))return{data:null,error:i};throw i}})}updateBucket(e,t){return Ye(this,void 0,void 0,function*(){try{return{data:yield ik(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Kn(r))return{data:null,error:r};throw r}})}emptyBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}deleteBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield NT(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}}
433var Y1=class extends Error{constructor(n,e){var t;super(n),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((t=e.icebergType)==null?void 0:t.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function CZ(n,e,t){const r=new URL(e,n);if(t)for(const[i,s]of Object.entries(t))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function TZ(n){return!n||n.type==="none"?{}:n.type==="bearer"?{Authorization:`Bearer ${n.token}`}:n.type==="header"?{[n.name]:n.value}:n.type==="custom"?await n.getHeaders():{}}function PZ(n){const e=n.fetchImpl??globalThis.fetch;return{async request({method:t,path:r,query:i,body:s,headers:a}){const o=CZ(n.baseUrl,r,i),l=await TZ(n.auth),c=await e(o,{method:t,headers:{...s?{"Content-Type":"application/json"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),u=await c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),p=f&&u?JSON.parse(u):u;if(!c.ok){const h=f?p:void 0,b=h==null?void 0:h.error;throw new Y1((b==null?void 0:b.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:b==null?void 0:b.type,icebergCode:b==null?void 0:b.code,details:h})}return{status:c.status,headers:c.headers,data:p}}}}function h2(n){return n.join("�")}var jZ=class{constructor(n,e=""){this.client=n,this.prefix=e}async listNamespaces(n){const e=n?{parent:h2(n.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(n,e){const t={namespace:n.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:t})).data}async dropNamespace(n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${h2(n.namespace)}`})}async loadNamespaceMetadata(n){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${h2(n.namespace)}`})).data.properties}}async namespaceExists(n){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${h2(n.namespace)}`}),!0}catch(e){if(e instanceof Y1&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(n,e){try{return await this.createNamespace(n,e)}catch(t){if(t instanceof Y1&&t.status===409)return;throw t}}};function Kp(n){return n.join("�")}var RZ=class{constructor(n,e="",t){this.client=n,this.prefix=e,this.accessDelegation=t}async listTables(n){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables`})).data.identifiers}async createTable(n,e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables`,body:e,headers:t})).data.metadata}async updateTable(n,e){const t=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables/${n.name}`,body:e});return{"metadata-location":t.data["metadata-location"],metadata:t.data.metadata}}async dropTable(n,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables/${n.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(n){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables/${n.name}`,headers:e})).data.metadata}async tableExists(n){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Kp(n.namespace)}/tables/${n.name}`,headers:e}),!0}catch(t){if(t instanceof Y1&&t.status===404)return!1;throw t}}async createTableIfNotExists(n,e){try{return await this.createTable(n,e)}catch(t){if(t instanceof Y1&&t.status===409)return await this.loadTable({namespace:n.namespace,name:e.name});throw t}}},LZ=class{constructor(n){var r;let e="v1";n.catalogName&&(e+=`/${n.catalogName}`);const t=n.baseUrl.endsWith("/")?n.baseUrl:`${n.baseUrl}/`;this.client=PZ({baseUrl:t,auth:n.auth,fetchImpl:n.fetch}),this.accessDelegation=(r=n.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new jZ(this.client,e),this.tableOps=new RZ(this.client,e,this.accessDelegation)}async listNamespaces(n){return this.namespaceOps.listNamespaces(n)}async createNamespace(n,e){return this.namespaceOps.createNamespace(n,e)}async dropNamespace(n){await this.namespaceOps.dropNamespace(n)}async loadNamespaceMetadata(n){return this.namespaceOps.loadNamespaceMetadata(n)}async listTables(n){return this.tableOps.listTables(n)}
433async createTable(n,e){return this.tableOps.createTable(n,e)}async updateTable(n,e){return this.tableOps.updateTable(n,e)}async dropTable(n,e){await this.tableOps.dropTable(n,e)}async loadTable(n){return this.tableOps.loadTable(n)}async namespaceExists(n){return this.namespaceOps.namespaceExists(n)}async tableExists(n){return this.tableOps.tableExists(n)}async createNamespaceIfNotExists(n,e){return this.namespaceOps.createNamespaceIfNotExists(n,e)}async createTableIfNotExists(n,e){return this.tableOps.createTableIfNotExists(n,e)}};class iF{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},rF),t),this.fetch=ET(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}listBuckets(e){return Ye(this,void 0,void 0,function*(){try{const t=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&t.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&t.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&t.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&t.set("sortOrder",e.sortOrder),e!=null&&e.search&&t.set("search",e.search);const r=t.toString(),i=r?`${this.url}/bucket?${r}`:`${this.url}/bucket`;return{data:yield K1(this.fetch,i,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}deleteBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield NT(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Kn(t))return{data:null,error:t};throw t}})}from(e){if(!bZ(e))throw new Fb("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new LZ({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:()=>Ye(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const kT={"X-Client-Info":`storage-js/${nF}`,"Content-Type":"application/json"};class CT extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function xs(n){return typeof n=="object"&&n!==null&&"__isStorageVectorsError"in n}class J2 extends CT{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class sF extends CT{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}}var sk;(function(n){n.InternalError="InternalError",n.S3VectorConflictException="S3VectorConflictException",n.S3VectorNotFoundException="S3VectorNotFoundException",n.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",n.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",n.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(sk||(sk={}));const z5=n=>n?(...e)=>n(...e):(...e)=>fetch(...e),IZ=()=>Response,aF=n=>{if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},OZ=n=>Array.from(new Float32Array(n)),MZ=(n,e)=>{if(e!==void 0&&n.float32.length!==e)throw new Error(`Vector dimension mismatch: expected ${e}, got ${n.float32.length}`)},mR=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),DZ=(n,e,t)=>Ye(void 0,void 0,void 0,function*(){if(n&&typeof n=="object"&&"status"in n&&"ok"in n&&typeof n.status=="number"&&!(t!=null&&t.noResolveJson)){const i=n.status||500,s=n;if(typeof s.json=="function")s.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||i+"";e(new J2(mR(a),i,o))}).catch(()=>{const a=i+"",o=s.statusText||`HTTP ${i} error`;e(new J2(o,i,a))});else{const a=i+"",o=s.statusText||`HTTP ${i} error`;e(new J2(o,i,a))}}else e(new sF(mR(n),n))}),FZ=(n,e,t,r)=>{const i={method:n,headers:(e==null?void 0:e.headers)||{}};return r?(aF(r)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,Object.assign(Object.assign({},i),t)):i};function BZ(n,e,t,r,i,s){return Ye(this,void 0,void 0,function*(){return new Promise((a,o)=>{n(t,FZ(e,r,i,s)).then(l=>{if(!l.ok)throw l;if(r!=null&&r.noResolveJson)return l;const c=l.headers.get("content-type");return!c||!c.includes("application/json")?{}:l.json()}).then(l=>a(l)).catch(l=>DZ(l,o,r))})})}function Qs(n,e,t,r,i){return Ye(this,void 0,void 0,function*(){return BZ(n,"POST",e,r,i,t)})}class oF{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},kT),t),this.fetch=z5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return Ye(this,void 0,void 0,function*(){try{return{data:(yield Qs(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}getIndex(e,t){return Ye(this,void 0,void 0,function*(){try{return{data:yield Qs(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xs(r))return{data:null,error:r};throw r}})}listIndexes(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield Qs(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}deleteIndex(e,t){return Ye(this,void 0,void 0,function*(){try{return{data:(yield Qs(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xs(r))return{data:null,error:r};throw r}})}}class lF{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},kT),t),this.fetch=z5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return Ye(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield Qs(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}getVectors(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield Qs(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}listVectors(e){return Ye(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
433if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield Qs(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}queryVectors(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield Qs(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}deleteVectors(e){return Ye(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield Qs(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}}class cF{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},kT),t),this.fetch=z5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:(yield Qs(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}getBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:yield Qs(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}listBuckets(){return Ye(this,arguments,void 0,function*(e={}){try{return{data:yield Qs(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}deleteBucket(e){return Ye(this,void 0,void 0,function*(){try{return{data:(yield Qs(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xs(t))return{data:null,error:t};throw t}})}}class uF extends cF{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new dF(this.url,this.headers,e,this.fetch)}createBucket(e){const t=Object.create(null,{createBucket:{get:()=>super.createBucket}});return Ye(this,void 0,void 0,function*(){return t.createBucket.call(this,e)})}getBucket(e){const t=Object.create(null,{getBucket:{get:()=>super.getBucket}});return Ye(this,void 0,void 0,function*(){return t.getBucket.call(this,e)})}listBuckets(){const e=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return Ye(this,arguments,void 0,function*(t={}){return e.listBuckets.call(this,t)})}deleteBucket(e){const t=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return Ye(this,void 0,void 0,function*(){return t.deleteBucket.call(this,e)})}}
433class dF extends oF{constructor(e,t,r,i){super(e,t,i),this.vectorBucketName=r}createIndex(e){const t=Object.create(null,{createIndex:{get:()=>super.createIndex}});return Ye(this,void 0,void 0,function*(){return t.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return Ye(this,arguments,void 0,function*(t={}){return e.listIndexes.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const t=Object.create(null,{getIndex:{get:()=>super.getIndex}});return Ye(this,void 0,void 0,function*(){return t.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const t=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return Ye(this,void 0,void 0,function*(){return t.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new hF(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class hF extends lF{constructor(e,t,r,i,s){super(e,t,s),this.vectorBucketName=r,this.indexName=i}putVectors(e){const t=Object.create(null,{putVectors:{get:()=>super.putVectors}});return Ye(this,void 0,void 0,function*(){return t.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const t=Object.create(null,{getVectors:{get:()=>super.getVectors}});return Ye(this,void 0,void 0,function*(){return t.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return Ye(this,arguments,void 0,function*(t={}){return e.listVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const t=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return Ye(this,void 0,void 0,function*(){return t.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const t=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return Ye(this,void 0,void 0,function*(){return t.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class $Z extends kZ{constructor(e,t={},r,i){super(e,t,r,i)}from(e){return new NZ(this.url,this.headers,e,this.fetch)}get vectors(){return new uF(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new iF(this.url+"/iceberg",this.headers,this.fetch)}}const UZ=Object.freeze(Object.defineProperty({__proto__:null,StorageAnalyticsClient:iF,StorageApiError:eF,StorageClient:$Z,StorageError:Fb,StorageUnknownError:__,StorageVectorsApiError:J2,StorageVectorsClient:uF,StorageVectorsError:CT,get StorageVectorsErrorCode(){return sk},StorageVectorsUnknownError:sF,VectorBucketApi:cF,VectorBucketScope:dF,VectorDataApi:lF,VectorIndexApi:oF,VectorIndexScope:hF,isPlainObject:aF,isStorageError:Kn,isStorageVectorsError:xs,normalizeToFloat32:OZ,resolveFetch:z5,resolveResponse:IZ,validateVectorDimension:MZ},Symbol.toStringTag,{value:"Module"})),zZ=Nb(UZ);var fF={},q5={};Object.defineProperty(q5,"__esModule",{value:!0});q5.version=void 0;q5.version="2.86.2";(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_REALTIME_OPTIONS=n.DEFAULT_AUTH_OPTIONS=n.DEFAULT_DB_OPTIONS=n.DEFAULT_GLOBAL_OPTIONS=n.DEFAULT_HEADERS=void 0;const e=q5;let t="";typeof Deno<"u"?t="deno":typeof document<"u"?t="web":typeof navigator<"u"&&navigator.product==="ReactNative"?t="react-native":t="node",n.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${t}/${e.version}`},n.DEFAULT_GLOBAL_OPTIONS={headers:n.DEFAULT_HEADERS},n.DEFAULT_DB_OPTIONS={schema:"public"},n.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},n.DEFAULT_REALTIME_OPTIONS={}})(fF);var pF={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.fetchWithAuth=n.resolveHeadersConstructor=n.resolveFetch=void 0;const e=i=>i?(...s)=>i(...s):(...s)=>fetch(...s);n.resolveFetch=e;const t=()=>Headers;n.resolveHeadersConstructor=t;const r=(i,s,a)=>{const o=(0,n.resolveFetch)(a),l=(0,n.resolveHeadersConstructor)();return async(c,u)=>{var f;const p=(f=await s())!==null&&f!==void 0?f:i;let h=new l(u==null?void 0:u.headers);return h.has("apikey")||h.set("apikey",i),h.has("Authorization")||h.set("Authorization",`Bearer ${p}`),o(c,Object.assign(Object.assign({},u),{headers:h}))}};n.fetchWithAuth=r})(pF);var eh={};Object.defineProperty(eh,"__esModule",{value:!0});eh.isBrowser=void 0;eh.uuid=qZ;eh.ensureTrailingSlash=mF;eh.applySettingDefaults=WZ;eh.validateSupabaseUrl=VZ;function qZ(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var e=Math.random()*16|0,t=n=="x"?e:e&3|8;return t.toString(16)})}function mF(n){return n.endsWith("/")?n:n+"/"}const HZ=()=>typeof window<"u";eh.isBrowser=HZ;function WZ(n,e){var t,r;const{db:i,auth:s,realtime:a,global:o}=n,{db:l,auth:c,realtime:u,global:f}=e,p={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},c),s),realtime:Object.assign(Object.assign({},u),a),storage:{},global:Object.assign(Object.assign(Object.assign({},f),o),{headers:Object.assign(Object.assign({},(t=f==null?void 0:f.headers)!==null&&t!==void 0?t:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return n.accessToken?p.accessToken=n.accessToken:delete p.accessToken,p}function VZ(n){const e=n==null?void 0:n.trim();if(!e)throw new Error("supabaseUrl is required.");
433if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(mF(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var H5={};const gF="2.86.2",om=30*1e3,ak=3,$A=ak*om,GZ="http://localhost:9999",KZ="supabase.auth.token",YZ={"X-Client-Info":`gotrue-js/${gF}`},ok="X-Supabase-Api-Version",vF={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},XZ=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,JZ=10*60*1e3;let _0=class extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}};function ot(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}let yF=class extends _0{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}};function bF(n){return ot(n)&&n.name==="AuthApiError"}let Fu=class extends _0{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}},au=class extends _0{constructor(e,t,r,i){super(e,r,i),this.name=t,this.status=r}},fs=class extends au{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function wF(n){return ot(n)&&n.name==="AuthSessionMissingError"}let Ch=class extends au{constructor(){super("Auth session or user missing","AuthInvalidToken
433ResponseError",500,void 0)}},Bv=class extends au{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},$v=class extends au{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function xF(n){return ot(n)&&n.name==="AuthImplicitGrantRedirectError"}let lk=class extends au{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},S_=class extends au{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}};function Q2(n){return ot(n)&&n.name==="AuthRetryableFetchError"}let ck=class extends au{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}};function QZ(n){return ot(n)&&n.name==="AuthWeakPasswordError"}let A_=class extends au{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}};const E_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),gR=` 	
434\r=`.split(""),ZZ=(()=>{const n=new Array(128);for(let e=0;e<n.length;e+=1)n[e]=-1;for(let e=0;e<gR.length;e+=1)n[gR[e].charCodeAt(0)]=-2;for(let e=0;e<E_.length;e+=1)n[E_[e].charCodeAt(0)]=e;return n})();function vR(n,e,t){if(n!==null)for(e.queue=e.queue<<8|n,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(E_[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(E_[r]),e.queuedBits-=6}}function _F(n,e,t){const r=ZZ[n];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(n)}"`)}}function yR(n){const e=[],t=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{nee(a,r,t)};for(let a=0;a<n.length;a+=1)_F(n.charCodeAt(a),i,s);return e.join("")}function eee(n,e){if(n<=127){e(n);return}else if(n<=2047){e(192|n>>6),e(128|n&63);return}else if(n<=65535){e(224|n>>12),e(128|n>>6&63),e(128|n&63);return}else if(n<=1114111){e(240|n>>18),e(128|n>>12&63),e(128|n>>6&63),e(128|n&63);return}throw new Error(`Unrecognized Unicode codepoint: ${n.toString(16)}`)}function tee(n,e){for(let t=0;t<n.length;t+=1){let r=n.charCodeAt(t);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(n.charCodeAt(t+1)-56320&65535|i)+65536,t+=1}eee(r,e)}}function nee(n,e,t){if(e.utf8seq===0){if(n<=127){t(n);return}for(let r=1;r<6;r+=1)if(!(n>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=n&31;else if(e.utf8seq===3)e.codepoint=n&15;else if(e.utf8seq===4)e.codepoint=n&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(n<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|n&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function zm(n){const e=[],t={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<n.length;i+=1)_F(n.charCodeAt(i),t,r);return new Uint8Array(e)}function ree(n){const e=[];return tee(n,t=>e.push(t)),new Uint8Array(e)}function Wh(n){const e=[],t={queue:0,queuedBits:0},r=i=>{e.push(i)};return n.forEach(i=>vR(i,t,r)),vR(null,t,r),e.join("")}function iee(n){return Math.round(Date.now()/1e3)+n}function see(){return Symbol("auth-callback")}const vi=()=>typeof window<"u"&&typeof document<"u",_h={tested:!1,writable:!1},SF=()=>{if(!vi())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_h.tested)return _h.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),_h.tested=!0,_h.writable=!0}catch{_h.tested=!0,_h.writable=!1}return _h.writable};function aee(n){const e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((i,s)=>{e[s]=i})}catch{}return t.searchParams.forEach((r,i)=>{e[i]=r}),e}const AF=n=>n?(...e)=>n(...e):(...e)=>fetch(...e),oee=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",lm=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},Sh=async(n,e)=>{const t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},gi=async(n,e)=>{await n.removeItem(e)};class W5{constructor(){this.promise=new W5.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}W5.promiseConstructor=Promise;function UA(n){const e=n.split(".");if(e.length!==3)throw new A_("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!XZ.test(e[r]))throw new A_("JWT not in base64url format");return{header:JSON.parse(yR(e[0])),payload:JSON.parse(yR(e[1])),signature:zm(e[2]),raw:{header:e[0],payload:e[1]}}}async function lee(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function cee(n,e){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await n(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function uee(n){return("0"+n.toString(16)).substr(-2)}function dee(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length;let i="";for(let s=0;s<56;s++)i+=t.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,uee).join("")}async function hee(n){const t=new TextEncoder().encode(n),r=await crypto.subtle.digest("SHA-256",t),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function fee(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code 
434challenge method will default to use plain instead of sha256."),n;const t=await hee(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Yp(n,e,t=!1){const r=dee();let i=r;t&&(i+="/PASSWORD_RECOVERY"),await lm(n,`${e}-code-verifier`,i);const s=await fee(r);return[s,r===s?"plain":"s256"]}const pee=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function mee(n){const e=n.headers.get(ok);if(!e||!e.match(pee))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function gee(n){if(!n)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(n<=e)throw new Error("JWT has expired")}function vee(n){switch(n){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const yee=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Xp(n){if(!yee.test(n))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function zA(){const n={};return new Proxy(n,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const r=t.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function bee(n,e){return new Proxy(n,{get:(t,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(t,r,i)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(t,r,i)}})}function bR(n){return JSON.parse(JSON.stringify(n))}const Th=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),wee=[502,503,504];async function wR(n){var e;if(!oee(n))throw new S_(Th(n),0);if(wee.includes(n.status))throw new S_(Th(n),n.status);let t;try{t=await n.json()}catch(s){throw new Fu(Th(s),s)}let r;const i=mee(n);if(i&&i.getTime()>=vF["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new ck(Th(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new fs}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new ck(Th(t),n.status,t.weak_password.reasons);throw new yF(Th(t),n.status||500,r)}const xee=(n,e,t,r)=>{const i={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),t))};async function _t(n,e,t,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[ok]||(s[ok]=vF["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await _ee(n,e,t+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function _ee(n,e,t,r,i,s){const a=xee(e,r,i,s);let o;try{o=await n(t,Object.assign({},a))}catch(l){throw console.error(l),new S_(Th(l),0)}if(o.ok||await wR(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await wR(l)}}function eo(n){var e;let t=null;Eee(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=iee(n.expires_in)));const r=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:r},error:null}}function xR(n){const e=eo(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=n.weak_password),e}function Bu(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function See(n){return{data:n,error:null}}function Aee(n){const{action_link:e,email_otp:t,hashed_token:r,redirect_to:i,verification_type:s}=n,a=Zd(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:t,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function _R(n){return n}function Eee(n){return n.access_token&&n.refresh_token&&n.expires_in}const Z2=["global","local","others"];let TT=class{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=AF(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,t=Z2[0]){if(Z2.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Z2.join(", ")}`);try{return await _t(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await _t(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Bu})}catch(r){if(ot(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:t}=e,r=Zd(e,["options"]),i=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await _t(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:Aee,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(ot(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await _t(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Bu})}catch(t){if(ot(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,i,s,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},u=await _t(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:_R});if(u.error)throw u.error;const f=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,h=(l=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return h.length>
4340&&(h.forEach(b=>{const g=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(b.split(";")[1].split("=")[1]);c[`${w}Page`]=g}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ot(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Xp(e);try{return await _t(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Bu})}catch(t){if(ot(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){Xp(e);try{return await _t(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Bu})}catch(r){if(ot(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,t=!1){Xp(e);try{return await _t(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Bu})}catch(r){if(ot(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Xp(e.userId);try{const{data:t,error:r}=await _t(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:t,error:r}}catch(t){if(ot(t))return{data:null,error:t};throw t}}async _deleteFactor(e){Xp(e.userId),Xp(e.id);try{return{data:await _t(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,r,i,s,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},u=await _t(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:_R});if(u.error)throw u.error;const f=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,h=(l=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(b=>{const g=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(b.split(";")[1].split("=")[1]);c[`${w}Page`]=g}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ot(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await _t(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(ot(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await _t(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(ot(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await _t(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await _t(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await _t(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(ot(t))return{data:null,error:t};throw t}}};function SR(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}const Ph={debug:!!(globalThis&&SF()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class PT extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}let EF=class extends PT{};class Nee extends PT{}async function NF(n,e,t){Ph.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),Ph.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal}
434,async i=>{if(i){Ph.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,i.name);try{return await t()}finally{Ph.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,i.name)}}else{if(e===0)throw Ph.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new EF(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(Ph.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null,"  "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await t()}}))}const AR={};async function kee(n,e,t){var r;const i=(r=AR[n])!==null&&r!==void 0?r:Promise.resolve(),s=Promise.race([i.catch(()=>null),e>=0?new Promise((a,o)=>{setTimeout(()=>{o(new Nee(`Acquring process lock with name "${n}" timed out`))},e)}):null].filter(a=>a)).catch(a=>{if(a&&a.isAcquireTimeout)throw a;return null}).then(async()=>await t());return AR[n]=s.catch(async a=>{if(a&&a.isAcquireTimeout)return await i,null;throw a}),await s}function Cee(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function kF(n){if(!/^0x[a-fA-F0-9]{40}$/.test(n))throw new Error(`@supabase/auth-js: Address "${n}" is invalid.`);return n.toLowerCase()}function Tee(n){return parseInt(n,16)}function Pee(n){const e=new TextEncoder().encode(n);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function jee(n){var e;const{chainId:t,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:l,resources:c,scheme:u,uri:f,version:p}=n;{if(!Number.isInteger(t))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=n.statement)===null||e===void 0)&&e.includes(`
435`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${n.statement}`)}const h=kF(n.address),b=u?`${u}://${r}
435`:r,g=n.statement?`${n.statement}
436`:"",w=`${b} wants you to sign in with your Ethereum account:
437${h}
438
439${g}`;let y=`URI: ${f}
440Version: ${p}
441Chain ID: ${t}${a?`
442Nonce: ${a}`:""}
443Issued At: ${s.toISOString()}`;if(i&&(y+=`
444Expiration Time: ${i.toISOString()}`),o&&(y+=`
445Not Before: ${o.toISOString()}`),l&&(y+=`
446Request ID: ${l}`),c){let x=`
447Resources:`;for(const S of c){if(!S||typeof S!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${S}`);x+=`
448- ${S}`}y+=x}return`${w}
449${y}`}class jr extends Error{constructor({message:e,code:t,cause:r,name:i}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=t}}class N_ extends jr{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function Ree({error:n,options:e}){var t,r,i;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(n.name==="AbortError"){if(e.signal instanceof AbortSignal)return new jr({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:n})}else if(n.name==="ConstraintError"){if(((t=s.authenticatorSelection)===null||t===void 0?void 0:t.requireResidentKey)===!0)return new jr({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:n});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new jr({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:n});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new jr({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:n})}else{if(n.name==="InvalidStateError")return new jr({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:n});if(n.name==="NotAllowedError")return new jr({message:n.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n});if(n.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new jr({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:n}):new jr({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:n});if(n.name==="SecurityError"){const a=window.location.hostname;if(CF(a)){if(s.rp.id!==a)return new jr({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:n})}else return new jr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:n})}else if(n.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new jr({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:n})}else if(n.name==="UnknownError")return new jr({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:n})}return new jr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n})}function Lee({error:n,options:e}){const{publicKey:t}=e;if(!t)throw Error("options was missing required publicKey property");if(n.name==="AbortError"){if(e.signal instanceof AbortSignal)return new jr({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:n})}else{if(n.name==="NotAllowedError")return new jr({message:n.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n});if(n.name==="SecurityError"){const r=window.location.hostname;if(CF(r)){if(t.rpId!==r)return new jr({message:`The RP ID "${t.rpId}
449" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:n})}else return new jr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:n})}else if(n.name==="UnknownError")return new jr({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:n})}return new jr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n})}class Iee{createNewAbortSignal(){if(this.controller){const t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Oee=new Iee;function Mee(n){if(!n)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(n);const{challenge:e,user:t,excludeCredentials:r}=n,i=Zd(n,["challenge","user","excludeCredentials"]),s=zm(e).buffer,a=Object.assign(Object.assign({},t),{id:zm(t.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const c=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:zm(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function Dee(n){if(!n)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(n);const{challenge:e,allowCredentials:t}=n,r=Zd(n,["challenge","allowCredentials"]),i=zm(e).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(t&&t.length>0){s.allowCredentials=new Array(t.length);for(let a=0;a<t.length;a++){const o=t[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:zm(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function Fee(n){var e;if("toJSON"in n&&typeof n.toJSON=="function")return n.toJSON();const t=n;return{id:n.id,rawId:n.id,response:{attestationObject:Wh(new Uint8Array(n.response.attestationObject)),clientDataJSON:Wh(new Uint8Array(n.response.clientDataJSON))},type:"public-key",clientExtensionResults:n.getClientExtensionResults(),authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Bee(n){var e;if("toJSON"in n&&typeof n.toJSON=="function")return n.toJSON();const t=n,r=n.getClientExtensionResults(),i=n.response;return{id:n.id,rawId:n.id,response:{authenticatorData:Wh(new Uint8Array(i.authenticatorData)),clientDataJSON:Wh(new Uint8Array(i.clientDataJSON)),signature:Wh(new Uint8Array(i.signature)),userHandle:i.userHandle?Wh(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function CF(n){return n==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(n)}function ER(){var n,e;return!!(vi()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((n=navigator==null?void 0:navigator.credentials)===null||n===void 0?void 0:n.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function $ee(n){try{const e=await navigator.credentials.create(n);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new N_("Browser returned unexpected credential type",e)}:{data:null,error:new N_("Empty credential response",e)}}catch(e){return{data:null,error:Ree({error:e,options:n})}}}async function Uee(n){try{const e=await navigator.credentials.get(n);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new N_("Browser returned unexpected credential type",e)}:{data:null,error:new N_("Empty credential response",e)}}catch(e){return{data:null,error:Lee({error:e,options:n})}}}const zee={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},qee={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function k_(...n){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),t=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of n)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(t(a))r[s]=a;else if(e(a)){const o=r[s];e(o)?r[s]=k_(o,a):r[s]=k_(a)}else r[s]=a}return r}function Hee(n,e){return k_(zee,n,e||{})}function Wee(n,e){return k_(qee,n,e||{})}class Vee{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:i},s){try{const{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};const l=i??Oee.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:c}=a.webauthn.credential_options.publicKey;c.name||(c.name=`${c.id}:${r}`),c.displayName||(c.displayName=c.name)}switch(a.webauthn.type){case"create":{const c=Hee(a.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:u,error:f}=await $ee({publicKey:c,signal:l});return u?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:u}},error:null}:{data:null,error:f}}case"request":{const c=Wee(a.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:u,error:f}=await Uee(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:c,signal:l}));return u?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:u}},error:null}:{data:null,error:f}}}}catch(a){return ot(a)?{data:null,error:a}:{data:null,error:new Fu("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!t)return{data:null,error:new _0("rpId is required for WebAuthn authentication")};try{if(!ER())return{data:null,error:new Fu("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:t,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return ot(a)?{data:null,error:a}:{data:null,error:new Fu("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!t)return{data:null,error:new _0("rpId is required for WebAuthn registration")};try{if(!ER())return{data:null,error:new Fu("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(u=>{var f;return(f=u.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:o};const{data:l,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:i},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:t,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(a){return ot(a)?{data:null,error:a}:{data:null,error:new Fu("Unexpected error in register",a)}}}}Cee();const Gee={url:GZ,storageKey:KZ,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:YZ,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function NR(n,e,t){return await t()}const Jp={};let jT=class uk{get jwks(){var e,t;return(t=(e=Jp[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){Jp[this.storageKey]=Object.assign(Object.assign({},Jp[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=Jp[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Jp[this.storageKey]=Object.assign(Object.assign({},Jp[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},Gee),e);if(this.storageKey=s.storageKey,this.instanceID=(t=uk.nextInstanceID[this.storageKey])!==null&&t!==void 0?t:0,uk.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&vi()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new TT({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=AF(s.fetch),this.lock=s.lock||NR,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,s.lock?this.lock=s.lock:vi()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=NF:this.lock=NR,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Vee(this)}
449,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:SF()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=SR(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=SR(this.memoryStorage)),vi()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${gF}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let t={},r="none";if(vi()&&(t=aee(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),vi()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(t,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),xF(s)){const l=(e=s.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return ot(t)?this._returnResult({error:t}):this._returnResult({error:new Fu("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,i;try{const s=await _t(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:eo}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(ot(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var t,r,i;try{let s;if("email"in e){const{email:u,password:f,options:p}=e;let h=null,b=null;this.flowType==="pkce"&&([h,b]=await Yp(this.storage,this.storageKey)),s=await _t(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:f,data:(t=p==null?void 0:p.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:h,code_challenge_method:b},xform:eo})}else if("phone"in e){const{phone:u,password:f,options:p}=e;s=await _t(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(i=p==null?void 0:p.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:eo})}else throw new Bv("You must provide either an email or phone number and a password");const{data:a,error:o}=s;
449if(o||!a)return await gi(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let t;if("email"in e){const{email:s,password:a,options:o}=e;t=await _t(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:xR})}else if("phone"in e){const{phone:s,password:a,options:o}=e;t=await _t(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:xR})}else throw new Bv("You must provide either an email or phone number and a password");const{data:r,error:i}=t;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new Ch;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(t){if(ot(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,r,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,i,s,a,o,l,c,u,f,p;let h,b;if("message"in e)h=e.message,b=e.signature;else{const{chain:g,wallet:w,statement:y,options:x}=e;let S;if(vi())if(typeof w=="object")S=w;else{const L=window;if("ethereum"in L&&typeof L.ethereum=="object"&&"request"in L.ethereum&&typeof L.ethereum.request=="function")S=L.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=w}const A=new URL((t=x==null?void 0:x.url)!==null&&t!==void 0?t:window.location.href),C=await S.request({method:"eth_requestAccounts"}).then(L=>L).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!C||C.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=kF(C[0]);let R=(r=x==null?void 0:x.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!R){const L=await S.request({method:"eth_chainId"});R=Tee(L)}const I={domain:A.host,address:T,statement:y,uri:A.href,version:"1",chainId:R,nonce:(i=x==null?void 0:x.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=x==null?void 0:x.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=x==null?void 0:x.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=x==null?void 0:x.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=x==null?void 0:x.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=x==null?void 0:x.signInWithEthereum)===null||u===void 0?void 0:u.resources};h=jee(I),b=await S.request({method:"personal_sign",params:[Pee(h),T]})}try{const{data:g,error:w}=await _t(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:b},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:eo});if(w)throw w;if(!g||!g.session||!g.user){const y=new Ch;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:w})}catch(g){if(ot(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var t,r,i,s,a,o,l,c,u,f,p,h;let b,g;if("message"in e)b=e.message,g=e.signature;else{const{chain:w,wallet:y,statement:x,options:S}=e;let A;if(vi())if(typeof y=="object")A=y;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))A=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=y}const C=new URL((t=S==null?void 0:S.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in A&&A.signIn){const T=await A.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},S==null?void 0:S.signInWithSolana),{version:"1",domain:C.host,uri:C.href}),x?{statement:x}:null));let R;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")R=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)R=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in R&&"signature"in R&&(typeof R.signedMessage=="string"||R.signedMessage instanceof Uint8Array)&&R.signature instanceof Uint8Array)b=typeof R.signedMessage=="string"?R.signedMessage:new TextDecoder().decode(R.signedMessage),g=R.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in A)||typeof A.signMessage!="function"||!("publicKey"in A)||typeof A!="object"||!A.publicKey||!("toBase58"in A.publicKey)||typeof A.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${C.host} wants you to sign in with your Solana account:`,A.publicKey.toBase58(),...x?["",x,""]:[""],"Version: 1",`URI: ${C.href}`,`Issued At: ${(i=(r=S==null?void 0:S.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=S==null?void 0:S.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${S.signInWithSolana.notBefore}`]:[],...!((a=S==null?void 0:S.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${S.signInWithSolana.expirationTime}`]:[],...!((o=S==null?void 0:S.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${S.signInWithSolana.chainId}`]:[],...!((l=S==null?void 0:S.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${S.signInWithSolana.nonce}`]:[],...!((c=S==null?void 0:S.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${S.signInWithSolana.requestId}`]:[],...!((f=(u=S==null?void 0:S.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...S.signInWithSolana.resources.map(R=>`- ${R}`)]:[]].join(`
450`);const T=await A.signMessage(new TextEncoder().encode(b),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=T}}try{const{data:w,error:y}=await _t(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:Wh(g)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:eo});if(y)throw y;if(!w||!w.session||!w.user){const x=new Ch;return this._returnResult({data:{user:null,session:null},error:x})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:y})}catch(w){if(ot(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(e){const t=await Sh(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(t??"").split("/");try{const{data:s,error:a}=await _t(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:eo});if(await gi(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new Ch;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:t,provider:r,token:i,access_token:s,nonce:a}=e,o=await _t(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:eo}),{data:l,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new Ch;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(t){if(ot(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,r,i,s,a;try{if("email"in e){const{email:o,options:l}=e;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Yp(this.storage,this.storageKey));const{error:f}=await _t(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(t=l==null?void 0:l.data)!==null&&t!==void 0?t:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:o,options:l}=e,{data:c,error:u}=await _t(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new Bv("You must provide either an email or phone number.")}catch(o){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,r;try{let i,s;"options"in e&&(i=(t=e.options)===null||t===void 0?void 0:t.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await _t(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:eo});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,c=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(ot(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var t,r,i,s,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await Yp(this.storage,this.storageKey));const c=await _t(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
450:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:See});return!((s=c.data)===null||s===void 0)&&s.url&&vi()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new fs;const{error:i}=await _t(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(ot(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:s}=e,{error:a}=await _t(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:i,options:s}=e,{data:a,error:o}=await _t(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new Bv("You must provide either an email or phone number and a type")}catch(t){if(ot(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await Sh(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<$A:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const a=await Sh(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=zA()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=bee(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const t=await this._acquireLock(-1,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await _t(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Bu}):await this._useSession(async t=>{var r,i,s;const{data:a,error:o}=t;if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new fs}:await _t(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Bu})})}catch(t){if(ot(t))return wF(t)&&(await this._removeSession(),await gi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new fs;const a=i.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await Yp(this.storage,this.storageKey));const{data:c,error:u}=await _t(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({}
450,e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:Bu});if(u)throw u;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new fs;const t=Date.now()/1e3;let r=t,i=!0,s=null;const{payload:a}=UA(e.access_token);if(a.exp&&(r=a.exp,i=r<=t),i){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)throw l;s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(t){if(ot(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){const{data:a,error:o}=t;if(o)throw o;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new fs;const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(ot(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){try{if(!vi())throw new $v("No browser detected.");if(e.error||e.error_description||e.error_code)throw new $v(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new lk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new $v("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new lk("No code detected.");const{data:x,error:S}=await this._exchangeCodeForSession(e.code);if(S)throw S;const A=new URL(window.location.href);return A.searchParams.delete("code"),window.history.replaceState(window.history.state,"",A.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:l,token_type:c}=e;if(!s||!o||!a||!c)throw new $v("No session defined in URL");const u=Math.round(Date.now()/1e3),f=parseInt(o);let p=u+f;l&&(p=parseInt(l));const h=p-u;h*1e3<=om&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const b=p-f;u-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,p,u):u-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,p,u);const{data:g,error:w}=await this._getUser(s);if(w)throw w;const y={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:f,expires_at:p,refresh_token:a,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:e.type},error:null})}catch(r){if(ot(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await Sh(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;const{data:i,error:s}=t;if(s)return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);
450if(o&&!(bF(o)&&(o.status===404||o.status===401||o.status===403)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await gi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=see(),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,i;try{const{data:{session:s},error:a}=t;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,t={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Yp(this.storage,this.storageKey,!0));try{return await _t(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(s){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,l,c,u;const{data:f,error:p}=s;if(p)throw p;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await _t(this.fetch,"GET",h,{headers:this.headers,jwt:(u=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(i)throw i;return vi()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(ot(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{const{error:i,data:{session:s}}=t;if(i)throw i;const{options:a,provider:o,token:l,access_token:c,nonce:u}=e,f=await _t(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:eo}),{data:p,error:h}=f;return h?this._returnResult({data:{user:null,session:null},error:h}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new Ch}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:h}))}catch(i){if(await gi(this.storage,`${this.storageKey}-code-verifier`),ot(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,i;const{data:s,error:a}=t;if(a)throw a;return await _t(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const r=Date.now();return await cee(async i=>(i>0&&await lee(200*Math.pow(2,i-1)),this._debug(t,"refreshing attempt",i),await _t(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:eo})),(i,s)=>{const a=200*Math.pow(2,i);return s&&Q2(s)&&Date.now()+a-r<om})}catch(r){if(this._debug(t,"error",r),ot(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),vi()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await Sh(this.storage,this.storageKey);if(i&&this.userStorage){let a=await Sh(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await lm(this.userStorage,this.storageKey+"-user",a)),i.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:zA()}else if(i&&!i.user&&!i.user){const a=await Sh(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await gi(this.storage,this.storageKey+"-user"),await lm(this.storage,this.storageKey,i)):i.user=zA()}
450if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((t=i.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<$A;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${$A}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),Q2(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new fs;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new W5;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new fs;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),ot(s)){const a={data:null,error:s};return Q2(s)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,t,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,t)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await gi(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),r=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&t.user&&await lm(this.userStorage,this.storageKey+"-user",{user:t.user});const i=Object.assign({},t);delete i.user;const s=bR(i);await lm(this.storage,this.storageKey,s)}else{const i=bR(t);await lm(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await gi(this.storage,this.storageKey),await gi(this.storage,this.storageKey+"-code-verifier"),await gi(this.storage,this.storageKey+"-user"),this.userStorage&&await gi(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&vi()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),om);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/om);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${om}ms, refresh threshold is ${ak} ticks`),i<=ak&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof PT)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!vi()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
450await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){const i=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await Yp(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;const{data:i,error:s}=t;return s?this._returnResult({data:null,error:s}):await _t(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,i;const{data:s,error:a}=t;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:c}=await _t(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Fee(e.webauthn.credential_response):Bee(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await _t(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});const a=await _t(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Mee(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Dee(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}})}async _challengeAndVerify(e){const{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=t==null?void 0:t.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(){var e,t;const{data:{session:r},error:i}
450=await this.getSession();if(i)return this._returnResult({data:null,error:i});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:s}=UA(r.access_token);let a=null;s.aal&&(a=s.aal);let o=a;((t=(e=r.user.factors)===null||e===void 0?void 0:e.filter(u=>u.status==="verified"))!==null&&t!==void 0?t:[]).length>0&&(o="aal2");const c=s.amr||[];return{data:{currentLevel:a,nextLevel:o,currentAuthenticationMethods:c},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:r},error:i}=t;return i?this._returnResult({data:null,error:i}):r?await _t(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new fs})})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new fs});const a=await _t(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&vi()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new fs});const a=await _t(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&vi()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await _t(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new fs})})}catch(e){if(ot(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:r},error:i}=t;return i?this._returnResult({data:null,error:i}):r?(await _t(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new fs})})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(o=>o.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+JZ>i)return r;const{data:s,error:a}=await _t(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,t={}){try{let r=e;if(!r){const{data:h,error:b}
450=await this.getSession();if(b||!h.session)return this._returnResult({data:null,error:b});r=h.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:l}}=UA(r);t!=null&&t.allowExpired||gee(s.exp);const c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,t!=null&&t.keys?{keys:t.keys}:t==null?void 0:t.jwks);if(!c){const{error:h}=await this.getUser(r);if(h)throw h;return{data:{claims:s,header:i,signature:a},error:null}}const u=vee(i.alg),f=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,a,ree(`${o}.${l}`)))throw new A_("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}};jT.nextInstanceID={};const Kee=TT,Yee=jT,Xee=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:Kee,AuthApiError:yF,AuthClient:Yee,AuthError:_0,AuthImplicitGrantRedirectError:$v,AuthInvalidCredentialsError:Bv,AuthInvalidJwtError:A_,AuthInvalidToken
450ResponseError:Ch,AuthPKCEGrantCodeExchangeError:lk,AuthRetryableFetchError:S_,AuthSessionMissingError:fs,AuthUnknownError:Fu,AuthWeakPasswordError:ck,CustomAuthError:au,GoTrueAdminApi:TT,GoTrueClient:jT,NavigatorLockAcquireTimeoutError:EF,SIGN_OUT_SCOPES:Z2,isAuthApiError:bF,isAuthError:ot,isAuthImplicitGrantRedirectError:xF,isAuthRetryableFetchError:Q2,isAuthSessionMissingError:wF,isAuthWeakPasswordError:QZ,lockInternals:Ph,navigatorLock:NF,processLock:kee},Symbol.toStringTag,{value:"Module"})),TF=Nb(Xee);Object.defineProperty(H5,"__esModule",{value:!0});H5.SupabaseAuthClient=void 0;const Jee=TF;class Qee extends Jee.AuthClient{constructor(e){super(e)}}H5.SupabaseAuthClient=Qee;Object.defineProperty(b_,"__esModule",{value:!0});const Zee=LD,ete=zi,tte=ZD,nte=zZ,f2=fF,rte=pF,kR=eh,ite=H5;let ste=class{constructor(e,t,r){var i,s,a;this.supabaseUrl=e,this.supabaseKey=t;const o=(0,kR.validateSupabaseUrl)(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const l=`sb-${o.hostname.split(".")[0]}-auth-token`,c={db:f2.DEFAULT_DB_OPTIONS,realtime:f2.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},f2.DEFAULT_AUTH_OPTIONS),{storageKey:l}),global:f2.DEFAULT_GLOBAL_OPTIONS},u=(0,kR.applySettingDefaults)(r??{},c);this.storageKey=(i=u.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=u.global.headers)!==null&&s!==void 0?s:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=u.auth)!==null&&a!==void 0?a:{},this.headers,u.global.fetch),this.fetch=(0,rte.fetchWithAuth)(t,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.accessToken&&this.accessToken().then(f=>this.realtime.setAuth(f)).catch(f=>console.warn("Failed to set initial Realtime auth token:",f)),this.rest=new ete.PostgrestClient(new URL("rest/v1",o).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),this.storage=new nte.StorageClient(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new Zee.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();const{data:r}=await this.auth.getSession();return(t=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:i,userStorage:s,storageKey:a,flowType:o,lock:l,debug:c,throwOnError:u},f,p){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ite.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),f),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:i,userStorage:s,flowType:o,lock:l,debug:c,throwOnError:u,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new tte.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,r)=>{this._handleTokenChanged(t,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};b_.default=ste;(function(n){var e=Vp&&Vp.__createBinding||(Object.create?function(u,f,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(f,p);
450(!b||("get"in b?!f.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(u,h,b)}:function(u,f,p,h){h===void 0&&(h=p),u[h]=f[p]}),t=Vp&&Vp.__exportStar||function(u,f){for(var p in u)p!=="default"&&!Object.prototype.hasOwnProperty.call(f,p)&&e(f,u,p)},r=Vp&&Vp.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(n,"__esModule",{value:!0}),n.createClient=n.SupabaseClient=n.FunctionRegion=n.FunctionsError=n.FunctionsRelayError=n.FunctionsFetchError=n.FunctionsHttpError=n.PostgrestError=void 0;const i=r(b_);t(TF,n);var s=zi;Object.defineProperty(n,"PostgrestError",{enumerable:!0,get:function(){return s.PostgrestError}});var a=LD;Object.defineProperty(n,"FunctionsHttpError",{enumerable:!0,get:function(){return a.FunctionsHttpError}}),Object.defineProperty(n,"FunctionsFetchError",{enumerable:!0,get:function(){return a.FunctionsFetchError}}),Object.defineProperty(n,"FunctionsRelayError",{enumerable:!0,get:function(){return a.FunctionsRelayError}}),Object.defineProperty(n,"FunctionsError",{enumerable:!0,get:function(){return a.FunctionsError}}),Object.defineProperty(n,"FunctionRegion",{enumerable:!0,get:function(){return a.FunctionRegion}}),t(ZD,n);var o=b_;Object.defineProperty(n,"SupabaseClient",{enumerable:!0,get:function(){return r(o).default}});const l=(u,f,p)=>new i.default(u,f,p);n.createClient=l;function c(){if(typeof window<"u"||typeof process>"u")return!1;const u=process.version;if(u==null)return!1;const f=u.match(/^v(\d+)\./);return f?parseInt(f[1],10)<=18:!1}c()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")})(xT);const PF=a5(xT),ate=o6({__proto__:null,default:PF},[xT]),{PostgrestError:hme,FunctionsHttpError:fme,FunctionsFetchError:pme,FunctionsRelayError:mme,FunctionsError:gme,FunctionRegion:vme,SupabaseClient:yme,createClient:ote,GoTrueAdminApi:bme,GoTrueClient:wme,AuthAdminApi:xme,AuthClient:_me,navigatorLock:Sme,NavigatorLockAcquireTimeoutError:Ame,lockInternals:Eme,processLock:Nme,SIGN_OUT_SCOPES:kme,AuthError:Cme,AuthApiError:Tme,AuthUnknownError:Pme,CustomAuthError:jme,AuthSessionMissingError:Rme,AuthInvalidToken
450ResponseError:Lme,AuthInvalidCredentialsError:Ime,AuthImplicitGrantRedirectError:Ome,AuthPKCEGrantCodeExchangeError:Mme,AuthRetryableFetchError:Dme,AuthWeakPasswordError:Fme,AuthInvalidJwtError:Bme,isAuthError:$me,isAuthApiError:Ume,isAuthSessionMissingError:zme,isAuthImplicitGrantRedirectError:qme,isAuthRetryableFetchError:Hme,isAuthWeakPasswordError:Wme,RealtimePresence:Vme,RealtimeChannel:Gme,RealtimeClient:Kme,REALTIME_LISTEN_TYPES:Yme,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:Xme,REALTIME_PRESENCE_LISTEN_EVENTS:Jme,REALTIME_SUBSCRIBE_STATES:Qme,REALTIME_CHANNEL_STATES:Zme}=PF||ate,lte="https://sb.titrain.re",cte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzg2NDI4NjkwLCJleHAiOjIxMDE3ODg2OTB9.emSHQ1DmypUnBAJf6xoniMg16MNo0NzoxvQtdJbWYQc",Xe=ote(lte,cte,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),jF=E.createContext(void 0);function ute({children:n}){const[e,t]=E.useState(null),[r,i]=E.useState(null),[s,a]=E.useState(!1),[o,l]=E.useState(!0);E.useEffect(()=>{const{data:{subscription:h}}=Xe.auth.onAuthStateChange((b,g)=>{i(g),t((g==null?void 0:g.user)??null),g!=null&&g.user?setTimeout(()=>{c(g.user.id)},0):(a(!1),l(!1))});return Xe.auth.getSession().then(({data:{session:b}})=>{i(b),t((b==null?void 0:b.user)??null),b!=null&&b.user?c(b.user.id):l(!1)}),()=>h.unsubscribe()},[]);const c=async h=>{try{const{data:b,error:g}=await Xe.from("admin_profiles").select("id").eq("user_id",h).maybeSingle();a(!!b&&!g)}catch{a(!1)}finally{l(!1)}},u=async(h,b)=>{const{error:g}=await Xe.auth.signInWithPassword({email:h,password:b});return{error:g}},f=async(h,b,g)=>{const w=`${window.location.origin}/admin`,{data:y,error:x}=await Xe.auth.signUp({email:h,password:b,options:{emailRedirectTo:w,data:{full_name:g}}});return!x&&y.user&&await Xe.rpc("create_first_admin",{admin_email:h,admin_name:g}),{error:x}},p=async()=>{await Xe.auth.signOut()};return d.jsx(jF.Provider,{value:{user:e,session:r,isAdmin:s,isLoading:o,signIn:u,signUp:f,signOut:p},children:n})}function RT(){const n=E.useContext(jF);if(n===void 0)throw new Error("useAuth must be used within an AuthProvider");return n}const LT=Ob("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Oe=E.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...i},s)=>{const a=r?GV:"button";return d.jsx(a,{className:We(LT({variant:e,size:t,className:n})),ref:s,...i})});Oe.displayName="Button";function dte(){const[n,e]=E.useState(!1);E.useEffect(()=>{localStorage.getItem("cookie-consent")||e(!0)},[]);const t=()=>{localStorage.setItem("cookie-consent","accepted"),e(!1)},r=()=>{localStorage.setItem("cookie-consent","declined"),e(!1)};return n?d.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 p-4 bg-card border-t border-border shadow-lg",children:d.jsxs("div",{className:"container mx-auto flex flex-col sm:flex-row items-center justify-between gap-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground text-center sm:text-left",children:"Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer, vous acceptez notre utilisation des cookies."}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsx(Oe,{variant:"outline",size:"sm",onClick:r,children:"Refuser"}),d.jsx(Oe,{size:"sm",onClick:t,children:"Accepter"})]})]})}):null}const IT="/assets/logo-titrain-BkeiM1wv.jpg",CR=[{name:"Accueil",href:"/",anchor:null},{name:"Galerie",href:"/galerie",anchor:null},{name:"Actualités",href:"/blog",anchor:null},{name:"Infos pratiques",href:"/",anchor:"infos-pratiques"},{name:"Adhérer",href:"/adhesion",anchor:null}];function hte(){const[n,e]=E.useState(!1),t=su(),r=Np(),i=s=>{if(s.anchor)if(t.pathname==="/"){const a=document.getElementById(s.anchor);a&&a.scrollIntoView({behavior:"smooth"})}else r("/"),setTimeout(()=>{const a=document.getElementById(s.anchor);a&&a.scrollIntoView({behavior:"smooth"})},100);else r(s.href)};return d.jsxs("header",{className:"sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:[d.jsxs("nav",{className:"container flex h-16 items-center justify-between lg:h-20",children:[d.jsx($n,{to:"/",className:"flex items-center group",children:d.jsx("img",{src:IT,alt:"Association Ti Train Réunion",className:"h-12 lg:h-14 w-auto transition-transform group-hover:scale-105"})}),d.jsx("div",{className:"hidden lg:flex lg:items-center lg:gap-1",children:CR.map(s=>d.jsx("button",{onClick:()=>i(s),className:We("px-3 py-2 text-sm font-medium transition-colors rounded-md",t.pathname===s.href&&!s.anchor?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:s.name},s.name))}),d.jsx("div",{className:"hidden lg:flex lg:items-center lg:gap-4",children:d.jsx(Oe,{asChild:!0,variant:"default",size:"sm",children:d.jsx($n,{to:"/adhesion",children:"Rejoignez-nous"})})}),d.jsxs("button",{type:"button",className:"lg:hidden inline-flex items-center justify-center rounded-md p-2 text-foreground hover:bg-muted",onClick:()=>e(!n),children:[d.jsx("span",{className:"sr-only",children:"Ouvrir le menu"}),n?d.jsx(Ba,{className:"h-6 w-6","aria-hidden":"true"}):d.jsx(t8,{className:"h-6 w-6","aria-hidden":"true"})]})]}),n&&d.jsx("div",{className:"lg:hidden border-t border-border bg-background",children:d.jsxs("div",{className:"container py-4 space-y-1",children:[CR.map(s=>d.jsx("button",{onClick:()=>{i(s),e(!1)},className:We("block w-full text-left px-3 py-2.5 text-base font-medium transition-colors rounded-md",t.pathname===s.href&&!s.anchor?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:s.name},s.name)),d.jsx("div",{className:"pt-4 border-t border-border mt-4",children:d.jsx(Oe,{asChild:!0,className:"w-full",children:d.jsx($n,{to:"/adhesion",onClick:()=>e(!1),children:"Rejoignez-nous"})})})]})})]})}const fte="/assets/logo-region-reunion-Bk1T9XmB.jpg",pte="/assets/logo-europe-BEyq4WyQ.png";function mte(){return d.jsxs("footer",{className:"bg-sidebar text-sidebar-foreground",children:[d.jsx("div",{className:"container py-12 lg:py-16",children:d.jsxs("div",{className:"grid gap-8 md:grid-cols-2 lg:grid-cols-4",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx($n,{to:"/",className:"flex items-center",children:d.jsx("img",{src:IT,alt:"Association Ti Train Réunion",className:"h-14 w-auto"})}
450),d.jsx("p",{className:"text-sm text-sidebar-foreground/80 leading-relaxed",children:"Association dédiée à la préservation et à la mise en valeur du patrimoine ferroviaire de La Réunion."}),d.jsxs("div",{className:"flex gap-3",children:[d.jsx("a",{href:"#",className:"flex h-9 w-9 items-center justify-center rounded-full bg-sidebar-accent hover:bg-sidebar-primary transition-colors","aria-label":"Facebook",children:d.jsx(YG,{className:"h-4 w-4"})}),d.jsx("a",{href:"#",className:"flex h-9 w-9 items-center justify-center rounded-full bg-sidebar-accent hover:bg-sidebar-primary transition-colors","aria-label":"Instagram",children:d.jsx(QG,{className:"h-4 w-4"})}),d.jsx("a",{href:"#",className:"flex h-9 w-9 items-center justify-center rounded-full bg-sidebar-accent hover:bg-sidebar-primary transition-colors","aria-label":"YouTube",children:d.jsx(pK,{className:"h-4 w-4"})})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-display text-base font-semibold mb-4",children:"Navigation"}),d.jsxs("ul",{className:"space-y-2.5 text-sm",children:[d.jsx("li",{children:d.jsx($n,{to:"/historique",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"L'histoire du Ti Train"})}),d.jsx("li",{children:d.jsx($n,{to:"/galerie",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Galerie photos & vidéos"})}),d.jsx("li",{children:d.jsx($n,{to:"/blog",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Actualités"})}),d.jsx("li",{children:d.jsx($n,{to:"/adhesion",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Adhérer"})}),d.jsx("li",{children:d.jsx($n,{to:"/boutique",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Boutique"})})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-display text-base font-semibold mb-4",children:"Association"}),d.jsxs("ul",{className:"space-y-2.5 text-sm",children:[d.jsx("li",{children:d.jsx($n,{to:"/adhesion",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Devenir membre"})}),d.jsx("li",{children:d.jsx($n,{to:"/mentions-legales",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"Mentions légales"})})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-display text-base font-semibold mb-4",children:"Contact"}),d.jsxs("ul",{className:"space-y-3 text-sm",children:[d.jsxs("li",{className:"flex items-start gap-2.5",children:[d.jsx(tT,{className:"h-4 w-4 mt-0.5 text-primary shrink-0"}),d.jsxs("span",{className:"text-sidebar-foreground/80",children:["La Grande Chaloupe",d.jsx("br",{}),"97460 Saint-Paul, La Réunion"]})]}),d.jsxs("li",{className:"flex items-center gap-2.5",children:[d.jsx(nT,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("a",{href:"tel:+262692385391",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"0692 38 53 91"})]}),d.jsxs("li",{className:"flex items-center gap-2.5",children:[d.jsx(N5,{className:"h-4 w-4 text-primary shrink-0"}),d.jsx("a",{href:"mailto:[email protected]",className:"text-sidebar-foreground/80 hover:text-sidebar-foreground transition-colors",children:"[email protected]"})]})]})]})]})}),d.jsx("div",{className:"border-t border-sidebar-border",children:d.jsx("div",{className:"container py-6",children:d.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-6 sm:gap-8",children:[d.jsxs("div",{className:"flex items-center gap-4 sm:gap-6",children:[d.jsx("img",{src:pte,alt:"Cofinancé par l'Union européenne",className:"h-12 w-auto bg-white rounded-lg p-2"}),d.jsx("img",{src:fte,alt:"Région Réunion",className:"h-12 w-auto bg-white rounded p-1"})]}),d.jsx("p",{className:"text-xs text-sidebar-foreground/70 text-center sm:text-left max-w-md leading-relaxed",children:"Ce site a été financé par l'Union Européenne dans le cadre du programme FEDER-FSE+ Réunion dont l'Autorité de gestion est la Région Réunion. L'Europe s'engage à La Réunion avec le fonds FEDER."})]})})}),d.jsx("div",{className:"border-t border-sidebar-border",children:d.jsxs("div",{className:"container py-4 flex flex-col sm:flex-row items-center justify-between gap-2 text-xs text-sidebar-foreground
vendor: 5,376 bytes, line 450
450/60",children:[d.jsxs("p",{children:["© ",new Date().getFullYear()," Ti Train Réunion. Tous droits réservés."]}),d.jsxs("p",{children:["Fait avec ❤️ à La Réunion par ",d.jsx("a",{href:"https://sitewebreunion.com",target:"_blank",rel:"noopener noreferrer",className:"hover:text-sidebar-foreground transition-colors underline",children:"Site Web Réunion"})]})]})})]})}function jo({children:n}){return d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsx(hte,{}),d.jsx("main",{className:"flex-1",children:n}),d.jsx(mte,{})]})}function ca(n){const e=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&e==="[object Date]"?new n.constructor(+n):typeof n=="number"||e==="[object Number]"||typeof n=="string"||e==="[object String]"?new Date(n):new Date(NaN)}function Ud(n,e){return n instanceof Date?new n.constructor(e):new Date(e)}function TR(n,e){const t=ca(n);return isNaN(e)?Ud(n,NaN):(t.setDate(t.getDate()+e),t)}const RF=6048e5,gte=864e5;let vte={};function V5(){return vte}function X1(n,e){var o,l,c,u;const t=V5(),r=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=ca(n),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function C_(n){return X1(n,{weekStartsOn:1})}function LF(n){const e=ca(n),t=e.getFullYear(),r=Ud(n,0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);const i=C_(r),s=Ud(n,0);s.setFullYear(t,0,4),s.setHours(0,0,0,0);const a=C_(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function PR(n){const e=ca(n);return e.setHours(0,0,0,0),e}function jR(n){const e=ca(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function yte(n,e){const t=PR(n),r=PR(e),i=+t-jR(t),s=+r-jR(r);return Math.round((i-s)/gte)}function bte(n){const e=LF(n),t=Ud(n,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),C_(t)}function wte(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function xte(n){if(!wte(n)&&typeof n!="number")return!1;const e=ca(n);return!isNaN(Number(e))}function _te(n){const e=ca(n),t=Ud(n,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Ste={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ate=(n,e,t)=>{let r;const i=Ste[n];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function qm(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const Ete={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Nte={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kte={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cte={date:qm({formats:Ete,defaultWidth:"full"}),time:qm({formats:Nte,defaultWidth:"full"}),dateTime:qm({formats:kte,defaultWidth:"full"})},Tte={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pte=(n,e,t,r)=>Tte[n];function Al(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let i;if(r==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=t!=null&&t.width?String(t.width):a;i=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[o]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(e):e;return i[s]}}const jte={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Rte={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Lte={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ite={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
450ay","Saturday"]},Ote={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Dte=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Fte={ordinalNumber:Dte,era:Al({values:jte,defaultWidth:"wide"}),quarter:Al({values:Rte,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Al({values:Lte,defaultWidth:"wide"}),day:Al({values:Ite,defaultWidth:"wide"}),dayPeriod:Al({values:Ote,defaultWidth:"wide",formattingValues:Mte,defaultFormattingWidth:"wide"})};function El(n){return(e,t={})=>{const r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],o=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?$te(o,f=>f.test(a)):Bte(o,f=>f.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;const u=e.slice(a.length);return{value:c,rest:u}}}function Bte(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function $te(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function IF(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const i=r[0],s=e.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;const o=e.slice(i.length);return{value:a,rest:o}}}const Ute=/^(\d+)(th|st|nd|rd)?/i,zte=/\d+/i,qte={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Hte={any:[/^b/i,/^(a|c)/i]},Wte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vte={any:[/1/i,/2/i,/3/i,/4/i]},Gte={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kte={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yte={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Xte={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jte={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Qte={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Zte={ordinalNumber:IF({matchPattern:Ute,parsePattern:zte,valueCallback:n=>parseInt(n,10)}),era:El({matchPatterns:qte,defaultMatchWidth:"wide",parsePatterns:Hte,defaultParseWidth:"any"}),quarter:El({matchPatterns:Wte,defaultMatchWidth:"wide",parsePatterns:Vte,defaultParseWidth:"any",valueCallback:n=>n+1}),month:El({matchPatterns:Gte,defaultMatchWidth:"wide",parsePatterns:Kte,defaultParseWidth:"any"}),day:El({matchPatterns:Yte,defaultMatchWidth:"wide",parsePatterns:Xte,defaultParseWidth:"any"}),dayPeriod:El({matchPatterns:Jte,defaultMatchWidth:"any",parsePatterns:Qte,defaultParseWidth:"any"})},ene={code:"en-US",formatDistance:Ate,formatLong:Cte,formatRelative:Pte,localize:Fte,match:Zte,options:{weekStartsOn:0,firstWeekContainsDate:1}};function tne(n){const e=ca(n);return yte(e,_te(e))+1}function nne(n){const e=ca(n),t=+C_(e)-+bte(e);return Math.round(t/RF)+1}function OF(n,e){var u,f,p,h;const t=ca(n),r=t.getFullYear(),i=V5(),s=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((h=(p=i.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,a=Ud(n,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=X1(a,e),l=Ud(n,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=X1(l,e);return t.getTime()>=o.getTime()?r+1:t.getTime()>=c.getTime()?r:r-1}function rne(n,e){var o,l,c,u;const t=V5(),r=(e==null?void 0:e.firstWeekContainsDate)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=OF(n,e),s=Ud(n,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),X1(s,e)}function ine(n,e){const t=ca(n),r=+X1(t,e)-+rne(t,e);return Math.round(r/RF)+1}function yn(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const ku={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return yn(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):yn(t+1,2)},d(n,e){return yn(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return yn(n.getHours()%12||12,e.length)},H(n,e){return yn(n.getHours(),e.length)},m(n,e){return yn(n.getMinutes(),e.length)},s(n,e){return yn(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),i=Math.trunc(r*Math.pow(10,t-3));return yn(i,e.length)}},Qp={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},RR={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),i=r>0?r:1-r;return t.ordinalNumber(i,{unit:"year"})}return ku.y(n,e)},Y:function(n,e,t,r){const i=OF(n,r),s=i>0?i:1-i;if(e==="YY"){const a=s%100;return yn(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):yn(s,e.length)},R:function(n,e){const t=LF(n);return yn(t,e.length)},u:function(n,e){const t=n.getFullYear();return yn(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return yn(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return yn(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return ku.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return yn(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const i=ine(n,r);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):yn(i,e.length)},I:function(n,e,t){const r=nne(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):yn(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):ku.d(n,e)},D:function(n,e,t){const r=tne(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):yn(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const i=n.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return yn(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const i=n.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return yn(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return yn(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const i=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let i;switch(r===12?i=Qp.noon:r===0?i=Qp.midnight:i=r/12>
vendor: 4,584 bytes, line 450
450=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let i;switch(r>=17?i=Qp.evening:r>=12?i=Qp.afternoon:r>=4?i=Qp.morning:i=Qp.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return ku.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):ku.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):yn(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):yn(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):ku.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):ku.s(n,e)},S:function(n,e){return ku.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return IR(r);case"XXXX":case"XX":return jh(r);case"XXXXX":case"XXX":default:return jh(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return IR(r);case"xxxx":case"xx":return jh(r);case"xxxxx":case"xxx":default:return jh(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+LR(r,":");case"OOOO":default:return"GMT"+jh(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+LR(r,":");case"zzzz":default:return"GMT"+jh(r,":")}},t:function(n,e,t){const r=Math.trunc(n.getTime()/1e3);return yn(r,e.length)},T:function(n,e,t){const r=n.getTime();return yn(r,e.length)}};function LR(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),i=Math.trunc(r/60),s=r%60;return s===0?t+String(i):t+String(i)+e+yn(s,2)}function IR(n,e){return n%60===0?(n>0?"-":"+")+yn(Math.abs(n)/60,2):jh(n,e)}function jh(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),i=yn(Math.trunc(r/60),2),s=yn(r%60,2);return t+i+e+s}const OR=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},MF=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},sne=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],i=t[2];if(!i)return OR(n,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",OR(r,e)).replace("{{time}}",MF(i,e))},ane={p:MF,P:sne},one=/^D+$/,lne=/^Y+$/,cne=["D","DD","YY","YYYY"];function une(n){return one.test(n)}function dne(n){return lne.test(n)}function hne(n,e,t){const r=fne(n,e,t);if(console.warn(r),cne.includes(n))throw new RangeError(r)}function fne(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const pne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mne=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gne=/^'([^]*?)'?$/,vne=/''/g,yne=/[a-zA-Z]/;function Ro(n,e,t){var u,f,p,h,b,g,w,y;const r=V5(),i=(t==null?void 0:t.locale)??r.locale??ene,s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,a=(t==null?void 0:t.weekStartsOn)??((g=(b=t==null?void 0:t.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((y=(w=r.locale)==null?void 0:w.options)==null?void 0:y.weekStartsOn)??0,o=ca(n);if(!xte(o))throw new RangeError("Invalid time value");let l=e.match(mne).map(x=>{const S=x[0];if(S==="p"||S==="P"){const A=ane[S];return A(x,i.formatLong)}return x}).join("").match(pne).map(x=>
450{if(x==="''")return{isToken:!1,value:"'"};const S=x[0];if(S==="'")return{isToken:!1,value:bne(x)};if(RR[S])return{isToken:!0,value:x};if(S.match(yne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(x=>{if(!x.isToken)return x.value;const S=x.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&dne(S)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&une(S))&&hne(S,e,String(n));const A=RR[S[0]];return A(o,S,i.localize,c)}).join("")}function bne(n){const e=n.match(gne);return e?e[1].replace(vne,"'"):n}function MR(n){return ca(n).getDay()}const wne={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},xne=(n,e,t)=>{let r;const i=wne[n];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},_ne={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Sne={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Ane={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ene={date:qm({formats:_ne,defaultWidth:"full"}),time:qm({formats:Sne,defaultWidth:"full"}),dateTime:qm({formats:Ane,defaultWidth:"full"})},Nne={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},kne=(n,e,t,r)=>Nne[n],Cne={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},Tne={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},Pne={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},jne={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Rne={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},Lne=(n,e)=>{const t=Number(n),r=e==null?void 0:e.unit;if(t===0)return"0";const i=["year","week","hour","minute","second"];let s;return t===1?s=r&&i.includes(r)?"ère":"er":s="ème",t+s},Ine=["MMM","MMMM"],One={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&Ine.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:Lne,era:Al({values:Cne,defaultWidth:"wide"}),quarter:Al({values:Tne,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Al({values:Pne,defaultWidth:"wide"}),day:Al({values:jne,defaultWidth:"wide"}),dayPeriod:Al({values:Rne,defaultWidth:"wide"})},Mne=/^(\d+)(ième|ère|ème|er|e)?/i,Dne=/\d+/i,Fne={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},Bne={any:[/^av/i,/^ap/i]},$ne={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Une={any:[/1/i,/2/i,/3/i,/4/i]},zne={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janv
450ier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},qne={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hne={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},Wne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Vne={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},Gne={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Kne={ordinalNumber:IF({matchPattern:Mne,parsePattern:Dne,valueCallback:n=>parseInt(n)}),era:El({matchPatterns:Fne,defaultMatchWidth:"wide",parsePatterns:Bne,defaultParseWidth:"any"}),quarter:El({matchPatterns:$ne,defaultMatchWidth:"wide",parsePatterns:Une,defaultParseWidth:"any",valueCallback:n=>n+1}),month:El({matchPatterns:zne,defaultMatchWidth:"wide",parsePatterns:qne,defaultParseWidth:"any"}),day:El({matchPatterns:Hne,defaultMatchWidth:"wide",parsePatterns:Wne,defaultParseWidth:"any"}),dayPeriod:El({matchPatterns:Vne,defaultMatchWidth:"any",parsePatterns:Gne,defaultParseWidth:"any"})},zd={code:"fr",formatDistance:xne,formatLong:Ene,formatRelative:kne,localize:One,match:Kne,options:{weekStartsOn:1,firstWeekContainsDate:4}},Yne="/assets/slider-1-titrain-CtG6z1lD.png",Xne="/assets/slider-2-xr0jTxpX.png";function Jne(){const n=new Date;let e=new Date(n.getFullYear(),n.getMonth(),1);for(;MR(e)!==0;)e=TR(e,1);if(e<n)for(e=new Date(n.getFullYear(),n.getMonth()+1,1);MR(e)!==0;)e=TR(e,1);return e}const Zp=[{id:1,title:"Profitez d'une balade en Ti Train et découvrez l'histoire ferroviaire de la Réunion",subtitle:"Un voyage dans le temps au cœur du patrimoine réunionnais",image:Yne},{id:2,title:"Le Ti Train remis sur les rails, il vous attend à la Grande Chaloupe",subtitle:"Venez vivre une expérience unique entre mer et montagne",image:Xne}];function Qne(){const[n,e]=E.useState(0),[t,r]=E.useState(!0);E.useEffect(()=>{const c=setInterval(()=>{e(u=>(u+1)%Zp.length)},6e3);return()=>clearInterval(c)},[]);const i=c=>{e(c)},s=()=>{e(c=>(c-1+Zp.length)%Zp.length)},a=()=>{e(c=>(c+1)%Zp.length)},o=Jne(),l=Ro(o,"d MMMM yyyy",{locale:zd});return d.jsxs("section",{className:"relative h-[70vh] min-h-[500px] lg:h-[85vh] lg:min-h-[600px] overflow-hidden",children:[t&&d.jsxs("div",{className:"absolute top-4 right-4 z-20 bg-background/95 backdrop-blur-sm rounded-lg shadow-lg p-4 max-w-[260px] sm:max-w-xs border border-border",children:[d.jsx("button",{onClick:()=>r(!1),className:"absolute top-1.5 right-1.5 p-1 rounded-full hover:bg-muted transition-colors","aria-label":"Fermer",children:d.jsx(Ba,{className:"h-4 w-4 text-muted-foreground"})}),d.jsxs("div",{className:"flex items-start gap-3 pr-4",children:[d.jsx(BG,{className:"h-8 w-8 text-primary shrink-0 mt-1"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Prochaine visite guidée"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Tous les premiers dimanche du mois"}),d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Sauf cas exceptionnel (fermeture route, intempérie)"}),d.jsxs("div",{className:"mt-2 pt-2 border-t border-border",children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:"Prochaine visite :"}),d.jsx("p",{className:"text-lg font-bold text-primary capitalize",children:l})]})]})]})]}),Zp.map((c,u)=>d.jsxs("div",{className:We("absolute inset-0 transition-opacity duration-1000",u===n?"opacity-100":"opacity-0"),children:[d.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${c.image})`},children:d.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-transparent"})}),d.jsx("div",{className:"relative h-full container flex items-center",children:d.jsxs("div",{className:"max-w-3xl space-y-6",children:[d.jsx("h1",{className:We("font-display text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-primary-foreground leading-tight",u===n&&"animate-fade-in-up"),children:c.title}),d.jsx("p",{className:We("text-lg sm:text-xl text-primary-foreground
450/90 max-w-xl",u===n&&"animate-fade-in-up animation-delay-200"),children:c.subtitle})]})})]},c.id)),d.jsx("button",{onClick:s,className:"absolute left-4 top-1/2 -translate-y-1/2 flex h-12 w-12 items-center justify-center rounded-full bg-background/20 text-primary-foreground backdrop-blur-sm transition-all hover:bg-background/30","aria-label":"Slide précédent",children:d.jsx(PN,{className:"h-6 w-6"})}),d.jsx("button",{onClick:a,className:"absolute right-4 top-1/2 -translate-y-1/2 flex h-12 w-12 items-center justify-center rounded-full bg-background/20 text-primary-foreground backdrop-blur-sm transition-all hover:bg-background/30","aria-label":"Slide suivant",children:d.jsx(jN,{className:"h-6 w-6"})}),d.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 flex gap-2",children:Zp.map((c,u)=>d.jsx("button",{onClick:()=>i(u),className:We("h-2.5 rounded-full transition-all",u===n?"w-8 bg-gold":"w-2.5 bg-primary-foreground/50 hover:bg-primary-foreground/70"),"aria-label":`Aller au slide ${u+1}`},u))})]})}const Zne="/assets/train-historique-1882-optimized-BBX_yMtN.jpg";function ere(){return d.jsx("section",{className:"py-16 lg:py-24 bg-gradient-warm",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 lg:gap-16 items-center",children:[d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"aspect-[4/3] rounded-2xl overflow-hidden shadow-elevated relative",children:[d.jsx("img",{src:Zne,alt:"Ti Train historique",className:"w-full h-full object-cover",loading:"lazy"}),d.jsx("p",{className:"absolute bottom-2 right-2 text-xs text-white/80 italic bg-black/40 px-2 py-1 rounded",children:"photo colorisée"})]}),d.jsx("div",{className:"absolute -bottom-6 -right-6 bg-card p-6 rounded-xl shadow-card hidden md:block",children:d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:d.jsx(C5,{className:"h-7 w-7 animate-train"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-lg font-display font-bold text-foreground",children:"1878 - 1882"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Début et fin de travaux"})]})]})})]}),d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"inline-block",children:d.jsx("span",{className:"text-sm font-medium text-primary uppercase tracking-wider",children:"Notre Association"})}),d.jsxs("h2",{className:"text-3xl lg:text-4xl font-display font-bold text-foreground",children:["Préserver et faire vivre le"," ",d.jsx("span",{className:"text-gradient-warm",children:"patrimoine ferroviaire"})," de La Réunion"]}),d.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:"L'association Ti Train Réunion œuvre depuis de nombreuses années pour la sauvegarde et la mise en valeur de l'histoire ferroviaire de notre île. À la Grande Chaloupe, nous vous invitons à découvrir ce patrimoine unique, témoignage d'une époque révolue et d'une œuvre réunionnaise colossale."}),d.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Grâce à nos bénévoles passionnés, le Ti Train a repris vie et vous attend pour des balades inoubliables entre mer et montagne, au cœur d'un site classé."})]})]})})})}const tre="/assets/expo-titrain-cover-CvHVQmFn.jpg",nre="modulepreload",rre=function(n){return"/"+n},DR={},Vh=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(t.map(l=>{if(l=rre(l),l in DR)return;DR[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":nre,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};var g1={};g1.d=(n,e)=>{for(var t in e)g1.o(e,t)&&!g1.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})};g1.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var It=globalThis.pdfjsLib={};g1.d(It,{AbortException:()=>Cp,AnnotationEditorLayer:()=>_C,AnnotationEditorParamsType:()=>jt,AnnotationEditorType:()=>Ht,AnnotationEditorUIManager:()=>dp,AnnotationLayer:()=>tse,AnnotationMode:()=>$u,ColorPicker:()=>R_,DOMSVGFactory:()=>VT,DrawLayer:()=>NC,FeatureTest:()=>is,GlobalWorkerOptions:()=>$c,ImageKind:()=>ex,InvalidPDFException:()=>FF,MissingPDFException:()=>kp,OPS:()=>oo,OutputScale:()=>mk,PDFDataRangeTransport:()=>I7,PDFDateString:()=>BT,PDFWorker:()=>Wm,PasswordResponses:()=>ore,PermissionFlag:()=>are,PixelsPerInch:()=>qd,RenderingCancelledException:()=>DT,TextLayer:()=>qk,UnexpectedResponseException:()=>X5,Util:()=>ft,VerbosityLevel:()=>G5,XfaLayer:()=>M7,build:()=>Oie,createValidAbsoluteUrl:()=>dre,fetchData:()=>Q5,getDocument:()=>Nie,getFilenameFromUrl:()=>wre,getPdfFilenameFromUrl:()=>xre,getXfaPageViewport:()=>_re,isDataScheme:()=>Z5,isPdfFile:()=>
450FT,noContextMenu:()=>$a,normalizeUnicode:()=>vre,setLayerDimensions:()=>up,shadow:()=>tn,version:()=>Iie});const Hi=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),DF=[1,0,0,1,0,0],dk=[.001,0,0,.001,0,0],ire=1e7,qA=1.35,Ks={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},$u={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},sre="pdfjs_internal_editor_",Ht={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},jt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},are={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ii={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ex={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},$r={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Tv={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},G5={ERRORS:0,WARNINGS:1,INFOS:5},oo={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},ore={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let K5=G5.WARNINGS;function lre(n){Number.isInteger(n)&&(K5=n)}function cre(){return K5}function Y5(n){K5>=G5.INFOS&&console.log(`Info: ${n}`)}function Gt(n){K5>=G5.WARNINGS&&console.log(`Warning: ${n}`)}function Un(n){throw new Error(n)}function Wr(n,e){n||Un(e)}function ure(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function dre(n,e=null,t=null){if(!n)return null;try{if(t&&typeof n=="string"){if(t.addDefaultProtocol&&n.startsWith("www.")){const i=n.match(/\./g);(i==null?void 0:i.length)>=2&&(n=`http://${n}`)}if(t.tryConvertEncoding)try{n=gre(n)}catch{}}const r=e?new URL(n,e):new URL(n);if(ure(r))return r}catch{}return null}function tn(n,e,t,r=!1){return Object.defineProperty(n,e,{value:t,enumerable:!r,configurable:!0,writable:!1}),t}const th=function(){function e(t,r){this.message=t,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class hk extends th{constructor(e,t){super(e,"PasswordException"),this.code=t}}class fk extends th{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class FF extends th{constructor(e){super(e,"InvalidPDFException")}}class kp extends th{constructor(e){super(e,"MissingPDFException")}}class X5 extends th{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}}class hre extends th{constructor(e){super(e,"FormatError")}}class Cp extends th{constructor(e){super(e,"AbortException")}}function BF(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&Un("Invalid argument for bytesToString");const e=n.length,t=8192;if(e<t)return String.fromCharCode.apply(null,n);const r=[];for(let i=0;i<e;i+=t){const s=Math.min(i+t,e),a=n.subarray(i,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}
450function J5(n){typeof n!="string"&&Un("Invalid argument for stringToBytes");const e=n.length,t=new Uint8Array(e);for(let r=0;r<e;++r)t[r]=n.charCodeAt(r)&255;return t}function fre(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function OT(n){const e=Object.create(null);for(const[t,r]of n)e[t]=r;return e}function pre(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function mre(){try{return new Function(""),!0}catch{return!1}}class is{static get isLittleEndian(){return tn(this,"isLittleEndian",pre())}static get isEvalSupported(){return tn(this,"isEvalSupported",mre())}static get isOffscreenCanvasSupported(){return tn(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?tn(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof(navigator==null?void 0:navigator.userAgent)=="string"&&navigator.userAgent.includes("Firefox")}):tn(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var e,t;return tn(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const HA=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));var Wc,tx,pk;class ft{static makeHexColor(e,t,r){return`#${HA[e]}${HA[t]}${HA[r]}`}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){const r=e[0]*t[0]+e[1]*t[2]+t[4],i=e[0]*t[1]+e[1]*t[3]+t[5];return[r,i]}static applyInverseTransform(e,t){const r=t[0]*t[3]-t[1]*t[2],i=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,s=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r;return[i,s]}static getAxialAlignedBoundingBox(e,t){const r=this.applyTransform(e,t),i=this.applyTransform(e.slice(2,4),t),s=this.applyTransform([e[0],e[3]],t),a=this.applyTransform([e[2],e[1]],t);return[Math.min(r[0],i[0],s[0],a[0]),Math.min(r[1],i[1],s[1],a[1]),Math.max(r[0],i[0],s[0],a[0]),Math.max(r[1],i[1],s[1],a[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],i=e[0]*t[1]+e[1]*t[3],s=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],o=(r+a)/2,l=Math.sqrt((r+a)**2-4*(r*a-s*i))/2,c=o+l||1,u=o-l||1;return[Math.sqrt(c),Math.sqrt(u)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>i)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[r,s,i,a]}static bezierBoundingBox(e,t,r,i,s,a,o,l,c){return c?(c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,l)):c=[Math.min(e,o),Math.min(t,l),Math.max(e,o),Math.max(t,l)],U(this,Wc,pk).call(this,e,r,s,o,t,i,a,l,3*(-e+3*(r-s)+o),6*(e-2*r+s),3*(r-e),c),U(this,Wc,pk).call(this,e,r,s,o,t,i,a,l,3*(-t+3*(i-a)+l),6*(t-2*i+a),3*(i-t),c),c}}Wc=new WeakSet,tx=function(e,t,r,i,s,a,o,l,c,u){if(c<=0||c>=1)return;const f=1-c,p=c*c,h=p*c,b=f*(f*(f*e+3*c*t)+3*p*r)+h*i,g=f*(f*(f*s+3*c*a)+3*p*o)+h*l;u[0]=Math.min(u[0],b),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],b),u[3]=Math.max(u[3],g)},pk=function(e,t,r,i,s,a,o,l,c,u,f,p){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&U(this,Wc,tx).call(this,e,t,r,i,s,a,o,l,-f/u,p);return}const h=u**2-4*f*c;if(h<0)return;const b=Math.sqrt(h),g=2*c;U(this,Wc,tx).call(this,e,t,r,i,s,a,o,l,(-u+b)/g,p),U(this,Wc,tx).call(this,e,t,r,i,s,a,o,l,(-u-b)/g,p)},q(ft,Wc);function gre(n){return decodeURIComponent(escape(n))}let WA=null,FR=null;function vre(n){return WA||(WA=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,FR=new Map([["ſt","ſt"]])),n.replaceAll(WA,(e,t,r)=>t?t.normalize("NFKC"):FR.get(r))}function yre(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const n=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(n);else for(let e=0;e<32;e++)n[e]=Math.floor(Math.random()*255);return BF(n)}const MT="pdfjs_internal_id_",rc={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};function bre(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(BF(n))}const lc="http://www.w3.org/2000/svg",$h=class $h{};Ue($h,"CSS",96),Ue($h,"PDF",72),Ue($h,"PDF_TO_CSS_UNITS",$h.CSS/$h.PDF);let qd=$h;async function Q5(n,e="text"){if(Uv(n,document.baseURI)){const t=await fetch(n);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,r)=>{const i=new XMLHttpRequest;i.open("GET",n,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(i.response);return}t(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}class $b{constructor({viewBox:e,scale:t,rotation:r,offsetX:i=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=i,this.offsetY=s;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,u,f,p;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,u=0,f=0,p=1;break;case 90:c=0,u=1,f=1,p=0;break;case 270:c=0,u=-1,f=-1,p=0;break;case 0:c=1,u=0,f=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(f=-f,p=-p);let h,b,g,w;c===0?(h=Math.abs(l-e[1])*t+i,b=Math.abs(o-e[0])*t+s,g=(e[3]-e[1])*t,w=(e[2]-e[0])*t):(h=Math.abs(o-e[0])*t+i,b=Math.abs(l-e[1])*t+s,g=(e[2]-e[0])*t,w=(e[3]-e[1])*t),this.transform=[c*t,u*t,f*t,p*t,h-c*t*o-f*t*l,b-u*t*o-p*t*l],this.width=g,this.height=w}get rawDims(){const{viewBox:e}=this;return tn(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}={}){return new $b({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:i,dontFlip:s}
450)}convertToViewportPoint(e,t){return ft.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=ft.applyTransform([e[0],e[1]],this.transform),r=ft.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return ft.applyInverseTransform([e,t],this.transform)}}class DT extends th{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function Z5(n){const e=n.length;let t=0;for(;t<e&&n[t].trim()==="";)t++;return n.substring(t,t+5).toLowerCase()==="data:"}function FT(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function wre(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function xre(n,e="document.pdf"){if(typeof n!="string")return e;if(Z5(n))return Gt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=t.exec(n);let s=r.exec(i[1])||r.exec(i[2])||r.exec(i[3]);if(s&&(s=s[0],s.includes("%")))try{s=r.exec(decodeURIComponent(s))[0]}catch{}return s||e}class BR{constructor(){Ue(this,"started",Object.create(null));Ue(this,"times",[])}time(e){e in this.started&&Gt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Gt(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:r}of this.times)t=Math.max(r.length,t);for(const{name:r,start:i,end:s}of this.times)e.push(`${r.padEnd(t)} ${s-i}ms
451`);return e.join("")}}function Uv(n,e){try{const{protocol:t}=e?new URL(n,e):new URL(n);return t==="http:"||t==="https:"}catch{return!1}}function $a(n){n.preventDefault()}function $R(n){console.log("Deprecated API usage: "+n)}var dy;class BT{static toDateObject(e){if(!e||typeof e!="string")return null;m(this,dy)||M(this,dy,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=m(this,dy).exec(e);if(!t)return null;const r=parseInt(t[1],10);let i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let f=parseInt(t[9],10)||0;return f=f>=0&&f<=59?f:0,c==="-"?(a+=u,o+=f):c==="+"&&(a-=u,o-=f),new Date(Date.UTC(r,i,s,a,o,l))}}dy=new WeakMap,q(BT,dy);function _re(n,{scale:e=1,rotation:t=0}){const{width:r,height:i}=n.attributes.style,s=[0,0,parseInt(r),parseInt(i)];return new $b({viewBox:s,scale:e,rotation:t})}function $T(n){if(n.startsWith("#")){const e=parseInt(n.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(e=>parseInt(e)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Gt(`Not a valid color format: "${n}"`),[0,0,0])}function Sre(n){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const t of n.keys()){e.style.color=t;const r=window.getComputedStyle(e).color;n.set(t,$T(r))}e.remove()}function er(n){const{a:e,b:t,c:r,d:i,e:s,f:a}=n.getTransform();return[e,t,r,i,s,a]}function ic(n){const{a:e,b:t,c:r,d:i,e:s,f:a}=n.getTransform().invertSelf();return[e,t,r,i,s,a]}function up(n,e,t=!1,r=!0){if(e instanceof $b){const{pageWidth:i,pageHeight:s}=e.rawDims,{style:a}=n,o=is.isCSSRoundSupported,l=`var(--scale-factor) * ${i}px`,c=`var(--scale-factor) * ${s}px`,u=o?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,f=o?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!t||e.rotation%180===0?(a.width=u,a.height=f):(a.width=f,a.height=u)}r&&n.setAttribute("data-main-rotation",e.rotation)}class mk{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}var Gu,nf,uo,rf,hy,fy,q_,$F,ss,UF,zF,nx,qF,vk;const uc=class uc{constructor(e){q(this,ss);q(this,Gu,null);q(this,nf,null);q(this,uo);q(this,rf,null);q(this,hy,null);M(this,uo,e),m(uc,fy)||M(uc,fy,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"}))}render(){const e=M(this,Gu,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=m(this,uo)._uiManager._signal;e.addEventListener("contextmenu",$a,{signal:t}),e.addEventListener("pointerdown",U(uc,q_,$F),{signal:t});const r=M(this,rf,document.createElement("div"));r.className="buttons",e.append(r);const i=m(this,uo).toolbarPosition;if(i){const{style:s}=e,a=m(this,uo)._uiManager.direction==="ltr"?1-i[0]:i[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return U(this,ss,qF).call(this),e}get div(){return m(this,Gu)}hide(){var e;m(this,Gu).classList.add("hidden"),(e=m(this,nf))==null||e.hideDropdown()}show(){var e;m(this,Gu).classList.remove("hidden"),(e=m(this,hy))==null||e.shown()}async addAltText(e){const t=await e.render();
451U(this,ss,nx).call(this,t),m(this,rf).prepend(t,m(this,ss,vk)),M(this,hy,e)}addColorPicker(e){M(this,nf,e);const t=e.renderButton();U(this,ss,nx).call(this,t),m(this,rf).prepend(t,m(this,ss,vk))}remove(){var e;m(this,Gu).remove(),(e=m(this,nf))==null||e.destroy(),M(this,nf,null)}};Gu=new WeakMap,nf=new WeakMap,uo=new WeakMap,rf=new WeakMap,hy=new WeakMap,fy=new WeakMap,q_=new WeakSet,$F=function(e){e.stopPropagation()},ss=new WeakSet,UF=function(e){m(this,uo)._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()},zF=function(e){m(this,uo)._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()},nx=function(e){const t=m(this,uo)._uiManager._signal;e.addEventListener("focusin",U(this,ss,UF).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",U(this,ss,zF).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",$a,{signal:t})},qF=function(){const{editorType:e,_uiManager:t}=m(this,uo),r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",m(uc,fy)[e]),U(this,ss,nx).call(this,r),r.addEventListener("click",i=>{t.delete()},{signal:t._signal}),m(this,rf).append(r)},vk=function(){const e=document.createElement("div");return e.className="divider",e},q(uc,q_),q(uc,fy,null);let gk=uc;var py,sf,af,Gd,HF,WF,VF;class Are{constructor(e){q(this,Gd);q(this,py,null);q(this,sf,null);q(this,af);M(this,af,e)}show(e,t,r){const[i,s]=U(this,Gd,WF).call(this,t,r),{style:a}=m(this,sf)||M(this,sf,U(this,Gd,HF).call(this));e.append(m(this,sf)),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){m(this,sf).remove()}}py=new WeakMap,sf=new WeakMap,af=new WeakMap,Gd=new WeakSet,HF=function(){const e=M(this,sf,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",$a,{signal:m(this,af)._signal});const t=M(this,py,document.createElement("div"));return t.className="buttons",e.append(t),U(this,Gd,VF).call(this),e},WF=function(e,t){let r=0,i=0;for(const s of e){const a=s.y+s.height;if(a<r)continue;const o=s.x+(t?s.width:0);if(a>r){i=o,r=a;continue}t?o>i&&(i=o):o<i&&(i=o)}return[t?1-i:i,r]},VF=function(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=m(this,af)._signal;e.addEventListener("contextmenu",$a,{signal:r}),e.addEventListener("click",()=>{m(this,af).highlightSelection("floating_button")},{signal:r}),m(this,py).append(e)};function T_(n,e,t){for(const r of t)e.addEventListener(r,n[r].bind(n))}function Ere(n){return Math.round(Math.min(255,Math.max(1,255*n))).toString(16).padStart(2,"0")}var H_;class Nre{constructor(){q(this,H_,0)}get id(){return`${sre}${Xr(this,H_)._++}`}}H_=new WeakMap;var ug,my,Di,dg,rx;const kP=class kP{constructor(){q(this,dg);q(this,ug,yre());q(this,my,0);q(this,Di,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const s=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return tn(this,"_isSVGFittingCanvas",s)}async getFromFile(e){const{lastModified:t,name:r,size:i,type:s}=e;return U(this,dg,rx).call(this,`${t}_${r}_${i}_${s}`,e)}async getFromUrl(e){return U(this,dg,rx).call(this,e,e)}async getFromBlob(e,t){const r=await t;return U(this,dg,rx).call(this,e,r)}async getFromId(e){m(this,Di)||M(this,Di,new Map);const t=m(this,Di).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:r}=t;return delete t.blobPromise,this.getFromBlob(t.id,r)}return this.getFromUrl(t.url)}getFromCanvas(e,t){m(this,Di)||M(this,Di,new Map);let r=m(this,Di).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${m(this,ug)}_${Xr(this,my)._++}`,refCounter:1,isSvg:!1},m(this,Di).set(e,r),m(this,Di).set(r.id,r),r}getSvgUrl(e){const t=m(this,Di).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){var i;m(this,Di)||M(this,Di,new Map);const t=m(this,Di).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:r}=t;if(!t.url&&!t.file){const s=new OffscreenCanvas(r.width,r.height);s.getContext("bitmaprenderer").transferFromImageBitmap(r),t.blobPromise=s.convertToBlob()}(i=r.close)==null||i.call(r),t.bitmap=null}isValidId(e){return e.startsWith(`image_${m(this,ug)}_`)}};ug=new WeakMap,my=new WeakMap,Di=new WeakMap,dg=new WeakSet,rx=async function(e,t){m(this,Di)||M(this,Di,new Map);let r=m(this,Di).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${m(this,ug)}_${Xr(this,my)._++}`,refCounter:0,isSvg:!1});let i;if(typeof t=="string"?(r.url=t,i=await Q5(t,"blob")):t instanceof File?i=r.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){const s=kP._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,c()},a.onload=async()=>{const f=r.svgUrl=a.result;o.src=await s?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=u});a.readAsDataURL(i),await l}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){console.error(i),r=null}return m(this,Di).set(e,r),r&&m(this,Di).set(r.id,r),r};let yk=kP;var Qr,Ku,gy,Zr;class kre{constructor(e=128){q(this,Qr,[]);q(this,Ku,!1);q(this,gy);q(this,Zr,-1);M(this,gy,e)}add({cmd:e,undo:t,post:r,mustExec:i,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&e(),m(this,Ku))return;const l={cmd:e,undo:t,post:r,type:s};if(m(this,Zr)===-1){m(this,Qr).length>0&&(m(this,Qr).length=0),M(this,Zr,0),m(this,Qr).push(l);return}if(a&&m(this,Qr)[m(this,Zr)].type===s){o&&(l.undo=m(this,Qr)[m(this,Zr)].undo),m(this,Qr)[m(this,Zr)]=l;return}const c=m(this,Zr)+1;c===m(this,gy)?m(this,Qr).splice(0,1):(M(this,Zr,c),c<m(this,Qr).length&&m(this,Qr).splice(c)),m(this,Qr).push(l)}undo(){if(m(this,Zr)===-1)return;M(this,Ku,!0);const{undo:e,post:t}=m(this,Qr)[m(this,Zr)];e(),t==null||t(),M(this,Ku,!1),M(this,Zr,m(this,Zr)-1)}redo(){if(m(this,Zr)<m(this,Qr).length-1){M(this,Zr,m(this,Zr)+1),M(this,Ku,!0);const{cmd:e,post:t}=m(this,Qr)[m(this,Zr)];e(),t==null||t(),M(this,Ku,!1)}}hasSomethingToUndo(){return m(this,Zr)!==-1}hasSomethingToRedo(){return m(this,Zr)<m(this,Qr).length-1}destroy(){M(this,Qr,null)}}
451Qr=new WeakMap,Ku=new WeakMap,gy=new WeakMap,Zr=new WeakMap;var W_,GF;class Ub{constructor(e){q(this,W_);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=is.platform;for(const[r,i,s={}]of e)for(const a of r){const o=a.startsWith("mac+");t&&o?(this.callbacks.set(a.slice(4),{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1))):!t&&!o&&(this.callbacks.set(a,{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const r=this.callbacks.get(U(this,W_,GF).call(this,t));if(!r)return;const{callback:i,options:{bubbles:s=!1,args:a=[],checker:o=null}}=r;o&&!o(e,t)||(i.bind(e,...a,t)(),s||(t.stopPropagation(),t.preventDefault()))}}W_=new WeakSet,GF=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t};const V_=class V_{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return Sre(e),tn(this,"_colors",e)}convert(e){const t=$T(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[r,i]of this._colors)if(i.every((s,a)=>s===t[a]))return V_._colorsMapping.get(r);return t}getHexCode(e){const t=this._colors.get(e);return t?ft.makeHexColor(...t):e}};Ue(V_,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let bk=V_;var hg,$s,Ur,bi,fg,gc,pg,ho,Yu,mg,of,sl,fo,lf,vy,yy,gg,by,al,Xu,vg,Ju,ol,G_,Qu,wy,Zu,cf,xy,_y,ei,gn,vc,uf,Sy,Ay,ed,ll,yc,Ey,ba,$e,ix,wk,KF,YF,sx,XF,JF,QF,xk,ZF,_k,Sk,e7,Xi,ju,t7,n7,Ak,r7,zv,Ek;const Rm=class Rm{constructor(e,t,r,i,s,a,o,l,c,u,f){q(this,$e);q(this,hg,new AbortController);q(this,$s,null);q(this,Ur,new Map);q(this,bi,new Map);q(this,fg,null);q(this,gc,null);q(this,pg,null);q(this,ho,new kre);q(this,Yu,null);q(this,mg,0);q(this,of,new Set);q(this,sl,null);q(this,fo,null);q(this,lf,new Set);q(this,vy,!1);q(this,yy,!1);q(this,gg,!1);q(this,by,null);q(this,al,null);q(this,Xu,null);q(this,vg,null);q(this,Ju,!1);q(this,ol,null);q(this,G_,new Nre);q(this,Qu,!1);q(this,wy,!1);q(this,Zu,null);q(this,cf,null);q(this,xy,null);q(this,_y,null);q(this,ei,Ht.NONE);q(this,gn,new Set);q(this,vc,null);q(this,uf,null);q(this,Sy,null);q(this,Ay,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});q(this,ed,[0,0]);q(this,ll,null);q(this,yc,null);q(this,Ey,null);q(this,ba,null);const p=this._signal=m(this,hg).signal;M(this,yc,e),M(this,Ey,t),M(this,fg,r),this._eventBus=i,i._on("editingaction",this.onEditingAction.bind(this),{signal:p}),i._on("pagechanging",this.onPageChanging.bind(this),{signal:p}),i._on("scalechanging",this.onScaleChanging.bind(this),{signal:p}),i._on("rotationchanging",this.onRotationChanging.bind(this),{signal:p}),i._on("setpreference",this.onSetPreference.bind(this),{signal:p}),i._on("switchannotationeditorparams",h=>this.updateParams(h.type,h.value),{signal:p}),U(this,$e,XF).call(this),U(this,$e,e7).call(this),U(this,$e,xk).call(this),M(this,gc,s.annotationStorage),M(this,by,s.filterFactory),M(this,uf,a),M(this,vg,o||null),M(this,vy,l),M(this,yy,c),M(this,gg,u),M(this,_y,f||null),this.viewParameters={realScale:qd.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const e=Rm.prototype,t=a=>m(a,yc).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return tn(this,"_keyboardManager",new Ub([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}
451],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&m(a,yc).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&m(a,yc).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}]]))}destroy(){var e,t,r,i;(e=m(this,ba))==null||e.resolve(),M(this,ba,null),(t=m(this,hg))==null||t.abort(),M(this,hg,null),this._signal=null;for(const s of m(this,bi).values())s.destroy();m(this,bi).clear(),m(this,Ur).clear(),m(this,lf).clear(),M(this,$s,null),m(this,gn).clear(),m(this,ho).destroy(),(r=m(this,fg))==null||r.destroy(),(i=m(this,ol))==null||i.hide(),M(this,ol,null),m(this,al)&&(clearTimeout(m(this,al)),M(this,al,null)),m(this,ll)&&(clearTimeout(m(this,ll)),M(this,ll,null))}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return m(this,_y)}get useNewAltTextFlow(){return m(this,yy)}get useNewAltTextWhenAddingImage(){return m(this,gg)}get hcmFilter(){return tn(this,"hcmFilter",m(this,uf)?m(this,by).addHCMFilter(m(this,uf).foreground,m(this,uf).background):"none")}get direction(){return tn(this,"direction",getComputedStyle(m(this,yc)).direction)}get highlightColors(){return tn(this,"highlightColors",m(this,vg)?new Map(m(this,vg).split(",").map(e=>e.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return tn(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){M(this,xy,e)}editAltText(e,t=!1){var r;(r=m(this,fg))==null||r.editAltText(this,e,t)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":M(this,gg,t);break}}onPageChanging({pageNumber:e}){M(this,mg,e-1)}focusMainContainer(){m(this,yc).focus()}findParent(e,t){for(const r of m(this,bi).values()){const{x:i,y:s,width:a,height:o}=r.div.getBoundingClientRect();if(e>=i&&e<=i+a&&t>=s&&t<=s+o)return r}return null}disableUserSelect(e=!1){m(this,Ey).classList.toggle("noUserSelect",e)}addShouldRescale(e){m(this,lf).add(e)}removeShouldRescale(e){m(this,lf).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*qd.PDF_TO_CSS_UNITS;for(const t of m(this,lf))t.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:a}=t,o=t.toString(),c=U(this,$e,ix).call(this,t).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;t.empty();const f=U(this,$e,wk).call(this,c),p=m(this,ei)===Ht.NONE,h=()=>{f==null||f.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:u,anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:a,text:o}),p&&this.showAllEditors("highlight",!0,!0)};if(p){this.switchToMode(Ht.HIGHLIGHT,h);return}h()}addToAnnotationStorage(e){!e.isEmpty()&&m(this,gc)&&!m(this,gc).has(e.id)&&m(this,gc).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,m(this,Ju)&&(M(this,Ju,!1),U(this,$e,sx).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of m(this,gn))if(t.div.contains(e)){M(this,cf,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!m(this,cf))return;const[e,t]=m(this,cf);M(this,cf,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){U(this,$e,xk).call(this),U(this,$e,_k).call(this)}removeEditListeners(){U(this,$e,ZF).call(this),U(this,$e,Sk).call(this)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const r of m(this,fo))if(r.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const r of m(this,fo))if(r.isHandlingMimeForPasting(t.type)){r.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=m(this,$s))==null||r.commitOrRemove(),!this.hasSelection)return;const t=[];for(const i of m(this,gn)){const s=i.serialize(!0);
451s&&t.push(s)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const s of t.items)for(const a of m(this,fo))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let r=t.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(s){Gt(`paste: "${s.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const s=[];for(const l of r){const c=await i.deserialize(l);if(!c)return;s.push(c)}const a=()=>{for(const l of s)U(this,$e,Ak).call(this,l);U(this,$e,Ek).call(this,s)},o=()=>{for(const l of s)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){Gt(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),m(this,ei)!==Ht.NONE&&!this.isEditorHandlingKeyboard&&Rm._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,m(this,Ju)&&(M(this,Ju,!1),U(this,$e,sx).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(U(this,$e,JF).call(this),U(this,$e,_k).call(this),U(this,$e,Xi).call(this,{isEditing:m(this,ei)!==Ht.NONE,isEmpty:U(this,$e,zv).call(this),hasSomethingToUndo:m(this,ho).hasSomethingToUndo(),hasSomethingToRedo:m(this,ho).hasSomethingToRedo(),hasSelectedEditor:!1})):(U(this,$e,QF).call(this),U(this,$e,Sk).call(this),U(this,$e,Xi).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!m(this,fo)){M(this,fo,e);for(const t of m(this,fo))U(this,$e,ju).call(this,t.defaultPropertiesToUpdate)}}getId(){return m(this,G_).id}get currentLayer(){return m(this,bi).get(m(this,mg))}getLayer(e){return m(this,bi).get(e)}get currentPageIndex(){return m(this,mg)}addLayer(e){m(this,bi).set(e.pageIndex,e),m(this,Qu)?e.enable():e.disable()}removeLayer(e){m(this,bi).delete(e.pageIndex)}async updateMode(e,t=null,r=!1){if(m(this,ei)!==e&&!(m(this,ba)&&(await m(this,ba).promise,!m(this,ba)))){if(M(this,ba,Promise.withResolvers()),M(this,ei,e),e===Ht.NONE){this.setEditingState(!1),U(this,$e,n7).call(this),m(this,ba).resolve();return}this.setEditingState(!0),await U(this,$e,t7).call(this),this.unselectAll();for(const i of m(this,bi).values())i.updateMode(e);if(!t){r&&this.addNewEditorFromKeyboard(),m(this,ba).resolve();return}for(const i of m(this,Ur).values())i.annotationElementId===t?(this.setSelected(i),i.enterInEditMode()):i.unselect();m(this,ba).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==m(this,ei)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){var r;if(m(this,fo)){switch(e){case jt.CREATE:this.currentLayer.addNewEditor();return;case jt.HIGHLIGHT_DEFAULT_COLOR:(r=m(this,xy))==null||r.updateColor(t);break;case jt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(m(this,Sy)||M(this,Sy,new Map)).set(e,t),this.showAllEditors("highlight",t);break}for(const i of m(this,gn))i.updateParams(e,t);for(const i of m(this,fo))i.updateDefaultParams(e,t)}}showAllEditors(e,t,r=!1){var s;for(const a of m(this,Ur).values())a.editorType===e&&a.show(t);(((s=m(this,Sy))==null?void 0:s.get(jt.HIGHLIGHT_SHOW_ALL))??!0)!==t&&U(this,$e,ju).call(this,[[jt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(m(this,wy)!==e){M(this,wy,e);for(const t of m(this,bi).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const r of m(this,Ur).values())r.pageIndex===e&&t.push(r);return t}getEditor(e){return m(this,Ur).get(e)}addEditor(e){m(this,Ur).set(e.id,e)}removeEditor(e){var t;e.div.contains(document.activeElement)&&(m(this,al)&&clearTimeout(m(this,al)),M(this,al,setTimeout(()=>{this.focusMainContainer(),M(this,al,null)},0))),m(this,Ur).delete(e.id),this.unselect(e),(!e.annotationElementId||!m(this,of).has(e.annotationElementId))&&((t=m(this,gc))==null||t.remove(e.id))}addDeletedAnnotationElement(e){m(this,of).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}
451isDeletedAnnotationElement(e){return m(this,of).has(e)}removeDeletedAnnotationElement(e){m(this,of).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){m(this,$s)!==e&&(M(this,$s,e),e&&U(this,$e,ju).call(this,e.propertiesToUpdate))}updateUI(e){m(this,$e,r7)===e&&U(this,$e,ju).call(this,e.propertiesToUpdate)}toggleSelected(e){if(m(this,gn).has(e)){m(this,gn).delete(e),e.unselect(),U(this,$e,Xi).call(this,{hasSelectedEditor:this.hasSelection});return}m(this,gn).add(e),e.select(),U(this,$e,ju).call(this,e.propertiesToUpdate),U(this,$e,Xi).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const t of m(this,gn))t!==e&&t.unselect();m(this,gn).clear(),m(this,gn).add(e),e.select(),U(this,$e,ju).call(this,e.propertiesToUpdate),U(this,$e,Xi).call(this,{hasSelectedEditor:!0})}isSelected(e){return m(this,gn).has(e)}get firstSelectedEditor(){return m(this,gn).values().next().value}unselect(e){e.unselect(),m(this,gn).delete(e),U(this,$e,Xi).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return m(this,gn).size!==0}get isEnterHandled(){return m(this,gn).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){m(this,ho).undo(),U(this,$e,Xi).call(this,{hasSomethingToUndo:m(this,ho).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:U(this,$e,zv).call(this)})}redo(){m(this,ho).redo(),U(this,$e,Xi).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:m(this,ho).hasSomethingToRedo(),isEmpty:U(this,$e,zv).call(this)})}addCommands(e){m(this,ho).add(e),U(this,$e,Xi).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:U(this,$e,zv).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...m(this,gn)],t=()=>{for(const i of e)i.remove()},r=()=>{for(const i of e)U(this,$e,Ak).call(this,i)};this.addCommands({cmd:t,undo:r,mustExec:!0})}commitOrRemove(){var e;(e=m(this,$s))==null||e.commitOrRemove()}hasSomethingToControl(){return m(this,$s)||this.hasSelection}selectAll(){for(const e of m(this,gn))e.commit();U(this,$e,Ek).call(this,m(this,Ur).values())}unselectAll(){if(!(m(this,$s)&&(m(this,$s).commitOrRemove(),m(this,ei)!==Ht.NONE))&&this.hasSelection){for(const e of m(this,gn))e.unselect();m(this,gn).clear(),U(this,$e,Xi).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;m(this,ed)[0]+=e,m(this,ed)[1]+=t;const[i,s]=m(this,ed),a=[...m(this,gn)],o=1e3;
451m(this,ll)&&clearTimeout(m(this,ll)),M(this,ll,setTimeout(()=>{M(this,ll,null),m(this,ed)[0]=m(this,ed)[1]=0,this.addCommands({cmd:()=>{for(const l of a)m(this,Ur).has(l.id)&&l.translateInPage(i,s)},undo:()=>{for(const l of a)m(this,Ur).has(l.id)&&l.translateInPage(-i,-s)},mustExec:!1})},o));for(const l of a)l.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),M(this,sl,new Map);for(const e of m(this,gn))m(this,sl).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!m(this,sl))return!1;this.disableUserSelect(!1);const e=m(this,sl);M(this,sl,null);let t=!1;for(const[{x:i,y:s,pageIndex:a},o]of e)o.newX=i,o.newY=s,o.newPageIndex=a,t||(t=i!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!t)return!1;const r=(i,s,a,o)=>{if(m(this,Ur).has(i.id)){const l=m(this,bi).get(o);l?i._setParentAndPosition(l,s,a):(i.pageIndex=o,i.x=s,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:s,newY:a,newPageIndex:o}]of e)r(i,s,a,o)},undo:()=>{for(const[i,{savedX:s,savedY:a,savedPageIndex:o}]of e)r(i,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(m(this,sl))for(const r of m(this,sl).keys())r.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||m(this,gn).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return m(this,$s)===e}getActive(){return m(this,$s)}getMode(){return m(this,ei)}get imageManager(){return tn(this,"imageManager",new yk)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let c=0,u=t.rangeCount;c<u;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:i,width:s,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,u,f,p)=>({x:(u-i)/a,y:1-(c+f-r)/s,width:p/a,height:f/s});break;case"180":o=(c,u,f,p)=>({x:1-(c+f-r)/s,y:1-(u+p-i)/a,width:f/s,height:p/a});break;case"270":o=(c,u,f,p)=>({x:1-(u+p-i)/a,y:(c-r)/s,width:p/a,height:f/s});break;default:o=(c,u,f,p)=>({x:(c-r)/s,y:(u-i)/a,width:f/s,height:p/a});break}const l=[];for(let c=0,u=t.rangeCount;c<u;c++){const f=t.getRangeAt(c);if(!f.collapsed)for(const{x:p,y:h,width:b,height:g}of f.getClientRects())b===0||g===0||l.push(o(p,h,b,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(m(this,pg)||M(this,pg,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=m(this,pg))==null||t.delete(e)}renderAnnotationElement(e){var i;const t=(i=m(this,pg))==null?void 0:i.get(e.data.id);if(!t)return;const r=m(this,gc).getRawValue(t);r&&(m(this,ei)===Ht.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}};hg=new WeakMap,$s=new WeakMap,Ur=new WeakMap,bi=new WeakMap,fg=new WeakMap,gc=new WeakMap,pg=new WeakMap,ho=new WeakMap,Yu=new WeakMap,mg=new WeakMap,of=new WeakMap,sl=new WeakMap,fo=new WeakMap,lf=new WeakMap,vy=new WeakMap,yy=new WeakMap,gg=new WeakMap,by=new WeakMap,al=new WeakMap,Xu=new WeakMap,vg=new WeakMap,Ju=new WeakMap,ol=new WeakMap,G_=new WeakMap,Qu=new WeakMap,wy=new WeakMap,Zu=new WeakMap,cf=new WeakMap,xy=new WeakMap,_y=new WeakMap,ei=new WeakMap,gn=new WeakMap,vc=new WeakMap,uf=new WeakMap,Sy=new WeakMap,Ay=new WeakMap,ed=new WeakMap,ll=new WeakMap,yc=new WeakMap,Ey=new WeakMap,ba=new WeakMap,$e=new WeakSet,ix=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},wk=function(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const r of m(this,bi).values())if(r.hasTextLayer(e))return r;return null},KF=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=U(this,$e,ix).call(this,e).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(m(this,ol)||M(this,ol,new Are(this)),m(this,ol).show(r,i,this.direction==="ltr"))},YF=function(){var s,a,o;const e=document.getSelection();if(!e||e.isCollapsed){m(this,vc)&&((s=m(this,ol))==null||s.hide(),M(this,vc,null),U(this,$e,Xi).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===m(this,vc))return;const i=U(this,$e,ix).call(this,e).closest(".textLayer");if(!i){m(this,vc)&&((a=m(this,ol))==null||a.hide(),M(this,vc,null),U(this,$e,Xi).call(this,{hasSelectedText:!1}));return}if((o=m(this,ol))==null||o.hide(),M(this,vc,t),U(this,$e,Xi).call(this,{hasSelectedText:!0}),!(m(this,ei)!==Ht.HIGHLIGHT&&m(this,ei)!==Ht.NONE)&&(m(this,ei)===Ht.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),M(this,Ju,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=m(this,ei)===Ht.HIGHLIGHT?U(this,$e,wk).call(this,i):null;l==null||l.toggleDrawing();const c=new AbortController,u=this.combinedSignal(c),f=p=>{p.type==="pointerup"&&p.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),p.t
451ype==="pointerup"&&U(this,$e,sx).call(this,"main_toolbar"))};window.addEventListener("pointerup",f,{signal:u}),window.addEventListener("blur",f,{signal:u})}},sx=function(e=""){m(this,ei)===Ht.HIGHLIGHT?this.highlightSelection(e):m(this,vy)&&U(this,$e,KF).call(this)},XF=function(){document.addEventListener("selectionchange",U(this,$e,YF).bind(this),{signal:this._signal})},JF=function(){if(m(this,Xu))return;M(this,Xu,new AbortController);const e=this.combinedSignal(m(this,Xu));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},QF=function(){var e;(e=m(this,Xu))==null||e.abort(),M(this,Xu,null)},xk=function(){if(m(this,Zu))return;M(this,Zu,new AbortController);const e=this.combinedSignal(m(this,Zu));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},ZF=function(){var e;(e=m(this,Zu))==null||e.abort(),M(this,Zu,null)},_k=function(){if(m(this,Yu))return;M(this,Yu,new AbortController);const e=this.combinedSignal(m(this,Yu));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},Sk=function(){var e;(e=m(this,Yu))==null||e.abort(),M(this,Yu,null)},e7=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Xi=function(e){Object.entries(e).some(([r,i])=>m(this,Ay)[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(m(this,Ay),e)}),m(this,ei)===Ht.HIGHLIGHT&&e.hasSelectedEditor===!1&&U(this,$e,ju).call(this,[[jt.HIGHLIGHT_FREE,!0]]))},ju=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},t7=async function(){if(!m(this,Qu)){M(this,Qu,!0);const e=[];for(const t of m(this,bi).values())e.push(t.enable());await Promise.all(e);for(const t of m(this,Ur).values())t.enable()}},n7=function(){if(this.unselectAll(),m(this,Qu)){M(this,Qu,!1);for(const e of m(this,bi).values())e.disable();for(const e of m(this,Ur).values())e.disable()}},Ak=function(e){const t=m(this,bi).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},r7=function(){let e=null;for(e of m(this,gn));return e},zv=function(){if(m(this,Ur).size===0)return!0;if(m(this,Ur).size===1)for(const e of m(this,Ur).values())return e.isEmpty();return!1},Ek=function(e){for(const t of m(this,gn))t.unselect();m(this,gn).clear();for(const t of e)t.isEmpty()||(m(this,gn).add(t),t.select());U(this,$e,Xi).call(this,{hasSelectedEditor:this.hasSelection})},Ue(Rm,"TRANSLATE_SMALL",1),Ue(Rm,"TRANSLATE_BIG",10);let dp=Rm;var ti,cl,po,yg,ul,Us,bg,dl,ms,bc,df,hl,td,ko,qv,ax;const Ji=class Ji{constructor(e){q(this,ko);q(this,ti,null);q(this,cl,!1);q(this,po,null);q(this,yg,null);q(this,ul,null);q(this,Us,null);q(this,bg,!1);q(this,dl,null);q(this,ms,null);q(this,bc,null);q(this,df,null);q(this,hl,!1);M(this,ms,e),M(this,hl,e._uiManager.useNewAltTextFlow),m(Ji,td)||M(Ji,td,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){Ji._l10n??(Ji._l10n=e)}async render(){const e=M(this,po,document.createElement("button"));e.className="altText",e.tabIndex="0";const t=M(this,yg,document.createElement("span"));e.append(t),m(this,hl)?(e.classList.add("new"),e.setAttribute("data-l10n-id",m(Ji,td).missing),t.setAttribute("data-l10n-id",m(Ji,td)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=m(this,ms)._uiManager._signal;e.addEventListener("contextmenu",$a,{signal:r}),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});const i=s=>{s.preventDefault(),m(this,ms)._uiManager.editAltText(m(this,ms)),m(this,hl)&&m(this,ms)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:m(this,ko,qv)}})};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(M(this,bg,!0),i(s))},{signal:r}),await U(this,ko,ax).call(this),e}finish(){m(this,po)&&(m(this,po).focus({focusVisible:m(this,bg)}),M(this,bg,!1))}isEmpty(){return m(this,hl)?m(this,ti)===null:!m(this,ti)&&!m(this,cl)}hasData(){return m(this,hl)?m(this,ti)!==null||!!m(this,bc):this.isEmpty()}get guessedText(){return m(this,bc)}async setGuessedText(e){m(this,ti)===null&&(M(this,bc,e),M(this,df,await Ji._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),U(this,ko,ax).call(this))}toggleAltTextBadge(e=!1){var t;if(!m(this,hl)||m(this,ti)){(t=m(this,dl))==null||t.remove(),M(this,dl,null);return}if(!m(this,dl)){const r=M(this,dl,document.createElement("div"));r.className="noAltTextBadge",m(this,ms).div.append(r)}m(this,dl).classList.toggle("hidden",!e)}serialize(e){let t=m(this,ti);return!e&&m(this,bc)===t&&(t=m(this,df)),{altText:t,decorative:m(this,cl),guessedText:m(this,bc),textWithDisclaimer:m(this,df)}}get data(){return{altText:m(this,ti),decorative:m(this,cl)}}set data({altText:e,decorative:t,guessedText:r,textWithDisclaimer:i,cancel:s=!1}){r&&(M(this,bc,r),M(this,df,i)),!(m(this,ti)===e&&m(this,cl)===t)&&(s||(M(this,ti,e),M(this,cl,t)),U(this,ko,ax).call(this))}toggle(e=!1){m(this,po)&&(!e&&m(this,Us)&&(clearTimeout(m(this,Us)),M(this,Us,null)),m(this,po).disabled=!e)}shown(){m(this,ms)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:m(this,ko,qv)}})}destroy(){var e,t;(e=m(this,po))==null||e.remove(),M(this,po,null),M(this,yg,null),M(this,ul,null),(t=m(this,dl))==null||t.remove(),M(this,dl,null)}};ti=new WeakMap,cl=new WeakMap,po=new WeakMap,yg=new WeakMap,ul=new WeakMap,Us=new WeakMap,bg=new WeakMap,dl=new WeakMap,ms=new WeakMap,bc=new WeakMap,df=new WeakMap,hl=new WeakMap,td=new WeakMap,ko=new WeakSet,qv=function(){return m(this,ti)&&"added"||m(this,ti)===null&&this.guessedText&&"review"||"missing"},ax=async function(){var i,s,a;const e=m(this,po);if(!e)return;if(m(this,hl)){if(e.classList.toggle("done",!!m(this,ti)),e.setAttribute("data-l10n-id",m(Ji,td)[m(this,ko,qv)]),(i=m(this,yg))==null||i.setAttribute("data-l10n-id",m(Ji,td)[`${m(this,ko,qv)}-label`]),!m(this,ti)){(s=m(this,ul))==null||s.remove();return}}else{if(!m(this,ti)&&!m(this,cl)){e.classList.remove("done"),(a=m(this,ul))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=m(this,ul);if(!t){M(this,ul,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${m(this,ms).id}`;const o=100,l=m(this,ms)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(m(this,Us)),M(this,Us,null)},{once:!0}),e.addEventListener("mouseenter",()=>{M(this,Us,setTimeout(()=>{M(this,Us,null),m(this,ul).classList.add("show"),m(this,ms)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var c;m(this,Us)&&(clearTimeout(m(this,Us)),M(this,Us,null)),(c=m(this,ul))==null||c.classList.remove("show")},{signal:l})}m(this,cl)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=m(this,ti)),t.parentNode||e.append(t);const r=m(this,ms).getImageForAltText();r==null||r.setAttribute("aria-describedby",t.id)},q(Ji,td,null),Ue(Ji,"_l10n",null);let P_=Ji;var hf,mo,Qn,wg,ff,wi,pf,nd,Ny,mf,rd,ky,gf,wc,fl,xg,_g,wa,Cy,K_,Wt,Nk,Ty,kk,Ck,i7,s7,Tk,Pk,jk,a7,Rk,o7,l7,c7,Lk,Hv;const fn=class fn{constructor(e){q(this,Wt);q(this,hf,null);q(this,mo,null);q(this,Qn,null);q(this,wg,!1);q(this,ff,!1);q(this,wi,null);q(this,pf,null);q(this,nd,null);q(this,Ny,"");q(this,mf,!1);q(this,rd,null);q(this,ky,!1);q(this,gf,!1);q(this,wc,!1);q(this,fl,null);q(this,xg,0);q(this,_g,0);q(this,wa,null);Ue(this,"_editToolbar",null);Ue(this,"_initialOptions",Object.create(null));Ue(this,"_initialData",null);Ue(this,"_isVisible",!0);Ue(this,"_uiManager",null);Ue(this,"_focusEventsAllowed",!0);q(this,Cy,!1);q(this,K_,fn._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=fn.prototype._resizeWithKeyboard,t=dp.TRANSLATE_SMALL,r=
451dp.TRANSLATE_BIG;return tn(this,"_resizerKeyboardManager",new Ub([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],fn.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return tn(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new Cre({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(fn._l10n??(fn._l10n=e),fn._l10nResizer||(fn._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),fn._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);fn._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Un("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return m(this,Cy)}set _isDraggable(e){var t;M(this,Cy,e),(t=this.div)==null||t.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=m(this,K_)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):U(this,Wt,Hv).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(m(this,mf)?M(this,mf,!1):this.parent.setSelected(this))}focusout(e){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(r=this.parent)!=null&&r.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,r,i){const[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(e+r)/s,this.y=(t+i)/a,this.fixAndSetPosition()}translate(e,t){U(this,Wt,Nk).call(this,this.parentDimensions,e,t)}translateInPage(e,t){m(this,rd)||M(this,rd,[this.x,this.y]),U(this,Wt,Nk).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){m(this,rd)||M(this,rd,[this.x,this.y]);const[r,i]=this.parentDimensions;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:c,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[o,l]=this.getBaseTranslation();s+=o,a+=l,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!m(this,rd)&&(m(this,rd)[0]!==this.x||m(this,rd)[1]!==this.y)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:r}=fn,i=r/e,s=r/t;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[t,r]=this.pageDimensions;let{x:i,y:s,width:a,height:o}=this;if(a*=t,o*=r,i*=t,s*=r,this._mustFixPosition)switch(e){case 0:i=Math.max(0,Math.min(t-a,i)
451),s=Math.max(0,Math.min(r-o,s));break;case 90:i=Math.max(0,Math.min(t-o,i)),s=Math.min(r,Math.max(a,s));break;case 180:i=Math.min(t,Math.max(a,i)),s=Math.min(r,Math.max(o,s));break;case 270:i=Math.min(t,Math.max(o,i)),s=Math.max(0,Math.min(r-a,s));break}this.x=i/=t,this.y=s/=r;const[l,c]=this.getBaseTranslation();i+=l,s+=c;const{style:u}=this.div;u.left=`${(100*i).toFixed(2)}%`,u.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var r;return U(r=fn,Ty,kk).call(r,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var r;return U(r=fn,Ty,kk).call(r,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,r]}=this;return[t*e,r*e]}setDims(e,t){const[r,i]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,m(this,ff)||(this.div.style.height=`${(100*t/i).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:r}=e,i=r.endsWith("%"),s=!m(this,ff)&&t.endsWith("%");if(i&&s)return;const[a,o]=this.parentDimensions;i||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!m(this,ff)&&!s&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var e;(e=m(this,Qn))==null||e.finish()}async addEditToolbar(){return this._editToolbar||m(this,gf)?this._editToolbar:(this._editToolbar=new gk(this),this.div.append(this._editToolbar.render()),m(this,Qn)&&await this._editToolbar.addAltText(m(this,Qn)),this._editToolbar)}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=m(this,Qn))==null||e.destroy())}addContainer(e){var r;const t=(r=this._editToolbar)==null?void 0:r.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){m(this,Qn)||(P_.initialize(fn._l10n),M(this,Qn,new P_(this)),m(this,hf)&&(m(this,Qn).data=m(this,hf),M(this,hf,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=m(this,Qn))==null?void 0:e.data}set altTextData(e){m(this,Qn)&&(m(this,Qn).data=e)}get guessedAltText(){var e;return(e=m(this,Qn))==null?void 0:e.guessedText}async setGuessedAltText(e){var t;await((t=m(this,Qn))==null?void 0:t.setGuessedText(e))}serializeAltText(e){var t;return(t=m(this,Qn))==null?void 0:t.serialize(e)}hasAltText(){return!!m(this,Qn)&&!m(this,Qn).isEmpty()}hasAltTextData(){var e;return((e=m(this,Qn))==null?void 0:e.hasData())??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=m(this,wg)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),U(this,Wt,Rk).call(this);const[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);const[r,i]=this.getInitialTranslation();return this.translate(r,i),T_(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=is.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(M(this,mf,!0),this._isDraggable){U(this,Wt,a7).call(this,e);return}U(this,Wt,jk).call(this,e)}get isSelected(){return this._uiManager.isSelected(this)}moveInDOM(){m(this,fl)&&clearTimeout(m(this,fl)),M(this,fl,setTimeout(()=>{var e;M(this,fl,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,r){e.changeParent(this),this.x=t,this.y=r,this.fixAndSetPosition()}getRect(e,t,r=this.rotation){const i=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/i,u=t/i,f=this.x*s,p=this.y*a,h=this.width*s,b=this.height*a;switch(r){case 0:return[f+c+o,a-p-u-b+l,f+c+h+o,a-p-u+l];case 90:return[f+u+o,a-p+c+l,f+u+b+o,a-p+c+h+l];case 180:return[f-c-h+o,a-p+u+l,f-c+o,a-p+u+b+l];case 270:return[f-u-b+o,a-p-c-h+l,f-u+o,a-p-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[r,i,s,a]=e,o=s-r,l=a-i;switch(this.rotation){case 0:return[r,t-a,o,l];case 90:return[r,t-i,l,o];case 180:return[s,t-i,o,l];case 270:return[s,t-a,l,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){M(this,gf,!0)}disableEditMode(){M(this,gf,!1)}isInEditMode(){return m(this,gf)}shouldGetKeyboardEvents(){return m(this,wc)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){U(this,Wt,Rk).call(this)}rotate(e){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,t=null){Un("An editor must be serializable")}static async deserialize(e,t,r){const i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:r});i.rotation=e.rotation,M(i,hf,e.accessibilityData);const[s,a]=i.pageDimensions,[o,l,c,u]=i.getRectInCurrentCoords(e.rect,a);return i.x=o/s,i.y=l/a,i.width=c/s,i.height=u/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e;if((e=m(this,nd))==null||e.abort(),M(this,nd,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),m(this,fl)&&(clearTimeout(m(this,fl)),M(this,fl,null)),U(this,Wt,Hv).call(this),this.removeEditToolbar(),m(this,wa)){for(const t of m(this,wa).values())clearTimeout(t);M(this,wa,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(U(this,Wt,i7).call(this),m(this,wi).classList.remove("hidden"),T_(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),M(this,pf,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=m(this,wi).children;if(!m(this,mo)){M(this,mo,Array.from(t));const a=U(this,Wt,o7).bind(this),o=U(this,Wt,l7).bind(this),l=this._uiManager._signal;for(const c of m(this,mo)){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",U(this,Wt,c7).bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",fn._l10nResizer[u])}}const r=m(this,mo)[0];let i=0;for(const a of t){if(a===r)break;
451i++}const s=(360-this.rotation+this.parentRotation)%360/90*(m(this,mo).length/4);if(s!==i){if(s<i)for(let o=0;o<i-s;o++)m(this,wi).append(m(this,wi).firstChild);else if(s>i)for(let o=0;o<s-i;o++)m(this,wi).firstChild.before(m(this,wi).lastChild);let a=0;for(const o of t){const c=m(this,mo)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",fn._l10nResizer[c])}}U(this,Wt,Lk).call(this,0),M(this,wc,!0),m(this,wi).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){m(this,wc)&&U(this,Wt,Pk).call(this,m(this,Ny),{movementX:e,movementY:t})}_stopResizingWithKeyboard(){U(this,Wt,Hv).call(this),this.div.focus()}select(){var e,t,r;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var i,s;(i=this.div)!=null&&i.classList.contains("selectedEditor")&&((s=this._editToolbar)==null||s.show())});return}(t=this._editToolbar)==null||t.show(),(r=m(this,Qn))==null||r.toggleAltTextBadge(!1)}unselect(){var e,t,r,i,s;(e=m(this,wi))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(i=this._editToolbar)==null||i.hide(),(s=m(this,Qn))==null||s.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return m(this,ky)}set isEditing(e){M(this,ky,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){M(this,ff,!0);const r=e/t,{style:i}=this.div;i.aspectRatio=r,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){m(this,wa)||M(this,wa,new Map);const{action:r}=e;let i=m(this,wa).get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),m(this,wa).delete(r),m(this,wa).size===0&&M(this,wa,null)},fn._telemetryTimeout),m(this,wa).set(r,i);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),M(this,wg,!1)}disable(){this.div&&(this.div.tabIndex=-1),M(this,wg,!0)}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const r=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),r.before(t)}return t}resetAnnotationElement(e){const{firstChild:t}=e.container;(t==null?void 0:t.nodeName)==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};hf=new WeakMap,mo=new WeakMap,Qn=new WeakMap,wg=new WeakMap,ff=new WeakMap,wi=new WeakMap,pf=new WeakMap,nd=new WeakMap,Ny=new WeakMap,mf=new WeakMap,rd=new WeakMap,ky=new WeakMap,gf=new WeakMap,wc=new WeakMap,fl=new WeakMap,xg=new WeakMap,_g=new WeakMap,wa=new WeakMap,Cy=new WeakMap,K_=new WeakMap,Wt=new WeakSet,Nk=function([e,t],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/e,this.y+=i/t,this.fixAndSetPosition()},Ty=new WeakSet,kk=function(e,t,r){switch(r){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},Ck=function(e){switch(e){case 90:{const[t,r]=this.pageDimensions;return[0,-t/r,r/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,r]=this.pageDimensions;return[0,t/r,-r/t,0]}default:return[1,0,0,1]}},i7=function(){if(m(this,wi))return;M(this,wi,document.createElement("div")),m(this,wi).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const r of e){const i=document.createElement("div");m(this,wi).append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",U(this,Wt,s7).bind(this,r),{signal:t}),i.addEventListener("contextmenu",$a,{signal:t}),i.tabIndex=-1}this.div.prepend(m(this,wi))},s7=function(e,t){var b;t.preventDefault();const{isMac:r}=is.platform;if(t.button!==0||t.ctrlKey&&r)return;(b=m(this,Qn))==null||b.toggle(!1);const i=this._isDraggable;this._isDraggable=!1;const s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",U(this,Wt,Pk).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("contextmenu",$a,{signal:a});const o=this.x,l=this.y,c=this.width,u=this.height,f=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const h=()=>{var g;s.abort(),this.parent.togglePointerEvents(!0),(g=m(this,Qn))==null||g.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=f,this.div.style.cursor=p,U(this,Wt,Tk).call(this,o,l,c,u)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})},Tk=function(e,t,r,i){const s=this.x,a=this.y,o=this.width,l=this.height;s===e&&a===t&&o===r&&l===i||this.addCommands({cmd:()=>{this.width=o,this.height=l,this.x=s,this.y=a;const[c,u]=this.parentDimensions;this.setDims(c*o,u*l),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=i,this.x=e,this.y=t;const[c,u]=this.parentDimensions;this.setDims(c*r,u*i),this.fixAndSetPosition()},mustExec:!0})},Pk=function(e,t){const[r,i]=this.parentDimensions,s=this.x,a=this.y,o=this.width,l=this.height,c=fn.MIN_SIZE/r,u=fn.MIN_SIZE/i,f=se=>Math.round(se*1e4)/1e4,p=U(this,Wt,Ck).call(this,this.rotation),h=(se,O)=>[p[0]*se+p[2]*O,p[1]*se+p[3]*O],b=U(this,Wt,Ck).call(this,360-this.rotation),g=(se,O)=>[b[0]*se+b[2]*O,b[1]*se+b[3]*O];let w,y,x=!1,S=!1;switch(e){case"topLeft":x=!0,w=(se,O)=>[0,0],y=(se,O)=>[se,O];break;case"topMiddle":w=(se,O)=>[se/2,0],y=(se,O)=>[se/2,O];break;case"topRight":x=!0,w=(se,O)=>[se,0],y=(se,O)=>[0,O];break;case"middleRight":S=!0,w=(se,O)=>[se,O/2],y=(se,O)=>[0,O/2];break;case"bottomRight":x=!0,w=(se,O)=>[se,O],y=(se,O)=>[0,0];break;case"bottomMiddle":w=(se,O)=>[se/2,O],y=(se,O)=>[se/2,0];break;case"bottomLeft":x=!0,w=(se,O)=>[0,O],y=(se,O)=>[se,0];break;case"middleLeft":S=!0,w=(se,O)=>[0,O/2],y=(se,O)=>[se,O/2];break}const A=w(o,l),C=y(o,l);let T=h(...C);const R=f(s+T[0]),I=f(a+T[1]);let L=1,V=1,[j,$]=this.screenToPageTranslation(t.movementX,t.movementY);if([j,$]=g(j/r,$/i),x){const se=Math.hypot(o,l);L=V=Math.max(Math.min(Math.hypot(C[0]-A[0]-j,C[1]-A[1]-$)/se,1/o,1/l),c/o,u/l)}else S?L=Math.max(c,Math.min(1,Math.abs(C[0]-A[0]-j)))/o:V=Math.max(u,Math.min(1,Math.abs(C[1]-A[1]-$)))/l;const J=f(o*L),H=f(l*V);T=h(...y(J,H));const le=R-T[0],oe=I-T[1];this.width=J,this.height=H,this.x=le,this.y=oe,this.setDims(r*J,i*H),this.fixAndSetPosition()},jk=function(e){const{isMac:t}=is.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},a7=function(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();const r=new AbortController,i=this._uiManager.combinedSignal(r);if(t){this.div.classList.add("moving"),M(this,xg,e.clientX),M(this,_g,e.clientY);const a=o=>{const{clientX:l,clientY:c}=o,[u,f]=this.screenToPageTranslation(l-m(this,xg),c-m(this,_g));M(this,xg,l),M(this,_g,c),this._uiManager.dragSelectedEditors(u,f)};window.addEventListener("pointermove",a,{passive:!0,capture:!0,signal:i})}const s=()=>{r.abort(),t&&this.div.classList.remove("moving"),M(this,mf,!1),this._uiManager.endDragSession()||U(this,Wt,jk).call(this,e)};window.addEventListener("pointerup",s,{signal:i}),window.addEventListener("blur",s,{signal:i})},Rk=function(){if(m(this,nd)||!this.div)return;M(this,nd,new AbortController);const e=this._uiManager.combinedSignal(m(this,nd));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},o7=function(e){fn._resizerKeyboardManager.exec(this,e)},l7=function(e){var t;m(this,wc)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==m(this,wi)&&U(this,Wt,Hv).call(this)},c7=function(e){M(this,Ny,m(this,wc)?e:"")},Lk=function(e){if(m(this,mo))for(const t of m(this,mo))t.tabIndex=e},Hv=function(){if(M(this,wc,!1),U(this,Wt,Lk).call(this,-1),m(this,pf)){const{savedX:e,s
451avedY:t,savedWidth:r,savedHeight:i}=m(this,pf);U(this,Wt,Tk).call(this,e,t,r,i),M(this,pf,null)}},q(fn,Ty),Ue(fn,"_l10n",null),Ue(fn,"_l10nResizer",null),Ue(fn,"_borderLineWidth",-1),Ue(fn,"_colorManager",new bk),Ue(fn,"_zIndex",1),Ue(fn,"_telemetryTimeout",1e3);let bn=fn;class Cre extends bn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const UR=3285377520,va=4294901760,Jo=65535;class u7{constructor(e){this.h1=e?e&4294967295:UR,this.h2=e?e&4294967295:UR}update(e){let t,r;if(typeof e=="string"){t=new Uint8Array(e.length*2),r=0;for(let g=0,w=e.length;g<w;g++){const y=e.charCodeAt(g);y<=255?t[r++]=y:(t[r++]=y>>>8,t[r++]=y&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),r=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=r>>2,s=r-i*4,a=new Uint32Array(t.buffer,0,i);let o=0,l=0,c=this.h1,u=this.h2;const f=3432918353,p=461845907,h=f&Jo,b=p&Jo;for(let g=0;g<i;g++)g&1?(o=a[g],o=o*f&va|o*h&Jo,o=o<<15|o>>>17,o=o*p&va|o*b&Jo,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[g],l=l*f&va|l*h&Jo,l=l<<15|l>>>17,l=l*p&va|l*b&Jo,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,s){case 3:o^=t[i*4+2]<<16;case 2:o^=t[i*4+1]<<8;case 1:o^=t[i*4],o=o*f&va|o*h&Jo,o=o<<15|o>>>17,o=o*p&va|o*b&Jo,i&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&va|e*36045&Jo,t=t*4283543511&va|((t<<16|e>>>16)*2950163797&va)>>>16,e^=t>>>1,e=e*444984403&va|e*60499&Jo,t=t*3301882366&va|((t<<16|e>>>16)*3120437893&va)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const Ik=Object.freeze({map:null,hash:"",transfer:void 0});var vf,yf,ni,Y_,d7;class UT{constructor(){q(this,Y_);q(this,vf,!1);q(this,yf,null);q(this,ni,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const r=m(this,ni).get(e);return r===void 0?t:Object.assign(t,r)}getRawValue(e){return m(this,ni).get(e)}remove(e){if(m(this,ni).delete(e),m(this,ni).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const t of m(this,ni).values())if(t instanceof bn)return;this.onAnnotationEditor(null)}}setValue(e,t){const r=m(this,ni).get(e);let i=!1;if(r!==void 0)for(const[s,a]of Object.entries(t))r[s]!==a&&(i=!0,r[s]=a);else i=!0,m(this,ni).set(e,t);i&&U(this,Y_,d7).call(this),t instanceof bn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return m(this,ni).has(e)}getAll(){return m(this,ni).size>0?OT(m(this,ni)):null}setAll(e){for(const[t,r]of Object.entries(e))this.setValue(t,r)}get size(){return m(this,ni).size}resetModified(){m(this,vf)&&(M(this,vf,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new h7(this)}get serializable(){if(m(this,ni).size===0)return Ik;const e=new Map,t=new u7,r=[],i=Object.create(null);let s=!1;for(const[a,o]of m(this,ni)){const l=o instanceof bn?o.serialize(!1,i):o;l&&(e.set(a,l),t.update(`${a}:${JSON.stringify(l)}`),s||(s=!!l.bitmap))}if(s)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:r}:Ik}get editorStats(){let e=null;const t=new Map;for(const r of m(this,ni).values()){if(!(r instanceof bn))continue;const i=r.telemetryFinalData;if(!i)continue;const{type:s}=i;t.has(s)||t.set(s,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const a=e[s]||(e[s]=new Map);for(const[o,l]of Object.entries(i)){if(o==="type")continue;let c=a.get(o);c||(c=new Map,a.set(o,c));const u=c.get(l)??0;c.set(l,u+1)}}for(const[r,i]of t)e[r]=i.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){M(this,yf,null)}get modifiedIds(){if(m(this,yf))return m(this,yf);const e=[];for(const t of m(this,ni).values())!(t instanceof bn)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return M(this,yf,{ids:new Set(e),hash:e.join(",")})}}vf=new WeakMap,yf=new WeakMap,ni=new WeakMap,Y_=new WeakSet,d7=function(){m(this,vf)||(M(this,vf,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Py;class h7 extends UT{constructor(t){super();q(this,Py);const{map:r,hash:i,transfer:s}=t.serializable,a=structuredClone(r,s?{transfer:s}:null);M(this,Py,{map:a,hash:i,transfer:s})}get print(){Un("Should not call PrintAnnotationStorage.print")}get serializable(){return m(this,Py)}get modifiedIds(){return tn(this,"modifiedIds",{ids:new Set,hash:""})}}Py=new WeakMap;var Sg;class Tre{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){q(this,Sg,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),m(this,Sg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}
451){if(!(!e||m(this,Sg).has(e.loadedName))){if(Wr(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:i,style:s}=e,a=new FontFace(r,i,s);this.addNativeFontFace(a);try{await a.load(),m(this,Sg).add(r),t==null||t(e)}catch{Gt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Un("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw Gt(`Failed to load font '${r.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return tn(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Hi||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),tn(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function t(){for(Wr(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){const s=r.shift();setTimeout(s.callback,0)}}const{loadingRequests:r}=this,i={done:!1,complete:t,callback:e};return r.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return tn(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function r(A,C){return A.charCodeAt(C)<<24|A.charCodeAt(C+1)<<16|A.charCodeAt(C+2)<<8|A.charCodeAt(C+3)&255}function i(A,C,T,R){const I=A.substring(0,C),L=A.substring(C+T);return I+R+L}let s,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function u(A,C){if(++c>30){Gt("Load test font never loaded."),C();return}if(l.font="30px "+A,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(u.bind(null,A,C))}const f=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=i(p,976,f.length,f);const b=16,g=1482184792;let w=r(p,b);for(s=0,a=f.length-3;s<a;s+=4)w=w-g+r(f,s)|0;s<f.length&&(w=w-g+r(f+"XXX",s)|0),p=i(p,b,4,fre(w));const y=`url(data:font/opentype;base64,${btoa(p)});`,x=`@font-face {font-family:"${f}";src:${y}}`;this.insertRule(x);const S=this._document.createElement("div");S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",
451S.style.top=S.style.left="0px";for(const A of[e.loadedName,f]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=A,S.append(C)}this._document.body.append(S),u(f,()=>{S.remove(),t.complete()})}}Sg=new WeakMap;class Pre{constructor(e,{disableFontFace:t=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const i in e)this[i]=e[i];this.disableFontFace=t===!0,this._inspectFont=r}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var r;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${bre(this.data)});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}return(r=this._inspectFont)==null||r.call(this,this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let r;try{r=e.get(this.loadedName+"_path_"+t)}catch(s){Gt(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[t]=function(s,a){};const i=[];for(let s=0,a=r.length;s<a;)switch(r[s++]){case rc.BEZIER_CURVE_TO:{const[o,l,c,u,f,p]=r.slice(s,s+6);i.push(h=>h.bezierCurveTo(o,l,c,u,f,p)),s+=6}break;case rc.MOVE_TO:{const[o,l]=r.slice(s,s+2);i.push(c=>c.moveTo(o,l)),s+=2}break;case rc.LINE_TO:{const[o,l]=r.slice(s,s+2);i.push(c=>c.lineTo(o,l)),s+=2}break;case rc.QUADRATIC_CURVE_TO:{const[o,l,c,u]=r.slice(s,s+4);i.push(f=>f.quadraticCurveTo(o,l,c,u)),s+=4}break;case rc.RESTORE:i.push(o=>o.restore());break;case rc.SAVE:i.push(o=>o.save());break;case rc.SCALE:Wr(i.length===2,"Scale command is only valid at the third position.");break;case rc.TRANSFORM:{const[o,l,c,u,f,p]=r.slice(s,s+6);i.push(h=>h.transform(o,l,c,u,f,p)),s+=6}break;case rc.TRANSLATE:{const[o,l]=r.slice(s,s+2);i.push(c=>c.translate(o,l)),s+=2}break}return this.compiledGlyphs[t]=function(a,o){i[0](a),i[1](a),a.scale(o,-o);for(let l=2,c=i.length;l<c;l++)i[l](a)}}}var jy;class f7{constructor({enableHWA:e=!1}){q(this,jy,!1);M(this,jy,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!m(this,jy)})}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Un("Abstract method `_createCanvas` called.")}}jy=new WeakMap;class jre extends f7{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const r=this._document.createElement("canvas");return r.width=e,r.height=t,r}}class p7{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){Un("Abstract method `_fetch` called.")}}class m7 extends p7{async _fetch(e){const t=await Q5(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):J5(t)}}class g7{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,r,i,s){return"none"}destroy(e=!1){}}var bf,wf,pl,xc,Fi,X_,xf,qe,Oi,cm,um,ox,dm,v7,Ok,hm,Wv,Vv,Mk,Gv;class Rre extends g7{constructor({docId:t,ownerDocument:r=globalThis.document}){super();q(this,qe);q(this,bf);q(this,wf);q(this,pl);q(this,xc);q(this,Fi);q(this,X_);q(this,xf,0);M(this,xc,t),M(this,Fi,r)}addFilter(t){if(!t)return"none";let r=m(this,qe,Oi).get(t);if(r)return r;const[i,s,a]=U(this,qe,ox).call(this,t),o=t.length===1?i:`${i}${s}${a}`;if(r=m(this,qe,Oi).get(o),r)return m(this,qe,Oi).set(t,r),r;const l=`g_${m(this,xc)}_transfer_map_${Xr(this,xf)._++}`,c=U(this,qe,dm).call(this,l);m(this,qe,Oi).set(t,c),m(this,qe,Oi).set(o,c);const u=U(this,qe,hm).call(this,l);return U(this,qe,Vv).call(this,i,s,a,u),c}addHCMFilter(t,r){var b;const i=`${t}-${r}`,s="base";let a=m(this,qe,cm).get(s);if((a==null?void 0:a.key)===i||(a?((b=a.filter)==null||b.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},m(this,qe,cm).set(s,a)),!t||!r))return a.url;const o=U(this,qe,Gv).call(this,t);t=ft.makeHexColor(...o);const l=U(this,qe,Gv).call(this,r);if(r=ft.makeHexColor(...l),m(this,qe,um).style.color="",t==="#000000"&&r==="#ffffff"||t===r)return a.url;const c=new Array(256);for(let g=0;g<=255;g++){const w=g/255;c[g]=w<=.03928?w/12.92:((w+.055)/1.055)**2.4}const u=c.join(","),f=`g_${m(this,xc)}_hcm_filter`,p=a.filter=U(this,qe,hm).call(this,f);U(this,qe,Vv).call(this,u,u,u,p),U(this,qe,Ok).call(this,p);const h=(g,w)=>{const y=o[g]/255,x=l[g]/255,S=new Array(w+1);for(let A=0;A<=w;A++)S[A]=y+A/w*(x-y);return S.join(",")};return U(this,qe,Vv).call(this,h(0,5),h(1,5),h(2,5),p),a.url=U(this,qe,dm).call(this,f),a.url}addAlphaFilter(t){let r=m(this,qe,Oi).get(t);if(r)return r;const[i]=U(this,qe,ox).call(this,[t]),s=`alpha_${i}`;if(r=m(this,qe,Oi).get(s),r)return m(this,qe,Oi).set(t,r),r;const a=`g_${m(this,xc)}_alpha_map_${Xr(this,xf)._++}`,o=U(this,qe,dm).call(this,a);m(this,qe,Oi).set(t,o),m(this,qe,Oi).set(s,o);const l=U(this,qe,hm).call(this,a);return U(this,qe,Mk).call(this,i,l),o}addLuminosityFilter(t){let r=m(this,qe,Oi).get(t||"luminosity");if(r)return r;let i,s;if(t?([i]=U(this,qe,ox).call(this,[t]),s=`luminosity_${i}`):s="luminosity",r=m(this,qe,Oi).get(s),r)return m(this,qe,Oi).set(t,r),r;const a=`g_${m(this,xc)}_luminosity_map_${Xr(this,xf)._++}`,o=U(this,qe,dm).call(this,a);m(this,qe,Oi).set(t,o),m(this,qe,Oi).set(s,o);const l=U(this,qe,hm).call(this,a);return U(this,qe,v7).call(this,l),t&&U(this,qe,Mk).call(this,i,l),o}addHighlightHCMFilter(t,r,i,s,a){var x;const o=`${r}-${i}-${s}-${a}`;let l=m(this,qe,cm).get(t);if((l==null?void 0:l.key)===o||(l?((x=l.filter)==null||x.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},m(this,qe,cm).set(t,l)),!r||!i))return l.url;const[c,u]=[r,i].map(U(this,qe,Gv).bind(this));let f=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[h,b]=[s,a].map(U(this,qe,Gv).bind(this));p<f&&([f,p,h,b]=[p,f,b,h]),m(this,qe,um).style.color="";const g=(S,A,C)=>{const T=new Array(256),R=(p-f)/C,I=S/255,L=(A-S)/(255*C);let V=0;for(let j=0;j<=C;j++){const $=Math.round(f+j*R),J=I+j*L;for(let H=V;H<=$;H++)T[H]=J;V=$+1}for(let j=V;j<256;j++)T[j]=T[V-1];return T.join(",")},w=`g_${m(this,xc)}_hcm_${t}_filter`,y=l.filter=U(this,qe,hm).call(this,w);return U(this,qe,Ok).call(this,y),U(this,qe,Vv).call(this,g(h[0],b[0],5),g(h[1],b[1],5),g(h[2],b[2],5),y),l.url=U(this,qe,dm).call(this,w),l.url}destroy(t=!1){t&&m(this,qe,cm).size!==0||(m(this,pl)&&(m(this,pl).parentNode.parentNode.remove(),M(this,pl,null)),m(this,wf)&&(m(this,wf).clear(),M(this,wf,null)),M(this,xf,0))}}bf=new WeakMap,wf=new WeakMap,pl=new WeakMap,xc=new WeakMap,Fi=new WeakMap,X_=new WeakMap,xf=new WeakMap,qe=new WeakSet,Oi=function(){return m(this,wf)||M(this,wf,new Map)},cm=function(){return m(this,X_)||M(this,X_,new Map)},um=function(){if(!m(this,pl)){const t=m(this,Fi).createElement("div"),{style:r}=t;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const i=m(this,Fi).createElementNS(lc,"svg");i.setAttribute("width",0),i.setAttribute("height",0),M(this,pl,m
451(this,Fi).createElementNS(lc,"defs")),t.append(i),i.append(m(this,pl)),m(this,Fi).body.append(t)}return m(this,pl)},ox=function(t){if(t.length===1){const c=t[0],u=new Array(256);for(let p=0;p<256;p++)u[p]=c[p]/255;const f=u.join(",");return[f,f,f]}const[r,i,s]=t,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=r[c]/255,o[c]=i[c]/255,l[c]=s[c]/255;return[a.join(","),o.join(","),l.join(",")]},dm=function(t){if(m(this,bf)===void 0){M(this,bf,"");const r=m(this,Fi).URL;r!==m(this,Fi).baseURI&&(Z5(r)?Gt('#createUrl: ignore "data:"-URL for performance reasons.'):M(this,bf,r.split("#",1)[0]))}return`url(${m(this,bf)}#${t})`},v7=function(t){const r=m(this,Fi).createElementNS(lc,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(r)},Ok=function(t){const r=m(this,Fi).createElementNS(lc,"feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(r)},hm=function(t){const r=m(this,Fi).createElementNS(lc,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),m(this,qe,um).append(r),r},Wv=function(t,r,i){const s=m(this,Fi).createElementNS(lc,r);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),t.append(s)},Vv=function(t,r,i,s){const a=m(this,Fi).createElementNS(lc,"feComponentTransfer");
451s.append(a),U(this,qe,Wv).call(this,a,"feFuncR",t),U(this,qe,Wv).call(this,a,"feFuncG",r),U(this,qe,Wv).call(this,a,"feFuncB",i)},Mk=function(t,r){const i=m(this,Fi).createElementNS(lc,"feComponentTransfer");r.append(i),U(this,qe,Wv).call(this,i,"feFuncA",t)},Gv=function(t){return m(this,qe,um).style.color=t,$T(getComputedStyle(m(this,qe,um)).getPropertyValue("color"))};class y7{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(r=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){Un("Abstract method `_fetch` called.")}}class b7 extends y7{async _fetch(e){const t=await Q5(e,"arraybuffer");return new Uint8Array(t)}}if(Hi){var Dk=Promise.withResolvers(),v1=null;(async()=>{const e=await Vh(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),t=await Vh(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),r=await Vh(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),i=await Vh(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);let s,a;return new Map(Object.entries({fs:e,http:t,https:r,url:i,canvas:s,path2d:a}))})().then(e=>{v1=e,Dk.resolve()},e=>{Gt(`loadPackages: ${e}`),v1=new Map,Dk.resolve()})}class Hd{static get promise(){return Dk.promise}static get(e){return v1==null?void 0:v1.get(e)}}async function w7(n){const t=await Hd.get("fs").promises.readFile(n);return new Uint8Array(t)}class Lre extends g7{}class Ire extends f7{_createCanvas(e,t){return Hd.get("canvas").createCanvas(e,t)}}class Ore extends p7{async _fetch(e){return w7(e)}}class Mre extends y7{async _fetch(e){return w7(e)}}const ts={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Fk(n,e){if(!e)return;const t=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,r),n.clip(i)}class zT{getPattern(){Un("Abstract method `getPattern` called.")}}class Dre extends zT{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)t.addColorStop(r[0],r[1]);return t}getPattern(e,t,r,i){let s;if(i===ts.STROKE||i===ts.FILL){const a=t.current.getClippedPathBoundingBox(i,er(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas("pattern",o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),r=ft.transform(r,[1,0,0,1,a[0],a[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),Fk(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),s=e.createPattern(c.canvas,"no-repeat");const f=new DOMMatrix(r);s.setTransform(f)}else Fk(e,this._bbox),s=this._createGradient(e);return s}}function VA(n,e,t,r,i,s,a,o){const l=e.coords,c=e.colors,u=n.data,f=n.width*4;let p;l[t+1]>l[r+1]&&(p=t,t=r,r=p,p=s,s=a,a=p),l[r+1]>l[i+1]&&(p=r,r=i,i=p,p=a,a=o,o=p),l[t+1]>l[r+1]&&(p=t,t=r,r=p,p=s,s=a,a=p);const h=(l[t]+e.offsetX)*e.scaleX,b=(l[t+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,w=(l[r+1]+e.offsetY)*e.scaleY,y=(l[i]+e.offsetX)*e.scaleX,x=(l[i+1]+e.offsetY)*e.scaleY;if(b>=x)return;const S=c[s],A=c[s+1],C=c[s+2],T=c[a],R=c[a+1],I=c[a+2],L=c[o],V=c[o+1],j=c[o+2],$=Math.round(b),J=Math.round(x);let H,le,oe,se,O,te,he,ge;for(let D=$;D<=J;D++){if(D<w){const Q=D<b?0:(b-D)/(b-w);H=h-(h-g)*Q,le=S-(S-T)*Q,oe=A-(A-R)*Q,se=C-(C-I)*Q}else{let Q;D>x?Q=1:w===x?Q=0:Q=(w-D)/(w-x),H=g-(g-y)*Q,le=T-(T-L)*Q,oe=R-(R-V)*Q,se=I-(I-j)*Q}let G;D<b?G=0:D>x?G=1:G=(b-D)/(b-x),O=h-(h-y)*G,te=S-(S-L)*G,he=A-(A-V)*G,ge=C-(C-j)*G;const ee=Math.round(Math.min(H,O)),ae=Math.round(Math.max(H,O));let X=f*D+ee*4;for(let Q=ee;Q<=ae;Q++)G=(H-Q)/(H-O),G<0?G=0:G>1&&(G=1),u[X++]=le-(le-te)*G|0,u[X++]=oe-(oe-he)*G|0,u[X++]=se-(se-ge)*G|0,u[X++]=255}}function Fre(n,e,t){const r=e.coords,i=e.colors;let s,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(r.length/o)-1,c=o-1;for(s=0;s<l;s++){let u=s*o;for(let f=0;f<c;f++,u++)VA(n,t,r[u],r[u+1],r[u+o],i[u],i[u+1],i[u+o]),VA(n,t,r[u+o+1],r[u+1],r[u+o],i[u+o+1],i[u+1],i[u+o])}break;case"triangles":for(s=0,a=r.length;s<a;s+=3)VA(n,t,r[s],r[s+1],r[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}class Bre extends zT{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,r){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,f=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),p=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),h=c/f,b=u/p,g={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/h,scaleY:1/b},w=f+2*2,y=p+2*2,x=r.getCanvas("mesh",w,y),S=x.context,A=S.createImageData(f,p);if(t){const T=A.data;for(let R=0,I=T.length;R<I;R+=4)T[R]=t[0],T[R+1]=t[1],T[R+2]=t[2],T[R+3]=255}for(const T of this._figures)Fre(A,T,g);return S.putImageData(A,2,2),{canvas:x.canvas,offsetX:o-2*h,offsetY:l-2*b,scaleX:h,scaleY:b}}getPattern(e,t,r,i){Fk(e,this._bbox);let s;if(i===ts.SHADING)s=ft.singularValueDecompose2dScale(er(e));else if(s=ft.singularValueDecompose2dScale(t.baseTransform),this.matrix
vendor: 12,211 bytes, line 451
451){const o=ft.singularValueDecompose2dScale(this.matrix);s=[s[0]*o[0],s[1]*o[1]]}const a=this._createMeshCanvas(s,i===ts.SHADING?null:this._background,t.cachedCanvases);return i!==ts.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class $re extends zT{getPattern(){return"hotpink"}}function Ure(n){switch(n[0]){case"RadialAxial":return new Dre(n);case"Mesh":return new Bre(n);case"Dummy":return new $re}throw new Error(`Unknown IR type: ${n[0]}`)}const zR={COLORED:1,UNCOLORED:2},J_=class J_{constructor(e,t,r,i,s){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=r,this.canvasGraphicsFactory=i,this.baseTransform=s}createPatternCanvas(e){const{bbox:t,operatorList:r,paintType:i,tilingType:s,color:a,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),Y5("TilingType: "+s);const u=t[0],f=t[1],p=t[2],h=t[3],b=p-u,g=h-f,w=ft.singularValueDecompose2dScale(this.matrix),y=ft.singularValueDecompose2dScale(this.baseTransform),x=w[0]*y[0],S=w[1]*y[1];let A=b,C=g,T=!1,R=!1;const I=Math.ceil(l*x),L=Math.ceil(c*S),V=Math.ceil(b*x),j=Math.ceil(g*S);I>=V?A=l:T=!0,L>=j?C=c:R=!0;const $=this.getSizeAndScale(A,this.ctx.canvas.width,x),J=this.getSizeAndScale(C,this.ctx.canvas.height,S),H=e.cachedCanvases.getCanvas("pattern",$.size,J.size),le=H.context,oe=o.createCanvasGraphics(le);if(oe.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(oe,i,a),le.translate(-$.scale*u,-J.scale*f),oe.transform($.scale,0,0,J.scale,0,0),le.save(),this.clipBbox(oe,u,f,p,h),oe.baseTransform=er(oe.ctx),oe.executeOperatorList(r),oe.endDrawing(),le.restore(),T||R){const se=H.canvas;T&&(A=l),R&&(C=c);const O=this.getSizeAndScale(A,this.ctx.canvas.width,x),te=this.getSizeAndScale(C,this.ctx.canvas.height,S),he=O.size,ge=te.size,D=e.cachedCanvases.getCanvas("pattern-workaround",he,ge),G=D.context,ee=T?Math.floor(b/l):0,ae=R?Math.floor(g/c):0;for(let X=0;X<=ee;X++)for(let Q=0;Q<=ae;Q++)G.drawImage(se,he*X,ge*Q,he,ge,0,0,he,ge);return{canvas:D.canvas,scaleX:O.scale,scaleY:te.scale,offsetX:u,offsetY:f}}return{canvas:H.canvas,scaleX:$.scale,scaleY:J.scale,offsetX:u,offsetY:f}}getSizeAndScale(e,t,r){const i=Math.max(J_.MAX_PATTERN_SIZE,t);let s=Math.ceil(e*r);return s>=i?s=i:r=s/e,{scale:r,size:s}}clipBbox(e,t,r,i,s){const a=i-t,o=s-r;e.ctx.rect(t,r,a,o),e.current.updateRectMinMax(er(e.ctx),[t,r,i,s]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,r){const i=e.ctx,s=e.current;switch(t){case zR.COLORED:const a=this.ctx;i.fillStyle=a.fillStyle,i.strokeStyle=a.strokeStyle,s.fillColor=a.fillStyle,s.strokeColor=a.strokeStyle;break;case zR.UNCOLORED:const o=ft.makeHexColor(r[0],r[1],r[2]);i.fillStyle=o,i.strokeStyle=o,s.fillColor=o,s.strokeColor=o;break;default:throw new hre(`Unsupported paint type: ${t}`)}}getPattern(e,t,r,i){let s=r;i!==ts.SHADING&&(s=ft.transform(s,t.baseTransform),this.matrix&&(s=ft.transform(s,this.matrix)));const a=this.createPatternCanvas(t);let o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=e.createPattern(a.canvas,"repeat");return l.setTransform(o),l}};Ue(J_,"MAX_PATTERN_SIZE",3e3);let Bk=J_;function zre({src:n,srcPos:e=0,dest:t,width:r,height:i,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=is.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],u=r>>3,f=r&7,p=n.length;t=new Uint32Array(t.buffer);let h=0;for(let b=0;b<i;b++){for(const w=e+u;e<w;e++){const y=e<p?n[e]:255;t[h++]=y&128?c:l,t[h++]=y&64?c:l,t[h++]=y&32?c:l,t[h++]=y&16?c:l,t[h++]=y&8?c:l,t[h++]=y&4?c:l,t[h++]=y&2?c:l,t[h++]=y&1?c:l}if(f===0)continue;const g=e<p?n[e++]:255;for(let w=0;w<f;w++)t[h++]=g&1<<7-w?c:l}return{srcPos:e,destPos:h}}const qR=16,HR=100,qre=15,WR=10,VR=1e3,bs=16;function Hre(n,e){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){e.save(),this.__originalSave()},n.restore=function(){e.restore(),this.__originalRestore()},n.translate=function(r,i){e.translate(r,i),this.__originalTranslate(r,i)},n.scale=function(r,i){e.scale(r,i),this.__originalScale(r,i)},n.transform=function(r,i,s,a,o,l){e.transform(r,i,s,a,o,l),this.__originalTransform(r,i,s,a,o,l)},n.setTransform=function(r,i,s,a,o,l){e.setTransform(r,i,s,a,o,l),this.__originalSetTransform(r,i,s,a,o,l)},n.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},n.rotate=function(r){e.rotate(r),this.__originalRotate(r)},n.clip=function(r){e.clip(r),this.__originalClip(r)},n.moveTo=function(t,r){e.moveTo(t,r),this.__originalMoveTo(t,r)},n.lineTo=function(t,r){e.lineTo(t,r),this.__originalLineTo(t,r)},n.bezierCurveTo=function(t,r,i,s,a,o){e.bezierCurveTo(t,r,i,s,a,o),this.__originalBezierCurveTo(t,r,i,s,a,o)},n.rect=function(t,r,i,s){e.rect(t,r,i,s),this.__originalRect(t,r,i,s)},n.closePath=function(){e.closePath(),this.__originalClosePath()},n.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class Wre{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,r){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,t,r)):(i=this.canvasFactory.create(t,r),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function p2(n,e,t,r,i,s,a,o,l,c){const[u,f,p,h,b,g]=er(n);if(f===0&&p===0){const x=a*u+b,S=Math.round(x),A=o*h+g,C=Math.round(A),T=(a+l)*u+b,R=Math.abs(Math.round(T)-S)||1,I=(o+c)*h+g,L=Math.abs(Math.round(I)-C)||1;return n.setTransform(Math.sign(u),0,0,Math.sign(h),S,C),n.drawImage(e,t,r,i,s,0,0,R,L),n.setTransform(u,f,p,h,b,g),[R,L]}if(u===0&&h===0){const x=o*p+b,S=Math.round(x),A=a*f+g,C=Math.round(A),T=(o+c)*p+b,R=Math.abs(Math.round(T)-S)||1,I=(a+l)*f+g,L=Math.abs(Math.round(I)-C)||1;return n.setTransform(0,Math.sign(f),Math.sign(p),0,S,C),n.drawImage(e,t,r,i,s,0,0,L,R),n.setTransform(u,f,p,h,b,g),[L,R]}n.drawImage(e,t,r,i,s,a,o,l,c);const w=Math.hypot(u,f),y=Math.hypot(p,h);return[w*l,y*c]}function Vre(n){const{width:e,height:t}=n;if(e>VR||t>VR)return null;const r=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let a=new Uint8Array(s*(t+1)),o,l,c;const u=e+7&-8;let f=new Uint8Array(u*t),p=0;for(const y of n.data){let x=128;for(;x>0;)f[p++]=y&x?0:255,x>>=1}let h=0;for(p=0,f[p]!==0&&(a[0]=1,++h),l=1;l<e;l++)f[p]!==f[p+1]&&(a[l]=f[p]?2:1,++h),p++;for(f[p]!==0&&(a[l]=2,++h),o=1;o<t;o++){p=o*u,c=o*s,f[p-u]!==f[p]&&(a[c]=f[p]?1:8,++h);let y=(f[p]?4:0)+(f[p-u]?8:0);for(l=1;l<e;l++)y=(y>>2)+(f[p+1]?4:0)+(f[p-u+1]?8:0),i[y]&&(a[c+l]=i[y],++h),p++;if(f[p-u]!==f[p]&&(a[c+l]=f[p]?2:4,++h),h>r)return null}for(p=u*(t-1),c=o*s,f[p]!==0&&(a[c]=8,++h),l=1;l<e;l++)f[p]!==f[p+1]&&(a[c+l]=f[p]?4:8,++h),p++;if(f[p]!==0&&(a[c+l]=4,++h),h>r)return null;const b=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(o=0;h&&o<=t;o++){let y=o*s;const x=y+e;for(;y<x&&!a[y];)y++;if(y===x)continue;g.moveTo(y%s,o);const S=y;let A=a[y];do{const C=b[A];do y+=C;while(!a[y]);const T=a[y];T!==5&&T!==10?(A=T,a[y]=0):(A=T&51*A>>4,a[y]&=A>>2|A<<2),g.lineTo(y%s,y/s|0),a[y]||--h}while(S!==y);--o}return f=null,a=null,function(y){y.save(),y.scale(1/e,-1/t),y.translate(0,-t),y.fill(g),y.beginPath(),y.restore()}}class GR{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=DF,this.textMatrixScale=1,this.fontMatrix=dk,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=Ii.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,r){[t,r]=ft.applyTransform([t,r],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,t){const r=ft.applyTransform(t,e),i=ft.applyTransform(t.slice(2),e),s=ft.applyTransform([t[0],t[3]],e),a=ft.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,r[0],i[0],s[0],a[0]),this.minY=Math.min(this.minY,r[1],i[1],s[1],a[1]),this.maxX=Math.max(this.maxX,r[0],i[0],s[0],a[0]),this.maxY=Math.max(this.maxY,r[1],i[1],s[1],a[1])}updateScalingPathMinMax(e,t){ft.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,r,i,s,a,o,l,c,u){const f=ft.bezierBoundingBox(t,r,i,s,a,o,l,c,u);u||this.updateRectMinMax(e,f)}getPathBoundingBox(e=ts.FILL,t=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===ts.STROKE){t||Un("Stroke bounding box must include transform.");const i=ft.singularValueDecompose2dScale(t),s=i[0]*this.lineWidth/2,a=i[1]*this.lineWidth/2;r[0]-=s,r[1]-=a,r[2]+=s,r[3]+=a}return r}updateClipFromPath(){const e=ft.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=ts.FILL,t=null){return ft.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function KR(n,e){if(typeof ImageData<"u"&&e instanceof ImageData){n.putImageData(e,0,0);return}const t=e.height,r=e.width,i=t%bs,s=(t-i)/bs,a=i===0?s:s+1,o=n.createImageData(r,bs);let l=0,c;const u=e.data,f=o.data;let p,h,b,g;if(e.kind===ex.GRAYSCALE_1BPP){const w=u.byteLength,y=new Uint32Array(f.buffer,0,f.byteLength>>2),x=y.length,S=r+7>>3,A=4294967295,C=is.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(b=p<s?bs:i,c=0,h=0;h<b;h++){const T=w-l;let R=0;const I=T>S?r:T*8-7,L=I&-8;let V=0,j=0;for(;R<L;R+=8)j=u[l++],y[c++]=j&128?A:C,y[c++]=j&64?A:C,y[c++]=j&32?A:C,y[c++]=j&16?A:C,y[c++]=j&8?A:C,y[c++]=j&4?A:C,y[c++]=j&2?A:C,y[c++]=j&1?A:C;for(;R<I;R++)V===0&&(j=u[l++],V=128),y[c++]=j&V?A:C,V>>=1}for(;c<x;)y[c++]=0;n.putImageData(o,0,p*bs)}}else if(e.kind===ex.RGBA_32BPP){for(h=0,g=r*bs*4,p=0;p<s;p++)f.set(u.subarray(l,l+g)),l+=g,n.putImageData(o,0,h),h+=bs;p<a&&(g=r*i*4,f.set(u.subarray(l,l+g)),n.putImageData(o,0,h))}else if(e.kind===ex.RGB_24BPP)for(b=bs,g=r*b,p=0;p<a;p++){for(p>=s&&(b=i,g=r*b),c=0,h=g;h--;)f[c++]=u[l++],f[c++]=u[l++],f[c++]=u[l++],f[c++]=255;n.putImageData(o,0,p*bs)}else throw new Error(`bad image kind: ${e.kind}`)}function YR(n,e){if(e.bitmap){n.drawImage(e.bitmap,0,0);return}const t=e.height,r=e.width,i=t%bs,s=(t-i)/bs,a=i===0?s:s+1,o=n.createImageData(r,bs);let l=0;const c=e.data,u=o.data;for(let f=0;f<a;f++){const p=f<s?bs:i;({srcPos:l}=zre({src:c,srcPos:l,dest:u,width:r,height:p,nonBlackColor:0})),n.putImageData(o,0,f*bs)}}function Pv(n,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of t)n[r]!==void 0&&(e[r]=n[r]);
vendor: 5,363 bytes, line 451
451n.setLineDash!==void 0&&(e.setLineDash(n.getLineDash()),e.lineDashOffset=n.lineDashOffset)}function m2(n){if(n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0),!Hi){const{filter:e}=n;e!=="none"&&e!==""&&(n.filter="none")}}function XR(n,e){if(e)return!0;const t=ft.singularValueDecompose2dScale(n);t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*qd.PDF_TO_CSS_UNITS);return t[0]<=r&&t[1]<=r}const Gre=["butt","round","square"],Kre=["miter","round","bevel"],Yre={},JR={};var Kd,$k,Uk;const CP=class CP{constructor(e,t,r,i,s,{optionalContentConfig:a,markedContentStack:o=null},l,c){q(this,Kd);this.ctx=e,this.current=new GR(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=r,this.canvasFactory=i,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new Wre(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:r=!1,background:i=null}){const s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,r){const l=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...er(this.compositeCtx))}this.ctx.save(),m2(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=er(this.ctx)}executeOperatorList(e,t,r,i){const s=e.argsArray,a=e.fnArray;let o=t||0;const l=s.length;if(l===o)return o;const c=l-o>WR&&typeof r=="function",u=c?Date.now()+qre:0;let f=0;const p=this.commonObjs,h=this.objs;let b;for(;;){if(i!==void 0&&o===i.nextBreakPoint)return i.breakIt(o,r),o;if(b=a[o],b!==oo.dependency)this[b].apply(this,s[o]);else for(const g of s[o]){const w=g.startsWith("g_")?p:h;if(!w.has(g))return w.get(g,r),o}if(o++,o===l)return o;if(c&&++f>WR){if(Date.now()>u)return r(),o;f=0}}}endDrawing(){U(this,Kd,$k).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),U(this,Kd,Uk).call(this)}_scaleImage(e,t){const r=e.width??e.displayWidth,i=e.height??e.displayHeight;let s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=r,l=i,c="prescale1",u,f;for(;s>2&&o>1||a>2&&l>1;){let p=o,h=l;s>2&&o>1&&(p=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/p),a>2&&l>1&&(h=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/h),u=this.cachedCanvases.getCanvas(c,p,h),f=u.context,f.clearRect(0,0,p,h),f.drawImage(e,0,0,o,l,0,0,p,h),e=u.canvas,o=p,l=h,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e){const t=this.ctx,{width:r,height:i}=e,s=this.current.fillColor,a=this.current.patternFill,o=er(t);let l,c,u,f;if((e.bitmap||e.data)&&e.count>1){const I=e.bitmap||e.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),s]),l=this._cachedBitmapsMap.get(I),l||(l=new Map,this._cachedBitmapsMap.set(I,l));const L=l.get(c);if(L&&!a){const V=Math.round(Math.min(o[0],o[2])+o[4]),j=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:L,offsetX:V,offsetY:j}}u=L}u||(f=this.cachedCanvases.getCanvas("maskCanvas",r,i),YR(f.context,e));let p=ft.transform(o,[1/r,0,0,-1/i,0,0]);p=ft.transform(p,[1,0,0,1,0,-i]);const[h,b,g,w]=ft.getAxialAlignedBoundingBox([0,0,r,i],p),y=Math.round(g-h)||1,x=Math.round(w-b)||1,S=this.cachedCanvases.getCanvas("fillCanvas",y,x),A=S.context,C=h,T=b;A.translate(-C,-T),A.transform(...p),u||(u=this._scaleImage(f.canvas,ic(A)),u=u.img,l&&a&&l.set(c,u)),A.imageSmoothingEnabled=XR(er(A),e.interpolate),p2(A,u,0,0,u.width,u.height,0,0,r,i),A.globalCompositeOperation="source-in";const R=ft.transform(ic(A),[1,0,0,1,-C,-T]);return A.fillStyle=a?s.getPattern(t,this,R,ts.FILL):s,A.fillRect(0,0,r,i),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,S.canvas)),{canvas:S.canvas,offsetX:Math.round(C),offsetY:Math.round(T)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=Gre[e]}setLineJoin(e){this.ctx.lineJoin=Kre[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=t)}
vendor: 5,266 bytes, line 451
451setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,t);this.suspendedCtx=this.ctx,this.ctx=i.context;const s=this.ctx;s.setTransform(...er(this.suspendedCtx)),Pv(this.suspendedCtx,s),Hre(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Pv(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,r,i){const s=i[0],a=i[1],o=i[2]-s,l=i[3]-a;o===0||l===0||(this.genericComposeSMask(t.context,r,o,l,t.subtype,t.backdrop,t.transferMap,s,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,t,r,i,s,a,o,l,c,u,f){let p=e.canvas,h=l-u,b=c-f;if(a){const w=ft.makeHexColor(...a);if(h<0||b<0||h+r>p.width||b+i>p.height){const y=this.cachedCanvases.getCanvas("maskExtension",r,i),x=y.context;x.drawImage(p,-h,-b),x.globalCompositeOperation="destination-atop",x.fillStyle=w,x.fillRect(0,0,r,i),x.globalCompositeOperation="source-over",p=y.canvas,h=b=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(h,b,r,i),e.clip(y),e.globalCompositeOperation="destination-atop",e.fillStyle=w,e.fillRect(h,b,r,i),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));const g=new Path2D;g.rect(l,c,r,i),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(p,h,b,r,i,l,c,r,i),t.restore()}save(){this.inSMaskMode?(Pv(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Pv(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,r,i,s,a){this.ctx.transform(e,t,r,i,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,r){const i=this.ctx,s=this.current;let a=s.x,o=s.y,l,c;const u=er(i),f=u[0]===0&&u[3]===0||u[1]===0&&u[2]===0,p=f?r.slice(0):null;for(let h=0,b=0,g=e.length;h<g;h++)switch(e[h]|0){case oo.rectangle:a=t[b++],o=t[b++];const w=t[b++],y=t[b++],x=a+w,S=o+y;i.moveTo(a,o),w===0||y===0?i.lineTo(x,S):(i.lineTo(x,o),i.lineTo(x,S),i.lineTo(a,S)),f||s.updateRectMinMax(u,[a,o,x,S]),i.closePath();break;case oo.moveTo:a=t[b++],o=t[b++],i.moveTo(a,o),f||s.updatePathMinMax(u,a,o);break;case oo.lineTo:a=t[b++],o=t[b++],i.lineTo(a,o),f||s.updatePathMinMax(u,a,o);break;case oo.curveTo:l=a,c=o,a=t[b+4],o=t[b+5],i.bezierCurveTo(t[b],t[b+1],t[b+2],t[b+3],a,o),s.updateCurvePathMinMax(u,l,c,t[b],t[b+1],t[b+2],t[b+3],a,o,p),b+=6;break;case oo.curveTo2:l=a,c=o,i.bezierCurveTo(a,o,t[b],t[b+1],t[b+2],t[b+3]),s.updateCurvePathMinMax(u,l,c,a,o,t[b],t[b+1],t[b+2],t[b+3],p),a=t[b+2],o=t[b+3],b+=4;break;case oo.curveTo3:l=a,c=o,a=t[b+2],o=t[b+3],i.bezierCurveTo(t[b],t[b+1],a,o,a,o),s.updateCurvePathMinMax(u,l,c,t[b],t[b+1],a,o,a,o,p),b+=4;break;case oo.closePath:i.closePath();break}f&&s.updateScalingPathMinMax(u,p),s.setCurrentPoint(a,o)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,r=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&(r!=null&&r.getPattern)?(t.save(),t.strokeStyle=r.getPattern(t,this,ic(t),ts.STROKE),this.rescaleAndStroke(!1),t.restore(
451)):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,r=this.current.fillColor,i=this.current.patternFill;let s=!1;i&&(t.save(),t.fillStyle=r.getPattern(t,this,ic(t),ts.FILL),s=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),s&&t.restore(),e&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Yre}eoClip(){this.pendingClip=JR}beginText(){this.current.textMatrix=DF,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(e===void 0){t.beginPath();return}t.save(),t.beginPath();for(const r of e)t.setTransform(...r.transform),t.translate(r.x,r.y),r.addToPath(t,r.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){var u;const r=this.commonObjs.get(e),i=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=r.fontMatrix||dk,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&Gt("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;const s=r.loadedName||"sans-serif",a=((u=r.systemFontInfo)==null?void 0:u.css)||`"${s}", ${r.fallbackName}`;let o="normal";r.black?o="900":r.bold&&(o="bold");const l=r.italic?"italic":"normal";let c=t;t<qR?c=qR:t>HR&&(c=HR),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,r,i,s,a){this.current.textMatrix=[e,t,r,i,s,a],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,r,i){const s=this.ctx,a=this.current,o=a.font,l=a.textRenderingMode,c=a.fontSize/a.fontSizeScale,u=l&Ii.FILL_STROKE_MASK,f=!!(l&Ii.ADD_TO_PATH_FLAG),p=a.patternFill&&!o.missingFile;let h;(o.disableFontFace||f||p)&&(h=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||p?(s.save(),s.translate(t,r),s.beginPath(),h(s,c),i&&s.setTransform(...i),(u===Ii.FILL||u===Ii.FILL_STROKE)&&s.fill(),(u===Ii.STROKE||u===Ii.FILL_STROKE)&&s.stroke(),s.restore()):((u===Ii.FILL||u===Ii.FILL_STROKE)&&s.fillText(e,t,r),(u===Ii.STROKE||u===Ii.FILL_STROKE)&&s.strokeText(e,t,r)),f&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:er(s),x:t,y:r,fontSize:c,addToPath:h})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let r=!1;for(let i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){r=!0;break}return tn(this,"isFontSubpixelAAEnabled",r)}showText(e){const t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);const i=t.fontSize;if(i===0)return;const s=this.ctx,a=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,c=t.fontDirection,u=t.textHScale*c,f=e.length,p=r.vertical,h=p?1:-1,b=r.defaultVMetrics,g=i*t.fontMatrix[0],w=t.textRenderingMode===Ii.FILL&&!r.disableFontFace&&!t.patternFill;s.save(),s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),c>0?s.scale(u,-1):s.scale(u,1);let y;if(t.patternFill){s.save();const T=t.fillColor.getPattern(s,this,ic(s),ts.FILL);
451y=er(s),s.restore(),s.fillStyle=T}let x=t.lineWidth;const S=t.textMatrixScale;if(S===0||x===0){const T=t.textRenderingMode&Ii.FILL_STROKE_MASK;(T===Ii.STROKE||T===Ii.FILL_STROKE)&&(x=this.getSinglePixelWidth())}else x/=S;if(a!==1&&(s.scale(a,a),x/=a),s.lineWidth=x,r.isInvalidPDFjsFont){const T=[];let R=0;for(const I of e)T.push(I.unicode),R+=I.width;s.fillText(T.join(""),0,0),t.x+=R*g*u,s.restore(),this.compose();return}let A=0,C;for(C=0;C<f;++C){const T=e[C];if(typeof T=="number"){A+=h*T*i/1e3;continue}let R=!1;const I=(T.isSpace?l:0)+o,L=T.fontChar,V=T.accent;let j,$,J=T.width;if(p){const le=T.vmetric||b,oe=-(T.vmetric?le[1]:J*.5)*g,se=le[2]*g;J=le?-le[0]:J,j=oe/a,$=(A+se)/a}else j=A/a,$=0;if(r.remeasure&&J>0){const le=s.measureText(L).width*1e3/i*a;if(J<le&&this.isFontSubpixelAAEnabled){const oe=J/le;R=!0,s.save(),s.scale(oe,1),j/=oe}else J!==le&&(j+=(J-le)/2e3*i/a)}if(this.contentVisible&&(T.isInFont||r.missingFile)){if(w&&!V)s.fillText(L,j,$);else if(this.paintChar(L,j,$,y),V){const le=j+i*V.offset.x/a,oe=$-i*V.offset.y/a;this.paintChar(V.fontChar,le,oe,y)}}const H=p?J*g-I*c:J*g+I*c;A+=H,R&&s.restore()}p?t.y-=A:t.x+=A*u,s.restore(),this.compose()}showType3Text(e){const t=this.ctx,r=this.current,i=r.font,s=r.fontSize,a=r.fontDirection,o=i.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,u=r.textHScale*a,f=r.fontMatrix||dk,p=e.length,h=r.textRenderingMode===Ii.INVISIBLE;let b,g,w,y;if(!(h||s===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...r.textMatrix),t.translate(r.x,r.y),t.scale(u,a),b=0;b<p;++b){if(g=e[b],typeof g=="number"){y=o*g*s/1e3,this.ctx.translate(y,0),r.x+=y*u;continue}const x=(g.isSpace?c:0)+l,S=i.charProcOperatorList[g.operatorListId];if(!S){Gt(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),t.scale(s,s),t.transform(...f),this.executeOperatorList(S),this.restore()),w=ft.applyTransform([g.width,0],f)[0]*s+x,t.translate(w,0),r.x+=w*u}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,r,i,s,a){this.ctx.rect(r,i,s-r,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if(e[0]==="TilingPattern"){const r=e[1],i=this.baseTransform||er(this.ctx),s={createCanvasGraphics:a=>new CP(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new Bk(e,r,this.ctx,s,i)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,r){this.ctx.strokeStyle=this.current.strokeColor=ft.makeHexColor(e,t,r)}
vendor: 8,658 bytes, line 451
451setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,t,r){this.ctx.fillStyle=this.current.fillColor=ft.makeHexColor(e,t,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=Ure(this.getObject(e)),this.cachedPatterns.set(e,r)),t&&(r.matrix=t),r}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const r=this._getPattern(e);t.fillStyle=r.getPattern(t,this,ic(t),ts.SHADING);const i=ic(t);if(i){const{width:s,height:a}=t.canvas,[o,l,c,u]=ft.getAxialAlignedBoundingBox([0,0,s,a],i);this.ctx.fillRect(o,l,c-o,u-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Un("Should not call beginInlineImage")}beginImageData(){Un("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=er(this.ctx),t)){const r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.current.updateRectMinMax(er(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||Y5("TODO: Support non-isolated groups."),e.knockout&&Gt("Knockout groups not supported.");const r=er(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=ft.getAxialAlignedBoundingBox(e.bbox,er(t));const s=[0,0,t.canvas.width,t.canvas.height];i=ft.intersect(i,s)||[0,0,0,0];const a=Math.floor(i[0]),o=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-a,1),c=Math.max(Math.ceil(i[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(u,l,c),p=f.context;p.translate(-a,-o),p.transform(...r),e.smask?this.smaskStack.push({canvas:f.canvas,context:p,offsetX:a,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,o),t.save()),Pv(t,p),this.ctx=p,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const i=er(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);const s=ft.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],i);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,r,i,s){if(U(this,Kd,$k).call(this),m2(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const a=t[2]-t[0],o=t[3]-t[1];if(s&&this.annotationCanvasMap){r=r.slice(),r[4]-=t[0],r[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=a,t[3]=o;const[l,c]=ft.singularValueDecompose2dScale(er(this.ctx)),{viewportScale:u}=this,f=Math.ceil(a*this.outputScaleX*u),p=Math.ceil(o*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(f,p);const{canvas:h,context:b}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=b,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,o*c),m2(this.ctx)}else m2(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],a,o),this.ctx.clip(),this.ctx.beginPath()}this.current=new GR(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),U(this,Kd,Uk).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;e=this.getObject(e.data,e),e.count=t;const r=this.ctx,i=this.processingType3;if(i&&(i.compiled===void 0&&(i.compiled=Vre(e)),i.compiled)){i.compiled(r);return}const s=this._createMaskCanvas(e),a=s.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,s.offsetX,s.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,r=0,i=0,s,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const l=er(o);o.transform(t,r,i,s,0,0);const c=this._createMaskCanvas(e);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,f=a.length;u<f;u+=2){const p=ft.transform(l,[t,r,i,s,a[u],a[u+1]]),[h,b]=ft.applyTransform([0,0],p);o.drawImage(c.canvas,h,b)}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(const s of e){const{data:a,width:o,height:l,transform:c}=s,u=this.cachedCanvases.getCanvas("maskCanvas",o,l),f=u.context;f.save();const p=this.getObject(a,s);YR(f,p),f.globalCompositeOperation="source-in",f.fillStyle=i?r.getPattern(f,this,ic(t),ts.FILL):r,f.fillRect(0,0,o,l),f.restore(),t.save(),t.transform(...c),t.scale(1,-1),p2(t,u.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);if(!t){Gt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t)}paintImageXObjectRepeat(e,t,r,i){if(!this.contentVisible)return;const s=this.getObject(e);if(!s){Gt("Dependent image isn't ready yet");return}const a=s.width,o=s.height,l=[];for(let c=0,u=i.length;c<u;c+=2)l.push({transform:[t,0,0,r,i[c],i[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:t,width:r,height:i}=e,s=this.cachedCanvases.getCanvas("inlineImage",r,i),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",s.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,r=e.height,i=this.ctx;if(this.save(),!Hi){const{filter:o}=i;o!=="none"&&o!==""&&(i.filter="none")}i.scale(1/t,-1/r);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{const l=this.cachedCanvases.getCanvas("inlineImage",t,r).context;KR(l,e),s=this.applyTransferMapsToCanvas(l)}const a=this._scaleImage(s,ic(i));i.imageSmoothingEnabled=XR(er(i),e.interpolate),p2(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,t,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const r=this.ctx;let i;if(e.bitmap)i=e.bitmap;else{const s=e.width,a=e.height,l=this.cachedCanvases.getCanvas("inlineImage",s,a).context;KR(l,e),i=this.applyTransferMapsToCanvas(l)}for(const s of t)r.save(),r.transform(...s.transform),r.scale(1,-1),p2(r,i,s.x,s.y,s.w,s.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(t||(this.pendingClip===JR?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=er(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:t,b:r,c:i,d:s}=this.ctx.getTransform();let a,o;
451if(r===0&&i===0){const l=Math.abs(t),c=Math.abs(s);if(l===c)if(e===0)a=o=1/l;else{const u=l*e;a=o=u<1?1/u:1}else if(e===0)a=1/l,o=1/c;else{const u=l*e,f=c*e;a=u<1?1/u:1,o=f<1?1/f:1}}else{const l=Math.abs(t*s-r*i),c=Math.hypot(t,r),u=Math.hypot(i,s);if(e===0)a=u/l,o=c/l;else{const f=e*l;a=u>f?u/f:1,o=c>f?c/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:r}=this.current,[i,s]=this.getScaleForStroking();if(t.lineWidth=r||1,i===1&&s===1){t.stroke();return}const a=t.getLineDash();if(e&&t.save(),t.scale(i,s),a.length>0){const o=Math.max(i,s);t.setLineDash(a.map(l=>l/o)),t.lineDashOffset/=o}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};Kd=new WeakSet,$k=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Uk=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}};let Hm=CP;for(const n in oo)Hm.prototype[n]!==void 0&&(Hm.prototype[oo[n]]=Hm.prototype[n]);var Ry,Ly;class $c{static get workerPort(){return m(this,Ry)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");M(this,Ry,e)}static get workerSrc(){return m(this,Ly)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");M(this,Ly,e)}}Ry=new WeakMap,Ly=new WeakMap,q($c,Ry,null),q($c,Ly,"");const g2={UNKNOWN:0,DATA:1,ERROR:2},Cr={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Ds(n){switch(n instanceof Error||typeof n=="object"&&n!==null||Un('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Cp(n.message);case"MissingPDFException":return new kp(n.message);case"PasswordException":return new hk(n.message,n.code);case"UnexpectedResponseException":return new X5(n.message,n.status);case"UnknownErrorException":return new fk(n.message,n.details);default:return new fk(n.message,n.toString())}}var Ag,Ia,x7,_7,S7,lx;class Kv{constructor(e,t,r){q(this,Ia);q(this,Ag,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),r.addEventListener("message",U(this,Ia,x7).bind(this),{signal:m(this,Ag).signal})}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const i=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},r)}catch(a){s.reject(a)}return s.promise}sendWithStream(e,t,r,i){const s=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[s]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:s,data:t,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[s].pullCall=u,l.postMessage({sourceName:a,targetName:o,stream:Cr.PULL,streamId:s,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Wr(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[s].cancelCall=u,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:Cr.CANCEL,streamId:s,reason:Ds(c)}),u.promise}},r)}destroy(){var e;(e=m(this,Ag))==null||e.abort(),M(this,Ag,null)}}Ag=new WeakMap,Ia=new WeakSet,x7=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){U(this,Ia,S7).call(this,e);return}if(e.callback){const r=e.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===g2.DATA)i.resolve(e.data);else if(e.callback===g2.ERROR)i.reject(Ds(e.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,i=e.sourceName,s=this.comObj;new Promise(function(a){a(t(e.data))}).then(function(a){s.postMessage({sourceName:r,targetName:i,callback:g2.DATA,callbackId:e.callbackId,data:a})},function(a){s.postMessage({sourceName:r,targetName:i,callback:g2.ERROR,callbackId:e.callbackId,reason:Ds(a)})});return}if(e.streamId){U(this,Ia,_7).call(this,e);return}t(e.data)},_7=function(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(c,u=1,f){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=u,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:i,stream:Cr.ENQUEUE,streamId:t,chunk:c},f)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Cr.CLOSE,streamId:t}),delete a.streamSinks[t])},error(c){Wr(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:Cr.ERROR,streamId:t,reason:Ds(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,new Promise(function(c){c(o(e.data,l))}).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Cr.START_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:r,targetName:i,stream:Cr.START_COMPLETE,streamId:t,reason:Ds(c)})})},S7=function(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case Cr.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Ds(e.reason));break;case Cr.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Ds(e.reason));break;case Cr.PULL:if(!o){s.postMessage({sourceName:r,targetName:i,stream:Cr.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,new Promise(function(l){var c;l((c=o.onPull)==null?void 0:c.call(o))}).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Cr.PULL_COMPLETE,streamId:t,success:!0})},function(l){s.postMessage({sourceName:r,targetName:i,stream:Cr.PULL_COMPLETE,streamId:t,reason:Ds(l)})});break;case Cr.ENQUEUE:if(Wr(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case Cr.CLOSE:if(Wr(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),U(this,Ia,lx).call(this,a,t);break;case Cr.ERROR:Wr(a,"error should have stream controller"),a.controller.error(Ds(e.reason)),U(this,Ia,lx).call(this,a,t);break;case Cr.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Ds(e.reason)),U(this,Ia,lx).call(this,a,t);break;case Cr.CANCEL:if(!o)break;new Promise(function(l){var c;l((c=o.onCancel)==null?void 0:c.call(o,Ds(e.reason)))}).then(function(){s.postMessage({sourceName:r,targetName:i,stream:Cr.CANCEL_COMPLETE,streamId:t,success:!0})},function(l){s.postMessage({sourceName:r,targetName:i,stream:Cr.CANCEL_COMPLETE,streamId:t,reason:Ds(l)})}),o.sinkCapability.reject(Ds(e.reason)),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},lx=async function(e,t){var r,i,s;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(i=e.pullCall)==null?void 0:i.promise,(s=e.cancelCall)==null?void 0:s.promise]),delete this.streamControllers[t]};var _f,Iy;class Xre{constructor({parsedData:e,rawData:t}){q(this,_f);q(this,Iy);M(this,_f,e),M(this,Iy,t)}getRaw(){return m(this,Iy)}get(e){return m(this,_f).get(e)??null}
451getAll(){return OT(m(this,_f))}has(e){return m(this,_f).has(e)}}_f=new WeakMap,Iy=new WeakMap;const fm=Symbol("INTERNAL");var Oy,My,Dy,Eg;class Jre{constructor(e,{name:t,intent:r,usage:i,rbGroups:s}){q(this,Oy,!1);q(this,My,!1);q(this,Dy,!1);q(this,Eg,!0);M(this,Oy,!!(e&Ks.DISPLAY)),M(this,My,!!(e&Ks.PRINT)),this.name=t,this.intent=r,this.usage=i,this.rbGroups=s}get visible(){if(m(this,Dy))return m(this,Eg);if(!m(this,Eg))return!1;const{print:e,view:t}=this.usage;return m(this,Oy)?(t==null?void 0:t.viewState)!=="OFF":m(this,My)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,t,r=!1){e!==fm&&Un("Internal method `_setVisible` called."),M(this,Dy,r),M(this,Eg,t)}}Oy=new WeakMap,My=new WeakMap,Dy=new WeakMap,Eg=new WeakMap;var id,vn,Ng,kg,Fy,zk;class Qre{constructor(e,t=Ks.DISPLAY){q(this,Fy);q(this,id,null);q(this,vn,new Map);q(this,Ng,null);q(this,kg,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,M(this,kg,e.order);for(const r of e.groups)m(this,vn).set(r.id,new Jre(t,r));if(e.baseState==="OFF")for(const r of m(this,vn).values())r._setVisible(fm,!1);for(const r of e.on)m(this,vn).get(r)._setVisible(fm,!0);for(const r of e.off)m(this,vn).get(r)._setVisible(fm,!1);M(this,Ng,this.getHash())}}isVisible(e){if(m(this,vn).size===0)return!0;if(!e)return Y5("Optional content group not defined."),!0;if(e.type==="OCG")return m(this,vn).has(e.id)?m(this,vn).get(e.id).visible:(Gt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return U(this,Fy,zk).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!m(this,vn).has(t))return Gt(`Optional content group not found: ${t}`),!0;if(m(this,vn).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!m(this,vn).has(t))return Gt(`Optional content group not found: ${t}`),!0;if(!m(this,vn).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!m(this,vn).has(t))return Gt(`Optional content group not found: ${t}`),!0;if(!m(this,vn).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!m(this,vn).has(t))return Gt(`Optional content group not found: ${t}`),!0;if(m(this,vn).get(t).visible)return!1}return!0}return Gt(`Unknown optional content policy ${e.policy}.`),!0}return Gt(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,r=!0){var s;const i=m(this,vn).get(e);if(!i){Gt(`Optional content group not found: ${e}`);return}if(r&&t&&i.rbGroups.length)for(const a of i.rbGroups)for(const o of a)o!==e&&((s=m(this,vn).get(o))==null||s._setVisible(fm,!1,!0));i._setVisible(fm,!!t,!0),M(this,id,null)}setOCGState({state:e,preserveRB:t}){let r;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}const s=m(this,vn).get(i);if(s)switch(r){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!s.visible,t);break}}M(this,id,null)}get hasInitialVisibility(){return m(this,Ng)===null||this.getHash()===m(this,Ng)}getOrder(){return m(this,vn).size?m(this,kg)?m(this,kg).slice():[...m(this,vn).keys()]:null}getGroups(){return m(this,vn).size>0?OT(m(this,vn)):null}getGroup(e){return m(this,vn).get(e)||null}getHash(){if(m(this,id)!==null)return m(this,id);const e=new u7;for(const[t,r]of m(this,vn))e.update(`${t}:${r.visible}`);return M(this,id,e.hexdigest())}}id=new WeakMap,vn=new WeakMap,Ng=new WeakMap,kg=new WeakMap,Fy=new WeakSet,zk=function(e){const t=e.length;if(t<2)return!0;const r=e[0];for(let i=1;i<t;i++){const s=e[i];let a;if(Array.isArray(s))a=U(this,Fy,zk).call(this,s);else if(m(this,vn).has(s))a=m(this,vn).get(s).visible;else return Gt(`Optional content group not found: ${s}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};class Zre{constructor(e,{disableRange:t=!1,disableStream:r=!1}){Wr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:s,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(s==null?void 0:s.length)>0){const l=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!t,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const r=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const i=this._rangeReaders.some(function(s){return s._begin!==e?!1:(s._enqueue(r),!0)});Wr(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var t,r,i,s;e.total===void 0?(r=(t=this._rangeReaders[0])==null?void 0:t.onProgress)==null||r.call(t,{loaded:e.loaded}):(s=(i=this._fullRequestReader)==null?void 0:i.onProgress)==null||s.call(i,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Wr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new eie(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new tie(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class eie{constructor(e,t,r=!1,i=null){this._stream=e,this._done=r||!1,this._filename=FT(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;
451this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class tie{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function nie(n){let e=!0,t=r("filename\\*","i").exec(n);if(t){t=t[1];let u=o(t);return u=unescape(u),u=l(u),u=c(u),s(u)}if(t=a(n),t){const u=c(t);return s(u)}if(t=r("filename","i").exec(n),t){t=t[1];let u=o(t);return u=c(u),s(u)}function r(u,f){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function i(u,f){if(u){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const p=new TextDecoder(u,{fatal:!0}),h=J5(f);f=p.decode(h),e=!1}catch{}}return f}function s(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function a(u){const f=[];let p;const h=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=h.exec(u))!==null;){let[,g,w,y]=p;if(g=parseInt(g,10),g in f){if(g===0)break;continue}f[g]=[w,y]}const b=[];for(let g=0;g<f.length&&g in f;++g){let[w,y]=f[g];y=o(y),w&&(y=unescape(y),g===0&&(y=l(y))),b.push(y)}return b.join("")}function o(u){if(u.startsWith('"')){const f=u.slice(1).split('\\"');for(let p=0;p<f.length;++p){const h=f[p].indexOf('"');h!==-1&&(f[p]=f[p].slice(0,h),f.length=p+1),f[p]=f[p].replaceAll(/\\(.)/g,"$1")}u=f.join('"')}return u}function l(u){const f=u.indexOf("'");if(f===-1)return u;const p=u.slice(0,f),b=u.slice(f+1).replace(/^[^']*'/,"");return i(p,b)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,p,h,b){if(h==="q"||h==="Q")return b=b.replaceAll("_"," "),b=b.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,w){return String.fromCharCode(parseInt(w,16))}),i(p,b);try{b=atob(b)}catch{}return i(p,b)})}return""}function qT(n,e){const t=new Headers;if(!n||!e||typeof e!="object")return t;for(const r in e){const i=e[r];i!==void 0&&t.append(r,i)}return t}function HT({responseHeaders:n,isHttp:e,rangeChunkSize:t,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(n.get("Content-Length"),10);return!Number.isInteger(s)||(i.suggestedLength=s,s<=2*t)||r||!e||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function WT(n){const e=n.get("Content-Disposition");if(e){let t=nie(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(FT(t))return t}return null}function eS(n,e){return n===404||n===0&&e.startsWith("file:")?new kp('Missing PDF "'+e+'".'):new X5(`Unexpected server response (${n}) while retrieving PDF "${e}".`,n)}function A7(n){return n===200||n===206}function E7(n,e,t){return{method:"GET",headers:n,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function N7(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(Gt(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}class QR{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=qT(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Wr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new rie(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new iie(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}
451class rie{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const r=new Headers(e.headers),i=t.url;fetch(i,E7(r,this._withCredentials,this._abortController)).then(s=>{if(!A7(s.status))throw eS(s.status,i);this._reader=s.body.getReader(),this._headersCapability.resolve();const a=s.headers,{allowRangeRequests:o,suggestedLength:l}=HT({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=WT(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Cp("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:N7(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}class iie{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const s=new Headers(e.headers);s.append("Range",`bytes=${t}-${r-1}`);const a=i.url;fetch(a,E7(s,this._withCredentials,this._abortController)).then(o=>{if(!A7(o.status))throw eS(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:N7(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}const GA=200,KA=206;function sie(n){const e=n.response;return typeof e!="string"?e:J5(e).buffer}class aie{constructor({url:e,httpHeaders:t,withCredentials:r}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=qT(this.isHttp,t),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,r){const i={begin:e,end:t};for(const s in r)i[s]=r[s];return this.request(i)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[s,a]of this.headers)t.setRequestHeader(s,a);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=KA):i.expectedStatus=GA,t.responseType="arraybuffer",e.onError&&(t.onerror=function(s){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,r),t.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,t.send(null),r}onProgress(e,t){var i;const r=this.pendingRequests[e];r&&((i=r.onProgress)==null||i.call(r,t))}onStateChange(e,t){var l,c,u;const r=this.pendingRequests[e];if(!r)return;const i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){(l=r.onError)==null||l.call(r,i.status);return}const s=i.status||GA;if(!(s===GA&&r.expectedStatus===KA)&&s!==r.expectedStatus){(c=r.onError)==null||c.call(r,i.status);return}const o=sie(i);if(s===KA){const f=i.getResponseHeader("Content-Range"),p=/bytes (\d+)-(\d+)\/(\d+)/.exec(f);r.onDone({begin:parseInt(p[1],10),chunk:o})}else o?r.onDone({begin:0,chunk:o}):(u=r.onError)==null||u.call(r,i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}
451abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class oie{constructor(e){this._source=e,this._manager=new aie(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Wr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new lie(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new cie(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class lie{constructor(e,t){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(r),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=new Headers(t.getAllResponseHeaders().trim().split(/[\r\n]+/).map(a=>{const[o,...l]=a.split(": ");return[o,l.join(": ")]})),{allowRangeRequests:i,suggestedLength:s}=HT({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=WT(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=eS(e,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;(t=this.onProgress)==null||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class cie{constructor(e,t,r){this._manager=e;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=eS(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||(t=this.onProgress)==null||t.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
451(this._requestId),this._close()}}const uie=/^[a-z][a-z0-9\-+.]+:/i;function die(n){if(uie.test(n))return new URL(n);const e=Hd.get("url");return new URL(e.pathToFileURL(n))}function k7(n,e,t){return n.protocol==="http:"?Hd.get("http").request(n,{headers:e},t):Hd.get("https").request(n,{headers:e},t)}class hie{constructor(e){this.source=e,this.url=die(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.headers=qT(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Wr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new mie(this):new fie(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=this.isFsUrl?new gie(this,e,t):new pie(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class C7{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Cp("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class T7{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class fie extends C7{constructor(e){super(e);const t=Object.fromEntries(e.headers),r=i=>{if(i.statusCode===404){const l=new kp(`Missing PDF "${this._url}".`);this._storedError=l,this._headersCapability.reject(l);return}this._headersCapability.resolve(),this._setReadableStream(i);const s=new Headers(this._readableStream.headers),{allowRangeRequests:a,suggestedLength:o}=HT({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=WT(s)};this._request=k7(this._url,t,r),this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class pie extends T7{constructor(e,t,r){super(e);const i=Object.fromEntries(e.headers);i.Range=`bytes=${t}-${r-1}`;const s=a=>
451{if(a.statusCode===404){const o=new kp(`Missing PDF "${this._url}".`);this._storedError=o;return}this._setReadableStream(a)};this._request=k7(this._url,i,s),this._request.on("error",a=>{this._storedError=a}),this._request.end()}}class mie extends C7{constructor(e){super(e);const t=Hd.get("fs");t.promises.lstat(this._url).then(r=>{this._contentLength=r.size,this._setReadableStream(t.createReadStream(this._url)),this._headersCapability.resolve()},r=>{r.code==="ENOENT"&&(r=new kp(`Missing PDF "${this._url}".`)),this._storedError=r,this._headersCapability.reject(r)})}}class gie extends T7{constructor(e,t,r){super(e);const i=Hd.get("fs");this._setReadableStream(i.createReadStream(this._url,{start:t,end:r-1}))}}const vie=1e5,hs=30,yie=.8;var s6,sd,gs,By,$y,Sf,_c,Uy,zy,Af,Cg,Tg,ad,Pg,qy,jg,Ef,Hy,Wy,hr,Nf,kf,Vy,od,Rg,eu,P7,j7,Hk,ia,cx,Wk,R7,L7;let qk=(hr=class{constructor({textContentSource:e,container:t,viewport:r}){q(this,eu);q(this,sd,Promise.withResolvers());q(this,gs,null);q(this,By,!1);q(this,$y,!!((s6=globalThis.FontInspector)!=null&&s6.enabled));q(this,Sf,null);q(this,_c,null);q(this,Uy,0);q(this,zy,0);q(this,Af,null);q(this,Cg,null);q(this,Tg,0);q(this,ad,0);q(this,Pg,Object.create(null));q(this,qy,[]);q(this,jg,null);q(this,Ef,[]);q(this,Hy,new WeakMap);q(this,Wy,null);var l;if(e instanceof ReadableStream)M(this,jg,e);else if(typeof e=="object")M(this,jg,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');M(this,gs,M(this,Cg,t)),M(this,ad,r.scale*(globalThis.devicePixelRatio||1)),M(this,Tg,r.rotation),M(this,_c,{div:null,properties:null,ctx:null});const{pageWidth:i,pageHeight:s,pageX:a,pageY:o}=r.rawDims;M(this,Wy,[1,0,0,-1,-a,o+s]),M(this,zy,i),M(this,Uy,s),U(l=hr,ia,R7).call(l),up(t,r),m(this,sd).promise.finally(()=>{m(hr,Rg).delete(this),M(this,_c,null),M(this,Pg,null)}
vendor: 5,844 bytes, line 451
451).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=is.platform;return tn(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{m(this,Af).read().then(({value:t,done:r})=>{if(r){m(this,sd).resolve();return}m(this,Sf)??M(this,Sf,t.lang),Object.assign(m(this,Pg),t.styles),U(this,eu,P7).call(this,t.items),e()},m(this,sd).reject)};return M(this,Af,m(this,jg).getReader()),m(hr,Rg).add(this),e(),m(this,sd).promise}update({viewport:e,onBefore:t=null}){var s;const r=e.scale*(globalThis.devicePixelRatio||1),i=e.rotation;if(i!==m(this,Tg)&&(t==null||t(),M(this,Tg,i),up(m(this,Cg),{rotation:i})),r!==m(this,ad)){t==null||t(),M(this,ad,r);const a={div:null,properties:null,ctx:U(s=hr,ia,cx).call(s,m(this,Sf))};for(const o of m(this,Ef))a.properties=m(this,Hy).get(o),a.div=o,U(this,eu,Hk).call(this,a)}}cancel(){var t;const e=new Cp("TextLayer task cancelled.");(t=m(this,Af))==null||t.cancel(e).catch(()=>{}),M(this,Af,null),m(this,sd).reject(e)}get textDivs(){return m(this,Ef)}get textContentItemsStr(){return m(this,qy)}static cleanup(){if(!(m(this,Rg).size>0)){m(this,Nf).clear();for(const{canvas:e}of m(this,kf).values())e.remove();m(this,kf).clear()}}},sd=new WeakMap,gs=new WeakMap,By=new WeakMap,$y=new WeakMap,Sf=new WeakMap,_c=new WeakMap,Uy=new WeakMap,zy=new WeakMap,Af=new WeakMap,Cg=new WeakMap,Tg=new WeakMap,ad=new WeakMap,Pg=new WeakMap,qy=new WeakMap,jg=new WeakMap,Ef=new WeakMap,Hy=new WeakMap,Wy=new WeakMap,Nf=new WeakMap,kf=new WeakMap,Vy=new WeakMap,od=new WeakMap,Rg=new WeakMap,eu=new WeakSet,P7=function(e){var i,s;if(m(this,By))return;(s=m(this,_c)).ctx??(s.ctx=U(i=hr,ia,cx).call(i,m(this,Sf)));const t=m(this,Ef),r=m(this,qy);for(const a of e){if(t.length>vie){Gt("Ignoring additional textDivs for performance reasons."),M(this,By,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=m(this,gs);M(this,gs,document.createElement("span")),m(this,gs).classList.add("markedContent"),a.id!==null&&m(this,gs).setAttribute("id",`${a.id}`),o.append(m(this,gs))}else a.type==="endMarkedContent"&&M(this,gs,m(this,gs).parentNode);continue}r.push(a.str),U(this,eu,j7).call(this,a)}},j7=function(e){var g;const t=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};m(this,Ef).push(t);const i=ft.transform(m(this,Wy),e.transform);let s=Math.atan2(i[1],i[0]);const a=m(this,Pg)[e.fontName];a.vertical&&(s+=Math.PI/2);let o=m(this,$y)&&a.fontSubstitution||a.fontFamily;o=hr.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),c=l*U(g=hr,ia,L7).call(g,o,m(this,Sf));let u,f;s===0?(u=i[4],f=i[5]-c):(u=i[4]+c*Math.sin(s),f=i[5]-c*Math.cos(s));const p="calc(var(--scale-factor)*",h=t.style;m(this,gs)===m(this,Cg)?(h.left=`${(100*u/m(this,zy)).toFixed(2)}%`,h.top=`${(100*f/m(this,Uy)).toFixed(2)}%`):(h.left=`${p}${u.toFixed(2)}px)`,h.top=`${p}${f.toFixed(2)}px)`),h.fontSize=`${p}${(m(hr,od)*l).toFixed(2)}px)`,h.fontFamily=o,r.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,m(this,$y)&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),s!==0&&(r.angle=s*(180/Math.PI));let b=!1;if(e.str.length>1)b=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const w=Math.abs(e.transform[0]),y=Math.abs(e.transform[3]);w!==y&&Math.max(w,y)/Math.min(w,y)>1.5&&(b=!0)}if(b&&(r.canvasWidth=a.vertical?e.height:e.width),m(this,Hy).set(t,r),m(this,_c).div=t,m(this,_c).properties=r,U(this,eu,Hk).call(this,m(this,_c)),r.hasText&&m(this,gs).append(t),r.hasEOL){const w=document.createElement("br");w.setAttribute("role","presentation"),m(this,gs).append(w)}},Hk=function(e){var o;const{div:t,properties:r,ctx:i}=e,{style:s}=t;let a="";if(m(hr,od)>1&&(a=`scale(${1/m(hr,od)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:l}=s,{canvasWidth:c,fontSize:u}=r;U(o=hr,ia,Wk).call(o,i,u*m(this,ad),l);const{width:f}=i.measureText(t.textContent);f>0&&(a=`scaleX(${c*m(this,ad)/f}) ${a}`)}r.angle!==0&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(s.transform=a)},ia=new WeakSet,cx=function(e=null){let t=m(this,kf).get(e||(e=""));if(!t){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),t=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),m(this,kf).set(e,t),m(this,Vy).set(t,{size:0,family:""})}return t},Wk=function(e,t,r){const i=m(this,Vy).get(e);t===i.size&&r===i.family||(e.font=`${t}px ${r}`,i.size=t,i.family=r)},R7=function(){if(m(this,od)!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),M(this,od,e.getBoundingClientRect().height),e.remove()},L7=function(e,t){const r=m(this,Nf).get(e);if(r)return r;const i=U(this,ia,cx).call(this,t);i.canvas.width=i.canvas.height=hs,U(this,ia,Wk).call(this,i,hs,e);const s=i.measureText("");let a=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);if(a){const u=a/(a+o);return m(this,Nf).set(e,u),i.canvas.width=i.canvas.height=0,u}i.strokeStyle="red",i.clearRect(0,0,hs,hs),i.strokeText("g",0,0);let l=i.getImageData(0,0,hs,hs).data;o=0;for(let u=l.length-1-3;u>=0;u-=4)if(l[u]>0){o=Math.ceil(u/4/hs);break}i.clearRect(0,0,hs,hs),i.strokeText("A",0,hs),l=i.getImageData(0,0,hs,hs).data,a=0;for(let u=0,f=l.length;u<f;u+=4)if(l[u]>0){a=hs-Math.floor(u/4/hs);break}i.canvas.width=i.canvas.height=0;const c=a?a/(a+o):yie;return m(this,Nf).set(e,c),c},q(hr,ia),q(hr,Nf,new Map),q(hr,kf,new Map),q(hr,Vy,new WeakMap),q(hr,od,null),q(hr,Rg,new Set),hr);class J1{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};function i(s){var l;if(!s)return;let a=null;const o=s.name;if(o==="#text")a=s.value;
451else if(J1.shouldBuildText(o))(l=s==null?void 0:s.attributes)!=null&&l.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&t.push({str:a}),!!s.children)for(const c of s.children)i(c)}return i(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const bie=65536,wie=100,xie=5e3,_ie=Hi?Ire:jre,Sie=Hi?Ore:m7,Aie=Hi?Lre:Rre,Eie=Hi?Mre:b7;function Nie(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const e=new Vk,{docId:t}=e,r=n.url?kie(n.url):null,i=n.data?Cie(n.data):null,s=n.httpHeaders||null,a=n.withCredentials===!0,o=n.password??null,l=n.range instanceof I7?n.range:null,c=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:bie;let u=n.worker instanceof Wm?n.worker:null;const f=n.verbosity,p=typeof n.docBaseUrl=="string"&&!Z5(n.docBaseUrl)?n.docBaseUrl:null,h=typeof n.cMapUrl=="string"?n.cMapUrl:null,b=n.cMapPacked!==!1,g=n.CMapReaderFactory||Sie,w=typeof n.standardFontDataUrl=="string"?n.standardFontDataUrl:null,y=n.StandardFontDataFactory||Eie,x=n.stopAtErrors!==!0,S=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,A=n.isEvalSupported!==!1,C=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!Hi,T=typeof n.isChrome=="boolean"?n.isChrome:!is.platform.isFirefox&&typeof window<"u"&&!!(window!=null&&window.chrome),R=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,I=typeof n.disableFontFace=="boolean"?n.disableFontFace:Hi,L=n.fontExtraProperties===!0,V=n.enableXfa===!0,j=n.ownerDocument||globalThis.document,$=n.disableRange===!0,J=n.disableStream===!0,H=n.disableAutoFetch===!0,le=n.pdfBug===!0,oe=n.CanvasFactory||_ie,se=n.FilterFactory||Aie,O=n.enableHWA===!0,te=l?l.length:n.length??NaN,he=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!Hi&&!I,ge=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:g===m7&&y===b7&&h&&w&&Uv(h,document.baseURI)&&Uv(w,document.baseURI);n.canvasFactory&&$R("`canvasFactory`-instance option, please use `CanvasFactory` instead."),n.filterFactory&&$R("`filterFactory`-instance option, please use `FilterFactory` instead.");const D=null;lre(f);const G={canvasFactory:new oe({ownerDocument:j,enableHWA:O}),filterFactory:new se({docId:t,ownerDocument:j}),cMapReaderFactory:ge?null:new g({baseUrl:h,isCompressed:b}),standardFontDataFactory:ge?null:new y({baseUrl:w})};if(!u){const X={verbosity:f,port:$c.workerPort};u=X.port?Wm.fromPort(X):new Wm(X),e._worker=u}const ee={docId:t,apiVersion:"4.8.69",data:i,password:o,disableAutoFetch:H,rangeChunkSize:c,length:te,docBaseUrl:p,enableXfa:V,evaluatorOptions:{maxImageSize:S,disableFontFace:I,ignoreErrors:x,isEvalSupported:A,isOffscreenCanvasSupported:C,isChrome:T,canvasMaxAreaInBytes:R,fontExtraProperties:L,useSystemFonts:he,cMapUrl:ge?h:null,standardFontDataUrl:ge?w:null}},ae={disableFontFace:I,fontExtraProperties:L,ownerDocument:j,pdfBug:le,styleElement:D,loadingParams:{disableAutoFetch:H,enableXfa:V}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const X=u.messageHandler.sendWithPromise("GetDocRequest",ee,i?[i.buffer]:null);let Q;if(l)Q=new Zre(l,{disableRange:$,disableStream:J});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");let ue;Hi?ue=typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&Uv(r)?QR:hie:ue=Uv(r)?QR:oie,Q=new ue({url:r,length:te,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:$,disableStream:J})}return X.then(ue=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const pe=new Kv(t,ue,u.port),me=new Rie(pe,e,Q,ae,G);e._transport=me,pe.send("Ready",null)})}).catch(e._capability.reject),e}function kie(n){if(n instanceof URL)return n.href;try{return new URL(n,window.location).href}catch{if(Hi&&typeof n=="string")return n}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Cie(n){if(Hi&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return J5(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function ZR(n){return typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0}var Q_;const Z_=class Z_{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Xr(Z_,Q_)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e,t,r;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((t=this._transport)==null?void 0:t.destroy())}catch(i){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,i}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};Q_=new WeakMap,q(Z_,Q_,0);let Vk=Z_,I7=class{constructor(e,t,r=!1,i=null){this.length=e,this.initialData=t,this.progressiveDone=r,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const r of this._rangeListeners)r(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){Un("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Tie{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return tn(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
451getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var ld,Sc,Ca,pm,ux;class Pie{constructor(e,t,r,i=!1){q(this,Ca);q(this,ld,null);q(this,Sc,!1);this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=i?new BR:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new O7,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}={}){return new $b({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return tn(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:t,intent:r="display",annotationMode:i=$u.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:f=!1}){var A,C;(A=this._stats)==null||A.time("Overall");const p=this._transport.getRenderingIntent(r,i,u,f),{renderingIntent:h,cacheKey:b}=p;M(this,Sc,!1),U(this,Ca,ux).call(this),o||(o=this._transport.getOptionalContentConfig(h));let g=this._intentStates.get(b);g||(g=Object.create(null),this._intentStates.set(b,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const w=!!(h&Ks.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(C=this._stats)==null||C.time("Page Request"),this._pumpOperatorList(p));const y=T=>{var R;g.renderTasks.delete(x),(this._maybeCleanupAfterRender||w)&&M(this,Sc,!0),U(this,Ca,pm).call(this,!w),T?(x.capability.reject(T),this._abortOperatorList({intentState:g,reason:T instanceof Error?T:new Error(T)})):x.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(R=globalThis.Stats)!=null&&R.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},x=new Kk({callback:y,params:{canvasContext:e,viewport:t,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,page
451Colors:c});(g.renderTasks||(g.renderTasks=new Set)).add(x);const S=x.task;return Promise.all([g.displayReadyCapability.promise,o]).then(([T,R])=>{var I;if(this.destroyed){y();return}if((I=this._stats)==null||I.time("Rendering"),!(R.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");x.initializeGraphics({transparency:T,optionalContentConfig:R}),x.operatorListChanged()}).catch(y),S}getOperatorList({intent:e="display",annotationMode:t=$u.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){var c;function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,t,r,i,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>J1.textContent(r));const t=this.streamTextContent(e);return new Promise(function(r,i){function s(){a.read().then(function({value:l,done:c}){if(c){r(o);return}o.lang??(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),s()},i)}const a=t.getReader(),o={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),M(this,Sc,!1),U(this,Ca,ux).call(this),Promise.all(e)}cleanup(e=!1){M(this,Sc,!0);const t=U(this,Ca,pm).call(this,!1);return e&&t&&this._stats&&(this._stats=new BR),t}_startRenderPage(e,t){var i,s;const r=this._intentStates.get(t);r&&((i=this._stats)==null||i.timeEnd("Page Request"),(s=r.displayReadyCapability)==null||s.resolve(e))}_renderPageChunk(e,t){for(let r=0,i=e.length;r<i;r++)t.operatorList.fnArray.push(e.fnArray[r]),t.operatorList.argsArray.push(e.argsArray[r]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const r of t.renderTasks)r.operatorListChanged();e.lastChunk&&U(this,Ca,pm).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:r,modifiedIds:i}){const{map:s,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:s,modifiedIds:i},a).getReader(),c=this._intentStates.get(t);c.streamReader=l;const u=()=>{l.read().then(({value:f,done:p})=>{if(p){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,c),u())},f=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const p of c.renderTasks)p.operatorListChanged();U(this,Ca,pm).call(this,!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(f);else if(c.opListReadCapability)c.opListReadCapability.reject(f);else throw f}})};u()}_abortOperatorList({intentState:e,reason:t,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(t instanceof DT){let i=wie;t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i);return}}if(e.streamReader.cancel(new Cp(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,s]of this._intentStates)if(s===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}ld=new WeakMap,Sc=new WeakMap,Ca=new WeakSet,pm=function(e=!1){if(U(this,Ca,ux).call(this),!m(this,Sc)||this.destroyed)return!1;if(e)return M(this,ld,setTimeout(()=>{M(this,ld,null),U(this,Ca,pm).call(this,!1)},xie)),!1;for(const{renderTasks:t,operatorList:r}of this._intentStates.values())if(t.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),M(this,Sc,!1),!0},ux=function(){m(this,ld)&&(clearTimeout(m(this,ld)),M(this,ld,null))};var Ac,e5;class jie{constructor(){q(this,Ac,new Map);q(this,e5,Promise.resolve())}postMessage(e,t){const r={data:structuredClone(e,t?{transfer:t}:null)};m(this,e5).then(()=>{for(const[i]of m(this,Ac))i.call(this,r)})}addEventListener(e,t,r=null){let i=null;if((r==null?void 0:r.signal)instanceof AbortSignal){const{signal:s}=r;if(s.aborted){Gt("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,t);i=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}m(this,Ac).set(t,i)}removeEventListener(e,t){const r=m(this,Ac).get(t);r==null||r(),m(this,Ac).delete(t)}terminate(){for(const[,e]of m(this,Ac))e==null||e();m(this,Ac).clear()}}Ac=new WeakMap,e5=new WeakMap;var t5,Cf,Tf,Lg,dx,Ig,hx;const Gn=class Gn{constructor({name:e=null,port:t=null,verbosity:r=cre()}={}){q(this,Lg);var i;if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if((i=m(Gn,Tf))!=null&&i.has(t))throw new Error("Cannot use more than one PDFWorker per port.");(m(Gn,Tf)||M(Gn,Tf,new WeakMap)).set(t,this),this._initializeFromPort(t);return}this._initialize()}get promise(){return Hi?Promise.all([Hd.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Kv("main","worker",e),this._messageHandler.on("ready",function(){}),U(this,Lg,dx).call(this)}_initialize(){if(m(Gn,Cf)||m(Gn,Ig,hx)){this._setupFakeWorker();return}let{workerSrc:e}=Gn;try{Gn._isSameOrigin(window.location.href,e)||(e=Gn._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),r=new Kv("main","worker",t),i=()=>{s.abort(),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;t.addEventListener("error",()=>{this._webWorker||i()},{signal:s.signal}),r.on("test",o=>{if(s.abort(),this.destroyed||!o){i();return}this._messageHandler=r,this._port=t,this._webWorker=t,U(this,Lg,dx).call(this)}),r.on("ready",o=>
451{if(s.abort(),this.destroyed){i();return}try{a()}catch{this._setupFakeWorker()}});const a=()=>{const o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{Y5("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){m(Gn,Cf)||(Gt("Setting up fake worker."),M(Gn,Cf,!0)),Gn._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const t=new jie;this._port=t;const r=`fake${Xr(Gn,t5)._++}`,i=new Kv(r+"_worker",r,t);e.setup(i,t),this._messageHandler=new Kv(r,r+"_worker",t),U(this,Lg,dx).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(e=m(Gn,Tf))==null||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var r;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const t=(r=m(this,Tf))==null?void 0:r.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new Gn(e)}static get workerSrc(){if($c.workerSrc)return $c.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return tn(this,"_setupFakeWorkerGlobal",(async()=>m(this,Ig,hx)?m(this,Ig,hx):(await import(this.workerSrc)).WorkerMessageHandler)())}};t5=new WeakMap,Cf=new WeakMap,Tf=new WeakMap,Lg=new WeakSet,dx=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},Ig=new WeakSet,hx=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},q(Gn,Ig),q(Gn,t5,0),q(Gn,Cf,!1),q(Gn,Tf),Hi&&(M(Gn,Cf,!0),$c.workerSrc||($c.workerSrc="./pdf.worker.mjs")),Gn._isSameOrigin=(e,t)=>{let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const i=new URL(t,r);return r.origin===i.origin},Gn._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};let Wm=Gn;var Ec,ml,Og,Mg,gl,Pf,Yv;class Rie{constructor(e,t,r,i,s){q(this,Pf);q(this,Ec,new Map);q(this,ml,new Map);q(this,Og,new Map);q(this,Mg,new Map);q(this,gl,null);this.messageHandler=e,this.loadingTask=t,this.commonObjs=new O7,this.fontLoader=new Tre({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return tn(this,"annotationStorage",new UT)}getRenderingIntent(e,t=$u.ENABLE,r=null,i=!1,s=!1){let a=Ks.DISPLAY,o=Ik;switch(e){case"any":a=Ks.ANY;break;case"display":break;case"print":a=Ks.PRINT;break;default:Gt(`getRenderingIntent - invalid intent: ${e}`)}const l=a&Ks.PRINT&&r instanceof h7?r:this.annotationStorage;switch(t){case $u.DISABLE:a+=Ks.ANNOTATIONS_DISABLE;break;case $u.ENABLE:break;case $u.ENABLE_FORMS:a+=Ks.ANNOTATIONS_FORMS;break;case $u.ENABLE_STORAGE:a+=Ks.ANNOTATIONS_STORAGE,o=l.serializable;break;default:Gt(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(a+=Ks.IS_EDITING),s&&(a+=Ks.OPLIST);const{ids:c,hash:u}=l.modifiedIds,f=[a,o.hash,u];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=m(this,gl))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const i of m(this,ml).values())e.push(i._destroy());m(this,ml).clear(),m(this,Og).clear(),m(this,Mg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();
451const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{var i;this.commonObjs.clear(),this.fontLoader.clear(),m(this,Ec).clear(),this.filterFactory.destroy(),qk.cleanup(),(i=this._networkStream)==null||i.cancelAllRequests(new Cp("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(r,i)=>{Wr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},i.onPull=()=>{this._fullReader.read().then(function({value:s,done:a}){if(a){i.close();return}Wr(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{this._fullReader.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:s,contentLength:a}=this._fullReader;return(!i||!s)&&(this._lastProgress&&((o=t.onProgress)==null||o.call(t,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=t.onProgress)==null||c.call(t,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:i,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,i)=>{Wr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(r.begin,r.end);if(!s){i.close();return}i.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){i.close();return}Wr(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{s.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,t._capability.resolve(new Tie(r,this))}),e.on("DocException",function(r){let i;switch(r.name){case"PasswordException":i=new hk(r.message,r.code);break;case"InvalidPDFException":i=new FF(r.message);break;case"MissingPDFException":i=new kp(r.message);break;case"UnexpectedResponseException":i=new X5(r.message,r.status);break;case"UnknownErrorException":i=new fk(r.message,r.details);break;default:Un("DocException - expected a valid Error.")}t._capability.reject(i)}),e.on("PasswordRequest",r=>{if(M(this,gl,Promise.withResolvers()),t.onPassword){const i=s=>{s instanceof Error?m(this,gl).reject(s):m(this,gl).resolve({password:s})};try{t.onPassword(i,r.code)}catch(s){m(this,gl).reject(s)}}else m(this,gl).reject(new hk(r.message,r.code));return m(this,gl).promise}),e.on("DataLoaded",r=>{var i;(i=t.onProgress)==null||i.call(t,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;m(this,ml).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,i,s])=>{var a;if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":const{disableFontFace:o,fontExtraProperties:l,pdfBug:c}=this._params;if("error"in s){const h=s.error;Gt(`Error during font loading: ${h}`),this.commonObjs.resolve(r,h);break}const u=c&&((a=globalThis.FontInspector)!=null&&a.enabled)?(h,b)=>globalThis.FontInspector.fontAdded(h,b):null,f=new Pre(s,{disableFontFace:o,inspectFont:u});this.fontLoader.bind(f).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l&&f.data&&(f.data=null),this.commonObjs.resolve(r,f)});break;case"CopyLocalImage":const{imageRef:p}=s;Wr(p,"The imageRef must be defined.");for(const h of m(this,ml).values())for(const[,b]of h.objs)if((b==null?void 0:b.ref)===p)return b.dataLen?(this.commonObjs.resolve(r,structuredClone(b)),b.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,s);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([r,i,s,a])=>{var l;if(this.destroyed)return;const o=m(this,ml).get(i);if(!o.objs.has(r)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(s){case"Image":o.objs.resolve(r,a),(a==null?void 0:a.dataLen)>ire&&(o._maybeCleanupAfterRender=!0);break;case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",r=>{var i;this.destroyed||(i=t.onProgress)==null||i.call(t,{loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");
451if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(r)}),e.on("FetchStandardFontData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&Gt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((r=this._fullReader)==null?void 0:r.filename)??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,r=m(this,Og).get(t);if(r)return r;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&m(this,Mg).set(s.refStr,e);const a=new Pie(t,s,this,this._params.pdfBug);return m(this,ml).set(t,a),a});return m(this,Og).set(t,i),i}getPageIndex(e){return ZR(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return U(this,Pf,Yv).call(this,"GetFieldObjects")}hasJSActions(){return U(this,Pf,Yv).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return U(this,Pf,Yv).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return U(this,Pf,Yv).call(this,"GetOptionalContentConfig").then(t=>new Qre(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=m(this,Ec).get(e);if(t)return t;const r=this.messageHandler.sendWithPromise(e,null).then(i=>{var s,a;return{info:i[0],metadata:i[1]?new Xre(i[1]):null,contentDispositionFilename:((s=this._fullReader)==null?void 0:s.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return m(this,Ec).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of m(this,ml).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),m(this,Ec).clear(),this.filterFactory.destroy(!0),qk.cleanup()}}cachedPageNumber(e){if(!ZR(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return m(this,Mg).get(t)??null}}Ec=new WeakMap,ml=new WeakMap,Og=new WeakMap,Mg=new WeakMap,gl=new WeakMap,Pf=new WeakSet,Yv=function(e,t=null){const r=m(this,Ec).get(e);if(r)return r;
451const i=this.messageHandler.sendWithPromise(e,t);return m(this,Ec).set(e,i),i};const v2=Symbol("INITIAL_DATA");var go,Gy,Gk;class O7{constructor(){q(this,Gy);q(this,go,Object.create(null))}get(e,t=null){if(t){const i=U(this,Gy,Gk).call(this,e);return i.promise.then(()=>t(i.data)),null}const r=m(this,go)[e];if(!r||r.data===v2)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const t=m(this,go)[e];return!!t&&t.data!==v2}resolve(e,t=null){const r=U(this,Gy,Gk).call(this,e);r.data=t,r.resolve()}clear(){var e;for(const t in m(this,go)){const{data:r}=m(this,go)[t];(e=r==null?void 0:r.bitmap)==null||e.close()}M(this,go,Object.create(null))}*[Symbol.iterator](){for(const e in m(this,go)){const{data:t}=m(this,go)[e];t!==v2&&(yield[e,t])}}}go=new WeakMap,Gy=new WeakSet,Gk=function(e){var t;return(t=m(this,go))[e]||(t[e]={...Promise.withResolvers(),data:v2})};var cd;class Lie{constructor(e){q(this,cd,null);M(this,cd,e),this.onContinue=null}get promise(){return m(this,cd).capability.promise}cancel(e=0){m(this,cd).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=m(this,cd).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=m(this,cd);return e.form||e.canvas&&(t==null?void 0:t.size)>0}}cd=new WeakMap;var ud,jf;const Uh=class Uh{constructor({callback:e,params:t,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:f=!1,pageColors:p=null}){q(this,ud,null);this.callback=e,this.params=t,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=f,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Lie(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){var o,l;if(this.cancelled)return;if(this._canvas){if(m(Uh,jf).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");m(Uh,jf).add(this._canvas)}this._pdfBug&&((o=globalThis.StepperManager)!=null&&o.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:i,transform:s,background:a}=this.params;this.gfx=new Hm(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,(l=this.graphicsReadyCallback)==null||l.call(this)}cancel(e=null,t=0){var r;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),m(this,ud)&&(window.cancelAnimationFrame(m(this,ud)),M(this,ud,null)),m(Uh,jf).delete(this._canvas),this.callback(e||new DT(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?M(this,ud,window.requestAnimationFrame(()=>{M(this,ud,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),m(Uh,jf).delete(this._canvas),this.callback())))}};ud=new WeakMap,jf=new WeakMap,q(Uh,jf,new WeakSet);let Kk=Uh;const Iie="4.8.69",Oie="3634dab10";function eL(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function jv(n){return Math.max(0,Math.min(255,255*n))}class tL{static CMYK_G([e,t,r,i]){return["G",1-Math.min(1,.3*e+.59*r+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=jv(e),[e,e,e]}static G_HTML([e]){const t=eL(e);return`#${t}${t}${t}`}static RGB_G([e,t,r]){return["G",.3*e+.59*t+.11*r]}static RGB_rgb(e){return e.map(jv)}static RGB_HTML(e){return`#${e.map(eL).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,r,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,r+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,r,i]){return[jv(1-Math.min(1,e+i)),jv(1-Math.min(1,r+i)),jv(1-Math.min(1,t+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,r]){const i=1-e,s=1-t,a=1-r,o=Math.min(i,s,a);return["CMYK",i,s,a,o]}}class Mie{create(e,t,r=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Un("Abstract method `_createSVG` called.")}}class VT extends Mie{_createSVG(e){return document.createElementNS(lc,e)}}class M7{static setupStorage(e,t,r,i,s){const a=i.getValue(t,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",o=>{i.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of r.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:r=null,intent:i,linkService:s}){const{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&s.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,t,r)}static render(e){var f,p;const t=e.annotationStorage,r=e.linkService,i=e.xfaHtml,s=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:s,linkService:r});const o=s!=="richText",l=e.div;if(l.append(a),e.viewport){const h=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=h}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const h=document.createTextNode(i.value);a.append(h),o&&J1.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}const u=[[i,-1,a]];for(;u.length>0;){const[h,b,g]=u.at(-1);if(b+1===h.children.length){u.pop();continue}const w=h.children[++u.at(-1)[1]];if(w===null)continue;const{name:y}=w;if(y==="#text"){const S=document.createTextNode(w.value);c.push(S),g.append(S);continue}const x=(f=w==null?void 0:w.attributes)!=null&&f.xmlns?document.createElementNS(w.attributes.xmlns,y):document.createElement(y);if(g.append(x),w.attributes&&this.setAttributes({html:x,element:w,storage:t,intent:s,linkService:r}),((p=w.children)==null?void 0:p.length)>0)u.push([w,-1,x]);else if(w.value){const S=document.createTextNode(w.value);o&&J1.shouldBuildText(y)&&c.push(S),x.append(S)}}for(const h of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const zb=1e3,Die=9,hp=new WeakSet;function Hc(n){return{width:n[2]-n[0],height:n[3]-n[1]}}class Fie{static create(e){switch(e.data.annotationType){case $r.LINK:return new D7(e);case $r.TEXT:return new Bie(e);case $r.WIDGET:switch(e.data.fieldType){case"Tx":return new $ie(e);case"Btn":return e.data.radioButton?new $7(e):e.data.checkBox?new zie(e):new qie(e);case"Ch":return new Hie(e);case"Sig":return new Uie(e)}return new Tp(e);case $r.POPUP:return new Xk(e);case $r.FREETEXT:return new W7(e);case $r.LINE:return new Vie(e);case $r.SQUARE:return new Gie(e);case $r.CIRCLE:return new Kie(e);case $r.POLYLINE:return new V7(e);case $r.CARET:return new Xie(e);case $r.INK:return new GT(e);case $r.POLYGON:return new Yie(e);case $r.HIGHLIGHT:return new G7(e);case $r.UNDERLINE:return new Jie(e);case $r.SQUIGGLY:return new Qie(e);case $r.STRIKEOUT:return new Zie(e);case $r.STAMP:return new K7(e);case $r.FILEATTACHMENT:return new ese(e);default:return new Ar(e)}}}var Rf,Dg,Fg,Ky,Yk;const TP=class TP{constructor(e,{isRenderable:t=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){q(this,Ky);q(this,Rf,null);q(this,Dg,!1);q(this,Fg,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:r}){return!!(e!=null&&e.str||t!=null&&t.str||r!=null&&r.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return TP._hasPopupData(this.data)}updateEdited(e){var r;if(!this.container)return;m(this,Rf)||M(this,Rf,{rect:this.data.rect.slice(0)});const{rect:t}=e;t&&U(this,Ky,Yk).call(this,t),(r=m(this,Fg))==null||r.popup.updateEdited(e)}resetEdited(){var e;m(this,Rf)&&(U(this,Ky,Yk).call(this,m(this,Rf).rect),(e=m(this,Fg))==null||e.popup.resetEdited(),M(this,Rf,null))}_createContainer(e){const{data:t,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),this instanceof Tp||(s.tabIndex=zb);const{style:a}=s;
451if(a.zIndex=this.parent.zIndex++,t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof Xk){const{rotation:g}=t;return!t.hasOwnCanvas&&g!==0&&this.setRotation(g,s),s}const{width:o,height:l}=Hc(t.rect);if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;const g=t.borderStyle.horizontalCornerRadius,w=t.borderStyle.verticalCornerRadius;if(g>0||w>0){const x=`calc(${g}px * var(--scale-factor)) / calc(${w}px * var(--scale-factor))`;a.borderRadius=x}else if(this instanceof $7){const x=`calc(${o}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=x}switch(t.borderStyle.style){case Tv.SOLID:a.borderStyle="solid";break;case Tv.DASHED:a.borderStyle="dashed";break;case Tv.BEVELED:Gt("Unimplemented border style: beveled");break;case Tv.INSET:Gt("Unimplemented border style: inset");break;case Tv.UNDERLINE:a.borderBottomStyle="solid";break}const y=t.borderColor||null;y?(M(this,Dg,!0),a.borderColor=ft.makeHexColor(y[0]|0,y[1]|0,y[2]|0)):a.borderWidth=0}const c=ft.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]),{pageWidth:u,pageHeight:f,pageX:p,pageY:h}=i.rawDims;a.left=`${100*(c[0]-p)/u}%`,a.top=`${100*(c[1]-h)/f}%`;const{rotation:b}=t;return t.hasOwnCanvas||b===0?(a.width=`${100*o/u}%`,a.height=`${100*l/f}%`):this.setRotation(b,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims,{width:s,height:a}=Hc(this.data.rect);let o,l;e%180===0?(o=100*s/r,l=100*a/i):(o=100*a/r,l=100*s/i),t.style.width=`${o}%`,t.style.height=`${l}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,r,i)=>{const s=i.detail[t],a=s[0],o=s.slice(1);i.target.style[r]=tL[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:tL[`${a}_rgb`](o)})};return tn(this,"_commonActions",{display:t=>{const{display:r}=t.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:r}=t.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const r=t.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,t){const r=this._commonActions;for(const i of Object.keys(t.detail)){const s=e[i]||r[i];s==null||s(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const r=this._commonActions;for(const[i,s]of Object.entries(t)){const a=r[i];if(a){const o={detail:{[i]:s},target:e};a(o),delete t[i]}}}
451_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,r,i,s]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,w,y,x]=e.subarray(2,6);if(i===g&&s===w&&t===y&&r===x)return}const{style:a}=this.container;let o;if(m(this,Dg)){const{borderColor:g,borderWidth:w}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${g}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}const l=i-t,c=s-r,{svgFactory:u}=this,f=u.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0);const p=u.createElement("defs");f.append(p);const h=u.createElement("clipPath"),b=`clippath_${this.data.id}`;h.setAttribute("id",b),h.setAttribute("clipPathUnits","objectBoundingBox"),p.append(h);for(let g=2,w=e.length;g<w;g+=8){const y=e[g],x=e[g+1],S=e[g+2],A=e[g+3],C=u.createElement("rect"),T=(S-t)/l,R=(s-x)/c,I=(y-S)/l,L=(x-A)/c;C.setAttribute("x",T),C.setAttribute("y",R),C.setAttribute("width",I),C.setAttribute("height",L),h.append(C),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${T}" y="${R}" width="${I}" height="${L}"/>`)}m(this,Dg)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(f),this.container.style.clipPath=`url(#${b})`}_createPopup(){const{data:e}=this,t=M(this,Fg,new Xk({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(t.render())}render(){Un("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:s,id:a,exportValues:o}of i){if(s===-1||a===t)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!hp.has(c)){Gt(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:c})}return r}for(const i of document.getElementsByName(e)){const{exportValue:s}=i,a=i.getAttribute("data-element-id");a!==t&&hp.has(i)&&r.push({id:a,exportValue:s,domElement:i})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}};Rf=new WeakMap,Dg=new WeakMap,Fg=new WeakMap,Ky=new WeakSet,Yk=function(e){const{container:{style:t},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}}}=this;r==null||r.splice(0,4,...e);const{width:c,height:u}=Hc(e);t.left=`${100*(e[0]-o)/s}%`,t.top=`${100*(a-e[3]+l)/a}%`,i===0?(t.width=`${100*c/s}%`,t.height=`${100*u/a}%`):this.setRotation(i)};let Ar=TP;var Js,Rh,F7,B7;class D7 extends Ar{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});q(this,Js);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:r}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let s=!1;return t.url?(r.addLinkAttributes(i,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(i,t.action),s=!0):t.attachment?(U(this,Js,F7).call(this,i,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(U(this,Js,B7).call(this,i,t.setOCGState),s=!0):t.dest?(this._bindLink(i,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),s=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.container.classList.add("linkA
451nnotation"),s&&this.container.append(i),this.container}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&U(this,Js,Rh).call(this)}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),U(this,Js,Rh).call(this)}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(r.actions)){const a=i.get(s);a&&(t[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:s}}),!1})}t.onclick||(t.onclick=()=>!1),U(this,Js,Rh).call(this)}_bindResetFormAction(t,r){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),U(this,Js,Rh).call(this),!this._fieldObjects){Gt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{var f;i==null||i();const{fields:s,refs:a,include:o}=r,l=[];if(s.length!==0||a.length!==0){const p=new Set(a);for(const h of s){const b=this._fieldObjects[h]||[];for(const{id:g}of b)p.add(g)}for(const h of Object.values(this._fieldObjects))for(const b of h)p.has(b.id)===o&&l.push(b)}else for(const p of Object.values(this._fieldObjects))l.push(...p);const c=this.annotationStorage,u=[];for(const p of l){const{id:h}=p;switch(u.push(h),p.type){case"text":{const g=p.defaultValue||"";c.setValue(h,{value:g});break}case"checkbox":case"radiobutton":{const g=p.defaultValue===p.exportValues;c.setValue(h,{value:g});break}case"combobox":case"listbox":{const g=p.defaultValue||"";c.setValue(h,{value:g});break}default:continue}const b=document.querySelector(`[data-element-id="${h}"]`);if(b){if(!hp.has(b)){Gt(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;b.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}})),!1}}}Js=new WeakSet,Rh=function(){this.container.setAttribute("data-internal-link","")},F7=function(t,r,i=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>{var s;return(s=this.downloadManager)==null||s.openOrDownloadData(r.content,r.filename,i),!1},U(this,Js,Rh).call(this)},B7=function(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),U(this,Js,Rh).call(this)};class Bie extends Ar{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class Tp extends Ar{render(){return this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&(((t=e.previousSibling)==null?void 0:t.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return is.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,r,i,s){r.includes("mouse")?e.addEventListener(r,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{var o;if(r==="blur"){if(!t.focused||!a.relatedTarget)return;t.focused=!1}else if(r==="focus"){if(t.focused)return;t.focused=!0}s&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a)}}))})}_setEventListeners(e,t,r,i){var s,a,o;for(const[l,c]of r)(c==="Action"||(s=this.data.actions)!=null&&s[c])&&((c==="Focus"||c==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,l,c,i),c==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,t,"blur","Blur",null):c==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,t,"focus","Focus",null))}
451_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":ft.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||Die,s=e.style;let a;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),u=Math.round(c/(qA*i))||1,f=c/u;a=Math.min(i,l(f/qA))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,l(c/qA))}s.fontSize=`calc(${a}px * var(--scale-factor))`,s.color=ft.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class $ie extends Tp{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,r,i){const s=this.annotationStorage;
451for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=r),s.setValue(a.id,{[i]:r})}render(){var i,s;const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const a=e.getValue(t,{value:this.data.fieldValue});let o=a.value||"";const l=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((i=this.data.textContent)==null?void 0:i.join(`
452`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const u={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=c??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",c??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),hp.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=zb,this._setRequired(r,this.data.required),l&&(r.maxLength=l),r.addEventListener("input",p=>{e.setValue(t,{value:p.target.value}),this.setPropertyOnSiblings(r,"value",p.target.value,"value"),u.formattedValue=null}),r.addEventListener("resetform",p=>{const h=this.data.defaultFieldValue??"";r.value=u.userValue=h,u.formattedValue=null});let f=p=>{const{formattedValue:h}=u;h!=null&&(p.target.value=h),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",h=>{var g;if(u.focused)return;const{target:b}=h;u.userValue&&(b.value=u.userValue),u.lastCommittedValue=b.value,u.commitKey=1,(g=this.data.actions)!=null&&g.Focus||(u.focused=!0)}),r.addEventListener("updatefromsandbox",h=>{this.showElementAndHideCanvas(h.target);const b={value(g){u.userValue=g.detail.value??"",e.setValue(t,{value:u.userValue.toString()}),g.target.value=u.userValue},formattedValue(g){const{formattedValue:w}=g.detail;u.formattedValue=w,w!=null&&g.target!==document.activeElement&&(g.target.value=w),e.setValue(t,{formattedValue:w})},selRange(g){g.target.setSelectionRange(...g.detail.selRange)},charLimit:g=>{var S;const{charLimit:w}=g.detail,{target:y}=g;if(w===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",w);let x=u.userValue;!x||x.length<=w||(x=x.slice(0,w),y.value=u.userValue=x,e.setValue(t,{value:x}),(S=this.linkService.eventBus)==null||S.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:x,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(b,h)}),r.addEventListener("keydown",h=>{var w;u.commitKey=1;let b=-1;if(h.key==="Escape"?b=0:h.key==="Enter"&&!this.data.multiLine?b=2:h.key==="Tab"&&(u.commitKey=3),b===-1)return;const{value:g}=h.target;u.lastCommittedValue!==g&&(u.lastCommittedValue=g,u.userValue=g,(w=this.linkService.eventBus)==null||w.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:g,willCommit:!0,commitKey:b,selStart:h.target.selectionStart,selEnd:h.target.selectionEnd}}))});const p=f;f=null,r.addEventListener("blur",h=>{var g,w;if(!u.focused||!h.relatedTarget)return;(g=this.data.actions)!=null&&g.Blur||(u.focused=!1);const{value:b}=h.target;u.userValue=b,u.lastCommittedValue!==b&&((w=this.linkService.eventBus)==null||w.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:u.commitKey,selStart:h.target.selectionStart,selEnd:h.target.selectionEnd}})),p(h)}),(s=this.data.actions)!=null&&s.Keystroke&&r.addEventListener("beforeinput",h=>{var C;u.lastCommittedValue=null;const{data:b,target:g}=h,{value:w,selectionStart:y,selectionEnd:x}=g;let S=y,A=x;switch(h.inputType){case"deleteWordBackward":{const T=w.substring(0,y).match(/\w*[^\w]*$/);T&&(S-=T[0].length);break}
vendor: 4,158 bytes, line 452
452case"deleteWordForward":{const T=w.substring(y).match(/^[^\w]*\w*/);T&&(A+=T[0].length);break}case"deleteContentBackward":y===x&&(S-=1);break;case"deleteContentForward":y===x&&(A+=1);break}h.preventDefault(),(C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:w,change:b||"",willCommit:!1,selStart:S,selEnd:A}})}),this._setEventListeners(r,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],h=>h.target.value)}if(f&&r.addEventListener("blur",f),this.data.comb){const h=(this.data.rect[2]-this.data.rect[0])/l;r.classList.add("comb"),r.style.letterSpacing=`calc(${h}px * var(--scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Uie extends Tp{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class zie extends Tp{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,r=t.id;let i=e.getValue(r,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return hp.add(s),s.setAttribute("data-element-id",r),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=t.fieldName,i&&s.setAttribute("checked",!0),s.setAttribute("exportValue",t.exportValue),s.tabIndex=zb,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r)){const u=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue||"Off";a.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class $7 extends Tp{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,r=t.id;let i=e.getValue(r,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,e.setValue(r,{value:i})),i)for(const a of this._getElementsByName(t.fieldName,r))e.setValue(a.id,{value:!1});const s=document.createElement("input");if(hp.add(s),s.setAttribute("data-element-id",r),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=t.fieldName,i&&s.setAttribute("checked",!0),s.tabIndex=zb,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue;a.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;s.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const u=a===c.detail.value;for(const f of this._getElementsByName(c.target.name)){const p=u&&f.id===r;f.domElement&&(f.domElement.checked=p),e.setValue(f.id,{value:p})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}
452return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class qie extends D7{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class Hie extends Tp{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,r=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");hp.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=zb;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",u=>{const f=this.data.defaultFieldValue;for(const p of i.options)p.selected=p.value===f});for(const u of this.data.options){const f=document.createElement("option");f.textContent=u.displayValue,f.value=u.exportValue,r.value.includes(u.exportValue)&&(f.setAttribute("selected",!0),s=!1),i.append(f)}let a=null;if(s){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),i.prepend(u),a=()=>{u.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const o=u=>{const f=u?"value":"textContent",{options:p,multiple:h}=i;return h?Array.prototype.filter.call(p,b=>b.selected).map(b=>b[f]):p.selectedIndex===-1?null:p[p.selectedIndex][f]};let l=o(!1);const c=u=>{const f=u.target.options;return Array.prototype.map.call(f,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",u=>{const f={value(p){a==null||a();const h=p.detail.value,b=new Set(Array.isArray(h)?h:[h]);for(const g of i.options)g.selected=b.has(g.value);e.setValue(t,{value:o(!0)}),l=o(!1)},multipleSelection(p){i.multiple=!0},remove(p){const h=i.options,b=p.detail.remove;h[b].selected=!1,i.remove(b),h.length>0&&Array.prototype.findIndex.call(h,w=>w.selected)===-1&&(h[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},clear(p){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),l=o(!1)},insert(p){const{index:h,displayValue:b,exportValue:g}=p.detail.insert,w=i.children[h],y=document.createElement("option");y.textContent=b,y.value=g,w?w.before(y):i.append(y),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},items(p){const{items:h}=p.detail;for(;i.length!==0;)i.remove(0);for(const b of h){const{displayValue:g,exportValue:w}=b,y=document.createElement("option");y.textContent=g,y.value=w,i.append(y)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},indices(p){const h=new Set(p.detail.indices);for(const b of p.target.options)b.selected=h.has(b.index);e.setValue(t,{value:o(!0)}),l=o(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(f,u)}),i.addEventListener("input",u=>{var h;const f=o(!0),p=o(!1);e.setValue(t,{value:f}),u.preventDefault(),(h=this.linkService.eventBus)==null||h.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:p,changeEx:f,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):i.addEventListener("input",function(u){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Xk extends Ar{constructor(e){const{data:t,elements:r}=e;super(e,{isRenderable:Ar._hasPopupData(t)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new Wie({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",t.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(r=>`${MT}${r}`).join(",")),this.container}}
452var Bg,n5,r5,$g,Lf,ur,Nc,Ug,Yy,Xy,zg,kc,vo,Cc,Jy,Tc,Qy,If,Of,An,fx,Jk,U7,z7,q7,H7,px,mx,Qk;class Wie{constructor({container:e,color:t,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:c,parentRect:u,open:f}){q(this,An);q(this,Bg,U(this,An,q7).bind(this));q(this,n5,U(this,An,Qk).bind(this));q(this,r5,U(this,An,mx).bind(this));q(this,$g,U(this,An,px).bind(this));q(this,Lf,null);q(this,ur,null);q(this,Nc,null);q(this,Ug,null);q(this,Yy,null);q(this,Xy,null);q(this,zg,null);q(this,kc,!1);q(this,vo,null);q(this,Cc,null);q(this,Jy,null);q(this,Tc,null);q(this,Qy,null);q(this,If,null);q(this,Of,!1);var p;M(this,ur,e),M(this,Qy,i),M(this,Nc,a),M(this,Tc,o),M(this,Xy,l),M(this,Lf,t),M(this,Jy,c),M(this,zg,u),M(this,Yy,r),M(this,Ug,BT.toDateObject(s)),this.trigger=r.flatMap(h=>h.getElementsToTriggerPopup());for(const h of this.trigger)h.addEventListener("click",m(this,$g)),h.addEventListener("mouseenter",m(this,r5)),h.addEventListener("mouseleave",m(this,n5)),h.classList.add("popupTriggerArea");for(const h of r)(p=h.container)==null||p.addEventListener("keydown",m(this,Bg));m(this,ur).hidden=!0,f&&U(this,An,px).call(this)}render(){if(m(this,vo))return;const e=M(this,vo,document.createElement("div"));if(e.className="popup",m(this,Lf)){const s=e.style.outlineColor=ft.makeHexColor(...m(this,Lf));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`:e.style.backgroundColor=ft.makeHexColor(...m(this,Lf).map(o=>Math.floor(.7*(255-o)+o)))}const t=document.createElement("span");t.className="header";const r=document.createElement("h1");if(t.append(r),{dir:r.dir,str:r.textContent}=m(this,Qy),e.append(t),m(this,Ug)){const s=document.createElement("span");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:m(this,Ug).valueOf()})),t.append(s)}const i=m(this,An,fx);if(i)M7.render({xfaHtml:i,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const s=this._formatContents(m(this,Nc));e.append(s)}m(this,ur).append(e)}_formatContents({str:e,dir:t}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=t;const i=e.split(/(?:\r\n?|\n)/);for(let s=0,a=i.length;s<a;++s){const o=i[s];r.append(document.createTextNode(o)),s<a-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:t}){var r;m(this,If)||M(this,If,{contentsObj:m(this,Nc),richText:m(this,Tc)}),e&&M(this,Cc,null),t&&(M(this,Tc,U(this,An,z7).call(this,t)),M(this,Nc,null)),(r=m(this,vo))==null||r.remove(),M(this,vo,null)}resetEdited(){var e;m(this,If)&&({contentsObj:Xr(this,Nc)._,richText:Xr(this,Tc)._}=m(this,If),M(this,If,null),(e=m(this,vo))==null||e.remove(),M(this,vo,null),M(this,Cc,null))}forceHide(){M(this,Of,this.isVisible),m(this,Of)&&(m(this,ur).hidden=!0)}maybeShow(){m(this,Of)&&(m(this,vo)||U(this,An,mx).call(this),M(this,Of,!1),m(this,ur).hidden=!1)}get isVisible(){return m(this,ur).hidden===!1}}Bg=new WeakMap,n5=new WeakMap,r5=new WeakMap,$g=new WeakMap,Lf=new WeakMap,ur=new WeakMap,Nc=new WeakMap,Ug=new WeakMap,Yy=new WeakMap,Xy=new WeakMap,zg=new WeakMap,kc=new WeakMap,vo=new WeakMap,Cc=new WeakMap,Jy=new WeakMap,Tc=new WeakMap,Qy=new WeakMap,If=new WeakMap,Of=new WeakMap,An=new WeakSet,fx=function(){const e=m(this,Tc),t=m(this,Nc);return e!=null&&e.str&&(!(t!=null&&t.str)||t.str===e.str)&&m(this,Tc).html||null},Jk=function(){var e,t,r;return((r=(t=(e=m(this,An,fx))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:r.fontSize)||0},U7=function(){var e,t,r;return((r=(t=(e=m(this,An,fx))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:r.color)||null},z7=function(e){const t=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:m(this,An,U7),fontSize:m(this,An,Jk)?`calc(${m(this,An,Jk)}px * var(--scale-factor))`:""}};for(const s of e.split(`
453`))t.push({name:"span",value:s,attributes:i});return r},q7=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&m(this,kc))&&U(this,An,px).call(this)},H7=function(){if(m(this,Cc)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:r,pageX:i,pageY:s}}}=m(this,Xy);let a=!!m(this,zg),o=a?m(this,zg):m(this,Jy);for(const b of m(this,Yy))if(!o||ft.intersect(b.data.rect,o)!==null){o=b.data.rect,a=!0;break}const l=ft.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=a?o[2]-o[0]+5:0,f=l[0]+u,p=l[1];M(this,Cc,[100*(f-i)/t,100*(p-s)/r]);const{style:h}=m(this,ur);
453h.left=`${m(this,Cc)[0]}%`,h.top=`${m(this,Cc)[1]}%`},px=function(){M(this,kc,!m(this,kc)),m(this,kc)?(U(this,An,mx).call(this),m(this,ur).addEventListener("click",m(this,$g)),m(this,ur).addEventListener("keydown",m(this,Bg))):(U(this,An,Qk).call(this),m(this,ur).removeEventListener("click",m(this,$g)),m(this,ur).removeEventListener("keydown",m(this,Bg)))},mx=function(){m(this,vo)||this.render(),this.isVisible?m(this,kc)&&m(this,ur).classList.add("focused"):(U(this,An,H7).call(this),m(this,ur).hidden=!1,m(this,ur).style.zIndex=parseInt(m(this,ur).style.zIndex)+1e3)},Qk=function(){m(this,ur).classList.remove("focused"),!(m(this,kc)||!this.isVisible)&&(m(this,ur).hidden=!0,m(this,ur).style.zIndex=parseInt(m(this,ur).style.zIndex)-1e3)};class W7 extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Ht.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const r=document.createElement("span");r.textContent=t,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Zy;class Vie extends Ar{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,Zy,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:r,height:i}=Hc(t.rect),s=this.svgFactory.create(r,i,!0),a=M(this,Zy,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),a.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),a.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),a.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return m(this,Zy)}addHighlightArea(){this.container.classList.add("highlightArea")}}Zy=new WeakMap;var eb;class Gie extends Ar{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,eb,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:r,height:i}=Hc(t.rect),s=this.svgFactory.create(r,i,!0),a=t.borderStyle.width,o=M(this,eb,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return m(this,eb)}addHighlightArea(){this.container.classList.add("highlightArea")}}eb=new WeakMap;var tb;class Kie extends Ar{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,tb,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:r,height:i}=Hc(t.rect),s=this.svgFactory.create(r,i,!0),a=t.borderStyle.width,o=M(this,tb,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",i/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",i/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return m(this,tb)}addHighlightArea(){this.container.classList.add("highlightArea")}}tb=new WeakMap;var nb;class V7 extends Ar{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,nb,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:r,borderStyle:i,popupRef:s}}=this;if(!r)return this.container;const{width:a,height:o}=Hc(t),l=this.svgFactory.create(a,o,!0);let c=[];for(let f=0,p=r.length;f<p;f+=2){const h=r[f]-t[0],b=t[3]-r[f+1];c.push(`${h},${b}`)}c=c.join(" ");const u=M(this,nb,this.svgFactory.createElement(this.svgElementName));return u.setAttribute("points",c),u.setAttribute("stroke-width",i.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),l.append(u),this.container.append(l),!s&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return m(this,nb)}addHighlightArea(){this.container.classList.add("highlightArea")}}nb=new WeakMap;class Yie extends V7{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Xie extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
453var rb;class GT extends Ar{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,rb,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Ht.HIGHLIGHT:Ht.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:r,borderStyle:i,popupRef:s}}=this,{width:a,height:o}=Hc(t),l=this.svgFactory.create(a,o,!0);for(const c of r){let u=[];for(let p=0,h=c.length;p<h;p+=2){const b=c[p]-t[0],g=t[3]-c[p+1];u.push(`${b},${g}`)}u=u.join(" ");const f=this.svgFactory.createElement(this.svgElementName);m(this,rb).push(f),f.setAttribute("points",u),f.setAttribute("stroke-width",i.width||1),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),l.append(f)}return!s&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}getElementsToTriggerPopup(){return m(this,rb)}addHighlightArea(){this.container.classList.add("highlightArea")}}rb=new WeakMap;class G7 extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Ht.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class Jie extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Qie extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Zie extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class K7 extends Ar{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Ht.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var ib,sb,Zk;class ese extends Ar{constructor(t){var i;super(t,{isRenderable:!0});q(this,sb);q(this,ib,null);const{file:r}=this.data;this.filename=r.filename,this.content=r.content,(i=this.linkService.eventBus)==null||i.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:r}=this;let i;r.hasAppearance||r.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),i.addEventListener("dblclick",U(this,sb,Zk).bind(this)),M(this,ib,i);const{isMac:s}=is.platform;return t.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&U(this,sb,Zk).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return m(this,ib)}addHighlightArea(){this.container.classList.add("highlightArea")}}ib=new WeakMap,sb=new WeakSet,Zk=function(){var t;(t=this.downloadManager)==null||t.openOrDownloadData(this.content,this.filename)};var ab,Mf,Df,ob,xp,Y7,eC,a6;let tse=(a6=class{constructor({div:e,accessibilityManager:t,annotationCanvasMap:r,annotationEditorUIManager:i,page:s,viewport:a,structTreeLayer:o}){q(this,xp);q(this,ab,null);q(this,Mf,null);q(this,Df,new Map);q(this,ob,null);this.div=e,M(this,ab,t),M(this,Mf,r),M(this,ob,o||null),this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i}hasEditableAnnotations(){return m(this,Df).size>0}async render(e){var a;const{annotations:t}=e,r=this.div;up(r,this.viewport);const i=new Map,s={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new VT,annotationStorage:e.annotationStorage||new UT,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const o of t){if(o.noHTML)continue;const l=o.annotationType===$r.POPUP;if(l){const f=i.get(o.id);if(!f)continue;s.elements=f}else{const{width:f,height:p}=Hc(o.rect);if(f<=0||p<=0)continue}s.data=o;const c=Fie.create(s);if(!c.isRenderable)continue;if(!l&&o.popupRef){const f=i.get(o.popupRef);f?f.push(c):i.set(o.popupRef,[c])}const u=c.render();o.hidden&&(u.style.visibility="hidden"),await U(this,xp,Y7).call(this,u,o.id),c._isEditable&&(m(this,Df).set(c.data.id,c),(a=this._annotationEditorUIManager)==null||a.renderAnnotationElement(c))}
453U(this,xp,eC).call(this)}update({viewport:e}){const t=this.div;this.viewport=e,up(t,{rotation:e.rotation}),U(this,xp,eC).call(this),t.hidden=!1}getEditableAnnotations(){return Array.from(m(this,Df).values())}getEditableAnnotation(e){return m(this,Df).get(e)}},ab=new WeakMap,Mf=new WeakMap,Df=new WeakMap,ob=new WeakMap,xp=new WeakSet,Y7=async function(e,t){var a,o;const r=e.firstChild||e,i=r.id=`${MT}${t}`,s=await((a=m(this,ob))==null?void 0:a.getAriaAttributes(i));if(s)for(const[l,c]of s)r.setAttribute(l,c);this.div.append(e),(o=m(this,ab))==null||o.moveElementInDOM(this.div,e,r,!1)},eC=function(){if(!m(this,Mf))return;const e=this.div;for(const[t,r]of m(this,Mf)){const i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;r.className="annotationContent";const{firstChild:s}=i;s?s.nodeName==="CANVAS"?s.replaceWith(r):s.classList.contains("annotationContent")?s.after(r):s.before(r):i.append(r)}m(this,Mf).clear()},a6);const y2=/\r\n?|\n/g;var yo,zs,lb,Ff,qs,Lr,X7,J7,Q7,gx,Vc,vx,yx,Z7,nC,eB;const Ln=class Ln extends bn{constructor(t){super({...t,name:"freeTextEditor"});q(this,Lr);q(this,yo);q(this,zs,"");q(this,lb,`${this.id}-editor`);q(this,Ff,null);q(this,qs);M(this,yo,t.color||Ln._defaultColor||bn._defaultLineColor),M(this,qs,t.fontSize||Ln._defaultFontSize)}static get _keyboardManager(){const t=Ln.prototype,r=a=>a.isEmpty(),i=dp.TRANSLATE_SMALL,s=dp.TRANSLATE_BIG;return tn(this,"_keyboardManager",new Ub([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:r}]]))}static initialize(t,r){bn.initialize(t,r);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,r){switch(t){case jt.FREETEXT_SIZE:Ln._defaultFontSize=r;break;case jt.FREETEXT_COLOR:Ln._defaultColor=r;break}}updateParams(t,r){switch(t){case jt.FREETEXT_SIZE:U(this,Lr,X7).call(this,r);break;case jt.FREETEXT_COLOR:U(this,Lr,J7).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[jt.FREETEXT_SIZE,Ln._defaultFontSize],[jt.FREETEXT_COLOR,Ln._defaultColor||bn._defaultLineColor]]}get propertiesToUpdate(){return[[jt.FREETEXT_SIZE,m(this,qs)],[jt.FREETEXT_COLOR,m(this,yo)]]}_translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}getInitialTranslation(){const t=this.parentScale;return[-Ln._internalPadding*t,-(Ln._internalPadding+m(this,qs))*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Ht.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),M(this,Ff,new AbortController);const t=this._uiManager.combinedSignal(m(this,Ff));this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t})}disableEditMode(){var t;this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",m(this,lb)),this._isDraggable=!0,(t=m(this,Ff))==null||t.abort(),M(this,Ff,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),(t=this._initialOptions)!=null&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=m(this,zs),r=M(this,zs,U(this,Lr,Q7).call(this).trimEnd());if(t===r)return;const i=s=>{if(M(this,zs,s),!s){this.remove();return}U(this,Lr,yx).call(this),this._uiManager.rebuild(this),U(this,Lr,gx).call(this)};this.addCommands({cmd:()=>{i(r)}
453,undo:()=>{i(t)},mustExec:!1}),U(this,Lr,gx).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Ln._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",m(this,lb)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${m(this,qs)}px * var(--scale-factor))`,i.color=m(this,yo),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),T_(this,this.div,["dblclick","keydown"]),this.width){const[s,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[u,f]=this.pageDimensions,[p,h]=this.pageTranslation;let b,g;switch(this.rotation){case 0:b=t+(o[0]-p)/u,g=r+this.height-(o[1]-h)/f;break;case 90:b=t+(o[0]-p)/u,g=r-(o[1]-h)/f,[l,c]=[c,-l];break;case 180:b=t-this.width+(o[0]-p)/u,g=r-(o[1]-h)/f,[l,c]=[-l,-c];break;case 270:b=t+(o[0]-p-this.height*f)/u,g=r+(o[1]-h-this.width*u)/f,[l,c]=[-c,l];break}this.setAt(b*s,g*a,l,c)}else this.setAt(t*s,r*a,this.width*s,this.height*a);U(this,Lr,yx).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var b,g,w;const r=t.clipboardData||window.clipboardData,{types:i}=r;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();const s=U(b=Ln,Vc,nC).call(b,r.getData("text")||"").replaceAll(y2,`
454`);if(!s)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!s.includes(`
455`)){o.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,u=[],f=[];if(l.nodeType===Node.TEXT_NODE){const y=l.parentElement;if(f.push(l.nodeValue.slice(c).replaceAll(y2,"")),y!==this.editorDiv){let x=u;for(const S of this.editorDiv.childNodes){if(S===y){x=f;continue}x.push(U(g=Ln,Vc,vx).call(g,S))}}u.push(l.nodeValue.slice(0,c).replaceAll(y2,""))}else if(l===this.editorDiv){let y=u,x=0;for(const S of this.editorDiv.childNodes)x++===c&&(y=f),y.push(U(w=Ln,Vc,vx).call(w,S))}M(this,zs,`${u.join(`
456`)}${s}${f.join(`
457`)}`),U(this,Lr,yx).call(this);const p=new Range;let h=u.reduce((y,x)=>y+x.length,0);for(const{firstChild:y}of this.editorDiv.childNodes)if(y.nodeType===Node.TEXT_NODE){const x=y.nodeValue.length;if(h<=x){p.setStart(y,h),p.setEnd(y,h);break}h-=x}a.removeAllRanges(),a.addRange(p)}get contentDiv(){return this.editorDiv}static async deserialize(t,r,i){var o;let s=null;if(t instanceof W7){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:u,rotation:f,id:p,popupRef:h},textContent:b,textPosition:g,parent:{page:{pageNumber:w}}}=t;if(!b||b.length===0)return null;s=t={annotationType:Ht.FREETEXT,color:Array.from(c),fontSize:l,value:b.join(`
458`),position:g,pageIndex:w-1,rect:u.slice(0),rotation:f,id:p,deleted:!1,popupRef:h}}const a=await super.deserialize(t,r,i);return M(a,qs,t.fontSize),M(a,yo,ft.makeHexColor(...t.color)),M(a,zs,U(o=Ln,Vc,nC).call(o,t.value)),a.annotationElementId=t.id||null,a._initialData=s,a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=Ln._internalPadding*this.parentScale,i=this.getRect(r,r),s=bn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:m(this,yo)),a={annotationType:Ht.FREETEXT,color:s,fontSize:m(this,qs),value:U(this,Lr,Z7).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?a:this.annotationElementId&&!U(this,Lr,eB).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){const r=super.renderAnnotationElement(t);if(this.deleted)return r;const{style:i}=r;i.fontSize=`calc(${m(this,qs)}px * var(--scale-factor))`,i.color=m(this,yo),r.replaceChildren();for(const a of m(this,zs).split(`
459`)){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),r.append(o)}const s=Ln._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(s,s),popupContent:m(this,zs)}),r}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};yo=new WeakMap,zs=new WeakMap,lb=new WeakMap,Ff=new WeakMap,qs=new WeakMap,Lr=new WeakSet,X7=function(t){const r=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--scale-factor))`,this.translate(0,-(s-m(this,qs))*this.parentScale),M(this,qs,s),U(this,Lr,gx).call(this)},i=m(this,qs);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.FREETEXT_S
459IZE,overwriteIfSameType:!0,keepUndo:!0})},J7=function(t){const r=s=>{M(this,yo,this.editorDiv.style.color=s)},i=m(this,yo);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Q7=function(){var i;const t=[];this.editorDiv.normalize();let r=null;for(const s of this.editorDiv.childNodes)(r==null?void 0:r.nodeType)===Node.TEXT_NODE&&s.nodeName==="BR"||(t.push(U(i=Ln,Vc,vx).call(i,s)),r=s);return t.join(`
460`)},gx=function(){const[t,r]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:s,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/r):(this.width=i.height/t,this.height=i.width/r),this.fixAndSetPosition()},Vc=new WeakSet,vx=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(y2,"")},yx=function(){if(this.editorDiv.replaceChildren(),!!m(this,zs))for(const t of m(this,zs).split(`
461`)){const r=document.createElement("div");r.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(r)}},Z7=function(){return m(this,zs).replaceAll(" "," ")},nC=function(t){return t.replaceAll(" "," ")},eB=function(t){const{value:r,fontSize:i,color:s,pageIndex:a}=this._initialData;return this._hasBeenMoved||t.value!==r||t.fontSize!==i||t.color.some((o,l)=>o!==s[l])||t.pageIndex!==a},q(Ln,Vc),Ue(Ln,"_freeTextDefaultContent",""),Ue(Ln,"_internalPadding",0),Ue(Ln,"_defaultColor",null),Ue(Ln,"_defaultFontSize",10),Ue(Ln,"_type","freetext"),Ue(Ln,"_editorType",Ht.FREETEXT);let tC=Ln;class tB{toSVGPath(){Un("Abstract method `toSVGPath` must be implemented.")}get box(){Un("Abstract getter `box` must be implemented.")}serialize(e,t){Un("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){Un("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){Un("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}var Hs,bo,qg,Hg,vl,Kt,Bf,$f,cb,ub,Wg,Vg,dd,db,i5,s5,Gr,Xv,nB,rB,iB,sB,aB,oB;const dc=class dc{constructor({x:e,y:t},r,i,s,a,o=0){q(this,Gr);q(this,Hs);q(this,bo,[]);q(this,qg);q(this,Hg);q(this,vl,[]);q(this,Kt,new Float64Array(18));q(this,Bf);q(this,$f);q(this,cb);q(this,ub);q(this,Wg);q(this,Vg);q(this,dd,[]);M(this,Hs,r),M(this,Vg,s*i),M(this,Hg,a),m(this,Kt).set([NaN,NaN,NaN,NaN,e,t],6),M(this,qg,o),M(this,ub,m(dc,db)*i),M(this,cb,m(dc,s5)*i),M(this,Wg,i),m(this,dd).push(e,t)}isEmpty(){return isNaN(m(this,Kt)[8])}add({x:e,y:t}){var L;M(this,Bf,e),M(this,$f,t);const[r,i,s,a]=m(this,Hs);let[o,l,c,u]=m(this,Kt).subarray(8,12);const f=e-c,p=t-u,h=Math.hypot(f,p);if(h<m(this,cb))return!1;const b=h-m(this,ub),g=b/h,w=g*f,y=g*p;let x=o,S=l;o=c,l=u,c+=w,u+=y,(L=m(this,dd))==null||L.push(e,t);const A=-y/b,C=w/b,T=A*m(this,Vg),R=C*m(this,Vg);return m(this,Kt).set(m(this,Kt).subarray(2,8),0),m(this,Kt).set([c+T,u+R],4),m(this,Kt).set(m(this,Kt).subarray(14,18),12),m(this,Kt).set([c-T,u-R],16),isNaN(m(this,Kt)[6])?(m(this,vl).length===0&&(m(this,Kt).set([o+T,l+R],2),m(this,vl).push(NaN,NaN,NaN,NaN,(o+T-r)/s,(l+R-i)/a),m(this,Kt).set([o-T,l-R],14),m(this,bo).push(NaN,NaN,NaN,NaN,(o-T-r)/s,(l-R-i)/a)),m(this,Kt).set([x,S,o,l,c,u],6),!this.isEmpty()):(m(this,Kt).set([x,S,o,l,c,u],6),Math.abs(Math.atan2(S-l,x-o)-Math.atan2(y,w))<Math.PI/2?([o,l,c,u]=m(this,Kt).subarray(2,6),m(this,vl).push(NaN,NaN,NaN,NaN,((o+c)/2-r)/s,((l+u)/2-i)/a),[o,l,x,S]=m(this,Kt).subarray(14,18),m(this,bo).push(NaN,NaN,NaN,NaN,((x+o)/2-r)/s,((S+l)/2-i)/a),!0):([x,S,o,l,c,u]=m(this,Kt).subarray(0,6),m(this,vl).push(((x+5*o)/6-r)/s,((S+5*l)/6-i)/a,((5*o+c)/6-r)/s,((5*l+u)/6-i)/a,((o+c)/2-r)/s,((l+u)/2-i)/a),[c,u,o,l,x,S]=m(this,Kt).subarray(12,18),m(this,bo).push(((x+5*o)/6-r)/s,((S+5*l)/6-i)/a,((5*o+c)/6-r)/s,((5*l+u)/6-i)/a,((o+c)/2-r)/s,((l+u)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=m(this,vl),t=m(this,bo);if(isNaN(m(this,Kt)[6])&&!this.isEmpty())return U(this,Gr,nB).call(this);const r=[];r.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?r.push(`L${e[i+4]} ${e[i+5]}`):r.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);U(this,Gr,iB).call(this,r);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?r.push(`L${t[i+4]} ${t[i+5]}`):r.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return U(this,Gr,rB).call(this,r),r.join(" ")}newFreeDrawOutline(e,t,r,i,s,a){return new lB(e,t,r,i,s,a)}getOutlines(){var f;const e=m(this,vl),t=m(this,bo),r=m(this,Kt),[i,s,a,o]=m(this,Hs),l=new Float64Array((((f=m(this,dd))==null?void 0:f.length)??0)+2);for(let p=0,h=l.length-2;p<h;
461p+=2)l[p]=(m(this,dd)[p]-i)/a,l[p+1]=(m(this,dd)[p+1]-s)/o;if(l[l.length-2]=(m(this,Bf)-i)/a,l[l.length-1]=(m(this,$f)-s)/o,isNaN(r[6])&&!this.isEmpty())return U(this,Gr,sB).call(this,l);const c=new Float64Array(m(this,vl).length+24+m(this,bo).length);let u=e.length;for(let p=0;p<u;p+=2){if(isNaN(e[p])){c[p]=c[p+1]=NaN;continue}c[p]=e[p],c[p+1]=e[p+1]}u=U(this,Gr,oB).call(this,c,u);for(let p=t.length-6;p>=6;p-=6)for(let h=0;h<6;h+=2){if(isNaN(t[p+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[p+h],c[u+1]=t[p+h+1],u+=2}return U(this,Gr,aB).call(this,c,u),this.newFreeDrawOutline(c,l,m(this,Hs),m(this,Wg),m(this,qg),m(this,Hg))}};Hs=new WeakMap,bo=new WeakMap,qg=new WeakMap,Hg=new WeakMap,vl=new WeakMap,Kt=new WeakMap,Bf=new WeakMap,$f=new WeakMap,cb=new WeakMap,ub=new WeakMap,Wg=new WeakMap,Vg=new WeakMap,dd=new WeakMap,db=new WeakMap,i5=new WeakMap,s5=new WeakMap,Gr=new WeakSet,Xv=function(){const e=m(this,Kt).subarray(4,6),t=m(this,Kt).subarray(16,18),[r,i,s,a]=m(this,Hs);return[(m(this,Bf)+(e[0]-t[0])/2-r)/s,(m(this,$f)+(e[1]-t[1])/2-i)/a,(m(this,Bf)+(t[0]-e[0])/2-r)/s,(m(this,$f)+(t[1]-e[1])/2-i)/a]},nB=function(){const[e,t,r,i]=m(this,Hs),[s,a,o,l]=U(this,Gr,Xv).
vendor: 1,134 bytes, line 461
461call(this);return`M${(m(this,Kt)[2]-e)/r} ${(m(this,Kt)[3]-t)/i} L${(m(this,Kt)[4]-e)/r} ${(m(this,Kt)[5]-t)/i} L${s} ${a} L${o} ${l} L${(m(this,Kt)[16]-e)/r} ${(m(this,Kt)[17]-t)/i} L${(m(this,Kt)[14]-e)/r} ${(m(this,Kt)[15]-t)/i} Z`},rB=function(e){const t=m(this,bo);e.push(`L${t[4]} ${t[5]} Z`)},iB=function(e){const[t,r,i,s]=m(this,Hs),a=m(this,Kt).subarray(4,6),o=m(this,Kt).subarray(16,18),[l,c,u,f]=U(this,Gr,Xv).call(this);e.push(`L${(a[0]-t)/i} ${(a[1]-r)/s} L${l} ${c} L${u} ${f} L${(o[0]-t)/i} ${(o[1]-r)/s}`)},sB=function(e){const t=m(this,Kt),[r,i,s,a]=m(this,Hs),[o,l,c,u]=U(this,Gr,Xv).call(this),f=new Float64Array(36);return f.set([NaN,NaN,NaN,NaN,(t[2]-r)/s,(t[3]-i)/a,NaN,NaN,NaN,NaN,(t[4]-r)/s,(t[5]-i)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(t[16]-r)/s,(t[17]-i)/a,NaN,NaN,NaN,NaN,(t[14]-r)/s,(t[15]-i)/a],0),this.newFreeDrawOutline(f,e,m(this,Hs),m(this,Wg),m(this,qg),m(this,Hg))},aB=function(e,t){const r=m(this,bo);return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],t),t+=6},oB=function(e,t){const r=m(this,Kt).subarray(4,6),i=m(this,Kt).subarray(16,18),[s,a,o,l]=m(this,Hs),[c,u,f,p]=U(this,Gr,Xv).
461call(this);return e.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,f,p,NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/l],t),t+=24},q(dc,db,8),q(dc,i5,2),q(dc,s5,m(dc,db)+m(dc,i5));let j_=dc;var Gg,Uf,Pc,hb,Ws,fb,br,As,Jv,Qv,cB;class lB extends tB{constructor(t,r,i,s,a,o){super();q(this,As);q(this,Gg);q(this,Uf,null);q(this,Pc);q(this,hb);q(this,Ws);q(this,fb);q(this,br);M(this,br,t),M(this,Ws,r),M(this,Gg,i),M(this,fb,s),M(this,Pc,a),M(this,hb,o),U(this,As,cB).call(this,o);const{x:l,y:c,width:u,height:f}=m(this,Uf);for(let p=0,h=t.length;p<h;p+=2)t[p]=(t[p]-l)/u,t[p+1]=(t[p+1]-c)/f;for(let p=0,h=r.length;p<h;p+=2)r[p]=(r[p]-l)/u,r[p+1]=(r[p+1]-c)/f}toSVGPath(){const t=[`M${m(this,br)[4]} ${m(this,br)[5]}`];for(let r=6,i=m(this,br).length;r<i;r+=6){if(isNaN(m(this,br)[r])){t.push(`L${m(this,br)[r+4]} ${m(this,br)[r+5]}`);continue}t.push(`C${m(this,br)[r]} ${m(this,br)[r+1]} ${m(this,br)[r+2]} ${m(this,br)[r+3]} ${m(this,br)[r+4]} ${m(this,br)[r+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,r,i,s],a){const o=i-t,l=s-r;let c,u;switch(a){case 0:c=U(this,As,Jv).call(this,m(this,br),t,s,o,-l),u=U(this,As,Jv).call(this,m(this,Ws),t,s,o,-l);break;case 90:c=U(this,As,Qv).call(this,m(this,br),t,r,o,l),u=U(this,As,Qv).call(this,m(this,Ws),t,r,o,l);break;case 180:c=U(this,As,Jv).call(this,m(this,br),i,r,-o,l),u=U(this,As,Jv).call(this,m(this,Ws),i,r,-o,l);break;case 270:c=U(this,As,Qv).call(this,m(this,br),i,s,-o,-l),u=U(this,As,Qv).call(this,m(this,Ws),i,s,-o,-l);break}return{outline:Array.from(c),points:[Array.from(u)]}}get box(){return m(this,Uf)}newOutliner(t,r,i,s,a,o=0){return new j_(t,r,i,s,a,o)}getNewOutline(t,r){const{x:i,y:s,width:a,height:o}=m(this,Uf),[l,c,u,f]=m(this,Gg),p=a*u,h=o*f,b=i*u+l,g=s*f+c,w=this.newOutliner({x:m(this,Ws)[0]*p+b,y:m(this,Ws)[1]*h+g},m(this,Gg),m(this,fb),t,m(this,hb),r??m(this,Pc));for(let y=2;y<m(this,Ws).length;y+=2)w.add({x:m(this,Ws)[y]*p+b,y:m(this,Ws)[y+1]*h+g});return w.getOutlines()}get mustRemoveSelfIntersections(){return!0}}Gg=new WeakMap,Uf=new WeakMap,Pc=new WeakMap,hb=new WeakMap,Ws=new WeakMap,fb=new WeakMap,br=new WeakMap,As=new WeakSet,Jv=function(t,r,i,s,a){const o=new Float64Array(t.length);for(let l=0,c=t.length;l<c;l+=2)o[l]=r+t[l]*s,o[l+1]=i+t[l+1]*a;return o},Qv=function(t,r,i,s,a){const o=new Float64Array(t.length);for(let l=0,c=t.length;l<c;l+=2)o[l]=r+t[l+1]*s,o[l+1]=i+t[l]*a;return o},cB=function(t){const r=m(this,br);let i=r[4],s=r[5],a=i,o=s,l=i,c=s,u=i,f=s;const p=t?Math.max:Math.min;for(let y=6,x=r.length;y<x;y+=6){if(isNaN(r[y]))a=Math.min(a,r[y+4]),o=Math.min(o,r[y+5]),l=Math.max(l,r[y+4]),c=Math.max(c,r[y+5]),f<r[y+5]?(u=r[y+4],f=r[y+5]):f===r[y+5]&&(u=p(u,r[y+4]));else{const S=ft.bezierBoundingBox(i,s,...r.slice(y,y+6));a=Math.min(a,S[0]),o=Math.min(o,S[1]),l=Math.max(l,S[2]),c=Math.max(c,S[3]),f<S[3]?(u=S[2],f=S[3]):f===S[3]&&(u=p(u,S[2]))}i=r[y+4],s=r[y+5]}const h=a-m(this,Pc),b=o-m(this,Pc),g=l-a+2*m(this,Pc),w=c-o+2*m(this,Pc);M(this,Uf,{x:h,y:b,width:g,height:w,lastPoint:[u,f]})};var pb,hd,wo,as,uB,bx,dB,hB,rC;class nL{constructor(e,t=0,r=0,i=!0){q(this,as);q(this,pb);q(this,hd,[]);q(this,wo,[]);let s=1/0,a=-1/0,o=1/0,l=-1/0;const u=10**-4;for(const{x:y,y:x,width:S,height:A}of e){const C=Math.floor((y-t)/u)*u,T=Math.ceil((y+S+t)/u)*u,R=Math.floor((x-t)/u)*u,I=Math.ceil((x+A+t)/u)*u,L=[C,R,I,!0],V=[T,R,I,!1];m(this,hd).push(L,V),s=Math.min(s,C),a=Math.max(a,T),o=Math.min(o,R),l=Math.max(l,I)}const f=a-s+2*r,p=l-o+2*r,h=s-r,b=o-r,g=m(this,hd).at(i?-1:-2),w=[g[0],g[2]];for(const y of m(this,hd)){const[x,S,A]=y;y[0]=(x-h)/f,y[1]=(S-b)/p,y[2]=(A-b)/p}M(this,pb,{x:h,y:b,width:f,height:p,lastPoint:w})}getOutlines(){m(this,hd).sort((t,r)=>t[0]-r[0]||t[1]-r[1]||t[2]-r[2]);const e=[];for(const t of m(this,hd))t[3]?(e.push(...U(this,as,rC).call(this,t)),U(this,as,dB).call(this,t)):(U(this,as,hB).call(this,t),e.push(...U(this,as,rC).call(this,t)));return U(this,as,uB).call(this,e)}}pb=new WeakMap,hd=new WeakMap,wo=new WeakMap,as=new WeakSet,uB=function(e){const t=[],r=new Set;for(const a of e){const[o,l,c]=a;t.push([o,l,a],[o,c,a])}t.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=t.length;a<o;a+=2){const l=t[a][2],c=t[a+1][2];l.push(c),c.push(l),r.add(l),r.add(c)}const i=[];let s;for(;r.size>0;){const a=r.values().next().value;let[o,l,c,u,f]=a;r.delete(a);let p=o,h=l;for(s=[o,c],i.push(s);;){let b;if(r.has(u))b=u;else if(r.has(f))b=f;else break;r.delete(b),[o,l,c,u,f]=b,p!==o&&(s.push(p,h,o,h===l?l:c),p=o),h=h===l?c:l}s.push(p,h)}return new nse(i,m(this,pb))},bx=function(e){const t=m(this,wo);let r=0,i=t.length-1;for(;r<=i;){const s=r+i>>1,a=t[s][0];if(a===e)return s;a<e?r=s+1:i=s-1}return i+1},dB=function([,e,t]){const r=U(this,as,bx).call(this,e);m(this,wo).splice(r,0,[e,t])},hB=function([,e,t]){const r=U(this,as,bx).call(this,e);for(let i=r;i<m(this,wo).length;i++){const[s,a]=m(this,wo)[i];if(s!==e)break;if(s===e&&a===t){m(this,wo).splice(i,1);return}}for(let i=r-1;i>=0;i--){const[s,a]=m(this,wo)[i];if(s!==e)break;if(s===e&&a===t){m(this,wo).splice(i,1);return}}},rC=function(e){const[t,r,i]=e,s=[[t,r,i]],a=U(this,as,bx).call(this,i);for(let o=0;o<a;o++){const[l,c]=m(this,wo)[o];for(let u=0,f=s.length;u<f;u++){const[,p,h]=s[u];if(!(c<=p||h<=l)){if(p>=l){if(h>c)s[u][1]=c;else{if(f===1)return[];s.splice(u,1),u--,f--}continue}s[u][2]=l,h>c&&s.push([t,c,h])}}}return s};var mb,Kg;class nse extends tB{constructor(t,r){super();q(this,mb);q(this,Kg);M(this,Kg,t),M(this,mb,r)}toSVGPath(){const t=[];for(const r of m(this,Kg)){let[i,s]=r;t.push(`M${i} ${s}`);for(let a=2;a<r.length;a+=2){const o=r[a],l=r[a+1];o===i?(t.push(`V${l}`),s=l):l===s&&(t.push(`H${o}`),i=o)}t.push("Z")}return t.join(" ")}serialize([t,r,i,s],a){const o=[],l=i-t,c=s-r;for(const u of m(this,Kg)){const f=new Array(u.length);for(let p=0;p<u.length;p+=2)f[p]=t+u[p]*l,f[p+1]=s-u[p+1]*c;o.push(f)}return o}get box(){return m(this,mb)}get classNamesForDrawing(){return["highlight"]}get classNamesForOutlining(){return["highlightOutline"]}}mb=new WeakMap,Kg=new WeakMap;class iC extends j_{newFreeDrawOutline(e,t,r,i,s,a){return new rse(e,t,r,i,s,a)}get classNamesForDrawing(){return["highlight","free"]}}class rse extends lB{get classNamesForDrawing(){return["highlight","free"]}get classNamesForOutlining(){return["highlightOutline","free"]}newOutliner(e,t,r,i,s,a=0){return new iC(e,t,r,i,s,a)}}var xo,zf,Yg,zr,gb,Xg,vb,yb,fd,_o,Jg,bb,Sn,sC,aC,oC,Lh,fB,Ru;const ps=class ps{constructor({editor:e=null,uiManager:t=null}){q(this,Sn);q(this,xo,null);q(this,zf,null);q(this,Yg);q(this,zr,null);q(this,gb,!1);q(this,Xg,!1);q(this,vb,null);q(this,yb);q(this,fd,null);q(this,_o,null);q(this,Jg);var r;e?(M(this,Xg,!1),M(this,Jg,jt.HIGHLIGHT_COLOR),M(this,vb,e)):(M(this,Xg,!0),M(this,Jg,jt.HIGHLIGHT_DEFAULT_COLOR)),M(this,_o,(e==null?void 0:e._uiManager)||t),M(this,yb,m(this,_o)._eventBus),M(this,Yg,(e==null?void 0:e.color)||((r=m(this,_o))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98"),m(ps,bb)||M(ps,bb,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return tn(this,"_keyboardManager",new Ub([[["Escape","mac+Escape"],ps.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ps.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ps.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ps.prototype._moveToPrevious],[["Home","mac+Home"],ps.prototype._moveToBeginning],[["End","mac+End"],ps.prototype._moveToEnd]]))}renderButton(){const e=M(this,xo,document.createElement("button"));
461e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const t=m(this,_o)._signal;e.addEventListener("click",U(this,Sn,Lh).bind(this),{signal:t}),e.addEventListener("keydown",U(this,Sn,oC).bind(this),{signal:t});const r=M(this,zf,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=m(this,Yg),e.append(r),e}renderMainDropdown(){const e=M(this,zr,U(this,Sn,sC).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===m(this,xo)){U(this,Sn,Lh).call(this,e);return}const t=e.target.getAttribute("data-color");t&&U(this,Sn,aC).call(this,t,e)}_moveToNext(e){var t,r;if(!m(this,Sn,Ru)){U(this,Sn,Lh).call(this,e);return}if(e.target===m(this,xo)){(t=m(this,zr).firstChild)==null||t.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var t,r;if(e.target===((t=m(this,zr))==null?void 0:t.firstChild)||e.target===m(this,xo)){m(this,Sn,Ru)&&this._hideDropdownFromKeyboard();return}m(this,Sn,Ru)||U(this,Sn,Lh).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var t;if(!m(this,Sn,Ru)){U(this,Sn,Lh).call(this,e);return}(t=m(this,zr).firstChild)==null||t.focus()}_moveToEnd(e){var t;if(!m(this,Sn,Ru)){U(this,Sn,Lh).call(this,e);return}(t=m(this,zr).lastChild)==null||t.focus()}hideDropdown(){var e,t;(e=m(this,zr))==null||e.classList.add("hidden"),(t=m(this,fd))==null||t.abort(),M(this,fd,null)}_hideDropdownFromKeyboard(){var e;if(!m(this,Xg)){if(!m(this,Sn,Ru)){(e=m(this,vb))==null||e.unselect();return}this.hideDropdown(),m(this,xo).focus({preventScroll:!0,focusVisible:m(this,gb)})}}updateColor(e){if(m(this,zf)&&(m(this,zf).style.backgroundColor=e),!m(this,zr))return;const t=m(this,_o).highlightColors.values();for(const r of m(this,zr).children)r.setAttribute("aria-selected",t.next().value===e)}destroy(){var e,t;(e=m(this,xo))==null||e.remove(),M(this,xo,null),M(this,zf,null),(t=m(this,zr))==null||t.remove(),M(this,zr,null)}};xo=new WeakMap,zf=new WeakMap,Yg=new WeakMap,zr=new WeakMap,gb=new WeakMap,Xg=new WeakMap,vb=new WeakMap,yb=new WeakMap,fd=new WeakMap,_o=new WeakMap,Jg=new WeakMap,bb=new WeakMap,Sn=new WeakSet,sC=function(){const e=document.createElement("div"),t=m(this,_o)._signal;e.addEventListener("contextmenu",$a,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,i]of m(this,_o).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",i),s.title=r,s.setAttribute("data-l10n-id",m(ps,bb)[r]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=i,s.setAttribute("aria-selected",i===m(this,Yg)),s.addEventListener("click",U(this,Sn,aC).bind(this,i),{signal:t}),e.append(s)}return e.addEventListener("keydown",U(this,Sn,oC).bind(this),{signal:t}),e},aC=function(e,t){t.stopPropagation(),m(this,yb).dispatch("switchannotationeditorparams",{source:this,type:m(this,Jg),value:e})},oC=function(e){ps._keyboardManager.exec(this,e)},Lh=function(e){if(m(this,Sn,Ru)){this.hideDropdown();return}if(M(this,gb,e.detail===0),m(this,fd)||(M(this,fd,new AbortController),window.addEventListener("pointerdown",U(this,Sn,fB).bind(this),{signal:m(this,_o).combinedSignal(m(this,fd))})),m(this,zr)){m(this,zr).classList.remove("hidden");return}const t=M(this,zr,U(this,Sn,sC).call(this));m(this,xo).append(t)},fB=function(e){var t;(t=m(this,zr))!=null&&t.contains(e.target)||this.hideDropdown()},Ru=function(){return m(this,zr)&&!m(this,zr).classList.contains("hidden")},q(ps,bb,null);let R_=ps;var Qg,wb,jc,qf,Zg,xa,xb,_b,Hf,So,Bi,vs,e0,Rc,qr,t0,_a,Sb,$t,lC,wx,pB,mB,gB,cC,Ih,Ta,mm,vB,xx,Zv,yB,bB,wB,xB,_B;const dn=class dn extends bn{constructor(t){super({...t,name:"highlightEditor"});q(this,$t);q(this,Qg,null);q(this,wb,0);q(this,jc);q(this,qf,null);q(this,Zg,null);q(this,xa,null);q(this,xb,null);q(this,_b,0);q(this,Hf,null);q(this,So,null);q(this,Bi,null);q(this,vs,!1);q(this,e0,null);q(this,Rc);q(this,qr,null);q(this,t0,"");q(this,_a);q(this,Sb,"");this.color=t.color||dn._defaultColor,M(this,_a,t.thickness||dn._defaultThickness),M(this,Rc,t.opacity||dn._defaultOpacity),M(this,jc,t.boxes||null),M(this,Sb,t.methodOfCreation||""),M(this,t0,t.text||""),this._isDraggable=!1,t.highlightId>
461-1?(M(this,vs,!0),U(this,$t,wx).call(this,t),U(this,$t,Ih).call(this)):m(this,jc)&&(M(this,Qg,t.anchorNode),M(this,wb,t.anchorOffset),M(this,xb,t.focusNode),M(this,_b,t.focusOffset),U(this,$t,lC).call(this),U(this,$t,Ih).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const t=dn.prototype;return tn(this,"_keyboardManager",new Ub([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:m(this,vs)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:m(this,_a),methodOfCreation:m(this,Sb)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,r){var i;bn.initialize(t,r),dn._defaultColor||(dn._defaultColor=((i=r.highlightColors)==null?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,r){switch(t){case jt.HIGHLIGHT_DEFAULT_COLOR:dn._defaultColor=r;break;case jt.HIGHLIGHT_THICKNESS:dn._defaultThickness=r;break}}translateInPage(t,r){}get toolbarPosition(){return m(this,e0)}updateParams(t,r){switch(t){case jt.HIGHLIGHT_COLOR:U(this,$t,pB).call(this,r);break;case jt.HIGHLIGHT_THICKNESS:U(this,$t,mB).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[jt.HIGHLIGHT_DEFAULT_COLOR,dn._defaultColor],[jt.HIGHLIGHT_THICKNESS,dn._defaultThickness]]}get propertiesToUpdate(){return[[jt.HIGHLIGHT_COLOR,this.color||dn._defaultColor],[jt.HIGHLIGHT_THICKNESS,m(this,_a)||dn._defaultThickness],[jt.HIGHLIGHT_FREE,m(this,vs)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(M(this,Zg,new R_({editor:this})),t.addColorPicker(m(this,Zg))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(U(this,$t,Zv).call(this))}getBaseTranslation(){return[0,0]}getRect(t,r){return super.getRect(t,r,U(this,$t,Zv).call(this))}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){U(this,$t,cC).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(U(this,$t,Ih).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var i;let r=!1;this.parent&&!t?U(this,$t,cC).call(this):t&&(U(this,$t,Ih).call(this,t),r=!this.parent&&((i=this.div)==null?void 0:i.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),r&&this.select()}rotate(t){var s,a,o;const{drawLayer:r}=this.parent;let i;m(this,vs)?(t=(t-this.rotation+360)%360,i=U(s=dn,Ta,mm).call(s,m(this,So).box,t)):i=U(a=dn,Ta,mm).call(a,this,t),r.rotate(m(this,Bi),t),r.rotate(m(this,qr),t),r.updateBox(m(this,Bi),i),r.updateBox(m(this,qr),U(o=dn,Ta,mm).call(o,m(this,xa).box,t))}render(){if(this.div)return this.div;const t=super.render();m(this,t0)&&(t.setAttribute("aria-label",m(this,t0)),t.setAttribute("role","mark")),m(this,vs)?t.classList.add("free"):this.div.addEventListener("keydown",U(this,$t,vB).bind(this),{signal:this._uiManager._signal});const r=M(this,Hf,document.createElement("div"));t.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=m(this,qf);const[i,s]=this.parentDimensions;return this.setDims(this.width*i,this.height*s),T_(this,m(this,Hf),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent.drawLayer.addClass(m(this,qr),"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(m(this,qr),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:U(this,$t,xx).call(this,!0);break;case 1:case 3:U(this,$t,xx).call(this,!1);break}}select(){var t,r;super.select(),m(this,qr)&&((t=this.parent)==null||t.drawLayer.removeClass(m(this,qr),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(m(this,qr),"selected"))}unselect(){var t;super.unselect(),m(this,qr)&&((t=this.parent)==null||t.drawLayer.removeClass(m(this,qr),"selected"),m(this,vs)||U(this,$t,xx).call(this,!1))}get _mustFixPosition(){return!m(this,vs)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(m(this,Bi),t),this.parent.drawLayer.show(m(this,qr),t))}static startHighlighting(t,r,{target:i,x:s,y:a}){const{x:o,y:l,width:c,height:u}=i.getBoundingClientRect(),f=new AbortController,p=t.combinedSignal(f),h=g=>{g.preventDefault(),g.stopPropagation()},b=g=>{f.abort(),U(this,Ta,xB).call(this,t,g)};window.addEventListener("blur",b,{signal:p}),window.addEventListener("pointerup",b,{signal:p}),window.addEventListener("pointerdown",h,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",$a,{signal:p}),i.addEventListener("pointermove",U(this,Ta,wB).bind(this,t),{signal:p}),this._freeHighlight=new iC({x:s,y:a},[o,l,c,u],t.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static async deserialize(t,r,i){var g,w,y,x;let s=null;if(t instanceof G7){const{data:{quadPoints:S,rect:A,rotation:C,id:T,color:R,opacity:I,popupRef:L},parent:{page:{pageNumber:V}}}=t;s=t={annotationType:Ht.HIGHLIGHT,color:Array.from(R),opacity:I,quadPoints:S,boxes:null,pageIndex:V-1,rect:A.slice(0),rotation:C,id:T,deleted:!1,popupRef:L}}else if(t instanceof GT){const{data:{inkLists:S,rect:A,rotation:C,id:T,color:R,borderStyle:{rawWidth:I},popupRef:L},parent:{page:{pageNumber:V}}}=t;s=t={annotationType:Ht.HIGHLIGHT,color:Array.from(R),thickness:I,inkLists:S,boxes:null,pageIndex:V-1,rect:A.slice(0),rotation:C,id:T,deleted:!1,popupRef:L}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=t,u=await super.deserialize(t,r,i);u.color=ft.makeHexColor(...a),M(u,Rc,c||1),l&&M(u,_a,t.thickness),u.annotationElementId=t.id||null,u._initialData=s;const[f,p]=u.pageDimensions,[h,b]=u.pageTranslation;if(o){const S=M(u,jc,[]);for(let A=0;A<o.length;A+=8)S.push({x:(o[A]-h)/f,y:1-(o[A+1]-b)/p,width:(o[A+2]-o[A])/f,height:(o[A+1]-o[A+5])/p});U(g=u,$t,lC).call(g),U(w=u,$t,Ih).call(w),u.rotate(u.rotation)}else if(l){M(u,vs,!0);const S=l[0],A={x:S[0]-h,y:p-(S[1]-b)},C=new iC(A,[0,0,f,p],1,m(u,_a)/2,!0,.001);for(let I=0,L=S.length;I<L;I+=2)A.x=S[I]-h,A.y=p-(S[I+1]-b),C.add(A);const{id:T,clipPathId:R}=r.drawLayer.draw(C,u.color,u._defaultOpacity,!0);U(y=u,$t,wx).call(y,{highlightOutlines:C.getOutlines(),highlightId:T,clipPathId:R}),U(x=u,$t,Ih).call(x)}return u}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const r=this.getRect(0,0),i=bn._colorManager.convert(this.color),s={annotationType:Ht.HIGHLIGHT,color:i,opacity:m(this,Rc),thickness:m(this,_a),quadPoints:U(this,$t,yB).call(this),outlines:U(this,$t,bB).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:U(this,$t,Zv).call(this),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!U(this,$t,_B).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};Qg=new WeakMap,wb=new WeakMap,jc=new WeakMap,qf=new WeakMap,Zg=new WeakMap,xa=new WeakMap,xb=new WeakMap,_b=new WeakMap,Hf=new WeakMap,So=new WeakMap,Bi=new WeakMap,vs=new WeakMap,e0=new WeakMap,Rc=new WeakMap,qr=new WeakMap,t0=new WeakMap,_a=new WeakMap,Sb=new WeakMap,$t=new WeakSet,lC=function(){const t=new nL(m(this,jc),.001);M(this,So,t.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}
461=m(this,So).box;const r=new nL(m(this,jc),.0025,.001,this._uiManager.direction==="ltr");M(this,xa,r.getOutlines());const{lastPoint:i}=m(this,xa).box;M(this,e0,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},wx=function({highlightOutlines:t,highlightId:r,clipPathId:i}){var f,p;if(M(this,So,t),M(this,xa,t.getNewOutline(m(this,_a)/2+1.5,.0025)),r>=0)M(this,Bi,r),M(this,qf,i),this.parent.drawLayer.finalizeLine(r,t),M(this,qr,this.parent.drawLayer.drawOutline(m(this,xa)));else if(this.parent){const h=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(m(this,Bi),t),this.parent.drawLayer.updateBox(m(this,Bi),U(f=dn,Ta,mm).call(f,m(this,So).box,(h-this.rotation+360)%360)),this.parent.drawLayer.updateLine(m(this,qr),m(this,xa)),this.parent.drawLayer.updateBox(m(this,qr),U(p=dn,Ta,mm).call(p,m(this,xa).box,h))}const{x:a,y:o,width:l,height:c}=t.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[h,b]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*b/h,this.height=c*h/b;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[h,b]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*b/h,this.height=c*h/b;break}}const{lastPoint:u}=m(this,xa).box;M(this,e0,[(u[0]-a)/l,(u[1]-o)/c])},pB=function(t){const r=(a,o)=>{var l,c,u;this.color=a,(l=this.parent)==null||l.drawLayer.changeColor(m(this,Bi),a),(c=m(this,Zg))==null||c.updateColor(a),M(this,Rc,o),(u=this.parent)==null||u.drawLayer.changeOpacity(m(this,Bi),o)},i=this.color,s=m(this,Rc);this.addCommands({cmd:r.bind(this,t,dn._defaultOpacity),undo:r.bind(this,i,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},mB=function(t){const r=m(this,_a),i=s=>{M(this,_a,s),U(this,$t,gB).call(this,s)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},gB=function(t){if(!m(this,vs))return;U(this,$t,wx).call(this,{highlightOutlines:m(this,So).getNewOutline(t/2)}),this.fixAndSetPosition();const[r,i]=this.parentDimensions;this.setDims(this.width*r,this.height*i)},cC=function(){m(this,Bi)===null||!this.parent||(this.parent.drawLayer.remove(m(this,Bi)),M(this,Bi,null),this.parent.drawLayer.remove(m(this,qr)),M(this,qr,null))},Ih=function(t=this.parent){m(this,Bi)===null&&({id:Xr(this,Bi)._,clipPathId:Xr(this,qf)._}=t.drawLayer.draw(m(this,So),this.color,m(this,Rc)),M(this,qr,t.drawLayer.drawOutline(m(this,xa))),m(this,Hf)&&(m(this,Hf).style.clipPath=m(this,qf)))},Ta=new WeakSet,mm=function({x:t,y:r,width:i,height:s},a){switch(a){case 90:return{x:1-r-s,y:t,width:s,height:i};case 180:return{x:1-t-i,y:1-r-s,width:i,height:s};case 270:return{x:r,y:1-t-i,width:s,height:i}}return{x:t,y:r,width:i,height:s}},vB=function(t){dn._keyboardManager.exec(this,t)},xx=function(t){if(!m(this,Qg))return;const r=window.getSelection();t?r.setPosition(m(this,Qg),m(this,wb)):r.setPosition(m(this,xb),m(this,_b))},Zv=function(){return m(this,vs)?this.rotation:0},yB=function(){if(m(this,vs))return null;const[t,r]=this.pageDimensions,[i,s]=this.pageTranslation,a=m(this,jc),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:u,width:f,height:p}of a){const h=c*t+i,b=(1-u-p)*r+s;o[l]=o[l+4]=h,o[l+1]=o[l+3]=b,o[l+2]=o[l+6]=h+f*t,o[l+5]=o[l+7]=b+p*r,l+=8}return o},bB=function(t){return m(this,So).serialize(t,U(this,$t,Zv).call(this))},wB=function(t,r){this._freeHighlight.add(r)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},xB=function(t,r){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},_B=function(t){const{color:r}=this._initialData;return t.color.some((i,s)=>i!==r[s])},q(dn,Ta),Ue(dn,"_defaultColor",null),Ue(dn,"_defaultOpacity",1),Ue(dn,"_defaultThickness",12),Ue(dn,"_type","highlight"),Ue(dn,"_editorType",Ht.HIGHLIGHT),Ue(dn,"_freeHighlightId",-1),Ue(dn,"_freeHighlight",null),Ue(dn,"_freeHighlightClipId","");let L_=dn;var Wf,Vf,yl,Lc,Sa,Gf,Kf,Yf,Ic,n0,Xf,Jf,pd,Be,SB,AB,EB,NB,dC,kB,hC,CB,TB,PB,jB,RB,Oh,fC,pC,mC,_x,Sx,gm,gC,Ax,tu,LB,vC,IB,OB,yC,Ex,e1;const Jn=class Jn extends bn{constructor(t){super({...t,name:"inkEditor"});q(this,Be);q(this,Wf,0);q(this,Vf,0);q(this,yl,null);q(this,Lc,new Path2D);q(this,Sa,!1);q(this,Gf,null);q(this,Kf,!1);q(this,Yf,!1);q(this,Ic,null);q(this,n0,null);q(this,Xf,0);q(this,Jf,0);q(this,pd,null);this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,r){bn.initialize(t,r)}static updateDefaultParams(t,r){switch(t){case jt.INK_THICKNESS:Jn._defaultThickness=r;break;case jt.INK_COLOR:Jn._defaultColor=r;break;case jt.INK_OPACITY:Jn._defaultOpacity=r/100;break}}updateParams(t,r){switch(t){case jt.INK_THICKNESS:U(this,Be,SB).call(this,r);break;case jt.INK_COLOR:U(this,Be,AB).call(this,r);break;case jt.INK_OPACITY:U(this,Be,EB).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[jt.INK_THICKNESS,Jn._defaultThickness],[jt.INK_COLOR,Jn._defaultColor||bn._defaultLineColor],[jt.INK_OPACITY,Math.round(Jn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[jt.INK_THICKNESS,this.thickness||Jn._defaultThickness],[jt.INK_COLOR,this.color||Jn._defaultColor||bn._defaultLineColor],[jt.INK_OPACITY,Math.round(100*(this.opacity??Jn._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(U(this,Be,_x).call(this),U(this,Be,Sx).call(this)),this.isAttachedToDOM||(this.parent.add(this),U(this,Be,gm).call(this)),U(this,Be,e1).call(this)))}remove(){var t;this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,m(this,yl)&&(clearTimeout(m(this,yl)),M(this,yl,null)),(t=m(this,Ic))==null||t.disconnect(),M(this,Ic,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&t===null&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,r]=this.parentDimensions,i=this.width*t,s=this.height*r;this.setDimensions(i,s)}enableEditMode(){m(this,Sa)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,U(this,Be,fC).call(this))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),U(this,Be,pC).call(this))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){m(this,Sa)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),M(this,Sa,!0),this.div.classList.add("disabled"),U(this,Be,e1).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){t.button!==0||!this.isInEditMode()||m(this,Sa)||(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),U(this,Be,kB).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),U(this,Be,hC).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),U(this,Be,mC).call(this,t)}canvasPointerleave(t){U(this,Be,mC).call(this,t)}get isResizable(){return!this.isEmpty()&&m(this,Sa)}
461render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,s,a,o]=U(this,Be,NB).call(this);if(this.setAt(i,s,0,0),this.setDims(a,o),U(this,Be,_x).call(this),this.width){const[l,c]=this.parentDimensions;this.setAspectRatio(this.width*l,this.height*c),this.setAt(t*l,r*c,this.width*l,this.height*c),M(this,Yf,!0),U(this,Be,gm).call(this),this.setDims(this.width*l,this.height*c),U(this,Be,Oh).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return U(this,Be,Sx).call(this),this.div}setDimensions(t,r){const i=Math.round(t),s=Math.round(r);if(m(this,Xf)===i&&m(this,Jf)===s)return;M(this,Xf,i),M(this,Jf,s),this.canvas.style.visibility="hidden";const[a,o]=this.parentDimensions;this.width=t/a,this.height=r/o,this.fixAndSetPosition(),m(this,Sa)&&U(this,Be,gC).call(this,t,r),U(this,Be,gm).call(this),U(this,Be,Oh).call(this),this.canvas.style.visibility="visible",this.fixDims()}static async deserialize(t,r,i){var w,y,x;if(t instanceof GT)return null;const s=await super.deserialize(t,r,i);s.thickness=t.thickness,s.color=ft.makeHexColor(...t.color),s.opacity=t.opacity;const[a,o]=s.pageDimensions,l=s.width*a,c=s.height*o,u=s.parentScale,f=t.thickness/2;M(s,Sa,!0),M(s,Xf,Math.round(l)),M(s,Jf,Math.round(c));const{paths:p,rect:h,rotation:b}=t;for(let{bezier:S}of p){S=U(w=Jn,tu,IB).call(w,S,h,b);const A=[];s.paths.push(A);let C=u*(S[0]-f),T=u*(S[1]-f);for(let I=2,L=S.length;I<L;I+=6){const V=u*(S[I]-f),j=u*(S[I+1]-f),$=u*(S[I+2]-f),J=u*(S[I+3]-f),H=u*(S[I+4]-f),le=u*(S[I+5]-f);A.push([[C,T],[V,j],[$,J],[H,le]]),C=H,T=le}const R=U(this,tu,LB).call(this,A);s.bezierPath2D.push(R)}const g=U(y=s,Be,yC).call(y);return M(s,Vf,Math.max(bn.MIN_SIZE,g[2]-g[0])),M(s,Wf,Math.max(bn.MIN_SIZE,g[3]-g[1])),U(x=s,Be,gC).call(x,l,c),s}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),r=bn._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Ht.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:U(this,Be,OB).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};Wf=new WeakMap,Vf=new WeakMap,yl=new WeakMap,Lc=new WeakMap,Sa=new WeakMap,Gf=new WeakMap,Kf=new WeakMap,Yf=new WeakMap,Ic=new WeakMap,n0=new WeakMap,Xf=new WeakMap,Jf=new WeakMap,pd=new WeakMap,Be=new WeakSet,SB=function(t){const r=s=>{this.thickness=s,U(this,Be,e1).call(this)},i=this.thickness;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},AB=function(t){const r=s=>{this.color=s,U(this,Be,Oh).call(this)},i=this.color;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},EB=function(t){const r=s=>{this.opacity=s,U(this,Be,Oh).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:jt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},NB=function(){const{parentRotation:t,parentDimensions:[r,i]}=this;switch(t){case 90:return[0,i,i,r];case 180:return[r,i,r,i];case 270:return[r,0,i,r];default:return[0,0,r,i]}},dC=function(){const{ctx:t,color:r,opacity:i,thickness:s,parentScale:a,scaleFactor:o}=this;t.lineWidth=s*a/o,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${r}${Ere(i)}`},kB=function(t,r){this.canvas.addEventListener("contextmenu",$a,{signal:this._uiManager._signal}),U(this,Be,pC).call(this),M(this,Gf,new AbortController);const i=this._uiManager.combinedSignal(m(this,Gf));this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,m(this,Yf)||(M(this,Yf,!0),U(this,Be,gm).call(this),this.thickness||(this.thickness=Jn._defaultThickness),this.color||(this.color=Jn._defaultColor||bn._defaultLineColor),this.opacity??(this.opacity=Jn._defaultOpacity)),this.currentPath.push([t,r]),M(this,Kf,!1),U(this,Be,dC).call(this),M(this,pd,()=>{U(this,Be,PB).call(this),m(this,pd)&&window.requestAnimationFrame(m(this,pd))}),window.requestAnimationFrame(m(this,pd))},hC=function(t,r){const[i,s]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&r===s)return;const a=this.currentPath;let o=m(this,Lc);if(a.push([t,r]),M(this,Kf,!0),a.length<=2){o.moveTo(...a[0]),o.lineTo(t,r);return}a.length===3&&(M(this,Lc,o=new Path2D),o.moveTo(...a[0])),U(this,Be,jB).call(this,o,...a.at(-3),...a.at(-2),t,r)},CB=function(){if(this.currentPath.length===0)return;const t=this.currentPath.at(-1);m(this,Lc).lineTo(...t)},TB=function(t,r){M(this,pd,null),t=Math.min(Math.max(t,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),U(this,Be,hC).call(this,t,r),U(this,Be,CB).call(this);let i;if(this.currentPath.length!==1)i=U(this,Be,RB).call(this);else{const c=[t,r];i=[[c,c.slice(),c.slice(),c]]}const s=m(this,Lc),a=this.currentPath;this.currentPath=[],M(this,Lc,new Path2D);const o=()=>{this.allRawPaths.push(a),this.paths.push(i),this.bezierPath2D.push(s),this._uiManager.rebuild(this)},l=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(U(this,Be,_x).call(this),U(this,Be,Sx).call(this)),U(this,Be,e1).call(this))};this.addCommands({cmd:o,undo:l,mustExec:!0})},PB=function(){if(!m(this,Kf))return;M(this,Kf,!1);const t=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),i=r.map(o=>o[0]),s=r.map(o=>o[1]);Math.min(...i)-t,Math.max(...i)+t,Math.min(...s)-t,Math.max(...s)+t;const{ctx:a}=this;a.save(),a.clearRect(0,0,this.canvas.width,this.canvas.height);for(const o of this.bezierPath2D)a.stroke(o);
461a.stroke(m(this,Lc)),a.restore()},jB=function(t,r,i,s,a,o,l){const c=(r+s)/2,u=(i+a)/2,f=(s+o)/2,p=(a+l)/2;t.bezierCurveTo(c+2*(s-c)/3,u+2*(a-u)/3,f+2*(s-f)/3,p+2*(a-p)/3,f,p)},RB=function(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const r=[];let i,[s,a]=t[0];for(i=1;i<t.length-2;i++){const[h,b]=t[i],[g,w]=t[i+1],y=(h+g)/2,x=(b+w)/2,S=[s+2*(h-s)/3,a+2*(b-a)/3],A=[y+2*(h-y)/3,x+2*(b-x)/3];r.push([[s,a],S,A,[y,x]]),[s,a]=[y,x]}const[o,l]=t[i],[c,u]=t[i+1],f=[s+2*(o-s)/3,a+2*(l-a)/3],p=[c+2*(o-c)/3,u+2*(l-u)/3];return r.push([[s,a],f,p,[c,u]]),r},Oh=function(){if(this.isEmpty()){U(this,Be,Ax).call(this);return}U(this,Be,dC).call(this);const{canvas:t,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.width,t.height),U(this,Be,Ax).call(this);for(const i of this.bezierPath2D)r.stroke(i)},fC=function(){if(m(this,n0))return;M(this,n0,new AbortController);const t=this._uiManager.combinedSignal(m(this,n0));this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:t})},pC=function(){var t;(t=this.pointerdownAC)==null||t.abort(),this.pointerdownAC=null},mC=function(t){var r;(r=m(this,Gf))==null||r.abort(),M(this,Gf,null),U(this,Be,fC).call(this),m(this,yl)&&clearTimeout(m(this,yl)),M(this,yl,setTimeout(()=>{M(this,yl,null),this.canvas.removeEventListener("contextmenu",$a)},10)),U(this,Be,TB).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()},_x=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Sx=function(){M(this,Ic,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),m(this,Ic).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=m(this,Ic))==null||t.disconnect(),M(this,Ic,null)},{once:!0})},gm=function(){if(!m(this,Yf))return;const[t,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*r),U(this,Be,Ax).call(this)},gC=function(t,r){const i=U(this,Be,Ex).call(this),s=(t-i)/m(this,Vf),a=(r-i)/m(this,Wf);this.scaleFactor=Math.min(s,a)},Ax=function(){const t=U(this,Be,Ex).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)},tu=new WeakSet,LB=function(t){const r=new Path2D;for(let i=0,s=t.length;i<s;i++){const[a,o,l,c]=t[i];i===0&&r.moveTo(...a),r.bezierCurveTo(o[0],o[1],l[0],l[1],c[0],c[1])}return r},vC=function(t,r,i){const[s,a,o,l]=r;switch(i){case 0:for(let c=0,u=t.length;c<u;c+=2)t[c]+=s,t[c+1]=l-t[c+1];break;case 90:for(let c=0,u=t.length;c<u;c+=2){const f=t[c];t[c]=t[c+1]+s,t[c+1]=f+a}break;case 180:for(let c=0,u=t.length;c<u;c+=2)t[c]=o-t[c],t[c+1]+=a;break;case 270:for(let c=0,u=t.length;c<u;c+=2){const f=t[c];t[c]=o-t[c+1],t[c+1]=l-f}break;default:throw new Error("Invalid rotation")}return t},IB=function(t,r,i){const[s,a,o,l]=r;switch(i){case 0:for(let c=0,u=t.length;c<u;c+=2)t[c]-=s,t[c+1]=l-t[c+1];break;case 90:for(let c=0,u=t.length;c<u;c+=2){const f=t[c];t[c]=t[c+1]-a,t[c+1]=f-s}break;case 180:for(let c=0,u=t.length;c<u;c+=2)t[c]=o-t[c],t[c+1]-=a;break;case 270:for(let c=0,u=t.length;c<u;c+=2){const f=t[c];t[c]=l-t[c+1],t[c+1]=o-f}break;default:throw new Error("Invalid rotation")}return t},OB=function(t,r,i,s){var u,f;const a=[],o=this.thickness/2,l=t*r+o,c=t*i+o;for(const p of this.paths){const h=[],b=[];for(let g=0,w=p.length;g<w;g++){const[y,x,S,A]=p[g];if(y[0]===A[0]&&y[1]===A[1]&&w===1){const J=t*y[0]+l,H=t*y[1]+c;h.push(J,H),b.push(J,H);break}const C=t*y[0]+l,T=t*y[1]+c,R=t*x[0]+l,I=t*x[1]+c,L=t*S[0]+l,V=t*S[1]+c,j=t*A[0]+l,$=t*A[1]+c;g===0&&(h.push(C,T),b.push(C,T)),h.push(R,I,L,V,j,$),b.push(R,I),g===w-1&&b.push(j,$)}a.push({bezier:U(u=Jn,tu,vC).call(u,h,s,this.rotation),points:U(f=Jn,tu,vC).call(f,b,s,this.rotation)})}return a},yC=function(){let t=1/0,r=-1/0,i=1/0,s=-1/0;for(const a of this.paths)for(const[o,l,c,u]of a){const f=ft.bezierBoundingBox(...o,...l,...c,...u);t=Math.min(t,f[0]),i=Math.min(i,f[1]),r=Math.max(r,f[2]),s=Math.max(s,f[3])}return[t,i,r,s]},Ex=function(){return m(this,Sa)?Math.ceil(this.thickness*this.parentScale):0},e1=function(t=!1){if(this.isEmpty())return;if(!m(this,Sa)){U(this,Be,Oh).call(this);return}const r=U(this,Be,yC).call(this),i=U(this,Be,Ex).call(this);M(this,Vf,Math.max(bn.MIN_SIZE,r[2]-r[0])),M(this,Wf,Math.max(bn.MIN_SIZE,r[3]-r[1]));const s=Math.ceil(i+m(this,Vf)*this.scaleFactor),a=Math.ceil(i+m(this,Wf)*this.scaleFactor),[o,l]=this.parentDimensions;this.width=s/o,this.height=a/l,this.setAspectRatio(s,a);const c=this.translationX,u=this.translationY;this.translationX=-r[0],this.translationY=-r[1],U(this,Be,gm).call(this),U(this,Be,Oh).call(this),M(this,Xf,s),M(this,Jf,a),this.setDims(s,a);const f=t?i/this.scaleFactor/2:0;this.translate(c-this.translationX-f,u-this.translationY-f)},q(Jn,tu),Ue(Jn,"_defaultColor",null),Ue(Jn,"_defaultOpacity",1),Ue(Jn,"_defaultThickness",1),Ue(Jn,"_type","ink"),Ue(Jn,"_editorType",Ht.INK);let uC=Jn;var Zn,xi,md,Oc,gd,r0,bl,Mc,wl,Vs,i0,Qt,t1,n1,Nx,wC,MB,kx,xC,Cx,DB,FB;const S1=class S1 extends bn{constructor(t){super({...t,name:"stampEditor"});q(this,Qt);q(this,Zn,null);q(this,xi,null);q(this,md,null);q(this,Oc,null);q(this,gd,null);q(this,r0,"");q(this,bl,null);q(this,Mc,null);q(this,wl,null);q(this,Vs,!1);q(this,i0,!1);M(this,Oc,t.bitmapUrl),M(this,gd,t.bitmapFile)}static initialize(t,r){bn.initialize(t,r)}static get supportedTypes(){return tn(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(r=>`image/${r}`))}static get supportedTypesStr(){return tn(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,r){r.pasteEditor(Ht.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const r=t.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(t=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:a,height:o}=t||this.copyCanvas(null,null,!0).imageData,l=await i.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),r&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var t,r;m(this,xi)&&(M(this,Zn,null),this._uiManager.imageManager.deleteId(m(this,xi)),(t=m(this,bl))==null||t.remove(),M(this,bl,null),(r=m(this,Mc))==null||r.disconnect(),M(this,Mc,null),m(this,wl)&&(clearTimeout(m(this,wl)),M(this,wl,null))),super.remove()}rebuild(){if(!this.parent){m(this,xi)&&U(this,Qt,Nx).call(this);return}super.rebuild(),this.div!==null&&(m(this,xi)&&m(this,bl)===null&&U(this,Qt,Nx).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(m(this,md)||m(this,Zn)||m(this,Oc)||m(this,gd)||m(this,xi))}get isResizable(){return!0}
vendor: 5,469 bytes, line 461
461render(){if(this.div)return this.div;let t,r;if(this.width&&(t=this.x,r=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),m(this,Zn)?U(this,Qt,wC).call(this):U(this,Qt,Nx).call(this),this.width&&!this.annotationElementId){const[i,s]=this.parentDimensions;this.setAt(t*i,r*s,this.width*i,this.height*s)}return this.div}copyCanvas(t,r,i=!1){var h;t||(t=224);const{width:s,height:a}=m(this,Zn),o=new mk;let l=m(this,Zn),c=s,u=a,f=null;if(r){if(s>r||a>r){const I=Math.min(r/s,r/a);c=Math.floor(s*I),u=Math.floor(a*I)}f=document.createElement("canvas");const b=f.width=Math.ceil(c*o.sx),g=f.height=Math.ceil(u*o.sy);m(this,Vs)||(l=U(this,Qt,kx).call(this,b,g));const w=f.getContext("2d");w.filter=this._uiManager.hcmFilter;let y="white",x="#cfcfd8";this._uiManager.hcmFilter!=="none"?x="black":(h=window.matchMedia)!=null&&h.call(window,"(prefers-color-scheme: dark)").matches&&(y="#8f8f9d",x="#42414d");const S=15,A=S*o.sx,C=S*o.sy,T=new OffscreenCanvas(A*2,C*2),R=T.getContext("2d");R.fillStyle=y,R.fillRect(0,0,A*2,C*2),R.fillStyle=x,R.fillRect(0,0,A,C),R.fillRect(A,C,A,C),w.fillStyle=w.createPattern(T,"repeat"),w.fillRect(0,0,b,g),w.drawImage(l,0,0,l.width,l.height,0,0,b,g)}let p=null;if(i){let b,g;if(o.symmetric&&l.width<t&&l.height<t)b=l.width,g=l.height;else if(l=m(this,Zn),s>t||a>t){const x=Math.min(t/s,t/a);b=Math.floor(s*x),g=Math.floor(a*x),m(this,Vs)||(l=U(this,Qt,kx).call(this,b,g))}const y=new OffscreenCanvas(b,g).getContext("2d",{willReadFrequently:!0});y.drawImage(l,0,0,l.width,l.height,0,0,b,g),p={width:b,height:g,data:y.getImageData(0,0,b,g).data}}return{canvas:f,width:c,height:u,imageData:p}}getImageForAltText(){return m(this,bl)}static async deserialize(t,r,i){var g;let s=null;if(t instanceof K7){const{data:{rect:w,rotation:y,id:x,structParent:S,popupRef:A},container:C,parent:{page:{pageNumber:T}}}=t,R=C.querySelector("canvas"),I=i.imageManager.getFromCanvas(C.id,R);R.remove();const L=((g=await r._structTree.getAriaAttributes(`${MT}${x}`))==null?void 0:g.get("aria-label"))||"";s=t={annotationType:Ht.STAMP,bitmapId:I.id,bitmap:I.bitmap,pageIndex:T-1,rect:w.slice(0),rotation:y,id:x,deleted:!1,accessibilityData:{decorative:!1,altText:L},isSvg:!1,structParent:S,popupRef:A}}const a=await super.deserialize(t,r,i),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:u,isSvg:f,accessibilityData:p}=t;u&&i.imageManager.isValidId(u)?(M(a,xi,u),l&&M(a,Zn,l)):M(a,Oc,c),M(a,Vs,f);const[h,b]=a.pageDimensions;return a.width=(o[2]-o[0])/h,a.height=(o[3]-o[1])/b,a.annotationElementId=t.id||null,p&&(a.altTextData=p),a._initialData=s,M(a,i0,!!s),a}serialize(t=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i={annotationType:Ht.STAMP,bitmapId:m(this,xi),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:m(this,Vs),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=U(this,Qt,Cx).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=U(this,Qt,FB).call(this,i);if(l.isSame)return null;l.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,r===null)return i;r.stamps||(r.stamps=new Map);const o=m(this,Vs)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!r.stamps.has(m(this,xi)))r.stamps.set(m(this,xi),{area:o,serialized:i}),i.bitmap=U(this,Qt,Cx).call(this,!1);else if(m(this,Vs)){const l=r.stamps.get(m(this,xi));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=U(this,Qt,Cx).call(this,!1))}return i}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}};Zn=new WeakMap,xi=new WeakMap,md=new WeakMap,Oc=new WeakMap,gd=new WeakMap,r0=new WeakMap,bl=new WeakMap,Mc=new WeakMap,wl=new WeakMap,Vs=new WeakMap,i0=new WeakMap,Qt=new WeakSet,t1=function(t,r=!1){if(!t){this.remove();return}M(this,Zn,t.bitmap),r||(M(this,xi,t.id),M(this,Vs,t.isSvg)),t.file&&M(this,r0,t.file.name),U(this,Qt,wC).call(this)},n1=function(){if(M(this,md,null),this._uiManager.enableWaiting(!1),!!m(this,bl)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&m(this,Zn)){this._editToolbar.hide(),this._uiManager.editAltText(this,!0);return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&m(this,Zn)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},Nx=function(){if(m(this,xi)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(m(this,xi)).then(i=>U(this,Qt,t1).call(this,i,!0)).finally(()=>U(this,Qt,n1).call(this));return}if(m(this,Oc)){const i=m(this,Oc);M(this,Oc,null),this._uiManager.enableWaiting(!0),M(this,md,this._uiManager.imageManager.getFromUrl(i).then(s=>U(this,Qt,t1).call(this,s)).finally(()=>U(this,Qt,n1).call(this)));return}if(m(this,gd)){const i=m(this,gd);M(this,gd,null),this._uiManager.enableWaiting(!0),M(this,md,this._uiManager.imageManager.getFromFile(i).then(s=>U(this,Qt,t1).call(this,s)).finally(()=>U(this,Qt,n1).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=S1.supportedTypesStr;const r=this._uiManager._signal;M(this,md,new Promise(i=>{t.addEventListener("change",async()=>
461{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const s=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),U(this,Qt,t1).call(this,s)}i()},{signal:r}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>U(this,Qt,n1).call(this))),t.click()},wC=function(){const{div:t}=this;let{width:r,height:i}=m(this,Zn);const[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,i=this.height*a;else if(r>o*s||i>o*a){const f=Math.min(o*s/r,o*a/i);r*=f,i*=f}const[l,c]=this.parentDimensions;this.setDims(r*l/s,i*c/a),this._uiManager.enableWaiting(!1);const u=M(this,bl,document.createElement("canvas"));u.setAttribute("role","img"),this.addContainer(u),(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),U(this,Qt,xC).call(this,r,i),U(this,Qt,DB).call(this),m(this,i0)||(this.parent.addUndoableEditor(this),M(this,i0,!0)),this._reportTelemetry({action:"inserted_image"}),m(this,r0)&&u.setAttribute("aria-label",m(this,r0))},MB=function(t,r){var o;const[i,s]=this.parentDimensions;this.width=t/i,this.height=r/s,(o=this._initialOptions)!=null&&o.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,m(this,wl)!==null&&clearTimeout(m(this,wl)),M(this,wl,setTimeout(()=>{M(this,wl,null),U(this,Qt,xC).call(this,t,r)},200))},kx=function(t,r){const{width:i,height:s}=m(this,Zn);let a=i,o=s,l=m(this,Zn);for(;a>2*t||o>2*r;){const c=a,u=o;a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(l,0,0,c,u,0,0,a,o),l=f.transferToImageBitmap()}return l},xC=function(t,r){const i=new mk,s=Math.ceil(t*i.sx),a=Math.ceil(r*i.sy),o=m(this,bl);if(!o||o.width===s&&o.height===a)return;o.width=s,o.height=a;const l=m(this,Vs)?m(this,Zn):U(this,Qt,kx).call(this,s,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,s,a)},Cx=function(t){if(t){if(m(this,Vs)){const s=this._uiManager.imageManager.getSvgUrl(m(this,xi));if(s)return s}const r=document.createElement("canvas");return{width:r.width,height:r.height}=m(this,Zn),r.getContext("2d").drawImage(m(this,Zn),0,0),r.toDataURL()}if(m(this,Vs)){const[r,i]=this.pageDimensions,s=Math.round(this.width*r*qd.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*qd.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(m(this,Zn),0,0,m(this,Zn).width,m(this,Zn).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(m(this,Zn))},DB=function(){this._uiManager._signal&&(M(this,Mc,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&U(this,Qt,MB).call(this,r.width,r.height)})),m(this,Mc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=m(this,Mc))==null||t.disconnect(),M(this,Mc,null)},{once:!0}))},FB=function(t){var c;const{rect:r,pageIndex:i,accessibilityData:{altText:s}}=this._initialData,a=t.rect.every((u,f)=>Math.abs(u-r[f])<1),o=t.pageIndex===i,l=(((c=t.accessibilityData)==null?void 0:c.alt)||"")===s;return{isSame:a&&o&&l,isSameAltText:l}},Ue(S1,"_type","stamp"),Ue(S1,"_editorType",Ht.STAMP);let bC=S1;var Qf,s0,xl,vd,Dc,Gs,yd,a0,o0,$i,Fc,vt,bd,Ei,BB,SC,AC,EC,Tx;const ro=class ro{constructor({uiManager:e,pageIndex:t,div:r,structTreeLayer:i,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:u}){q(this,Ei);q(this,Qf);q(this,s0,!1);q(this,xl,null);q(this,vd,null);q(this,Dc,null);q(this,Gs,new Map);q(this,yd,!1);q(this,a0,!1);q(this,o0,!1);q(this,$i,null);q(this,Fc,null);q(this,vt);const f=[...m(ro,bd).values()];if(!ro._initialized){ro._initialized=!0;for(const p of f)p.initialize(u,e)}e.registerEditorTypes(f),M(this,vt,e),this.pageIndex=t,this.div=r,M(this,Qf,s),M(this,xl,a),this.viewport=c,M(this,$i,l),this.drawLayer=o,this._structTree=i,m(this,vt).addLayer(this)}get isEmpty(){return m(this,Gs).size===0}get isInvisible(){return this.isEmpty&&m(this,vt).getMode()===Ht.NONE}updateToolbar(e){m(this,vt).updateToolbar(e)}updateMode(e=m(this,vt).getMode()){switch(U(this,Ei,Tx).call(this),e){case Ht.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Ht.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Ht.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of m(ro,bd).values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=m(this,$i))==null?void 0:t.div)}addInkEditorIfNeeded(e){if(m(this,vt).getMode()!==Ht.INK)return;if(!e){for(const r of m(this,Gs).values())if(r.isEmpty()){r.setInBackgroun
461d();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){m(this,vt).setEditingState(e)}addCommands(e){m(this,vt).addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=m(this,xl))==null||t.div.classList.toggle("disabled",!e)}async enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of m(this,Gs).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(m(this,vt).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!m(this,xl))return;const t=m(this,xl).getEditableAnnotations();for(const r of t){if(r.hide(),m(this,vt).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const i=await this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){var i;M(this,o0,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const s of m(this,Gs).values())if(s.disableEditing(),!!s.annotationElementId){if(s.seri
461alize()!==null){e.set(s.annotationElementId,s);continue}else t.set(s.annotationElementId,s);(i=this.getEditableAnnotation(s.annotationElementId))==null||i.show(),s.remove()}if(m(this,xl)){const s=m(this,xl).getEditableAnnotations();for(const a of s){const{id:o}=a.data;if(m(this,vt).isDeletedAnnotationElement(o))continue;let l=t.get(o);if(l){l.resetAnnotationElement(a),l.show(!1),a.show();continue}l=e.get(o),l&&(m(this,vt).addChangedExistingAnnotation(l),l.renderAnnotationElement(a)&&l.show(!1)),a.show()}}U(this,Ei,Tx).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const s of m(ro,bd).values())r.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),M(this,o0,!1)}getEditableAnnotation(e){var t;return((t=m(this,xl))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){m(this,vt).getActive()!==e&&m(this,vt).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=m(this,$i))!=null&&e.div&&!m(this,Fc)){M(this,Fc,new AbortController);const t=m(this,vt).combinedSignal(m(this,Fc));m(this,$i).div.addEventListener("pointerdown",U(this,Ei,BB).bind(this),{signal:t}),m(this,$i).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=m(this,$i))!=null&&e.div&&m(this,Fc)&&(m(this,Fc).abort(),M(this,Fc,null),m(this,$i).div.classList.remove("highlighting"))}enableClick(){if(m(this,vd))return;M(this,vd,new AbortController);const e=m(this,vt).combinedSignal(m(this,vd));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){var e;(e=m(this,vd))==null||e.abort(),M(this,vd,null)}attach(e){m(this,Gs).set(e.id,e);const{annotationElementId:t}=e;t&&m(this,vt).isDeletedAnnotationElement(t)&&m(this,vt).removeDeletedAnnotationElement(e)}detach(e){var t;m(this,Gs).delete(e.id),(t=m(this,Qf))==null||t.removePointerInTextLayer(e.contentDiv),!m(this,o0)&&e.annotationElementId&&m(this,vt).addDeletedAnnotationElement(e)}remove(e){this.detach(e),m(this,vt).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,m(this,a0)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(m(this,vt).addDeletedAnnotationElement(e.annotationElementId),bn.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),m(this,vt).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),m(this,vt).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!m(this,Dc)&&(e._focusEventsAllowed=!1,M(this,Dc,setTimeout(()=>{M(this,Dc,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:m(this,vt)._signal}),t.focus())},0))),e._structTreeParentId=(r=m(this,Qf))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const t=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:t,undo:r,mustExec:!1})}getNextId(){return m(this,vt).getId()}combinedSignal(e){return m(this,vt).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=m(this,Ei,SC))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,t){m(this,vt).updateToolbar(e),m(this,vt).updateMode(e);const{offsetX:r,offsetY:i}=U(this,Ei,EC).call(this),s=this.getNextId(),a=U(this,Ei,AC).call(this,{parent:this,id:s,x:r,y:i,uiManager:m(this,vt),isCentered:!0,...t});a&&this.add(a)}async deserialize(e){var t;return await((t=m(ro,bd).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,m(this,vt)))||null}createAndAddNewEditor(e,t,r={}){const i=this.getNextId(),s=U(this,Ei,AC).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:m(this,vt),isCentered:t,...r});return s&&this.add(s),s}addNewEditor(){this.createAndAddNewEditor(U(this,Ei,EC).call(this),!0)}setSelected(e){m(this,vt).setSelected(e)}toggleSelected(e){m(this,vt).toggleSelected(e)}unselect(e){m(this,vt).unselect(e)}pointerup(e){const{isMac:t}=is.platform;if(!(e.button!==0||e.ctrlKey&&t)&&e.target===this.div&&m(this,yd)){if(M(this,yd,!1),!m(this,s0)){M(this,s0,!0);return}if(m(this,vt).getMode()===Ht.STAMP){m(this,vt).unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(m(this,vt).getMode()===Ht.HIGHLIGHT&&this.enableTextSelection(),m(this,yd)){M(this,yd,!1);return}const{isMac:t}=is.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;M(this,yd,!0);const r=m(this,vt).getActive();M(this,s0,!r||r.isEmpty())}findNewParent(e,t,r){const i=m(this,vt).findParent(t,r);return i===null||i===this?!1:(i.changeParent(e),!0)}destroy(){var e,t;((e=m(this,vt).getActive())==null?void 0:e.parent)===this&&(m(this,vt).commitOrRemove(),m(this,vt).setActiveEditor(null)),m(this,Dc)&&(clearTimeout(m(this,Dc)),M(this,Dc,null));for(const r of m(this,Gs).values())(t=m(this,Qf))==null||t.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,m(this,Gs).clear(),m(this,vt).removeLayer(this)}render({viewport:e}){this.viewport=e,up(this.div,e);for(const t of m(this,vt).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){m(this,vt).commitOrRemove(),U(this,Ei,Tx).call(this);const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,up(this.div,{rotation:r}),t!==r)for(const i of m(this,Gs).values())i.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return m(this,vt).viewParameters.realScale}};Qf=new WeakMap,s0=new WeakMap,xl=new WeakMap,vd=new WeakMap,Dc=new WeakMap,Gs=new WeakMap,yd=new WeakMap,a0=new WeakMap,o0=new WeakMap,$i=new WeakMap,Fc=new WeakMap,vt=new WeakMap,bd=new WeakMap,Ei=new WeakSet,BB=function(e){m(this,vt).unselectAll();const{target:t}=e;if(t===m(this,$i).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&m(this,$i).div.contains(t)){const{isMac:r}=is.platform;if(e.button!==0||e.ctrlKey&&r)return;m(this,vt).showAllEditors("highlight",!0,!0),m(this,$i).div.classList.add("free"),this.toggleDrawing(),L_.startHighlighting(this,m(this,vt).direction==="ltr",{target:m(this,$i).div,x:e.x,y:e.y}),m(this,$i).div.addEventListener("pointerup",()=>{m(this,$i).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:m(this,vt)._signal}),e.preventDefault()}},SC=function(){return m(ro,bd).get(m(this,vt).getMode())},AC=function(e){const t=m(this,Ei,SC);return t?new t.prototype.constructor(e):null},EC=function(){const{x:e,y:t,width:r,height:i}=this.div.getBoundingClientRect(),s=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,t+i),c=(s+o)/2-e,u=(a+l)/2-t,[f,p]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:f,offsetY:p}},Tx=function(){M(this,a0,!0);for(const e of m(this,Gs).values())e.isEmpty()&&e.remove();M(this,a0,!1)},Ue(ro,"_initialized",!1),q(ro,bd,new Map([tC,uC,bC,L_].map(e=>[e._editorType,e])));let _C=ro;var _l,Ab,Pr,Bc,Eb,kC,_p,CC,$B;const yi=class yi{constructor({pageIndex:e}){q(this,_p);q(this,_l,null);q(this,Ab,0);q(this,Pr,new Map);q(this,Bc,new Map);this.pageIndex=e}setParent(e){if(!m(this,_l)){M(this,_l,e);return}if(m(this,_l)!==e){if(m(this,Pr).size>0)for(const t of m(this,Pr).values())t.remove(),e.append(t);M(this,_l,e)}}static get _svgFactory(){return tn(this,"_svgFactory",new VT)}draw(e,t,r,i=!1){const s=Xr(this,Ab)._++,a=U(this,_p,CC).call(this,e.box);a.classList.add(...e.classNamesForDrawing);const o=yi._svgFactory.createElement("defs");a.append(o);const l=yi._svgFactory.createElement("path");o.append(l);const c=`path_p${this.pageIndex}_${s}`;l.setAttribute("id",c),l.setAttribute("d",e.toSVGPath()),i&&m(this,Bc).set(s,l);const u=U(this,_p,$B).call(this,o,c),f=yi._svgFactory.createElement("use");return a.append(f),a.setAttribute("fill",t),a.setAttribute("fill-opacity",r),f.setAttribute("href",`#${c}`),m(this,Pr).set(s,a),{id:s,clipPathId:`url(#${u})`}}drawOutline(e){const t=Xr(this,Ab)._++,r=U(this,_p,CC).call(this,e.box);r.classList.add(...e.classNamesForOutlining);const i=yi._svgFactory.createElement("defs");r.append(i);const s=yi._svgFactory.createElement("path");i.append(s);const a=`path_p${this.pageIndex}_${t}`;s.setAttribute("id",a),s.setAttribute("d",e.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke");let o;if(e.mustRemoveSelfIntersections){const u=yi._svgFactory.createElement("mask");i.append(u),o=`mask_p${this.pageIndex}_${t}`,u.setAttribute("id",o),u.setAttribute("maskUnits","objectBoundingBox");const f=yi._svgFactory.createElement("rect");u.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const p=yi._svgFactory.createElement("use");u.append(p),p.setAttribute("href",`#${a}`),p.setAttribute("stroke","none"),p.setAttribute("fill","black"),p.setAttribute("fill-rule","nonzero"),p.classList.add("mask")}const l=yi._svgFactory.createElement("use");r.append(l),l.setAttribute("href",`#${a}`),o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();return r.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),m(this,Pr).set(t,r),t}finalizeLine(e,t){const r=m(this,Bc).get(e);m(this,Bc).delete(e),this.updateBox(e,t.box),r.setAttribute("d",t.toSVGPath())}updateLine(e,t){m(this,Pr).get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}updatePath(e,t){m(this,Bc).get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){var r;U(r=yi,Eb,kC).call(r,m(this,Pr).get(e),t)}
461show(e,t){m(this,Pr).get(e).classList.toggle("hidden",!t)}rotate(e,t){m(this,Pr).get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){m(this,Pr).get(e).setAttribute("fill",t)}changeOpacity(e,t){m(this,Pr).get(e).setAttribute("fill-opacity",t)}addClass(e,t){m(this,Pr).get(e).classList.add(t)}removeClass(e,t){m(this,Pr).get(e).classList.remove(t)}getSVGRoot(e){return m(this,Pr).get(e)}remove(e){m(this,Bc).delete(e),m(this,_l)!==null&&(m(this,Pr).get(e).remove(),m(this,Pr).delete(e))}destroy(){M(this,_l,null);for(const e of m(this,Pr).values())e.remove();m(this,Pr).clear(),m(this,Bc).clear()}};_l=new WeakMap,Ab=new WeakMap,Pr=new WeakMap,Bc=new WeakMap,Eb=new WeakSet,kC=function(e,{x:t=0,y:r=0,width:i=1,height:s=1}={}){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*t}%`,a.width=`${100*i}%`,a.height=`${100*s}%`},_p=new WeakSet,CC=function(e){var r;const t=yi._svgFactory.create(1,1,!0);return m(this,_l).append(t),t.setAttribute("aria-hidden",!0),U(r=yi,Eb,kC).call(r,t,e),t},$B=function(e,t){const r=yi._svgFactory.createElement("clipPath");e.append(r);const i=`clip_${t}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");const s=yi._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),i},q(yi,Eb);let NC=yi;var ise=It.AbortException,sse=It.AnnotationEditorLayer,ase=It.AnnotationEditorParamsType,ose=It.AnnotationEditorType,lse=It.AnnotationEditorUIManager,UB=It.AnnotationLayer,zB=It.AnnotationMode,cse=It.ColorPicker,use=It.DOMSVGFactory,dse=It.DrawLayer,hse=It.FeatureTest,KT=It.GlobalWorkerOptions,fse=It.ImageKind,pse=It.InvalidPDFException,mse=It.MissingPDFException,gse=It.OPS,vse=It.OutputScale,yse=It.PDFDataRangeTransport,bse=It.PDFDateString,wse=It.PDFWorker,xse=It.PasswordResponses,_se=It.PermissionFlag,Sse=It.PixelsPerInch,Ase=It.RenderingCancelledException,qB=It.TextLayer,Ese=It.UnexpectedResponseException,Nse=It.Util,kse=It.VerbosityLevel,Cse=It.XfaLayer,Tse=It.build,Pse=It.createValidAbsoluteUrl,jse=It.fetchData,HB=It.getDocument,Rse=It.getFilenameFromUrl,Lse=It.getPdfFilenameFromUrl,Ise=It.getXfaPageViewport,Ose=It.isDataScheme,Mse=It.isPdfFile,Dse=It.noContextMenu,Fse=It.normalizeUnicode,Bse=It.setLayerDimensions,$se=It.shadow,WB=It.version;const Use=Object.freeze(Object.defineProperty({__proto__:null,AbortException:ise,AnnotationEditorLayer:sse,AnnotationEditorParamsType:ase,AnnotationEditorType:ose,AnnotationEditorUIManager:lse,AnnotationLayer:UB,AnnotationMode:zB,ColorPicker:cse,DOMSVGFactory:use,DrawLayer:dse,FeatureTest:hse,GlobalWorkerOptions:KT,ImageKind:fse,InvalidPDFException:pse,MissingPDFException:mse,OPS:gse,OutputScale:vse,PDFDataRangeTransport:yse,PDFDateString:bse,PDFWorker:wse,PasswordResponses:xse,PermissionFlag:_se,PixelsPerInch:Sse,RenderingCancelledException:Ase,TextLayer:qB,UnexpectedResponseException:Ese,Util:Nse,VerbosityLevel:kse,XfaLayer:Cse,build:Tse,createValidAbsoluteUrl:Pse,fetchData:jse,getDocument:HB,getFilenameFromUrl:Rse,getPdfFilenameFromUrl:Lse,getXfaPageViewport:Ise,isDataScheme:Ose,isPdfFile:Mse,noContextMenu:Dse,normalizeUnicode:Fse,setLayerDimensions:Bse,shadow:$se,version:WB},Symbol.toStringTag,{value:"Module"}));var Jr=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))},zse=["onCopy","onCut","onPaste"],qse=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],Hse=["onFocus","onBlur"],Wse=["onInput","onInvalid","onReset","onSubmit"],Vse=["onLoad","onError"],Gse=["onKeyDown","onKeyPress","onKeyUp"],Kse=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],Yse=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],Xse=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],Jse=["onSelect"],Qse=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],Zse=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],eae=["onScroll"],tae=["onWheel"],nae=["onAnimationStart","onAnimationEnd","onAnimationIteration"],rae=["onTransitionEnd"],iae=["onToggle"],sae=["onChange"],aae=Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr(Jr([],zse,!0),qse,!0),Hse,!0),Wse,!0),Vse,!0),Gse,!0),Kse,!0),Yse,!0),Xse,!0),Jse,!0),Qse,!0),Zse,!0),eae,!0),tae,!0),nae,!0),rae,!0),sae,!0),iae,!0);function VB(n,e){var t={};return aae.forEach(function(r){var i=n[r];i&&(e?t[r]=function(s){return i(s,e(r))}:t[r]=i)}),t}function qb(n){var e=!1,t=new Promise(function(r,i){n.then(function(s){return!e&&r(s)}).catch(function(s){return!e&&i(s)})});return{promise:t,cancel:function(){e=!0}}}var oae="Invariant failed";function Cn(n,e){if(!n)throw new Error(oae)}var lae=function(){},cae=lae;const qi=a5(cae);var rL=Object.prototype.hasOwnProperty;function iL(n,e,t){for(t of n.keys())if(Vm(t,e))return t}function Vm(n,e){var t,r,i;if(n===e)return!0;
461if(n&&e&&(t=n.constructor)===e.constructor){if(t===Date)return n.getTime()===e.getTime();if(t===RegExp)return n.toString()===e.toString();if(t===Array){if((r=n.length)===e.length)for(;r--&&Vm(n[r],e[r]););return r===-1}if(t===Set){if(n.size!==e.size)return!1;for(r of n)if(i=r,i&&typeof i=="object"&&(i=iL(e,i),!i)||!e.has(i))return!1;return!0}if(t===Map){if(n.size!==e.size)return!1;for(r of n)if(i=r[0],i&&typeof i=="object"&&(i=iL(e,i),!i)||!Vm(r[1],e.get(i)))return!1;return!0}if(t===ArrayBuffer)n=new Uint8Array(n),e=new Uint8Array(e);else if(t===DataView){if((r=n.byteLength)===e.byteLength)for(;r--&&n.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(n)){if((r=n.byteLength)===e.byteLength)for(;r--&&n[r]===e[r];);return r===-1}if(!t||typeof n=="object"){r=0;for(t in n)if(rL.call(n,t)&&++r&&!rL.call(e,t)||!(t in e)||!Vm(n[t],e[t]))return!1;return Object.keys(e).length===r}}return n!==n&&e!==e}const GB=E.createContext(null);function Gm({children:n,type:e}){return d.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:n})}const uae="noopener noreferrer nofollow";class dae{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Cn(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){Cn(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(t=>{Cn(this.pdfDocument),Cn(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(t):Array.isArray(e)?t(e):e.then(t)}).then(t=>{Cn(Array.isArray(t));const r=t[0];new Promise(i=>{Cn(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(s=>{i(s)}).catch(()=>{Cn(!1)}):typeof r=="number"?i(r):Cn(!1)}).then(i=>{const s=i+1;Cn(this.pdfViewer),Cn(s>=1&&s<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:i,pageNumber:s})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const t=e-1;Cn(this.pdfViewer),Cn(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:t,pageNumber:e})}addLinkAttributes(e,t,r){e.href=t,e.rel=this.externalLinkRel||uae,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const sL={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},tS=typeof window<"u",KB=tS&&window.location.protocol==="file:";function hae(n){return typeof n<"u"}function Ah(n){return hae(n)&&n!==null}function fae(n){return typeof n=="string"}function pae(n){return n instanceof ArrayBuffer}function mae(n){return Cn(tS),n instanceof Blob}function TC(n){return fae(n)&&/^data:/.test(n)}function aL(n){Cn(TC(n));const[e="",t=""]=n.split(",");return e.split(";").indexOf("base64")!==-1?atob(t):unescape(t)}function gae(){return tS&&window.devicePixelRatio||1}const YB="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function oL(){qi(!KB,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${YB}`)}function vae(){qi(!KB,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${YB}`)}function fp(n){n!=null&&n.cancel&&n.cancel()}function PC(n,e){return Object.defineProperty(n,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(n,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(n,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(n,"originalHeight",{get(){return this.view[3]},configurable:!0}),n}function yae(n){return n.name==="RenderingCancelledException"}function bae(n){return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>
461{if(!r.result)return t(new Error("Error while reading a file."));e(r.result)},r.onerror=i=>{if(!i.target)return t(new Error("Error while reading a file."));const{error:s}=i.target;if(!s)return t(new Error("Error while reading a file."));switch(s.code){case s.NOT_FOUND_ERR:return t(new Error("Error while reading a file: File not found."));case s.SECURITY_ERR:return t(new Error("Error while reading a file: Security error."));case s.ABORT_ERR:return t(new Error("Error while reading a file: Aborted."));default:return t(new Error("Error while reading a file."))}},r.readAsArrayBuffer(n)})}function wae(n,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return n}}function S0(){return E.useReducer(wae,{value:void 0,error:void 0})}var xae=function(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((r=r.apply(n,e||[])).next())})},lL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const{PDFDataRangeTransport:_ae}=Use,Sae=(n,e)=>{switch(e){case sL.NEED_PASSWORD:{const t=prompt("Enter the password to open this PDF file.");n(t);break}case sL.INCORRECT_PASSWORD:{const t=prompt("Invalid password. Please try again.");n(t);break}}};function cL(n){return typeof n=="object"&&n!==null&&("data"in n||"range"in n||"url"in n)}const Aae=E.forwardRef(function(e,t){var{children:r,className:i,error:s="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:u,loading:f="Loading PDF…",noData:p="No PDF file specified.",onItemClick:h,onLoadError:b,onLoadProgress:g,onLoadSuccess:w,onPassword:y=Sae,onSourceError:x,onSourceSuccess:S,options:A,renderMode:C,rotate:T}=e,R=lL(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[I,L]=S0(),{value:V,error:j}=I,[$,J]=S0(),{value:H,error:le}=$,oe=E.useRef(new dae),se=E.useRef([]),O=E.useRef(void 0),te=E.useRef(void 0);l&&l!==O.current&&cL(l)&&(qi(!Vm(l,O.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),O.current=l),A&&A!==te.current&&(qi(!Vm(A,te.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),te.current=A);const he=E.useRef({scrollPageIntoView:ye=>{const{dest:Re,pageNumber:Y,pageIndex:Te=Y-1}=ye;if(h){h({dest:Re,pageIndex:Te,pageNumber:Y});return}const it=se.current[Te];if(it){it.scrollIntoView();return}qi(!1,`An internal link leading to page ${Y} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});E.useImperativeHandle(t,()=>({linkService:oe,pages:se,viewer:he}),[]);function ge(){S&&S()}function D(){j&&(qi(!1,j.toString()),x&&x(j))}function G(){L({type:"RESET"})}E.useEffect(G,[l,L]);const ee=E.useCallback(()=>xae(this,void 0,void 0,function*(){if(!l)return null;if(typeof l=="string")return TC(l)?{data:aL(l)}:(oL(),{url:l});if(l instanceof _ae)return{range:l};if(pae(l))return{data:l};if(tS&&mae(l))return{data:yield bae(l)};if(Cn(typeof l=="object"),Cn(cL(l)),"url"in l&&typeof l.url=="string"){if(TC(l.url)){const{url:ye}=l,Re=lL(l,["url"]),Y=aL(ye);return Object.assign({data:Y},Re)}oL()}return l}),[l]);E.useEffect(()=>{const ye=qb(ee());return ye.promise.then(Re=>{L({type:"RESOLVE",value:Re})}).catch(Re=>{L({type:"REJECT",error:Re})}),()=>{fp(ye)}},[ee,L]),E.useEffect(()=>{if(!(typeof V>"u")){if(V===!1){D();return}ge()}},[V]);
461function ae(){H&&(w&&w(H),se.current=new Array(H.numPages),oe.current.setDocument(H))}function X(){le&&(qi(!1,le.toString()),b&&b(le))}E.useEffect(function(){J({type:"RESET"})},[J,V]),E.useEffect(function(){if(!V)return;const Re=A?Object.assign(Object.assign({},V),A):V,Y=HB(Re);g&&(Y.onProgress=g),y&&(Y.onPassword=y);const Te=Y,it=Te.promise.then(He=>{J({type:"RESOLVE",value:He})}).catch(He=>{Te.destroyed||J({type:"REJECT",error:He})});return()=>{it.finally(()=>Te.destroy())}},[A,J,V]),E.useEffect(()=>{if(!(typeof H>"u")){if(H===!1){X();return}ae()}},[H]),E.useEffect(function(){oe.current.setViewer(he.current),oe.current.setExternalLinkRel(a),oe.current.setExternalLinkTarget(o)},[a,o]);const Q=E.useCallback((ye,Re)=>{se.current[ye]=Re},[]),ue=E.useCallback(ye=>{delete se.current[ye]},[]),pe=E.useMemo(()=>({imageResourcesPath:u,linkService:oe.current,onItemClick:h,pdf:H,registerPage:Q,renderMode:C,rotate:T,unregisterPage:ue}),[u,h,H,Q,C,T,ue]),me=E.useMemo(()=>VB(R,()=>H),[R,H]);function _e(){return d.jsx(GB.Provider,{value:pe,children:r})}function Ee(){return l?H==null?d.jsx(Gm,{type:"loading",children:typeof f=="function"?f():f}):H===!1?d.jsx(Gm,{type:"error",children:typeof s=="function"?s():s}):_e():d.jsx(Gm,{type:"no-data",children:typeof p=="function"?p():p})}return d.jsx("div",Object.assign({className:R0("react-pdf__Document",i),ref:c,style:{"--scale-factor":"1"}},me,{children:Ee()}))});function XB(){return E.useContext(GB)}function JB(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.filter(Boolean);if(t.length<=1){var r=t[0];return r||null}return function(s){t.forEach(function(a){typeof a=="function"?a(s):a&&(a.current=s)})}}const QB=E.createContext(null),ZB={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Eae=/^H(\d+)$/;function Nae(n){return n in ZB}function nS(n){return"children"in n}function e$(n){return nS(n)?n.children.length===1&&0 in n.children&&"id"in n.children[0]:!1}function kae(n){const e={};if(nS(n)){const{role:t}=n,r=t.match(Eae);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if(Nae(t)){const i=ZB[t];i&&(e.role=i)}}return e}function t$(n){const e={};if(nS(n)){if(n.alt!==void 0&&(e["aria-label"]=n.alt),n.lang!==void 0&&(e.lang=n.lang),e$(n)){const[t]=n.children;if(t){const r=t$(t);return Object.assign(Object.assign({},e),r)}}}else"id"in n&&(e["aria-owns"]=n.id);return e}function Cae(n){return n?Object.assign(Object.assign({},kae(n)),t$(n)):null}function n$({className:n,node:e}){const t=E.useMemo(()=>Cae(e),[e]),r=E.useMemo(()=>!nS(e)||e$(e)?null:e.children.map((i,s)=>d.jsx(n$,{node:i},s)),[e]);return d.jsx("span",Object.assign({className:n},t,{children:r}))}function rS(){return E.useContext(QB)}function Tae(){const n=rS();Cn(n);const{onGetStructTreeError:e,onGetStructTreeSuccess:t}=n,[r,i]=S0(),{value:s,error:a}=r,{customTextRenderer:o,page:l}=n;function c(){s&&t&&t(s)}function u(){a&&(qi(!1,a.toString()),e&&e(a))}return E.useEffect(function(){i({type:"RESET"})},[i,l]),E.useEffect(function(){if(o||!l)return;const p=qb(l.getStructTree()),h=p;return p.promise.then(b=>{i({type:"RESOLVE",value:b})}).catch(b=>{i({type:"REJECT",error:b})}),()=>fp(h)},[o,l,i]),E.useEffect(()=>{if(s!==void 0){if(s===!1){u();return}c()}},[s]),s?d.jsx(n$,{className:"react-pdf__Page__structTree structTree",node:s}):null}const uL=zB;function Pae(n){const e=rS();Cn(e);const t=Object.assign(Object.assign({},e),n),{_className:r,canvasBackground:i,devicePixelRatio:s=gae(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:c,renderTextLayer:u,rotate:f,scale:p}=t,{canvasRef:h}=n;Cn(l);const b=E.useRef(null);function g(){l&&o&&o(PC(l,p))}function w(A){yae(A)||(qi(!1,A.toString()),a&&a(A))}const y=E.useMemo(()=>l.getViewport({scale:p*s,rotation:f}),[s,l,f,p]),x=E.useMemo(()=>l.getViewport({scale:p,rotation:f}),[l,f,p]);E.useEffect(function(){if(!l)return;l.cleanup();const{current:C}=b;if(!C)return;C.width=y.width,C.height=y.height,C.style.width=`${Math.floor(x.width)}px`,C.style.height=`${Math.floor(x.height)}px`,C.style.visibility="hidden";const T={annotationMode:c?uL.ENABLE_FORMS:uL.ENABLE,canvasContext:C.getContext("2d",{alpha:!1}),viewport:y};i&&(T.background=i);const R=l.render(T),I=R;return R.promise.then(()=>{C.style.visibility="",g()}).catch(w),()=>fp(I)},[i,l,c,y,x]);const S=E.useCallback(()=>{const{current:A}=b;A&&(A.width=0,A.height=0)},[]);return E.useEffect(()=>S,[S]),d.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:JB(h,b),style:{display:"block",userSelect:"none"},children:u?d.jsx(Tae,{}):null})}function jae(n){return"str"in n}function Rae(){const n=rS();Cn(n);const{customTextRenderer:e,onGetTextError:t,onGetTextSuccess:r,onRenderTextLayerError:i,onRenderTextLayerSuccess:s,page:a,pageIndex:o,pageNumber:l,rotate:c,scale:u}=n;Cn(a);const[f,p]=S0(),{value:h,error:b}=f,g=E.useRef(null);qi(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function w(){h&&r&&r(h)}function y(){b&&(qi(!1,b.toString()),t&&t(b))}E.useEffect(function(){p({type:"RESET"})},[a,p]),E.useEffect(function(){if(!a)return;const I=qb(a.getTextContent()),L=I;return I.promise.then(V=>{p({type:"RESOLVE",value:V}
461)}).catch(V=>{p({type:"REJECT",error:V})}),()=>fp(L)},[a,p]),E.useEffect(()=>{if(h!==void 0){if(h===!1){y();return}w()}},[h]);const x=E.useCallback(()=>{s&&s()},[s]),S=E.useCallback(R=>{qi(!1,R.toString()),i&&i(R)},[i]);function A(){const R=g.current;R&&R.classList.add("selecting")}function C(){const R=g.current;R&&R.classList.remove("selecting")}const T=E.useMemo(()=>a.getViewport({scale:u,rotation:c}),[a,c,u]);return E.useLayoutEffect(function(){if(!a||!h)return;const{current:I}=g;if(!I)return;I.innerHTML="";const L=a.streamTextContent({includeMarkedContent:!0}),V={container:I,textContentSource:L,viewport:T},j=new qB(V),$=j;return j.render().then(()=>{const J=document.createElement("div");J.className="endOfContent",I.append(J);const H=I.querySelectorAll('[role="presentation"]');if(e){let le=0;h.items.forEach((oe,se)=>{if(!jae(oe))return;const O=H[le];if(!O)return;const te=e(Object.assign({pageIndex:o,pageNumber:l,itemIndex:se},oe));O.innerHTML=te,le+=oe.str&&oe.hasEOL?2:1})}x()}).catch(S),()=>fp($)},[e,S,x,a,o,l,h,T]),d.jsx("div",{className:R0("react-pdf__Page__textContent","textLayer"),onMouseUp:C,onMouseDown:A,ref:g})}function Lae(){const n=XB(),e=rS();Cn(e);const t=Object.assign(Object.assign({},n),e),{imageResourcesPath:r,linkService:i,onGetAnnotationsError:s,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:l,page:c,pdf:u,renderForms:f,rotate:p,scale:h=1}=t;Cn(u),Cn(c),Cn(i);const[b,g]=S0(),{value:w,error:y}=b,x=E.useRef(null);qi(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function S(){w&&a&&a(w)}function A(){y&&(qi(!1,y.toString()),s&&s(y))}E.useEffect(function(){g({type:"RESET"})},[g,c]),E.useEffect(function(){if(!c)return;const L=qb(c.getAnnotations()),V=L;return L.promise.then(j=>{g({type:"RESOLVE",value:j})}).catch(j=>{g({type:"REJECT",error:j})}),()=>{fp(V)}},[g,c]),E.useEffect(()=>{if(w!==void 0){if(w===!1){A();return}S()}},[w]);function C(){l&&l()}function T(I){qi(!1,`${I}`),o&&o(I)}const R=E.useMemo(()=>c.getViewport({scale:h,rotation:p}),[c,p,h]);return E.useEffect(function(){if(!u||!c||!i||!w)return;const{current:L}=x;if(!L)return;const V=R.clone({dontFlip:!0}),j={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:L,l10n:null,page:c,structTreeLayer:null,viewport:V},$={annotations:w,annotationStorage:u.annotationStorage,div:L,imageResourcesPath:r,linkService:i,page:c,renderForms:f,viewport:V};L.innerHTML="";try{new UB(j).render($),C()}catch(J){T(J)}return()=>{}},[w,r,i,c,u,f,R]),d.jsx("div",{className:R0("react-pdf__Page__annotations","annotationLayer"),ref:x})}var Iae=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const dL=1;function YA(n){const e=XB(),t=Object.assign(Object.assign({},e),n),{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:i=!0,canvasBackground:s,canvasRef:a,children:o,className:l,customRenderer:c,customTextRenderer:u,devicePixelRatio:f,error:p="Failed to load the page.",height:h,inputRef:b,loading:g="Loading page…",noData:w="No page specified.",onGetAnnotationsError:y,onGetAnnotationsSuccess:x,onGetStructTreeError:S,onGetStructTreeSuccess:A,onGetTextError:C,onGetTextSuccess:T,onLoadError:R,onLoadSuccess:I,onRenderAnnotationLayerError:L,onRenderAnnotationLayerSuccess:V,onRenderError:j,onRenderSuccess:$,onRenderTextLayerError:J,onRenderTextLayerSuccess:H,pageIndex:le,pageNumber:oe,pdf:se,registerPage:O,renderAnnotationLayer:te=!0,renderForms:he=!1,renderMode:ge="canvas",renderTextLayer:D=!0,rotate:G,scale:ee=dL,unregisterPage:ae,width:X}=t,Q=Iae(t,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[ue,pe]=S0(),{value:me,error:_e}=ue,Ee=E.useRef(null);Cn(se);const ye=Ah(oe)?oe-1:le??null,Re=oe??(Ah(le)?le+1:null),Y=G??(me?me.rotate:null),Te=E.useMemo(()=>
461{if(!me)return null;let St=1;const Ot=ee??dL;if(X||h){const Ve=me.getViewport({scale:1,rotation:Y});X?St=X/Ve.width:h&&(St=h/Ve.height)}return Ot*St},[h,me,Y,ee,X]);E.useEffect(function(){return()=>{Ah(ye)&&i&&ae&&ae(ye)}},[i,se,ye,ae]);function it(){if(I){if(!me||!Te)return;I(PC(me,Te))}if(i&&O){if(!Ah(ye)||!Ee.current)return;O(ye,Ee.current)}}function He(){_e&&(qi(!1,_e.toString()),R&&R(_e))}E.useEffect(function(){pe({type:"RESET"})},[pe,se,ye]),E.useEffect(function(){if(!se||!Re)return;const Ot=qb(se.getPage(Re)),Ve=Ot;return Ot.promise.then(wt=>{pe({type:"RESOLVE",value:wt})}).catch(wt=>{pe({type:"REJECT",error:wt})}),()=>fp(Ve)},[pe,se,Re]),E.useEffect(()=>{if(me!==void 0){if(me===!1){He();return}it()}},[me,Te]);const Ce=E.useMemo(()=>me&&Ah(ye)&&Re&&Ah(Y)&&Ah(Te)?{_className:r,canvasBackground:s,customTextRenderer:u,devicePixelRatio:f,onGetAnnotationsError:y,onGetAnnotationsSuccess:x,onGetStructTreeError:S,onGetStructTreeSuccess:A,onGetTextError:C,onGetTextSuccess:T,onRenderAnnotationLayerError:L,onRenderAnnotationLayerSuccess:V,onRenderError:j,onRenderSuccess:$,onRenderTextLayerError:J,onRenderTextLayerSuccess:H,page:me,pageIndex:ye,pageNumber:Re,renderForms:he,renderTextLayer:D,rotate:Y,scale:Te}:null,[r,s,u,f,y,x,S,A,C,T,L,V,j,$,J,H,me,ye,Re,he,D,Y,Te]),Je=E.useMemo(()=>VB(Q,()=>me&&(Te?PC(me,Te):void 0)),[Q,me,Te]),De=`${ye}@${Te}/${Y}`;function Qe(){switch(ge){case"custom":return Cn(c),d.jsx(c,{},`${De}_custom`);case"none":return null;case"canvas":default:return d.jsx(Pae,{canvasRef:a},`${De}_canvas`)}}function ze(){return D?d.jsx(Rae,{},`${De}_text`):null}function Vt(){return te?d.jsx(Lae,{},`${De}_annotations`):null}function Ct(){return d.jsxs(QB.Provider,{value:Ce,children:[Qe(),ze(),Vt(),o]})}function dt(){return Re?se===null||me===void 0||me===null?d.jsx(Gm,{type:"loading",children:typeof g=="function"?g():g}):se===!1||me===!1?d.jsx(Gm,{type:"error",children:typeof p=="function"?p():p}):Ct():d.jsx(Gm,{type:"no-data",children:typeof w=="function"?w():w})}return d.jsx("div",Object.assign({className:R0(r,l),"data-page-number":Re,ref:JB(b,Ee),style:{"--scale-factor":`${Te}`,backgroundColor:s||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},Je,{children:dt()}))}vae();KT.workerSrc="pdf.worker.mjs";var XA="focusScope.autoFocusOnMount",JA="focusScope.autoFocusOnUnmount",hL={bubbles:!1,cancelable:!0},Oae="FocusScope",iS=E.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=n,[o,l]=E.useState(null),c=Da(i),u=Da(s),f=E.useRef(null),p=Xt(e,g=>l(g)),h=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let g=function(S){if(h.paused||!o)return;const A=S.target;o.contains(A)?f.current=A:Lu(f.current,{select:!0})},w=function(S){if(h.paused||!o)return;const A=S.relatedTarget;A!==null&&(o.contains(A)||Lu(f.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Lu(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const x=new MutationObserver(y);return o&&x.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),x.disconnect()}}},[r,o,h.paused]),E.useEffect(()=>{if(o){pL.add(h);const g=document.activeElement;if(!o.contains(g)){const y=new CustomEvent(XA,hL);o.addEventListener(XA,c),o.dispatchEvent(y),y.defaultPrevented||(Mae(Uae(r$(o)),{select:!0}),document.activeElement===g&&Lu(o))}return()=>{o.removeEventListener(XA,c),setTimeout(()=>{const y=new CustomEvent(JA,hL);o.addEventListener(JA,u),o.dispatchEvent(y),y.defaultPrevented||Lu(g??document.body,{select:!0}),o.removeEventListener(JA,u),pL.remove(h)},0)}}},[o,c,u,h]);const b=E.useCallback(g=>{if(!t&&!r||h.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(w&&y){const x=g.currentTarget,[S,A]=Dae(x);S&&A?!g.shiftKey&&y===A?(g.preventDefault(),t&&Lu(S,{select:!0})):g.shiftKey&&y===S&&(g.preventDefault(),t&&Lu(A,{select:!0})):y===x&&g.preventDefault()}},[t,r,h.paused]);return d.jsx(yt.div,{tabIndex:-1,...a,ref:p,onKeyDown:b})});iS.displayName=Oae;function Mae(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(Lu(r,{select:e}),document.activeElement!==t)return}function Dae(n){const e=r$(n),t=fL(e,n),r=fL(e.reverse(),n);return[t,r]}function r$(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function fL(n,e){for(const t of n)if(!Fae(t,{upTo:e}))return t}function Fae(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function Bae(n){return n instanceof HTMLInputElement&&"select"in n}function Lu(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&Bae(n)&&e&&n.select()}}var pL=$ae();function $ae(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=mL(n,e),n.unshift(e)},remove(e){var t;n=mL(n,e),(t=n[0])==null||t.resume()}}}function mL(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function Uae(n){return n.filter(e=>e.tagName!=="A")}var QA=0;
vendor: 1,204 bytes, line 461
461function YT(){E.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??gL()),document.body.insertAdjacentElement("beforeend",n[1]??gL()),QA++,()=>{QA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),QA--}},[])}function gL(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Px="right-scroll-bar-position",jx="width-before-scroll-bar",zae="with-scroll-bars-hidden",qae="--removed-body-scroll-bar-size";function ZA(n,e){return typeof n=="function"?n(e):n&&(n.current=e),n}function Hae(n,e){var t=E.useState(function(){return{value:n,callback:e,facade:{get current(){return t.value},set current(r){var i=t.value;i!==r&&(t.value=r,t.callback(r,i))}}}})[0];return t.callback=e,t.facade}var Wae=typeof window<"u"?E.useLayoutEffect:E.useEffect,vL=new WeakMap;function Vae(n,e){var t=Hae(null,function(r){return n.forEach(function(i){return ZA(i,r)})});return Wae(function(){var r=vL.get(t);if(r){var i=new Set(r),s=new Set(n),a=t.current;
vendor: 4,224 bytes, lines 461-476
461i.forEach(function(o){s.has(o)||ZA(o,null)}),s.forEach(function(o){i.has(o)||ZA(o,a)})}vL.set(t,n)},[n]),t}function Gae(n){return n}function Kae(n,e){e===void 0&&(e=Gae);var t=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(s){var a=e(s,r);return t.push(a),function(){t=t.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;t.length;){var a=t;t=[],a.forEach(s)}t={push:function(o){return s(o)},filter:function(){return t}}},assignMedium:function(s){r=!0;var a=[];if(t.length){var o=t;t=[],o.forEach(s),a=t}var l=function(){var u=a;a=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),t={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),t}}}};return i}function Yae(n){n===void 0&&(n={});var e=Kae(null);return e.options=Na({async:!0,ssr:!1},n),e}var i$=function(n){var e=n.sideCar,t=Zd(n,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Na({},t))};i$.isSideCarExport=!0;function Xae(n,e){return n.useMedium(e),i$}var s$=Yae(),eE=function(){},sS=E.forwardRef(function(n,e){var t=E.useRef(null),r=E.useState({onScrollCapture:eE,onWheelCapture:eE,onTouchMoveCapture:eE}),i=r[0],s=r[1],a=n.forwardProps,o=n.children,l=n.className,c=n.removeScrollBar,u=n.enabled,f=n.shards,p=n.sideCar,h=n.noRelative,b=n.noIsolation,g=n.inert,w=n.allowPinchZoom,y=n.as,x=y===void 0?"div":y,S=n.gapMode,A=Zd(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,T=Vae([t,e]),R=Na(Na({},A),i);return E.createElement(E.Fragment,null,u&&E.createElement(C,{sideCar:s$,removeScrollBar:c,shards:f,noRelative:h,noIsolation:b,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:t,gapMode:S}),a?E.cloneElement(E.Children.only(o),Na(Na({},R),{ref:T})):E.createElement(x,Na({},R,{className:l,ref:T}),o))});sS.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sS.classNames={fullWidth:jx,zeroRight:Px};var Jae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Qae(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var e=Jae();return e&&n.setAttribute("nonce",e),n}function Zae(n,e){n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}function eoe(n){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(n)}var toe=function(){var n=0,e=null;return{add:function(t){n==0&&(e=Qae())&&(Zae(e,t),eoe(e)),n++},remove:function(){n--,!n&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},noe=function(){var n=toe();return function(e,t){E.useEffect(function(){return n.add(e),function(){n.remove()}},[e&&t])}},a$=function(){var n=noe(),e=function(t){var r=t.styles,i=t.dynamic;return n(r,i),null};return e},roe={left:0,top:0,right:0,gap:0},tE=function(n){return parseInt(n||"",10)||0},ioe=function(n){var e=window.getComputedStyle(document.body),t=e[n==="padding"?"paddingLeft":"marginLeft"],r=e[n==="padding"?"paddingTop":"marginTop"],i=e[n==="padding"?"paddingRight":"marginRight"];return[tE(t),tE(r),tE(i)]},soe=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return roe;var e=ioe(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},aoe=a$(),Km="data-scroll-locked",ooe=function(n,e,t,r){var i=n.left,s=n.top,a=n.right,o=n.gap;return t===void 0&&(t="margin"),`
462  .`.concat(zae,` {
463   overflow: hidden `).concat(r,`;
464   padding-right: `).concat(o,"px ").concat(r,`;
465  }
466  body[`).concat(Km,`] {
467    overflow: hidden `).concat(r,`;
468    overscroll-behavior: contain;
469    `).concat([e&&"position: relative ".concat(r,";"),t==="margin"&&`
470    padding-left: `.concat(i,`px;
471    padding-top: `).concat(s,`px;
472    padding-right: `).concat(a,`px;
473    margin-left:0;
474    margin-top:0;
475    margin-right: `).concat(o,"px ").concat(r,`;
476    `),t==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";
476")].filter(Boolean).join(""),`
477  }
478  
479  .`).concat(Px,` {
480    right: `).concat(o,"px ").concat(r,`;
481  }
482  
483  .`).concat(jx,` {
484    margin-right: `).concat(o,"px ").concat(r,`;
485  }
486  
487  .`).concat(Px," .").concat(Px,` {
488    right: 0 `).concat(r,`;
489  }
490  
491  .`).concat(jx," .").concat(jx,` {
492    margin-right: 0 `).concat(r,`;
493  }
494  
495  body[`).concat(Km,`] {
496    `).concat(qae,": ").concat(o,`px;
497  }
498`)},yL=function(){var n=parseInt(document.body.getAttribute(Km)||"0",10);return isFinite(n)?n:0},loe=function(){E.useEffect(function(){return document.body.setAttribute(Km,(yL()+1).toString()),function(){var n=yL()-1;n<=0?document.body.removeAttribute(Km):document.body.setAttribute(Km,n.toString())}},[])},coe=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r;loe();var s=E.useMemo(function(){return soe(i)},[i]);return E.createElement(aoe,{styles:ooe(s,!e,i,t?"":"!important")})},jC=!1;if(typeof window<"u")try{var b2=Object.defineProperty({},"passive",{get:function(){return jC=!0,!0}});window.addEventListener("test",b2,b2),window.removeEventListener("test",b2,b2)}catch{jC=!1}var em=jC?{passive:!1}:!1,uoe=function(n){return n.tagName==="TEXTAREA"},o$=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!uoe(n)&&t[e]==="visible")},doe=function(n){return o$(n,"overflowY")},hoe=function(n){return o$(n,"overflowX")},bL=function(n,e){var t=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=l$(n,r);if(i){var s=c$(n,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},foe=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},poe=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},l$=function(n,e){return n==="v"?doe(e):hoe(e)},c$=function(n,e){return n==="v"?foe(e):poe(e)},moe=function(n,e){return n==="h"&&e==="rtl"?-1:1},goe=function(n,e,t,r,i){var s=moe(n,window.getComputedStyle(e).direction),a=s*r,o=t.target,l=e.contains(o),c=!1,u=a>0,f=0,p=0;do{if(!o)break;var h=c$(n,o),b=h[0],g=h[1],w=h[2],y=g-w-s*b;(b||y)&&l$(n,o)&&(f+=y,p+=b);var x=o.parentNode;o=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(u&&(Math.abs(f)<1||!i)||!u&&(Math.abs(p)<1||!i))&&(c=!0),c},w2=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},wL=function(n){return[n.deltaX,n.deltaY]},xL=function(n){return n&&"current"in n?n.current:n},voe=function(n,e){return n[0]===e[0]&&n[1]===e[1]},yoe=function(n){return`
499  .block-interactivity-`.concat(n,` {pointer-events: none;}
500  .allow-interactivity-`).concat(n,` {pointer-events: all;}
501`)},boe=0,tm=[];function woe(n){var e=E.useRef([]),t=E.useRef([0,0]),r=E.useRef(),i=E.useState(boe++)[0],s=E.useState(a$)[0],a=E.useRef(n);E.useEffect(function(){a.current=n},[n]),E.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var g=ST([n.lockRef.current],(n.shards||[]).map(xL),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var o=E.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var y=w2(g),x=t.current,S="deltaX"in g?g.deltaX:x[0]-y[0],A="deltaY"in g?g.deltaY:x[1]-y[1],C,T=g.target,R=Math.abs(S)>Math.abs(A)?"h":"v";if("touches"in g&&R==="h"&&T.type==="range")return!1;var I=bL(R,T);if(!I)return!0;if(I?C=R:(C=R==="v"?"h":"v",I=bL(R,T)),!I)return!1;if(!r.current&&"changedTouches"in g&&(S||A)&&(r.current=C),!C)return!0;var L=r.current||C;return goe(L,w,g,L==="h"?S:A,!0)},[]),l=E.useCallback(function(g){var w=g;if(!(!tm.length||tm[tm.length-1]!==s)){var y="deltaY"in w?wL(w):w2(w),x=e.current.filter(function(C){return C.name===w.t
vendor: 4,636 bytes, line 501
501ype&&(C.target===w.target||w.target===C.shadowParent)&&voe(C.delta,y)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(xL).filter(Boolean).filter(function(C){return C.contains(w.target)}),A=S.length>0?o(w,S[0]):!a.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),c=E.useCallback(function(g,w,y,x){var S={name:g,delta:w,target:y,should:x,shadowParent:xoe(y)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(A){return A!==S})},1)},[]),u=E.useCallback(function(g){t.current=w2(g),r.current=void 0},[]),f=E.useCallback(function(g){c(g.type,wL(g),g.target,o(g,n.lockRef.current))},[]),p=E.useCallback(function(g){c(g.type,w2(g),g.target,o(g,n.lockRef.current))},[]);E.useEffect(function(){return tm.push(s),n.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,em),document.addEventListener("touchmove",l,em),document.addEventListener("touchstart",u,em),function(){tm=tm.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,em),document.removeEventListener("touchmove",l,em),document.removeEventListener("touchstart",u,em)}},[]);var h=n.removeScrollBar,b=n.inert;return E.createElement(E.Fragment,null,b?E.createElement(s,{styles:yoe(i)}):null,h?E.createElement(coe,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function xoe(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const _oe=Xae(s$,woe);var aS=E.forwardRef(function(n,e){return E.createElement(sS,Na({},n,{ref:e,sideCar:_oe}))});aS.classNames=sS.classNames;var Soe=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},nm=new WeakMap,x2=new WeakMap,_2={},nE=0,u$=function(n){return n&&(n.host||u$(n.parentNode))},Aoe=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=u$(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},Eoe=function(n,e,t,r){var i=Aoe(e,Array.isArray(n)?n:[n]);_2[t]||(_2[t]=new WeakMap);var s=_2[t],a=[],o=new Set,l=new Set(i),c=function(f){!f||o.has(f)||(o.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(o.has(p))u(p);else try{var h=p.getAttribute(r),b=h!==null&&h!=="false",g=(nm.get(p)||0)+1,w=(s.get(p)||0)+1;nm.set(p,g),s.set(p,w),a.push(p),g===1&&b&&x2.set(p,!0),w===1&&p.setAttribute(t,"true"),b||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return u(e),o.clear(),nE++,function(){a.forEach(function(f){var p=nm.get(f)-1,h=s.get(f)-1;nm.set(f,p),s.set(f,h),p||(x2.has(f)||f.removeAttribute(r),x2.delete(f)),h||f.removeAttribute(t)}),nE--,nE||(nm=new WeakMap,nm=new WeakMap,x2=new WeakMap,_2={})}},XT=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=Soe(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Eoe(r,i,t,"aria-hidden")):function(){return null}},oS="Dialog",[d$,h$]=cs(oS),[Noe,Fo]=d$(oS),f$=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=n,o=E.useRef(null),l=E.useRef(null),[c,u]=Fa({prop:r,defaultProp:i??!1,onChange:s,caller:oS});return d.jsx(Noe,{scope:e,triggerRef:o,contentRef:l,contentId:Po(),titleId:Po(),descriptionId:Po(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(f=>!f),[u]),modal:a,children:t})};f$.displayName=oS;var p$="DialogTrigger",m$=E.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Fo(p$,t),s=Xt(e,i.triggerRef);return d.jsx(yt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ZT(i.open),...r,ref:s,onClick:rt(n.onClick,i.onOpenToggle)})});m$.displayName=p$;var JT="DialogPortal",[koe,g$]=d$(JT,{forceMount:void 0}),v$=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=Fo(JT,e);return d.jsx(koe,{scope:e,forceMount:t,children:E.Children.map(r,a=>d.jsx(Do,{present:t||s.open,children:d.jsx(Rb,{asChild:!0,container:i,children:a})}))})};v$.displayName=JT;var I_="DialogOverlay",y$=E.forwardRef((n,e)=>{const t=g$(I_,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=Fo(I_,n.__scopeDialog);return s.modal?d.jsx(Do,{present:r||s.open,children:d.jsx(Toe,{...i,ref:e})}):null});y$.displayName=I_;var Coe=lp("DialogOverlay.RemoveScroll"),Toe=E.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Fo(I_,t);return d.jsx(aS,{as:Coe,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(yt.div,{"data-state":ZT(i.open
vendor: 4,503 bytes, lines 501-505
501),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),pp="DialogContent",b$=E.forwardRef((n,e)=>{const t=g$(pp,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=Fo(pp,n.__scopeDialog);return d.jsx(Do,{present:r||s.open,children:s.modal?d.jsx(Poe,{...i,ref:e}):d.jsx(joe,{...i,ref:e})})});b$.displayName=pp;var Poe=E.forwardRef((n,e)=>{const t=Fo(pp,n.__scopeDialog),r=E.useRef(null),i=Xt(e,t.contentRef,r);return E.useEffect(()=>{const s=r.current;if(s)return XT(s)},[]),d.jsx(w$,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(n.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:rt(n.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:rt(n.onFocusOutside,s=>s.preventDefault())})}),joe=E.forwardRef((n,e)=>{const t=Fo(pp,n.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return d.jsx(w$,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=n.onCloseAutoFocus)==null||a.call(n,s),s.defaultPrevented||(r.current||(o=t.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=n.onInteractOutside)==null||l.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),w$=E.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=n,o=Fo(pp,t),l=E.useRef(null),c=Xt(e,l);return YT(),d.jsxs(d.Fragment,{children:[d.jsx(iS,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(j0,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":ZT(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Loe,{titleId:o.titleId}),d.jsx(Ooe,{contentRef:l,descriptionId:o.descriptionId})]})]})}),QT="DialogTitle",x$=E.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Fo(QT,t);return d.jsx(yt.h2,{id:i.titleId,...r,ref:e})});x$.displayName=QT;var _$="DialogDescription",S$=E.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Fo(_$,t);return d.jsx(yt.p,{id:i.descriptionId,...r,ref:e})});S$.displayName=_$;var A$="DialogClose",E$=E.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Fo(A$,t);return d.jsx(yt.button,{type:"button",...r,ref:e,onClick:rt(n.onClick,()=>i.onOpenChange(!1))})});E$.displayName=A$;function ZT(n){return n?"open":"closed"}var N$="DialogTitleWarning",[Roe,k$]=WV(N$,{contentName:pp,titleName:QT,docsSlug:"dialog"}),Loe=({titleId:n})=>{const e=k$(N$),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
502
503If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
504
505For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return E.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},Ioe="DialogDescriptionWarning",Ooe=({contentRef:n,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${k$(Ioe).contentName}}.`;return E.useEffect(()=>{var s;const i=(s=n.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,n,e]),null},eP=f$,tP=m$,nP=v$,Hb=y$,Wb=b$,Vb=x$,Gb=S$,lS=E$;const Ua=eP,Q1=tP,Moe=nP,C$=E.forwardRef(({className:n,...e},t)=>d.jsx(Hb,{ref:t,className:We("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e}));C$.displayName=Hb.displayName;const aa=E.forwardRef(({className:n,children:e,...t},r)=>d.jsxs(Moe,{children:[d.jsx(C$,{}),d.jsxs(Wb,{ref:r,className:We("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
505nded-lg",n),...t,children:[e,d.jsxs(lS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[d.jsx(Ba,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));aa.displayName=Wb.displayName;const Zc=({className:n,...e})=>d.jsx("div",{className:We("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});Zc.displayName="DialogHeader";const T$=({className:n,...e})=>d.jsx("div",{className:We("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});T$.displayName="DialogFooter";const Fl=E.forwardRef(({className:n,...e},t)=>d.jsx(Vb,{ref:t,className:We("text-lg font-semibold leading-none tracking-tight",n),...e}));Fl.displayName=Vb.displayName;const P$=E.forwardRef(({className:n,...e},t)=>d.jsx(Gb,{ref:t,className:We("text-sm text-muted-foreground",n),...e}));P$.displayName=Gb.displayName;const rE=768;function Doe(){const[n,e]=E.useState(void 0);return E.useEffect(()=>{const t=window.matchMedia(`(max-width: ${rE-1}px)`),r=()=>{e(window.innerWidth<rE)};return t.addEventListener("change",r),e(window.innerWidth<rE),()=>t.removeEventListener("change",r)},[]),!!n}KT.workerSrc=`//unpkg.com/pdfjs-dist@${WB}/build/pdf.worker.min.mjs`;const Foe=({isOpen:n,onClose:e,pdfUrl:t,title:r})=>{const[i,s]=E.useState(0),[a,o]=E.useState(1),[l,c]=E.useState(1),[u,f]=E.useState(1),[p,h]=E.useState(!0),[b,g]=E.useState(!1),[w,y]=E.useState(null),[x,S]=E.useState(null),[A,C]=E.useState(!0),[T,R]=E.useState("single"),[I,L]=E.useState(null),V=E.useRef(null),j=Doe(),$=E.useCallback(()=>{if(A)try{const ye=new AudioContext,Re=()=>{const Te=ye.currentTime,it=Math.floor(ye.sampleRate*.35),He=ye.createBuffer(1,it,ye.sampleRate),Ce=He.getChannelData(0);for(let ze=0;ze<it;ze++){const Vt=ze/it,Ct=Math.pow(1-Vt,1.5)*Math.sin(Vt*Math.PI*.8);Ce[ze]=(Math.random()*2-1)*Ct*.4}const Je=ye.createBufferSource();Je.buffer=He;const De=ye.createBiquadFilter();De.type="bandpass",De.frequency.value=2500,De.Q.value=.5;const Qe=ye.createGain();Qe.gain.setValueAtTime(.6,Te),Qe.gain.exponentialRampToValueAtTime(.01,Te+.35),Je.connect(De),De.connect(Qe),Qe.connect(ye.destination),Je.start(Te),Je.stop(Te+.35),Je.onended=()=>{ye.close().catch(()=>{})}};ye.state==="suspended"?ye.resume().then(Re).catch(()=>ye.close()):Re()}catch{}},[A]),J=E.useCallback(({numPages:ye})=>{s(ye),h(!1)},[]),H=E.useCallback(ye=>{I||L({width:ye.width,height:ye.height})},[I]);E.useEffect(()=>{if(!V.current||!I||!n)return;const ye=()=>{const Y=V.current;if(!Y)return;const Te=j?20:120,it=j?20:40,He=Y.clientWidth-Te,Ce=Y.clientHeight-it,Je=!j&&T==="double"&&a>1?2:1,De=I.width*Je,Qe=I.height,ze=He/De,Vt=Ce/Qe,Ct=Math.min(ze,Vt,j?2:1.5);f(Math.max(Ct,.3)),c(Math.max(Ct,.3))};ye();const Re=new ResizeObserver(ye);return Re.observe(V.current),()=>Re.disconnect()},[I,T,a,n,j]);const le=j?"single":T,oe=E.useCallback((ye,Re)=>{if(Re==="single"||j)return[ye];if(i<=0)return[1];if(ye<=1)return[1];const Y=ye%2===0?ye:ye-1,Te=Y+1<=i?Y+1:null;return Te!=null?[Y,Te]:[Y]},[i,j]),se=i<=1?1:i%2===0?i:i-1,O=oe(a,le),te=x!=null?oe(x,le):O,he=b&&x!=null?te:O,ge=b&&x!=null?x:a,D=!b&&a>1,G=!b&&(T==="double"?a===1?i>1:a<se:a<i),ee=E.useCallback(()=>{if(!D)return;g(!0),y("prev"),$();const ye=T==="double"&&a>2?Math.max(a-2,1):Math.max(a-1,1);S(ye)},[D,a,$,T]),ae=E.useCallback(()=>{if(!G)return;g(!0),y("next"),$();const ye=T==="double"?a===1?2:Math.min(a+2,se):Math.min(a+1,i);S(ye)},[G,a,se,i,$,T]),X=E.useCallback(ye=>{ye.animationName!=="flipToLeft"&&ye.animationName!=="flipToRight"||(x!=null&&o(x),g(!1),y(null),S(null))},[x]),Q=()=>c(ye=>Math.min(ye+.1,1.5)),ue=()=>c(ye=>Math.max(ye-.1,.4)),pe=()=>c(u),me=E.useCallback(ye=>{ye.key==="ArrowLeft"?ee():ye.key==="ArrowRight"?ae():ye.key==="Escape"&&e()},[ee,ae,e]);E.useEffect(()=>{n&&(o(1),g(!1),y(null),S(null),R("single"),L(null))},[n]);const _e=T==="double"?O[1]??O[0]??1:a,Ee=T==="double"?O[0]??O[1]??1:a;return d.jsx(Ua,{open:n,onOpenChange:e,children:d.jsxs(aa,{className:`${j?"w-screen h-screen max-w-none max-h-none rounded-none":"max-w-7xl w-[98vw] h-[95vh]"} p-0 bg-stone-900 border-stone-700`,onKeyDown:me,children:[d.jsxs("div",{className:`flex items-center justify-between ${j?"px-2 py-2":"px-4 py-3"} border-b border-stone-700 bg-stone-800`,children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[d.jsx("h3",{className:`font-display ${j?"text-sm":"text-lg"} font-semibold text-stone-100 truncate`,children:j?"PDF":r||"Document PDF"}),d.jsxs("span",{className:`${j?"text-xs":"text-sm"} text-stone-400 shrink-0`,children:[ge,"/",i]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[!j&&d.jsxs("div",{className:"flex items-center gap-1 bg-stone-700 rounded-lg p-1 mr-2",children:[d.jsxs(Oe,{variant:"ghost",size:"sm",disabled:b,onClick:()=>{S(null),R("single")},className:`h-7 px-2 gap-1 ${T==="single"?"bg-stone-600 text-stone-100":"text-stone-400 hover:text-stone-200"}`,children:[d.jsx(XG,{className:"h-3 w-3"}),d.jsx("span",{className:"text-xs",children:"1 page"})]}),d.jsxs(Oe,{variant:"ghost",size:"sm",disabled:b,onClick:()=>{S(null),R("double"),o(ye=>ye>1&&ye%2===1?ye-1:ye)},className:`h-7 px-2 gap-1 ${T==="double"?"bg-stone-600 text-stone-100":"text-stone-400 hover:text-stone-200"}`,children:[d.jsx(TN,{className:"h-3 w-3"}),d.jsx("span",{className:"text-xs",children:"2 pages"})]})]}),!j&&d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>C(!A),className:"h-8 w-8 text-stone-300 hover:text-stone-100 hover:bg-stone-700",children:A?d.jsx(hK,{className:"h-4 w-4"}):d.jsx(fK,{className:"h-4 w-4"})}),!j&&d.jsxs("div",{className:"flex items-center gap-1 mr-2",children:[d.jsx(Oe,{variant:"ghost",size:"icon",onClick:ue,disabled:l<=.3,className:"h-8 w-8 text-stone-300 hover:text-stone-100 hover:bg-stone-700",children:d.jsx(mK,{className:"h-4 w-4"})}),d.jsxs(Oe,{variant:"ghost",size:"sm",onClick:pe,className:"h-8 px-2 text-xs text-stone-300 hover:text-stone-100 hover:bg-stone-700",children:[Math.round(l*100),"%"]}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:Q,disabled:l>=1.5,className:"h-8 w-8 text-stone-300 hover:text-stone-100 hover:bg-stone-700",children:d.jsx(r8,{className:"h-4 w-4"})})]}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:e,className:`${j?"h-10 w-10":"h-8 w-8"} text-stone-300 hover:text-stone-100 hover:bg-stone-700`,children:d.jsx(Ba,{className:j?"h-6 w-6":"h-4 w-4"})})]})]}),d.jsxs("div",{ref:V,className:`flex-1 flex items-center justify-center overflow-auto ${j?"p-1":"p-4"} relative bg-gradient-to-b from-stone-900 to-stone-950`,children:[j?d.jsxs(d.Fragment,{children:[d.jsx(Oe,{variant:"secondary",size:"icon",onClick:ee,disabled:!D,className:"absolute left-2 bottom-16 z-20 h-12 w-12 rounded-full shadow-2xl bg-stone-800/90 backdrop-blur-sm hover:bg-stone-700 text-stone-100 border border-stone-600",children:d.jsx(PN,{className:"h-6 w-6"})}),d.jsx(Oe,{variant:"secondary",size:"icon",onClick:ae,disabled:!G,className:"absolute right-2 bottom-16 z-20 h-12 w-12 rounded-full shadow-2xl bg-stone-800/90 backdrop-blur-sm hover:bg-stone-700 text-stone-100 border border-stone-600",children:d.jsx(jN,{className:"h-6 w-6"})})]}):d.jsx(Oe,{variant:"secondary",size:"icon",onClick:ee,disabled:!D,className:"absolute left-4 z-20 h-14 w-14 roun
505ded-full shadow-2xl bg-stone-800/90 backdrop-blur-sm hover:bg-stone-700 text-stone-100 border border-stone-600",children:d.jsx(PN,{className:"h-8 w-8"})}),d.jsxs("div",{className:"book-container",style:{perspective:"1500px"},children:[p&&d.jsxs("div",{className:"flex flex-col items-center gap-4 absolute inset-0 z-10 bg-stone-900/80 backdrop-blur-sm justify-center",children:[d.jsx("div",{className:"w-12 h-12 border-4 border-primary/30 border-t-primary rounded-full animate-spin"}),d.jsx("p",{className:"text-stone-400",children:"Chargement du livre..."})]}),d.jsx(Aae,{file:t,onLoadSuccess:J,loading:null,children:d.jsxs("div",{className:"book-wrapper",style:{transformStyle:"preserve-3d"},children:[d.jsx("div",{className:`book-pages ${b?w==="next"?"flipping-next":"flipping-prev":""}`,children:d.jsxs("div",{className:"pages-container",style:{display:"flex",position:"relative",justifyContent:he.length===1?"center":"flex-start"},children:[he.map((ye,Re)=>d.jsx("div",{className:"page-wrapper",style:{position:"relative",boxShadow:he.length>1?Re===0?"inset -10px 0 30px -10px rgba(0,0,0,0.2)":"inset 10px 0 30px -10px rgba(0,0,0,0.2)":"0 0 30px rgba(0,0,0,0.3)"},children:d.jsx(YA,{pageNumber:ye,scale:l,renderTextLayer:!1,renderAnnotationLayer:!1,className:"pdf-page",onLoadSuccess:H})},`current-${ye}-${Re}`)),b&&w==="next"&&x!=null&&d.jsxs("div",{className:"flipping-page flip-to-left",onAnimationEnd:X,style:{position:"absolute",top:0,left:O.length>1?"50%":0,width:O.length>1?"50%":"100%",transformOrigin:"left center",transformStyle:"preserve-3d",zIndex:10,overflow:"hidden"},children:[d.jsx("div",{className:"page-front",children:d.jsx(YA,{pageNumber:_e,scale:l,renderTextLayer:!1,renderAnnotationLayer:!1,className:"pdf-page"})}),d.jsx("div",{className:"page-back",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"rotateY(180deg)",backfaceVisibility:"hidden"}})]}),b&&w==="prev"&&x!=null&&d.jsxs("div",{className:"flipping-page flip-to-right",onAnimationEnd:X,style:{position:"absolute",top:0,left:O.length>1?0:void 0,right:O.length===1?0:void 0,width:O.length>1?"50%":"100%",transformOrigin:"right center",transformStyle:"preserve-3d",zIndex:10,overflow:"hidden"},children:[d.jsx("div",{className:"page-front",children:d.jsx(YA,{pageNumber:Ee,scale:l,renderTextLayer:!1,renderAnnotationLayer:!1,className:"pdf-page"})}),d.jsx("div",{className:"page-back",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"rotateY(-180deg)",backfaceVisibility:"hidden"}})]})]})}),le==="double"&&he.length>1&&d.jsx("div",{className:"book-spine",style:{position:"absolute",left:"50%",top:0,bottom:0,width:"4px",background:"linear-gradient(to right, #78716c, #a8a29e, #78716c)",transform:"translateX(-50%)",zIndex:5}})]})})]}),!j&&d.jsx(Oe,{variant:"secondary",size:"icon",onClick:ae,disabled:!G,className:"absolute right-4 z-20 h-14 w-14 rounded-full shadow-2xl bg-stone-800/90 backdrop-blur-sm hover:bg-stone-700 text-stone-100 border border-stone-600",children:d.jsx(jN,{className:"h-8 w-8"})})]}),d.jsx("div",{className:`${j?"px-2 py-2":"px-4 py-3"} border-t border-stone-700 bg-stone-800`,children:d.jsxs("div",{className:"flex items-center justify-center gap-2",children:[d.jsx("div",{className:`flex-1 ${j?"max-w-full":"max-w-md"} h-2 bg-stone-700 rounded-full overflow-hidden`,children:d.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:i?`${ge/i*100}%`:"0%"}})}),d.jsxs("span",{className:`${j?"text-xs":"text-sm"} text-stone-400 min-w-[60px] text-center`,children:[ge," / ",i]})]})})]})})},Boe=()=>{const[n,e]=E.useState(!1);return d.jsxs("section",{className:"py-16 md:py-24 bg-gradient-to-br from-primary/10 via-background to-accent/10",children:[d.jsx("div",{className:"container mx-auto px-4",children:d.jsxs("div",{className:"max-w-5xl mx-auto",children:[d.jsxs("div",{className:"text-center mb-12",children:[d.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-primary/20 mb-6",children:d.jsx(JG,{className:"w-10 h-10 text-primary"})}),d.jsx("h2",{className:"font-display text-3xl md:text-4xl font-bold text-foreground mb-4",children:"L'histoire du chemin de fer à La Réunion"}),d.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:"Une épopée ferroviaire unique qui a façonné l'île pe
505ndant près d'un siècle, reliant les hommes et les territoires à travers un réseau audacieux."})]}),d.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 items-center",children:[d.jsxs("button",{onClick:()=>e(!0),className:"group block text-left relative mx-auto",children:[d.jsxs("div",{className:"relative rounded-lg overflow-hidden shadow-2xl transition-all duration-500 group-hover:shadow-primary/30 group-hover:scale-[1.02] max-w-sm",children:[d.jsx("img",{src:tre,alt:"L'histoire du chemin de fer à La Réunion - Couverture",className:"w-full h-auto"}),d.jsx("div",{className:"absolute inset-0 bg-primary/0 group-hover:bg-primary/20 transition-colors duration-300 flex items-center justify-center",children:d.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-all duration-300 transform group-hover:scale-100 scale-90",children:d.jsx("div",{className:"bg-primary text-primary-foreground rounded-full p-5 shadow-2xl",children:d.jsx(TN,{className:"w-10 h-10"})})})}),d.jsx("div",{className:"absolute top-4 right-4 bg-primary text-primary-foreground px-3 py-1 rounded-full text-sm font-medium shadow-lg",children:"PDF interactif"})]}),d.jsxs("div",{className:"mt-6 text-center",children:[d.jsx("p",{className:"text-lg font-semibold text-foreground mb-2",children:"Feuilleter le livre en ligne"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Cliquez pour découvrir l'histoire complète du Ti Train"})]})]}),d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-lg",children:[d.jsx("h3",{className:"font-display text-2xl font-bold text-foreground mb-4",children:"Un patrimoine à préserver"}),d.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"De Saint-Benoît à Saint-Pierre, le chemin de fer réunionnais a transporté voyageurs et marchandises à travers des paysages spectaculaires. Tunnels, ponts et viaducs témoignent encore aujourd'hui de cette prouesse technique."}),d.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"L'association Ti Train œuvre pour la sauvegarde et la valorisation de ce patrimoine exceptionnel, notamment sur le site de la Grande Chaloupe."})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{className:"bg-card rounded-xl p-4 text-center shadow-md",children:[d.jsx(Ml,{className:"w-6 h-6 mx-auto mb-2 text-primary"}),d.jsx("p",{className:"text-2xl font-bold text-foreground",children:"1882"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Inauguration"})]}),d.jsxs("div",{className:"bg-card rounded-xl p-4 text-center shadow-md",children:[d.jsx(tT,{className:"w-6 h-6 mx-auto mb-2 text-primary"}),d.jsx("p",{className:"text-2xl font-bold text-foreground",children:"12"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Gares principales"})]}),d.jsxs("div",{className:"bg-card rounded-xl p-4 text-center shadow-md",children:[d.jsx(C5,{className:"w-6 h-6 mx-auto mb-2 text-primary"}),d.jsx("p",{className:"text-2xl font-bold text-foreground",children:"1976"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Dernier voyage"})]})]}),d.jsxs(Oe,{onClick:()=>e(!0),size:"lg",className:"w-full gap-2",children:[d.jsx(TN,{className:"w-5 h-5"}),"Ouvrir le livre"]})]})]})]})}),d.jsx(Foe,{isOpen:n,onClose:()=>e(!1),pdfUrl:"/documents/expo-titrain-histoire.pdf",title:"L'histoire du chemin de fer à La Réunion"})]})},$oe="/assets/membership-bg-titrain-CTzNX4Kl.png",Uoe=[{icon:e8,title:"Soutenez le patrimoine",description:"Participez à la préservation de l'histoire ferroviaire réunionnaise"},{icon:Mb,title:"Communauté passionnée",description:"Rejoignez une famille de passionnés du Ti Train"}];function zoe(){return d.jsxs("section",{className:"py-24 lg:py-36 text-white relative overflow-hidden",children:[d.jsx("div",{className:"absolute inset-0 bg-contain bg-center bg-no-repeat",style:{backgroundImage:`url(${$oe})`}}),d.jsx("div",{className:"absolute inset-0 bg-stone-800 -z-10"}),d.jsx("div",{className:"absolute inset-0 bg-amber-900/50"}),d.jsx("div",{className:"container relative",children:d.jsxs("div",{className:"max-w-4xl mx-auto text-center space-y-6",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-black uppercase tracking-wider",children:"Rejoignez l'aventure"}),d.jsxs("h2",{className:"text-3xl lg:text-5xl font-display font-bold",children:["Devenez membre de"," ",d.jsx("span",{className:"text-gold",children:"Ti Train Réunion"})]}),d.jsx("p",{className:"text-lg text-white/90 max-w-2xl mx-auto font-bold",children:"En adhérant à notre association, vous contribuez activement à la sauvegarde de ce patrimoine unique et bénéficiez d'avantages exclusifs."}),d.jsx("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-6 py-8",children:Uoe.map((n,e)=>d.jsxs("div",{className:"text-center p-4 rounded-xl bg-black/40 backdrop-blur-md hover:bg-black/50 transition-colors border border-white/10 w-full sm:w-64",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-gold/20 text-gold mx-auto mb-3",children:d.jsx(n.icon,{className:"h-6 w-6"})}),d.jsx("h3",{className:"font-display font-semibold mb-1 text-white",children:n.title}),d.jsx("p",{className:"text-sm text-white/70",children:n.description})]},e))}),d.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-4",children:[d.jsx(Oe,{asChild:!0,size:"lg",className:"bg-gold text-gold-foreground hover:bg-gold/90 text-base px-8",children:d.jsx($n,{to:"/adhesion",children:"Adhérer maintenant"})}),d.jsxs("p",{className:"text-sm text-white/60",children:["À partir de ",d.jsx("span",{className:"font-semibold text-gold",children:"15€ / an"})]})]})]})})]})}
505const On=E.forwardRef(({className:n,...e},t)=>d.jsx("div",{ref:t,className:We("rounded-lg border bg-card text-card-foreground shadow-sm",n),...e}));On.displayName="Card";const Ra=E.forwardRef(({className:n,...e},t)=>d.jsx("div",{ref:t,className:We("flex flex-col space-y-1.5 p-6",n),...e}));Ra.displayName="CardHeader";const La=E.forwardRef(({className:n,...e},t)=>d.jsx("h3",{ref:t,className:We("text-2xl font-semibold leading-none tracking-tight",n),...e}));La.displayName="CardTitle";const Ym=E.forwardRef(({className:n,...e},t)=>d.jsx("p",{ref:t,className:We("text-sm text-muted-foreground",n),...e}));Ym.displayName="CardDescription";const Mn=E.forwardRef(({className:n,...e},t)=>d.jsx("div",{ref:t,className:We("p-6 pt-0",n),...e}));Mn.displayName="CardContent";const qoe=E.forwardRef(({className:n,...e},t)=>d.jsx("div",{ref:t,className:We("flex items-center p-6 pt-0",n),...e}));qoe.displayName="CardFooter";const Hoe=[{id:1,name:"T-shirt Ti Train Vintage",price:25,image:"https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=400&q=80",category:"Vêtements"},{id:2,name:"Mug Locomotive 1882",price:12,image:"https://images.unsplash.com/photo-1514228742587-6b1558fcca3d?w=400&q=80",category:"Accessoires"},{id:3,name:"Affiche Grande Chaloupe",price:18,image:"https://images.unsplash.com/photo-1513475382585-d06e58bcb0e0?w=400&q=80",category:"Décoration"}];function Woe(){const[n,e]=E.useState(null);return E.useEffect(()=>{(async()=>{const{data:r}=await Xe.from("settings").select("value").eq("key","boutique_enabled").single();e((r==null?void 0:r.value)!=="false")})()},[]),n===null||!n?null:d.jsx("section",{className:"py-16 lg:py-24 bg-muted/50",children:d.jsxs("div",{className:"container",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4 mb-10",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-sm font-medium text-primary uppercase tracking-wider",children:"Souvenirs"}),d.jsx("h2",{className:"text-3xl lg:text-4xl font-display font-bold text-foreground mt-2",children:"La Boutique du Ti Train"}),d.jsx("p",{className:"text-muted-foreground mt-2 max-w-lg",children:"Repartez avec un souvenir unique et soutenez notre association"})]}),d.jsx(Oe,{asChild:!0,variant:"outline",children:d.jsxs($n,{to:"/boutique",children:["Voir la boutique",d.jsx(m0,{className:"ml-2 h-4 w-4"})]})})]}),d.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:Hoe.map((t,r)=>d.jsxs(On,{className:"overflow-hidden group hover:shadow-elevated transition-all duration-300",children:[d.jsx("div",{className:"aspect-square overflow-hidden bg-muted",children:d.jsx("img",{src:t.image,alt:t.name,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"})}),d.jsxs(Mn,{className:"p-5",children:[d.jsx("span",{className:"text-xs font-medium text-primary uppercase tracking-wider",children:t.category}),d.jsx("h3",{className:"font-display text-lg font-semibold text-foreground mt-1 group-hover:text-primary transition-colors",children:t.name}),d.jsxs("div",{className:"flex items-center justify-between mt-3",children:[d.jsxs("span",{className:"text-xl font-bold text-foreground",children:[t.price,"€"]}),d.jsx(Oe,{asChild:!0,size:"sm",variant:"secondary",children:d.jsxs($n,{to:`/boutique/${t.id}`,children:[d.jsx(k5,{className:"h-4 w-4 mr-1"}),"Voir"]})})]})]})]},t.id))})]})})}const Rt=E.forwardRef(({className:n,type:e,...t},r)=>d.jsx("input",{type:e,className:We("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:r,...t}));Rt.displayName="Input";const Wd=E.forwardRef(({className:n,...e},t)=>d.jsx("textarea",{className:We("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
505ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...e}));Wd.displayName="Textarea";var Voe="Label",j$=E.forwardRef((n,e)=>d.jsx(yt.label,{...n,ref:e,onMouseDown:t=>{var i;t.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));j$.displayName=Voe;var R$=j$;const Goe=Ob("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pt=E.forwardRef(({className:n,...e},t)=>d.jsx(R$,{ref:t,className:We(Goe(),n),...e}));pt.displayName=R$.displayName;var cS="Collapsible",[Koe,L$]=cs(cS),[Yoe,rP]=Koe(cS),I$=E.forwardRef((n,e)=>{const{__scopeCollapsible:t,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...o}=n,[l,c]=Fa({prop:r,defaultProp:i??!1,onChange:a,caller:cS});return d.jsx(Yoe,{scope:t,disabled:s,contentId:Po(),open:l,onOpenToggle:E.useCallback(()=>c(u=>!u),[c]),children:d.jsx(yt.div,{"data-state":sP(l),"data-disabled":s?"":void 0,...o,ref:e})})});I$.displayName=cS;var O$="CollapsibleTrigger",M$=E.forwardRef((n,e)=>{const{__scopeCollapsible:t,...r}=n,i=rP(O$,t);return d.jsx(yt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":sP(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:rt(n.onClick,i.onOpenToggle)})});M$.displayName=O$;var iP="CollapsibleContent",D$=E.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=rP(iP,n.__scopeCollapsible);return d.jsx(Do,{present:t||i.open,children:({present:s})=>d.jsx(Xoe,{...r,ref:e,present:s})})});D$.displayName=iP;var Xoe=E.forwardRef((n,e)=>{const{__scopeCollapsible:t,present:r,children:i,...s}=n,a=rP(iP,t),[o,l]=E.useState(r),c=E.useRef(null),u=Xt(e,c),f=E.useRef(0),p=f.current,h=E.useRef(0),b=h.current,g=a.open||o,w=E.useRef(g),y=E.useRef(void 0);return E.useEffect(()=>{const x=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(x)},[]),li(()=>{const x=c.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const S=x.getBoundingClientRect();f.current=S.height,h.current=S.width,w.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(r)}},[a.open,r]),d.jsx(yt.div,{"data-state":sP(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...s,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...n.style},children:g&&i})});function sP(n){return n?"open":"closed"}var Joe=I$,Qoe=M$,Zoe=D$,ele=E.createContext(void 0);function Kb(n){const e=E.useContext(ele);return n||e||"ltr"}var Bo="Accordion",tle=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[aP,nle,rle]=S5(Bo),[uS,nge]=cs(Bo,[rle,L$]),oP=L$(),F$=Ie.forwardRef((n,e)=>{const{type:t,...r}=n,i=r,s=r;return d.jsx(aP.Provider,{scope:n.__scopeAccordion,children:t==="multiple"?d.jsx(ole,{...s,ref:e}):d.jsx(ale,{...i,ref:e})})});F$.displayName=Bo;var[B$,ile]=uS(Bo),[$$,sle]=uS(Bo,{collapsible:!1}),ale=Ie.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=n,[o,l]=Fa({prop:t,defaultProp:r??"",onChange:i,caller:Bo});return d.jsx(B$,{scope:n.__scopeAccordion,value:Ie.useMemo(()=>o?[o]:[],[o]),onItemOpen:l,onItemClose:Ie.useCallback(()=>s&&l(""),[s,l]),children:d.jsx($$,{scope:n.__scopeAccordion,collapsible:s,children:d.jsx(U$,{...a,ref:e})})})}),ole=Ie.forwardRef((n,e)=>{const{value:t,defaultValue:r,onValueChange:i=()=>{},...s}=n,[a,o]=Fa({prop:t,defaultProp:r??[],onChange:i,caller:Bo}),l=Ie.useCallback(u=>o((f=[])=>[...f,u]),[o]),c=Ie.useCallback(u=>o((f=[])=>f.filter(p=>p!==u)),[o]);return d.jsx(B$,{scope:n.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:d.jsx($$,{scope:n.__scopeAccordion,collapsible:!0,children:d.jsx(U$,{...s,ref:e})})})}),[lle,dS]=uS(Bo),U$=Ie.forwardRef((n,e)=>{const{__scopeAccordion:t,disabled:r,dir:i,orientation:s="vertical",...a}=n,o=Ie.useRef(null),l=Xt(o,e),c=nle(t),f=Kb(i)==="ltr",p=rt(n.onKeyDown,h=>{var I;if(!tle.includes(h.key))return;const b=h.target,g=c().filter(L=>{var V;return!((V=L.ref.current)!=null&&V.disabled)}),w=g.findIndex(L=>L.ref.current===b),y=g.length;if(w===-1)return;h.preventDefault();let x=w;const S=0,A=y-1,C=()=>{x=w+1,x>A&&(x=S)},T=()=>{x=w-1,x<S&&(x=A)};switch(h.key){case"Home":x=S;break;case"End":x=A;break;case"ArrowRight":s==="horizontal"&&(f?C():T());break;case"ArrowDown":s==="vertical"&&C();break;case"ArrowLeft":s==="horizontal"&&(f?T():C());break;case"ArrowUp":s==="vertical"&&T();break}const R=x%y;(I=g[R].ref.current)==null||I.focus()});return d.jsx(lle,{scope:t,disabled:r,direction:i,orientation:s,children:d.jsx(aP.Slot,{scope:t,children:d.jsx(yt.div,{...a,"data-orientation":s,ref:l,onKeyDown:r?void 0:p})})})}),O_="AccordionItem",[cle,lP]=uS(O_),z$=Ie.forwardRef((n,e)=>{const{__scopeAccordion:t,value:r,...i}=n,s=dS(O_,t),a=ile(O_,t),o=oP(t),l=Po(),c=r&&a.value.includes(r)||!1,u=s.disabled||n.disabled;return d.jsx(cle,{scope:t,open:c,disabled:u,triggerId:l,children:d.jsx(Joe,{"data-orientation":s.orientation,"data-state":K$(c),...o,...i,ref:e,disabled:u,open:c,onOpenChange:f=>{f?a.onItemOpen(r):a.onItemClose(r)}})})});z$.displayName=O_;var q$="AccordionHeader",H$=Ie.forwardRef((n,e)=>{const{__scopeAccordion:t,...r}=n,i=dS(Bo,t),s=lP(q$,t);return d.jsx(yt.h3,{"data-orientation":i.orientation,"data-state":K$(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:e})});H$.displayName=q$;var RC="AccordionTrigger",W$=Ie.forwardRef((n,e)=>{const{__scopeAccordion:t,...r}=n,i=dS(Bo,t),s=lP(RC,t),a=sle(RC,t),o=oP(t);return d.jsx(aP.ItemSlot,{scope:t,children:d.jsx(Qoe,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...r,ref:e})})});W$.displayName=RC;var V$="AccordionContent",G$=Ie.forwardRef((n,e)=>{const{__scopeAccordion:t,...r}=n,i=dS(Bo,t),s=lP(V$,t),a=oP(t);return d.jsx(Zoe,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...n.style}})});G$.displayName=V$;function K$(n){return n?"open":"closed"}var ule=F$,dle=z$,hle=H$,Y$=W$,X$=G$;const fle=ule,J$=E.forwardRef(({className:n,...e},t)=>d.jsx(dle,{ref:t,className:We("border-b",n),...e}));J$.displayName="AccordionItem";const Q$=E.forwardRef(({className:n,children:e,...t},r)=>d.jsx(hle,{className:"flex",children:d.jsxs(Y$,{ref:r,className:We("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",n),...t,children:[e,d.jsx(eT,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Q$.displayName=Y$.displayName;const Z$=E.forwardRef(({className:n,children:e,...t},r)=>d.jsx(X$,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...t,children:d.jsx("div",{className:We("pb-4 pt-0",n),children:e})}));Z$.displayName=X$.displayName;const ple=[{question:"Les visites sont-elles accessibles aux personnes à mobilité réduite ?",answer:"Le site est partiellement accessible. Le quai principal et le wagon de présentation sont accessibles en fauteuil roulant. Cependant, la montée dans les wagons historiques peut être difficile. N'hé
505sitez pas à nous contacter pour plus d'informations."},{question:"Peut-on venir avec des enfants en bas âge ?",answer:"Absolument ! Les enfants de tous âges sont les bienvenus. Les poussettes peuvent circuler sur le site. Des activités spéciales sont prévues pour les plus jeunes lors des journées portes ouvertes."},{question:"Faut-il réserver pour visiter le site ?",answer:"Pour les visites libres les weekends, la réservation n'est pas obligatoire mais recommandée. Pour les visites guidées et les balades en Ti Train, la réservation est indispensable car les places sont limitées."},{question:"Y a-t-il une buvette ou un point restauration sur place ?",answer:"Oui, une petite buvette propose des boissons fraîches et des en-cas. Lors des événements spéciaux, un espace restauration plus complet est généralement installé. Vous pouvez aussi apporter votre pique-nique."},{question:"Combien de temps dure une visite complète ?",answer:"Comptez environ 1h30 à 2h pour une visite complète incluant la balade en Ti Train. La visite libre du site seul prend environ 45 minutes."},{question:"Les animaux de compagnie sont-ils acceptés ?",answer:"Les chiens tenus en laisse sont acceptés sur le site. Ils ne peuvent cependant pas monter dans les wagons du Ti Train pour des raisons de sécurité et de confort des autres visiteurs."}];function mle(){return d.jsx("section",{id:"infos-pratiques",className:"py-16 lg:py-24 bg-muted/30",children:d.jsxs("div",{className:"container",children:[d.jsxs("div",{className:"max-w-3xl mb-12",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-primary uppercase tracking-wider mb-4",children:"Préparez votre visite"}),d.jsx("h2",{className:"text-3xl lg:text-4xl font-display font-bold text-foreground mb-4",children:"Infos pratiques"}),d.jsx("p",{className:"text-lg text-muted-foreground",children:"Tout ce que vous devez savoir pour préparer votre visite à la Grande Chaloupe."})]}),d.jsxs("div",{className:"grid lg:grid-cols-3 gap-12",children:[d.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[d.jsxs("div",{className:"bg-card rounded-2xl p-6 lg:p-8 shadow-card",children:[d.jsx("h3",{className:"font-display text-2xl font-bold text-foreground mb-6",children:"Comment venir ?"}),d.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:d.jsx($G,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-foreground mb-1",children:"En voiture"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Depuis Saint-Denis : Route du Littoral, sortie La Grande Chaloupe. Depuis Saint-Paul : Direction Saint-Denis, sortie La Grande Chaloupe."})]})]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:d.jsx(FG,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-foreground mb-1",children:"En bus"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:`Ligne Car Jaune 03, arrêt "La Grande Chaloupe". Puis 3 minutes à pied jusqu'au site.`})]})]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:d.jsx(qG,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-foreground mb-1",children:"Parking"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Parking gratuit disponible sur place."})]})]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:d.jsx(tT,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-foreground mb-1",children:"Adresse"}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:["La Grande Chaloupe",d.jsx("br",{}),"La Possession"]})]})]})]}),d.jsx("div",{className:"mt-6 aspect-[16/9] rounded-xl overflow-hidden bg-muted",children:d.jsx("iframe",{src:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1500!2d55.37696534271879!3d-20.89627680461
5057745!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zMjDCsDUzJzQ2LjYiUyA1NcKwMjInMzcuMSJF!5e0!3m2!1sfr!2sfr!4v1700000000000!5m2!1sfr!2sfr",width:"100%",height:"100%",style:{border:0},allowFullScreen:!0,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:"Carte Google Maps - La Grande Chaloupe"})})]}),d.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[d.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-accent/20 text-accent",children:d.jsx(WG,{className:"h-5 w-5"})}),d.jsx("h3",{className:"font-display text-xl font-bold text-foreground",children:"Horaires"})]}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Tous les 1er dimanche du mois de 10h à 17h"})]}),d.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-card",children:[d.jsx("h3",{className:"font-display text-xl font-bold text-foreground mb-4",children:"Tarifs"}),d.jsxs("div",{className:"space-y-3 text-sm",children:[d.jsxs("div",{className:"flex justify-between py-2 border-b border-border",children:[d.jsx("span",{className:"text-muted-foreground",children:"La balade"}),d.jsx("span",{className:"font-medium text-foreground",children:"2€"})]}),d.jsxs("div",{className:"flex justify-between py-2",children:[d.jsx("span",{className:"text-muted-foreground",children:"Visite guidée"}),d.jsx("span",{className:"font-medium text-foreground",children:"5€"})]})]})]})]}),d.jsxs("div",{className:"bg-card rounded-2xl p-6 lg:p-8 shadow-card",children:[d.jsx("h3",{className:"font-display text-2xl font-bold text-foreground mb-6",children:"Questions fréquentes"}),d.jsx(fle,{type:"single",collapsible:!0,className:"w-full",children:ple.map((n,e)=>d.jsxs(J$,{value:`item-${e}`,children:[d.jsx(Q$,{className:"text-left font-medium",children:n.question}),d.jsx(Z$,{className:"text-muted-foreground",children:n.answer})]},e))})]})]}),d.jsx("div",{children:d.jsxs("div",{className:"bg-card rounded-2xl p-6 lg:p-8 shadow-card lg:sticky lg:top-24",children:[d.jsx("h3",{className:"font-display text-2xl font-bold text-foreground mb-2",children:"Nous contacter"}),d.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Une question ? N'hésitez pas à nous écrire."}),d.jsxs("div",{className:"space-y-3 mb-6 pb-6 border-b border-border",children:[d.jsxs("a",{href:"tel:+262692385391",className:"flex items-center gap-3 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(nT,{className:"h-4 w-4 text-primary"}),"0692 38 53 91"]}),d.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(N5,{className:"h-4 w-4 text-primary"}),"[email protected]"]})]}),d.jsxs("form",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"name",children:"Nom complet"}),d.jsx(Rt,{id:"name",placeholder:"Votre nom"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"email",children:"Email"}),d.jsx(Rt,{id:"email",type:"email",placeholder:"[email protected]"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"subject",children:"Sujet"}),d.jsx(Rt,{id:"subject",placeholder:"Objet de votre message"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"message",children:"Message"}),d.jsx(Wd,{id:"message",placeholder:"Votre message...",rows:4})]}),d.jsx(Oe,{type:"submit",className:"w-full",children:"Envoyer le message"})]})]})})]})]})})}const gle=()=>{const[n,e]=E.useState(!1);E.useEffect(()=>{(async()=>{if(sessionStorage.getItem("construction-notice-seen"))return;const{data:s}=await Xe.from("settings").select("value").eq("key","construction_notice_enabled").single();(s==null?void 0:s.value)==="true"&&e(!0)})()},[]);const t=()=>{sessionStorage.setItem("construction-notice-seen","true"),e(!1)};return d.jsx(Ua,{open:n,onOpenChange:e,children:d.jsxs(aa,{className:"sm:max-w-md",children:[d.jsxs(Zc,{className:"text-center",children:[d.jsx("div",{className:"flex justify-center mb-4",children:d.jsx(QM,{className:"h-12 w-12 text-primary"})}),d.jsx(Fl,{className:"text-xl text-center",children:"Site en construction"}),d.jsx(P$,{className:"text-center text-base pt-2",children:"Toutes les informations ne sont pas à jour. Certaines rubriques sont en mode démo."})]}),d.jsx("div",{className:"flex justify-center pt-4",children:d.jsx(Oe,{onClick:t,className:"px-8",children:"J'ai compris"})})]})})},vle=Ob("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Nl({className:n,variant:e,...t}){return d.jsx("div",{className:We(vle({variant:e}),n),...t})}const yle=()=>{const[n,e]=E.useState([]),[t,r]=E.useState([]),[i,s]=E.useState(!0),[a,o]=E.useState(null);Np(),E.useEffect(()=>{l()},[]),E.useEffect(()=>{(a===null||t.length>0)&&c()},[a,t]);const l=async()=>{const{data:p}=await Xe.from("blog_categories").select("*").order("sort_order",{ascending:!0});r(p||[])},c=async()=>{try{let p=Xe.from("blog_articles").select("*, category:blog_categories(*)").eq("published",!0);if(a){const g=t.find(w=>w.slug===a);g&&(p=p.eq("category_id",g.id))}const{data:h,error:b}=await p.order("is_featured",{ascending:!1}).order("published_at",{ascending:!1}).limit(6);if(b)throw b;e(h||[])}catch(p){console.error("Error fetching articles:",p)}finally{s(!1)}},u=p=>p?Ro(new Date(p),"d MMMM yyyy",{locale:zd}):"",f=p=>{o(p)};return i?null:d.jsx("section",{className:"py-16 lg:py-24 bg-muted/30",children:d.jsxs("div",{className:"container",children:[d.jsxs("div",{className:"text-center mb-10",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-primary uppercase tracking-wider mb-4",children:"Actualités"}),d.jsx("h2",{className:"text-3xl lg:text-4xl font-display font-bold text-foreground mb-4",children:"Notre Blog"}),d.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto mb-8",children:"Suivez toute l'actualité de Ti Train Réunion"}),t.length>0&&d.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-10",children:[d.jsx("button",{onClick:()=>f(null),className:`px-5 py-2.5 rounded-full text-sm font-medium transition-all duration-200 ${a===null?"bg-primary text-primary-foreground shadow-md":"bg-background border border-border text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:"Tous"}),t.map(p=>d.jsxs("button",{onClick:()=>f(p.slug),className:`px-5 py-2.5 rounded-full text-sm font-medium transition-all duration-200 flex items-center gap-2 ${a===p.slug?"bg-primary text-primary-foreground shadow-md":"bg-background border border-border text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[d.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:p.color}}),p.name]},p.id))]})]}),n.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8 mb-10",children:n.map(p=>d.jsxs(On,{className:"overflow-hidden group hover:shadow-elevated transition-all duration-300",children:[p.cover_image_url&&d.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:d.jsx("img",{src:p.cover_image_url,alt:p.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"})}),d.jsxs(Mn,{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Ml,{className:"h-4 w-4"}),u(p.published_at||p.created_at)]}),p.category&&d.jsx(Nl,{variant:"secondary",className:"cursor-pointer hover:opacity-80",style:{backgroundColor:p.category.color+"20",color:p.category.color},onClick:()=>f(p.category.slug),children:p.category.name})]}),d.jsx("h3",{className:"font-display text-xl font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:d.jsx($n,{to:`/blog/${p.slug}`,children:p.title})}),p.excerpt&&d.jsx("p",{className:"text-muted-foreground text-sm line-clamp-3",children:p.excerpt}),d.jsx("div",{className:"flex items-center justify-end pt-2",children:d.jsx(Oe,{asChild:!0,variant:"ghost",size:"sm",className:"text-primary hover:text-primary",children:d.jsxs($n,{to:`/blog/${p.slug}`,children:["Lire",d.jsx(m0,{className:"ml-1 h-4 w-4"})]})})})]})]}
505,p.id))}),d.jsx("div",{className:"text-center",children:d.jsx(Oe,{asChild:!0,variant:"outline",size:"lg",children:d.jsxs($n,{to:"/blog",children:["Voir tous les articles",d.jsx(m0,{className:"ml-2 h-4 w-4"})]})})})]})]})})},_L=n=>{const e=/youtube\.com\/shorts\/([^"&?\/\s]{11})/,t=n.match(e);if(t)return t[1];const r=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,i=n.match(r);return i?i[1]:null},SL=n=>n.includes("youtube.com")||n.includes("youtu.be"),ble=()=>{const[n,e]=E.useState([]),[t,r]=E.useState(!0);E.useEffect(()=>{(async()=>{const{data:o,error:l}=await Xe.from("gallery_items").select("id, type, title, url, thumbnail_url, youtube_id").eq("published",!0).order("created_at",{ascending:!1}).limit(8);l?console.error("Error fetching gallery items:",l):e(o||[]),r(!1)})()},[]);const i=a=>{if(a.thumbnail_url)return a.thumbnail_url;if(SL(a.url)){const o=a.youtube_id||_L(a.url);if(o)return`https://img.youtube.com/vi/${o}/hqdefault.jpg`}if(a.type==="video"){const o=a.youtube_id||_L(a.url);if(o)return`https://img.youtube.com/vi/${o}/hqdefault.jpg`}return a.url},s=a=>a.type==="video"||SL(a.url);return d.jsx("section",{className:"py-16 bg-secondary/30",children:d.jsxs("div",{className:"container mx-auto px-4",children:[d.jsxs("div",{className:"text-center mb-10",children:[d.jsx("h2",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"Galerie"}),d.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Découvrez nos photos et vidéos retraçant l'histoire et les événements du Ti Train"})]}),d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mb-8",children:n.map(a=>{const o=i(a),l=s(a);return d.jsxs($n,{to:"/galerie",className:We("group relative aspect-square overflow-hidden rounded-xl bg-muted","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"),children:[d.jsx("img",{src:o,alt:a.title||"Média galerie",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110",loading:"lazy",onError:c=>{c.currentTarget.src="/placeholder.svg"}}),d.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-foreground
505/80 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 p-3 translate-y-full group-hover:translate-y-0 transition-transform duration-300",children:d.jsx("p",{className:"text-sm font-medium text-primary-foreground line-clamp-2",children:a.title||"Sans titre"})}),l&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/90 text-primary-foreground shadow-lg group-hover:scale-110 transition-transform",children:d.jsx(n8,{className:"h-5 w-5 ml-0.5"})})})]},a.id)})}),d.jsx("div",{className:"text-center",children:d.jsx($n,{to:"/galerie",children:d.jsxs(Oe,{variant:"outline",className:"gap-2",children:[d.jsx(Rl,{className:"h-4 w-4"}),"Voir toute la galerie",d.jsx(m0,{className:"h-4 w-4"})]})})})]})})};function wle(){const[n,e]=E.useState(null),[t,r]=E.useState(!1);E.useEffect(()=>{i()},[]);const i=async()=>{try{const{data:a,error:o}=await Xe.from("event_modals").select("*").eq("active",!0).gte("end_date",new Date().toISOString()).lte("start_date",new Date().toISOString()).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(o)throw o;if(a){const l=sessionStorage.getItem("dismissedEventModals");(l?JSON.parse(l):[]).includes(a.id)||(e(a),r(!0))}}catch(a){console.error("Error fetching event modal:",a)}},s=()=>
505{if(n){const a=sessionStorage.getItem("dismissedEventModals"),o=a?JSON.parse(a):[];o.push(n.id),sessionStorage.setItem("dismissedEventModals",JSON.stringify(o))}r(!1)};return n?d.jsx(Ua,{open:t,onOpenChange:s,children:d.jsxs(aa,{className:"max-w-[98vw] sm:max-w-2xl w-auto p-0 overflow-hidden max-h-[90vh] overflow-y-auto rounded-lg",children:[n.image_url&&d.jsx("div",{className:"flex justify-center w-full",children:d.jsx("img",{src:n.image_url,alt:n.title,className:"w-auto max-w-full sm:max-w-[90vw] max-h-[35vh] sm:max-h-[50vh] object-contain"})}),d.jsxs("div",{className:"p-4 sm:p-6 space-y-3 sm:space-y-4",children:[d.jsxs(Zc,{className:"space-y-2",children:[(n.event_date||n.event_time)&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary font-medium",children:[d.jsx(Ml,{className:"h-4 w-4"}),d.jsxs("span",{children:[n.event_date&&Ro(new Date(n.event_date),"d MMMM yyyy",{locale:zd}),n.event_date&&n.event_time&&" • ",n.event_time]})]}),n.event_price&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground font-medium",children:[d.jsx(GG,{className:"h-4 w-4"}),d.jsx("span",{children:n.event_price})]}),d.jsx(Fl,{className:"font-display text-2xl font-bold text-foreground",children:n.title})]}),n.description&&d.jsx("p",{className:"text-muted-foreground leading-relaxed",children:n.description}),d.jsxs("div",{className:"flex gap-3 pt-2",children:[n.button_link&&d.jsx(Oe,{asChild:!0,className:"flex-1",children:d.jsxs("a",{href:n.button_link,target:"_blank",rel:"noopener noreferrer",children:[n.button_text||"En savoir plus",d.jsx(m0,{className:"ml-2 h-4 w-4"})]})}),d.jsx(Oe,{variant:"outline",onClick:s,children:"Fermer"})]})]})]})}):null}const xle=()=>d.jsxs(jo,{children:[d.jsx(wle,{}),d.jsx(gle,{}),d.jsx(Qne,{}),d.jsx(ere,{}),d.jsx(Boe,{}),d.jsx(yle,{}),d.jsx(ble,{}),d.jsx(zoe,{}),d.jsx(Woe,{}),d.jsx(mle,{})]});function _le({className:n,...e}){return d.jsx("div",{className:We("animate-pulse rounded-md bg-muted",n),...e})}const S2=n=>{const e=/(?:youtube\.com\/(?:shorts\/|[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,t=n.match(e);return t?t[1]:null},A2=n=>{const e=/(?:vimeo\.com\/(?:video\/|channels\/[^\/]+\/)?|player\.vimeo\.com\/video\/)(\d+)/,t=n.match(e);return t?t[1]:null};function Sle(){const[n,e]=E.useState([]),[t,r]=E.useState([]),[i,s]=E.useState("all"),[a,o]=E.useState(null),[l,c]=E.useState(!0);E.useEffect(()=>{u()},[]);const u=async()=>{c(!0);const[g,w]=await Promise.all([Xe.from("gallery_albums").select("id, title, slug").eq("published",!0).order("sort_order",{ascending:!0}),Xe.from("gallery_items").select("*").eq("published",!0).order("created_at",{ascending:!1})]);g.data&&e(g.data),w.data&&r(w.data),c(!1)},f=t.filter(g=>{const w=g.youtube_id||S2(g.url),y=A2(g.url),x=g.type==="video"||!!w||!!y;return i==="all"?!0:i==="photos"?!x:i==="videos"?x:g.album_id===i}),p=g=>{const w=g.youtube_id||S2(g.url);if(w)return`https://www.youtube.com/embed/${w}`;const y=A2(g.url);return y?`https://player.vimeo.com/video/${y}`:null},h=g=>{if(g.thumbnail_url)return g.thumbnail_url;const w=g.youtube_id||S2(g.url);if(w)return`https://i.ytimg.com/vi/${w}/0.jpg`;const y=A2(g.url);return y?`https://vumbnail.com/${y}.jpg`:g.url},b=g=>{const w=g.youtube_id||S2(g.url),y=A2(g.url);return g.type==="video"||!!w||!!y};return d.jsxs(jo,{children:[d.jsx("section",{className:"py-16 lg:py-24 bg-muted/50",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"max-w-3xl",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-primary uppercase tracking-wider mb-4",children:"Galerie"}),d.jsx("h1",{className:"text-4xl lg:text-5xl font-display font-bold text-foreground mb-4",children:"Photos & Vidéos"}),d.jsx("p",{className:"text-lg text-muted-foreground",children:"Découvrez le Ti Train en images : événements, travaux de restauration, vie de l'association et souvenirs partagés."})]})})}),d.jsx("section",{className:"py-8 border-b border-border sticky top-16 lg:top-20 bg-background/95 backdrop-blur z-40",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Oe,{variant:i==="all"?"default":"outline",size:"sm",onClick:()=>s("all"),className:"gap-2",children:[d.jsx(Rl,{className:"h-4 w-4"}),"Tout"]}),d.jsxs(Oe,{variant:i==="photos"?"default":"outline",size:"sm",onClick:()=>s("photos"),className:"gap-2",children:[d.jsx(Rl,{className:"h-4 w-4"}),"Photos"]}),d.jsxs(Oe,{variant:i==="videos"?"default":"outline",size:"sm",onClick:()=>s("videos"),className:"gap-2",children:[d.jsx(c_,{className:"h-4 w-4"}),"Vidéos"]}),n.map(g=>d.jsxs(Oe,{variant:i===g.id?"default":"outline",size:"sm",onClick:()=>s(g.id),className:"gap-2",children:[d.jsx(ZM,{className:"h-4 w-4"}),g.title]},g.id))]})})}),d.jsx("section",{className:"py-12 lg:py-16",children:d.jsx("div",{className:"container",children:l?d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[...Array(8)].map((g,w)=>d.jsx(_le,{className:"aspect-square rounded-xl"},w))}):f.length===0?d.jsxs("div",{className:"text-center py-16",children:[d.jsx(Rl,{className:"h-16 w-16 mx-auto text-muted-foreground
505/50 mb-4"}),d.jsx("p",{className:"text-muted-foreground",children:"Aucun média dans la galerie pour le moment."})]}):d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(g=>{const w=h(g),y=b(g),x=w&&!w.includes("vimeo.com/");return d.jsxs("button",{onClick:()=>o(g),className:We("group relative aspect-square overflow-hidden rounded-xl bg-muted","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"),children:[x?d.jsx("img",{src:w,alt:g.title||"Média",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110",loading:"lazy",onError:S=>{var R;const A=S.currentTarget,C=A.getAttribute("src")||"";if(C.includes("img.youtube.com")||C.includes("i.ytimg.com")){const I=[["/0.jpg","/hqdefault.jpg"],["hqdefault.jpg","mqdefault.jpg"],["/mqdefault.jpg","/1.jpg"],["/1.jpg","/2.jpg"],["/2.jpg","/3.jpg"]];for(const[L,V]of I)if(C.includes(L)){A.src=C.replace(L,V);return}}A.style.display="none",(R=A.nextElementSibling)==null||R.classList.remove("hidden")}}):null,d.jsx("div",{className:We("absolute inset-0 flex items-center justify-center bg-muted",x?"hidden":""),children:d.jsx(c_,{className:"h-12 w-12 text-muted-foreground"})}),d.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-foreground
505/80 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),d.jsx("div",{className:"absolute inset-x-0 bottom-0 p-4 translate-y-full group-hover:translate-y-0 transition-transform duration-300",children:d.jsx("p",{className:"text-sm font-medium text-primary-foreground line-clamp-2",children:g.title||"Sans titre"})}),y&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:d.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/90 text-primary-foreground shadow-lg group-hover:scale-110 transition-transform",children:d.jsx(n8,{className:"h-6 w-6 ml-1"})})})]},g.id)})})})}),d.jsx(Ua,{open:!!a,onOpenChange:()=>o(null),children:d.jsxs(aa,{className:"max-w-4xl p-0 overflow-hidden bg-foreground","aria-describedby":void 0,children:[d.jsx(Lb,{children:d.jsx(Fl,{children:(a==null?void 0:a.title)||"Média"})}),a&&d.jsxs("div",{className:"relative",children:[d.jsx("button",{onClick:()=>o(null),className:"absolute top-4 right-4 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-background/20 text-primary-foreground backdrop-blur hover:bg-background/30 transition-colors",children:d.jsx(Ba,{className:"h-5 w-5"})}),b(a)?d.jsx("div",{className:"w-full flex justify-center bg-black",children:d.jsx("iframe",{src:p(a)||"",title:a.title||"Vidéo",className:"w-full max-w-2xl aspect-video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",allowFullScreen:!0})}):d.jsx("img",{src:a.url,alt:a.title||"Photo",className:"w-full"}),d.jsxs("div",{className:"p-4 bg-background",children:[d.jsx("p",{className:"font-display font-semibold text-foreground",children:a.title||"Sans titre"}),a.description&&d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description})]})]})]})})]})}function Ale(){const[n,e]=E.useState([]),[t,r]=E.useState([]),[i,s]=E.useState(!0),[a,o]=qQ(),l=a.get("categorie");E.useEffect(()=>{c(),u()},[l]);const c=async()=>{const{data:h}=await Xe.from("blog_categories").select("*").order("sort_order",{ascending:!0});r(h||[])},u=async()=>{try{let h=Xe.from("blog_articles").select("*, category:blog_categories(*)").eq("published",!0).order("is_featured",{ascending:!1}).order("published_at",{ascending:!1});if(l){const w=t.find(y=>y.slug===l);w&&(h=h.eq("category_id",w.id))}const{data:b,error:g}=await h;if(g)throw g;e(b||[])}catch(h){console.error("Error fetching articles:",h)}finally{s(!1)}},f=h=>h?Ro(new Date(h),"d MMMM yyyy",{locale:zd}):"",p=h=>{o(h?{categorie:h}:{})};return d.jsxs(jo,{children:[d.jsx("section",{className:"py-16 lg:py-24 bg-muted/50",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-primary uppercase tracking-wider mb-4",children:"Actualités"}),d.jsx("h1",{className:"text-4xl lg:text-5xl font-display font-bold text-foreground mb-4",children:"Notre Blog"}),d.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Suivez toute l'actualité de Ti Train Réunion : événements, travaux, vie de l'association et découvertes historiques."}),t.length>0&&d.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[d.jsx("button",{onClick:()=>p(null),className:`px-5 py-2.5 rounded-full text-sm font-medium transition-all duration-200 ${l?"bg-background border border-border text-muted-foreground hover:bg-muted hover:text-foreground":"bg-primary text-primary-foreground shadow-md"}`,children:"Tout"}),t.map(h=>d.jsxs("button",{onClick:()=>p(h.slug),className:`px-5 py-2.5 rounded-full text-sm font-medium transition-all duration-200 flex items-center gap-2 ${l===h.slug?"text-white shadow-md":"bg-background border border-border text-muted-foreground hover:bg-muted hover:text-foreground"}`,style:l===h.slug?{backgroundColor:h.color}:{},children:[d.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:l===h.slug?"white":h.color}}),h.name]},h.id))]})]})})}),d.jsx("section",{className:"py-12 lg:py-16",children:d.jsx("div",{className:"container",children:i?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):n.length===0?d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:l?"Aucun article dans cette catégorie pour le moment.":"Aucun article publié pour le moment."}),l&&d.jsx(Oe,{variant:"link",onClick:()=>p(null),className:"mt-2",children:"Voir tous les articles"})]}):d.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(h=>d.jsxs(On,{className:"overflow-hidden group hover:shadow-elevated transition-all duration-300",children:[h.cover_image_url&&d.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:d.jsx("img",{src:h.cover_image_url,alt:h.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"})}),d.jsxs(Mn,{className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(Ml,{className:"h-4 w-4"}),f(h.published_at||h.created_at)]}),h.category&&d.jsx(Nl,{variant:"secondary",className:"cursor-pointer hover:opacity-80",style:{backgroundColor:h.category.color+"20",color:h.category.color},onClick:()=>
505p(h.category.slug),children:h.category.name})]}),d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:d.jsx($n,{to:`/blog/${h.slug}`,children:h.title})}),h.excerpt&&d.jsx("p",{className:"text-muted-foreground text-sm line-clamp-3",children:h.excerpt}),d.jsx("div",{className:"flex items-center justify-end pt-2",children:d.jsx(Oe,{asChild:!0,variant:"ghost",size:"sm",className:"text-primary hover:text-primary",children:d.jsxs($n,{to:`/blog/${h.slug}`,children:["Lire",d.jsx(m0,{className:"ml-1 h-4 w-4"})]})})})]})]},h.id))})})})]})}const Ele=/\[(?:IMAGE|PDF|LIEN):([^\]]+)\]/g,iE=/(https?:\/\/[^\s<]+[^\s<.,;:!?'")}\]])/g;function eU({content:n}){const[e,t]=E.useState(null),[r,i]=E.useState(null),s=c=>c.split(iE).map((f,p)=>iE.test(f)?(iE.lastIndex=0,d.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-words",children:f},p)):f),o=(c=>{const u=[];let f=0,p;const h=new RegExp(Ele.source,"g");for(;(p=h.exec(c))!==null;){if(p.index>f){const w=c.slice(f,p.index);w.trim()&&u.push({type:"text",content:w})}const b=p[0],g=p[1];if(b.startsWith("[IMAGE:"))u.push({type:"image",content:g});else if(b.startsWith("[PDF:"))u.push({type:"pdf",content:g});else if(b.startsWith("[LIEN:")){const w=g.indexOf("://");if(w>0){let y=-1,x=0;for(let S=w+3;S<g.length;S++){if(g[S]==="/"&&x++,g[S]===":"&&x>0){y=S;break}if(g[S]===":"&&S>w+5){const A=g.slice(w+3,S);if(!A.includes("/")&&A.includes(".")){y=S;break}}}if(y>0){const S=g.slice(0,y),A=g.slice(y+1);u.push({type:"link",content:S,linkText:A||S})}else u.push({type:"link",content:g,linkText:g})}else{const y=g.lastIndexOf(":");y>0?u.push({type:"link",content:g.slice(0,y),linkText:g.slice(y+1)}):u.push({type:"link",content:g,linkText:g})}}f=p.index+p[0].length}if(f<c.length){const b=c.slice(f);b.trim()&&u.push({type:"text",content:b})}return u})(n),l=c=>{try{const u=c.split("/");return u[u.length-1].replace(/^\d+-[a-z0-9]+\./,"").replace(/\.(webp|pdf)$/i,"")}catch{return"Document"}};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"prose prose-lg max-w-none text-foreground space-y-6",children:o.map((c,u)=>{if(c.type==="text")return d.jsx("div",{children:c.content.split(`
506`).map((f,p)=>f.trim()&&d.jsx("p",{className:"mb-4 text-foreground/90 leading-relaxed",children:s(f)},p))},u);if(c.type==="link")return d.jsx("a",{href:c.content,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline font-medium",children:c.linkText||c.content},u);if(c.type==="image")return d.jsx("figure",{className:"my-8",children:d.jsxs("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg",onClick:()=>t(c.content),children:[d.jsx("img",{src:c.content,alt:"Image de l'article",className:"w-full h-auto rounded-lg transition-transform duration-300 group-hover:scale-[1.02]",loading:"lazy",onError:f=>{console.error("Image failed to load:",c.content),f.currentTarget.style.display="none"}}),d.jsx("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/10 transition-colors flex items-center justify-center pointer-events-none",children:d.jsx(r8,{className:"w-10 h-10 text-white opacity-0 group-hover:opacity-100 transition-opacity drop-shadow-lg"})})]})},u);if(c.type==="pdf"){const f=c.content,p=`https://docs.google.com/viewer?url=${encodeURIComponent(f)}&embedded=true`;return d.jsx("div",{className:"my-8",children:d.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 border",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center",children:d.jsx(E5,{className:"w-6 h-6 text-primary"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-foreground",children:"Document PDF"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:l(f)})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Oe,{variant:"outline",size:"sm",onClick:()=>i(f),children:"Plein écran"}),d.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:d.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:[d.jsx(RN,{className:"w-4 h-4 mr-2"}),"Télécharger"]})})]})]}),d.jsx("div",{className:"rounded-lg overflow-hidden border bg-white",children:d.jsx("iframe",{src:p,className:"w-full h-[500px]",title:"Aperçu PDF",frameBorder:"0"})})]})},u)}return null})}),d.jsx(Ua,{open:!!e,onOpenChange:()=>t(null),children:d.jsxs(aa,{className:"max-w-[95vw] max-h-[95vh] p-0 bg-black/95 border-none",children:[d.jsx(Oe,{variant:"ghost",size:"icon",className:"absolute top-4 right-4 z-10 text-white hover:bg-white/20",onClick:()=>t(null),children:d.jsx(Ba,{className:"w-6 h-6"})}),e&&d.jsx("img",{src:e,alt:"Image en plein écran",className:"w-full h-full object-contain max-h-[90vh]"})]})}),d.jsx(Ua,{open:!!r,onOpenChange:()=>i(null),children:d.jsxs(aa,{className:"max-w-[95vw] max-h-[95vh] p-0",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b bg-background",children:[d.jsx("span",{className:"font-medium",children:"Document PDF"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Oe,{variant:"outline",size:"sm",asChild:!0,children:d.jsxs("a",{href:r||"",target:"_blank",rel:"noopener noreferrer",children:[d.jsx(RN,{className:"w-4 h-4 mr-2"}),"Télécharger"]})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>i(null),children:d.jsx(Ba,{className:"w-4 h-4"})})]})]}),r&&d.jsx("iframe",{src:`https://docs.google.com/viewer?url=${encodeURIComponent(r)}&embedded=true`,className:"w-full h-[80vh]",title:"PDF Viewer",frameBorder:"0"})]})})]})}function Nle(){const{slug:n}=fQ(),[e,t]=E.useState(null),[r,i]=E.useState(!0),[s,a]=E.useState(!1);E.useEffect(()=>{n&&o(n)},[n]);const o=async c=>{try{const{data:u,error:f}=await Xe.from("blog_articles").select("*").eq("slug",c).eq("published",!0).maybeSingle();if(f)throw f;u?t(u):a(!0)}catch(u){console.error("Error fetching article:",u),a(!0)}finally{i(!1)}},l=c=>c?Ro(new Date(c),"d MMMM yyyy",{locale:zd}):"";return r?d.jsx(jo,{children:d.jsx("div",{className:"container py-16",children:d.jsx("div",{className:"flex justify-center py-12",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})})})}):s||!e?d.jsx(jo,{children:d.jsx("div",{className:"container py-16",children:d.jsxs("div",{className:"text-center py-12",children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Article non trouvé"}),d.jsx("p",{className:"text-muted-foreground mb-6",children:"Cet article n'existe pas ou n'est plus disponible."}),d.jsx(Oe,{asChild:!0,children:d.jsxs($n,{to:"/blog",children:[d.jsx(jj,{className:"mr-2 h-4 w-4"}),"Retour au blog"]})})]})})}):d.jsxs(jo,{children:[e.cover_image_url&&d.jsxs("div",{className:"relative h-[40vh] lg:h-[50vh] overflow-hidden",children:[d.jsx("img",{src:e.cover_image_url,alt:e.title,className:"w-full h-full object-cover"}),d.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/80 to-transparent"})]}),d.jsx("article",{className:"container py-12 lg:py-16",children:d.jsxs("div",{className:"max-w-3xl mx-auto",children:[d.jsx(Oe,{asChild:!0,variant:"ghost",className:"mb-6 -ml-4",children:d.jsxs($n,{to:"/blog",children:[d.jsx(jj,{className:"mr-2 h-4 w-4"}),"Retour au blog"]})}),d.jsxs("header",{className:"mb-8",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary mb-4",children:[d.jsx(Ml,{className:"h-4 w-4"}),l(e.published_at||e.created_at)]}),d.jsx("h1",{className:"text-3xl lg:text-4xl font-display font-bold text-foreground mb-4",children:e.title}),e.excerpt&&d.jsx("p",{className:"text-lg text-muted-foreground",children:e.excerpt})]}
vendor: 6,471 bytes, line 506
506),e.content&&d.jsx(eU,{content:e.content})]})})]})}var sE="rovingFocusGroup.onEntryFocus",kle={bubbles:!1,cancelable:!0},Yb="RovingFocusGroup",[LC,tU,Cle]=S5(Yb),[Tle,hS]=cs(Yb,[Cle]),[Ple,jle]=Tle(Yb),nU=E.forwardRef((n,e)=>d.jsx(LC.Provider,{scope:n.__scopeRovingFocusGroup,children:d.jsx(LC.Slot,{scope:n.__scopeRovingFocusGroup,children:d.jsx(Rle,{...n,ref:e})})}));nU.displayName=Yb;var Rle=E.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=n,p=E.useRef(null),h=Xt(e,p),b=Kb(s),[g,w]=Fa({prop:a,defaultProp:o??null,onChange:l,caller:Yb}),[y,x]=E.useState(!1),S=Da(c),A=tU(t),C=E.useRef(!1),[T,R]=E.useState(0);return E.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(sE,S),()=>I.removeEventListener(sE,S)},[S]),d.jsx(Ple,{scope:t,orientation:r,dir:b,loop:i,currentTabStopId:g,onItemFocus:E.useCallback(I=>w(I),[w]),onItemShiftTab:E.useCallback(()=>x(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(I=>I+1),[]),onFocusableItemRemove:E.useCallback(()=>R(I=>I-1),[]),children:d.jsx(yt.div,{tabIndex:y||T===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...n.style},onMouseDown:rt(n.onMouseDown,()=>{C.current=!0}),onFocus:rt(n.onFocus,I=>{const L=!C.current;if(I.target===I.currentTarget&&L&&!y){const V=new CustomEvent(sE,kle);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const j=A().filter(oe=>oe.focusable),$=j.find(oe=>oe.active),J=j.find(oe=>oe.id===g),le=[$,J,...j].filter(Boolean).map(oe=>oe.ref.current);sU(le,u)}}C.current=!1}),onBlur:rt(n.onBlur,()=>x(!1))})})}),rU="RovingFocusGroupItem",iU=E.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...o}=n,l=Po(),c=s||l,u=jle(rU,t),f=u.currentTabStopId===c,p=tU(t),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:g}=u;return E.useEffect(()=>{if(r)return h(),()=>b()},[r,h,b]),d.jsx(LC.ItemSlot,{scope:t,id:c,focusable:r,active:i,children:d.jsx(yt.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...o,ref:e,onMouseDown:rt(n.onMouseDown,w=>{r?u.onItemFocus(c):w.preventDefault()}),onFocus:rt(n.onFocus,()=>u.onItemFocus(c)),onKeyDown:rt(n.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const y=Ole(w,u.orientation,u.dir);if(y!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=p().filter(A=>A.focusable).map(A=>A.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const A=S.indexOf(w.currentTarget);S=u.loop?Mle(S,A+1):S.slice(A+1)}setTimeout(()=>sU(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});iU.displayName=rU;var Lle={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ile(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function Ole(n,e,t){const r=Ile(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lle[r]}function sU(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function Mle(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var aU=nU,oU=iU;function cP(n){const e=E.useRef({value:n,previous:n});return E.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var uP="Radio",[Dle,lU]=cs(uP),[Fle,Ble]=Dle(uP),cU=E.forwardRef((n,e)=>{const{__scopeRadio:t,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:l,form:c,...u}=n,[f,p]=E.useState(null),h=Xt(e,w=>p(w)),b=E.useRef(!1),g=f?c||!!f.closest("form"):!0;return d.jsxs(Fle,{scope:t,checked:i,disabled:a,children:[d.jsx(yt.button,{type:"button",role:"radio","aria-checked":i,"data-state":fU(i),"data-disabled":a?"":void 0,disabled:a,value:o,...u,ref:h,onClick:rt(n.onClick,w=>{i||l==null||l(),g&&(b.current=w.isPropagationStopped(),b.current||w.stopPropagation())})}),g&&d.jsx(hU,{control:f,bubbles:!b.current,name:r,value:o,checked:i,required:s,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});cU.displayName=uP;var uU="RadioIndicator",dU=E.forwardRef((n,e)=>{const{__scopeRadio:t,forceMount:r,...i}=n,s=Ble(uU,t);return d.jsx(Do,{present:r||s.checked,children:d.jsx(yt.span,{"data-state":fU(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});dU.displayName=uU;var $le="RadioBubbleInput",hU=E.forwardRef(({__scopeRadio:n,control:e,checked:t,bubbles:r=!0,...i},s)=>{const a=E.useRef(null),o=Xt(a,s),l=cP(t),c=dT(e);return E.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==t&&h){const b=new Event("click",{bubbles:r});h.call(u,t),u.dispatchEvent(b)}},[l,t,r]),d.jsx(yt.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...i,tabIndex:-1,ref:o,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});hU.displayName=$le;function fU(n){return n?"checked":"unchecked"}var Ule=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fS="RadioGroup",[zle,rge]=cs(fS,[hS,lU]),pU=hS(),mU=lU(),[qle,Hle]=zle(fS),gU=E.forwardRef((n,e)=>{const{__scopeRadioGroup:t,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...p}=n,h=pU(t),b=Kb(c),[g,w]=Fa({prop:s,defaultProp:i??null,onChange:f,caller:fS});return d.jsx(qle,{scope:t,name:r,required:a,disabled:o,value:g,onValueChange:w,children:d.jsx(aU,{asChild:!0,...h,orientation:l,dir:b,loop:u,children:d.jsx(yt.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":o?"":void 0,dir:b,...p,ref:e})})})});gU.displayName=fS;var vU="RadioGroupItem",yU=E.forwardRef((n,e)=>{const{__scopeRadioGroup:t,disabled:r,...i}=n,s=Hle(vU,t),a=s.disabled||r,o=pU(t),l=mU(t),c=E.useRef(null),u=Xt(e,c),f=s.value===i.value,p=E.useRef(!1);return E.useEffect(()=>{const h=g=>{Ule.includes(g.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",b)}},[]),d.jsx(oU,{asChild:!0,...o,focusable:!a,active:f,children:d.jsx(cU,{disabled:a,required:s.required,
vendor: 5,931 bytes, line 506
506checked:f,...l,...i,name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:rt(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:rt(i.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});yU.displayName=vU;var Wle="RadioGroupIndicator",bU=E.forwardRef((n,e)=>{const{__scopeRadioGroup:t,...r}=n,i=mU(t);return d.jsx(dU,{...i,...r,ref:e})});bU.displayName=Wle;var wU=gU,xU=yU,Vle=bU;const _U=E.forwardRef(({className:n,...e},t)=>d.jsx(wU,{className:We("grid gap-2",n),...e,ref:t}));_U.displayName=wU.displayName;const SU=E.forwardRef(({className:n,...e},t)=>d.jsx(xU,{ref:t,className:We("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...e,children:d.jsx(Vle,{className:"flex items-center justify-center",children:d.jsx(HG,{className:"h-2.5 w-2.5 fill-current text-current"})})}));SU.displayName=xU.displayName;function wn(n){"@babel/helpers - typeof";return wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wn(n)}var Mo=Uint8Array,ea=Uint16Array,dP=Int32Array,hP=new Mo([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]),fP=new Mo([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]),AL=new Mo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),AU=function(n,e){for(var t=new ea(31),r=0;r<31;++r)t[r]=e+=1<<n[r-1];for(var i=new dP(t[30]),r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)i[s]=s-t[r]<<5|r;return{b:t,r:i}},EU=AU(hP,2),Gle=EU.b,IC=EU.r;Gle[28]=258,IC[258]=28;var Kle=AU(fP,0),EL=Kle.r,OC=new ea(32768);for(var zn=0;zn<32768;++zn){var Cu=(zn&43690)>>1|(zn&21845)<<1;Cu=(Cu&52428)>>2|(Cu&13107)<<2,Cu=(Cu&61680)>>4|(Cu&3855)<<4,OC[zn]=((Cu&65280)>>8|(Cu&255)<<8)>>1}var y1=function(n,e,t){for(var r=n.length,i=0,s=new ea(e);i<r;++i)n[i]&&++s[n[i]-1];var a=new ea(e);for(i=1;i<e;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(t){o=new ea(1<<e);var l=15-e;for(i=0;i<r;++i)if(n[i])for(var c=i<<4|n[i],u=e-n[i],f=a[n[i]-1]++<<u,p=f|(1<<u)-1;f<=p;++f)o[OC[f]>>l]=c}else for(o=new ea(r),i=0;i<r;++i)n[i]&&(o[i]=OC[a[n[i]-1]++]>>15-n[i]);return o},mp=new Mo(288);for(var zn=0;zn<144;++zn)mp[zn]=8;for(var zn=144;zn<256;++zn)mp[zn]=9;for(var zn=256;zn<280;++zn)mp[zn]=7;for(var zn=280;zn<288;++zn)mp[zn]=8;var M_=new Mo(32);for(var zn=0;zn<32;++zn)M_[zn]=5;var Yle=y1(mp,9,0),Xle=y1(M_,5,0),NU=function(n){return(n+7)/8|0},Jle=function(n,e,t){return(t==null||t>n.length)&&(t=n.length),new Mo(n.subarray(e,t))},sc=function(n,e,t){t<<=e&7;var r=e/8|0;n[r]|=t,n[r+1]|=t>>8},Rv=function(n,e,t){t<<=e&7;var r=e/8|0;n[r]|=t,n[r+1]|=t>>8,n[r+2]|=t>>16},aE=function(n,e){for(var t=[],r=0;r<n.length;++r)n[r]&&t.push({s:r,f:n[r]});var i=t.length,s=t.slice();if(!i)return{t:CU,l:0};if(i==1){var a=new Mo(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(C,T){return C.f-T.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,f=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=i-1;)o=t[t[c].f<t[f].f?c++:f++],l=t[c!=u&&t[c].f<t[f].f?c++:f++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var h=new ea(p+1),b=MC(t[u-1],h,0);if(b>e){var r=0,g=0,w=b-e,y=1<<w;for(s.sort(function(T,R){return h[R.s]-h[T.s]||T.f-R.f});r<i;++r){var x=s[r].s;if(h[x]>e)g+=y-(1<<b-h[x]),h[x]=e;else break}for(g>>=w;g>0;){var S=s[r].s;h[S]<e?g-=1<<e-h[S]++-1:++r}for(;r>=0&&g;--r){var A=s[r].s;h[A]==e&&(--h[A],++g)}b=e}return{t:new Mo(h),l:b}},MC=function(n,e,t){return n.s==-1?Math.max(MC(n.l,e,t+1),MC(n.r,e,t+1)):e[n.s]=t},NL=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new ea(++e),r=0,i=n[0],s=1,a=function(l){t[r++]=l},o=1;o<=e;++o)if(n[o]==i&&o!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=n[o]}return{c:t.subarray(0,r),n:e}},Lv=function(n,e){for(var t=0,r=0;r<e.length;++r)t+=n[r]*e[r];return t},kU=function(n,e,t){var r=t.length,i=NU(e+2);n[i]=r&255,n[i+1]=r>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var s=0;s<r;++s)n[i+s+4]=t[s];return(i+4+r)*8},kL=function(n,e,t,r,i,s,a,o,l,c,u){sc(e,u++,t),++i[256];for(var f=aE(i,15),p=f.t,h=f.l,b=aE(s,15),g=b.t,w=b.l,y=NL(p),x=y.c,S=y.n,A=NL(g),C=A.c,T=A.n,R=new ea(19),I=0;I<x.length;++I)++R[x[I]&31];for(var I=0;I<C.length;++I)++R[C[I]&31];for(var L=aE(R,7),V=L.t,j=L.l,$=19;$>4&&!V[AL[$-1]];--$);var J=c+5<<3,H=Lv(i,mp)+Lv(s,M_)+a,le=Lv(i,p)+Lv(s,g)+a+14+3*$+Lv(R,V)+2*R[16]+3*R[17]+7*R[18];if(l>=0&&J<=H&&J<=le)return kU(e,u,n.subarray(l,l+c));var oe,se,O,te;if(sc(e,u,1+(le<H)),u+=2,le<H){oe=y1(p,h,0),se=p,O=y1(g,w,0),te=g;var he=y1(V,j,0);sc(e,u,S-257),sc(e,u+5,T-1),sc(e,u+10,$-4),u+=14;for(var I=0;I<$;++I)sc(e,u+3*I,V[AL[I]]);u+=3*$;for(var ge=[x,C],D=0;D<2;++D)for(var G=ge[D],I=0;I<G.length;++I){var ee=G[I]&31;sc(e,u,he[ee]),u+=V[ee],ee>15&&(sc(e,u,G[I]>>5&127),u+=G[I]>>12)}}else oe=Yle,se=mp,O=Xle,te=M_;for(var I=0;I<o;++I){var ae=r[I];if(ae>255){var ee=ae>>18&31;Rv(e,u,oe[ee+257]),u+=se[ee+257],ee>7&&(sc(e,u,ae>>23&31),u+=hP[ee]);var X=ae&31;Rv(e,u,O[X]),u+=te[X],X>3&&(Rv(e,u,ae>>5&8191),u+=fP[X])}else Rv(e,u,oe[ae]),u+=se[ae]}return Rv(e,u,oe[256]),u+se[256]},Qle=new dP([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),CU=new Mo(0),Zle=function(n,e,t,r,i,s){var a=s.z||n.length,o=new Mo(r+a+5*(1+Math.ceil(a/7e3))+i),l=o.subarray(r,o.length-i),c=s.l,u=(s.r||0)&7;if(e){u&&(l[0]=s.r>>3);for(var f=Qle[e-1],p=f>>13,h=f&8191,b=(1<<t)-1,g=s.p||new ea(32768),w=s.h||new ea(b+1),y=Math.ceil(t/3),x=2*y,S=function(Re){return(n[Re]^n[Re+1]<<y^n[Re+2]<<x)&b},A=new dP(25e3),C=new ea(288),T=new ea(32),R=0,I=0,L=s.i||0,V=0,j=s.w||0,$=0;L+2<a;++L){var J=S(L),H=L&32767,le=w[J];if(g[H]=le,w[J]=H,j<=L){var oe=a-L;
vendor: 9,781 bytes, lines 506-507
506if((R>7e3||V>24576)&&(oe>423||!c)){u=kL(n,l,0,A,C,T,I,V,$,L-$,u),V=R=I=0,$=L;for(var se=0;se<286;++se)C[se]=0;for(var se=0;se<30;++se)T[se]=0}var O=2,te=0,he=h,ge=H-le&32767;if(oe>2&&J==S(L-ge))for(var D=Math.min(p,oe)-1,G=Math.min(32767,L),ee=Math.min(258,oe);ge<=G&&--he&&H!=le;){if(n[L+O]==n[L+O-ge]){for(var ae=0;ae<ee&&n[L+ae]==n[L+ae-ge];++ae);if(ae>O){if(O=ae,te=ge,ae>D)break;for(var X=Math.min(ge,ae-2),Q=0,se=0;se<X;++se){var ue=L-ge+se&32767,pe=g[ue],me=ue-pe&32767;me>Q&&(Q=me,le=ue)}}}H=le,le=g[H],ge+=H-le&32767}if(te){A[V++]=268435456|IC[O]<<18|EL[te];var _e=IC[O]&31,Ee=EL[te]&31;I+=hP[_e]+fP[Ee],++C[257+_e],++T[Ee],j=L+O,++R}else A[V++]=n[L],++C[n[L]]}}for(L=Math.max(L,j);L<a;++L)A[V++]=n[L],++C[n[L]];u=kL(n,l,c,A,C,T,I,V,$,L-$,u),c||(s.r=u&7|l[u/8|0]<<3,u-=7,s.h=w,s.p=g,s.i=L,s.w=j)}else{for(var L=s.w||0;L<a+c;L+=65535){var ye=L+65535;ye>=a&&(l[u/8|0]=c,ye=a),u=kU(l,u+1,n.subarray(L,ye))}s.i=a}return Jle(o,0,r+NU(u)+i)},TU=function(){var n=1,e=0;return{p:function(t){for(var r=n,i=e,s=t.length|0,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=t[a];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}n=r,e=i},d:function(){return n%=65521,e%=65521,(n&255)<<24|(n&65280)<<8|(e&255)<<8|e>>8}}},ece=function(n,e,t,r,i){if(!i&&(i={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),a=new Mo(s.length+n.length);a.set(s),a.set(n,s.length),n=a,i.w=s.length}return Zle(n,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+e.mem,t,r,i)},PU=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},tce=function(n,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;if(n[0]=120,n[1]=r<<6|(e.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,e.dictionary){var i=TU();i.p(e.dictionary),PU(n,2,i.d())}};function DC(n,e){e||(e={});var t=TU();t.p(n);var r=ece(n,e,e.dictionary?6:2,4);return tce(r,e),PU(r,r.length-4,t.d()),r}var nce=typeof TextDecoder<"u"&&new TextDecoder,rce=0;try{nce.decode(CU,{stream:!0}),rce=1}catch{}function ice(n){if(Array.isArray(n))return n}function sce(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,s,a,o=[],l=!0,c=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}function CL(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ace(n,e){if(n){if(typeof n=="string")return CL(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?CL(n,e):void 0}}function oce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
507In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TL(n,e){return ice(n)||sce(n,e)||ace(n,e)||oce()}function PL(n,e="utf8"){return new TextDecoder(e).decode(n)}const lce=new TextEncoder;function cce(n){return lce.encode(n)}const uce=1024*8,dce=(()=>{const n=new Uint8Array(4),e=new Uint32Array(n.buffer);return!((e[0]=1)&n[0])})(),oE={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 pP{constructor(e=uce,t={}){Ue(this,"buffer");Ue(this,"byteLength");Ue(this,"byteOffset");Ue(this,"length");Ue(this,"offset");Ue(this,"lastWrittenByte");Ue(this,"littleEndian");Ue(this,"_data");Ue(this,"_mark");Ue(this,"_marks");let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=t.offset?t.offset>>>0:0,s=e.byteLength-i;let a=i;(ArrayBuffer.isView(e)||e instanceof pP)&&(e.byteLength!==e.buffer.byteLength&&(a=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=e,this.length=s,this.byteLength=s,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,s),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(e===void 0)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 r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}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 r=oE[t].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+r);if(this.littleEndian===dce&&t!=="uint8"&&t!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+r));o.reverse();const l=new oE[t](o.buffer);return this.offset+=r,l.reverse(),l}const a=new oE[t](s);return this.offset+=r,a}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 r=0;r<e;r++)t+=this.readChar();return t}readUtf8(e=1){return PL(this.readBytes(e))}decodeText(e=1,t="utf8"){return PL(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(cce(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)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const hce=4,jL=0,RL=1,fce=2;function U0(n){let e=n.length;for(;--e>=0;)n[e]=0}const pce=0,jU=1,mce=2,gce=3,vce=258,mP=29,Xb=256,Z1=Xb+1+mP,Xm=30,gP=19,RU=2*Z1+1,Gh=15,lE=16,yce=7,vP=256,LU=16,IU=17,OU=18,FC=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]),Rx=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]),bce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),MU=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wce=512,fc=new Array((Z1+2)*2);U0(fc);const b1=new Array(Xm*2);U0(b1);const ey=new Array(wce);U0(ey);const ty=new Array(vce-gce+1);U0(ty);const yP=new Array(mP);U0(yP);const D_=new Array(Xm);U0(D_);function cE(n,e,t,r,i){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=r,this.max_length=i,this.has_stree=n&&n.length}let DU,FU,BU;function uE(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}const $U=n=>n<256?ey[n]:ey[256+(n>>>7)],ny=(n,e)=>
vendor: 42,831 bytes, line 507
507{n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255},Ss=(n,e,t)=>{n.bi_valid>lE-t?(n.bi_buf|=e<<n.bi_valid&65535,ny(n,n.bi_buf),n.bi_buf=e>>lE-n.bi_valid,n.bi_valid+=t-lE):(n.bi_buf|=e<<n.bi_valid&65535,n.bi_valid+=t)},kl=(n,e,t)=>{Ss(n,t[e*2],t[e*2+1])},UU=(n,e)=>{let t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1},xce=n=>{n.bi_valid===16?(ny(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},_ce=(n,e)=>{const t=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let c,u,f,p,h,b,g=0;for(p=0;p<=Gh;p++)n.bl_count[p]=0;for(t[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;c<RU;c++)u=n.heap[c],p=t[t[u*2+1]*2+1]+1,p>l&&(p=l,g++),t[u*2+1]=p,!(u>r)&&(n.bl_count[p]++,h=0,u>=o&&(h=a[u-o]),b=t[u*2],n.opt_len+=b*(p+h),s&&(n.static_len+=b*(i[u*2+1]+h)));if(g!==0){do{for(p=l-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[l]--,g-=2}while(g>0);for(p=l;p!==0;p--)for(u=n.bl_count[p];u!==0;)f=n.heap[--c],!(f>r)&&(t[f*2+1]!==p&&(n.opt_len+=(p-t[f*2+1])*t[f*2],t[f*2+1]=p),u--)}},zU=(n,e,t)=>{const r=new Array(Gh+1);let i=0,s,a;for(s=1;s<=Gh;s++)i=i+t[s-1]<<1,r[s]=i;for(a=0;a<=e;a++){let o=n[a*2+1];o!==0&&(n[a*2]=UU(r[o]++,o))}},Sce=()=>{let n,e,t,r,i;const s=new Array(Gh+1);for(t=0,r=0;r<mP-1;r++)for(yP[r]=t,n=0;n<1<<FC[r];n++)ty[t++]=r;for(ty[t-1]=r,i=0,r=0;r<16;r++)for(D_[r]=i,n=0;n<1<<Rx[r];n++)ey[i++]=r;for(i>>=7;r<Xm;r++)for(D_[r]=i<<7,n=0;n<1<<Rx[r]-7;n++)ey[256+i++]=r;for(e=0;e<=Gh;e++)s[e]=0;for(n=0;n<=143;)fc[n*2+1]=8,n++,s[8]++;for(;n<=255;)fc[n*2+1]=9,n++,s[9]++;for(;n<=279;)fc[n*2+1]=7,n++,s[7]++;for(;n<=287;)fc[n*2+1]=8,n++,s[8]++;for(zU(fc,Z1+1,s),n=0;n<Xm;n++)b1[n*2+1]=5,b1[n*2]=UU(n,5);DU=new cE(fc,FC,Xb+1,Z1,Gh),FU=new cE(b1,Rx,0,Xm,Gh),BU=new cE(new Array(0),bce,0,gP,yce)},qU=n=>{let e;for(e=0;e<Z1;e++)n.dyn_ltree[e*2]=0;for(e=0;e<Xm;e++)n.dyn_dtree[e*2]=0;for(e=0;e<gP;e++)n.bl_tree[e*2]=0;n.dyn_ltree[vP*2]=1,n.opt_len=n.static_len=0,n.sym_next=n.matches=0},HU=n=>{n.bi_valid>8?ny(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},LL=(n,e,t,r)=>{const i=e*2,s=t*2;return n[i]<n[s]||n[i]===n[s]&&r[e]<=r[t]},dE=(n,e,t)=>{const r=n.heap[t];let i=t<<1;for(;i<=n.heap_len&&(i<n.heap_len&&LL(e,n.heap[i+1],n.heap[i],n.depth)&&i++,!LL(e,r,n.heap[i],n.depth));)n.heap[t]=n.heap[i],t=i,i<<=1;n.heap[t]=r},IL=(n,e,t)=>{let r,i,s=0,a,o;if(n.sym_next!==0)do r=n.pending_buf[n.sym_buf+s++]&255,r+=(n.pending_buf[n.sym_buf+s++]&255)<<8,i=n.pending_buf[n.sym_buf+s++],r===0?kl(n,i,e):(a=ty[i],kl(n,a+Xb+1,e),o=FC[a],o!==0&&(i-=yP[a],Ss(n,i,o)),r--,a=$U(r),kl(n,a,t),o=Rx[a],o!==0&&(r-=D_[a],Ss(n,r,o)));while(s<n.sym_next);kl(n,vP,e)},BC=(n,e)=>{const t=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=RU,a=0;a<s;a++)t[a*2]!==0?(n.heap[++n.heap_len]=l=a,n.depth[a]=0):t[a*2+1]=0;for(;n.heap_len<2;)c=n.heap[++n.heap_len]=l<2?++l:0,t[c*2]=1,n.depth[c]=0,n.opt_len--,i&&(n.static_len-=r[c*2+1]);for(e.max_code=l,a=n.heap_len>>1;a>=1;a--)dE(n,t,a);c=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],dE(n,t,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,t[c*2]=t[a*2]+t[o*2],n.depth[c]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,t[a*2+1]=t[o*2+1]=c,n.heap[1]=c++,dE(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],_ce(n,e),zU(t,l,n.bl_count)},OL=(n,e,t)=>{let r,i=-1,s,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(t+1)*2+1]=65535,r=0;r<=t;r++)s=a,a=e[(r+1)*2+1],!(++o<l&&s===a)&&(o<c?n.bl_tree[s*2]+=o:s!==0?(s!==i&&n.bl_tree[s*2]++,n.bl_tree[LU*2]++):o<=10?n.bl_tree[IU*2]++:n.bl_tree[OU*2]++,o=0,i=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4))},ML=(n,e,t)=>{let r,i=-1,s,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),r=0;r<=t;r++)if(s=a,a=e[(r+1)*2+1],!(++o<l&&s===a)){if(o<c)do kl(n,s,n.bl_tree);while(--o!==0);else s!==0?(s!==i&&(kl(n,s,n.bl_tree),o--),kl(n,LU,n.bl_tree),Ss(n,o-3,2)):o<=10?(kl(n,IU,n.bl_tree),Ss(n,o-3,3)):(kl(n,OU,n.bl_tree),Ss(n,o-11,7));o=0,i=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4)}},Ace=n=>{let e;for(OL(n,n.dyn_ltree,n.l_desc.max_code),OL(n,n.dyn_dtree,n.d_desc.max_code),BC(n,n.bl_desc),e=gP-1;e>=3&&n.bl_tree[MU[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e},Ece=(n,e,t,r)=>{let i;for(Ss(n,e-257,5),Ss(n,t-1,5),Ss(n,r-4,4),i=0;i<r;i++)Ss(n,n.bl_tree[MU[i]*2+1],3);ML(n,n.dyn_ltree,e-1),ML(n,n.dyn_dtree,t-1)},Nce=n=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return jL;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return RL;for(t=32;t<Xb;t++)if(n.dyn_ltree[t*2]!==0)return RL;return jL};let DL=!1;const kce=n=>{DL||(Sce(),DL=!0),n.l_desc=new uE(n.dyn_ltree,DU),n.d_desc=new uE(n.dyn_dtree,FU),n.bl_desc=new uE(n.bl_tree,BU),n.bi_buf=0,n.bi_valid=0,qU(n)},WU=(n,e,t,r)=>{Ss(n,(pce<<1)+(r?1:0),3),HU(n),ny(n,t),ny(n,~t),t&&n.pending_buf.set(n.window.subarray(e,e+t),n.pending),n.pending+=t},Cce=n=>{Ss(n,jU<<1,3),kl(n,vP,fc),xce(n)},Tce=(n,e,t,r)=>{let i,s,a=0;n.level>0?(n.strm.data_type===fce&&(n.strm.data_type=Nce(n)),BC(n,n.l_desc),BC(n,n.d_desc),a=Ace(n),i=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?WU(n,e,t,r):n.strategy===hce||s===i?(Ss(n,(jU<<1)+(r?1:0),3),IL(n,fc,b1)):(Ss(n,(mce<<1)+(r?1:0),3),Ece(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),IL(n,n.dyn_ltree,n.dyn_dtree)),qU(n),r&&HU(n)},Pce=(n,e,t)=>(n.pending_buf[n.sym_buf+n.sym_next++]=e,n.pending_buf[n.sym_buf+n.sym_next++]=e>>8,n.pending_buf[n.sym_buf+n.sym_next++]=t,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(ty[t]+Xb+1)*2]++,n.dyn_dtree[$U(e)*2]++),n.sym_next===n.sym_end);var jce=kce,Rce=WU,Lce=Tce,Ice=Pce,Oce=Cce,Mce={_tr_init:jce,_tr_stored_block:Rce,_tr_flush_block:Lce,_tr_tally:Ice,_tr_align:Oce};const Dce=(n,e,t,r)=>{let i=n&65535|0,s=n>>>16&65535|0,a=0;for(;t!==0;){a=t>2e3?2e3:t,t-=a;do i=i+e[r++]|0,s=s+i|0;while(--a);i%=65521,s%=65521}return i|s<<16|0};var ry=Dce;const Fce=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},Bce=new Uint32Array(Fce()),$ce=(n,e,t,r)=>{const i=Bce,s=r+t;n^=-1;for(let a=r;a<s;a++)n=n>>>8^i[(n^e[a])&255];return n^-1};var ri=$ce,A0={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"},Jb={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:Uce,_tr_stored_block:$C,_tr_flush_block:zce,_tr_tally:Id,_tr_align:qce}=Mce,{Z_NO_FLUSH:Od,Z_PARTIAL_FLUSH:Hce,Z_FULL_FLUSH:Wce,Z_FINISH:ka,Z_BLOCK:FL,Z_OK:Si,Z_STREAM_END:BL,Z_STREAM_ERROR:Il,Z_DATA_ERROR:Vce,Z_BUF_ERROR:hE,Z_DEFAULT_COMPRESSION:Gce,Z_FILTERED:Kce,Z_HUFFMAN_ONLY:E2,Z_RLE:Yce,Z_FIXED:Xce,Z_DEFAULT_STRATEGY:Jce,Z_UNKNOWN:Qce,Z_DEFLATED:pS}=Jb,Zce=9,eue=15,tue=8,nue=29,rue=256,UC=rue+1+nue,iue=30,sue=19,aue=2*UC+1,oue=15,en=3,Sd=258,Ol=Sd+en+1,lue=32,E0=42,bP=57,zC=69,qC=73,HC=91,WC=103,Kh=113,r1=666,ns=1,z0=2,gp=3,q0=4,cue=3,Yh=(n,e)=>(n.msg=A0[e],e),$L=n=>n*2-(n>4?9:0),Uu=n=>{let e=n.length;for(;--e>=0;)n[e]=0},uue=n=>{let e,t,r,i=n.w_size;e=n.hash_size,r=e;do t=n.head[--r],n.head[r]=t>=i?t-i:0;while(--e);e=i,r=e;do t=n.prev[--r],n.prev[r]=t>=i?t-i:0;while(--e)};let due=(n,e,t)=>(e<<n.hash_shift^t)&n.hash_mask,Md=due;const Bs=n=>{const e=n.state;let t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(n.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},ta=(n,e)=>{zce(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,Bs(n.strm)},un=(n,e)=>{n.pending_buf[n.pending++]=e},Iv=(n,e)=>{n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255},VC=(n,e,t,r)=>{let i=n.avail_in;return i>r&&(i=r),i===0?0:(n.avail_in-=i,e.set(n.input.subarray(n.next_in,n.next_in+i),t),n.state.wrap===1?n.adler=ry(n.adler,e,i,t):n.state.wrap===2&&(n.adler=ri(n.adler,e,i,t)),n.next_in+=i,n.total_in+=i,i)},VU=(n,e)=>{let t=n.max_chain_length,r=n.strstart,i,s,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Ol?n.strstart-(n.w_size-Ol):0,c=n.window,u=n.w_mask,f=n.prev,p=n.strstart+Sd;let h=c[r+a-1],b=c[r+a];n.prev_length>=n.good_match&&(t>>=2),o>n.lookahead&&(o=n.lookahead);do if(i=e,!(c[i+a]!==b||c[i+a-1]!==h||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<p);if(s=Sd-(p-r),r=p-Sd,s>a){if(n.match_start=e,a=s,s>=o)break;h=c[r+a-1],b=c[r+a]}}while((e=f[e&u])>l&&--t!==0);return a<=n.lookahead?a:n.lookahead},N0=n=>{const e=n.w_size;let t,r,i;do{if(r=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-Ol)&&(n.window.set(n.window.subarray(e,e+e-r),0),n.match_start-=e,n.strstart-=e,n.block_start-=e,n.insert>n.strstart&&(n.insert=n.strstart),uue(n),r+=e),n.strm.avail_in===0)break;if(t=VC(n.strm,n.window,n.strstart+n.lookahead,r),n.lookahead+=t,n.lookahead+n.insert>=en)for(i=n.strstart-n.insert,n.ins_h=n.window[i],n.ins_h=Md(n,n.ins_h,n.window[i+1]);n.insert&&(n.ins_h=Md(n,n.ins_h,n.window[i+en-1]),n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,n.insert--,!(n.lookahead+n.insert<en)););}while(n.lookahead<Ol&&n.strm.avail_in!==0)},GU=(n,e)=>{let t=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,r,i,s,a=0,o=n.strm.avail_in;do{if(r=65535,s=n.bi_valid+42>>3,n.strm.avail_out<s||(s=n.strm.avail_out-s,i=n.strstart-n.block_start,r>i+n.strm.avail_in&&(r=i+n.strm.avail_in),r>s&&(r=s),r<t&&(r===0&&e!==ka||e===Od||r!==i+n.strm.avail_in)))break;a=e===ka&&r===i+n.strm.avail_in?1:0,$C(n,0,0,a),n.pending_buf[n.pending-4]=r,n.pending_buf[n.pending-3]=r>>8,n.pending_buf[n.pending-2]=~r,n.pending_buf[n.pending-1]=~r>>8,Bs(n.strm),i&&(i>r&&(i=r),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+i),n.strm.next_out),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i,n.block_start+=i,r-=i),r&&(VC(n.strm,n.strm.output,n.strm.next_out,r),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_water<n.strstart&&(n.high_water=n.strstart),a?q0:e!==Od&&e!==ka&&n.strm.avail_in===0&&n.strstart===n.block_start?z0:(s=n.window_size-n.strstart,n.strm.avail_in>s&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(VC(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water<n.strstart&&(n.high_water=n.strstart),s=n.bi_valid+42>>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,t=s>n.w_size?n.w_size:s,i=n.strstart-n.block_start,(i>=t||(i||e===ka)&&e!==Od&&n.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,a=e===ka&&n.strm.avail_in===0&&r===i?1:0,$C(n,n.block_start,r,a),n.block_start+=r,Bs(n.strm)),a?gp:ns)},fE=(n,e)=>{let t,r;for(;;){if(n.lookahead<Ol){if(N0(n),n.lookahead<Ol&&e===Od)return ns;if(n.lookahead===0)break}if(t=0,n.lookahead>=en&&(n.ins_h=Md(n,n.ins_h,n.window[n.strstart+en-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-Ol&&(n.match_length=VU(n,t)),n.match_length>=en)if(r=Id(n,n.strstart-n.match_start,n.match_length-en),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=en){n.match_length--;do n.strstart++,n.ins_h=Md(n,n.ins_h,n.window[n.strstart+en-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=Md(n,n.ins_h,n.window[n.strstart+1]);else r=Id(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(r&&(ta(n,!1),n.strm.avail_out===0))return ns}return n.insert=n.strstart<en-1?n.strstart:en-1,e===ka?(ta(n,!0),n.strm.avail_out===0?gp:q0):n.sym_next&&(ta(n,!1),n.strm.avail_out===0)?ns:z0},rm=(n,e)=>{let t,r,i;for(;;){if(n.lookahead<Ol){if(N0(n),n.lookahead<Ol&&e===Od)return ns;if(n.lookahead===0)break}if(t=0,n.lookahead>=en&&(n.ins_h=Md(n,n.ins_h,n.window[n.strstart+en-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=en-1,t!==0&&n.prev_length<n.max_lazy_match&&n.strstart-t<=n.w_size-Ol&&(n.match_length=VU(n,t),n.match_length<=5&&(n.strategy===Kce||n.match_length===en&&n.strstart-n.match_start>4096)&&(n.match_length=en-1)),n.prev_length>=en&&n.match_length<=n.prev_length){i=n.strstart+n.lookahead-en,r=Id(n,n.strstart-1-n.prev_match,n.prev_length-en),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=i&&(n.ins_h=Md(n,n.ins_h,n.window[n.strstart+en-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=en-1,n.strstart++,r&&(ta(n,!1),n.strm.avail_out===0))return ns}else if(n.match_available){if(r=Id(n,0,n.window[n.strstart-1]),r&&ta(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return ns}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(r=Id(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<en-1?n.strstart:en-1,e===ka?(ta(n,!0),n.strm.avail_out===0?gp:q0):n.sym_next&&(ta(n,!1),n.strm.avail_out===0)?ns:z0},hue=(n,e)=>{let t,r,i,s;const a=n.window;for(;;){if(n.lookahead<=Sd){if(N0(n),n.lookahead<=Sd&&e===Od)return ns;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=en&&n.strstart>0&&(i=n.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){s=n.strstart+Sd;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);n.match_length=Sd-(s-i),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=en?(t=Id(n,1,n.match_length-en),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=Id(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(ta(n,!1),n.strm.avail_out===0))return ns}return n.insert=0,e===ka?(ta(n,!0),n.strm.avail_out===0?gp:q0):n.sym_next&&(ta(n,!1),n.strm.avail_out===0)?ns:z0},fue=(n,e)=>{let t;for(;;){if(n.lookahead===0&&(N0(n),n.lookahead===0)){if(e===Od)return ns;break}if(n.match_length=0,t=Id(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(ta(n,!1),n.strm.avail_out===0))return ns}return n.insert=0,e===ka?(ta(n,!0),n.strm.avail_out===0?gp:q0):n.sym_next&&(ta(n,!1),n.strm.avail_out===0)?ns:z0};function Qo(n,e,t,r,i){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=r,this.func=i}const i1=[new Qo(0,0,0,0,GU),new Qo(4,4,8,4,fE),new Qo(4,5,16,8,fE),new Qo(4,6,32,32,fE),new Qo(4,4,16,16,rm),new Qo(8,16,32,32,rm),new Qo(8,16,128,128,rm),new Qo(8,32,128,256,rm),new Qo(32,128,258,1024,rm),new Qo(32,258,258,4096,rm)],pue=n=>{n.window_size=2*n.w_size,Uu(n.head),n.max_lazy_match=i1[n.level].max_lazy,n.good_match=i1[n.level].good_length,n.nice_match=i1[n.level].nice_length,n.max_chain_length=i1[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=en-1,n.match_available=0,n.ins_h=0};function mue(){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=pS,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(aue*2),this.dyn_dtree=new Uint16Array((2*iue+1)*2),this.bl_tree=new Uint16Array((2*sue+1)*2),Uu(this.dyn_ltree),Uu(this.dyn_dtree),Uu(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(oue+1),this.heap=new Uint16Array(2*UC+1),Uu(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*UC+1),Uu(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 Qb=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.status!==E0&&e.status!==bP&&e.status!==zC&&e.status!==qC&&e.status!==HC&&e.status!==WC&&e.status!==Kh&&e.status!==r1?1:0},KU=n=>{if(Qb(n))return Yh(n,Il);n.total_in=n.total_out=0,n.data_type=Qce;const e=n.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?bP:e.wrap?E0:Kh,n.adler=e.wrap===2?0:1,e.last_flush=-2,Uce(e),Si},YU=n=>{const e=KU(n);return e===Si&&pue(n.state),e},gue=(n,e)=>Qb(n)||n.state.wrap!==2?Il:(n.state.gzhead=e,Si),XU=(n,e,t,r,i,s)=>{if(!n)return Il;let a=1;if(e===Gce&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>Zce||t!==pS||r<8||r>15||e<0||e>9||s<0||s>Xce||r===8&&a!==1)return Yh(n,Il);r===8&&(r=9);const o=new mue;return n.state=o,o.strm=n,o.status=E0,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+en-1)/en),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=s,o.method=t,YU(n)},vue=(n,e)=>XU(n,e,pS,eue,tue,Jce),yue=(n,e)=>{if(Qb(n)||e>FL||e<0)return n?Yh(n,Il):Il;const t=n.state;if(!n.output||n.avail_in!==0&&!n.input||t.status===r1&&e!==ka)return Yh(n,n.avail_out===0?hE:Il);const r=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Bs(n),n.avail_out===0)return t.last_flush=-1,Si}else if(n.avail_in===0&&$L(e)<=$L(r)&&e!==ka)return Yh(n,hE);if(t.status===r1&&n.avail_in!==0)return Yh(n,hE);if(t.status===E0&&t.wrap===0&&(t.status=Kh),t.status===E0){let i=pS+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=E2||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=lue),i+=31-i%31,Iv(t,i),t.strstart!==0&&(Iv(t,n.adler>>>16),Iv(t,n.adler&65535)),n.adler=1,t.status=Kh,Bs(n),t.pending!==0)return t.last_flush=-1,Si}if(t.status===bP){if(n.adler=0,un(t,31),un(t,139),un(t,8),t.gzhead)un(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),un(t,t.gzhead.time&255),un(t,t.gzhead.time>>8&255),un(t,t.gzhead.time>>16&255),un(t,t.gzhead.time>>24&255),un(t,t.level===9?2:t.strategy>=E2||t.level<2?4:0),un(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(un(t,t.gzhead.extra.length&255),un(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(n.adler=ri(n.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=zC;else if(un(t,0),un(t,0),un(t,0),un(t,0),un(t,0),un(t,t.level===9?2:t.strategy>=E2||t.level<2?4:0),un(t,cue),t.status=Kh,Bs(n),t.pending!==0)return t.last_flush=-1,Si}if(t.status===zC){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let o=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=o,Bs(n),t.pending!==0)return t.last_flush=-1,Si;i=0,s-=o}let a=new Uint8Array(t.gzhead.extra);t.pending_buf.set(a.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=qC}if(t.status===qC){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i)),Bs(n),t.pending!==0)return t.last_flush=-1,Si;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,un(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=HC}if(t.status===HC){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i)),Bs(n),t.pending!==0)return t.last_flush=-1,Si;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,un(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(n.adler=ri(n.adler,t.pending_buf,t.pending-i,i))}t.status=WC}if(t.status===WC){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Bs(n),t.pending!==0))return t.last_flush=-1,Si;un(t,n.adler&255),un(t,n.adler>>8&255),n.adler=0}if(t.status=Kh,Bs(n),t.pending!==0)return t.last_flush=-1,Si}if(n.avail_in!==0||t.lookahead!==0||e!==Od&&t.status!==r1){let i=t.level===0?GU(t,e):t.strategy===E2?fue(t,e):t.strategy===Yce?hue(t,e):i1[t.level].func(t,e);if((i===gp||i===q0)&&(t.status=r1),i===ns||i===gp)return n.avail_out===0&&(t.last_flush=-1),Si;if(i===z0&&(e===Hce?qce(t):e!==FL&&($C(t,0,0,!1),e===Wce&&(Uu(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Bs(n),n.avail_out===0))return t.last_flush=-1,Si}return e!==ka?Si:t.wrap<=0?BL:(t.wrap===2?(un(t,n.adler&255),un(t,n.adler>>8&255),un(t,n.adler>>16&255),un(t,n.adler>>24&255),un(t,n.total_in&255),un(t,n.total_in>>8&255),un(t,n.total_in>>16&255),un(t,n.total_in>>24&255)):(Iv(t,n.adler>>>16),Iv(t,n.adler&65535)),Bs(n),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Si:BL)},bue=n=>{if(Qb(n))return Il;const e=n.state.status;return n.state=null,e===Kh?Yh(n,Vce):Si},wue=(n,e)=>{let t=e.length;if(Qb(n))return Il;const r=n.state,i=r.wrap;if(i===2||i===1&&r.status!==E0||r.lookahead)return Il;if(i===1&&(n.adler=ry(n.adler,e,t,0)),r.wrap=0,t>=r.w_size){i===0&&(Uu(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(t-r.w_size,t),0),e=l,t=r.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=t,n.next_in=0,n.input=e,N0(r);r.lookahead>=en;){let l=r.strstart,c=r.lookahead-(en-1);do r.ins_h=Md(r,r.ins_h,r.window[l+en-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--c);r.strstart=l,r.lookahead=en-1,N0(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=en-1,r.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,r.wrap=i,Si};var xue=vue,_ue=XU,Sue=YU,Aue=KU,Eue=gue,Nue=yue,kue=bue,Cue=wue,Tue="pako deflate (from Nodeca project)",w1={deflateInit:xue,deflateInit2:_ue,deflateReset:Sue,deflateResetKeep:Aue,deflateSetHeader:Eue,deflate:Nue,deflateEnd:kue,deflateSetDictionary:Cue,deflateInfo:Tue};const Pue=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var jue=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)Pue(t,r)&&(n[r]=t[r])}}return n},Rue=n=>{let e=0;for(let r=0,i=n.length;r<i;r++)e+=n[r].length;const t=new Uint8Array(e);for(let r=0,i=0,s=n.length;r<s;r++){let a=n[r];t.set(a,i),i+=a.length}return t},mS={assign:jue,flattenChunks:Rue};let JU=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{JU=!1}const iy=new Uint8Array(256);for(let n=0;n<256;n++)iy[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;iy[254]=iy[254]=1;var Lue=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,r,i,s,a=n.length,o=0;for(i=0;i<a;i++)t=n.charCodeAt(i),(t&64512)===55296&&i+1<a&&(r=n.charCodeAt(i+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),i++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(o),s=0,i=0;s<o;i++)t=n.charCodeAt(i),(t&64512)===55296&&i+1<a&&(r=n.charCodeAt(i+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const Iue=(n,e)=>{if(e<65534&&n.subarray&&JU)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let r=0;r<e;r++)t+=String.fromCharCode(n[r]);return t};var Oue=(n,e)=>{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let r,i;const s=new Array(t*2);for(i=0,r=0;r<t;){let a=n[r++];if(a<128){s[i++]=a;continue}let o=iy[a];if(o>4){s[i++]=65533,r+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&r<t;)a=a<<6|n[r++]&63,o--;if(o>1){s[i++]=65533;continue}a<65536?s[i++]=a:(a-=65536,s[i++]=55296|a>>10&1023,s[i++]=56320|a&1023)}return Iue(s,i)},Mue=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+iy[n[t]]>e?t:e},sy={string2buf:Lue,buf2string:Oue,utf8border:Mue};function Due(){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}var QU=Due;const ZU=Object.prototype.toString,{Z_NO_FLUSH:Fue,Z_SYNC_FLUSH:Bue,Z_FULL_FLUSH:$ue,Z_FINISH:Uue,Z_OK:F_,Z_STREAM_END:zue,Z_DEFAULT_COMPRESSION:que,Z_DEFAULT_STRATEGY:Hue,Z_DEFLATED:Wue}=Jb;function wP(n){this.options=mS.assign({level:que,method:Wue,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hue},n||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new QU,this.strm.avail_out=0;let t=w1.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==F_)throw new Error(A0[t]);if(e.header&&w1.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=sy.string2buf(e.dictionary):ZU.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,t=w1.deflateSetDictionary(this.strm,r),t!==F_)throw new Error(A0[t]);this._dict_set=!0}}wP.prototype.push=function(n,e){const t=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?Uue:Fue,typeof n=="string"?t.input=sy.string2buf(n):ZU.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(s===Bue||s===$ue)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=w1.deflate(t,s),i===zue)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=w1.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===F_;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};wP.prototype.onData=function(n){this.chunks.push(n)};wP.prototype.onEnd=function(n){n===F_&&(this.result=mS.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const N2=16209,Vue=16191;var Gue=function(e,t){let r,i,s,a,o,l,c,u,f,p,h,b,g,w,y,x,S,A,C,T,R,I,L,V;const j=e.state;r=e.next_in,L=e.input,i=r+(e.avail_in-5),s=e.next_out,V=e.output,a=s-(t-e.avail_out),o=s+(e.avail_out-257),l=j.dmax,c=j.wsize,u=j.whave,f=j.wnext,p=j.window,h=j.hold,b=j.bits,g=j.lencode,w=j.distcode,y=(1<<j.lenbits)-1,x=(1<<j.distbits)-1;e:do{b<15&&(h+=L[r++]<<b,b+=8,h+=L[r++]<<b,b+=8),S=g[h&y];t:for(;;){if(A=S>>>24,h>>>=A,b-=A,A=S>>>16&255,A===0)V[s++]=S&65535;else if(A&16){C=S&65535,A&=15,A&&(b<A&&(h+=L[r++]<<b,b+=8),C+=h&(1<<A)-1,h>>>=A,b-=A),b<15&&(h+=L[r++]<<b,b+=8,h+=L[r++]<<b,b+=8),S=w[h&x];n:for(;;){if(A=S>>>24,h>>>=A,b-=A,A=S>>>16&255,A&16){if(T=S&65535,A&=15,b<A&&(h+=L[r++]<<b,b+=8,b<A&&(h+=L[r++]<<b,b+=8)),T+=h&(1<<A)-1,T>l){e.msg="invalid distance too far back",j.mode=N2;break e}if(h>>>=A,b-=A,A=s-a,T>A){if(A=T-A,A>u&&j.sane){e.msg="invalid distance too far back",j.mode=N2;break e}if(R=0,I=p,f===0){if(R+=c-A,A<C){C-=A;do V[s++]=p[R++];while(--A);R=s-T,I=V}}else if(f<A){if(R+=c+f-A,A-=f,A<C){C-=A;do V[s++]=p[R++];while(--A);if(R=0,f<C){A=f,C-=A;do V[s++]=p[R++];while(--A);R=s-T,I=V}}}else if(R+=f-A,A<C){C-=A;do V[s++]=p[R++];while(--A);R=s-T,I=V}for(;C>2;)V[s++]=I[R++],V[s++]=I[R++],V[s++]=I[R++],C-=3;C&&(V[s++]=I[R++],C>1&&(V[s++]=I[R++]))}else{R=s-T;do V[s++]=V[R++],V[s++]=V[R++],V[s++]=V[R++],C-=3;while(C>2);C&&(V[s++]=V[R++],C>1&&(V[s++]=V[R++]))}}else if(A&64){e.msg="invalid distance code",j.mode=N2;break e}else{S=w[(S&65535)+(h&(1<<A)-1)];continue n}break}}else if(A&64)if(A&32){j.mode=Vue;break e}else{e.msg="invalid literal/length code",j.mode=N2;break e}else{S=g[(S&65535)+(h&(1<<A)-1)];continue t}break}}while(r<i&&s<o);C=b>>3,r-=C,b-=C<<3,h&=(1<<b)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<o?257+(o-s):257-(s-o),j.hold=h,j.bits=b};const im=15,UL=852,zL=592,qL=0,pE=1,HL=2,Kue=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]),Yue=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]),Xue=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]),Jue=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]),Que=(n,e,t,r,i,s,a,o)=>{const l=o.bits;let c=0,u=0,f=0,p=0,h=0,b=0,g=0,w=0,y=0,x=0,S,A,C,T,R,I=null,L;const V=new Uint16Array(im+1),j=new Uint16Array(im+1);let $=null,J,H,le;for(c=0;c<=im;c++)V[c]=0;for(u=0;u<r;u++)V[e[t+u]]++;for(h=l,p=im;p>=1&&V[p]===0;p--);if(h>p&&(h=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(f=1;f<p&&V[f]===0;f++);for(h<f&&(h=f),w=1,c=1;c<=im;c++)if(w<<=1,w-=V[c],w<0)return-1;if(w>0&&(n===qL||p!==1))return-1;for(j[1]=0,c=1;c<im;c++)j[c+1]=j[c]+V[c];for(u=0;u<r;u++)e[t+u]!==0&&(a[j[e[t+u]]++]=u);if(n===qL?(I=$=a,L=20):n===pE?(I=Kue,$=Yue,L=257):(I=Xue,$=Jue,L=0),x=0,u=0,c=f,R=s,b=h,g=0,C=-1,y=1<<h,T=y-1,n===pE&&y>UL||n===HL&&y>zL)return 1;for(;;){J=c-g,a[u]+1<L?(H=0,le=a[u]):a[u]>=L?(H=$[a[u]-L],le=I[a[u]-L]):(H=96,le=0),S=1<<c-g,A=1<<b,f=A;do A-=S,i[R+(x>>g)+A]=J<<24|H<<16|le|0;while(A!==0);for(S=1<<c-1;x&S;)S>>=1;if(S!==0?(x&=S-1,x+=S):x=0,u++,--V[c]===0){if(c===p)break;c=e[t+a[u]]}if(c>h&&(x&T)!==C){for(g===0&&(g=h),R+=f,b=c-g,w=1<<b;b+g<p&&(w-=V[b+g],!(w<=0));)b++,w<<=1;if(y+=1<<b,n===pE&&y>UL||n===HL&&y>zL)return 1;C=x&T,i[C]=h<<24|b<<16|R-s|0}}return x!==0&&(i[R+x]=c-g<<24|64<<16|0),o.bits=h,0};var x1=Que;const Zue=0,e9=1,t9=2,{Z_FINISH:WL,Z_BLOCK:ede,Z_TREES:k2,Z_OK:vp,Z_STREAM_END:tde,Z_NEED_DICT:nde,Z_STREAM_ERROR:za,Z_DATA_ERROR:n9,Z_MEM_ERROR:r9,Z_BUF_ERROR:rde,Z_DEFLATED:VL}=Jb,gS=16180,GL=16181,KL=16182,YL=16183,XL=16184,JL=16185,QL=16186,ZL=16187,eI=16188,tI=16189,B_=16190,ac=16191,mE=16192,nI=16193,gE=16194,rI=16195,iI=16196,sI=16197,aI=16198,C2=16199,T2=16200,oI=16201,lI=16202,cI=16203,uI=16204,dI=16205,vE=16206,hI=16207,fI=16208,Vn=16209,i9=16210,s9=16211,ide=852,sde=592,ade=15,ode=ade,pI=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function lde(){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 Pp=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.mode<gS||e.mode>s9?1:0},a9=n=>{if(Pp(n))return za;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=gS,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(ide),e.distcode=e.distdyn=new Int32Array(sde),e.sane=1,e.back=-1,vp},o9=n=>{if(Pp(n))return za;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,a9(n)},l9=(n,e)=>{let t;if(Pp(n))return za;const r=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?za:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=t,r.wbits=e,o9(n))},c9=(n,e)=>{if(!n)return za;const t=new lde;n.state=t,t.strm=n,t.window=null,t.mode=gS;const r=l9(n,e);return r!==vp&&(n.state=null),r},cde=n=>c9(n,ode);let mI=!0,yE,bE;const ude=n=>{if(mI){yE=new Int32Array(512),bE=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(x1(e9,n.lens,0,288,yE,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;x1(t9,n.lens,0,32,bE,0,n.work,{bits:5}),mI=!1}n.lencode=yE,n.lenbits=9,n.distcode=bE,n.distbits=5},u9=(n,e,t,r)=>{let i;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(t-r,t-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(t-r,t),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},dde=(n,e)=>{let t,r,i,s,a,o,l,c,u,f,p,h,b,g,w=0,y,x,S,A,C,T,R,I;const L=new Uint8Array(4);let V,j;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pp(n)||!n.output||!n.input&&n.avail_in!==0)return za;t=n.state,t.mode===ac&&(t.mode=mE),a=n.next_out,i=n.output,l=n.avail_out,s=n.next_in,r=n.input,o=n.avail_in,c=t.hold,u=t.bits,f=o,p=l,I=vp;e:for(;;)switch(t.mode){case gS:if(t.wrap===0){t.mode=mE;break}for(;u<16;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(t.wrap&2&&c===35615){t.wbits===0&&(t.wbits=15),t.check=0,L[0]=c&255,L[1]=c>>>8&255,t.check=ri(t.check,L,2,0),c=0,u=0,t.mode=GL;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",t.mode=Vn;break}if((c&15)!==VL){n.msg="unknown compression method",t.mode=Vn;break}if(c>>>=4,u-=4,R=(c&15)+8,t.wbits===0&&(t.wbits=R),R>15||R>t.wbits){n.msg="invalid window size",t.mode=Vn;break}t.dmax=1<<t.wbits,t.flags=0,n.adler=t.check=1,t.mode=c&512?tI:ac,c=0,u=0;break;case GL:for(;u<16;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(t.flags=c,(t.flags&255)!==VL){n.msg="unknown compression method",t.mode=Vn;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=Vn;break}t.head&&(t.head.text=c>>8&1),t.flags&512&&t.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,t.check=ri(t.check,L,2,0)),c=0,u=0,t.mode=KL;case KL:for(;u<32;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.head&&(t.head.time=c),t.flags&512&&t.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,L[2]=c>>>16&255,L[3]=c>>>24&255,t.check=ri(t.check,L,4,0)),c=0,u=0,t.mode=YL;case YL:for(;u<16;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.head&&(t.head.xflags=c&255,t.head.os=c>>8),t.flags&512&&t.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,t.check=ri(t.check,L,2,0)),c=0,u=0,t.mode=XL;case XL:if(t.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.length=c,t.head&&(t.head.extra_len=c),t.flags&512&&t.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,t.check=ri(t.check,L,2,0)),c=0,u=0}else t.head&&(t.head.extra=null);t.mode=JL;case JL:if(t.flags&1024&&(h=t.length,h>o&&(h=o),h&&(t.head&&(R=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(s,s+h),R)),t.flags&512&&t.wrap&4&&(t.check=ri(t.check,r,h,s)),o-=h,s+=h,t.length-=h),t.length))break e;t.length=0,t.mode=QL;case QL:if(t.flags&2048){if(o===0)break e;h=0;do R=r[s+h++],t.head&&R&&t.length<65536&&(t.head.name+=String.fromCharCode(R));while(R&&h<o);if(t.flags&512&&t.wrap&4&&(t.check=ri(t.check,r,h,s)),o-=h,s+=h,R)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=ZL;case ZL:if(t.flags&4096){if(o===0)break e;h=0;do R=r[s+h++],t.head&&R&&t.length<65536&&(t.head.comment+=String.fromCharCode(R));while(R&&h<o);if(t.flags&512&&t.wrap&4&&(t.check=ri(t.check,r,h,s)),o-=h,s+=h,R)break e}else t.head&&(t.head.comment=null);t.mode=eI;case eI:if(t.flags&512){for(;u<16;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(t.wrap&4&&c!==(t.check&65535)){n.msg="header crc mismatch",t.mode=Vn;break}c=0,u=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=ac;break;case tI:for(;u<32;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}n.adler=t.check=pI(c),c=0,u=0,t.mode=B_;case B_:if(t.havedict===0)return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,t.hold=c,t.bits=u,nde;n.adler=t.check=1,t.mode=ac;case ac:if(e===ede||e===k2)break e;case mE:if(t.last){c>>>=u&7,u-=u&7,t.mode=vE;break}for(;u<3;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}switch(t.last=c&1,c>>>=1,u-=1,c&3){case 0:t.mode=nI;break;case 1:if(ude(t),t.mode=C2,e===k2){c>>>=2,u-=2;break e}break;case 2:t.mode=iI;break;case 3:n.msg="invalid block type",t.mode=Vn}c>>>=2,u-=2;break;case nI:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){n.msg="invalid stored block lengths",t.mode=Vn;break}if(t.length=c&65535,c=0,u=0,t.mode=gE,e===k2)break e;case gE:t.mode=rI;case rI:if(h=t.length,h){if(h>o&&(h=o),h>l&&(h=l),h===0)break e;i.set(r.subarray(s,s+h),a),o-=h,s+=h,l-=h,a+=h,t.length-=h;break}t.mode=ac;break;case iI:for(;u<14;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(t.nlen=(c&31)+257,c>>>=5,u-=5,t.ndist=(c&31)+1,c>>>=5,u-=5,t.ncode=(c&15)+4,c>>>=4,u-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Vn;break}t.have=0,t.mode=sI;case sI:for(;t.have<t.ncode;){for(;u<3;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.lens[$[t.have++]]=c&7,c>>>=3,u-=3}for(;t.have<19;)t.lens[$[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,V={bits:t.lenbits},I=x1(Zue,t.lens,0,19,t.lencode,0,t.work,V),t.lenbits=V.bits,I){n.msg="invalid code lengths set",t.mode=Vn;break}t.have=0,t.mode=aI;case aI:for(;t.have<t.nlen+t.ndist;){for(;w=t.lencode[c&(1<<t.lenbits)-1],y=w>>>24,x=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(S<16)c>>>=y,u-=y,t.lens[t.have++]=S;else{if(S===16){for(j=y+2;u<j;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(c>>>=y,u-=y,t.have===0){n.msg="invalid bit length repeat",t.mode=Vn;break}R=t.lens[t.have-1],h=3+(c&3),c>>>=2,u-=2}else if(S===17){for(j=y+3;u<j;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}c>>>=y,u-=y,R=0,h=3+(c&7),c>>>=3,u-=3}else{for(j=y+7;u<j;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}c>>>=y,u-=y,R=0,h=11+(c&127),c>>>=7,u-=7}if(t.have+h>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Vn;break}for(;h--;)t.lens[t.have++]=R}}if(t.mode===Vn)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Vn;break}if(t.lenbits=9,V={bits:t.lenbits},I=x1(e9,t.lens,0,t.nlen,t.lencode,0,t.work,V),t.lenbits=V.bits,I){n.msg="invalid literal/lengths set",t.mode=Vn;break}if(t.distbits=6,t.distcode=t.distdyn,V={bits:t.distbits},I=x1(t9,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,V),t.distbits=V.bits,I){n.msg="invalid distances set",t.mode=Vn;break}if(t.mode=C2,e===k2)break e;case C2:t.mode=T2;case T2:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,t.hold=c,t.bits=u,Gue(n,p),a=n.next_out,i=n.output,l=n.avail_out,s=n.next_in,r=n.input,o=n.avail_in,c=t.hold,u=t.bits,t.mode===ac&&(t.back=-1);break}for(t.back=0;w=t.lencode[c&(1<<t.lenbits)-1],y=w>>>24,x=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(x&&!(x&240)){for(A=y,C=x,T=S;w=t.lencode[T+((c&(1<<A+C)-1)>>A)],y=w>>>24,x=w>>>16&255,S=w&65535,!(A+y<=u);){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}c>>>=A,u-=A,t.back+=A}if(c>>>=y,u-=y,t.back+=y,t.length=S,x===0){t.mode=dI;break}if(x&32){t.back=-1,t.mode=ac;break}if(x&64){n.msg="invalid literal/length code",t.mode=Vn;break}t.extra=x&15,t.mode=oI;case oI:if(t.extra){for(j=t.extra;u<j;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.length+=c&(1<<t.extra)-1,c>>>=t.extra,u-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=lI;case lI:for(;w=t.distcode[c&(1<<t.distbits)-1],y=w>>>24,x=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(!(x&240)){for(A=y,C=x,T=S;w=t.distcode[T+((c&(1<<A+C)-1)>>A)],y=w>>>24,x=w>>>16&255,S=w&65535,!(A+y<=u);){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}c>>>=A,u-=A,t.back+=A}if(c>>>=y,u-=y,t.back+=y,x&64){n.msg="invalid distance code",t.mode=Vn;break}t.offset=S,t.extra=x&15,t.mode=cI;case cI:if(t.extra){for(j=t.extra;u<j;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}t.offset+=c&(1<<t.extra)-1,c>>>=t.extra,u-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Vn;break}t.mode=uI;case uI:if(l===0)break e;if(h=p-l,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Vn;break}h>t.wnext?(h-=t.wnext,b=t.wsize-h):b=t.wnext-h,h>t.length&&(h=t.length),g=t.window}else g=i,b=a-t.offset,h=t.length;h>l&&(h=l),l-=h,t.length-=h;do i[a++]=g[b++];while(--h);t.length===0&&(t.mode=T2);break;case dI:if(l===0)break e;i[a++]=t.length,l--,t.mode=T2;break;case vE:if(t.wrap){for(;u<32;){if(o===0)break e;o--,c|=r[s++]<<u,u+=8}if(p-=l,n.total_out+=p,t.total+=p,t.wrap&4&&p&&(n.adler=t.check=t.flags?ri(t.check,i,p,a-p):ry(t.check,i,p,a-p)),p=l,t.wrap&4&&(t.flags?c:pI(c))!==t.check){n.msg="incorrect data check",t.mode=Vn;break}c=0,u=0}t.mode=hI;case hI:if(t.wrap&&t.flags){for(;u<32;){if(o===0)break e;o--,c+=r[s++]<<u,u+=8}if(t.wrap&4&&c!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=Vn;break}c=0,u=0}t.mode=fI;case fI:I=tde;break e;case Vn:I=n9;break e;case i9:return r9;case s9:default:return za}return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,t.hold=c,t.bits=u,(t.wsize||p!==n.avail_out&&t.mode<Vn&&(t.mode<vE||e!==WL)
vendor: 12,548 bytes, line 507
507)&&u9(n,n.output,n.next_out,p-n.avail_out),f-=n.avail_in,p-=n.avail_out,n.total_in+=f,n.total_out+=p,t.total+=p,t.wrap&4&&p&&(n.adler=t.check=t.flags?ri(t.check,i,p,n.next_out-p):ry(t.check,i,p,n.next_out-p)),n.data_type=t.bits+(t.last?64:0)+(t.mode===ac?128:0)+(t.mode===C2||t.mode===gE?256:0),(f===0&&p===0||e===WL)&&I===vp&&(I=rde),I},hde=n=>{if(Pp(n))return za;let e=n.state;return e.window&&(e.window=null),n.state=null,vp},fde=(n,e)=>{if(Pp(n))return za;const t=n.state;return t.wrap&2?(t.head=e,e.done=!1,vp):za},pde=(n,e)=>{const t=e.length;let r,i,s;return Pp(n)||(r=n.state,r.wrap!==0&&r.mode!==B_)?za:r.mode===B_&&(i=1,i=ry(i,e,t,0),i!==r.check)?n9:(s=u9(n,e,t,t),s?(r.mode=i9,r9):(r.havedict=1,vp))};var mde=o9,gde=l9,vde=a9,yde=cde,bde=c9,wde=dde,xde=hde,_de=fde,Sde=pde,Ade="pako inflate (from Nodeca project)",pc={inflateReset:mde,inflateReset2:gde,inflateResetKeep:vde,inflateInit:yde,inflateInit2:bde,inflate:wde,inflateEnd:xde,inflateGetHeader:_de,inflateSetDictionary:Sde,inflateInfo:Ade};function Ede(){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}var Nde=Ede;const d9=Object.prototype.toString,{Z_NO_FLUSH:kde,Z_FINISH:Cde,Z_OK:ay,Z_STREAM_END:wE,Z_NEED_DICT:xE,Z_STREAM_ERROR:Tde,Z_DATA_ERROR:gI,Z_MEM_ERROR:Pde}=Jb;function Zb(n){this.options=mS.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new QU,this.strm.avail_out=0;let t=pc.inflateInit2(this.strm,e.windowBits);if(t!==ay)throw new Error(A0[t]);if(this.header=new Nde,pc.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=sy.string2buf(e.dictionary):d9.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=pc.inflateSetDictionary(this.strm,e.dictionary),t!==ay)))throw new Error(A0[t])}Zb.prototype.push=function(n,e){const t=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?Cde:kde,d9.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),s=pc.inflate(t,a),s===xE&&i&&(s=pc.inflateSetDictionary(t,i),s===ay?s=pc.inflate(t,a):s===gI&&(s=xE));t.avail_in>0&&s===wE&&t.state.wrap>0&&n[t.next_in]!==0;)pc.inflateReset(t),s=pc.inflate(t,a);switch(s){case Tde:case gI:case xE:case Pde:return this.onEnd(s),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||s===wE))if(this.options.to==="string"){let l=sy.utf8border(t.output,t.next_out),c=t.next_out-l,u=sy.buf2string(t.output,l);t.next_out=c,t.avail_out=r-c,c&&t.output.set(t.output.subarray(l,l+c),0),this.onData(u)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===ay&&o===0)){if(s===wE)return s=pc.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Zb.prototype.onData=function(n){this.chunks.push(n)};Zb.prototype.onEnd=function(n){n===ay&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=mS.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function xP(n,e){const t=new Zb(e);if(t.push(n),t.err)throw t.msg||A0[t.err];return t.result}function jde(n,e){return e=e||{},e.raw=!0,xP(n,e)}var Rde=Zb,Lde=xP,Ide=jde,Ode=xP,Mde=Jb,Dde={Inflate:Rde,inflate:Lde,inflateRaw:Ide,ungzip:Ode,constants:Mde};const{Inflate:Fde,inflate:Bde,inflateRaw:ige,ungzip:sge}=Dde;var vI=Fde,$de=Bde;const h9=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;h9[n]=e}const yI=4294967295;function Ude(n,e,t){let r=n;for(let i=0;i<t;i++)r=h9[(r^e[i])&255]^r>>>8;return r}function zde(n,e){return(Ude(yI,n,e)^yI)>>>0}function bI(n,e,t){const r=n.readUint32(),i=zde(new Uint8Array(n.buffer,n.byteOffset+n.offset-e-4,e),e);if(i!==r)throw new Error(`CRC mismatch for chunk ${t}. Expected ${r}, found ${i}`)}function f9(n,e,t){for(let r=0;r<t;r++)e[r]=n[r]}function p9(n,e,t,r){let i=0;for(;i<r;i++)e[i]=n[i];for(;i<t;i++)e[i]=n[i]+e[i-r]&255}function m9(n,e,t,r){let i=0;if(t.length===0)for(;i<r;i++)e[i]=n[i];else for(;i<r;i++)e[i]=n[i]+t[i]&255}function g9(n,e,t,r,i){let s=0;if(t.length===0){for(;s<i;s++)e[s]=n[s];for(;s<r;s++)e[s]=n[s]+(e[s-i]>>1)&255}else{for(;s<i;s++)e[s]=n[s]+(t[s]>>1)&255;for(;s<r;s++)e[s]=n[s]+(e[s-i]+t[s]>>1)&255}}function v9(n,e,t,r,i){let s=0;if(t.length===0){for(;s<i;s++)e[s]=n[s];for(;s<r;s++)e[s]=n[s]+e[s-i]&255}else{for(;s<i;s++)e[s]=n[s]+t[s]&255;for(;s<r;s++)e[s]=n[s]+qde(e[s-i],t[s],t[s-i])&255}}function qde(n,e,t){const r=n+e-t,i=Math.abs(r-n),s=Math.abs(r-e),a=Math.abs(r-t);return i<=s&&i<=a?n:s<=a?e:t}function Hde(n,e,t,r,i,s){switch(n){case 0:f9(e,t,i);break;case 1:p9(e,t,i,s);break;case 2:m9(e,t,r,i);break;case 3:g9(e,t,r,i,s);break;case 4:v9(e,t,r,i,s);break;default:throw new Error(`Unsupported filter: ${n}`)}}const Wde=new Uint16Array([255]),Vde=new Uint8Array(Wde.buffer),Gde=Vde[0]===255;function Kde(n){const{data:e,width:t,height:r,channels:i,depth:s}=n,a=[{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}],o=Math.ceil(s/8)*i,l=new Uint8Array(r*t*o);let c=0;for(let u=0;u<7;u++){const f=a[u],p=Math.ceil((t-f.x)/f.xStep),h=Math.ceil((r-f.y)/f.yStep);if(p<=0||h<=0)continue;const b=p*o,g=new Uint8Array(b);for(let w=0;w<h;w++){const y=e[c++],x=e.subarray(c,c+b);c+=b;const S=new Uint8Array(b);Hde(y,x,S,g,b,o),g.set(S);for(let A=0;A<p;A++){const C=f.x+A*f.xStep,T=f.y+w*f.yStep;if(!(C>=t||T>=r))for(let R=0;R<o;R++)l[(T*t+C)*o+R]=S[A*o+R]}}}if(s===16){const u=new Uint16Array(l.buffer);if(Gde)for(let f=0;f<u.length;f++)u[f]=Yde(u[f]);return u}else return l}function Yde(n){return(n&255)<<8|n>>8&255}const Xde=new Uint16Array([255]),Jde=new Uint8Array(Xde.buffer),Qde=Jde[0]===255,Zde=new Uint8Array(0);function wI(n){const{data:e,width:t,height:r,channels:i,depth:s}=n,a=Math.ceil(s/8)*i,o=Math.ceil(s/8*i*t),l=new Uint8Array(r*o);let c=Zde,u=0,f,p;for(let h=0;h<r;h++){switch(f=e.subarray(u+1,u+1+o),p=l.subarray(h*o,(h+1)*o),e[u]){case 0:f9(f,p,o);break;case 1:p9(f,p,o,a);break;case 2:m9(f,p,c,o);break;case 3:g9(f,p,c,o,a);break;case 4:v9(f,p,c,o,a);break;default:throw new Error(`Unsupported filter: ${e[u]}`)}c=p,u+=o+1}if(s===16){const h=new Uint16Array(l.buffer);if(Qde)for(let b=0;b<h.length;b++)h[b]=ehe(h[b]);return h}else return l}function ehe(n){return(n&255)<<8|n>>8&255}const Lx=Uint8Array.of(137,80,78,71,13,10,26,10);function xI(n){if(!the(n.readBytes(Lx.length)))throw new Error("wrong PNG signature")}function the(n){if(n.length<Lx.length)return!1;for(let e=0;e<Lx.length;e++)if(n[e]!==Lx[e])return!1;return!0}const nhe="tEXt",rhe=0,y9=new TextDecoder("latin1");function ihe(n){if(ahe(n),n.length===0||n.length>79)throw new Error("keyword length must be between 1 and 79")}const she=/^[\u0000-\u00FF]*$/;function ahe(n){if(!she.test(n))throw new Error("invalid latin1 text")}function ohe(n,e,t){const r=b9(e);n[r]=lhe(e,t-r.length-1)}function b9(n){for(n.mark();n.readByte()!==rhe;);const e=n.offset;n.reset();const t=y9.decode(n.readBytes(e-n.offset-1));return n.skip(1),ihe(t),t}function lhe(n,e){return y9.decode(n.readBytes(e))}const Fs={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},_E={UNKNOWN:-1,DEFLATE:0},_I={UNKNOWN:-1,ADAPTIVE:0},SE={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},P2={NONE:0,BACKGROUND:1,PREVIOUS:2},AE={SOURCE:0,OVER:1};class che extends pP{constructor(t,r={}){super(t);Ue(this,"_checkCrc");Ue(this,"_inflator");Ue(this,"_png");Ue(this,"_apng");Ue(this,"_end");Ue(this,"_hasPalette");Ue(this,"_palette");Ue(this,"_hasTransparency");Ue(this,"_transparency");Ue(this,"_compressionMethod");Ue(this,"_filterMethod");Ue(this,"_interlaceMethod");Ue(this,"_colorType");Ue(this,"_isAnimated");Ue(this,"_numberOfFrames");Ue(this,"_numberOfPlays");Ue(this,"_frames");Ue(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new vI,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=_E.UNKNOWN,this._filterMethod=_I.UNKNOWN,this._interlaceMethod=SE.UNKNOWN,this._colorType=Fs.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(xI(this);!this._end;){const t=this.readUint32(),r=this.readChars(4);this.decodeChunk(t,r)}return this.decodeImage(),this._png}decodeApng(){for(xI(this);!this._end;){const t=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(t,r)}return this.decodeApngImage(),this._apng}decodeChunk(t,r){const i=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case nhe:ohe(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-i!==t)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?bI(this,t+4,r):this.skip(4)}decodeApngChunk(t,r){const i=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,r),this.offset=i+t;break}if(this.offset-i!==t)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?bI(this,t+4,r):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=uhe(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case Fs.GREYSCALE:i=1;break;case Fs.TRUECOLOUR:i=3;break;case Fs.INDEXED_COLOUR:i=1;break;case Fs.GREYSCALE_ALPHA:i=2;break;case Fs.TRUECOLOUR_ALPHA:i=4;break;case Fs.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==_E.DEFLATE)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 t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const r=t/3;this._hasPalette=!0;const i=[];this._palette=i;for(let s=0;s<r;s++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;const r=t,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let r=t,i=this.offset+this.byteOffset;if(i+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case Fs.GREYSCALE:case Fs.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let r=0;r<t/2;r++)this._transparency[r]=this.readUint16();break}case Fs.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alph
507a values than there are palette colors (${t} vs ${this._palette.length})`);let r=0;for(;r<t;r++){const i=this.readByte();this._palette[r].push(i)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Fs.UNKNOWN:case Fs.GREYSCALE_ALPHA:case Fs.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){const r=b9(this),i=this.readUint8();if(i!==_E.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const s=this.readBytes(t-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:$de(s)}}decodepHYs(){const t=this.readUint32(),r=this.readUint32(),i=this.readByte();this._png.resolution={x:t,y:r,unit:i}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){const r={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},i=this._frames.at(t);if(i){if(i.data=wI({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||i.xOffset===0&&i.yOffset===0&&i.width===this._png.width&&i.height===this._png.height)r.data=i.data;else{const s=this._apng.frames.at(t-1);this.disposeFrame(i,s,r),this.addFrameDataToCanvas(r,i)}this._apng.frames.push(r)}}return this._apng}disposeFrame(t,r,i){switch(t.disposeOp){case P2.NONE:break;case P2.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let a=0;a<this._png.width;a++){const o=(s*t.width+a)*this._png.channels;for(let l=0;l<this._png.channels;l++)i.data[o+l]=0}break;case P2.PREVIOUS:i.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,r){const i=1<<this._png.depth,s=(a,o)=>{const l=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,c=(a*r.width+o)*this._png.channels;return{index:l,frameIndex:c}};switch(r.blendOp){case AE.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:c}=s(a,o);for(let u=0;u<this._png.channels;u++)t.data[l+u]=r.data[c+u]}break;case AE.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:c}=s(a,o);for(let u=0;u<this._png.channels;u++){const f=r.data[c+this._png.channels-1]/i,p=u%(this._png.channels-1)===0?1:r.data[c+u],h=Math.floor(f*p+(1-f)*t.data[l+u]);t.data[l+u]+=h}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==_I.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===SE.NO_INTERLACE)this._png.data=wI({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===SE.ADAM7)this._png.data=Kde({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const t=this._inflator.result,r=this._frames.at(-1);r?r.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:P2.NONE,blendOp:AE.SOURCE,data:t}),this._inflator=new vI,this._writingDataChunks=!1}}function uhe(n){if(n!==1&&n!==2&&n!==4&&n!==8&&n!==16)throw new Error(`invalid bit depth: ${n}`);return n}var SI;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.METRE=1]="METRE"})(SI||(SI={}));function dhe(n,e){return new che(n,e).decode()}var At=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function EE(){At.console&&typeof At.console.log=="function"&&At.console.log.apply(At.console,arguments)}var kn={log:EE,warn:function(n){At.console&&(typeof At.console.warn=="function"?At.console.warn.apply(At.console,arguments):EE.call(null,arguments))},error:function(n){At.console&&(typeof At.console.error=="function"?At.console.error.apply(At.console,arguments):EE(n))}};function NE(n,e,t){var r=new XMLHttpRequest;r.open("GET",n),r.responseType="blob",r.onload=function(){Mh(r.response,e,t)},r.onerror=function(){kn.error("could not download file")},r.send()}function AI(n){var e=new XMLHttpRequest;e.open("HEAD",n,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function j2(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");
vendor: 3,407 bytes, lines 507-512
507e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(e)}}var Mh=At.saveAs||((typeof window>"u"?"undefined":wn(window))!=="object"||window!==At?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(n,e,t){var r=At.URL||At.webkitURL,i=document.createElement("a");e=e||n.name||"download",i.download=e,i.rel="noopener",typeof n=="string"?(i.href=n,i.origin!==location.origin?AI(i.href)?NE(n,e,t):j2(i,i.target="_blank"):j2(i)):(i.href=r.createObjectURL(n),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){j2(i)},0))}:"msSaveOrOpenBlob"in navigator?function(n,e,t){if(e=e||n.name||"download",typeof n=="string")if(AI(n))NE(n,e,t);else{var r=document.createElement("a");r.href=n,r.target="_blank",setTimeout(function(){j2(r)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:wn(s)!=="object"&&(kn.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(n,t),e)}:function(n,e,t,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof n=="string")return NE(n,e,t);var i=n.type==="application/octet-stream",s=/constructor/i.test(At.HTMLElement)||At.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":wn(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var u=o.result;u=a?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=u:location=u,r=null},o.readAsDataURL(n)}else{var l=At.URL||At.webkitURL,c=l.createObjectURL(n);r?r.location=c:location.href=c,r=null,setTimeout(function(){l.revokeObjectURL(c)},4e4)}});/**
508 * A class to parse color values
509 * @author Stoyan Stefanov <[email protected]>
510 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
511 * @license Use it if you like it
512 */function w9(n){var e;n=n||"",this.ok=!1,n.charAt(0)=="#"&&(n=n.substr(1,6)),n={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:"90ee9
5120",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"}[n=(n=n.replace(/ /g,"")).toLowerCase()]||n;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r<t.length;r++){var i=t[r].re,s=t[r].process,a=i.exec(n);a&&(e=s(a),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),l=this.g.toString(16),c=this.b.toString(16);return o.length==1&&(o="0"+o),l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),"#"+o+l+c}}var Ix=At.atob.bind(At),EI=At.btoa.bind(At);/**
513 * @license
514 * Joseph Myers does not specify a particular license for his work.
515 *
516 * Author: Joseph Myers
517 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
518 *
519 * Modified by: Owen Leong
520 */function kE(n,e){var t=n[0],r=n[1],i=n[2],s=n[3];t=Pi(t,r,i,s,e[0],7,-680876936),s=Pi(s,t,r,i,e[1],12,-389564586),i=Pi(i,s,t,r,e[2],17,606105819),r=Pi(r,i,s,t,e[3],22,-1044525330),t=Pi(t,r,i,s,e[4],7,-176418897),s=Pi(s,t,r,i,e[5],12,1200080426),i=Pi(i,s,t,r,e[6],17,-1473231341),r=Pi(r,i,s,t,e[7],22,-45705983),t=Pi(t,r,i,s,e[8],7,1770035416),s=Pi(s,t,r,i,e[9],12,-1958414417),i=Pi(i,s,t,r,e[10],17,-42063),r=Pi(r,i,s,t,e[11],22,-1990404162),t=Pi(t,r,i,s,e[12],7,1804603682),s=Pi(s,t,r,i,e[13],12,-40341101),i=Pi(i,s,t,r,e[14],17,-1502002290),t=ji(t,r=Pi(r,i,s,t,e[15],22,1236535329),i,s,e[1],5,-165796510),s=ji(s,t,r,i,e[6],9,-1069501632),i=ji(i,s,t,r,e[11],14,643717713),r=ji(r,i,s,t,e[0],20,-373897302),t=ji(t,r,i,s,e[5],5,-701558691),s=ji(s,t,r,i,e[10],9,38016083),i=ji(i,s,t,r,e[15],14,-660478335),r=ji(r,i,s,t,e[4],20,-405537848),t=ji(t,r,i,s,e[9],5,568446438),s=ji(s,t,r,i,e[14],9,-1019803690),i=ji(i,s,t,r,e[3],14,-187363961),r=ji(r,i,s,t,e[8],20,1163531501),t=ji(t,r,i,s,e[13],5,-1444681467),s=ji(s,t,r,i,e[2],9,-51403784),i=ji(i,s,t,r,e[7],14,1735328473),t=Ri(t,r=ji(r,i,s,t,e[12],20,-1926607734),i,s,e[5],4,-378558),s=Ri(s,t,r,i,e[8],11,-2022574463),i=Ri(i,s,t,r,e[11],16,1839030562),r=Ri(r,i,s,t,e[14],23,-35309556),t=Ri(t,r,i,s,e[1],4,-1530992060),s=Ri(s,t,r,i,e[4],11,1272893353),i=Ri(i,s,t,r,e[7],16,-155497632),r=Ri(r,i,s,t,e[10],23,-1094730640),t=Ri(t,r,i,s,e[13],4,681279174),s=Ri(s,t,r,i,e[0],11,-358537222),i=Ri(i,s,t,r,e[3],16,-722521979),r=Ri(r,i,s,t,e[6],23,76029189),t=Ri(t,r,i,s,e[9],4,
vendor: 1,104 bytes, line 520
520-640364487),s=Ri(s,t,r,i,e[12],11,-421815835),i=Ri(i,s,t,r,e[15],16,530742520),t=Li(t,r=Ri(r,i,s,t,e[2],23,-995338651),i,s,e[0],6,-198630844),s=Li(s,t,r,i,e[7],10,1126891415),i=Li(i,s,t,r,e[14],15,-1416354905),r=Li(r,i,s,t,e[5],21,-57434055),t=Li(t,r,i,s,e[12],6,1700485571),s=Li(s,t,r,i,e[3],10,-1894986606),i=Li(i,s,t,r,e[10],15,-1051523),r=Li(r,i,s,t,e[1],21,-2054922799),t=Li(t,r,i,s,e[8],6,1873313359),s=Li(s,t,r,i,e[15],10,-30611744),i=Li(i,s,t,r,e[6],15,-1560198380),r=Li(r,i,s,t,e[13],21,1309151649),t=Li(t,r,i,s,e[4],6,-145523070),s=Li(s,t,r,i,e[11],10,-1120210379),i=Li(i,s,t,r,e[2],15,718787259),r=Li(r,i,s,t,e[9],21,-343485551),n[0]=Ad(t,n[0]),n[1]=Ad(r,n[1]),n[2]=Ad(i,n[2]),n[3]=Ad(s,n[3])}function vS(n,e,t,r,i,s){return e=Ad(Ad(e,n),Ad(r,s)),Ad(e<<i|e>>>32-i,t)}function Pi(n,e,t,r,i,s,a){return vS(e&t|~e&r,n,e,i,s,a)}function ji(n,e,t,r,i,s,a){return vS(e&r|t&~r,n,e,i,s,a)}function Ri(n,e,t,r,i,s,a){return vS(e^t^r,n,e,i,s,a)}function Li(n,e,t,r,i,s,a){return vS(t^(e|~r),n,e,i,s,a)}function x9(n){var e,t=n.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=n.length;
vendor: 9,473 bytes, lines 520-537
520e+=64)kE(r,hhe(n.substring(e-64,e)));n=n.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<n.length;e++)i[e>>2]|=n.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(kE(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*t,kE(r,i),r}function hhe(n){var e,t=[];for(e=0;e<64;e+=4)t[e>>2]=n.charCodeAt(e)+(n.charCodeAt(e+1)<<8)+(n.charCodeAt(e+2)<<16)+(n.charCodeAt(e+3)<<24);return t}var NI="0123456789abcdef".split("");function fhe(n){for(var e="",t=0;t<4;t++)e+=NI[n>>8*t+4&15]+NI[n>>8*t&15];return e}function phe(n){return String.fromCharCode(255&n,(65280&n)>>8,(16711680&n)>>16,(4278190080&n)>>24)}function GC(n){return x9(n).map(phe).join("")}var mhe=function(n){for(var e=0;e<n.length;e++)n[e]=fhe(n[e]);return n.join("")}(x9("hello"))!="5d41402abc4b2a76b9719d911017c592";function Ad(n,e){if(mhe){var t=(65535&n)+(65535&e);return(n>>16)+(e>>16)+(t>>16)<<16|65535&t}return n+e&4294967295}/**
521 * @license
522 * FPDF is released under a permissive license: there is no usage restriction.
523 * You may embed it freely in your application (commercial or not), with or
524 * without modifications.
525 *
526 * Reference: http://www.fpdf.org/en/script/script37.php
527 */function KC(n,e){var t,r,i,s;if(n!==t){for(var a=(i=n,s=1+(256/n.length|0),new Array(s+1).join(i)),o=[],l=0;l<256;l++)o[l]=l;var c=0;for(l=0;l<256;l++){var u=o[l];c=(c+u+a.charCodeAt(l))%256,o[l]=o[c],o[c]=u}t=n,r=o}else o=r;var f=e.length,p=0,h=0,b="";for(l=0;l<f;l++)h=(h+(u=o[p=(p+1)%256]))%256,o[p]=o[h],o[h]=u,a=o[(o[p]+o[h])%256],b+=String.fromCharCode(e.charCodeAt(l)^a);return b}/**
528 * @license
529 * Licensed under the MIT License.
530 * http://opensource.org/licenses/mit-license
531 * Author: Owen Leong (@owenl131)
532 * Date: 15 Oct 2020
533 * References:
534 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
535 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
536 * http://www.fpdf.org/en/script/script37.php
537 */var kI={print:4,modify:8,copy:16,"annot-forms":32};function vm(n,e,t,r){this.v=1,this.r=2;var i=192;n.forEach(function(o){if(kI.perm!==void 0)throw new Error("Invalid permission: "+o);i+=kI[o]}),this.padding="(¿N^NuŠAd\0NVÿú�\b..\0¶Ðh>€/\f©þdSiz";var s=(e+this.padding).substr(0,32),a=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,a),this.P=-(1+(255^i)),this.encryptionKey=GC(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=KC(this.encryptionKey,this.padding)}function ym(n){if(/[^\u0000-\u00ff]/.test(n))throw new Error("Invalid PDF Name Object: "+n+", Only accept ASCII characters.");for(var e="",t=n.length,r=0;r<t;r++){var i=n.charCodeAt(r);e+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):n[r]}return e}function CI(n){if(wn(n)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,r,i){if(i=i||!1,typeof t!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var s=Math.random().toString(35);return e[t][s]=[r,!!i],s},this.unsubscribe=function(t){for(var r in e)if(e[r][t])return delete e[r][t],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var s in e[t]){var a=e[t][s];try{a[0].apply(n,r)}catch(o){At.console&&kn.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function $_(n){if(!(this instanceof $_))return new $_(n);var e="opacity,stroke-opacity".split(",");for(var t in n)n.hasOwnProperty(t)&&e.indexOf(t)>=0&&(this[t]=n[t]);this.id="",this.objectNumber=-1}function _9(n,e){this.gState=n,this.matrix=e,this.id="",this.objectNumber=-1}function Bh(n,e,t,r,i){if(!(this instanceof Bh))return new Bh(n,e,t,r,i);this.type=n==="axial"?2:3,this.coords=e,this.colors=t,_9.call(this,r,i)}function jm(n,e,t,r,i){if(!(this instanceof jm))return new jm(n,e,t,r,i);this.boundingBox=n,this.xStep=e,this.yStep=t,this.stream="",this.cloneIndex=0,_9.call(this,r,i)}function mt(n){var e,t=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,l=16,c="S",u=null;wn(n=n||{})==="object"&&(t=n.orientation,r=n.unit||r,i=n.format||i,s=n.compress||n.compressPdf||s,(u=n.encryption||null)!==null&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),o=typeof n.userUnit=="number"?Math.abs(n.userUnit):1,n.precision!==void 0&&(e=n.precision),n.floatPrecision!==void 0&&(l=n.floatPrecision),c=n.defaultPathOperation||"S"),a=n.filters||(s===!0?["FlateEncode"]:a),r=r||"mm",t=(""+(t||"P")).toLowerCase();var f=n.putOnlyUsedFonts||!1,p={},h={internal:{},__private__:{}};h.__private__.PubSub=CI;var b="1.3",g=h.__private__.getPdfVersion=function(){return b};h.__private__.setPdfVersion=function(N){b=N};var w={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]};h.__private__.getPageFormats=function(){return w};var y=h.__private__.getPageFormat=function(N){return w[N]};i=i||"a4";var x="compat",S="advanced",A=x;function C(){this.saveGraphicsState(),Y(new nt(wt,0,0,-wt,0,hh()*wt).toString()+" cm"),this.setFontSize(this.getFontSize()/wt),c="n",A=S}function T(){this.restoreGraphicsState(),c="S",A=x}var R=h.__private__.combineFontStyleAndFontWeight=function(N,F){if(N=="bold"&&F=="normal"||N=="bold"&&F==400||N=="normal"&&F=="italic"||N=="bold"&&F=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return F&&(N=F==400||F==="normal"?N==="italic"?"italic":"normal":F!=700&&F!=="bold"||N!=="normal"?(F==700?"bold":F)+""+N:"bold"),N};h.advancedAPI=function(N){var F=A===x;return F&&C.call(this),typeof N!="function"||(N(this),F&&T.call(this)),this},h.compatAPI=function(N){var F=A===S;return F&&T.call(this),typeof N!="function"||(N(this),F&&C.call(this)),this},h.isAdvancedAPI=function(){return A===S};var I,L=function(N){if(A!==S)throw new Error(N+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},V=h.roundToPrecision=h.__private__.roundToPrecision=function(N,F){var ie=e||F;if(isNaN(N)||isNaN(ie))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return N.toFixed(ie).replace(/0+$/,"")};I=h.hpf=h.__private__.hpf=typeof l=="number"?function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.hpf");return V(N,l)}:l==="smart"?function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.hpf");return V(N,N>-1&&N<1?16:5)}:function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.hpf");return V(N,16)};var j=h.f2=h.__private__.f2=function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.f2");return V(N,2)},$=h.__private__.f3=function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.f3");return V(N,3)},J=h.scale=h.__private__.scale=function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.scale");return A===x?N*wt:A===S?N:void 0},H=function(N){return J(function(F){return A===x?hh()-F:A===S?F:void 0}(N))};h.__private__.setPrecision=h.setPrecision=function(N){typeof parseInt(N,10)=="number"&&(e=parseInt(N,10))};var le,oe="00000000000000000000000000000000",se=h.__private__.getFileId=function(){return oe},O=h.__private__.setFileId=function(N){return oe=N!==void 0&&/^[a-fA-F0-9]{32}$/.test(N)?N.toUpperCase():oe.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),u!==null&&(Ir=new vm(u.userPermissions,u.userPassword,u.ownerPassword,oe)),oe};h.setFileId=function(N){return O(N),this},h.getFileId=function(){return se()};var te=h.__private__.convertDateToPDFDate=function(N){var F=N.getTimezoneOffset(),ie=F<0?"+":"-",ce=Math.floor(Math.abs(F/60)),ve=Math.abs(F%60),Ne=[ie,ee(ce),"'",ee(ve),"'"].join("");return["D:",N.getFullYear(),ee(N.getMonth()+1),ee(N.getDate()),ee(N.getHours()),ee(N.getMinutes()),ee(N.getSeconds()),Ne].join("")},he=h.__private__.convertPDFDateToDate=function(N){var F=parseInt(N.substr(2,4),10),ie=parseInt(N.substr(6,2),10)-1,ce=parseInt(N.substr(8,2),10),ve=parseInt(N.substr(10,2),10),Ne=parseInt(N.substr(12,2),10),Pe=parseInt(N.substr(14,2),10);return new Date(F,ie,ce,ve,Ne,Pe,0)},ge=h.__private__.setCreationDate=function(N){var F;if(N===void 0&&(N=new Date),N instanceof Date)F=te(N);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(N))throw new Error("Invalid argument passed to 
537jsPDF.setCreationDate");F=N}return le=F},D=h.__private__.getCreationDate=function(N){var F=le;return N==="jsDate"&&(F=he(le)),F};h.setCreationDate=function(N){return ge(N),this},h.getCreationDate=function(N){return D(N)};var G,ee=h.__private__.padd2=function(N){return("0"+parseInt(N)).slice(-2)},ae=h.__private__.padd2Hex=function(N){return("00"+(N=N.toString())).substr(N.length)},X=0,Q=[],ue=[],pe=0,me=[],_e=[],Ee=!1,ye=ue;h.__private__.setCustomOutputDestination=function(N){Ee=!0,ye=N};var Re=function(N){Ee||(ye=N)};h.__private__.resetCustomOutputDestination=function(){Ee=!1,ye=ue};var Y=h.__private__.out=function(N){return N=N.toString(),pe+=N.length+1,ye.push(N),ye},Te=h.__private__.write=function(N){return Y(arguments.length===1?N.toString():Array.prototype.join.call(arguments," "))},it=h.__private__.getArrayBuffer=function(N){for(var F=N.length,ie=new ArrayBuffer(F),ce=new Uint8Array(ie);F--;)ce[F]=N.charCodeAt(F);return ie},He=[["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]];h.__private__.getStandardFonts=function(){return He};var Ce=n.fontSize||16;h.__private__.setFontSize=h.setFontSize=function(N){return Ce=A===S?N/wt:N,this};var Je,De=h.__private__.getFontSize=h.getFontSize=function(){return A===x?Ce:Ce*wt},Qe=n.R2L||!1;h.__private__.setR2L=h.setR2L=function(N){return Qe=N,this},h.__private__.getR2L=h.getR2L=function(){return Qe};var ze,Vt=h.__private__.setZoomMode=function(N){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(N))Je=N;else if(isNaN(N)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(N)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+N+'" is not recognized.');Je=N}else Je=parseInt(N,10)};h.__private__.getZoomMode=function(){return Je};var Ct,dt=h.__private__.setPageMode=function(N){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(N)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+N+'" is not recognized.');ze=N};h.__private__.getPageMode=function(){return ze};var St=h.__private__.setLayoutMode=function(N){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(N)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+N+'" is not recognized.');Ct=N};h.__private__.getLayoutMode=function(){return Ct},h.__private__.setDisplayMode=h.setDisplayMode=function(N,F,ie){return Vt(N),St(F),dt(ie),this};var Ot={title:"",subject:"",author:"",keywords:"",creator:""};h.__private__.getDocumentProperty=function(N){if(Object.keys(Ot).indexOf(N)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ot[N]},h.__private__.getDocumentProperties=function(){return Ot},h.__private__.setDocumentProperties=h.setProperties=h.setDocumentProperties=function(N){for(var F in Ot)Ot.hasOwnProperty(F)&&N[F]&&(Ot[F]=N[F]);return this},h.__private__.setDocumentProperty=function(N,F){if(Object.keys(Ot).indexOf(N)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ot[N]=F};var Ve,wt,lt,Hn,Yt,Et={},Dt={},cn=[],gt={},_n={},bt={},Nt={},Tn=null,Ft=0,ct=[],ln=new CI(h),xt=n.hotfixes||[],Tt={},nn={},sr=[],nt=function N(F,ie,ce,ve,Ne,Pe){if(!(this instanceof N))return new N(F,ie,ce,ve,Ne,Pe);isNaN(F)&&(F=1),isNaN(ie)&&(ie=0),isNaN(ce)&&(ce=0),isNaN(ve)&&(ve=1),isNaN(Ne)&&(Ne=0),isNaN(Pe)&&(Pe=0),this._matrix=[F,ie,ce,ve,Ne,Pe]};Object.defineProperty(nt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(N){this._matrix[0]=N}}),Object.defineProperty(nt.prototype,"shy",{get:function(){return this._matrix[
vendor: 15,553 bytes, lines 537-541
5371]},set:function(N){this._matrix[1]=N}}),Object.defineProperty(nt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(N){this._matrix[2]=N}}),Object.defineProperty(nt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(N){this._matrix[3]=N}}),Object.defineProperty(nt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(N){this._matrix[4]=N}}),Object.defineProperty(nt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(N){this._matrix[5]=N}}),Object.defineProperty(nt.prototype,"a",{get:function(){return this._matrix[0]},set:function(N){this._matrix[0]=N}}),Object.defineProperty(nt.prototype,"b",{get:function(){return this._matrix[1]},set:function(N){this._matrix[1]=N}}),Object.defineProperty(nt.prototype,"c",{get:function(){return this._matrix[2]},set:function(N){this._matrix[2]=N}}),Object.defineProperty(nt.prototype,"d",{get:function(){return this._matrix[3]},set:function(N){this._matrix[3]=N}}),Object.defineProperty(nt.prototype,"e",{get:function(){return this._matrix[4]},set:function(N){this._matrix[4]=N}}),Object.defineProperty(nt.prototype,"f",{get:function(){return this._matrix[5]},set:function(N){this._matrix[5]=N}}),Object.defineProperty(nt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(nt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(nt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(nt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),nt.prototype.join=function(N){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(I).join(N)},nt.prototype.multiply=function(N){var F=N.sx*this.sx+N.shy*this.shx,ie=N.sx*this.shy+N.shy*this.sy,ce=N.shx*this.sx+N.sy*this.shx,ve=N.shx*this.shy+N.sy*this.sy,Ne=N.tx*this.sx+N.ty*this.shx+this.tx,Pe=N.tx*this.shy+N.ty*this.sy+this.ty;return new nt(F,ie,ce,ve,Ne,Pe)},nt.prototype.decompose=function(){var N=this.sx,F=this.shy,ie=this.shx,ce=this.sy,ve=this.tx,Ne=this.ty,Pe=Math.sqrt(N*N+F*F),tt=(N/=Pe)*ie+(F/=Pe)*ce;ie-=N*tt,ce-=F*tt;var ut=Math.sqrt(ie*ie+ce*ce);return tt/=ut,N*(ce/=ut)<F*(ie/=ut)&&(N=-N,F=-F,tt=-tt,Pe=-Pe),{scale:new nt(Pe,0,0,ut,0,0),translate:new nt(1,0,0,1,ve,Ne),rotate:new nt(N,F,-F,N,0,0),skew:new nt(1,0,tt,1,0,0)}},nt.prototype.toString=function(N){return this.join(" ")},nt.prototype.inversed=function(){var N=this.sx,F=this.shy,ie=this.shx,ce=this.sy,ve=this.tx,Ne=this.ty,Pe=1/(N*ce-F*ie),tt=ce*Pe,ut=-F*Pe,kt=-ie*Pe,Bt=N*Pe;return new nt(tt,ut,kt,Bt,-tt*ve-kt*Ne,-ut*ve-Bt*Ne)},nt.prototype.applyToPoint=function(N){var F=N.x*this.sx+N.y*this.shx+this.tx,ie=N.x*this.shy+N.y*this.sy+this.ty;return new Wl(F,ie)},nt.prototype.applyToRectangle=function(N){var F=this.applyToPoint(N),ie=this.applyToPoint(new Wl(N.x+N.w,N.y+N.h));return new Z0(F.x,F.y,ie.x-F.x,ie.y-F.y)},nt.prototype.clone=function(){var N=this.sx,F=this.shy,ie=this.shx,ce=this.sy,ve=this.tx,Ne=this.ty;return new nt(N,F,ie,ce,ve,Ne)},h.Matrix=nt;var Kr=h.matrixMult=function(N,F){return F.multiply(N)},ci=new nt(1,0,0,1,0,0);h.unitMatrix=h.identityMatrix=ci;var Wn=function(N,F){if(!_n[N]){var ie=(F instanceof Bh?"Sh":"P")+(Object.keys(gt).length+1).toString(10);F.id=ie,_n[N]=ie,gt[ie]=F,ln.publish("addPattern",F)}};h.ShadingPattern=Bh,h.TilingPattern=jm,h.addShadingPattern=function(N,F){return L("addShadingPattern()"),Wn(N,F),this},h.beginTilingPattern=function(N){L("beginTilingPattern()"),ev(N.boundingBox[0],N.boundingBox[1],N.boundingBox[2]-N.boundingBox[0],N.boundingBox[3]-N.boundingBox[1],N.matrix)},h.endTilingPattern=function(N,F){L("endTilingPattern()"),F.stream=_e[G].join(`
538`),Wn(N,F),ln.publish("endTilingPattern",F),sr.pop().restore()};var pr,ar=h.__private__.newObject=function(){var N=Yr();return ui(N,!0),N},Yr=h.__private__.newObjectDeferred=function(){return X++,Q[X]=function(){return pe},X},ui=function(N,F){return F=typeof F=="boolean"&&F,Q[N]=pe,F&&Y(N+" 0 obj"),N},sh=h.__private__.newAdditionalObject=function(){var N={objId:Yr(),content:""};return me.push(N),N},lu=Yr(),qa=Yr(),zo=h.__private__.decodeColorString=function(N){var F=N.split(" ");if(F.length!==2||F[1]!=="g"&&F[1]!=="G")F.length!==5||F[4]!=="k"&&F[4]!=="K"||(F=[(1-F[0])*(1-F[3]),(1-F[1])*(1-F[3]),(1-F[2])*(1-F[3]),"r"]);else{var ie=parseFloat(F[0]);F=[ie,ie,ie,"r"]}for(var ce="#",ve=0;ve<3;ve++)ce+=("0"+Math.floor(255*parseFloat(F[ve])).toString(16)).slice(-2);return ce},Ha=h.__private__.encodeColorString=function(N){var F;typeof N=="string"&&(N={ch1:N});var ie=N.ch1,ce=N.ch2,ve=N.ch3,Ne=N.ch4,Pe=N.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ie=="string"&&ie.charAt(0)!=="#"){var tt=new w9(ie);if(tt.ok)ie=tt.toHex();else if(!/^\d*\.?\d*$/.test(ie))throw new Error('Invalid color "'+ie+'" passed to jsPDF.encodeColorString.')}if(typeof ie=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ie)&&(ie="#"+ie[1]+ie[1]+ie[2]+ie[2]+ie[3]+ie[3]),typeof ie=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ie)){var ut=parseInt(ie.substr(1),16);ie=ut>>16&255,ce=ut>>8&255,ve=255&ut}if(ce===void 0||Ne===void 0&&ie===ce&&ce===ve)F=typeof ie=="string"?ie+" "+Pe[0]:N.precision===2?j(ie/255)+" "+Pe[0]:$(ie/255)+" "+Pe[0];else if(Ne===void 0||wn(Ne)==="object"){if(Ne&&!isNaN(Ne.a)&&Ne.a===0)return["1.","1.","1.",Pe[1]].join(" ");F=typeof ie=="string"?[ie,ce,ve,Pe[1]].join(" "):N.precision===2?[j(ie/255),j(ce/255),j(ve/255),Pe[1]].join(" "):[$(ie/255),$(ce/255),$(ve/255),Pe[1]].join(" ")}else F=typeof ie=="string"?[ie,ce,ve,Ne,Pe[2]].join(" "):N.precision===2?[j(ie),j(ce),j(ve),j(Ne),Pe[2]].join(" "):[$(ie),$(ce),$(ve),$(Ne),Pe[2]].join(" ");return F},Wa=h.__private__.getFilters=function(){return a},ua=h.__private__.putStream=function(N){var F=(N=N||{}).data||"",ie=N.filters||Wa(),ce=N.alreadyAppliedFilters||[],ve=N.addLength1||!1,Ne=F.length,Pe=N.objectId,tt=function(Or){return Or};if(u!==null&&Pe===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");u!==null&&(tt=Ir.encryptor(Pe,0));var ut={};ie===!0&&(ie=["FlateEncode"]);var kt=N.additionalKeyValues||[],Bt=(ut=mt.API.processDataByFilters!==void 0?mt.API.processDataByFilters(F,ie):{data:F,reverseChain:[]}).reverseChain+(Array.isArray(ce)?ce.join(" "):ce.toString());if(ut.data.length!==0&&(kt.push({key:"Length",value:ut.data.length}),ve===!0&&kt.push({key:"Length1",value:Ne})),Bt.length!=0)if(Bt.split("/").length-1==1)kt.push({key:"Filter",value:Bt});else{kt.push({key:"Filter",value:"["+Bt+"]"});for(var sn=0;sn<kt.length;sn+=1)if(kt[sn].key==="DecodeParms"){for(var Xn=[],Nr=0;Nr<ut.reverseChain.split("/").length-1;Nr+=1)Xn.push("null");Xn.push(kt[sn].value),kt[sn].value="["+Xn.join(" ")+"]"}}Y("<<");for(var Pn=0;Pn<kt.length;Pn++)Y("/"+kt[Pn].key+" "+kt[Pn].value);Y(">>"),ut.data.length!==0&&(Y("stream"),Y(tt(ut.data)),Y("endstream"))},ah=h.__private__.putPage=function(N){var F=N.number,ie=N.data,ce=N.objId,ve=N.contentsObjId;ui(ce,!0),Y("<</Type /Page"),Y("/Parent "+N.rootDictionaryObjId+" 0 R"),Y("/Resources "+N.resourceDictionaryObjId+" 0 R"),Y("/MediaBox ["+parseFloat(I(N.mediaBox.bottomLeftX))+" "+parseFloat(I(N.mediaBox.bottomLeftY))+" "+I(N.mediaBox.topRightX)+" "+I(N.mediaBox.topRightY)+"]"),N.cropBox!==null&&Y("/CropBox ["+I(N.cropBox.bottomLeftX)+" "+I(N.cropBox.bottomLeftY)+" "+I(N.cropBox.topRightX)+" "+I(N.cropBox.topRightY)+"]"),N.bleedBox!==null&&Y("/BleedBox ["+I(N.bleedBox.bottomLeftX)+" "+I(N.bleedBox.bottomLeftY)+" "+I(N.bleedBox.topRightX)+" "+I(N.bleedBox.topRightY)+"]"),N.trimBox!==null&&Y("/TrimBox ["+I(N.trimBox.bottomLeftX)+" "+I(N.trimBox.bottomLeftY)+" "+I(N.trimBox.topRightX)+" "+I(N.trimBox.topRightY)+"]"),N.artBox!==null&&Y("/ArtBox ["+I(N.artBox.bottomLeftX)+" "+I(N.artBox.bottomLeftY)+" "+I(N.artBox.topRightX)+" "+I(N.artBox.topRightY)+"]"),typeof N.userUnit=="number"&&N.userUnit!==1&&Y("/UserUnit "+N.userUnit),ln.publish("putPage",{objId:ce,pageContext:ct[F],pageNumber:F,page:ie}),Y("/Contents "+ve+" 0 R"),Y(">>"),Y("endobj");var Ne=ie.join(`
539`);return A===S&&(Ne+=`
540Q`),ui(ve,!0),ua({data:Ne,filters:Wa(),objectId:ve}),Y("endobj"),ce},qo=h.__private__.putPages=function(){var N,F,ie=[];for(N=1;N<=Ft;N++)ct[N].objId=Yr(),ct[N].contentsObjId=Yr();for(N=1;N<=Ft;N++)ie.push(ah({number:N,data:_e[N],objId:ct[N].objId,contentsObjId:ct[N].contentsObjId,mediaBox:ct[N].mediaBox,cropBox:ct[N].cropBox,bleedBox:ct[N].bleedBox,trimBox:ct[N].trimBox,artBox:ct[N].artBox,userUnit:ct[N].userUnit,rootDictionaryObjId:lu,resourceDictionaryObjId:qa}));ui(lu,!0),Y("<</Type /Pages");var ce="/Kids [";for(F=0;F<Ft;F++)ce+=ie[F]+" 0 R ";Y(ce+"]"),Y("/Count "+Ft),Y(">>"),Y("endobj"),ln.publish("postPutPages")},oh=function(N){ln.publish("putFont",{font:N,out:Y,newObject:ar,putStream:ua}),N.isAlreadyPutted!==!0&&(N.objectNumber=ar(),Y("<<"),Y("/Type /Font"),Y("/BaseFont /"+ym(N.postScriptName)),Y("/Subtype /Type1"),typeof N.encoding=="string"&&Y("/Encoding /"+N.encoding),Y("/FirstChar 32"),Y("/LastChar 255"),Y(">>"),Y("endobj"))},Lp=function(N){N.objectNumber=ar();var F=[];F.push({key:"Type",value:"/XObject"}),F.push({key:"Subtype",value:"/Form"}),F.push({key:"BBox",value:"["+[I(N.x),I(N.y),I(N.x+N.width),I(N.y+N.height)].join(" ")+"]"}),F.push({key:"Matrix",value:"["+N.matrix.toString()+"]"});var ie=N.pages[1].join(`
541`);ua({data:ie,additionalKeyValues:F,objectId:N.objectNumber}),Y("endobj")},Ip=function(N,F){F||(F=21);var ie=ar(),ce=function(Pe,tt){var ut,kt=[],Bt=1/(tt-1);for(ut=0;ut<1;ut+=Bt)kt.push(ut);if(kt.push(1),Pe[0].offset!=0){var sn={offset:0,color:Pe[0].color};Pe.unshift(sn)}if(Pe[Pe.length-1].offset!=1){var Xn={offset:1,color:Pe[Pe.length-1].color};Pe.push(Xn)}for(var Nr="",Pn=0,Or=0;Or<kt.length;Or++){for(ut=kt[Or];ut>Pe[Pn+1].offset;)Pn++;var kr=Pe[Pn].offset,di=(ut-kr)/(Pe[Pn+1].offset-kr),Kl=Pe[Pn].color,Ga=Pe[Pn+1].color;Nr+=ae(Math.round((1-di)*Kl[0]+di*Ga[0]).toString(16))+ae(Math.round((1-di)*Kl[1]+di*Ga[1]).toString(16))+ae(Math.round((1-di)*Kl[2]+di*Ga[2]).toString(16))}return Nr.trim()}(N.colors,F),ve=[];ve.push({key:"FunctionType",value:"0"}),ve.push({key:"Domain",value:"[0.0 1.0]"}),ve.push({key:"Size",value:"["+F+"]"}),ve.push({key:"BitsPerSample",value:"8"}),ve.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ve.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ua({data:ce,additionalKeyValues:ve,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ie}),Y("endobj"),N.objectNumber=ar(),Y("<< /ShadingType "+N.type),Y("/ColorSpace /DeviceRGB");var Ne="/Coords ["+I(parseFloat(N.coords[0]))+" "+I(parseFloat(N.coords[1]))+" ";N.type===2?Ne+=I(parseFloat(N.coords[2]))+" "+I(parseFloat(N.coords[3])):Ne+=I(parseFloat(N.coords[2]))+" "+I(parseFloat(N.coords[3]))+" "+I(parseFloat(N.coords[4]))+" "+I(parseFloat(N.coords[5])),Y(Ne+="]"),N.matrix&&Y("/Matrix ["+N.matrix.toString()+"]"),Y("/Function "+ie+" 0 R"),Y("/Extend [true true]"),Y(">>"),Y("endobj")},Op=function(N,F){var ie=Yr(),ce=ar();F.push({resourcesOid:ie,objectOid:ce}),N.objectNumber=ce;var ve=[];ve.push({key:"Type",value:"/Pattern"}),ve.push({key:"PatternType",value:"1"}),ve.push({key:"PaintType",value:"1"}),ve.push({key:"TilingType",value:"1"}),ve.push({key:"BBox",value:"["+N.boundingBox.map(I).join(" ")+"]"}),ve.push({key:"XStep",value:I(N.xStep)}),ve.push({key:"YStep",value:I(N.yStep)}),ve.push({key:"Resources",value:ie+" 0 R"}),N.matrix&&ve.push({key:"Matrix",value:"["+N.matrix.toString()+"]"}),ua({data:N.stream,additionalKeyValues:ve,objectId:N.objectNumber}),Y("endobj")},AS=function(N){for(var F in N.objectNumber=ar(),Y("<<"),N)switch(F){case"opacity":Y("/ca "+j(N[F]));break;case"stroke-opacity":Y("/CA "+j(N[F]))}Y(">>"),Y("endobj")},W0=function(N){ui(N.resourcesOid,!0),Y("<<"),Y("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var F in Y("/Font <<"),Et)Et.hasOwnProperty(F)&&(f===!1||f===!0&&p.hasOwnProperty(F))&&Y("/"+F+" "+Et[F].objectNumber+" 0 R");Y(">>")}(),function(){if(Object.keys(gt).length>0){for(var F in Y("/Shading <<"),gt)gt.hasOwnProperty(F)&&gt[F]instanceof Bh&&gt[F].objectNumber>=0&&Y("/"+F+" "+gt[F].objectNumber+" 0 R");ln.publish("putShadingPatternDict"),Y(">>")}}(),function(F){if(Object.keys(gt).length>0){for(var ie in Y("/Pattern <<"),gt)gt.hasOwnProperty(ie)&&gt[ie]instanceof h.TilingPattern&&gt[ie].objectNumber>=0&&gt[ie].objectNumber<F&&Y("/"+ie+" "+gt[ie].objectNumber+" 0 R");ln.publish("putTilingPatternDict"),Y(">>")}}(N.objectOid),function(){if(Object.keys(bt).length>0){var F;for(F in Y("/ExtGState <<"),bt)bt.hasOwnProperty(F)&&bt[F].objectNumber>=0&&Y("/"+F+" "+bt[F].objectNumber+" 0 R");ln.publish("putGStateDict"),Y(">>")}}(),function(){for(var F in Y("/XObject <<"),Tt)Tt.hasOwnProperty(F)&&Tt[F].objectNumber>=0&&Y("/"+F+" "+Tt[F].objectNumber+" 0 R");ln.publish("putXobjectDict"),Y(">>")}(),Y(">>"),Y("endobj")},tw=function(N){Dt[N.fontName]=Dt[N.fontName]||{},Dt[N.fontName][N.fontStyle]=N.id},nw=function(N,F,ie,ce,ve){var Ne={id:"F"+(Object.keys(Et).length+1).toString(10),postScriptName:N,fontName:F,fontStyle:ie,encoding:ce,isStandardFont:ve||!1,metadata:{}};return ln.publish("addFont",{font:Ne,instance:this}),Et[Ne.id]=Ne,tw(Ne),Ne.id},da=h.__private__.pdfEscape=h.pdfEscape=function(N,F){return function(ie,ce){var ve,Ne,Pe,tt,ut,kt,Bt,sn,Xn;if(Pe=(ce=ce||{}).sourceEncoding||"Unicode",ut=ce.outputEncoding,(ce.autoencode||ut)&&Et[Ve].metadata&&Et[Ve].metadata[Pe]&&Et[Ve].metadata[Pe].encoding&&(tt=Et[Ve].metadata[Pe].encoding,!ut&&Et[Ve].encoding&&(ut=Et[Ve].encoding),!ut&&tt.codePages&&(ut=tt.codePages[0]),typeof ut=="string"&&(ut=tt[ut]),ut)){for(Bt=!1,kt=[],ve=0,Ne=ie.length;ve<Ne;ve++)(sn=ut[ie.charCodeAt(ve)])?kt.push(String.fromCharCode(sn)):kt.push(ie[ve]),kt[ve].charCodeAt(0)>>8&&(Bt=!0);ie=kt.join("")}for(ve=ie.length;Bt===void 0&&ve!==0;)ie.charCodeAt(ve-1)>>8&&(Bt=!0),ve--;if(!Bt)return ie;for(kt=ce.noBOM?[]:[254,255],ve=0,Ne=ie.length;ve<Ne;ve++){if((Xn=(sn=ie.charCodeAt(ve))>>8)>>8)throw new Error("Character at position "+ve+" of string '"+ie+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");kt.push(Xn),kt.push(sn-(Xn<<8))}return String.fromCharCode.apply(void 0,kt)}(N,F).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},V0=h.__private__.beginPage=function(N){_e[++Ft]=[],ct[Ft]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(N[0]),topRightY:Number(N[1])}},iw(Ft),Re(_e[G])},rw=function(N,F){var ie,ce,ve;switch(t=F||t,typeof N=="string"&&(ie=y(N.toLowerCase()),Array.isArray(ie)&&(ce=ie[0],ve=ie[1])),Array.isArray(N)&&(ce=N[0]*wt,ve=N[1]*wt),isNaN(ce)&&(ce=i[0],ve=i[1]),(ce>14400||ve>14400)&&(kn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),ce=Math.min(14400,ce),ve=Math.min(14400,ve)),i=[ce,ve],t.substr(0,1)){case"l":ve>ce&&(i=[ve,ce]);break;case"p":ce>ve&&(i=[ve,ce])}V0(i),Pt(Y0),Y(Bp),J0!==0&&Y(J0+" J"),Q0!==0&&Y(Q0+" j"),ln.publish("addPage",{pageNumber:Ft})},G0=function(N){N>0&&N<=Ft&&(_e.splice(N,1),ct.splice(N,1),Ft--,G>Ft&&(G=Ft),this.setPage(G))},iw=function(N){N>0&&N<=Ft&&(G=N)},sw=h.__private__.getNumberOfPages=h.getNumberOfPages=function(){return _e.length-1},aw=function(N,F,ie){var ce,ve=void 0;return ie=ie||{},N=N!==void 0?N:Et[Ve].fontName,F=F!==void 0?F:Et[Ve].fontStyle,ce=N.toLowerCase(),Dt[ce]!==void 0&&Dt[ce][F]!==void 0?ve=Dt[ce][F]:Dt[N]!==void 0&&Dt[N][F]!==void 0?ve=Dt[N][F]:ie.disableWarning===!1&&kn.warn("Unable to look up font label for font '"+N+"', '"+F+"'. Refer to getFontList(
541) for available fonts."),ve||ie.noFallback||(ve=Dt.times[F])==null&&(ve=Dt.times.normal),ve},Ho=h.__private__.putInfo=function(){var N=ar(),F=function(ce){return ce};for(var ie in u!==null&&(F=Ir.encryptor(N,0)),Y("<<"),Y("/Producer ("+da(F("jsPDF "+mt.version))+")"),Ot)Ot.hasOwnProperty(ie)&&Ot[ie]&&Y("/"+ie.substr(0,1).toUpperCase()+ie.substr(1)+" ("+da(F(Ot[ie]))+")");Y("/CreationDate ("+da(F(le))+")"),Y(">>"),Y("endobj")},Mp=h.__private__.putCatalog=function(N){var F=(N=N||{}).rootDictionaryObjId||lu;switch(ar(),Y("<<"),Y("/Type /Catalog"),Y("/Pages "+F+" 0 R"),Je||(Je="fullwidth"),Je){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 ie=""+Je;ie.substr(ie.length-1)==="%"&&(Je=parseInt(Je)/100),typeof Je=="number"&&Y("/OpenAction [3 0 R /XYZ null null "+j(Je)+"]")}switch(Ct||(Ct="continuous"),Ct){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")}ze&&Y("/PageMode /"+ze),ln.publish("putCatalog"),Y(">>"),Y("endobj")},ES=h.__private__.putTrailer=function(){Y("trailer"),Y("<<"),Y("/Size "+(X+1)),Y("/Root "+X+" 0 R"),Y("/Info "+(X-1)+" 0 R"),u!==null&&Y("/Encrypt "+Ir.oid+" 0 R"),Y("/ID [ <"+oe+"> <"+oe+"> ]"),Y(">>")},Er=h.__private__.putHeader=function(){Y("%PDF-"+b),Y("%ºß¬à")},ow=h.__private__.putXRef=function(){var N="0000000000";Y("xref"),Y("0 "+(X+1)),Y("0000000000 65535 f ");for(var F=1;F<=X;F++)typeof Q[F]=="function"?Y((N+Q[F]()).slice(-10)+" 00000 n "):Q[F]!==void 0?Y((N+Q[F]).slice(-10)+" 00000 n "):Y("0000000000 00000 n ")},Wo=h.__private__.buildDocument=function(){var N;X=0,pe=0,ue=[],Q=[],me=[],lu=Yr(),qa=Yr(),Re(ue),ln.publish("buildDocument"),Er(),qo(),function(){ln.publish("putAdditionalObjects");for(var ie=0;ie<me.length;ie++){var ce=me[ie];ui(ce.objId,!0),Y(ce.content),Y("endobj")}ln.publish("postPutAdditionalObjects")}(),N=[],function(){for(var ie in Et)Et.hasOwnProperty(ie)&&(f===!1||f===!0&&p.hasOwnProperty(ie))&&oh(Et[ie])}(),function(){var ie;for(ie in bt)bt.hasOwnProperty(ie)&&AS(bt[ie])}(),function(){for(var ie in Tt)Tt.hasOwnProperty(ie)&&Lp(Tt[ie])}(),function(ie){var ce;for(ce in gt)gt.hasOwnProperty(ce)&&(gt[ce]instanceof Bh?Ip(gt[ce]):gt[ce]instanceof jm&&Op(gt[ce],ie))}(N),ln.publish("putResources"),N.forEach(W0),W0({resourcesOid:qa,objectOid:Number.MAX_SAFE_INTEGER}),ln.publish("postPutResources"),u!==null&&(Ir.oid=ar(),Y("<<"),Y("/Filter /Standard"),Y("/V "+Ir.v),Y("/R "+Ir.r),Y("/U <"+Ir.toHexString(Ir.U)+">"),Y("/O <"+Ir.toHexString(Ir.O)+">"),Y("/P "+Ir.P),Y(">>"),Y("endobj")),Ho(),Mp();var F=pe;return ow(),ES(),Y("startxref"),Y(""+F),Y("%%EOF"),Re(_e[G]),ue.join(`
542`)},Dp=h.__private__.getBlob=function(N){return new Blob([it(N)],{type:"application/pdf"})},lw=h.output=h.__private__.output=(pr=function(N,F){switch(typeof(F=F||{})=="string"?F={filename:F}:F.filename=F.filename||"generated.pdf",N){case void 0:return Wo();case"save":h.save(F.filename);break;case"arraybuffer":return it(Wo());case"blob":return Dp(Wo());case"bloburi":case"bloburl":if(At.URL!==void 0&&typeof At.URL.createObjectURL=="function")return At.URL&&At.URL.createObjectURL(Dp(Wo()))||void 0;kn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ie="",ce=Wo();try{ie=EI(ce)}catch{ie=EI(unescape(encodeURIComponent(ce)))}return"data:application/pdf;filename="+F.filename+";base64,"+ie;case"pdfobjectnewwindow":if(Object.prototype.toString.call(At)==="[object Window]"){var ve="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ne=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';F.pdfObjectUrl&&(ve=F.pdfObjectUrl,Ne="");var Pe='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="'+ve+'"'+Ne+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(F)+");<\/script></body></html>",tt=At.open();return tt!==null&&tt.document.write(Pe),tt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(At)==="[object Window]"){var ut='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="'+(F.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+F.filename+'" width="500px" height="400px" /></body></html>',kt=At.open();if(kt!==null){kt.document.write(ut);var Bt=this;kt.document.documentElement.querySelector("#pdfViewer").onload=function(){kt.document.title=F.filename,kt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Bt.output("bloburl"))}}return kt}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(At)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var sn='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring",F)+'"></iframe></body></html>',Xn=At.open();if(Xn!==null&&(Xn.document.write(sn),Xn.document.title=F.filename),Xn||typeof safari>"u")return Xn;break;case"datauri":case"dataurl":return At.document.location.href=this.output("datauristring",F);default:return null}},pr.foo=function(){try{return pr.apply(this,arguments)}catch(ie){var N=ie.stack||"";~N.indexOf(" at ")&&(N=N.split(" at ")[1]);var F="Error in function "+N.split(`
543`)[0].split("<")[0]+": "+ie.message;if(!At.console)throw new Error(F);At.console.error(F,ie),At.alert&&alert(F)}},pr.foo.bar=pr,pr.foo),ha=function(N){return Array.isArray(xt)===!0&&xt.indexOf(N)>-1};switch(r){case"pt":wt=1;break;case"mm":wt=72/25.4;break;case"cm":wt=72/2.54;break;case"in":wt=72;break;case"px":wt=ha("px_scaling")==1?.75:96/72;break;case"pc":case"em":wt=12;break;case"ex":wt=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);wt=r}var Ir=null;ge(),O();var Ul=h.__private__.getPageInfo=h.getPageInfo=function(N){if(isNaN(N)||N%1!=0)throw new Error("Invalid argument passed to 
543jsPDF.getPageInfo");return{objId:ct[N].objId,pageNumber:N,pageContext:ct[N]}},cw=h.__private__.getPageInfoByObjId=function(N){if(isNaN(N)||N%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var F in ct)if(ct[F].objId===N)break;return Ul(F)},NS=h.__private__.getCurrentPageInfo=h.getCurrentPageInfo=function(){return{objId:ct[G].objId,pageNumber:G,pageContext:ct[G]}};h.addPage=function(){return rw.apply(this,arguments),this},h.setPage=function(){return iw.apply(this,arguments),Re.call(this,_e[G]),this},h.insertPage=function(N){return this.addPage(),this.movePage(G,N),this},h.movePage=function(N,F){var ie,ce;if(N>F){ie=_e[N],ce=ct[N];for(var ve=N;ve>F;ve--)_e[ve]=_e[ve-1],ct[ve]=ct[ve-1];_e[F]=ie,ct[F]=ce,this.setPage(F)}else if(N<F){ie=_e[N],ce=ct[N];for(var Ne=N;Ne<F;Ne++)_e[Ne]=_e[Ne+1],ct[Ne]=ct[Ne+1];_e[F]=ie,ct[F]=ce,this.setPage(F)}return this},h.deletePage=function(){return G0.apply(this,arguments),this},h.__private__.text=h.text=function(N,F,ie,ce,ve){var Ne,Pe,tt,ut,kt,Bt,sn,Xn,Nr,Pn=(ce=ce||{}).scope||this;if(typeof N=="number"&&typeof F=="number"&&(typeof ie=="string"||Array.isArray(ie))){var Or=ie;ie=F,F=N,N=Or}if(arguments[3]instanceof nt==0?(tt=arguments[4],ut=arguments[5],wn(sn=arguments[3])==="object"&&sn!==null||(typeof tt=="string"&&(ut=tt,tt=null),typeof sn=="string"&&(ut=sn,sn=null),typeof sn=="number"&&(tt=sn,sn=null),ce={flags:sn,angle:tt,align:ut})):(L("The transform parameter of text() with a Matrix value"),Nr=ve),isNaN(F)||isNaN(ie)||N==null)throw new Error("Invalid arguments passed to jsPDF.text");if(N.length===0)return Pn;var kr,di="",Kl=typeof ce.lineHeightFactor=="number"?ce.lineHeightFactor:ch,Ga=Pn.internal.scaleFactor;function Yl(hn){return hn=hn.split("	").join(Array(ce.TabLen||9).join(" ")),da(hn,sn)}function nv(hn){for(var En,gr=hn.concat(),Mr=[],Ql=gr.length;Ql--;)typeof(En=gr.shift())=="string"?Mr.push(En):Array.isArray(hn)&&(En.length===1||En[1]===void 0&&En[2]===void 0)?Mr.push(En[0]):Mr.push([En[0],En[1],En[2]]);return Mr}function Up(hn,En){var gr;if(typeof hn=="string")gr=En(hn)[0];else if(Array.isArray(hn)){for(var Mr,Ql,hv=hn.concat(),Hp=[],ww=hv.length;ww--;)typeof(Mr=hv.shift())=="string"?Hp.push(En(Mr)[0]):Array.isArray(Mr)&&typeof Mr[0]=="string"&&(Ql=En(Mr[0],Mr[1],Mr[2]),Hp.push([Ql[0],Ql[1],Ql[2]]));gr=Hp}return gr}var cu=!1,fh=!0;if(typeof N=="string")cu=!0;else if(Array.isArray(N)){var ph=N.concat();Pe=[];for(var uu,hi=ph.length;hi--;)(typeof(uu=ph.shift())!="string"||Array.isArray(uu)&&typeof uu[0]!="string")&&(fh=!1);cu=fh}if(cu===!1)throw new Error('Type of text must be string or Array. "'+N+'" is not recognized.');typeof N=="string"&&(N=N.match(/[\r?\n]/)?N.split(/\r\n|\r|\n/g):[N]);var mh=Ce/Pn.internal.scaleFactor,gh=mh*(Kl-1);switch(ce.baseline){case"bottom":ie-=gh;break;case"top":ie+=mh-gh;break;case"hanging":ie+=mh-2*gh;break;case"middle":ie+=mh/2-gh}if((Bt=ce.maxWidth||0)>0&&(typeof N=="string"?N=Pn.splitTextToSize(N,Bt):Object.prototype.toString.call(N)==="[object Array]"&&(N=N.reduce(function(hn,En){return hn.concat(Pn.splitTextToSize(En,Bt))},[]))),Ne={text:N,x:F,y:ie,options:ce,mutex:{pdfEscape:da,activeFontKey:Ve,fonts:Et,activeFontSize:Ce}},ln.publish("preProcessText",Ne),N=Ne.text,tt=(ce=Ne.options).angle,Nr instanceof nt==0&&tt&&typeof tt=="number"){tt*=Math.PI/180,ce.rotationDirection===0&&(tt=-tt),A===S&&(tt=-tt);var rv=Math.cos(tt),iv=Math.sin(tt);Nr=new nt(rv,iv,-iv,rv,0,0)}else tt&&tt instanceof nt&&(Nr=tt);A!==S||Nr||(Nr=ci),(kt=ce.charSpace||Hl)!==void 0&&(di+=I(J(kt))+` Tc
544`,this.setCharSpace(this.getCharSpace()||0)),(Xn=ce.horizontalScale)!==void 0&&(di+=I(100*Xn)+` Tz
545`),ce.lang;var Vi=-1,Xl=ce.renderingMode!==void 0?ce.renderingMode:ce.stroke,zp=Pn.internal.getCurrentPageInfo().pageContext;switch(Xl){case 0:case!1:case"fill":Vi=0;break;case 1:case!0:case"stroke":Vi=1;break;case 2:case"fillThenStroke":Vi=2;break;case 3:case"invisible":Vi=3;break;case 4:case"fillAndAddForClipping":Vi=4;break;case 5:case"strokeAndAddPathForClipping":Vi=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Vi=6;break;
vendor: 8,656 bytes, lines 545-557
545case 7:case"addToPathForClipping":Vi=7}var yw=zp.usedRenderingMode!==void 0?zp.usedRenderingMode:-1;Vi!==-1?di+=Vi+` Tr
546`:yw!==-1&&(di+=`0 Tr
547`),Vi!==-1&&(zp.usedRenderingMode=Vi),ut=ce.align||"left";var fa,vh=Ce*Kl,sv=Pn.internal.pageSize.getWidth(),av=Et[Ve];kt=ce.charSpace||Hl,Bt=ce.maxWidth||0,sn=Object.assign({autoencode:!0,noBOM:!0},ce.flags);var du=[],yh=function(hn){return Pn.getStringUnitWidth(hn,{font:av,charSpace:kt,fontSize:Ce,doKerning:!1})*Ce/Ga};if(Object.prototype.toString.call(N)==="[object Array]"){var Ts;Pe=nv(N),ut!=="left"&&(fa=Pe.map(yh));var Ps,hu=0;if(ut==="right"){F-=fa[0],N=[],hi=Pe.length;for(var Jl=0;Jl<hi;Jl++)Jl===0?(Ps=zl(F),Ts=ql(ie)):(Ps=J(hu-fa[Jl]),Ts=-vh),N.push([Pe[Jl],Ps,Ts]),hu=fa[Jl]}else if(ut==="center"){F-=fa[0]/2,N=[],hi=Pe.length;for(var fu=0;fu<hi;fu++)fu===0?(Ps=zl(F),Ts=ql(ie)):(Ps=J((hu-fa[fu])/2),Ts=-vh),N.push([Pe[fu],Ps,Ts]),hu=fa[fu]}else if(ut==="left"){N=[],hi=Pe.length;for(var ov=0;ov<hi;ov++)N.push(Pe[ov])}else if(ut==="justify"&&av.encoding==="Identity-H"){N=[],hi=Pe.length,Bt=Bt!==0?Bt:sv;for(var qp=0,mr=0;mr<hi;mr++)if(Ts=mr===0?ql(ie):-vh,Ps=mr===0?zl(F):qp,mr<hi-1){var bw=J((Bt-fa[mr])/(Pe[mr].split(" ").length-1)),Go=Pe[mr].split(" ");N.push([Go[0]+" ",Ps,Ts]),qp=0;for(var Ko=1;Ko<Go.length;Ko++){var lv=(yh(Go[Ko-1]+" "+Go[Ko])-yh(Go[Ko]))*Ga+bw;Ko==Go.length-1?N.push([Go[Ko],lv,0]):N.push([Go[Ko]+" ",lv,0]),qp-=lv}}else N.push([Pe[mr],Ps,Ts]);N.push(["",qp,0])}else{if(ut!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(N=[],hi=Pe.length,Bt=Bt!==0?Bt:sv,mr=0;mr<hi;mr++){Ts=mr===0?ql(ie):-vh,Ps=mr===0?zl(F):0;var cv=Pe[mr].split(" ").length-1,uv=cv>0?(Bt-fa[mr])/cv:0;mr<hi-1?du.push(I(J(uv))):du.push(0),N.push([Pe[mr],Ps,Ts])}}}(typeof ce.R2L=="boolean"?ce.R2L:Qe)===!0&&(N=Up(N,function(hn,En,gr){return[hn.split("").reverse().join(""),En,gr]})),Ne={text:N,x:F,y:ie,options:ce,mutex:{pdfEscape:da,activeFontKey:Ve,fonts:Et,activeFontSize:Ce}},ln.publish("postProcessText",Ne),N=Ne.text,kr=Ne.mutex.isHex||!1;var dv=Et[Ve].encoding;dv!=="WinAnsiEncoding"&&dv!=="StandardEncoding"||(N=Up(N,function(hn,En,gr){return[Yl(hn),En,gr]})),Pe=nv(N),N=[];for(var pu,mu,gu,bh=Array.isArray(Pe[0])?1:0,vu="",wh=function(hn,En,gr){var Mr="";return gr instanceof nt?(gr=typeof ce.angle=="number"?Kr(gr,new nt(1,0,0,1,hn,En)):Kr(new nt(1,0,0,1,hn,En),gr),A===S&&(gr=Kr(new nt(1,0,0,-1,0,0),gr)),Mr=gr.join(" ")+` Tm
548`):Mr=I(hn)+" "+I(En)+` Td
549`,Mr},pa=0;pa<Pe.length;pa++){switch(vu="",bh){case 1:gu=(kr?"<":"(")+Pe[pa][0]+(kr?">":")"),pu=parseFloat(Pe[pa][1]),mu=parseFloat(Pe[pa][2]);break;case 0:gu=(kr?"<":"(")+Pe[pa]+(kr?">":")"),pu=zl(F),mu=ql(ie)}du!==void 0&&du[pa]!==void 0&&(vu=du[pa]+` Tw
550`),pa===0?N.push(vu+wh(pu,mu,Nr)+gu):bh===0?N.push(vu+gu):bh===1&&N.push(vu+wh(pu,mu,Nr)+gu)}N=bh===0?N.join(` Tj
551T* `):N.join(` Tj
552`),N+=` Tj
553`;var Yo=`BT
554/`;return Yo+=Ve+" "+Ce+` Tf
555`,Yo+=I(Ce*Kl)+` TL
556`,Yo+=uh+`
557`,Yo+=di,Yo+=N,Y(Yo+="ET"),p[Ve]=!0,Pn};var kS=h.__private__.clip=h.clip=function(N){return Y(N==="evenodd"?"W*":"W"),this};h.clipEvenOdd=function(){return kS("evenodd")},h.__private__.discardPath=h.discardPath=function(){return Y("n"),this};var Vo=h.__private__.isValidStyle=function(N){var F=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(N)!==-1&&(F=!0),F};h.__private__.setDefaultPathOperation=h.setDefaultPathOperation=function(N){return Vo(N)&&(c=N),this};var uw=h.__private__.getStyle=h.getStyle=function(N){var F=c;switch(N){case"D":case"S":F="S";break;case"F":F="f";break;case"FD":case"DF":F="B";break;case"f":case"f*":case"B":case"B*":F=N}return F},dw=h.close=function(){return Y("h"),this};h.stroke=function(){return Y("S"),this},h.fill=function(N){return Fp("f",N),this},h.fillEvenOdd=function(N){return Fp("f*",N),this},h.fillStroke=function(N){return Fp("B",N),this},h.fillStrokeEvenOdd=function(N){return Fp("B*",N),this};var Fp=function(N,F){wn(F)==="object"?TS(F,N):Y(N)},lh=function(N){N===null||A===S&&N===void 0||(N=uw(N),Y(N))};function CS(N,F,ie,ce,ve){var Ne=new jm(F||this.boundingBox,ie||this.xStep,ce||this.yStep,this.gState,ve||this.matrix);Ne.stream=this.stream;var Pe=N+"$$"+this.cloneIndex+++"$$";return Wn(Pe,Ne),Ne}var TS=function(N,F){var ie=_n[N.key],ce=gt[ie];if(ce instanceof Bh)Y("q"),Y(PS(F)),ce.gState&&h.setGState(ce.gState),Y(N.matrix.toString()+" cm"),Y("/"+ie+" sh"),Y("Q");else if(ce instanceof jm){var ve=new nt(1,0,0,-1,0,hh());N.matrix&&(ve=ve.multiply(N.matrix||ci),ie=CS.call(ce,N.key,N.boundingBox,N.xStep,N.yStep,ve).id),Y("q"),Y("/Pattern cs"),Y("/"+ie+" scn"),ce.gState&&h.setGState(ce.gState),Y(F),Y("Q")}},PS=function(N){switch(N){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"}},K0=h.moveTo=function(N,F){return Y(I(J(N))+" "+I(H(F))+" m"),this},hw=h.lineTo=function(N,F){return Y(I(J(N))+" "+I(H(F))+" l"),this},Va=h.curveTo=function(N,F,ie,ce,ve,Ne){return Y([I(J(N)),I(H(F)),I(J(ie)),I(H(ce)),I(J(ve)),I(H(Ne)),"c"].join(" ")),this};h.__private__.line=h.line=function(N,F,ie,ce,ve){if(isNaN(N)||isNaN(F)||isNaN(ie)||isNaN(ce)||!Vo(ve))throw new Error("Invalid arguments passed to jsPDF.line");return A===x?this.lines([[ie-N,ce-F]],N,F,[1,1],ve||"S"):this.lines([[ie-N,ce-F]],N,F,[1,1]).stroke()},h.__private__.lines=h.lines=function(N,F,ie,ce,ve,Ne){var Pe,tt,ut,kt,Bt,sn,Xn,Nr,Pn,Or,kr,di;if(typeof N=="number"&&(di=ie,ie=F,F=N,N=di),ce=ce||[1,1],Ne=Ne||!1,isNaN(F)||isNaN(ie)||!Array.isArray(N)||!Array.isArray(ce)||!Vo(ve)||typeof Ne!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(K0(F,ie),Pe=ce[0],tt=ce[1],kt=N.length,Or=F,kr=ie,ut=0;ut<kt;ut++)(Bt=N[ut]).length===2?(Or=Bt[0]*Pe+Or,kr=Bt[1]*tt+kr,hw(Or,kr)):(sn=Bt[0]*Pe+Or,Xn=Bt[1]*tt+kr,Nr=Bt[2]*Pe+Or,Pn=Bt[3]*tt+kr,Or=Bt[4]*Pe+Or,kr=Bt[5]*tt+kr,Va(sn,Xn,Nr,Pn,Or,kr));return Ne&&dw(),lh(ve),this},h.path=function(N){for(var F=0;F<N.length;F++){var ie=N[F],ce=ie.c;switch(ie.op){case"m":K0(ce[0],ce[1]);break;case"l":hw(ce[0],ce[1]);break;case"c":Va.apply(this,ce);break;case"h":dw()}}return this},h.__private__.rect=h.rect=function(N,F,ie,ce,ve){if(isNaN(N)||isNaN(F)||isNaN(ie)||isNaN(ce)||!Vo(ve))throw new Error("Invalid arguments passed to jsPDF.rect");return A===x&&(ce=-ce),Y([I(J(N)),I(H(F)),I(J(ie)),I(J(ce)),"re"].join(" ")),lh(ve),this},h.__private__.triangle=h.triangle=function(N,F,ie,ce,ve,Ne,Pe){if(isNaN(N)||isNaN(F)||isNaN(ie)||isNaN(ce)||isNaN(ve)||isNaN(Ne)||!Vo(Pe))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ie-N,ce-F],[ve-ie,Ne-ce],[N-ve,F-Ne]],N,F,[1,1],Pe,!0),this},h.__private__.roundedRect=h.roundedRect=function(N,F,ie,ce,ve,Ne,Pe){if(isNaN(N)||isNaN(F)||isNaN(ie)||isNaN(ce)||isNaN(ve)||isNaN(Ne)||!Vo(Pe))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var tt=4/3*(Math.SQRT2-1);return ve=Math.min(ve,.5*ie),Ne=Math.min(Ne,.5*ce),this.lines([[ie-2*ve,0],[ve*tt,0,ve,Ne-Ne*tt,ve,Ne],[0,ce-2*Ne],[0,Ne*tt,-ve*tt,Ne,-ve,Ne],[2*ve-ie,0],[-ve*tt,0,-ve,-Ne*tt,-ve,-Ne],[0,2*Ne-ce],[0,-Ne*tt,ve*tt,-Ne,ve,-Ne]],N+ve,F,[1,1],Pe,!0),this},h.__private__.ellipse=h.ellipse=function(N,F,ie,ce,ve){if(isNaN(N)||isNaN(F)||isNaN(ie)||isNaN(ce)||!Vo(ve))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ne=4/3*(Math.SQRT2-1)*ie,Pe=4/3*(Math.SQRT2-1)*ce;return K0(N+ie,F),Va(N+ie,F-Pe,N+Ne,F-ce,N,F-ce),Va(N-Ne,F-ce,N-ie,F-Pe,N-ie,F),Va(N-ie,F+Pe,N-Ne,F+ce,N,F+ce),Va(N+Ne,F+ce,N+ie,F+Pe,N+ie,F),lh(ve),this},h.__private__.circle=h.circle=function(N,F,ie,ce){if(isNaN(N)||isNaN(F)||isNaN(ie)||!Vo(ce))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(N,F,ie,ie,ce)},h.setFont=function(N,F,ie){return ie&&(F=R(F,ie)),Ve=aw(N,F,{disableWarning:!1}),this};var jS=h.__private__.getFont=h.getFont=function(){return Et[aw.apply(h,arguments)]};h.__private__.getFontList=h.getFontList=function(){var N,F,ie={};for(N in Dt)if(Dt.hasOwnProperty(N))for(F in ie[N]=[],Dt[N])Dt[N].hasOwnProperty(F)&&ie[N].push(F);return ie},h.addFont=function(N,F,ie,ce,ve){var Ne=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ne.indexOf(arguments[3])!==-1?ve=arguments[3]:arguments[3]&&Ne.indexOf(arguments[3])==-1&&(ie=R(ie,ce)),nw.call(this,N,F,ie,ve=ve||"Identity-H")};var ch,Y0=n.lineWidth||.200025,RS=h.__private__.getLineWidth=h.getLineWidth=function(){return Y0},Pt=h.__private__.setLineWidth=h.setLineWidth=function(N){return Y0=N,Y(I(J(N))+" w"),this};h.__private__.setLineDash=mt.API.setLineDash=mt.API.setLineDashPattern=function(N,F){if(N=N||[],F=F||0,isNaN(F)||!Array.isArray(N))throw new Error("Invalid arguments passed to 
557jsPDF.setLineDash");return N=N.map(function(ie){return I(J(ie))}).join(" "),F=I(J(F)),Y("["+N+"] "+F+" d"),this};var LS=h.__private__.getLineHeight=h.getLineHeight=function(){return Ce*ch};h.__private__.getLineHeight=h.getLineHeight=function(){return Ce*ch};var IS=h.__private__.setLineHeightFactor=h.setLineHeightFactor=function(N){return typeof(N=N||1.15)=="number"&&(ch=N),this},OS=h.__private__.getLineHeightFactor=h.getLineHeightFactor=function(){return ch};IS(n.lineHeight);var zl=h.__private__.getHorizontalCoordinate=function(N){return J(N)},ql=h.__private__.getVerticalCoordinate=function(N){return A===S?N:ct[G].mediaBox.topRightY-ct[G].mediaBox.bottomLeftY-J(N)},MS=h.__private__.getHorizontalCoordinateString=h.getHorizontalCoordinateString=function(N){return I(zl(N))},DS=h.__private__.getVerticalCoordinateString=h.getVerticalCoordinateString=function(N){return I(ql(N))},Bp=n.strokeColor||"0 G";h.__private__.getStrokeColor=h.getDrawColor=function(){return zo(Bp)},h.__private__.setStrokeColor=h.setDrawColor=function(N,F,ie,ce){return Bp=Ha({ch1:N,ch2:F,ch3:ie,ch4:ce,pdfColorType:"draw",precision:2}),Y(Bp),this};var X0=n.fillColor||"0 g";h.__private__.getFillColor=h.getFillColor=function(){return zo(X0)},h.__private__.setFillColor=h.setFillColor=function(N,F,ie,ce){return X0=Ha({ch1:N,ch2:F,ch3:ie,ch4:ce,pdfColorType:"fill",precision:2}),Y(X0),this};var uh=n.textColor||"0 g",FS=h.__private__.getTextColor=h.getTextColor=function(){return zo(uh)};h.__private__.setTextColor=h.setTextColor=function(N,F,ie,ce){return uh=Ha({ch1:N,ch2:F,ch3:ie,ch4:ce,pdfColorType:"text",precision:3}),this};var Hl=n.charSpace,BS=h.__private__.getCharSpace=h.getCharSpace=function(){return parseFloat(Hl||0)};h.__private__.setCharSpace=h.setCharSpace=function(N){if(isNaN(N))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Hl=N,this};var J0=0;h.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},h.__private__.setLineCap=h.setLineCap=function(N){var F=h.CapJoinStyles[N];if(F===void 0)throw new Error("Line cap style of '"+N+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return J0=F,Y(F+" J"),this};var Q0=0;h.__private__.setLineJoin=h.setLineJoin=function(N){var F=h.CapJoinStyles[N];if(F===void 0)throw new Error("Line join style of '"+N+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Q0=F,Y(F+" j"),this},h.__private__.setLineMiterLimit=h.__private__.setMiterLimit=h.setLineMiterLimit=h.setMiterLimit=function(N){if(N=N||0,isNaN(N))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Y(I(J(N))+" M"),this},h.GState=$_,h.setGState=function(N){(N=typeof N=="string"?bt[Nt[N]]:fw(null,N)).equals(Tn)||(Y("/"+N.id+" gs"),Tn=N)};var fw=function(N,F){if(!N||!Nt[N]){var ie=!1;for(var ce in bt)if(bt.hasOwnProperty(ce)&&bt[ce].equals(F)){ie=!0;break}if(ie)F=bt[ce];else{var ve="GS"+(Object.keys(bt).length+1).toString(10);bt[ve]=F,F.id=ve}return N&&(Nt[N]=F.id),ln.publish("addGState",F),F}};h.addGState=function(N,F){return fw(N,F),this},h.saveGraphicsState=function(){return Y("q"),cn.push({key:Ve,size:Ce,color:uh}),this},h.restoreGraphicsState=function(){Y("Q");var N=cn.pop();return Ve=N.key,Ce=N.size,uh=N.color,Tn=null,this},h.setCurrentTransformationMatrix=function(N){return Y(N.toString()+" cm"),this},h.comment=function(N){return Y("#"+N),this};var Wl=function(N,F){var ie=N||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ie},set:function(Ne){isNaN(Ne)||(ie=parseFloat(Ne))}});var ce=F||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return ce},set:function(Ne){isNaN(Ne)||(ce=parseFloat(Ne))}});var ve="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ve},set:function(Ne){ve=Ne.toString()}}),this},Z0=function(N,F,ie,ce){Wl.call(this,N,F),this.type="rect";var ve=ie||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ve},set:function(Pe){isNaN(Pe)||(ve=parseFloat(Pe))}});var Ne=ce||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ne},set:function(Pe){isNaN(Pe)||(Ne=parseFloat(Pe))}}),this},$p=function(){this.page=Ft,this.currentPage=G,this.pages=_e.slice(0),this.pagesContext=ct.slice(0),this.x=lt,this.y=Hn,this.matrix=Yt,this.width=tv(G),this.height=mw(G),this.outputDestination=ye,this.id="",this.objectNumber=-1};$p.prototype.restore=function(){Ft=this.page,G=this.currentPage,ct=this.pagesContext,_e=this.pages,lt=this.x,Hn=this.y,Yt=this.matrix,pw(G,this.width),Vl(G,this.height),ye=this.outputDestination};var ev=function(N,F,ie,ce,ve){sr.push(new $p),Ft=G=0,_e=[],lt=N,Hn=F,Yt=ve,V0([ie,ce])};for(var dh in h.beginFormObject=function(N,F,ie,ce,ve){return ev(N,F,ie,ce,ve),this},h.endFormObject=function(N){return function(F){if(nn[F])sr.pop().restore(
vendor: 4,570 bytes, line 557
557);else{var ie=new $p,ce="Xo"+(Object.keys(Tt).length+1).toString(10);ie.id=ce,nn[F]=ce,Tt[ce]=ie,ln.publish("addFormObject",ie),sr.pop().restore()}}(N),this},h.doFormObject=function(N,F){var ie=Tt[nn[N]];return Y("q"),Y(F.toString()+" cm"),Y("/"+ie.id+" Do"),Y("Q"),this},h.getFormObject=function(N){var F=Tt[nn[N]];return{x:F.x,y:F.y,width:F.width,height:F.height,matrix:F.matrix}},h.save=function(N,F){return N=N||"generated.pdf",(F=F||{}).returnPromise=F.returnPromise||!1,F.returnPromise===!1?(Mh(Dp(Wo()),N),typeof Mh.unload=="function"&&At.setTimeout&&setTimeout(Mh.unload,911),this):new Promise(function(ie,ce){try{var ve=Mh(Dp(Wo()),N);typeof Mh.unload=="function"&&At.setTimeout&&setTimeout(Mh.unload,911),ie(ve)}catch(Ne){ce(Ne.message)}})},mt.API)mt.API.hasOwnProperty(dh)&&(dh==="events"&&mt.API.events.length?function(N,F){var ie,ce,ve;for(ve=F.length-1;ve!==-1;ve--)ie=F[ve][0],ce=F[ve][1],N.subscribe.apply(N,[ie].concat(typeof ce=="function"?[ce]:ce))}(ln,mt.API.events):h[dh]=mt.API[dh]);function tv(N){return ct[N].mediaBox.topRightX-ct[N].mediaBox.bottomLeftX}function pw(N,F){ct[N].mediaBox.topRightX=F+ct[N].mediaBox.bottomLeftX}function mw(N){return ct[N].mediaBox.topRightY-ct[N].mediaBox.bottomLeftY}function Vl(N,F){ct[N].mediaBox.topRightY=F+ct[N].mediaBox.bottomLeftY}var Gl=h.getPageWidth=function(N){return tv(N=N||G)/wt},gw=h.setPageWidth=function(N,F){pw(N,F*wt)},hh=h.getPageHeight=function(N){return mw(N=N||G)/wt},vw=h.setPageHeight=function(N,F){Vl(N,F*wt)};return h.internal={pdfEscape:da,getStyle:uw,getFont:jS,getFontSize:De,getCharSpace:BS,getTextColor:FS,getLineHeight:LS,getLineHeightFactor:OS,getLineWidth:RS,write:Te,getHorizontalCoordinate:zl,getVerticalCoordinate:ql,getCoordinateString:MS,getVerticalCoordinateString:DS,collections:{},newObject:ar,newAdditionalObject:sh,newObjectDeferred:Yr,newObjectDeferredBegin:ui,getFilters:Wa,putStream:ua,events:ln,scaleFactor:wt,pageSize:{getWidth:function(){return Gl(G)},setWidth:function(N){gw(G,N)},getHeight:function(){return hh(G)},setHeight:function(N){vw(G,N)}},encryptionOptions:u,encryption:Ir,getEncryptor:function(N){return u!==null?Ir.encryptor(N,0):function(F){return F}},output:lw,getNumberOfPages:sw,get pages(){return _e},out:Y,f2:j,f3:$,getPageInfo:Ul,getPageInfoByObjId:cw,getCurrentPageInfo:NS,getPDFVersion:g,Point:Wl,Rectangle:Z0,Matrix:nt,hasHotfix:ha},Object.defineProperty(h.internal.pageSize,"width",{get:function(){return Gl(G)},set:function(N){gw(G,N)},enumerable:!0,configurable:!0}),Object.defineProperty(h.internal.pageSize,"height",{get:function(){return hh(G)},set:function(N){vw(G,N)},enumerable:!0,configurable:!0}),(function(N){for(var F=0,ie=He.length;F<ie;F++){var ce=nw.call(this,N[F][0],N[F][1],N[F][2],He[F][3],!0);f===!1&&(p[ce]=!0);var ve=N[F][0].split("-");tw({id:ce,fontName:ve[0],fontStyle:ve[1]||""})}ln.publish("addFonts",{fonts:Et,dictionary:Dt})}).call(h,He),Ve="F1",rw(i,t),ln.publish("initialized"),h}vm.prototype.lsbFirstWord=function(n){return String.fromCharCode(255&n,n>>8&255,n>>16&255,n>>24&255)},vm.prototype.toHexString=function(n){return n.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},vm.prototype.hexToBytes=function(n){for(var e=[],t=0;t<n.length;t+=2)e.push(String.fromCharCode(parseInt(n.substr(t,2),16)));return e.join("")},vm.prototype.processOwnerPassword=function(n,e){return KC(GC(e).substr(0,5),n)},vm.prototype.encryptor=function(n,e){var t=GC(this.encryptionKey+String.fromCharCode(255&n,n>>8&255,n>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return KC(t,r)}},$_.prototype.equals=function(n){var e,t="id,objectNumber,equals";if(!n||wn(n)!==wn(this))return!1;var r=0;for(e in this)if(!(t.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!n.hasOwnProperty(e)||this[e]!==n[e])return!1;r++}for(e in n)n.hasOwnProperty(e)&&t.indexOf(e)<0&&r--;return r===0},mt.API={events:[]},mt.version="3.0.4";var dr=mt.API,_P=1,jp=function(n){return n.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},sm=function(n){return n.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Lt=function(n){return n.toFixed(2)},Tu=function(n){return n.toFixed(5)};dr.__acroform__={};var Cs=function(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n},TI=function(n){return n*_P},Zo=function(n){var e=new A9,t=Ze.internal.getHeight(n)||0,r=Ze.internal.getWidth(n)||0;return e.BBox=[0,0,Number(Lt(r)),Number(Lt(t))],e},ghe=dr.__acroform__.setBit=function(n,e){if(n=n||0,e=e||0,isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to 
557jsPDF.API.__acroform__.setBit");return n|1<<e},vhe=dr.__acroform__.clearBit=function(n,e){if(n=n||0,e=e||0,isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return n&~(1<<e)},yhe=dr.__acroform__.getBit=function(n,e){if(isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return n&1<<e?1:0},xr=dr.__acroform__.getBitForPdf=function(n,e){if(isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return yhe(n,e-1)},_r=dr.__acroform__.setBitForPdf=function(n,e){if(isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return ghe(n,e-1)},Sr=dr.__acroform__.clearBitForPdf=function(n,e){if(isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return vhe(n,e-1)},bhe=dr.__acroform__.calculateCoordinates=function(n,e){var t=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=n[0],s=n[1],a=n[2],o=n[3],l={};return l.lowerLeft_X=t(i)||0,l.lowerLeft_Y=r(s+o)||0,l.upperRight_X=t(i+a)||0,l.upperRight_Y=r(s)||0,[Number(Lt(l.lowerLeft_X)),Number(Lt(l.lowerLeft_Y)),Number(Lt(l.upperRight_X)),Number(Lt(l.upperRight_Y))]},whe=function(n){if(n.appearanceStreamContent)return n.appearanceStreamContent;if(n.V||n.DV){var e=[],t=n._V||n.DV,r=YC(n,t),i=n.scope.internal.getFont(n.fontName,n.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(n.scope.__private__.encodeColorString(n.color)),e.push("/"+i+" "+Lt(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=Zo(n);return s.scope=n.scope,s.stream=e.join(`
558`),s}},YC=function(n,e){var t=n.fontSize===0?n.maxFontSize:n.fontSize,r={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=n.multiline?i.map(function(j){return j.split(`
559`)}):i.map(function(j){return[j]});var s=t,a=Ze.internal.getHeight(n)||0;a=a<0?-a:a;var o=Ze.internal.getWidth(n)||0;o=o<0?-o:o;var l=function(j,$,J){if(j+1<i.length){var H=$+" "+i[j+1][0];return R2(H,n,J).width<=o-4}return!1};s++;e:for(;s>0;){e="",s--;var c,u,f=R2("3",n,s).height,p=n.multiline?a-s:(a-f)/2,h=p+=2,b=0,g=0,w=0;if(s<=0){e=`(...) Tj
560`,e+="% Width of Text: "+R2(e,n,s=12).width+", FieldWidth:"+o+`
561`;break}for(var y="",x=0,S=0;S<i.length;S++)if(i.hasOwnProperty(S)){var A=!1;
vendor: 62,251 bytes, lines 561-600
561if(i[S].length!==1&&w!==i[S].length-1){if((f+2)*(x+2)+2>a)continue e;y+=i[S][w],A=!0,g=S,S--}else{y=(y+=i[S][w]+" ").substr(y.length-1)==" "?y.substr(0,y.length-1):y;var C=parseInt(S),T=l(C,y,s),R=S>=i.length-1;if(T&&!R){y+=" ",w=0;continue}if(T||R){if(R)g=C;else if(n.multiline&&(f+2)*(x+2)+2>a)continue e}else{if(!n.multiline||(f+2)*(x+2)+2>a)continue e;g=C}}for(var I="",L=b;L<=g;L++){var V=i[L];if(n.multiline){if(L===g){I+=V[w]+" ",w=(w+1)%V.length;continue}if(L===b){I+=V[V.length-1]+" ";continue}}I+=V[0]+" "}switch(I=I.substr(I.length-1)==" "?I.substr(0,I.length-1):I,u=R2(I,n,s).width,n.textAlign){case"right":c=o-u-2;break;case"center":c=(o-u)/2;break;default:c=2}e+=Lt(c)+" "+Lt(h)+` Td
562`,e+="("+jp(I)+`) Tj
563`,e+=-Lt(c)+` 0 Td
564`,h=-(s+2),u=0,b=A?g:g+1,x++,y=""}break}return r.text=e,r.fontSize=s,r},R2=function(n,e,t){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(n,{font:r,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:i}},xhe={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},_he=function(n,e){var t={type:"reference",object:n};e.internal.getPageInfo(n.page).pageContext.annotations.find(function(r){return r.type===t.type&&r.object===t.object})===void 0&&e.internal.getPageInfo(n.page).pageContext.annotations.push(t)},She=function(n,e){if(e.scope=n,n.internal!==void 0&&(n.internal.acroformPlugin===void 0||n.internal.acroformPlugin.isInitialized===!1)){if($o.FieldNum=0,n.internal.acroformPlugin=JSON.parse(JSON.stringify(xhe)),n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");_P=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new E9,n.internal.acroformPlugin.acroFormDictionaryRoot.scope=n,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(n)}),n.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];s.objId=void 0,s.hasAnnotation&&_he(s,t)}})(n)}),n.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(n)}),n.internal.events.subscribe("postPutPages",function(t){(function(r,i){var s=!r;for(var a in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(a)){var o=r[a],l=[],c=o.Rect;if(o.Rect&&(o.Rect=bhe(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=Ze.createDefaultAppearanceStream(o),wn(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(l=o.getKeyValueListForStream()),o.Rect=c,o.hasAppearanceStream&&!o.appearanceStreamContent){var u=whe(o);l.push({key:"AP",value:"<</N "+u+">>"}),i.internal.acroformPlugin.xForms.push(u)}if(o.appearanceStreamContent){var f="";for(var p in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(p)){var h=o.appearanceStreamContent[p];if(f+="/"+p+" ",f+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var a in h)if(h.hasOwnProperty(a)){var b=h[a];typeof b=="function"&&(b=b.call(i,o)),f+="/"+a+" "+b+" ",i.internal.acroformPlugin.xForms.indexOf(b)>=0||i.internal.acroformPlugin.xForms.push(b)}}else typeof(b=h)=="function"&&(b=b.call(i,o)),f+="/"+a+" "+b,i.internal.acroformPlugin.xForms.indexOf(b)>=0||i.internal.acroformPlugin.xForms.push(b);f+=">>"}l.push({key:"AP",value:`<<
565`+f+">>"})}i.internal.putStream({additionalKeyValues:l,objectId:o.objId}),i.internal.out("endobj")}s&&function(g,w){for(var y in g)if(g.hasOwnProperty(y)){var x=y,S=g[y];w.internal.newObjectDeferredBegin(S.objId,!0),wn(S)==="object"&&typeof S.putStream=="function"&&S.putStream(),delete g[x]}}(i.internal.acroformPlugin.xForms,i)})(t,n)}),n.internal.acroformPlugin.isInitialized=!0}},S9=dr.__acroform__.arrayToPdfArray=function(n,e,t){var r=function(a){return a};if(Array.isArray(n)){for(var i="[",s=0;s<n.length;s++)switch(s!==0&&(i+=" "),wn(n[s])){case"boolean":case"number":case"object":i+=n[s].toString();break;case"string":n[s].substr(0,1)!=="/"?(e!==void 0&&t&&(r=t.internal.getEncryptor(e)),i+="("+jp(r(n[s].toString()))+")"):i+=n[s].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},CE=function(n,e,t){var r=function(i){return i};return e!==void 0&&t&&(r=t.internal.getEncryptor(e)),(n=n||"").toString(),"("+jp(r(n))+")"},Tl=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(n){this._objId=n}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Tl.prototype.toString=function(){return this.objId+" 0 R"},Tl.prototype.putStream=function(){var n=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:n,objectId:this.objId}),this.scope.internal.out("endobj")},Tl.prototype.getKeyValueListForStream=function(){var n=[],e=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var t in e)if(Object.getOwnPropertyDescriptor(this,e[t]).configurable===!1){var r=e[t],i=this[r];i&&(Array.isArray(i)?n.push({key:r,value:S9(i,this.objId,this.scope)}):i instanceof Tl?(i.scope=this.scope,n.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&n.push({key:r,value:i}))}return n};var A9=function(){Tl.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 n,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){n=t.trim()},get:function(){return n||null}})};Cs(A9,Tl);var E9=function(){Tl.call(this);var n,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(n){var t=function(r){return r};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+jp(t(n))+")"}},set:function(t){n=t}})};Cs(E9,Tl);var $o=function n(){Tl.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute F supplied.');e=y}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!xr(e,3)},set:function(y){y?this.F=_r(e,3):this.F=Sr(e,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute Ff supplied.');t=y}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(y){r=y!==void 0?y:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(y){r[0]=y}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(y){r[1]=y}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(y){r[2]=y}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(y){r[3]=y}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(y){switch(y){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=y;break;default:throw new Error('Invalid value "'+y+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof U_)return;s="FieldObject"+n.FieldNum++}var y=function(x){return x};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+jp(y(s))+")"},set:function(y){s=y.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(y){s=y}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(y){a=y}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(y){o=y}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(y){l=y}});var c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return c===void 0?50/_P:c},set:function(y){c=y}});var u="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(y){u=y}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof U_||this instanceof np))return CE(f,this.objId,this.scope)},set:function(y){y=y.toString(),f=y}});var p=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof ai==0?CE(p,this.objId,this.scope):p},set:function(y){y=y.toString(),p=this instanceof ai==0?y.substr(0,1)==="("?sm(y.substr(1,y.length-2)):sm(y):y}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof ai==1?sm(p.substr(1,p.length-1)):p},set:function(y){y=y.toString(),p=this instanceof ai==1?"/"+y:y}});var h=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(h)return h},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof ai==0?CE(h,this.objId,this.scope):h},set:function(y){y=y.toString(),h=this instanceof ai==0?y.substr(0,1)==="("?sm(y.substr(1,y.length-2)):sm(y):y}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof ai==1?sm(h.substr(1,h.length-1)):h},set:function(y){y=y.toString(),h=this instanceof ai==1?"/"+y:y}}),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 b,g=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return g},set:function(y){y=!!y,g=y}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(b)return b},set:function(y){b=y}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,1)},set:function(y){y?this.Ff=_r(this.Ff,1):this.Ff=Sr(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,2)},set:function(y){y?this.Ff=_r(this.Ff,2):this.Ff=Sr(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,3)},set:function(y){y?this.Ff=_r(this.Ff,3):this.Ff=Sr(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(w!==null)return w},set:function(y){if([0,1,2].indexOf(y)===-1)throw new Error('Invalid value "'+y+'" for attribute Q supplied.');w=y}}),Object.defineProperty(this,"textAlign",{get:function(){var y;switch(w){case 0:default:y="left";break;case 1:y="center";break;case 2:y="right"}return y},configurable:!0,enumerable:!0,set:function(y){switch(y){case"right":case 2:w=2;break;case"center":case 1:w=1;break;default:w=0}}})};Cs($o,Tl);var Jm=function(){$o.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var n=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return n},set:function(t){n=t}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return S9(e,this.objId,this.scope)},set:function(t){var r,i;i=[],typeof(r=t)=="string"&&(i=function(s,a,o){o||(o=1);for(var l,c=[];l=a.exec(s);)c.push(l[o]);return c}(r,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||"").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,r){for(r=r||!1,t=(t=t||"").toString();e.indexOf(t)!==-1&&(e.splice(e.indexOf(t),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,18)},set:function(t){t?this.Ff=_r(this.Ff,18):this.Ff=Sr(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=_r(this.Ff,19):this.Ff=Sr(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,20)},set:function(t){t?(this.Ff=_r(this.Ff,20),e.sort()):this.Ff=Sr(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,22)},set:function(t){t?this.Ff=_r(this.Ff,22):this.Ff=Sr(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,23)},set:function(t){t?this.Ff=_r(this.Ff,23):this.Ff=Sr(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,27)},set:function(t){t?this.Ff=_r(this.Ff,27):this.Ff=Sr(this.Ff,27)}}),this.hasAppearanceStream=!1};Cs(Jm,$o);var Qm=function(){Jm.call(this),this.fontName="helvetica",this.combo=!1};Cs(Qm,Jm);var Zm=function(){Qm.call(this),this.combo=!0};Cs(Zm,Qm);var Ox=function(){Zm.call(this),this.edit=!0};Cs(Ox,Zm);var ai=function(){$o.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,15)},set:function(t){t?this.Ff=_r(this.Ff,15):this.Ff=Sr(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,16)},set:function(t){t?this.Ff=_r(this.Ff,16):this.Ff=Sr(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,17)},set:function(t){t?this.Ff=_r(this.Ff,17):this.Ff=Sr(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,26)},set:function(t){t?this.Ff=_r(this.Ff,26):this.Ff=Sr(this.Ff,26)}});var n,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(s){return s};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,i=[];for(r in i.push("<<"),e)i.push("/"+r+" ("+jp(t(e[r]))+")");return i.push(">>"),i.join(`
566`)}},set:function(t){wn(t)==="object"&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){typeof t=="string"&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}})};Cs(ai,$o);var Mx=function(){ai.call(this),this.pushButton=!0};Cs(Mx,ai);var eg=function(){ai.call(this),this.radio=!0,this.pushButton=!1;var n=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e!==void 0?e:[]}})};Cs(eg,ai);var U_=function(){var n,e;$o.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){n=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var t,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(o){return o};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var s,a=[];for(s in a.push("<<"),r)a.push("/"+s+" ("+jp(i(r[s]))+")");return a.push(">>"),a.join(`
567`)},set:function(i){wn(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(i){t="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Ze.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Cs(U_,$o),eg.prototype.setAppearance=function(n){if(!("createAppearanceStream"in n)||!("getCA"in n))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var t=this.Kids[e];t.appearanceStreamContent=n.createAppearanceStream(t.optionName),t.caption=n.getCA()}},eg.prototype.createOption=function(n){var e=new U_;return e.Parent=this,e.optionName=n,this.Kids.push(e),Ahe.call(this.scope,e),e};var Dx=function(){ai.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Ze.CheckBox.createAppearanceStream()};Cs(Dx,ai);var np=function(){$o.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,13)},set:function(e){e?this.Ff=_r(this.Ff,13):this.Ff=Sr(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,21)},set:function(e){e?this.Ff=_r(this.Ff,21):this.Ff=Sr(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,23)},set:function(e){e?this.Ff=_r(this.Ff,23):this.Ff=Sr(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,24)},set:function(e){e?this.Ff=_r(this.Ff,24):this.Ff=Sr(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,25)},set:function(e){e?this.Ff=_r(this.Ff,25):this.Ff=Sr(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,26)},set:function(e){e?this.Ff=_r(this.Ff,26):this.Ff=Sr(this.Ff,26)}});var n=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return n},set:function(e){Number.isInteger(e)&&(n=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Cs(np,$o);var Fx=function(){np.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!xr(this.Ff,14)},set:function(n){n?this.Ff=_r(this.Ff,14):this.Ff=Sr(this.Ff,14)}}),this.password=!0};Cs(Fx,np);var Ze={CheckBox:{createAppearanceStream:function(){return{N:{On:Ze.CheckBox.YesNormal},D:{On:Ze.CheckBox.YesPushDown,Off:Ze.CheckBox.OffPushDown}}},YesPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=[],r=n.scope.internal.getFont(n.fontName,n.fontStyle).id,i=n.scope.__private__.encodeColorString(n.color),s=YC(n,n.caption);return t.push("0.749023 g"),t.push("0 0 "+Lt(Ze.internal.getWidth(n))+" "+Lt(Ze.internal.getHeight(n))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+r+" "+Lt(s.fontSize)+" Tf "+i),t.push("BT"),t.push(s.text),t.push("ET"),t.push("Q"),t.push("EMC"),e.stream=t.join(`
568`),e},YesNormal:function(n){var e=Zo(n);e.scope=n.scope;var t=n.scope.internal.getFont(n.fontName,n.fontStyle).id,r=n.scope.__private__.encodeColorString(n.color),i=[],s=Ze.internal.getHeight(n),a=Ze.internal.getWidth(n),o=YC(n,n.caption);return i.push("1 g"),i.push("0 0 "+Lt(a)+" "+Lt(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Lt(a-1)+" "+Lt(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+t+" "+Lt(o.fontSize)+" Tf "+r),i.push(o.text),i.push("ET"),i.push("Q"),e.stream=i.join(`
569`),e},OffPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Lt(Ze.internal.getWidth(n))+" "+Lt(Ze.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(`
570`),e}},RadioButton:{Circle:{createAppearanceStream:function(n){var e={D:{Off:Ze.RadioButton.Circle.OffPushDown},N:{}};return e.N[n]=Ze.RadioButton.Circle.YesNormal,e.D[n]=Ze.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(n){var e=Zo(n);e.scope=n.scope;var t=[],r=Ze.internal.getWidth(n)<=Ze.internal.getHeight(n)?Ze.internal.getWidth(n)/4:Ze.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var i=Ze.internal.Bezier_C,s=Number((r*i).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+Tu(Ze.internal.getWidth(n)/2)+" "+Tu(Ze.internal.getHeight(n)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),t.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),t.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),t.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(`
571`),e},YesPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=[],r=Ze.internal.getWidth(n)<=Ze.internal.getHeight(n)?Ze.internal.getWidth(n)/4:Ze.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*Ze.internal.Bezier_C).toFixed(5)),a=Number((r*Ze.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+Tu(Ze.internal.getWidth(n)/2)+" "+Tu(Ze.internal.getHeight(n)/2)+" cm"),t.push(i+" 0 m"),t.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),t.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),t.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),t.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+Tu(Ze.internal.getWidth(n)/2)+" "+Tu(Ze.internal.getHeight(n)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),t.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),t.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),t.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(`
572`),e},OffPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=[],r=Ze.internal.getWidth(n)<=Ze.internal.getHeight(n)?Ze.internal.getWidth(n)/4:Ze.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*Ze.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+Tu(Ze.internal.getWidth(n)/2)+" "+Tu(Ze.internal.getHeight(n)/2)+" cm"),t.push(i+" 0 m"),t.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),t.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),t.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),t.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(`
573`),e}},Cross:{createAppearanceStream:function(n){var e={D:{Off:Ze.RadioButton.Cross.OffPushDown},N:{}};return e.N[n]=Ze.RadioButton.Cross.YesNormal,e.D[n]=Ze.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(n){var e=Zo(n);e.scope=n.scope;var t=[],r=Ze.internal.calculateCross(n);return t.push("q"),t.push("1 1 "+Lt(Ze.internal.getWidth(n)-2)+" "+Lt(Ze.internal.getHeight(n)-2)+" re"),t.push("W"),t.push("n"),t.push(Lt(r.x1.x)+" "+Lt(r.x1.y)+" m"),t.push(Lt(r.x2.x)+" "+Lt(r.x2.y)+" l"),t.push(Lt(r.x4.x)+" "+Lt(r.x4.y)+" m"),t.push(Lt(r.x3.x)+" "+Lt(r.x3.y)+" l"),t.push("s"),t.push("Q"),e.stream=t.join(`
574`),e},YesPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=Ze.internal.calculateCross(n),r=[];return r.push("0.749023 g"),r.push("0 0 "+Lt(Ze.internal.getWidth(n))+" "+Lt(Ze.internal.getHeight(n))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Lt(Ze.internal.getWidth(n)-2)+" "+Lt(Ze.internal.getHeight(n)-2)+" re"),r.push("W"),r.push("n"),r.push(Lt(t.x1.x)+" "+Lt(t.x1.y)+" m"),r.push(Lt(t.x2.x)+" "+Lt(t.x2.y)+" l"),r.push(Lt(t.x4.x)+" "+Lt(t.x4.y)+" m"),r.push(Lt(t.x3.x)+" "+Lt(t.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
575`),e},OffPushDown:function(n){var e=Zo(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Lt(Ze.internal.getWidth(n))+" "+Lt(Ze.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(`
576`),e}}},createDefaultAppearanceStream:function(n){var e=n.scope.internal.getFont(n.fontName,n.fontStyle).id,t=n.scope.__private__.encodeColorString(n.color);return"/"+e+" "+n.fontSize+" Tf "+t}};Ze.internal={Bezier_C:.551915024494,calculateCross:function(n){var e=Ze.internal.getWidth(n),t=Ze.internal.getHeight(n),r=Math.min(e,t);return{x1:{x:(e-r)/2,y:(t-r)/2+r},x2:{x:(e-r)/2+r,y:(t-r)/2},x3:{x:(e-r)/2,y:(t-r)/2},x4:{x:(e-r)/2+r,y:(t-r)/2+r}}}},Ze.internal.getWidth=function(n){var e=0;return wn(n)==="object"&&(e=TI(n.Rect[2])),e},Ze.internal.getHeight=function(n){var e=0;return wn(n)==="object"&&(e=TI(n.Rect[3])),e};var Ahe=dr.addField=function(n){if(She(this,n),!(n instanceof $o))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=n).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),n.page=n.scope.internal.getCurrentPageInfo().pageNumber,this};dr.AcroFormChoiceField=Jm,dr.AcroFormListBox=Qm,dr.AcroFormComboBox=Zm,dr.AcroFormEditBox=Ox,dr.AcroFormButton=ai,dr.AcroFormPushButton=Mx,dr.AcroFormRadioButton=eg,dr.AcroFormCheckBox=Dx,dr.AcroFormTextField=np,dr.AcroFormPasswordField=Fx,dr.AcroFormAppearance=Ze,dr.AcroForm={ChoiceField:Jm,ListBox:Qm,ComboBox:Zm,EditBox:Ox,Button:ai,PushButton:Mx,RadioButton:eg,CheckBox:Dx,TextField:np,PasswordField:Fx,Appearance:Ze},mt.AcroForm={ChoiceField:Jm,ListBox:Qm,ComboBox:Zm,EditBox:Ox,Button:ai,PushButton:Mx,RadioButton:eg,CheckBox:Dx,TextField:np,PasswordField:Fx,Appearance:Ze};function N9(n){return n.reduce(function(e,t,r){return e[t]=r,e},{})}(function(n){var e="addImage_";n.__addimage__={};var t="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=n.__addimage__.getImageFileTypeByImageData=function(j,$){var J,H,le,oe,se,O=t;if(($=$||t)==="RGBA"||j.data!==void 0&&j.data instanceof Uint8ClampedArray&&"height"in j&&"width"in j)return"RGBA";if(T(j))for(se in r)for(le=r[se],J=0;J<le.length;J+=1){for(oe=!0,H=0;H<le[J].length;H+=1)if(le[J][H]!==void 0&&le[J][H]!==j[H]){oe=!1;break}if(oe===!0){O=se;break}}else for(se in r)for(le=r[se],J=0;J<le.length;J+=1){for(oe=!0,H=0;H<le[J].length;H+=1)if(le[J][H]!==void 0&&le[J][H]!==j.charCodeAt(H)){oe=!1;break}if(oe===!0){O=se;break}}return O===t&&$!==t&&(O=$),O},s=function j($){for(var J=this.internal.write,H=this.internal.putStream,le=(0,this.internal.getFilters)();le.indexOf("FlateEncode")!==-1;)le.splice(le.indexOf("FlateEncode"),1);$.objectId=this.internal.newObject();var oe=[];if(oe.push({key:"Type",value:"/XObject"}),oe.push({key:"Subtype",value:"/Image"}),oe.push({key:"Width",value:$.width}),oe.push({key:"Height",value:$.height}),$.colorSpace===y.INDEXED?oe.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+($.palette.length/3-1)+" "+("sMask"in $&&$.sMask!==void 0?$.objectId+2:$.objectId+1)+" 0 R]"}):(oe.push({key:"ColorSpace",value:"/"+$.colorSpace}),$.colorSpace===y.DEVICE_CMYK&&oe.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),oe.push({key:"BitsPerComponent",value:$.bitsPerComponent}),"decodeParameters"in $&&$.decodeParameters!==void 0&&oe.push({key:"DecodeParms",value:"<<"+$.decodeParameters+">>"}),"transparency"in $&&Array.isArray($.transparency)&&$.transparency.length>0){for(var se="",O=0,te=$.transparency.length;O<te;O++)se+=$.transparency[O]+" "+$.transparency[O]+" ";oe.push({key:"Mask",value:"["+se+"]"})}$.sMask!==void 0&&oe.push({key:"SMask",value:$.objectId+1+" 0 R"});var he=$.filter!==void 0?["/"+$.filter]:void 0;if(H({data:$.data,additionalKeyValues:oe,alreadyAppliedFilters:he,objectId:$.objectId}),J("endobj"),"sMask"in $&&$.sMask!==void 0){var ge,D=(ge=$.sMaskBitsPerComponent)!==null&&ge!==void 0?ge:$.bitsPerComponent,G={width:$.width,height:$.height,colorSpace:"DeviceGray",bitsPerComponent:D,data:$.sMask};"filter"in $&&(G.decodeParameters="/Predictor ".concat($.predictor," /Colors 1 /BitsPerComponent ").concat(D," /Columns ").concat($.width),G.filter=$.filter),j.call(this,G)}if($.colorSpace===y.INDEXED){var ee=this.internal.newObject();H({data:I(new Uint8Array($.palette)),objectId:ee}),J("endobj")}},a=function(){var j=this.internal.collections[e+"images"];for(var $ in j)s.call(this,j[$])},o=function(){var j,$=this.internal.collections[e+"images"],J=this.internal.write;for(var H in $)J("/I"+(j=$[H]).index,j.objectId,"0","R")},l=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},c=function(){var j=this.internal.collections[e+"images"];return l.call(this),j},u=function(){return Object.keys(this.internal.collections[e+"images"]).length},f=function(j){return typeof n["process"+j.toUpperCase()]=="function"},p=function(j){return wn(j)==="object"&&j.nodeType===1},h=function(j,$){if(j.nodeName==="IMG"&&j.hasAttribute("src")){var J=""+j.getAttribute("src");if(J.indexOf("data:image/")===0)return Ix(unescape(J).split("base64,").pop());var H=n.loadFile(J,!0);if(H!==void 0)return H}if(j.nodeName==="CANVAS"){if(j.width===0||j.height===0)throw new Error("Given canvas must have data. Canvas width: "+j.width+", height: "+j.height);var le;switch($){case"PNG":le="image/png";break;case"WEBP":le="image/webp";break;default:le="image/jpeg"}return Ix(j.toDataURL(le,1).split("base64,").pop())}},b=function(j){var $=this.internal.collections[e+"images"];if($){for(var J in $)if(j===$[J].alias)return $[J]}},g=function(j,$,J){return j||$||(j=-96,$=-96),j<0&&(j=-1*J.width*72/j/this.internal.scaleFactor),$<0&&($=-1*J.height*72/$/this.internal.scaleFactor),j===0&&(j=$*J.width/J.height),$===0&&($=j*J.height/J.width),[j,$]},w=function(j,$,J,H,le,oe){var se=g.call(this,J,H,le),O=this.internal.getCoordinateString,te=this.internal.getVerticalCoordinateString,he=c.call(this);if(J=se[0],H=se[1],he[le.index]=le,oe){oe*=Math.PI/180;var ge=Math.cos(oe),D=Math.sin(oe),G=function(ae){return ae.toFixed(4)},ee=[G(ge),G(D),G(-1*D),G(ge),0,0,"cm"]}this.internal.write("q"),oe?(this.internal.write([1,"0","0",1,O(j),te($+H),"cm"].join(" ")),this.internal.write(ee.join(" ")),this.internal.write([O(J),"0","0",O(H),"0","0","cm"].join(" "))):this.internal.write([O(J),"0","0",O(H),O(j),te($+H),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+le.index+" Do"),this.internal.write("Q")},y=n.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"};n.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 x=n.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},S=n.__addimage__.sHashCode=function(j){var $,J,H=0;if(typeof j=="string")for(J=j.length,$=0;$<J;$++)H=(H<<5)-H+j.charCodeAt($),H|=0;else if(T(j))for(J=j.byteLength/2,$=0;$<J;$++)H=(H<<5)-H+j[$],H|=0;return H},A=n.__addimage__.validateStringAsBase64=function(j){(j=j||"").toString().trim();var $=!0;return j.length===0&&($=!1),j.length%4!=0&&($=!1),/^[A-Za-z0-9+/]+$/.test(j.substr(0,j.length-2))===!1&&($=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(j.substr(-2))===!1&&($=!1),$},C=n.__addimage__.extractImageFromDataUrl=function(j){if(j==null||!(j=j.trim()).startsWith("data:"))return null;var $=j.indexOf(",");return $<0?null:j.substring(0,$).trim().endsWith("base64")?j.substring($+1):null};n.__addimage__.isArrayBuffer=function(j){return j instanceof ArrayBuffer};var T=n.__addimage__.isArrayBufferView=function(j){return j instanceof Int8Array||j instanceof Uint8Array||j instanceof Uint8ClampedArray||j instanceof Int16Array||j instanceof Uint16Array||j instanceof Int32Array||j instanceof Uint32Array||j instanceof Float32Array||j instanceof Float64Array},R=n.__addimage__.binaryStringToUint8Array=function(j){for(var $=j.length,J=new Uint8Array($),H=0;H<$;H++)J[H]=j.charCodeAt(H);return J},I=n.__addimage__.arrayBufferToBinaryString=function(j){for(var $="",J=T(j)?j:new Uint8Array(j),H=0;H<J.length;H+=8192)$+=String.fromCharCode.apply(null,J.subarray(H,H+8192));return $};n.addImage=function(){var j,$,J,H,le,oe,se,O,te;if(typeof arguments[1]=="number"?($=t,J=arguments[1],H=arguments[2],le=arguments[3],oe=arguments[4],se=arguments[5],O=arguments[6],te=arguments[7]):($=arguments[1],J=arguments[2],H=arguments[3],le=arguments[4],oe=arguments[5],se=arguments[6],O=arguments[7],te=arguments[8]),wn(j=arguments[0])==="object"&&!p(j)&&"imageData"in j){var he=j;j=he.imageData,$=he.format||$||t,J=he.x||J||0,H=he.y||H||0,le=he.w||he.width||le,oe=he.h||he.height||oe,se=he.alias||se,O=he.compression||O,te=he.rotation||he.angle||te}var ge=this.internal.getFilters();if(O===void 0&&ge.indexOf("FlateEncode")!==-1&&(O="SLOW"),isNaN(J)||isNaN(H))throw new Error("Invalid coordinates passed to jsPDF.addImage");l.call(this);var D=L.call(this,j,$,se,O);return w.call(this,J,H,le,oe,D,te),this};var L=function(j,$,J,H){var le,oe,se;if(typeof j=="string"&&i(j)===t){j=unescape(j);var O=V(j,!1);(O!==""||(O=n.loadFile(j,!0))!==void 0)&&(j=O)}if(p(j)&&(j=h(j,$)),$=i(j,$),!f($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(((se=J)==null||se.length===0)&&(J=function(te){return typeof te=="string"||T(te)?S(te):T(te.data)?S(te.data):null}(j)),(le=b.call(this,J))||(j instanceof Uint8Array||$==="RGBA"||(oe=j,j=R(j)),le=this["process"+$.toUpperCase()](j,u.call(this),J,function(te){return te&&typeof te=="string"&&(te=te.toUpperCase()),te in n.image_compression?te:x.NONE}(H),oe)),!le)throw new Error("An unknown error occurred whilst processing the image.");return le},V=n.__addimage__.convertBase64ToBinaryString=function(j,$){$=typeof $!="boolean"||$;var J,H="";if(typeof j=="string"){var le;J=(le=C(j))!==null&&le!==void 0?le:j;try{H=Ix(J)}catch(oe){if($)throw A(J)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+oe.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return H};n.getImageProperties=function(j){var $,J,H="";if(p(j)&&(j=h(j)),typeof j=="string"&&i(j)===t&&((H=V(j,!1))===""&&(H=n.loadFile(j)||""),j=H),J=i(j),!f(J))throw new Error("addImage does not support files of type '"+J+"', please ensure that a plugin for '"+J+"' support is added.");if(j instanceof Uint8Array||(j=R(j)),!($=this["process"+J.toUpperCase()](j)))throw new Error("An unknown error occurred whilst processing the image");return $.fileType=J,$}})(mt.API),function(n){var e=function(t){if(t!==void 0&&t!="")return!0};mt.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),n.events.push(["putPage",function(t){for(var r,i,s,a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,l=this.internal.getPageInfoByObjId(t.objId),c=t.pageContext.annotations,u=!1,f=0;f<c.length&&!u;f++)switch((r=c[f]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(u!=0){this.internal.write("/Annots [");for(var p=0;p<c.length;p++){r=c[p];var h=this.internal.pdfEscape,b=this.internal.getEncryptor(t.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var g=this.internal.newAdditionalObject(),w=this.internal.newAdditionalObject(),y=this.internal.getEncryptor(g.objId),x=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y)+"] ")+"/Contents ("+h(y(r.contents))+")",s+=" /Popup "+w.objId+" 0 R",s+=" /P "+l.objId+" 0 R",s+=" /T ("+h(y(x))+") >>",g.content=s;var S=g.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(r.bounds.x+30)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w+30)+" "+o(r.bounds.y)+"] ")+" /Parent "+S,r.open&&(s+=" /Open true"),s+=" >>",w.content=s,this.internal.write(g.objId,"0 R",w.objId,"0 R");break;case"freetext":i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y+r.bounds.h)+"] ";var A=r.color||"#000000";s="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+h(b(r.contents))+")",s+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+A+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var C=this.annotations._nameMap[r.options.name];r.options.pageNumber=C.page,r.options.top=C.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+h(b(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var T=o(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+T+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),n.createAnnotation=function(t){var r=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":r.pageContext.annotations.push(t)}},n.link=function(t,r,i,s,a){var o=this.internal.getCurrentPageInfo(),l=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:l(t),y:c(r),w:l(t+i),h:c(r+s)},options:a,type:"link"})},n.textWithLink=function(t,r,i,s){var a,o,l=this.getTextWidth(t),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){o=s.maxWidth;var u=this.splitTextToSize(t,o).length;a=Math.ceil(c*u)}else o=l,a=c;return this.text(t,r,i,s),i+=.2*c,s.align==="center"&&(r-=l/2),s.align==="right"&&(r-=l),this.link(r,i-c,o,a,s),l},n.getTextWidth=function(t){var r=this.internal.getFontSize();return this.getStringUnitWidth(t)*r/this.internal.scaleFactor}}(mt.API),function(n){var e={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]},t={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];n.__arabicParser__={};var s=n.__arabicParser__.isInArabicSubstitutionA=function(g){return e[g.charCodeAt(0)]!==void 0},a=n.__arabicParser__.isArabicLetter=function(g){return typeof g=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(g)},o=n.__arabicParser__.isArabicEndLetter=function(g){return a(g)&&s(g)&&e[g.charCodeAt(0)].length<=2},l=n.__arabicParser__.isArabicAlfLetter=function(g){return a(g)&&i.indexOf(g.charCodeAt(0))>=0};n.__arabicParser__.arabicLetterHasIsolatedForm=function(g){return a(g)&&s(g)&&e[g.charCodeAt(0)].length>=1};var c=n.__arabicParser__.arabicLetterHasFinalForm=function(g){return a(g)&&s(g)&&e[g.charCodeAt(0)].length>=2};n.__arabicParser__.arabicLetterHasInitialForm=function(g){return a(g)&&s(g)&&e[g.charCodeAt(0)].length>=3};var u=n.__arabicParser__.arabicLetterHasMedialForm=function(g){return a(g)&&s(g)&&e[g.charCodeAt(0)].length==4},f=n.__arabicParser__.resolveLigatures=function(g){var w=0,y=t,x="",S=0;for(w=0;w<g.length;w+=1)y[g.charCodeAt(w)]!==void 0?(S++,typeof(y=y[g.charCodeAt(w)])=="number"&&(x+=String.fromCharCode(y),y=t,S=0),w===g.length-1&&(y=t,x+=g.charAt(w-(S-1)),w-=S-1,S=0)):(y=t,x+=g.charAt(w-S),w-=S,S=0);return x};n.__arabicParser__.isArabicDiacritic=function(g){return g!==void 0&&r[g.charCodeAt(0)]!==void 0};var p=n.__arabicParser__.getCorrectForm=function(g,w,y){return a(g)?s(g)===!1?-1:!c(g)||!a(w)&&!a(y)||!a(y)&&o(w)||o(g)&&!a(w)||o(g)&&l(w)||o(g)&&o(w)?0:u(g)&&a(w)&&!o(w)&&a(y)&&c(y)?3:o(g)||!a(y)?1:2:-1},h=function(g){var w=0,y=0,x=0,S="",A="",C="",T=(g=g||"").split("\\s+"),R=[];for(w=0;w<T.length;w+=1){for(R.push(""),y=0;y<T[w].length;y+=1)S=T[w][y],A=T[w][y-1],C=T[w][y+1],a(S)?(x=p(S,A,C),R[w]+=x!==-1?String.fromCharCode(e[S.charCodeAt(0)][x]):S):R[w]+=S;R[w]=f(R[w])}return R.join(" ")},b=n.__arabicParser__.processArabic=n.processArabic=function(){var g,w=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,y=[];if(Array.isArray(w)){var x=0;for(y=[],x=0;x<w.length;x+=1)Array.isArray(w[x])?y.push([h(w[x][0]),w[x][1],w[x][2]]):y.push([h(w[x])]);g=y}else g=h(w);return typeof arguments[0]=="string"?g:(arguments[0].text=g,arguments[0])};n.events.push(["preProcessText",b])}(mt.API),mt.API.autoPrint=function(n){var e;return(n=n||{}).variant=n.variant||"non-conform",n.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},function(n){var e=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(o){t=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(o){i=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(o){s=o}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(o){a=o}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(t,r){var i;if((t=t||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},n.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(mt.API),function(n){var e={left:0,top:0,bottom:0,right:0},t=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(g){l=g}});var c=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return c},set:function(g){c=g}});var u=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return u},set:function(g){u=g}});var f=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return f},set:function(g){f=g}});var p=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return p},set:function(g){p=g}});var h=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return h},set:function(g){h=g}});var b=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return b},set:function(g){b=g}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},n.setHeaderFunction=function(l){return r.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},n.getTextDimensions=function(l,c){r.call(this);var u=(c=c||{}).fontSize||this.getFontSize(),f=c.font||this.getFont(),p=c.scaleFactor||this.internal.scaleFactor,h=0,b=0,g=0,w=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var y=c.maxWidth;y>0?typeof l=="string"?l=this.splitTextToSize(l,y):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(S,A){return S.concat(w.splitTextToSize(A,y))},[])):l=Array.isArray(l)?l:[l];for(var x=0;x<l.length;x++)h<(g=this.getStringUnitWidth(l[x],{font:f})*u)&&(h=g);return h!==0&&(b=l.length),{w:h/=p,h:Math.max((b*u*this.getLineHeightFactor()-u*(this.getLineHeightFactor()-1))/p,0)}},n.cellAddPage=function(){r.call(this),this.addPage();var l=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new s(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=n.cell=function(){var l;l=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var c=this.internal.__cell__.lastCell,u=this.internal.__cell__.padding,f=this.internal.__cell__.margins||e,p=this.internal.__cell__.tableHeaderRow,h=this.internal.__cell__.printHeaders;return c.lineNumber!==void 0&&(c.lineNumber===l.lineNumber?(l.x=(c.x||0)+(c.width||0),l.y=c.y||0):c.y+c.height+l.height+f.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=f.top,h&&p&&(this.printHeaderRow(l.lineNumber,!0),l.y+=p[0].height)):l.y=c.y+c.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,t===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-u,l.y+u,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+u,{align:"center",baseline:"top",maxWidth:l.width-u-u}):this.text(l.text,l.x+u,l.y+u,{align:"left",baseline:"top",maxWidth:l.width-u-u})),this.internal.__cell__.lastCell=l,this};n.table=function(l,c,u,f,p){if(r.call(this),!u)throw new Error("No data for PDF table.");var h,b,g,w,y=[],x=[],S=[],A={},C={},T=[],R=[],I=(p=p||{}).autoSize||!1,L=p.printHeaders!==!1,V=p.css&&p.css["font-size"]!==void 0?16*p.css["font-size"]:p.fontSize||12,j=p.margins||Object.assign({width:this.getPageWidth()},e),$=typeof p.padding=="number"?p.padding:3,J=p.headerBackgroundColor||"#c8c8c8",H=p.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=L,this.internal.__cell__.margins=j,this.internal.__cell__.table_font_size=V,this.internal.__cell__.padding=$,this.internal.__cell__.headerBackgroundColor=J,this.internal.__cell__.headerTextColor=H,this.setFontSize(V),f==null)x=y=Object.keys(u[0]),S=y.map(function(){return"left"});else if(Array.isArray(f)&&wn(f[0])==="object")for(y=f.map(function(he){return he.name}),x=f.map(function(he){return he.prompt||he.name||""}),S=f.map(function(he){return he.align||"left"}),h=0;h<f.length;h+=1)C[f[h].name]=.7499990551181103*f[h].width;else Array.isArray(f)&&typeof f[0]=="string"&&(x=y=f,S=y.map(function(){return"left"}));if(I||Array.isArray(f)&&typeof f[0]=="string")for(h=0;h<y.length;h+=1){for(A[w=y[h]]=u.map(function(he){return he[w]}),this.setFont(void 0,"bold"),T.push(this.getTextDimensions(x[h],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),b=A[w],this.setFont(void 0,"normal"),g=0;g<b.length;g+=1)T.push(this.getTextDimensions(b[g],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);C[w]=Math.max.apply(null,T)+$+$,T=[]}if(L){var le={};for(h=0;h<y.length;h+=1)le[y[h]]={},le[y[h]].text=x[h],le[y[h]].align=S[h];var oe=o.call(this,le,C);R=y.map(function(he){return new s(l,c,C[he],oe,le[he].text,void 0,le[he].align)}),this.setTableHeaderRow(R),this.printHeaderRow(1,!1)}var se=f.reduce(function(he,ge){return he[ge.name]=ge.align,he},{});for(h=0;h<u.length;h+=1){"rowStart"in p&&p.rowStart instanceof Function&&p.rowStart({row:h,data:u[h]},this);var O=o.call(this,u[h],C);for(g=0;g<y.length;g+=1){var te=u[h][y[g]];"cellStart"in p&&p.cellStart instanceof Function&&p.cellStart({row:h,col:g,data:te},this),a.call(this,new s(l,c,C[y[g]],O,te,h+2,se[y[g]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=c,this};var o=function(l,c){var u=this.internal.__cell__.padding,f=this.internal.__cell__.table_font_size,p=this.internal.scaleFactor;return Object.keys(l).map(function(h){var b=l[h];return this.splitTextToSize(b.hasOwnProperty("text")?b.text:b,c[h]-u-u)},this).map(function(h){return this.getLineHeightFactor()*h.length*f/p+u+u},this).reduce(function(h,b){return Math.max(h,b)},0)};n.setTableHeaderRow=function(l){r.call(this),this.internal.__cell__.tableHeaderRow=l},n.printHeaderRow=function(l,c){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var u;if(t=!0,typeof this.internal.__cell__.headerFunction=="function"){var f=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(f[0],f[1],f[2],f[3],void 0,-1)}this.setFont(void 0,"bold");for(var p=[],h=0;h<this.internal.__cell__.tableHeaderRow.length;h+=1){u=this.internal.__cell__.tableHeaderRow[h].clone(),c&&(u.y=this.internal.__cell__.margins.top||0,p.push(u)),u.lineNumber=l;var b=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,u),this.setTextColor(b)}p.length>0&&this.setTableHeaderRow(p),this.setFont(void 0,"normal"),t=!1}}(mt.API);var k9={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},C9=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],XC=N9(C9),T9=[100,200,300,400,500,600,700,800,900],Ehe=N9(T9);function TE(n){var e=n.family.replace(/"|'/g,"").toLowerCase(),t=function(s){return k9[s=s||"normal"]?s:"normal"}(n.style),r=function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400}(n.weight),i=function(s){return typeof XC[s=s||"normal"]=="number"?s:"normal"}(n.stretch);return{family:e,style:t,weight:r,stretch:i,src:n.src||[],ref:n.ref||{name:e,style:[i,t,r].join(" ")}}}function PI(n,e,t,r){var i;for(i=t;i>=0&&i<e.length;i+=r)if(n[e[i]])return n[e[i]];for(i=t;i>=0&&i<e.length;i-=r)if(n[e[i]])return n[e[i]]}var Nhe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},jI={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function RI(n){return[n.stretch,n.style,n.weight,n.family].join(" ")}function LI(n){return n.trimLeft()}function khe(n,e){for(var t=0;t<n.length;){if(n.charAt(t)===e)return[n.substring(0,t),n.substring(t+1)];t+=1}return null}function Che(n){var e=n.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],n.substring(e[0].length)]}var L2,II,OI,am,I2,MI,DI,FI,PE=["times"];function BI(n,e,t,r,i){var s=4,a=UI;switch(i){case mt.API.image_compression.FAST:s=1,a=$I;break;case mt.API.image_compression.MEDIUM:s=6,a=zI;break;case mt.API.image_compression.SLOW:s=9,a=qI}n=function(l,c,u,f){for(var p,h=l.length/c,b=new Uint8Array(l.length+h),g=[The,$I,UI,zI,qI],w=0;w<h;w+=1){var y=w*c,x=l.subarray(y,y+c);if(f)b.set(f(x,u,p),y+w);else{for(var S=g.length,A=[],C=0;C<S;C+=1)A[C]=g[C](x,u,p);var T=jhe(A.concat());b.set(A[T],y+w)}p=x}return b}(n,e,Math.ceil(t*r/8),a);var o=DC(n,{level:s});return mt.API.__addimage__.arrayBufferToBinaryString(o)}function The(n){var e=Array.apply([],n);return e.unshift(0),e}function $I(n,e){var t=n.length,r=[];r[0]=1;for(var i=0;i<t;i+=1){var s=n[i-e]||0;r[i+1]=n[i]-s+256&255}return r}function UI(n,e,t){var r=n.length,i=[];i[0]=2;for(var s=0;s<r;s+=1){var a=t&&t[s]||0;i[s+1]=n[s]-a+256&255}return i}function zI(n,e,t){var r=n.length,i=[];i[0]=3;for(var s=0;s<r;s+=1){var a=n[s-e]||0,o=t&&t[s]||0;i[s+1]=n[s]+256-(a+o>>>1)&255}return i}function qI(n,e,t){var r=n.length,i=[];i[0]=4;for(var s=0;s<r;s+=1){var a=Phe(n[s-e]||0,t&&t[s]||0,t&&t[s-e]||0);i[s+1]=n[s]-a+256&255}return i}function Phe(n,e,t){if(n===e&&e===t)return n;var r=Math.abs(e-t),i=Math.abs(n-t),s=Math.abs(n+e-t-t);return r<=i&&r<=s?n:i<=s?e:t}function jhe(n){var e=n.map(function(t){return t.reduce(function(r,i){return r+Math.abs(i)},0)});return e.indexOf(Math.min.apply(null,e))}function jE(n,e,t){var r=e*t,i=Math.floor(r/8),s=16-(r-8*i+t),a=(1<<t)-1;return P9(n,i)>>s&a}function HI(n,e,t,r){var i=t*r,s=Math.floor(i/8),a=16-(i-8*s+r),o=(1<<r)-1,l=(e&o)<<a;(function(c,u,f){if(u+1<c.byteLength)c.setUint16(u,f,!1);else{var p=f>>8&255;c.setUint8(u,p)}})(n,s,P9(n,s)&~(o<<a)&65535|l)}function P9(n,e){return e+1<n.byteLength?n.getUint16(e,!1):n.getUint8(e)<<8}function Rhe(n){var e=0;if(n[e++]!==71||n[e++]!==73||n[e++]!==70||n[e++]!==56||(n[e++]+1&253)!=56||n[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var t=n[e++]|n[e++]<<8,r=n[e++]|n[e++]<<8,i=n[e++],s=i>>7,a=1<<1+(7&i);n[e++],n[e++];var o=null,l=null;s&&(o=e,l=a,e+=3*a);var c=!0,u=[],f=0,p=null,h=0,b=null;for(this.width=t,this.height=r;c&&e<n.length;)switch(n[e++]){case 33:switch(n[e++]){case 255:if(n[e]!==11||n[e+1]==78&&n[e+2]==69&&n[e+3]==84&&n[e+4]==83&&n[e+5]==67&&n[e+6]==65&&n[e+7]==80&&n[e+8]==69&&n[e+9]==50&&n[e+10]==46&&n[e+11]==48&&n[e+12]==3&&n[e+13]==1&&n[e+16]==0)e+=14,b=n[e++]|n[e++]<<8,e++;else for(e+=12;;){if(!((j=n[e++])>=0))throw Error("Invalid block size");if(j===0)break;e+=j}break;case 249:if(n[e++]!==4||n[e+4]!==0)throw new Error("Invalid graphics extension block.");var g=n[e++];f=n[e++]|n[e++]<<8,p=n[e++],1&g||(p=null),h=g>>2&7,e++;break;case 254:for(;;){if(!((j=n[e++])>=0))throw Error("Invalid block size");if(j===0)break;e+=j}break;default:throw new Error("Unknown graphic control label: 0x"+n[e-1].toString(16))}break;case 44:var w=n[e++]|n[e++]<<8,y=n[e++]|n[e++]<<8,x=n[e++]|n[e++]<<8,S=n[e++]|n[e++]<<8,A=n[e++],C=A>>6&1,T=1<<1+(7&A),R=o,I=l,L=!1;A>>7&&(L=!0,R=e,I=T,e+=3*T);var V=e;for(e++;;){var j;if(!((j=n[e++])>=0))throw Error("Invalid block size");if(j===0)break;e+=j}u.push({x:w,y,width:x,height:S,has_local_palette:L,palette_offset:R,palette_size:I,data_offset:V,data_length:e-V,transparent_index:p,interlaced:!!C,delay:f,disposal:h});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+n[e-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return b},this.frameInfo=function($){if($<0||$>=u.length)throw new Error("Frame index out of range.");return u[$]},this.decodeAndBlitFrameBGRA=function($,J){var H=this.frameInfo($),le=H.width*H.height,oe=new Uint8Array(le);WI(n,H.data_offset,oe,le);var se=H.palette_offset,O=H.transparent_index;O===null&&(O=256);var te=H.width,he=t-te,ge=te,D=4*(H.y*t+H.x),G=4*((H.y+H.height)*t+H.x),ee=D,ae=4*he;H.interlaced===!0&&(ae+=4*t*7);for(var X=8,Q=0,ue=oe.length;Q<ue;++Q){var pe=oe[Q];if(ge===0&&(ge=te,(ee+=ae)>=G&&(ae=4*he+4*t*(X-1),ee=D+(te+he)*(X<<1),X>>=1)),pe===O)ee+=4;else{var me=n[se+3*pe],_e=n[se+3*pe+1],Ee=n[se+3*pe+2];J[ee++]=Ee,J[ee++]=_e,J[ee++]=me,J[ee++]=255}--ge}},this.decodeAndBlitFrameRGBA=function($,J){var H=this.frameInfo($),le=H.width*H.height,oe=new Uint8Array(le);WI(n,H.data_offset,oe,le);var se=H.palette_offset,O=H.transparent_index;O===null&&(O=256);var te=H.width,he=t-te,ge=te,D=4*(H.y*t+H.x),G=4*((H.y+H.height)*t+H.x),ee=D,ae=4*he;H.interlaced===!0&&(ae+=4*t*7);for(var X=8,Q=0,ue=oe.length;Q<ue;++Q){var pe=oe[Q];if(ge===0&&(ge=te,(ee+=ae)>=G&&(ae=4*he+4*t*(X-1),ee=D+(te+he)*(X<<1),X>>=1)),pe===O)ee+=4;else{var me=n[se+3*pe],_e=n[se+3*pe+1],Ee=n[se+3*pe+2];J[ee++]=me,J[ee++]=_e,J[ee++]=Ee,J[ee++]=255}--ge}}}function WI(n,e,t,r){for(var i=n[e++],s=1<<i,a=s+1,o=a+1,l=i+1,c=(1<<l)-1,u=0,f=0,p=0,h=n[e++],b=new Int32Array(4096),g=null;;){for(;u<16&&h!==0;)f|=n[e++]<<u,u+=8,h===1?h=n[e++]:--h;if(u<l)break;var w=f&c;if(f>>=l,u-=l,w!==s){if(w===a)break;for(var y=w<o?w:g,x=0,S=y;S>s;)S=b[S]>>8,++x;var A=S;if(p+x+(y!==w?1:0)>r)return void kn.log("Warning, gif stream longer than expected.");t[p++]=A;var C=p+=x;for(y!==w&&(t[p++]=A),S=y;x--;)S=b[S],t[--C]=255&S,S>>=8;g!==null&&o<4096&&(b[o++]=g<<8|A,o>=c+1&&l<12&&(++l,c=c<<1|1)),g=w}else o=a+1,c=(1<<(l=i+1))-1,g=null}return p!==r&&kn.log("Warning, gif stream shorter than expected."),t}/**
577 * @license
578  Copyright (c) 2008, Adobe Systems Incorporated
579  All rights reserved.
580
581  Redistribution and use in source and binary forms, with or without 
582  modification, are permitted provided that the following conditions are
583  met:
584
585  * Redistributions of source code must retain the above copyright notice, 
586    this list of conditions and the following disclaimer.
587  
588  * Redistributions in binary form must reproduce the above copyright
589    notice, this list of conditions and the following disclaimer in the 
590    documentation and/or other materials provided with the distribution.
591  
592  * Neither the name of Adobe Systems Incorporated nor the names of its 
593    contributors may be used to endorse or promote products derived from 
594    this software without specific prior written permission.
595
596  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
597  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
598  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
599  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
600  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,854 bytes, lines 601-607
601  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
602  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
603  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
604  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
605  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
606  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
607*/function RE(n){var e,t,r,i,s,a=Math.floor,o=new Array(64),l=new Array(64),c=new Array(64),u=new Array(64),f=new Array(65535),p=new Array(65535),h=new Array(64),b=new Array(64),g=[],w=0,y=7,x=new Array(64),S=new Array(64),A=new Array(64),C=new Array(256),T=new Array(2048),R=[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],I=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],j=[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],$=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],J=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],le=[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 oe(D,G){for(var ee=0,ae=0,X=new Array,Q=1;Q<=16;Q++){for(var ue=1;ue<=D[Q];ue++)X[G[ae]]=[],X[G[ae]][0]=ee,X[G[ae]][1]=Q,ae++,ee++;ee*=2}return X}function se(D){for(var G=D[0],ee=D[1]-1;ee>=0;)G&1<<ee&&(w|=1<<y),ee--,--y<0&&(w==255?(O(255),O(0)):O(w),y=7,w=0)}function O(D){g.push(D)}function te(D){O(D>>8&255),O(255&D)}function he(D,G,ee,ae,X){for(var Q,ue=X[0],pe=X[240],me=function(Ce,Je){var De,Qe,ze,Vt,Ct,dt,St,Ot,Ve,wt,lt=0;for(Ve=0;Ve<8;++Ve){De=Ce[lt],Qe=Ce[lt+1],ze=Ce[lt+2],Vt=Ce[lt+3],Ct=Ce[lt+4],dt=Ce[lt+5],St=Ce[lt+6];var Hn=De+(Ot=Ce[lt+7]),Yt=De-Ot,Et=Qe+St,Dt=Qe-St,cn=ze+dt,gt=ze-dt,_n=Vt+Ct,bt=Vt-Ct,Nt=Hn+_n,Tn=Hn-_n,Ft=Et+cn,ct=Et-cn;Ce[lt]=Nt+Ft,Ce[lt+4]=Nt-Ft;var ln=.707106781*(ct+Tn);Ce[lt+2]=Tn+ln,Ce[lt+6]=Tn-ln;var xt=.382683433*((Nt=bt+gt)-(ct=Dt+Yt)),Tt=.5411961*Nt+xt,nn=1.306562965*ct+xt,sr=.707106781*(Ft=gt+Dt),nt=Yt+sr,Kr=Yt-sr;Ce[lt+5]=Kr+Tt,Ce[lt+3]=Kr-Tt,Ce[lt+1]=nt+nn,Ce[lt+7]=nt-nn,lt+=8}for(lt=0,Ve=0;Ve<8;++Ve){De=Ce[lt],Qe=Ce[lt+8],ze=Ce[lt+16],Vt=Ce[lt+24],Ct=Ce[lt+32],dt=Ce[lt+40],St=Ce[lt+48];var ci=De+(Ot=Ce[lt+56]),Wn=De-Ot,pr=Qe+St,ar=Qe-St,Yr=ze+dt,ui=ze-dt,sh=Vt+Ct,lu=Vt-Ct,qa=ci+sh,zo=ci-sh,Ha=pr+Yr,Wa=pr-Yr;Ce[lt]=qa+Ha,Ce[lt+32]=qa-Ha;var ua=.707106781*(Wa+zo);Ce[lt+16]=zo+ua,Ce[lt+48]=zo-ua;var ah=.382683433*((qa=lu+ui)-(Wa=ar+Wn)),qo=.5411961*qa+ah,oh=1.306562965*Wa+ah,Lp=.707106781*(Ha=ui+ar),Ip=Wn+Lp,Op=Wn-Lp;Ce[lt+40]=Op+qo,Ce[lt+24]=Op-qo,Ce[lt+8]=Ip+oh,Ce[lt+56]=Ip-oh,lt++}for(Ve=0;Ve<64;++Ve)wt=Ce[Ve]*Je[Ve],h[Ve]=wt>0?wt+.5|0:wt-.5|0;return h}(D,G),_e=0;_e<64;++_e)b[R[_e]]=me[_e];var Ee=b[0]-ee;ee=b[0],Ee==0?se(ae[0]):(se(ae[p[Q=32767+Ee]]),se(f[Q]));for(var ye=63;ye>0&&b[ye]==0;)ye--;if(ye==0)return se(ue),ee;for(var Re,Y=1;Y<=ye;){for(var Te=Y;b[Y]==0&&Y<=ye;)++Y;var it=Y-Te;if(it>=16){Re=it>>4;for(var He=1;He<=Re;++He)se(pe);it&=15}Q=32767+b[Y],se(X[(it<<4)+p[Q]]),se(f[Q]),Y++}return ye!=63&&se(ue),ee}function ge(D){D=Math.min(Math.max(D,1),100),s!=D&&(function(G){for(var ee=[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],ae=0;ae<64;ae++){var X=a((ee[ae]*G+50)/100);X=Math.min(Math.max(X,1),255),o[R[ae]]=X}for(var Q=[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],ue=0;ue<64;ue++){var pe=a((Q[ue]*G+50)/100);pe=Math.min(Math.max(pe,1),255),l[R[ue]]=pe}for(var me=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],_e=0,Ee=0;Ee<8;Ee++)for(var ye=0;ye<8;ye++)c[_e]=1/(o[R[_e]]*me[Ee]*me[ye]*8),u[_e]=1/(l[R[_e]]*me[Ee]*me[ye]*8),_e++}(D<50?Math.floor(5e3/D):Math.floor(200-2*D)),s=D)}this.encode=function(D,G){G&&ge(G),g=new Array,w=0,y=7,te(65496),te(65504),te(16),O(74),O(70),O(73),O(70),O(0),O(1),O(1),O(0),te(1),te(1),O(0),O(0),function(){te(65499),te(132),O(0);for(var Qe=0;Qe<64;Qe++)O(o[Qe]);O(1);for(var ze=0;ze<64;ze++)O(l[ze])}(),function(Qe,ze){te(65472),te(17),O(8),te(ze),te(Qe),O(3),O(1),O(17),O(0),O(2),O(17),O(1),O(3),O(17),O(1)}(D.width,D.height),function(){te(65476),te(418),O(0);for(var Qe=0;Qe<16;Qe++)O(I[Qe+1]);for(var ze=0;ze<=11;ze++)O(L[ze]);O(16);for(var Vt=0;Vt<16;Vt++)O(V[Vt+1]);for(var Ct=0;Ct<=161;Ct++)O(j[Ct]);O(1);for(var dt=0;dt<16;dt++)O($[dt+1]);for(var St=0;St<=11;St++)O(J[St]);O(17);for(var Ot=0;Ot<16;Ot++)O(H[Ot+1]);for(var Ve=0;Ve<=161;Ve++)O(le[Ve])}(),te(65498),te(12),O(3),O(1),O(0),O(2),O(17),O(3),O(17),O(0),O(63),O(0);var ee=0,ae=0,X=0;
vendor: 44,906 bytes, lines 607-613
607w=0,y=7,this.encode.displayName="_encode_";for(var Q,ue,pe,me,_e,Ee,ye,Re,Y,Te=D.data,it=D.width,He=D.height,Ce=4*it,Je=0;Je<He;){for(Q=0;Q<Ce;){for(_e=Ce*Je+Q,ye=-1,Re=0,Y=0;Y<64;Y++)Ee=_e+(Re=Y>>3)*Ce+(ye=4*(7&Y)),Je+Re>=He&&(Ee-=Ce*(Je+1+Re-He)),Q+ye>=Ce&&(Ee-=Q+ye-Ce+4),ue=Te[Ee++],pe=Te[Ee++],me=Te[Ee++],x[Y]=(T[ue]+T[pe+256|0]+T[me+512|0]>>16)-128,S[Y]=(T[ue+768|0]+T[pe+1024|0]+T[me+1280|0]>>16)-128,A[Y]=(T[ue+1280|0]+T[pe+1536|0]+T[me+1792|0]>>16)-128;ee=he(x,c,ee,e,r),ae=he(S,u,ae,t,i),X=he(A,u,X,t,i),Q+=32}Je+=8}if(y>=0){var De=[];De[1]=y+1,De[0]=(1<<y+1)-1,se(De)}return te(65497),new Uint8Array(g)},n=n||50,function(){for(var D=String.fromCharCode,G=0;G<256;G++)C[G]=D(G)}(),e=oe(I,L),t=oe($,J),r=oe(V,j),i=oe(H,le),function(){for(var D=1,G=2,ee=1;ee<=15;ee++){for(var ae=D;ae<G;ae++)p[32767+ae]=ee,f[32767+ae]=[],f[32767+ae][1]=ee,f[32767+ae][0]=ae;for(var X=-(G-1);X<=-D;X++)p[32767+X]=ee,f[32767+X]=[],f[32767+X][1]=ee,f[32767+X][0]=G-1+X;D<<=1,G<<=1}}(),function(){for(var D=0;D<256;D++)T[D]=19595*D,T[D+256|0]=38470*D,T[D+512|0]=7471*D+32768,T[D+768|0]=-11059*D,T[D+1024|0]=-21709*D,T[D+1280|0]=32768*D+8421375,T[D+1536|0]=-27439*D,T[D+1792|0]=-5329*D}(),ge(n)}/**
608 * @license
609 * Copyright (c) 2017 Aras Abbasi
610 *
611 * Licensed under the MIT License.
612 * http://opensource.org/licenses/mit-license
613 */function Za(n,e){if(this.pos=0,this.buffer=n,this.datav=new DataView(n.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function VI(n){function e(L){if(!L)throw Error("assert :P")}function t(L,V,j){for(var $=0;4>$;$++)if(L[V+$]!=j.charCodeAt($))return!0;return!1}function r(L,V,j,$,J){for(var H=0;H<J;H++)L[V+H]=j[$+H]}function i(L,V,j,$){for(var J=0;J<$;J++)L[V+J]=j}function s(L){return new Int32Array(L)}function a(L,V){for(var j=[],$=0;$<L;$++)j.push(new V);return j}function o(L,V){var j=[];return function $(J,H,le){for(var oe=le[H],se=0;se<oe&&(J.push(le.length>H+1?[]:new V),!(le.length<H+1));se++)$(J[se],H+1,le)}(j,0,L),j}var l=function(){var L=this;function V(v,_){for(var k=1<<_-1>>>0;v&k;)k>>>=1;return k?(v&k-1)+k:v}function j(v,_,k,P,B){e(!(P%k));do v[_+(P-=k)]=B;while(0<P)}function $(v,_,k,P,B){if(e(2328>=B),512>=B)var z=s(512);else if((z=s(B))==null)return 0;return function(W,K,Z,ne,de,xe){var re,fe,be=K,Se=1<<Z,we=s(16),Ae=s(16);for(e(de!=0),e(ne!=null),e(W!=null),e(0<Z),fe=0;fe<de;++fe){if(15<ne[fe])return 0;++we[ne[fe]]}if(we[0]==de)return 0;for(Ae[1]=0,re=1;15>re;++re){if(we[re]>1<<re)return 0;Ae[re+1]=Ae[re]+we[re]}for(fe=0;fe<de;++fe)re=ne[fe],0<ne[fe]&&(xe[Ae[re]++]=fe);if(Ae[15]==1)return(ne=new J).g=0,ne.value=xe[0],j(W,be,1,Se,ne),Se;var ke,Le=-1,je=Se-1,ht=0,Ke=1,Ut=1,st=1<<Z;for(fe=0,re=1,de=2;re<=Z;++re,de<<=1){if(Ke+=Ut<<=1,0>(Ut-=we[re]))return 0;for(;0<we[re];--we[re])(ne=new J).g=re,ne.value=xe[fe++],j(W,be+ht,de,st,ne),ht=V(ht,re)}for(re=Z+1,de=2;15>=re;++re,de<<=1){if(Ke+=Ut<<=1,0>(Ut-=we[re]))return 0;for(;0<we[re];--we[re]){if(ne=new J,(ht&je)!=Le){for(be+=st,ke=1<<(Le=re)-Z;15>Le&&!(0>=(ke-=we[Le]));)++Le,ke<<=1;Se+=st=1<<(ke=Le-Z),W[K+(Le=ht&je)].g=ke+Z,W[K+Le].value=be-K-Le}ne.g=re-Z,ne.value=xe[fe++],j(W,be+(ht>>Z),de,st,ne),ht=V(ht,re)}}return Ke!=2*Ae[15]-1?0:Se}(v,_,k,P,B,z)}function J(){this.value=this.g=0}function H(){this.value=this.g=0}function le(){this.G=a(5,J),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(yh,H)}function oe(v,_,k,P){e(v!=null),e(_!=null),e(2147483648>P),v.Ca=254,v.I=0,v.b=-8,v.Ka=0,v.oa=_,v.pa=k,v.Jd=_,v.Yc=k+P,v.Zc=4<=P?k+P-4+1:k,ue(v)}function se(v,_){for(var k=0;0<_--;)k|=me(v,128)<<_;return k}function O(v,_){var k=se(v,_);return pe(v)?-k:k}function te(v,_,k,P){var B,z=0;for(e(v!=null),e(_!=null),e(4294967288>P),v.Sb=P,v.Ra=0,v.u=0,v.h=0,4<P&&(P=4),B=0;B<P;++B)z+=_[k+B]<<8*B;v.Ra=z,v.bb=P,v.oa=_,v.pa=k}function he(v){for(;8<=v.u&&v.bb<v.Sb;)v.Ra>>>=8,v.Ra+=v.oa[v.pa+v.bb]<<hu-8>>>0,++v.bb,v.u-=8;ae(v)&&(v.h=1,v.u=0)}function ge(v,_){if(e(0<=_),!v.h&&_<=Ps){var k=ee(v)&Ts[_];return v.u+=_,he(v),k}return v.h=1,v.u=0}function D(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function G(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function ee(v){return v.Ra>>>(v.u&hu-1)>>>0}function ae(v){return e(v.bb<=v.Sb),v.h||v.bb==v.Sb&&v.u>hu}function X(v,_){v.u=_,v.h=ae(v)}function Q(v){v.u>=Jl&&(e(v.u>=Jl),he(v))}function ue(v){e(v!=null&&v.oa!=null),v.pa<v.Zc?(v.I=(v.oa[v.pa++]|v.I<<8)>>>0,v.b+=8):(e(v!=null&&v.oa!=null),v.pa<v.Yc?(v.b+=8,v.I=v.oa[v.pa++]|v.I<<8):v.Ka?v.b=0:(v.I<<=8,v.b+=8,v.Ka=1))}function pe(v){return se(v,1)}function me(v,_){var k=v.Ca;0>v.b&&ue(v);var P=v.b,B=k*_>>>8,z=(v.I>>>P>B)+0;for(z?(k-=B,v.I-=B+1<<P>>>0):k=B+1,P=k,B=0;256<=P;)B+=8,P>>=8;return P=7^B+fu[P],v.b-=P,v.Ca=(k<<P)-1,z}function _e(v,_,k){v[_+0]=k>>24&255,v[_+1]=k>>16&255,v[_+2]=k>>8&255,v[_+3]=255&k}function Ee(v,_){return v[_+0]|v[_+1]<<8}function ye(v,_){return Ee(v,_)|v[_+2]<<16}function Re(v,_){return Ee(v,_)|Ee(v,_+2)<<16}function Y(v,_){var k=1<<_;return e(v!=null),e(0<_),v.X=s(k),v.X==null?0:(v.Mb=32-_,v.Xa=_,1)}function Te(v,_){e(v!=null),e(_!=null),e(v.Xa==_.Xa),r(_.X,0,v.X,0,1<<_.Xa)}function it(){this.X=[],this.Xa=this.Mb=0}function He(v,_,k,P){e(k!=null),e(P!=null);var B=k[0],z=P[0];return B==0&&(B=(v*z+_/2)/_),z==0&&(z=(_*B+v/2)/v),0>=B||0>=z?0:(k[0]=B,P[0]=z,1)}function Ce(v,_){return v+(1<<_)-1>>>_}function Je(v,_){return((4278255360&v)+(4278255360&_)>>>0&4278255360)+((16711935&v)+(16711935&_)>>>0&16711935)>>>0}function De(v,_){L[_]=function(k,P,B,z,W,K,Z){var ne;for(ne=0;ne<W;++ne){var de=L[v](K[Z+ne-1],B,z+ne);K[Z+ne]=Je(k[P+ne],de)}}}function Qe(){this.ud=this.hd=this.jd=0}function ze(v,_){return((4278124286&(v^_))>>>1)+(v&_)>>>0}function Vt(v){return 0<=v&&256>v?v:0>v?0:255<v?255:void 0}function Ct(v,_){return Vt(v+(v-_+.5>>1))}function dt(v,_,k){return Math.abs(_-k)-Math.abs(v-k)}function St(v,_,k,P,B,z,W){for(P=z[W-1],k=0;k<B;++k)z[W+k]=P=Je(v[_+k],P)}function Ot(v,_,k,P,B){var z;for(z=0;z<k;++z){var W=v[_+z],K=W>>8&255,Z=16711935&(Z=(Z=16711935&W)+((K<<16)+K));P[B+z]=(4278255360&W)+Z>>>0}}function Ve(v,_){_.jd=255&v,_.hd=v>>8&255,_.ud=v>>16&255}function wt(v,_,k,P,B,z){var W;for(W=0;W<P;++W){var K=_[k+W],Z=K>>>8,ne=K,de=255&(de=(de=K>>>16)+((v.jd<<24>>24)*(Z<<24>>24)>>>5));ne=255&(ne=(ne+=(v.hd<<24>>24)*(Z<<24>>24)>>>5)+((v.ud<<24>>24)*(de<<24>>24)>>>5)),B[z+W]=(4278255360&K)+(de<<16)+ne}}function lt(v,_,k,P,B){L[_]=function(z,W,K,Z,ne,de,xe,re,fe){for(Z=xe;Z<re;++Z)for(xe=0;xe<fe;++xe)ne[de++]=B(K[P(z[W++])])},L[v]=function(z,W,K,Z,ne,de,xe){var re=8>>z.b,fe=z.Ea,be=z.K[0],Se=z.w;if(8>re)for(z=(1<<z.b)-1,Se=(1<<re)-1;W<K;++W){var we,Ae=0;for(we=0;we<fe;++we)we&z||(Ae=P(Z[ne++])),de[xe++]=B(be[Ae&Se]),Ae>>=re}else L["VP8LMapColor"+k](Z,ne,be,Se,de,xe,W,K,fe)}}function Hn(v,_,k,P,B){for(k=_+k;_<k;){var z=v[_++];P[B++]=z>>16&255,P[B++]=z>>8&255,P[B++]=255&z}}function Yt(v,_,k,P,B){for(k=_+k;_<k;){var z=v[_++];P[B++]=z>>16&255,P[B++]=z>>8&255,P[B++]=255&z,P[B++]=z>>24&255}}function Et(v,_,k,P,B){for(k=_+k;_<k;){var z=(W=v[_++])>>16&240|W>>12&15,W=240&W|W>>28&15;P[B++]=z,P[B++]=W}}function Dt(v,_,k,P,B){for(k=_+k;_<k;){var z=(W=v[_++])>>16&248|W>>13&7,W=W>>5&224|W>>3&31;P[B++]=z,P[B++]=W}}function cn(v,_,k,P,B){for(k=_+k;_<k;){var z=v[_++];P[B++]=255&z,P[B++]=z>>8&255,P[B++]=z>>16&255}}function gt(v,_,k,P,B,z){if(z==0)for(k=_+k;_<k;)_e(P,((z=v[_++])[0]>>24|z[1]>>8&65280|z[2]<<8&16711680|z[3]<<24)>>>0),B+=32;else r(P,B,v,_,k)}function _n(v,_){L[_][0]=L[v+"0"],L[_][1]=L[v+"1"],L[_][2]=L[v+"2"],L[_][3]=L[v+"3"],L[_][4]=L[v+"4"],L[_][5]=L[v+"5"],L[_][6]=L[v+"6"],L[_][7]=L[v+"7"],L[_][8]=L[v+"8"],L[_][9]=L[v+"9"],L[_][10]=L[v+"10"],L[_][11]=L[v+"11"],L[_][12]=L[v+"12"],L[_][13]=L[v+"13"],L[_][14]=L[v+"0"],L[_][15]=L[v+"0"]}function bt(v){return v==zS||v==qS||v==Nw||v==HS}function Nt(){this.eb=[],this.size=this.A=this.fb=0}function Tn(){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 Ft(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Nt,this.f.kb=new Tn,this.sd=null}function ct(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ln(){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 xt(v){return alert("todo:WebPSamplerProcessPlane"),v.T}function Tt(v,_){var k=v.T,P=_.ba.f.RGBA,B=P.eb,z=P.fb+v.ka*P.A,W=ga[_.ba.S],K=v.y,Z=v.O,ne=v.f,de=v.N,xe=v.ea,re=v.W,fe=_.cc,be=_.dc,Se=_.Mc,we=_.Nc,Ae=v.ka,ke=v.ka+v.T,Le=v.U,je=Le+1>>1;for(Ae==0?W(K,Z,null,null,ne,de,xe,re,ne,de,xe,re,B,z,null,null,Le):(W(_.ec,_.fc,K,Z,fe,be,Se,we,ne,de,xe,re,B,z-P.A,B,z,Le),++k);Ae+2<ke;Ae+=2)fe=ne,be=de,Se=xe,we=re,de+=v.Rc,re+=v.Rc,z+=2*P.A,W(K,(Z+=2*v.fa)-v.fa,K,Z,fe,be,Se,we,ne,de,xe,re,B,z-P.A,B,z,Le);return Z+=v.fa,v.j+ke<v.o?(r(_.ec,_.fc,K,Z,Le),r(_.cc,_.dc,ne,de,je),r(_.Mc,_.Nc,xe,re,je),k--):1&ke||W(K,Z,null,null,ne,de,xe,re,ne,de,xe,re,B,z+P.A,null,null,Le),k}function nn(v,_,k){var P=v.F,B=[v.J];if(P!=null){var z=v.U,W=_.ba.S,K=W==Ew||W==Nw;_=_.ba.f.RGBA;var Z=[0],ne=v.ka;Z[0]=v.T,v.Kb&&(ne==0?--Z[0]:(--ne,B[0]-=v.width),v.j+v.ka+v.T==v.o&&(Z[0]=v.o-v.j-ne));var de=_.eb;ne=_.fb+ne*_.A,v=DP(P,B[0],v.width,z,Z,de,ne+(K?0:3),_.A),e(k==Z),v&&bt(W)&&fv(de,ne,K,z,Z,_.A)}return 0}function sr(v){var _=v.ma,k=_.ba.S,P=11>k,B=k==Sw||k==Aw||k==Ew||k==US||k==12||bt(k);if(_.memory=null,_.Ib=null,_.Jb=null,_.Nd=null,!sv(_.Oa,v,B?11:12))return 0;if(B&&bt(k)&&nv(),v.da)alert("todo:use_scaling");else{if(P){if(_.Ib=xt,v.Kb){if(k=v.U+1>>1,_.memory=s(v.U+2*k),_.memory==null)return 0;_.ec=_.memory,_.fc=0,_.cc=_.ec,_.dc=_.fc+v.U,_.Mc=_.cc,_.Nc=_.dc+k,_.Ib=Tt,nv()}}else alert("todo:EmitYUV");B&&(_.Jb=nn,P&&Ga())}if(P&&!e3){for(v=0;256>v;++v)Kq[v]=89858*(v-128)+Cw>>kw,Jq[v]=-22014*(v-128)+Cw,Xq[v]=-45773*(v-128),Yq[v]=113618*(v-128)+Cw>>kw;for(v=mv;v<GS;++v)_=76283*(v-16)+Cw>>kw,Qq[v-mv]=Ho(_,255),Zq[v-mv]=Ho(_+8>>4,15);e3=1}return 1}function nt(v){var _=v.ma,k=v.U,P=v.T;return e(!(1&v.ka)),0>=k||0>=P?0:(k=_.Ib(v,_),_.Jb!=null&&_.Jb(v,_,k),_.Dc+=k,1)}function Kr(v){v.ma.memory=null}function ci(v,_,k,P){return ge(v,8)!=47?0:(_[0]=ge(v,14)+1,k[0]=ge(v,14)+1,P[0]=ge(v,1),ge(v,3)!=0?0:!v.h)}function Wn(v,_){if(4>v)return v+1;var k=v-2>>1;return(2+(1&v)<<k)+ge(_,k)+1}function pr(v,_){return 120<_?_-120:1<=(k=((k=Iq[_-1])>>4)*v+(8-(15&k)))?k:1;var k}function ar(v,_,k){var P=ee(k),B=v[_+=255&P].g-8;return 0<B&&(X(k,k.u+8),P=ee(k),_+=v[_].value,_+=P&(1<<B)-1),X(k,k.u+v[_].g),v[_].value}function Yr(v,_,k){return k.g+=v.g,k.value+=v.value<<_>>>0,e(8>=k.g),v.g}function ui(v,_,k){var P=v.xc;return e((_=P==0?0:v.vc[v.md*(k>>P)+(_>>P)])<v.Wb),v.Ya[_]}function sh(v,_,k,P){var B=v.ab,z=v.c*_,W=v.C;_=W+_;var K=k,Z=P;for(P=v.Ta,k=v.Ua;0<B--;){var ne=v.gc[B],de=W,xe=_,re=K,fe=Z,be=(Z=P,K=k,ne.Ea);switch(e(de<xe),e(xe<=ne.nc),ne.hc){case 2:mr(re,fe,(xe-de)*be,Z,K);break;case 0:var Se=de,we=xe,Ae=Z,ke=K,Le=(st=ne).Ea;Se==0&&(ov(re,fe,null,null,1,Ae,ke),St(re,fe+1,0,0,Le-1,Ae,ke+1),fe+=Le,ke+=Le,++Se);for(var je=1<<st.b,ht=je-1,Ke=Ce(Le,st.b),Ut=st.K,st=st.w+(Se>>st.b)*Ke;Se<we;){var Zt=Ut,Dr=st,zt=1;for(qp(re,fe,Ae,ke-Le,1,Ae,ke);zt<Le;){var at=(zt&~ht)+je;at>Le&&(at=Le),(0,cv[Zt[Dr++]>>8&15])(re,fe+ +zt,Ae,ke+zt-Le,at-zt,Ae,ke+zt),zt=at}fe+=Le,ke+=Le,++Se&ht||(st+=Ke)}xe!=ne.nc&&r(Z,K-be,Z,K+(xe-de-1)*be,be);break;case 1:for(be=re,we=fe,Le=(re=ne.Ea)-(ke=re&~(Ae=(fe=1<<ne.b)-1)),Se=Ce(re,ne.b),je=ne.K,ne=ne.w+(de>>ne.b)*Se;de<xe;){for(ht=je,Ke=ne,Ut=new Qe,st=we+ke,Zt=we+re;we<st;)Ve(ht[Ke++],Ut),uv(Ut,be,we,fe,Z,K),we+=fe,K+=fe;we<Zt&&(Ve(ht[Ke++],Ut),uv(Ut,be,we,Le,Z,K),we+=Le,K+=Le),++de&Ae||(ne+=Se)}break;case 3:if(re==Z&&fe==K&&0<ne.b){for(we=Z,re=be=K+(xe-de)*be-(ke=(xe-de)*Ce(ne.Ea,ne.b)),fe=Z,Ae=K,Se=[],ke=(Le=ke)-1;0<=ke;--ke)Se[ke]=fe[Ae+ke];for(ke=Le-1;0<=ke;--ke)we[re+ke]=Se[ke];bw(ne,de,xe,Z,be,Z,K)}else bw(ne,de,xe,re,fe,Z,K)}K=P,Z=k}Z!=k&&r(P,k,K,Z,z)}function lu(v,_){var k=v.V,P=v.Ba+v.c*v.C,B=_-v.C;if(e(_<=v.l.o),e(16>=B),0<B){var z=v.l,W=v.Ta,K=v.Ua,Z=z.width;if(sh(v,B,k,P),B=K=[K],e((k=v.C)<(P=_)),e(z.v<z.va),P>z.o&&(P=z.o),k<z.j){var ne=z.j-k;k=z.j,B[0]+=ne*Z}if(k>=P?k=0:(B[0]+=4*z.v,z.ka=k-z.j,z.U=z.va-z.v,z.T=P-k,k=1),k){if(K=K[0],11>(k=v.ca).S){var de=k.f.RGBA,xe=(P=k.S,B=z.U,z=z.T,ne=de.eb,de.A),re=z;for(de=de.fb+v.Ma*de.A;0<re--;){var fe=W,be=K,Se=B,we=ne,Ae=de;switch(P){case _w:dv(fe,be,Se,we,Ae);break;case Sw:pu(fe,be,Se,we,Ae);break;case zS:pu(fe,be,Se,we,Ae),fv(we,Ae,0,Se,1,0);break;case HP:bh(fe,be,Se,we,Ae);break;case Aw:gt(fe,be,Se,we,Ae,1);break;case qS:gt(fe,be,Se,we,Ae,1),fv(we,Ae,0,Se,1,0);break;case Ew:gt(fe,be,Se,we,Ae,0);break;case Nw:gt(fe,be,Se,we,Ae,0),fv(we,Ae,1,Se,1,0);break;case US:mu(fe,be,Se,we,Ae);break;case HS:mu(fe,be,Se,we,Ae),MP(we,Ae,Se,1,0);break;case WP:gu(fe,be,Se,we,Ae);break;default:e(0)}K+=Z,de+=xe}v.Ma+=z}else alert("todo:EmitRescaledRowsYUVA");e(v.Ma<=k.height)}}v.C=_,e(v.C<=v.i)}function qa(v){var _;if(0<v.ua)return 0;for(_=0;_<v.Wb;++_){var k=v.Ya[_].G,P=v.Ya[_].H;if(0<k[1][P[1]+0].g||0<k[2][P[2]+0].g||0<k[3][P[3]+0].g)return 0}return 1}function zo(v,_,k,P,B,z){if(v.Z!=0){var W=v.qd,K=v.rd;for(e(bu[v.Z]!=null);_<k;++_)bu[v.Z](W,K,P,B,P,B,z),W=P,K=B,B+=z;v.qd=W,v.rd=K}}function Ha(v,_){var k=v.l.ma,P=k.Z==0||k.Z==1?v.l.j:v.C;if(P=v.C<P?P:v.C,e(_<=v.l.o),_>P){var B=v.l.width,z=k.ca,W=k.tb+B*P,K=v.V,Z=v.Ba+v.c*P,ne=v.gc;e(v.ab==1),e(ne[0].hc==3),Ko(ne[0],P,_,K,Z,z,W),zo(k,P,_,z,W,B)}v.C=v.Ma=_}function Wa(v,_,k,P,B,z,W){var K=v.$/P,Z=v.$%P,ne=v.m,de=v.s,xe=k+v.$,re=xe;B=k+P*B;var fe=k+P*z,be=280+de.ua,Se=v.Pb?K:16777216,we=0<de.ua?de.Wa:null,Ae=de.wc,ke=xe<fe?ui(de,Z,K):null;e(v.C<z),e(fe<=B);var Le=!1;e:for(;;){for(;Le||xe<fe;){var je=0;if(K>=Se){var ht=xe-k;e((Se=v).Pb),Se.wd=Se.m,Se.xd=ht,0<Se.s.ua&&Te(Se.s.Wa,Se.s.vb),Se=K+Mq}if(Z&Ae||(ke=ui(de,Z,K)),e(ke!=null),ke.Qb&&(_[xe]=ke.qb,Le=!0),!Le)if(Q(ne),ke.jc){je=ne,ht=_;var Ke=xe,Ut=ke.pd[ee(je)&yh-1];e(ke.jc),256>Ut.g?(X(je,je.u+Ut.g),ht[Ke]=Ut.value,je=0):(X(je,je.u+Ut.g-256),e(256<=Ut.value),je=Ut.value),je==0&&(Le=!0)}else je=ar(ke.G[0],ke.H[0],ne);if(ne.h)break;if(Le||256>je){if(!Le)if(ke.nd)_[xe]=(ke.qb|je<<8)>>>0;else{if(Q(ne),Le=ar(ke.G[1],ke.H[1],ne),Q(ne),ht=ar(ke.G[2],ke.H[2],ne),Ke=ar(ke.G[3],ke.H[3],ne),ne.h)break;_[xe]=(Ke<<24|Le<<16|je<<8|ht)>>>0}if(Le=!1,++xe,++Z>=P&&(Z=0,++K,W!=null&&K<=z&&!(K%16)&&W(v,K),we!=null))for(;re<xe;)je=_[re++],we.X[(506832829*je&4294967295)>>>we.Mb]=je}else if(280>je){if(je=Wn(je-256,ne),ht=ar(ke.G[4],ke.H[4],ne),Q(ne),ht=pr(P,ht=Wn(ht,ne)),ne.h)break;if(xe-k<ht||B-xe<je)break e;for(Ke=0;Ke<je;++Ke)_[xe+Ke]=_[xe+Ke-ht];for(xe+=je,Z+=je;Z>=P;)Z-=P,++K,W!=null&&K<=z&&!(K%16)&&W(v,K);if(e(xe<=B),Z&Ae&&(ke=ui(de,Z,K)),we!=null)for(;re<xe;)je=_[re++],we.X[(506832829*je&4294967295)>>>we.Mb]=je}else{if(!(je<be))break e;for(Le=je-280,e(we!=null);re<xe;)je=_[re++],we.X[(506832829*je&4294967295)>>>we.Mb]=je;je=xe,e(!(Le>>>(ht=we).Xa)),_[je]=ht.X[Le],Le=!0}Le||e(ne.h==ae(ne))}if(v.Pb&&ne.h&&xe<B)e(v.m.h),v.a=5,v.m=v.wd,v.$=v.xd,0<v.s.ua&&Te(v.s.vb,v.s.Wa);else{if(ne.h)break e;W!=null&&W(v,K>z?z:K),v.a=0,v.$=xe-k}return 1}return v.a=3,0}function ua(v){e(v!=null),v.vc=null,v.yc=null,v.Ya=null;var _=v.Wa;_!=null&&(_.X=null),v.vb=null,e(v!=null)}function ah(){var v=new kt;return v==null?null:(v.a=0,v.xb=KP,_n("Predictor","VP8LPredictors"),_n("Predictor","VP8LPredictors_C"),_n("PredictorAdd","VP8LPredictorsAdd"),_n("PredictorAdd","VP8LPredictorsAdd_C"),mr=Ot,uv=wt,dv=Hn,pu=Yt,mu=Et,gu=Dt,bh=cn,L.VP8LMapColor32b=Go,L.VP8LMapColor8b=lv,v)}function qo(v,_,k,P,B){var z=1,W=[v],K=[_],Z=P.m,ne=P.s,de=null,xe=0;e:for(;;){if(k)for(;z&&ge(Z,1);){var re=W,fe=K,be=P,Se=1,we=be.m,Ae=be.gc[be.ab],ke=ge(we,2);if(be.Oc&1<<ke)z=0;else{switch(be.Oc|=1<<ke,Ae.hc=ke,Ae.Ea=re[0],Ae.nc=fe[0],Ae.K=[null],++be.ab,e(4>=be.ab),ke){case 0:case 1:Ae.b=ge(we,3)+2,Se=qo(Ce(Ae.Ea,Ae.b),Ce(Ae.nc,Ae.b),0,be,Ae.K),Ae.K=Ae.K[0];break;case 3:var Le,je=ge(we,8)+1,ht=16<je?0:4<je?1:2<je?2:3;if(re[0]=Ce(Ae.Ea,ht),Ae.b=ht,Le=Se=qo(je,1,0,be,Ae.K)){var Ke,Ut=je,st=Ae,Zt=1<<(8>>st.b),Dr=s(Zt);if(Dr==null)Le=0;else{var zt=st.K[0],at=st.w;for(Dr[0]=st.K[0][0],Ke=1;Ke<1*Ut;++Ke)Dr[Ke]=Je(zt[at+Ke],Dr[Ke-1]);for(;Ke<4*Zt;++Ke)Dr[Ke]=0;st.K[0]=null,st.K[0]=Dr,Le=1}}Se=Le;break;case 2:break;default:e(0)}z=Se}}if(W=W[0],K=K[0],z&&ge(Z,1)&&!(z=1<=(xe=ge(Z,4))&&11>=xe)){P.a=3;break e}var Fe;if(Fe=z)t:{var vr,Mt,rn,Dn=P,fi=W,Gi=K,or=xe,ki=k,Ki=Dn.m,Fr=Dn.s,an=[null],pn=1,lr=0,mn=Oq[or];n:for(;;){if(ki&&ge(Ki,1)){var pi=ge(Ki,3)+2,Ya=Ce(fi,pi),yr=Ce(Gi,pi),us=Ya*yr;if(!qo(Ya,yr,0,Dn,an))break n;for(an=an[0],Fr.xc=pi,vr=0;vr<us;++vr){var Nn=an[vr]>>8&65535;an[vr]=Nn,Nn>=pn&&(pn=Nn+1)}}if(Ki.h)break n;for(Mt=0;5>Mt;++Mt){var Br=VP[Mt];!Mt&&0<or&&(Br+=1<<or),lr<Br&&(lr=Br)}var Rs=a(pn*mn,J),Yi=pn,Ls=a(Yi,le);if(Ls==null)var Is=null;else e(65536>=Yi),Is=Ls;var ds=s(lr);if(Is==null||ds==null||Rs==null){Dn.a=1;break n}var Os=Rs;for(vr=rn=0;vr<pn;++vr){var jn=Is[vr],Ms=jn.G,Xa=jn.H,xh=0,ec=1,mi=0;for(Mt=0;5>Mt;++Mt){Br=VP[Mt],Ms[Mt]=Os,Xa[Mt]=rn,!Mt&&0<or&&(Br+=1<<or);i:{var Pw,KS=Br,jw=Dn,gv=ds,nH=Os,rH=rn,YS=0,wu=jw.m,iH=ge(wu,1);if(i(gv,0,0,KS),iH){var sH=ge(wu,1)+1,aH=ge(wu,1),r3=ge(wu,aH==0?1:8);gv[r3]=1,sH==2&&(gv[r3=ge(wu,8)]=1);var Rw=1}else{var i3=s(19),s3=ge(wu,4)+4;if(19<s3){jw.a=3;var Lw=0;break i}for(Pw=0;Pw<s3;++Pw)i3[Lq[Pw]]=ge(wu,3);var XS=void 0,vv=void 0,a3=jw,oH=i3,Iw=KS,o3=gv,JS=0,xu=a3.m,l3=8,c3=a(128,J);r:for(;$(c3,0,7,oH,19);){if(ge(xu,1)){var lH=2+2*ge(xu,3);if((XS=2+ge(xu,lH))>Iw)break r}else XS=Iw;for(vv=0;vv<Iw&&XS--;){Q(xu);var u3=c3[0+(127&ee(xu))];X(xu,xu.u+u3.g);var Wp=u3.value;if(16>Wp)o3[vv++]=Wp,Wp!=0&&(l3=Wp);else{var cH=Wp==16,d3=Wp-16,uH=jq[d3],h3=ge(xu,Pq[d3])+uH;if(vv+h3>Iw)break r;for(var dH=cH?l3:0;0<h3--;)o3[vv++]=dH}}JS=1;break r}JS||(a3.a=3),Rw=JS}(Rw=Rw&&!wu.h)&&(YS=$(nH,rH,8,gv,KS)),Rw&&YS!=0?Lw=YS:(jw.a=3,Lw=0)}if(Lw==0)break n;if(ec&&Rq[Mt]==1&&(ec=Os[rn].g==0),xh+=Os[rn].g,rn+=Lw,3>=Mt){var yv,QS=ds[0];for(yv=1;yv<Br;++yv)ds[yv]>QS&&(QS=ds[yv]);mi+=QS}}if(jn.nd=ec,jn.Qb=0,ec&&(jn.qb=(Ms[3][Xa[3]+0].value<<24|Ms[1][Xa[1]+0].value<<16|Ms[2][Xa[2]+0].value)>>>0,xh==0&&256>Ms[0][Xa[0]+0].value&&(jn.Qb=1,jn.qb+=Ms[0][Xa[0]+0].value<<8)),jn.jc=!jn.Qb&&6>mi,jn.jc){var Ow,tc=jn;for(Ow=0;Ow<yh;++Ow){var _u=Ow,Su=tc.pd[_u],Mw=tc.G[0][tc.H[0]+_u];256<=Mw.value?(Su.g=Mw.g+256,Su.value=Mw.value):(Su.g=0,Su.value=0,_u>>=Yr(Mw,8,Su),_u>>=Yr(tc.G[1][tc.H[1]+_u],16,Su),_u>>=Yr(tc.G[2][tc.H[2]+_u],0,Su),Yr(tc.G[3][tc.H[3]+_u],24,Su))}}}Fr.vc=an,Fr.Wb=pn,Fr.Ya=Is,Fr.yc=Rs,Fe=1;break t}Fe=0}if(!(z=Fe)){P.a=3;break e}if(0<xe){if(ne.ua=1<<xe,!Y(ne.Wa,xe)){P.a=1,z=0;break e}}else ne.ua=0;var ZS=P,f3=W,hH=K,eA=ZS.s,tA=eA.xc;if(ZS.c=f3,ZS.i=hH,eA.md=Ce(f3,tA),eA.wc=tA==0?-1:(1<<tA)-1,k){P.xb=qq;break e}if((de=s(W*K))==null){P.a=1,z=0;break e}z=(z=Wa(P,de,0,W,K,K,null))&&!Z.h;break e}return z?(B!=null?B[0]=de:(e(de==null),e(k)),P.$=0,k||ua(ne)):ua(ne),z}function oh(v,_){var k=v.c*v.i,P=k+_+16*_;return e(v.c<=_),v.V=s(P),v.V==null?(v.Ta=null,v.Ua=0,v.a=1,0):(v.Ta=v.V,v.Ua=v.Ba+k+_,1)}function Lp(v,_){var k=v.C,P=_-k,B=v.V,z=v.Ba+v.c*k;for(e(_<=v.l.o);0<P;){var W=16<P?16:P,K=v.l.ma,Z=v.l.width,ne=Z*W,de=K.ca,xe=K.tb+Z*k,re=v.Ta,fe=v.Ua;sh(v,W,B,z),FP(re,fe,de,xe,ne),zo(K,k,k+W,de,xe,Z),P-=W,B+=W*v.c,k+=W}e(k==_),v.C=v.Ma=_}function Ip(){this.ub=this.yd=this.td=this.Rb=0}function Op(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function AS(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function W0(){this.Yb=function(){var v=[];return function _(k,P,B){for(var z=B[P],W=0;W<z&&(k.push(B.length>P+1?[]:0),!(B.length<P+1));W++)_(k[W],P+1,B)}(v,0,[3,11]),v}()}function tw(){this.jb=s(3),this.Wc=o([4,8],W0),this.Xc=o([4,17],W0)}function nw(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function da(){this.ld=this.La=this.dd=this.tc=0}function V0(){this.Na=this.la=0}function rw(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function G0(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function iw(){this.uc=this.M=this.Nb=0,this.wa=Array(new da),this.Y=0,this.ya=Array(new G0),this.aa=0,this.l=new Mp}function sw(){this.y=s(16),this.f=s(8),this.ea=s(8)}function aw(){this.cb=this.a=0,this.sc="",this.m=new D,this.Od=new Ip,this.Kc=new Op,this.ed=new nw,this.Qa=new AS,this.Ic=this.$c=this.Aa=0,this.D=new iw,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,D),this.ia=0,this.pb=a(4,rw),this.Pa=new tw,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new sw),this.Hd=0,this.rb=Array(new V0),this.sb=0,this.wa=Array(new da),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 G0),this.L=this.aa=0,this.gd=o([4,2],da),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 Ho(v,_){return 0>v?0:v>_?_:v}function Mp(){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 ES(){var v=new aw;return v!=null&&(v.a=0,v.sc="OK",v.cb=0,v.Xb=0,pv||(pv=Dp)),v}function Er(v,_,k){return v.a==0&&(v.a=_,v.sc=k,v.cb=0),0}function ow(v,_,k){return 3<=k&&v[_+0]==157&&v[_+1]==1&&v[_+2]==42}function Wo(v,_){if(v==null)return 0;if(v.a=0,v.sc="OK",_==null)return Er(v,2,"null VP8Io passed to VP8GetHeaders()");var k=_.data,P=_.w,B=_.ha;if(4>B)return Er(v,7,"Truncated header.");var z=k[P+0]|k[P+1]<<8|k[P+2]<<16,W=v.Od;if(W.Rb=!(1&z),W.td=z>>1&7,W.yd=z>>4&1,W.ub=z>>5,3<W.td)return Er(v,3,"Incorrect keyframe parameters.");if(!W.yd)return Er(v,4,"Frame not displayable.");P+=3,B-=3;var K=v.Kc;if(W.Rb){if(7>B)return Er(v,7,"cannot parse picture header");if(!ow(k,P,B))return Er(v,3,"Bad code word");K.c=16383&(k[P+4]<<8|k[P+3]),K.Td=k[P+4]>>6,K.i=16383&(k[P+6]<<8|k[P+5]),K.Ud=k[P+6]>>6,P+=7,B-=7,v.za=K.c+15>>4,v.Ub=K.i+15>>4,_.width=K.c,_.height=K.i,_.Da=0,_.j=0,_.v=0,_.va=_.width,_.o=_.height,_.da=0,_.ib=_.width,_.hb=_.height,_.U=_.width,_.T=_.height,i((z=v.Pa).jb,0,255,z.jb.length),e((z=v.Qa)!=null),z.Cb=0,z.Bb=0,z.Fb=1,i(z.Zb,0,0,z.Zb.length),i(z.Lb,0,0,z.Lb)}if(W.ub>B)return Er(v,7,"bad partition length");oe(z=v.m,k,P,W.ub),P+=W.ub,B-=W.ub,W.Rb&&(K.Ld=pe(z),K.Kd=pe(z)),K=v.Qa;var Z,ne=v.Pa;if(e(z!=null),e(K!=null),K.Cb=pe(z),K.Cb){if(K.Bb=pe(z),pe(z)){for(K.Fb=pe(z),Z=0;4>Z;++Z)K.Zb[Z]=pe(z)?O(z,7):0;for(Z=0;4>Z;++Z)K.Lb[Z]=pe(z)?O(z,6):0}if(K.Bb)for(Z=0;3>Z;++Z)ne.jb[Z]=pe(z)?se(z,8):255}else K.Bb=0;if(z.Ka)return Er(v,3,"cannot parse segment header");if((K=v.ed).zd=pe(z),K.Tb=se(z,6),K.wb=se(z,3),K.Pc=pe(z),K.Pc&&pe(z)){for(ne=0;4>ne;++ne)pe(z)&&(K.vd[ne]=O(z,6));for(ne=0;4>ne;++ne)pe(z)&&(K.od[ne]=O(z,6))}if(v.L=K.Tb==0?0:K.zd?1:2,z.Ka)return Er(v,3,"cannot parse filter header");var de=B;if(B=Z=P,P=Z+de,K=de,v.Xb=(1<<se(v.m,2))-1,de<3*(ne=v.Xb))k=7;else{for(Z+=3*ne,K-=3*ne,de=0;de<ne;++de){var xe=k[B+0]|k[B+1]<<8|k[B+2]<<16;xe>K&&(xe=K),oe(v.Jc[+de],k,Z,xe),Z+=xe,K-=xe,B+=3}oe(v.Jc[+ne],k,Z,K),k=Z<P?0:5}if(k!=0)return Er(v,k,"cannot parse partitions");for(k=se(Z=v.m,7),B=pe(Z)?O(Z,4):0,P=pe(Z)?O(Z,4):0,K=pe(Z)?O(Z,4):0,ne=pe(Z)?O(Z,4):0,Z=pe(Z)?O(Z,4):0,de=v.Qa,xe=0;4>xe;++xe){if(de.Cb){var re=de.Zb[xe];de.Fb||(re+=k)}else{if(0<xe){v.pb[xe]=v.pb[0];continue}re=k}var fe=v.pb[xe];fe.Sc[0]=WS[Ho(re+B,127)],fe.Sc[1]=VS[Ho(re+0,127)],fe.Eb[0]=2*WS[Ho(re+P,127)],fe.Eb[1]=101581*VS[Ho(re+K,127)]>>16,8>fe.Eb[1]&&(fe.Eb[1]=8),fe.Qc[0]=WS[Ho(re+ne,117)],fe.Qc[1]=VS[Ho(re+Z,127)],fe.lc=re+Z}if(!W.Rb)return Er(v,4,"Not a key frame.");for(pe(z),W=v.Pa,k=0;4>k;++k){for(B=0;8>B;++B)for(P=0;3>P;++P)for(K=0;11>K;++K)ne=me(z,Uq[k][B][P][K])?se(z,8):Bq[k][B][P][K],W.Wc[k][B].Yb[P][K]=ne;for(B=0;17>B;++B)W.Xc[k][B]=W.Wc[k][zq[B]]}return v.kc=pe(z),v.kc&&(v.Bd=se(z,8)),v.cb=1}function Dp(v,_,k,P,B,z,W){var K=_[B].Yb[k];for(k=0;16>B;++B){if(!me(v,K[k+0]))return B;for(;!me(v,K[k+1]);)if(K=_[++B].Yb[0],k=0,B==16)return 16;var Z=_[B+1].Yb;if(me(v,K[k+2])){var ne=v,de=0;if(me(ne,(re=K)[(xe=k)+3]))if(me(ne,re[xe+6])){for(K=0,xe=2*(de=me(ne,re[xe+8]))+(re=me(ne,re[xe+9+de])),de=0,re=Dq[xe];re[K];++K)de+=de+me(ne,re[K]);de+=3+(8<<xe)}else me(ne,re[xe+7])?(de=7+2*me(ne,165),de+=me(ne,145)):de=5+me(ne,159);else de=me(ne,re[xe+4])?3+me(ne,re[xe+5]):2;K=Z[2]}else de=1,K=Z[1];Z=W+Fq[B],0>(ne=v).b&&ue(ne);var xe,re=ne.b,fe=(xe=ne.Ca>>1)-(ne.I>>re)>>31;--ne.b,ne.Ca+=fe,ne.Ca|=1,ne.I-=(xe+1&fe)<<re,z[Z]=((de^fe)-fe)*P[(0<B)+0]}return 16}function lw(v){var _=v.rb[v.sb-1];_.la=0,_.Na=0,i(v.zc,0,0,v.zc.length),v.ja=0}function ha(v,_,k,P,B){B=v[_+k+32*P]+(B>>3),v[_+k+32*P]=-256&B?0>B?0:255:B}function Ir(v,_,k,P,B,z){ha(v,_,0,k,P+B),ha(v,_,1,k,P+z),ha(v,_,2,k,P-z),ha(v,_,3,k,P-B)}function Ul(v){return(20091*v>>16)+v}function cw(v,_,k,P){var B,z=0,W=s(16);for(B=0;4>B;++B){var K=v[_+0]+v[_+8],Z=v[_+0]-v[_+8],ne=(35468*v[_+4]>>16)-Ul(v[_+12]),de=Ul(v[_+4])+(35468*v[_+12]>>16);W[z+0]=K+de,W[z+1]=Z+ne,W[z+2]=Z-ne,W[z+3]=K-de,z+=4,_++}for(B=z=0;4>B;++B)K=(v=W[z+0]+4)+W[z+8],Z=v-W[z+8],ne=(35468*W[z+4]>>16)-Ul(W[z+12]),ha(k,P,0,0,K+(de=Ul(W[z+4])+(35468*W[z+12]>>16))),ha(k,P,1,0,Z+ne),ha(k,P,2,0,Z-ne),ha(k,P,3,0,K-de),z++,P+=32}function NS(v,_,k,P){var B=v[_+0]+4,z=35468*v[_+4]>>16,W=Ul(v[_+4]),K=35468*v[_+1]>>16;Ir(k,P,0,B+W,v=Ul(v[_+1]),K),Ir(k,P,1,B+z,v,K),Ir(k,P,2,B-z,v,K),Ir(k,P,3,B-W,v,K)}function kS(v,_,k,P,B){cw(v,_,k,P),B&&cw(v,_+16,k,P+4)}function Vo(v,_,k,P){wh(v,_+0,k,P,1),wh(v,_+32,k,P+128,1)}function uw(v,_,k,P){var B;for(v=v[_+0]+4,B=0;4>B;++B)for(_=0;4>_;++_)ha(k,P,_,B,v)}function dw(v,_,k,P){v[_+0]&&hn(v,_+0,k,P),v[_+16]&&hn(v,_+16,k,P+4),v[_+32]&&hn(v,_+32,k,P+128),v[_+48]&&hn(v,_+48,k,P+128+4)}function Fp(v,_,k,P){var B,z=s(16);for(B=0;4>B;++B){var W=v[_+0+B]+v[_+12+B],K=v[_+4+B]+v[_+8+B],Z=v[_+4+B]-v[_+8+B],ne=v[_+0+B]-v[_+12+B];z[0+B]=W+K,z[8+B]=W-K,z[4+B]=ne+Z,z[12+B]=ne-Z}for(B=0;4>B;++B)W=(v=z[0+4*B]+3)+z[3+4*B],K=z[1+4*B]+z[2+4*B],Z=z[1+4*B]-z[2+4*B],ne=v-z[3+4*B],k[P+0]=W+K>>3,k[P+16]=ne+Z>>3,k[P+32]=W-K>>3,k[P+48]=ne-Z>>3,P+=64}function lh(v,_,k){var P,B=_-32,z=js,W=255-v[B-1];for(P=0;P<k;++P){var K,Z=z,ne=W+v[_-1];for(K=0;K<k;++K)v[_+K]=Z[ne+v[B+K]];_+=32}}function CS(v,_){lh(v,_,4)}function TS(v,_){lh(v,_,8)}function PS(v,_){lh(v,_,16)}function K0(v,_){var k;for(k=0;16>k;++k)r(v,_+32*k,v,_-32,16)}function hw(v,_){var k;for(k=16;0<k;--k)i(v,_,v[_-1],16),_+=32}function Va(v,_,k){var P;for(P=0;16>P;++P)i(_,k+32*P,v,16)}function jS(v,_){var k,P=16;for(k=0;16>k;++k)P+=v[_-1+32*k]+v[_+k-32];Va(P>>5,v,_)}function ch(v,_){var k,P=8;for(k=0;16>k;++k)P+=v[_-1+32*k];Va(P>>4,v,_)}function Y0(v,_){var k,P=8;for(k=0;16>k;++k)P+=v[_+k-32];Va(P>>4,v,_)}function RS(v,_){Va(128,v,_)}function Pt(v,_,k){return v+2*_+k+2>>2}function LS(v,_){var k,P=_-32;for(P=new Uint8Array([Pt(v[P-1],v[P+0],v[P+1]),Pt(v[P+0],v[P+1],v[P+2]),Pt(v[P+1],v[P+2],v[P+3]),Pt(v[P+2],v[P+3],v[P+4])]),k=0;4>k;++k)r(v,_+32*k,P,0,P.length)}function IS(v,_){var k=v[_-1],P=v[_-1+32],B=v[_-1+64],z=v[_-1+96];_e(v,_+0,16843009*Pt(v[_-1-32],k,P)),_e(v,_+32,16843009*Pt(k,P,B)),_e(v,_+64,16843009*Pt(P,B,z)),_e(v,_+96,16843009*Pt(B,z,z))}function OS(v,_){var k,P=4;for(k=0;4>k;++k)P+=v[_+k-32]+v[_-1+32*k];for(P>>=3,k=0;4>k;++k)i(v,_+32*k,P,4)}function zl(v,_){var k=v[_-1+0],P=v[_-1+32],B=v[_-1+64],z=v[_-1-32],W=v[_+0-32],K=v[_+1-32],Z=v[_+2-32],ne=v[_+3-32];v[_+0+96]=Pt(P,B,v[_-1+96]),v[_+1+96]=v[_+0+64]=Pt(k,P,B),v[_+2+96]=v[_+1+64]=v[_+0+32]=Pt(z,k,P),v[_+3+96]=v[_+2+64]=v[_+1+32]=v[_+0+0]=Pt(W,z,k),v[_+3+64]=v[_+2+32]=v[_+1+0]=Pt(K,W,z),v[_+3+32]=v[_+2+0]=Pt(Z,K,W),v[_+3+0]=Pt(ne,Z,K)}function ql(v,_){var k=v[_+1-32],P=v[_+2-32],B=v[_+3-32],z=v[_+4-32],W=v[_+5-32],K=v[_+6-32],Z=v[_+7-32];v[_+0+0]=Pt(v[_+0-32],k,P),v[_+1+0]=v[_+0+32]=Pt(k,P,B),v[_+2+0]=v[_+1+32]=v[_+0+64]=Pt(P,B,z),v[_+3+0]=v[_+2+32]=v[_+1+64]=v[_+0+96]=Pt(B,z,W),v[_+3+32]=v[_+2+64]=v[_+1+96]=Pt(z,W,K),v[_+3+64]=v[_+2+96]=Pt(W,K,Z),v[_+3+96]=Pt(K,Z,Z)}function MS(v,_){var k=v[_-1+0],P=v[_-1+32],B=v[_-1+64],z=v[_-1-32],W=v[_+0-32],K=v[_+1-32],Z=v[_+2-32],ne=v[_+3-32];v[_+0+0]=v[_+1+64]=z+W+1>>1,v[_+1+0]=v[_+2+64]=W+K+1>>1,v[_+2+0]=v[_+3+64]=K+Z+1>>1,v[_+3+0]=Z+ne+1>>1,v[_+0+96]=Pt(B,P,k),v[_+0+64]=Pt(P,k,z),v[_+0+32]=v[_+1+96]=Pt(k,z,W),v[_+1+32]=v[_+2+96]=Pt(z,W,K),v[_+2+32]=v[_+3+96]=Pt(W,K,Z),v[_+3+32]=Pt(K,Z,ne)}function DS(v,_){var k=v[_+0-32],P=v[_+1-32],B=v[_+2-32],z=v[_+3-32],W=v[_+4-32],K=v[_+5-32],Z=v[_+6-32],ne=v[_+7-32];v[_+0+0]=k+P+1>>1,v[_+1+0]=v[_+0+64]=P+B+1>>1,v[_+2+0]=v[_+1+64]=B+z+1>>1,v[_+3+0]=v[_+2+64]=z+W+1>>1,v[_+0+32]=Pt(k,P,B),v[_+1+32]=v[_+0+96]=Pt(P,B,z),v[_+2+32]=v[_+1+96]=Pt(B,z,W),v[_+3+32]=v[_+2+96]=Pt(z,W,K),v[_+3+64]=Pt(W,K,Z),v[_+3+96]=Pt(K,Z,ne)}function Bp(v,_){var k=v[_-1+0],P=v[_-1+32],B=v[_-1+64],z=v[_-1+96];v[_+0+0]=k+P+1>>1,v[_+2+0]=v[_+0+32]=P+B+1>>1,v[_+2+32]=v[_+0+64]=B+z+1>>1,v[_+1+0]=Pt(k,P,B),v[_+3+0]=v[_+1+32]=Pt(P,B,z),v[_+3+32]=v[_+1+64]=Pt(B,z,z),v[_+3+64]=v[_+2+64]=v[_+0+96]=v[_+1+96]=v[_+2+96]=v[_+3+96]=z}function X0(v,_){var k=v[_-1+0],P=v[_-1+32],B=v[_-1+64],z=v[_-1+96],W=v[_-1-32],K=v[_+0-32],Z=v[_+1-32],ne=v[_+2-32];v[_+0+0]=v[_+2+32]=k+W+1>>1,v[_+0+32]=v[_+2+64]=P+k+1>>1,v[_+0+64]=v[_+2+96]=B+P+1>>1,v[_+0+96]=z+B+1>>1,v[_+3+0]=Pt(K,Z,ne),v[_+2+0]=Pt(W,K,Z),v[_+1+0]=v[_+3+32]=Pt(k,W,K),v[_+1+32]=v[_+3+64]=Pt(P,k,W),v[_+1+64]=v[_+3+96]=Pt(B,P,k),v[_+1+96]=Pt(z,B,P)}function uh(v,_){var k;for(k=0;8>k;++k)r(v,_+32*k,v,_-32,8)}function FS(v,_){var k;for(k=0;8>k;++k)i(v,_,v[_-1],8),_+=32}function Hl(v,_,k){var P;for(P=0;8>P;++P)i(_,k+32*P,v,8)}function BS(v,_){var k,P=8;for(k=0;8>k;++k)P+=v[_+k-32]+v[_-1+32*k];Hl(P>>4,v,_)}function J0(v,_){var k,P=4;for(k=0;8>k;++k)P+=v[_+k-32];Hl(P>>3,v,_)}function Q0(v,_){var k,P=4;for(k=0;8>k;++k)P+=v[_-1+32*k];Hl(P>>3,v,_)}function fw(v,_){Hl(128,v,_)}function Wl(v,_,k){var P=v[_-k],B=v[_+0],z=3*(B-P)+$S[1020+v[_-2*k]-v[_+k]],W=xw[112+(z+4>>3)];v[_-k]=js[255+P+xw[112+(z+3>>3)]],v[_+0]=js[255+B-W]}function Z0(v,_,k,P){var B=v[_+0],z=v[_+k];return ma[255+v[_-2*k]-v[_-k]]>P||ma[255+z-B]>P}function $p(v,_,k,P){return 4*ma[255+v[_-k]-v[_+0]]+ma[255+v[_-2*k]-v[_+k]]<=P}function ev(v,_,k,P,B){var z=v[_-3*k],W=v[_-2*k],K=v[_-k],Z=v[_+0],ne=v[_+k],de=v[_+2*k],xe=v[_+3*k];return 4*ma[255+K-Z]+ma[255+W-ne]>P?0:ma[255+v[_-4*k]-z]<=B&&ma[255+z-W]<=B&&ma[255+W-K]<=B&&ma[255+xe-de]<=B&&ma[255+de-ne]<=B&&ma[255+ne-Z]<=B}function dh(v,_,k,P){var B=2*P+1;for(P=0;16>P;++P)$p(v,_+P,k,B)&&Wl(v,_+P,k)}function tv(v,_,k,P){var B=2*P+1;for(P=0;16>P;++P)$p(v,_+P*k,1,B)&&Wl(v,_+P*k,1)}function pw(v,_,k,P){var B;for(B=3;0<B;--B)dh(v,_+=4*k,k,P)}function mw(v,_,k,P){var B;for(B=3;0<B;--B)tv(v,_+=4,k,P)}function Vl(v,_,k,P,B,z,W,K){for(z=2*z+1;0<B--;){if(ev(v,_,k,z,W))if(Z0(v,_,k,K))Wl(v,_,k);else{var Z=v,ne=_,de=k,xe=Z[ne-2*de],re=Z[ne-de],fe=Z[ne+0],be=Z[ne+de],Se=Z[ne+2*de],we=27*(ke=$S[1020+3*(fe-re)+$S[1020+xe-be]])+63>>7,Ae=18*ke+63>>7,ke=9*ke+63>>7;Z[ne-3*de]=js[255+Z[ne-3*de]+ke],Z[ne-2*de]=js[255+xe+Ae],Z[ne-de]=js[255+re+we],Z[ne+0]=js[255+fe-we],Z[ne+de]=js[255+be-Ae],Z[ne+2*de]=js[255+Se-ke]}_+=P}}function Gl(v,_,k,P,B,z,W,K){for(z=2*z+1;0<B--;){if(ev(v,_,k,z,W))if(Z0(v,_,k,K))Wl(v,_,k);else{var Z=v,ne=_,de=k,xe=Z[ne-de],re=Z[ne+0],fe=Z[ne+de],be=xw[112+(4+(Se=3*(re-xe))>>3)],Se=xw[112+(Se+3>>3)],we=be+1>>1;Z[ne-2*de]=js[255+Z[ne-2*de]+we],Z[ne-de]=js[255+xe+Se],Z[ne+0]=js[255+re-be],Z[ne+de]=js[255+fe-we]}_+=P}}function gw(v,_,k,P,B,z){Vl(v,_,k,1,16,P,B,z)}function hh(v,_,k,P,B,z){Vl(v,_,1,k,16,P,B,z)}function vw(v,_,k,P,B,z){var W;for(W=3;0<W;--W)Gl(v,_+=4*k,k,1,16,P,B,z)}function N(v,_,k,P,B,z){var W;for(W=3;0<W;--W)Gl(v,_+=4,1,k,16,P,B,z)}function F(v,_,k,P,B,z,W,K){Vl(v,_,B,1,8,z,W,K),Vl(k,P,B,1,8,z,W,K)}function ie(v,_,k,P,B,z,W,K){Vl(v,_,1,B,8,z,W,K),Vl(k,P,1,B,8,z,W,K)}function ce(v,_,k,P,B,z,W,K){Gl(v,_+4*B,B,1,8,z,W,K),Gl(k,P+4*B,B,1,8,z,W,K)}function ve(v,_,k,P,B,z,W,K){Gl(v,_+4,1,B,8,z,W,K),Gl(k,P+4,1,B,8,z,W,K)}function Ne(){this.ba=new Ft,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ln,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Pe(){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 tt(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function ut(){this.ua=0,this.Wa=new it,this.vb=new it,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new le,this.yc=new J}function kt(){this.xb=this.a=0,this.l=new Mp,this.ca=new Ft,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new G,this.Pb=0,this.wd=new G,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new ut,this.ab=0,this.gc=a(4,tt),this.Oc=0}function Bt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Mp,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function sn(v,_,k,P,B,z,W){for(v=v==null?0:v[_+0],_=0;_<W;++_)B[z+_]=v+k[P+_]&255,v=B[z+_]}function Xn(v,_,k,P,B,z,W){var K;if(v==null)sn(null,null,k,P,B,z,W);else for(K=0;K<W;++K)B[z+K]=v[_+K]+k[P+K]&255}function Nr(v,_,k,P,B,z,W){if(v==null)sn(null,null,k,P,B,z,W);else{var K,Z=v[_+0],ne=Z,de=Z;for(K=0;K<W;++K)ne=de+(Z=v[_+K])-ne,de=k[P+K]+(-256&ne?0>ne?0:255:ne)&255,ne=Z,B[z+K]=de}}function Pn(v,_,k,P){var B=_.width,z=_.o;if(e(v!=null&&_!=null),0>k||0>=P||k+P>z)return null;if(!v.Cc){if(v.ga==null){var W;if(v.ga=new Bt,(W=v.ga==null)||(W=_.width*_.o,e(v.Gb.length==0),v.Gb=s(W),v.Uc=0,v.Gb==null?W=0:(v.mb=v.Gb,v.nb=v.Uc,v.rc=null,W=1),W=!W),!W){W=v.ga;var K=v.Fa,Z=v.P,ne=v.qc,de=v.mb,xe=v.nb,re=Z+1,fe=ne-1,be=W.l;if(e(K!=null&&de!=null&&_!=null),bu[0]=null,bu[1]=sn,bu[2]=Xn,bu[3]=Nr,W.ca=de,W.tb=xe,W.c=_.width,W.i=_.height,e(0<W.c&&0<W.i),1>=ne)_=0;else if(W.$a=3&K[Z+0],W.Z=K[Z+0]>>2&3,W.Lc=K[Z+0]>>4&3,Z=K[Z+0]>>6&3,0>W.$a||1<W.$a||4<=W.Z||1<W.Lc||Z)_=0;else if(be.put=nt,be.ac=sr,be.bc=Kr,be.ma=W,be.width=_.width,be.height=_.height,be.Da=_.Da,be.v=_.v,be.va=_.va,be.j=_.j,be.o=_.o,W.$a)e:{e(W.$a==1),_=ah();t:for(;;){if(_==null){_=0;break e}if(e(W!=null),W.mc=_,_.c=W.c,_.i=W.i,_.l=W.l,_.l.ma=W,_.l.width=W.c,_.l.height=W.i,_.a=0,te(_.m,K,re,fe),!qo(W.c,W.i,1,_,null)||(_.ab==1&&_.gc[0].hc==3&&qa(_.s)?(W.ic=1,K=_.c*_.i,_.Ta=null,_.Ua=0,_.V=s(K),_.Ba=0,_.V==null?(_.a=1,_=0):_=1):(W.ic=0,_=oh(_,W.c)),!_))break t;_=1;break e}W.mc=null,_=0}else _=fe>=W.c*W.i;W=!_}if(W)return null;v.ga.Lc!=1?v.Ga=0:P=z-k}e(v.ga!=null),e(k+P<=z);e:{if(_=(K=v.ga).c,z=K.l.o,K.$a==0){if(re=v.rc,fe=v.Vc,be=v.Fa,Z=v.P+1+k*_,ne=v.mb,de=v.nb+k*_,e(Z<=v.P+v.qc),K.Z!=0)for(e(bu[K.Z]!=null),W=0;W<P;++W)bu[K.Z](re,fe,be,Z,ne,de,_),re=ne,fe=de,de+=_,Z+=_;else for(W=0;W<P;++W)r(ne,de,be,Z,_),re=ne,fe=de,de+=_,Z+=_;v.rc=re,v.Vc=fe}else{if(e(K.mc!=null),_=k+P,e((W=K.mc)!=null),e(_<=W.i),W.C>=_)_=1;else if(K.ic||Ga(),K.ic){K=W.V,re=W.Ba,fe=W.c;var Se=W.i,we=(be=1,Z=W.$/fe,ne=W.$%fe,de=W.m,xe=W.s,W.$),Ae=fe*Se,ke=fe*_,Le=xe.wc,je=we<ke?ui(xe,ne,Z):null;e(we<=Ae),e(_<=Se),e(qa(xe));t:for(;;){for(;!de.h&&we<ke;){if(ne&Le||(je=ui(xe,ne,Z)),e(je!=null),Q(de),256>(Se=ar(je.G[0],je.H[0],de)))K[re+we]=Se,++we,++ne>=fe&&(ne=0,++Z<=_&&!(Z%16)&&Ha(W,Z));else{if(!(280>Se)){be=0;break t}Se=Wn(Se-256,de);var ht,Ke=ar(je.G[4],je.H[4],de);if(Q(de),!(we>=(Ke=pr(fe,Ke=Wn(Ke,de)))&&Ae-we>=Se)){be=0;break t}for(ht=0;ht<Se;++ht)K[re+we+ht]=K[re+we+ht-Ke];for(we+=Se,ne+=Se;ne>=fe;)ne-=fe,++Z<=_&&!(Z%16)&&Ha(W,Z);we<ke&&ne&Le&&(je=ui(xe,ne,Z))}e(de.h==ae(de))}Ha(W,Z>_?_:Z);break t}!be||de.h&&we<Ae?(be=0,W.a=de.h?5:3):W.$=we,_=be}else _=Wa(W,W.V,W.Ba,W.c,W.i,_,Lp);if(!_){P=0;break e}}k+P>=z&&(v.Cc=1),P=1}if(!P)return null;if(v.Cc&&((P=v.ga)!=null&&(P.mc=null),v.ga=null,0<v.Ga))return alert("todo:WebPDequantizeLevels"),null}return v.nb+k*B}function Or(v,_,k,P,B,z){for(;0<B--;){var W,K=v,Z=_+(k?1:0),ne=v,de=_+(k?0:3);for(W=0;W<P;++W){var xe=ne[de+4*W];xe!=255&&(xe*=32897,K[Z+4*W+0]=K[Z+4*W+0]*xe>>23,K[Z+4*W+1]=K[Z+4*W+1]*xe>>23,K[Z+4*W+2]=K[Z+4*W+2]*xe>>23)}_+=z}}function kr(v,_,k,P,B){for(;0<P--;){var z;for(z=0;z<k;++z){var W=v[_+2*z+0],K=15&(ne=v[_+2*z+1]),Z=4369*K,ne=(240&ne|ne>>4)*Z>>16;v[_+2*z+0]=(240&W|W>>4)*Z>>16&240|(15&W|W<<4)*Z>>16>>4&15,v[_+2*z+1]=240&ne|K}_+=B}}function di(v,_,k,P,B,z,W,K){var Z,ne,de=255;for(ne=0;ne<B;++ne){for(Z=0;Z<P;++Z){var xe=v[_+Z];z[W+4*Z]=xe,de&=xe}_+=k,W+=K}return de!=255}function Kl(v,_,k,P,B){var z;for(z=0;z<B;++z)k[P+z]=v[_+z]>>8}function Ga(){fv=Or,MP=kr,DP=di,FP=Kl}function Yl(v,_,k){L[v]=function(P,B,z,W,K,Z,ne,de,xe,re,fe,be,Se,we,Ae,ke,Le){var je,ht=Le-1>>1,Ke=K[Z+0]|ne[de+0]<<16,Ut=xe[re+0]|fe[be+0]<<16;e(P!=null);var st=3*Ke+Ut+131074>>2;for(_(P[B+0],255&st,st>>16,Se,we),z!=null&&(st=3*Ut+Ke+131074>>2,_(z[W+0],255&st,st>>16,Ae,ke)),je=1;je<=ht;++je){var Zt=K[Z+je]|ne[de+je]<<16,Dr=xe[re+je]|fe[be+je]<<16,zt=Ke+Zt+Ut+Dr+524296,at=zt+2*(Zt+Ut)>>3;st=at+Ke>>1,Ke=(zt=zt+2*(Ke+Dr)>>3)+Zt>>1,_(P[B+2*je-1],255&st,st>>16,Se,we+(2*je-1)*k),_(P[B+2*je-0],255&Ke,Ke>>16,Se,we+(2*je-0)*k),z!=null&&(st=zt+Ut>>1,Ke=at+Dr>>1,_(z[W+2*je-1],255&st,st>>16,Ae,ke+(2*je-1)*k),_(z[W+2*je+0],255&Ke,Ke>>16,Ae,ke+(2*je+0)*k)),Ke=Zt,Ut=Dr}1&Le||(st=3*Ke+Ut+131074>>2,_(P[B+Le-1],255&st,st>>16,Se,we+(Le-1)*k),z!=null&&(st=3*Ut+Ke+131074>>2,_(z[W+Le-1],255&st,st>>16,Ae,ke+(Le-1)*k)))}}function nv(){ga[_w]=Hq,ga[Sw]=YP,ga[HP]=Wq,ga[Aw]=XP,ga[Ew]=JP,ga[US]=QP,ga[WP]=Vq,ga[zS]=YP,ga[qS]=XP,ga[Nw]=JP,ga[HS]=QP}function Up(v){return v&~Gq?0>v?0:255:v>>ZP}function cu(v,_){return Up((19077*v>>8)+(26149*_>>8)-14234)}function fh(v,_,k){return Up((19077*v>>8)-(6419*_>>8)-(13320*k>>8)+8708)}function ph(v,_){return Up((19077*v>>8)+(33050*_>>8)-17685)}function uu(v,_,k,P,B){P[B+0]=cu(v,k),P[B+1]=fh(v,_,k),P[B+2]=ph(v,_)}function hi(v,_,k,P,B){P[B+0]=ph(v,_),P[B+1]=fh(v,_,k),P[B+2]=cu(v,k)}function mh(v,_,k,P,B){var z=fh(v,_,k);_=z<<3&224|ph(v,_)>>3,P[B+0]=248&cu(v,k)|z>>5,P[B+1]=_}function gh(v,_,k,P,B){var z=240&ph(v,_)|15;P[B+0]=240&cu(v,k)|fh(v,_,k)>>4,P[B+1]=z}function rv(v,_,k,P,B){P[B+0]=255,uu(v,_,k,P,B+1)}function iv(v,_,k,P,B){hi(v,_,k,P,B),P[B+3]=255}function Vi(v,_,k,P,B){uu(v,_,k,P,B),P[B+3]=255}function Xl(v,_,k){L[v]=function(P,B,z,W,K,Z,ne,de,xe){for(var re=de+(-2&xe)*k;de!=re;)_(P[B+0],z[W+0],K[Z+0],ne,de),_(P[B+1],z[W+0],K[Z+0],ne,de+k),B+=2,++W,++Z,de+=2*k;1&xe&&_(P[B+0],z[W+0],K[Z+0],ne,de)}}function zp(v,_,k){return k==0?v==0?_==0?6:5:_==0?4:0:k}function yw(v,_,k,P,B){switch(v>>>30){case 3:wh(_,k,P,B,0);break;case 2:pa(_,k,P,B);break;case 1:hn(_,k,P,B)}}function fa(v,_){var k,P,B=_.M,z=_.Nb,W=v.oc,K=v.pc+40,Z=v.oc,ne=v.pc+584,de=v.oc,xe=v.pc+600;for(k=0;16>k;++k)W[K+32*k-1]=129;for(k=0;8>k;++k)Z[ne+32*k-1]=129,de[xe+32*k-1]=129;for(0<B?W[K-1-32]=Z[ne-1-32]=de[xe-1-32]=129:(i(W,K-32-1,127,21),i(Z,ne-32-1,127,9),i(de,xe-32-1,127,9)),P=0;P<v.za;++P){var re=_.ya[_.aa+P];if(0<P){for(k=-1;16>k;++k)r(W,K+32*k-4,W,K+32*k+12,4);for(k=-1;8>k;++k)r(Z,ne+32*k-4,Z,ne+32*k+4,4),r(de,xe+32*k-4,de,xe+32*k+4,4)}var fe=v.Gd,be=v.Hd+P,Se=re.ad,we=re.Hc;if(0<B&&(r(W,K-32,fe[be].y,0,16),r(Z,ne-32,fe[be].f,0,8),r(de,xe-32,fe[be].ea,0,8)),re.Za){var Ae=W,ke=K-32+16;for(0<B&&(P>=v.za-1?i(Ae,ke,fe[be].y[15],4):r(Ae,ke,fe[be+1].y,0,4)),k=0;4>k;k++)Ae[ke+128+k]=Ae[ke+256+k]=Ae[ke+384+k]=Ae[ke+0+k];for(k=0;16>k;++k,we<<=2)Ae=W,ke=K+t3[k],Ka[re.Ob[k]](Ae,ke),yw(we,Se,16*+k,Ae,ke)}else if(Ae=zp(P,B,re.Ob[0]),yu[Ae](W,K),we!=0)for(k=0;16>k;++k,we<<=2)yw(we,Se,16*+k,W,K+t3[k]);for(k=re.Gc,Ae=zp(P,B,re.Dd),Zl[Ae](Z,ne),Zl[Ae](de,xe),we=Se,Ae=Z,ke=ne,255&(re=0|k)&&(170&re?Yo(we,256,Ae,ke):En(we,256,Ae,ke)),re=de,we=xe,255&(k>>=8)&&(170&k?Yo(Se,320,re,we):En(Se,320,re,we)),B<v.Ub-1&&(r(fe[be].y,0,W,K+480,16),r(fe[be].f,0,Z,ne+224,8),r(fe[be].ea,0,de,xe+224,8)),k=8*z*v.B,fe=v.sa,be=v.ta+16*P+16*z*v.R,Se=v.qa,re=v.ra+8*P+k,we=v.Ha,Ae=v.Ia+8*P+k,k=0;16>k;++k)r(fe,be+k*v.R,W,K+32*k,16);for(k=0;8>k;++k)r(Se,re+k*v.B,Z,ne+32*k,8),r(we,Ae+k*v.B,de,xe+32*k,8)}}function vh(v,_,k,P,B,z,W,K,Z){var ne=[0],de=[0],xe=0,re=Z!=null?Z.kd:0,fe=Z??new Pe;if(v==null||12>k)return 7;fe.data=v,fe.w=_,fe.ha=k,_=[_],k=[k],fe.gb=[fe.gb];e:{var be=_,Se=k,we=fe.gb;if(e(v!=null),e(Se!=null),e(we!=null),we[0]=0,12<=Se[0]&&!t(v,be[0],"RIFF")){if(t(v,be[0]+8,"WEBP")){we=3;break e}var Ae=Re(v,be[0]+4);if(12>Ae||4294967286<Ae){we=3;break e}if(re&&Ae>Se[0]-8){we=7;break e}we[0]=Ae,be[0]+=12,Se[0]-=12}we=0}if(we!=0)return we;for(Ae=0<fe.gb[0],k=k[0];;){e:{var ke=v;Se=_,we=k;var Le=ne,je=de,ht=be=[0];if((st=xe=[xe])[0]=0,8>we[0])we=7;else{if(!t(ke,Se[0],"VP8X")){if(Re(ke,Se[0]+4)!=10){we=3;break e}if(18>we[0]){we=7;break e}var Ke=Re(ke,Se[0]+8),Ut=1+ye(ke,Se[0]+12);if(2147483648<=Ut*(ke=1+ye(ke,Se[0]+15))){we=3;break e}ht!=null&&(ht[0]=Ke),Le!=null&&(Le[0]=Ut),je!=null&&(je[0]=ke),Se[0]+=18,we[0]-=18,st[0]=1}we=0}}if(xe=xe[0],be=be[0],we!=0)return we;if(Se=!!(2&be),!Ae&&xe)return 3;if(z!=null&&(z[0]=!!(16&be)),W!=null&&(W[0]=Se),K!=null&&(K[0]=0),W=ne[0],be=de[0],xe&&Se&&Z==null){we=0;break}if(4>k){we=7;break}if(Ae&&xe||!Ae&&!xe&&!t(v,_[0],"ALPH")){k=[k],fe.na=[fe.na],fe.P=[fe.P],fe.Sa=[fe.Sa];e:{Ke=v,we=_,Ae=k;var st=fe.gb;Le=fe.na,je=fe.P,ht=fe.Sa,Ut=22,e(Ke!=null),e(Ae!=null),ke=we[0];var Zt=Ae[0];for(e(Le!=null),e(ht!=null),Le[0]=null,je[0]=null,ht[0]=0;;){if(we[0]=ke,Ae[0]=Zt,8>Zt){we=7;break e}var Dr=Re(Ke,ke+4);if(4294967286<Dr){we=3;break e}var zt=8+Dr+1&-2;if(Ut+=zt,0<st&&Ut>st){we=3;break e}if(!t(Ke,ke,"VP8 ")||!t(Ke,ke,"VP8L")){we=0;break e}if(Zt[0]<zt){we=7;break e}t(Ke,ke,"ALPH")||(Le[0]=Ke,je[0]=ke+8,ht[0]=Dr),ke+=zt,Zt-=zt}}if(k=k[0],fe.na=fe.na[0],fe.P=fe.P[0],fe.Sa=fe.Sa[0],we!=0)break}k=[k],fe.Ja=[fe.Ja],fe.xa=[fe.xa];e:if(st=v,we=_,Ae=k,Le=fe.gb[0],je=fe.Ja,ht=fe.xa,Ke=we[0],ke=!t(st,Ke,"VP8 "),Ut=!t(st,Ke,"VP8L"),e(st!=null),e(Ae!=null),e(je!=null),e(ht!=null),8>Ae[0])we=7;else{if(ke||Ut){if(st=Re(st,Ke+4),12<=Le&&st>Le-12){we=3;break e}if(re&&st>Ae[0]-8){we=7;break e}je[0]=st,we[0]+=8,Ae[0]-=8,ht[0]=Ut}else ht[0]=5<=Ae[0]&&st[Ke+0]==47&&!(st[Ke+4]>>5),je[0]=Ae[0];we=0}if(k=k[0],fe.Ja=fe.Ja[0],fe.xa=fe.xa[0],_=_[0],we!=0)break;if(4294967286<fe.Ja)return 3;if(K==null||Se||(K[0]=fe.xa?2:1),W=[W],be=[be],fe.xa){if(5>k){we=7;break}K=W,re=be,Se=z,v==null||5>k?v=0:5<=k&&v[_+0]==47&&!(v[_+4]>>5)?(Ae=[0],st=[0],Le=[0],te(je=new G,v,_,k),ci(je,Ae,st,Le)?(K!=null&&(K[0]=Ae[0]),re!=null&&(re[0]=st[0]),Se!=null&&(Se[0]=Le[0]),v=1):v=0):v=0}else{if(10>k){we=7;break}K=be,v==null||10>k||!ow(v,_+3,k-3)?v=0:(re=v[_+0]|v[_+1]<<8|v[_+2]<<16,Se=16383&(v[_+7]<<8|v[_+6]),v=16383&(v[_+9]<<8|v[_+8]),1&re||3<(re>>1&7)||!(re>>4&1)||re>>5>=fe.Ja||!Se||!v?v=0:(W&&(W[0]=Se),K&&(K[0]=v),v=1))}if(!v||(W=W[0],be=be[0],xe&&(ne[0]!=W||de[0]!=be)))return 3;Z!=null&&(Z[0]=fe,Z.offset=_-Z.w,e(4294967286>_-Z.w),e(Z.offset==Z.ha-k));break}return we==0||we==7&&xe&&Z==null?(z!=null&&(z[0]|=fe.na!=null&&0<fe.na.length),P!=null&&(P[0]=W),B!=null&&(B[0]=be),0):we}function sv(v,_,k){var P=_.width,B=_.height,z=0,W=0,K=P,Z=B;if(_.Da=v!=null&&0<v.Da,_.Da&&(K=v.cd,Z=v.bd,z=v.v,W=v.j,11>k||(z&=-2,W&=-2),0>z||0>W||0>=K||0>=Z||z+K>P||W+Z>B))return 0;if(_.v=z,_.j=W,_.va=z+K,_.o=W+Z,_.U=K,_.T=Z,_.da=v!=null&&0<v.da,_.da){if(!He(K,Z,k=[v.ib],z=[v.hb]))return 0;_.ib=k[0],_.hb=z[0]}return _.ob=v!=null&&v.ob,_.Kb=v==null||!v.Sd,_.da&&(_.ob=_.ib<3*P/4&&_.hb<3*B/4,_.Kb=0),1}function av(v){if(v==null)return 2;if(11>v.S){var _=v.f.RGBA;_.fb+=(v.height-1)*_.A,_.A=-_.A}else _=v.f.kb,v=v.height,_.O+=(v-1)*_.fa,_.fa=-_.fa,_.N+=(v-1>>1)*_.Ab,_.Ab=-_.Ab,_.W+=(v-1>>1)*_.Db,_.Db=-_.Db,_.F!=null&&(_.J+=(v-1)*_.lb,_.lb=-_.lb);return 0}function du(v,_,k,P){if(P==null||0>=v||0>=_)return 2;if(k!=null){if(k.Da){var B=k.cd,z=k.bd,W=-2&k.v,K=-2&k.j;if(0>W||0>K||0>=B||0>=z||W+B>v||K+z>_)return 2;v=B,_=z}if(k.da){if(!He(v,_,B=[k.ib],z=[k.hb]))return 2;v=B[0],_=z[0]}}P.width=v,P.height=_;e:{var Z=P.width,ne=P.height;if(v=P.S,0>=Z||0>=ne||!(v>=_w&&13>v))v=2;else{if(0>=P.Rd&&P.sd==null){W=z=B=_=0;var de=(K=Z*n3[v])*ne;if(11>v||(z=(ne+1)/2*(_=(Z+1)/2),v==12&&(W=(B=Z)*ne)),(ne=s(de+2*z+W))==null){v=1;break e}P.sd=ne,11>v?((Z=P.f.RGBA).eb=ne,Z.fb=0,Z.A=K,Z.size=de):((Z=P.f.kb).y=ne,Z.O=0,Z.fa=K,Z.Fd=de,Z.f=ne,Z.N=0+de,Z.Ab=_,Z.Cd=z,Z.ea=ne,Z.W=0+de+z,Z.Db=_,Z.Ed=z,v==12&&(Z.F=ne,Z.J=0+de+2*z),Z.Tc=W,Z.lb=B)}if(_=1,B=P.S,z=P.width,W=P.height,B>=_w&&13>B)if(11>B)v=P.f.RGBA,_&=(K=Math.abs(v.A))*(W-1)+z<=v.size,_&=K>=z*n3[B],_&=v.eb!=null;else{v=P.f.kb,K=(z+1)/2,de=(W+1)/2,Z=Math.abs(v.fa),ne=Math.abs(v.Ab);var xe=Math.abs(v.Db),re=Math.abs(v.lb),fe=re*(W-1)+z;_&=Z*(W-1)+z<=v.Fd,_&=ne*(de-1)+K<=v.Cd,_=(_&=xe*(de-1)+K<=v.Ed)&Z>=z&ne>=K&xe>=K,_&=v.y!=null,_&=v.f!=null,_&=v.ea!=null,B==12&&(_&=re>=z,_&=fe<=v.Tc,_&=v.F!=null)}else _=0;v=_?0:2}}return v!=0||k!=null&&k.fd&&(v=av(P)),v}var yh=64,Ts=[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],Ps=24,hu=32,Jl=8,fu=[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,
vendor: 4,755 bytes, line 613
6136,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];De("Predictor0","PredictorAdd0"),L.Predictor0=function(){return 4278190080},L.Predictor1=function(v){return v},L.Predictor2=function(v,_,k){return _[k+0]},L.Predictor3=function(v,_,k){return _[k+1]},L.Predictor4=function(v,_,k){return _[k-1]},L.Predictor5=function(v,_,k){return ze(ze(v,_[k+1]),_[k+0])},L.Predictor6=function(v,_,k){return ze(v,_[k-1])},L.Predictor7=function(v,_,k){return ze(v,_[k+0])},L.Predictor8=function(v,_,k){return ze(_[k-1],_[k+0])},L.Predictor9=function(v,_,k){return ze(_[k+0],_[k+1])},L.Predictor10=function(v,_,k){return ze(ze(v,_[k-1]),ze(_[k+0],_[k+1]))},L.Predictor11=function(v,_,k){var P=_[k+0];return 0>=dt(P>>24&255,v>>24&255,(_=_[k-1])>>24&255)+dt(P>>16&255,v>>16&255,_>>16&255)+dt(P>>8&255,v>>8&255,_>>8&255)+dt(255&P,255&v,255&_)?P:v},L.Predictor12=function(v,_,k){var P=_[k+0];return(Vt((v>>24&255)+(P>>24&255)-((_=_[k-1])>>24&255))<<24|Vt((v>>16&255)+(P>>16&255)-(_>>16&255))<<16|Vt((v>>8&255)+(P>>8&255)-(_>>8&255))<<8|Vt((255&v)+(255&P)-(255&_)))>>>0},L.Predictor13=function(v,_,k){var P=_[k-1];return(Ct((v=ze(v,_[k+0]))>>24&255,P>>24&255)<<24|Ct(v>>16&255,P>>16&255)<<16|Ct(v>>8&255,P>>8&255)<<8|Ct(255&v,255&P))>>>0};var ov=L.PredictorAdd0;L.PredictorAdd1=St,De("Predictor2","PredictorAdd2"),De("Predictor3","PredictorAdd3"),De("Predictor4","PredictorAdd4"),De("Predictor5","PredictorAdd5"),De("Predictor6","PredictorAdd6"),De("Predictor7","PredictorAdd7"),De("Predictor8","PredictorAdd8"),De("Predictor9","PredictorAdd9"),De("Predictor10","PredictorAdd10"),De("Predictor11","PredictorAdd11"),De("Predictor12","PredictorAdd12"),De("Predictor13","PredictorAdd13");var qp=L.PredictorAdd2;lt("ColorIndexInverseTransform","MapARGB","32b",function(v){return v>>8&255},function(v){return v}),lt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(v){return v},function(v){return v>>8&255});var mr,bw=L.ColorIndexInverseTransform,Go=L.MapARGB,Ko=L.VP8LColorIndexInverseTransformAlpha,lv=L.MapAlpha,cv=L.VP8LPredictorsAdd=[];cv.length=16,(L.VP8LPredictors=[]).length=16,(L.VP8LPredictorsAdd_C=[]).length=16,(L.VP8LPredictors_C=[]).length=16;var uv,dv,pu,mu,gu,bh,vu,wh,pa,Yo,hn,En,gr,Mr,Ql,hv,Hp,ww,PP,jP,RP,LP,IP,OP,fv,MP,DP,FP,BP=s(511),$P=s(2041),UP=s(225),zP=s(767),qP=0,$S=$P,xw=UP,js=zP,ma=BP,_w=0,Sw=1,HP=2,Aw=3,Ew=4,US=5,WP=6,zS=7,qS=8,Nw=9,HS=10,Pq=[2,3,7],jq=[3,3,11],VP=[280,256,256,256,40],Rq=[0,1,1,1,0],Lq=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Iq=[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],Oq=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Mq=8,WS=[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],VS=[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],pv=null,Dq=[[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]],Fq=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],GP=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Bq=[[[[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,25
6135,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]]]],$q=[[[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,25
6135,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]]],Uq=[[[[255,255,255,255,255,255,255,255,255,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,25
vendor: 21,640 bytes, line 613
6135,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]]]],zq=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],yu=[],Ka=[],Zl=[],qq=1,KP=2,bu=[],ga=[];Yl("UpsampleRgbLinePair",uu,3),Yl("UpsampleBgrLinePair",hi,3),Yl("UpsampleRgbaLinePair",Vi,4),Yl("UpsampleBgraLinePair",iv,4),Yl("UpsampleArgbLinePair",rv,4),Yl("UpsampleRgba4444LinePair",gh,2),Yl("UpsampleRgb565LinePair",mh,2);var Hq=L.UpsampleRgbLinePair,Wq=L.UpsampleBgrLinePair,YP=L.UpsampleRgbaLinePair,XP=L.UpsampleBgraLinePair,JP=L.UpsampleArgbLinePair,QP=L.UpsampleRgba4444LinePair,Vq=L.UpsampleRgb565LinePair,kw=16,Cw=1<<kw-1,mv=-227,GS=482,ZP=6,Gq=(256<<ZP)-1,e3=0,Kq=s(256),Yq=s(256),Xq=s(256),Jq=s(256),Qq=s(GS-mv),Zq=s(GS-mv);Xl("YuvToRgbRow",uu,3),Xl("YuvToBgrRow",hi,3),Xl("YuvToRgbaRow",Vi,4),Xl("YuvToBgraRow",iv,4),Xl("YuvToArgbRow",rv,4),Xl("YuvToRgba4444Row",gh,2),Xl("YuvToRgb565Row",mh,2);var t3=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Tw=[0,2,8],eH=[8,7,6,4,4,2,2,2,1,1,1,1],tH=1;this.WebPDecodeRGBA=function(v,_,k,P,B){var z=Sw,W=new Ne,K=new Ft;W.ba=K,K.S=z,K.width=[K.width],K.height=[K.height];var Z=K.width,ne=K.height,de=new ct;if(de==null||v==null)var xe=2;else e(de!=null),xe=vh(v,_,k,de.width,de.height,de.Pd,de.Qd,de.format,null);if(xe!=0?Z=0:(Z!=null&&(Z[0]=de.width[0]),ne!=null&&(ne[0]=de.height[0]),Z=1),Z){K.width=K.width[0],K.height=K.height[0],P!=null&&(P[0]=K.width),B!=null&&(B[0]=K.height);e:{if(P=new Mp,(B=new Pe).data=v,B.w=_,B.ha=k,B.kd=1,_=[0],e(B!=null),((v=vh(B.data,B.w,B.ha,null,null,null,_,null,B))==0||v==7)&&_[0]&&(v=4),(_=v)==0){if(e(W!=null),P.data=B.data,P.w=B.w+B.offset,P.ha=B.ha-B.offset,P.put=nt,P.ac=sr,P.bc=Kr,P.ma=W,B.xa){if((v=ah())==null){W=1;break e}if(function(re,fe){var be=[0],Se=[0],we=[0];t:for(;;){if(re==null)return 0;if(fe==null)return re.a=2,0;if(re.l=fe,re.a=0,te(re.m,fe.data,fe.w,fe.ha),!ci(re.m,be,Se,we)){re.a=3;break t}if(re.xb=KP,fe.width=be[0],fe.height=Se[0],!qo(be[0],Se[0],1,re,null))break t;return 1}return e(re.a!=0),0}(v,P)){if(P=(_=du(P.width,P.height,W.Oa,W.ba))==0){t:{P=v;n:for(;;){if(P==null){P=0;break t}if(e(P.s.yc!=null),e(P.s.Ya!=null),e(0<P.s.Wb),e((k=P.l)!=null),e((B=k.ma)!=null),P.xb!=0){if(P.ca=B.ba,P.tb=B.tb,e(P.ca!=null),!sv(B.Oa,k,Aw)){P.a=2;break n}if(!oh(P,k.width)||k.da)break n;if((k.da||bt(P.ca.S))&&Ga(),11>P.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),P.ca.f.kb.F!=null&&Ga()),P.Pb&&0<P.s.ua&&P.s.vb.X==null&&!Y(P.s.vb,P.s.Wa.Xa)){P.a=1;break n}P.xb=0}if(!Wa(P,P.V,P.Ba,P.c,P.i,k.o,lu))break n;B.Dc=P.Ma,P=1;break t}e(P.a!=0),P=0}P=!P}P&&(_=v.a)}else _=v.a}else{if((v=new ES)==null){W=1;break e}if(v.Fa=B.na,v.P=B.P,v.qc=B.Sa,Wo(v,P)){if((_=du(P.width,P.height,W.Oa,W.ba))==0){if(v.Aa=0,k=W.Oa,e((B=v)!=null),k!=null){if(0<(Z=0>(Z=k.Md)?0:100<Z?255:255*Z/100)){for(ne=de=0;4>ne;++ne)12>(xe=B.pb[ne]).lc&&(xe.ia=Z*eH[0>xe.lc?0:xe.lc]>>3),de|=xe.ia;de&&(alert("todo:VP8InitRandom"),B.ia=1)}B.Ga=k.Id,100<B.Ga?B.Ga=100:0>B.Ga&&(B.Ga=0)}(function(re,fe){if(re==null)return 0;if(fe==null)return Er(re,2,"NULL VP8Io parameter in VP8Decode().");if(!re.cb&&!Wo(re,fe))return 0;if(e(re.cb),fe.ac==null||fe.ac(fe)){fe.ob&&(re.L=0);var be=Tw[re.L];if(re.L==2?(re.yb=0,re.zb=0):(re.yb=fe.v-be>>4,re.zb=fe.j-be>>4,0>re.yb&&(re.yb=0),0>re.zb&&(re.zb=0)),re.Va=fe.o+15+be>>4,re.Hb=fe.va+15+be>>4,re.Hb>re.za&&(re.Hb=re.za),re.Va>re.Ub&&(re.Va=re.Ub),0<re.L){var Se=re.ed;for(be=0;4>be;++be){var we;if(re.Qa.Cb){var Ae=re.Qa.Lb[be];re.Qa.Fb||(Ae+=Se.Tb)}else Ae=Se.Tb;for(we=0;1>=we;++we){var ke=re.gd[be][we],Le=Ae;if(Se.Pc&&(Le+=Se.vd[0],we&&(Le+=Se.od[0])),0<(Le=0>Le?0:63<Le?63:Le)){var je=Le;0<Se.wb&&(je=4<Se.wb?je>>2:je>>1)>9-Se.wb&&(je=9-Se.wb),1>je&&(je=1),ke.dd=je,ke.tc=2*Le+je,ke.ld=40<=Le?2:15<=Le?1:0}else ke.tc=0;ke.La=we}}}be=0}else Er(re,6,"Frame setup failed"),be=re.a;if(be=be==0){if(be){re.$c=0,0<re.Aa||(re.Ic=tH);t:{be=re.Ic,Se=4*(je=re.za);var ht=32*je,Ke=je+1,Ut=0<re.L?je*(0<re.Aa?2:1):0,st=(re.Aa==2?2:1)*je;if((ke=Se+832+(we=3*(16*be+Tw[re.L])/2*ht)+(Ae=re.Fa!=null&&0<re.Fa.length?re.Kc.c*re.Kc.i:0))!=ke)be=0;else{if(ke>re.Vb){if(re.Vb=0,re.Ec=s(ke),re.Fc=0,re.Ec==null){be=Er(re,1,"no memory during frame initialization.");break t}re.Vb=ke}ke=re.Ec,Le=re.Fc,re.Ac=ke,re.Bc=Le,Le+=Se,re.Gd=a(ht,sw),re.Hd=0,re.rb=a(Ke+1,V0),re.sb=1,re.wa=Ut?a(Ut,da):null,re.Y=0,re.D.Nb=0,re.D.wa=re.wa,re.D.Y=re.Y,0<re.Aa&&(re.D.Y+=je),e(!0),re.oc=ke,re.pc=Le,Le+=832,re.ya=a(st,G0),re.aa=0,re.D.ya=re.ya,re.D.aa=re.aa,re.Aa==2&&(re.D.aa+=je),re.R=16*je,re.B=8*je,je=(ht=Tw[re.L])*re.R,ht=ht/2*re.B,re.sa=ke,re.ta=Le+je,re.qa=re.sa,re.ra=re.ta+16*be*re.R+ht,re.Ha=re.qa,re.Ia=re.ra+8*be*re.B+ht,re.$c=0,Le+=we,re.mb=Ae?ke:null,re.nb=Ae?Le:null,e(Le+Ae<=re.Fc+re.Vb),lw(re),i(re.Ac,re.Bc,0,Se),be=1}}if(be){if(fe.ka=0,fe.y=re.sa,fe.O=re.ta,fe.f=re.qa,fe.N=re.ra,fe.ea=re.Ha,fe.Vd=re.Ia,fe.fa=re.R,fe.Rc=re.B,fe.F=null,fe.J=0,!qP){for(be=-255;255>=be;++be)BP[255+be]=0>be?-be:be;for(be=-1020;1020>=be;++be)$P[1020+be]=-128>be?-128:127<be?127:be;for(be=-112;112>=be;++be)UP[112+be]=-16>be?-16:15<be?15:be;for(be=-255;510>=be;++be)zP[255+be]=0>be?0:255<be?255:be;qP=1}vu=Fp,wh=kS,Yo=Vo,hn=uw,En=dw,pa=NS,gr=gw,Mr=hh,Ql=F,hv=ie,Hp=vw,ww=N,PP=ce,jP=ve,RP=dh,LP=tv,IP=pw,OP=mw,Ka[0]=OS,Ka[1]=CS,Ka[2]=LS,Ka[3]=IS,Ka[4]=zl,Ka[5]=MS,Ka[6]=ql,Ka[7]=DS,Ka[8]=X0,Ka[9]=Bp,yu[0]=jS,yu[1]=PS,yu[2]=K0,yu[3]=hw,yu[4]=ch,yu[5]=Y0,yu[6]=RS,Zl[0]=BS,Zl[1]=TS,Zl[2]=uh,Zl[3]=FS,Zl[4]=Q0,Zl[5]=J0,Zl[6]=fw,be=1}else be=0}be&&(be=function(Zt,Dr){for(Zt.M=0;Zt.M<Zt.Va;++Zt.M){var zt,at=Zt.Jc[Zt.M&Zt.Xb],Fe=Zt.m,vr=Zt;for(zt=0;zt<vr.za;++zt){var Mt=Fe,rn=vr,Dn=rn.Ac,fi=rn.Bc+4*zt,Gi=rn.zc,or=rn.ya[rn.aa+zt];if(rn.Qa.Bb?or.$b=me(Mt,rn.Pa.jb[0])?2+me(Mt,rn.Pa.jb[2]):me(Mt,rn.Pa.jb[1]):or.$b=0,rn.kc&&(or.Ad=me(Mt,rn.Bd)),or.Za=!me(Mt,145)+0,or.Za){var ki=or.Ob,Ki=0;for(rn=0;4>rn;++rn){var Fr,an=Gi[0+rn];for(Fr=0;4>Fr;++Fr){an=$q[Dn[fi+Fr]][an];for(var pn=GP[me(Mt,an[0])];0<pn;)pn=GP[2*pn+me(Mt,an[pn])];an=-pn,Dn[fi+Fr]=an}r(ki,Ki,Dn,fi,4),Ki+=4,Gi[0+rn]=an}}else an=me(Mt,156)?me(Mt,128)?1:3:me(Mt,163)?2:0,or.Ob[0]=an,i(Dn,fi,an,4),i(Gi,0,an,4);or.Dd=me(Mt,142)?me(Mt,114)?me(Mt,183)?1:3:2:0}if(vr.m.Ka)return Er(Zt,7,"Premature end-of-partition0 encountered.");for(;Zt.ja<Zt.za;++Zt.ja){if(vr=at,Mt=(Fe=Zt).rb[Fe.sb-1],Dn=Fe.rb[Fe.sb+Fe.ja],zt=Fe.ya[Fe.aa+Fe.ja],fi=Fe.kc?zt.Ad:0)Mt.la=Dn.la=0,zt.Za||(Mt.Na=Dn.Na=0),zt.Hc=0,zt.Gc=0,zt.ia=0;else{var lr,mn;if(Mt=Dn,Dn=vr,fi=Fe.Pa.Xc,Gi=Fe.ya[Fe.aa+Fe.ja],or=Fe.pb[Gi.$b],rn=Gi.ad,ki=0,Ki=Fe.rb[Fe.sb-1],an=Fr=0,i(rn,ki,0,384),Gi.Za)var pi=0,Ya=fi[3];else{pn=s(16);var yr=Mt.Na+Ki.Na;if(yr=pv(Dn,fi[1],yr,or.Eb,0,pn,0),Mt.Na=Ki.Na=(0<yr)+0,1<yr)vu(pn,0,rn,ki);else{var us=pn[0]+3>>3;for(pn=0;256>pn;pn+=16)rn[ki+pn]=us}pi=1,Ya=fi[0]}var Nn=15&Mt.la,Br=15&Ki.la;for(pn=0;4>pn;++pn){var Rs=1&Br;for(us=mn=0;4>us;++us)Nn=Nn>>1|(Rs=(yr=pv(Dn,Ya,yr=Rs+(1&Nn),or.Sc,pi,rn,ki))>pi)<<7,mn=mn<<2|(3<yr?3:1<yr?2:rn[ki+0]!=0),ki+=16;Nn>>=4,Br=Br>>1|Rs<<7,Fr=(Fr<<8|mn)>>>0}for(Ya=Nn,pi=Br>>4,lr=0;4>lr;lr+=2){for(mn=0,Nn=Mt.la>>4+lr,Br=Ki.la>>4+lr,pn=0;2>pn;++pn){for(Rs=1&Br,us=0;2>us;++us)yr=Rs+(1&Nn),Nn=Nn>>1|(Rs=0<(yr=pv(Dn,fi[2],yr,or.Qc,0,rn,ki)))<<3,mn=mn<<2|(3<yr?3:1<yr?2:rn[ki+0]!=0),ki+=16;Nn>>=2,Br=Br>>1|Rs<<5}an|=mn<<4*lr,Ya|=Nn<<4<<lr,pi|=(240&Br)<<lr}Mt.la=Ya,Ki.la=pi,Gi.Hc=Fr,Gi.Gc=an,Gi.ia=43690&an?0:or.ia,fi=!(Fr|an)}if(0<Fe.L&&(Fe.wa[Fe.Y+Fe.ja]=Fe.gd[zt.$b][zt.Za],Fe.wa[Fe.Y+Fe.ja].La|=!fi),vr.Ka)return Er(Zt,7,"Premature end-of-file encountered.")}if(lw(Zt),Fe=Dr,vr=1,zt=(at=Zt).D,Mt=0<at.L&&at.M>=at.zb&&at.M<=at.Va,at.Aa==0)t:{if(zt.M=at.M,zt.uc=Mt,fa(at,zt),vr=1,zt=(mn=at.D).Nb,Mt=(an=Tw[at.L])*at.R,Dn=an/2*at.B,pn=16*zt*at.R,us=8*zt*at.B,fi=at.sa,Gi=at.ta-Mt+pn,or=at.qa,rn=at.ra-Dn+us,ki=at.Ha,Ki=at.Ia-Dn+us,Br=(Nn=mn.M)==0,Fr=Nn>=at.Va-1,at.Aa==2&&fa(at,mn),mn.uc)for(Rs=(yr=at).D.M,e(yr.D.uc),mn=yr.yb;mn<yr.Hb;++mn){pi=mn,Ya=Rs;var Yi=(Ls=(mi=yr).D).Nb;lr=mi.R;var Ls=Ls.wa[Ls.Y+pi],Is=mi.sa,ds=mi.ta+16*Yi*lr+16*pi,Os=Ls.dd,jn=Ls.tc;if(jn!=0)if(e(3<=jn),mi.L==1)0<pi&&LP(Is,ds,lr,jn+4),Ls.La&&OP(Is,ds,lr,jn),0<Ya&&RP(Is,ds,lr,jn+4),Ls.La&&IP(Is,ds,lr,jn);else{var Ms=mi.B,Xa=mi.qa,xh=mi.ra+8*Yi*Ms+8*pi,ec=mi.Ha,mi=mi.Ia+8*Yi*Ms+8*pi;Yi=Ls.ld,0<pi&&(Mr(Is,ds,lr,jn+4,Os,Yi),hv(Xa,xh,ec,mi,Ms,jn+4,Os,Yi)),Ls.La&&(ww(Is,ds,lr,jn,Os,Yi),jP(Xa,xh,ec,mi,Ms,jn,Os,Yi)),0<Ya&&(gr(Is,ds,lr,jn+4,Os,Yi),Ql(Xa,xh,ec,mi,Ms,jn+4,Os,Yi)),Ls.La&&(Hp(Is,ds,lr,jn,Os,Yi),PP(Xa,xh,ec,mi,Ms,jn,Os,Yi))}}if(at.ia&&alert("todo:DitherRow"),Fe.put!=null){if(mn=16*Nn,Nn=16*(Nn+1),Br?(Fe.y=at.sa,Fe.O=at.ta+pn,Fe.f=at.qa,Fe.N=at.ra+us,Fe.ea=at.Ha,Fe.W=at.Ia+us):(mn-=an,Fe.y=fi,Fe.O=Gi,Fe.f=or,Fe.N=rn,Fe.ea=ki,Fe.W=Ki),Fr||(Nn-=an),Nn>Fe.o&&(Nn=Fe.o),Fe.F=null,Fe.J=null,at.Fa!=null&&0<at.Fa.length&&mn<Nn&&(Fe.J=Pn(at,Fe,mn,Nn-mn),Fe.F=at.mb,Fe.F==null&&Fe.F.length==0)){vr=Er(at,3,"Could not decode alpha data.");break t}mn<Fe.j&&(an=Fe.j-mn,mn=Fe.j,e(!(1&an)),Fe.O+=at.R*an,Fe.N+=at.B*(an>>1),Fe.W+=at.B*(an>>1),Fe.F!=null&&(Fe.J+=Fe.width*an)),mn<Nn&&(Fe.O+=Fe.v,Fe.N+=Fe.v>>1,Fe.W+=Fe.v>>1,Fe.F!=null&&(Fe.J+=Fe.v),Fe.ka=mn-Fe.j,Fe.U=Fe.va-Fe.v,Fe.T=Nn-mn,vr=Fe.put(Fe))}zt+1!=at.Ic||Fr||(r(at.sa,at.ta-Mt,fi,Gi+16*at.R,Mt),r(at.qa,at.ra-Dn,or,rn+8*at.B,Dn),r(at.Ha,at.Ia-Dn,ki,Ki+8*at.B,Dn))}if(!vr)return Er(Zt,6,"Output aborted.")}return 1}(re,fe)),fe.bc!=null&&fe.bc(fe),be&=1}return be?(re.cb=0,be):0})(v,P)||(_=v.a)}}else _=v.a}_==0&&W.Oa!=null&&W.Oa.fd&&(_=av(W.ba))}W=_}z=W!=0?null:11>z?K.f.RGBA.eb:K.f.kb.y}else z=null;return z};var n3=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(L,V){for(var j="",$=0;$<4;$++)j+=String.fromCharCode(L[V++]);return j}function u(L,V){return L[V+0]|L[V+1]<<8}function f(L,V){return(L[V+0]|L[V+1]<<8|L[V+2]<<16)>>>0}function p(L,V){return(L[V+0]|L[V+1]<<8|L[V+2]<<16|L[V+3]<<24)>>>0}new l;var h=[0],b=[0],g=[],w=new l,y=n,x=function(L,V){var j={},$=0,J=!1,H=0,le=0;if(j.frames=[],!function(D,G){for(var ee=0;ee<4;ee++)if(D[G+ee]!="RIFF".charCodeAt(ee))return!0;return!1}(L,V)){for(p(L,V+=4),V+=8;V<L.length;){var oe=c(L,V),se=p(L,V+=4);V+=4;var O=se+(1&se);switch(oe){case"VP8 ":case"VP8L":j.frames[$]===void 0&&(j.frames[$]={}),(ge=j.frames[$]).src_off=J?le:V-8,ge.src_size=H+se+8,$++,J&&(J=!1,H=0,le=0);break;case"VP8X":(ge=j.header={}).feature_flags=L[V];var te=V+4;ge.canvas_width=1+f(L,te),te+=3,ge.canvas_height=1+f(L,te),te+=3;break;case"ALPH":J=!0,H=O+8,le=V-8;break;case"ANIM":(ge=j.header).bgcolor=p(L,V),te=V+4,ge.loop_count=u(L,te),te+=2;break;case"ANMF":var he,ge;(ge=j.frames[$]={}).offset_x=2*f(L,V),V+=3,ge.offset_y=2*f(L,V),V+=3,ge.width=1+f(L,V),V+=3,ge.height=1+f(L,V),V+=3,ge.duration=f(L,V),V+=3,he=L[V++],ge.dispose=1&he,ge.blend=he>>1&1}oe!="ANMF"&&(V+=O)}return j}}(y,0);x.response=y,x.rgbaoutput=!0,x.dataurl=!1;var S=x.header?x.header:null,A=x.frames?x.frames:null;if(S){S.loop_counter=S.loop_count,h=[S.canvas_height],b=[S.canvas_width];for(var C=0;C<A.length&&A[C].blend!=0;C++);}var T=A[0],R=w.WebPDecodeRGBA(y,T.src_off,T.src_size,b,h);T.rgba=R,T.imgwidth=b[0],T.imgheight=h[0];for(var I=0;I<b[0]*h[0]*4;I++)g[I]=R[I];return this.width=b,this.height=h,this.data=g,this}(function(n){var e,t,r,i,s,a,o,l,c,u=function(D){return D=D||{},this.isStrokeTransparent=D.isStrokeTransparent||!1,this.strokeOpacity=D.strokeOpacity||1,this.strokeStyle=D.strokeStyle||"#000000",this.fillStyle=D.fillStyle||"#000000",this.isFillTransparent=D.isFillTransparent||!1,this.fillOpacity=D.fillOpacity||1,this.font=D.font||"10px sans-serif",this.textBaseline=D.textBaseline||"alphabetic",this.textAlign=D.textAlign||"left",this.lineWidth=D.lineWidth||1,this.lineJoin=D.lineJoin||"miter",this.lineCap=D.lineCap||"butt",this.path=D.path||[],this.transform=D.transform!==void 0?D.transform.clone():new l,this.globalCompositeOperation=D.globalCompositeOperation||"normal",this.globalAlpha=D.globalAlpha||1,this.clip_path=D.clip_path||[],this.currentPoint=D.currentPoint||new a,this.miterLimit=D.miterLimit||10,this.lastPoint=D.lastPoint||new a,this.lineDashOffset=D.lineDashOffset||0,this.lineDash=D.lineDash||[],this.margin=D.margin||[0,0,0,0],this.prevPageLastElemOffset=D.prevPageLastElemOffset||0,this.ignoreClearRect=typeof D.ignoreClearRect!="boolean"||D.ignoreClearRect,this};n.events.push(["initialized",function(){this.context2d=new f(this),e=this.internal.f2,t=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,a=this.internal.Point,o=this.internal.Rectangle,l=this.internal.Matrix,c=new u}]);var f=function(D){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var G=D;Object.defineProperty(this,"pdf",{get:function(){return G}});var ee=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return ee},set:function(Y){ee=!!Y}});var ae=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ae},set:function(Y){ae=!!Y}});var X=0;Object.defineProperty(this,"posX",{get:function(){return X},set:function(Y){isNaN(Y)||(X=Y)}});var Q=0;Object.defineProperty(this,"posY",{get:function(){return Q},set:function(Y){isNaN(Y)||(Q=Y)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(Y){var Te;typeof Y=="number"?Te=[Y,Y,Y,Y]:((Te=new Array(4))[0]=Y[0],Te[1]=Y.length>=2?Y[1]:Te[0],Te[2]=Y.length>=3?Y[2]:Te[0],Te[3]=Y.length>=4?Y[3]:Te[1]),c.margin=Te}});var ue=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ue},set:function(Y){ue=Y}});var pe=0;Object.defineProperty(this,"lastBreak",{get:function(){return pe},set:function(Y){pe=Y}});var me=[];Object.defineProperty(this,"pageBreaks",{get:function(){return me},set:function(Y){me=Y}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(Y){Y instanceof u&&(c=Y)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(Y){c.path=Y}});var _e=[];Object.defineProperty(this,"ctxStack",{get:function(){return _e},set:function(Y){_e=Y}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Y){var Te;Te=p(Y),this.ctx.fillStyle=Te.style,this.ctx.isFillTransparent=Te.a===0,this.ctx.fillOpacity=Te.a,this.pdf.setFillColor(Te.r,Te.g,Te.b,{a:Te.a}),this.pdf.setTextColor(Te.r,Te.g,Te.b,{a:Te.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Y){var Te=p(Y);this.ctx.strokeStyle=Te.style,this.ctx.isStrokeTransparent=Te.a===0,this.ctx.strokeOpacity=Te.a,Te.a===0?this.pdf.setDrawColor(255,255,255):(Te.a,this.pdf.setDrawColor(Te.r,Te.g,Te.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Y){["butt","round","square"].indexOf(Y)!==-1&&(this.ctx.lineCap=Y,this.pdf.setLineCap(Y))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Y){isNaN(Y)||(this.ctx.lineWidth=Y,this.pdf.setLineWidth(Y))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Y){["bevel","round","miter"].indexOf(Y)!==-1&&(this.ctx.lineJoin=Y,this.pdf.setLineJoin(Y))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Y){isNaN(Y)||(this.ctx.miterLimit=Y,this.pdf.setMiterLimit(Y))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Y){this.ctx.textBaseline=Y}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Y){["right","end","center","left","start"].indexOf(Y)!==-1&&(this.ctx.textAlign=Y)}});var Ee=null,ye=null,Re=null;Object.defineProperty(this,"fontFaces",{get:function(){return Re},set:function(Y){Ee=null,ye=null,Re=Y}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Y){var Te;if(this.ctx.font=Y,(Te=/^\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(Y))!==null){var it=Te[1];Te[2];var He=Te[3],Ce=Te[4];Te[5];var Je=Te[6],De=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ce)[2];Ce=Math.floor(De==="px"?parseFloat(Ce)*this.pdf.internal.scaleFactor:De==="em"?parseFloat(Ce)*this.pdf.getFontSize():parseFloat(Ce)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ce);var Qe=function(lt){var Hn,Yt,Et=[],Dt=lt.trim();if(Dt==="")return PE;if(Dt in jI)return[jI[Dt]];for(;Dt!=="";){switch(Yt=null,Hn=(Dt=LI(Dt)).charAt(0)){case'"':case"'":Yt=khe(Dt.substring(1),Hn);break;default:Yt=Che(Dt)}if(Yt===null||(Et.push(Yt[0]),(Dt=LI(Yt[1]))!==""&&Dt.charAt(0)!==","))return PE;Dt=Dt.replace(/^,/,"")}return Et}(Je);if(this.fontFaces){var ze=function(lt,Hn){var Yt=lt.getFontList(),Et=JSON.stringify(Yt);if(Ee===null||ye!==Et){var Dt=function(cn){var gt=[];return Object.keys(cn).forEach(function(_n){cn[_n].forEach(function(bt){var Nt=null;switch(bt){case"bold":Nt={family:_n,weight:"bold"};break;case"italic":Nt={family:_n,style:"italic"};break;case"bolditalic":Nt={family:_n,weight:"bold",style:"italic"};break;case"":case"normal":Nt={family:_n}}Nt!==null&&(Nt.ref={name:_n,style:bt},gt.push(Nt))})}),gt}(Yt);Ee=function(cn){for(var gt={},_n=0;_n<cn.length;++_n){var bt=TE(cn[_n]),Nt=bt.family,Tn=bt.stretch,Ft=bt.style,ct=bt.weight;gt[Nt]=gt[Nt]||{},gt[Nt][Tn]=gt[Nt][Tn]||{},gt[Nt][Tn][Ft]=gt[Nt][Tn][Ft]||{},gt[Nt][Tn][Ft][ct]=bt}return gt}(Dt.concat(Hn)),ye=Et}return Ee}(this.pdf,this.fontFaces),Vt=Qe.map(function(lt){return{family:lt,stretch:"normal",weight:He,style:it}}),Ct=function(lt,Hn,Yt){for(var Et=(Yt=Yt||{}).defaultFontFamily||"times",Dt=Object.assign({},Nhe,Yt.genericFontFamilies||{}),cn=null,gt=null,_n=0;_n<Hn.length;++_n)if(Dt[(cn=TE(Hn[_n])).family]&&(cn.family=Dt[cn.family]),lt.hasOwnProperty(cn.family)){gt=lt[cn.family];break}if(!(gt=gt||lt[Et]))throw new Error("Could not find a font-family for the rule '"+RI(cn)+"' and default family '"+Et+"'.");if(gt=function(bt,Nt){if(Nt[bt])return Nt[bt];var Tn=XC[bt],Ft=Tn<=XC.normal?-1:1,ct=PI(Nt,C9,Tn,Ft);if(!ct)throw new Error("Could not find a matching font-stretch value for "+bt);return ct}(cn.stretch,gt),gt=function(bt,Nt){if(Nt[bt])return Nt[bt];for(var Tn=k9[bt],Ft=0;Ft<Tn.length;++Ft)if(Nt[Tn[Ft]])return Nt[Tn[Ft]];throw new Error("Could not find a matching font-style for "+bt)}(cn.style,gt),!(gt=function(bt,Nt){if(Nt[bt])return Nt[bt];if(bt===400&&Nt[500])return Nt[500];if(bt===500&&Nt[400])return Nt[400];var Tn=Ehe[bt],Ft=PI(Nt,T9,Tn,bt<400?-1:1);if(!Ft)throw new Error("Could not find a matching font-weight for value "+bt);return Ft}(cn.weight,gt)))throw new Error("Failed to resolve a font for the rule '"+RI(cn)+"'.");return gt}(ze,Vt);this.pdf.setFont(Ct.ref.name,Ct.ref.style)}else{var dt="";(He==="bold"||parseInt(He,10)>=700||it==="bold")&&(dt="bold"),it==="italic"&&(dt+="italic"),dt.length===0&&(dt="normal");for(var St="",Ot={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"},Ve=0;Ve<Qe.length;Ve++){if(this.pdf.internal.getFont(Qe[Ve],dt,{noFallback:!0,disableWarning:!0})!==void 0){St=Qe[Ve];break}if(dt==="bolditalic"&&this.pdf.internal.getFont(Qe[Ve],"bold",{noFallback:!0,disableWarning:!0})!==void 0)St=Qe[Ve],dt="bold";else if(this.pdf.internal.getFont(Qe[Ve],"normal",{noFallback:!0,disableWarning:!0})!==void 0){St=Qe[Ve],dt="normal";break}}if(St===""){for(var wt=0;wt<Qe.length;wt++)if(Ot[Qe[wt]]){St=Ot[Qe[wt]];break}}St=St===""?"Times":St,this.pdf.setFont(St,dt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Y){this.ctx.globalCompositeOperation=Y}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Y){this.ctx.globalAlpha=Y}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Y){this.ctx.lineDashOffset=Y,ge.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Y){this.ctx.lineDash=Y,ge.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Y){this.ctx.ignoreClearRect=!!Y}})};f.prototype.setLineDash=function(D){this.lineDash=D},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){A.call(this,"fill",!1)},f.prototype.stroke=function(){A.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(D,G){if(isNaN(D)||isNaN(G))throw kn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to 
613jsPDF.context2d.moveTo");var ee=this.ctx.transform.applyToPoint(new a(D,G));this.path.push({type:"mt",x:ee.x,y:ee.y}),this.ctx.lastPoint=new a(D,G)},f.prototype.closePath=function(){var D=new a(0,0),G=0;for(G=this.path.length-1;G!==-1;G--)if(this.path[G].type==="begin"&&wn(this.path[G+1])==="object"&&typeof this.path[G+1].x=="number"){D=new a(this.path[G+1].x,this.path[G+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(D.x,D.y)},f.prototype.lineTo=function(D,G){if(isNaN(D)||isNaN(G))throw kn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var ee=this.ctx.transform.applyToPoint(new a(D,G));this.path.push({type:"lt",x:ee.x,y:ee.y}),this.ctx.lastPoint=new a(ee.x,ee.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),A.call(this,null,!0)},f.prototype.quadraticCurveTo=function(D,G,ee,ae){if(isNaN(ee)||isNaN(ae)||isNaN(D)||isNaN(G))throw kn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var X=this.ctx.transform.applyToPoint(new a(ee,ae)),Q=this.ctx.transform.applyToPoint(new a(D,G));this.path.push({type:"qct",x1:Q.x,y1:Q.y,x:X.x,y:X.y}),this.ctx.lastPoint=new a(X.x,X.y)},f.prototype.bezierCurveTo=function(D,G,ee,ae,X,Q){if(isNaN(X)||isNaN(Q)||isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae))throw kn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ue=this.ctx.transform.applyToPoint(new a(X,Q)),pe=this.ctx.transform.applyToPoint(new a(D,G)),me=this.ctx.transform.applyToPoint(new a(ee,ae));this.path.push({type:"bct",x1:pe.x,y1:pe.y,x2:me.x,y2:me.y,x:ue.x,y:ue.y}),this.ctx.lastPoint=new a(ue.x,ue.y)},f.prototype.arc=function(D,G,ee,ae,X,Q){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae)||isNaN(X))throw kn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Q=!!Q,!this.ctx.transform.isIdentity){var ue=this.ctx.transform.applyToPoint(new a(D,G));D=ue.x,G=ue.y;var pe=this.ctx.transform.applyToPoint(new a(0,ee)),me=this.ctx.transform.applyToPoint(new a(0,0));ee=Math.sqrt(Math.pow(pe.x-me.x,2)+Math.pow(pe.y-me.y,2))}Math.abs(X-ae)>=2*Math.PI&&(ae=0,X=2*Math.PI),this.path.push({type:"arc",x:D,y:G,radius:ee,startAngle:ae,endAngle:X,counterclockwise:Q})},f.prototype.arcTo=function(D,G,ee,ae,X){throw new Error("arcTo not implemented.")},f.prototype.rect=function(D,G,ee,ae){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae))throw kn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(D,G),this.lineTo(D+ee,G),this.lineTo(D+ee,G+ae),this.lineTo(D,G+ae),this.lineTo(D,G),this.lineTo(D+ee,G),this.lineTo(D,G)},f.prototype.fillRect=function(D,G,ee,ae){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae))throw kn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var X={};this.lineCap!=="butt"&&(X.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(X.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(D,G,ee,ae),this.fill(),X.hasOwnProperty("lineCap")&&(this.lineCap=X.lineCap),X.hasOwnProperty("lineJoin")&&(this.lineJoin=X.lineJoin)}},f.prototype.strokeRect=function(D,G,ee,ae){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae))throw kn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");b.call(this)||(this.beginPath(),this.rect(D,G,ee,ae),this.stroke())},f.prototype.clearRect=function(D,G,ee,ae){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae))throw kn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(D,G,ee,ae))},f.prototype.save=function(D){D=typeof D!="boolean"||D;for(var G=this.pdf.internal.getCurrentPageInfo().pageNumber,ee=0;ee<this.pdf.internal.getNumberOfPages();ee++)this.pdf.setPage(ee+1),this.pdf.internal.out("q");
vendor: 6,123 bytes, line 613
613if(this.pdf.setPage(G),D){this.ctx.fontSize=this.pdf.internal.getFontSize();var ae=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ae}},f.prototype.restore=function(D){D=typeof D!="boolean"||D;for(var G=this.pdf.internal.getCurrentPageInfo().pageNumber,ee=0;ee<this.pdf.internal.getNumberOfPages();ee++)this.pdf.setPage(ee+1),this.pdf.internal.out("Q");this.pdf.setPage(G),D&&this.ctxStack.length!==0&&(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)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var p=function(D){var G,ee,ae,X;if(D.isCanvasGradient===!0&&(D=D.getColor()),!D)return{r:0,g:0,b:0,a:0,style:D};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(D))G=0,ee=0,ae=0,X=0;else{var Q=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(D);if(Q!==null)G=parseInt(Q[1]),ee=parseInt(Q[2]),ae=parseInt(Q[3]),X=1;else if((Q=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(D))!==null)G=parseInt(Q[1]),ee=parseInt(Q[2]),ae=parseInt(Q[3]),X=parseFloat(Q[4]);else{if(X=1,typeof D=="string"&&D.charAt(0)!=="#"){var ue=new w9(D);D=ue.ok?ue.toHex():"#000000"}D.length===4?(G=D.substring(1,2),G+=G,ee=D.substring(2,3),ee+=ee,ae=D.substring(3,4),ae+=ae):(G=D.substring(1,3),ee=D.substring(3,5),ae=D.substring(5,7)),G=parseInt(G,16),ee=parseInt(ee,16),ae=parseInt(ae,16)}}return{r:G,g:ee,b:ae,a:X,style:D}},h=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},b=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(D,G,ee,ae){if(isNaN(G)||isNaN(ee)||typeof D!="string")throw kn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ae=isNaN(ae)?void 0:ae,!h.call(this)){var X=O(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;$.call(this,{text:D,x:G,y:ee,scale:Q,angle:X,align:this.textAlign,maxWidth:ae})}},f.prototype.strokeText=function(D,G,ee,ae){if(isNaN(G)||isNaN(ee)||typeof D!="string")throw kn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!b.call(this)){ae=isNaN(ae)?void 0:ae;var X=O(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;$.call(this,{text:D,x:G,y:ee,scale:Q,renderingMode:"stroke",angle:X,align:this.textAlign,maxWidth:ae})}},f.prototype.measureText=function(D){if(typeof D!="string")throw kn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var G=this.pdf,ee=this.pdf.internal.scaleFactor,ae=G.internal.getFontSize(),X=G.getStringUnitWidth(D)*ae/G.internal.scaleFactor;return new function(Q){var ue=(Q=Q||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ue}}),this}({width:X*=Math.round(96*ee/72*1e4)/1e4})},f.prototype.scale=function(D,G){if(isNaN(D)||isNaN(G))throw kn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var ee=new l(D,0,0,G,0,0);this.ctx.transform=this.ctx.transform.multiply(ee)},f.prototype.rotate=function(D){if(isNaN(D))throw kn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var G=new l(Math.cos(D),Math.sin(D),-Math.sin(D),Math.cos(D),0,0);this.ctx.transform=this.ctx.transform.multiply(G)},f.prototype.translate=function(D,G){if(isNaN(D)||isNaN(G))throw kn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var ee=new l(1,0,0,1,D,G);this.ctx.transform=this.ctx.transform.multiply(ee)},f.prototype.transform=function(D,G,ee,ae,X,Q){if(isNaN(D)||isNaN(G)||isNaN(ee)||isNaN(ae)||isNaN(X)||isNaN(Q))throw kn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ue=new l(D,G,ee,ae,X,Q);this.ctx.transform=this.ctx.transform.multiply(ue)},f.prototype.setTransform=function(D,G,ee,ae,X,Q){D=isNaN(D)?1:D,G=isNaN(G)?0:G,ee=isNaN(ee)?0:ee,ae=isNaN(ae)?1:ae,X=isNaN(X)?0:X,Q=isNaN(Q)?0:Q,this.ctx.transform=new l(D,G,ee,ae,X,Q)};var g=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(D,G,ee,ae,X,Q,ue,pe,me){var _e=this.pdf.getImageProperties(D),Ee=1,ye=1,Re=1,Y=1;ae!==void 0&&pe!==void 0&&(Re=pe/ae,Y=me/X,Ee=_e.width/ae*pe/ae,ye=_e.height/X*me/X),Q===void 0&&(Q=G,ue=ee,G=0,ee=0),ae!==void 0&&pe===void 0&&(pe=ae,me=X),ae===void 0&&pe===void 0&&(pe=_e.width,me=_e.height);var Te=this.ctx.transform.decompose(),it=O(Te.rotate.shx),He=new l,Ce=(He=(He=(He=He.multiply(Te.translate)).multiply(Te.skew)).multiply(Te.scale)).applyToRectangle(new o(Q-G*Re,ue-ee*Y,ae*Ee,X*ye));if(this.autoPaging){for(var Je,De=w.call(this,Ce),Qe=[],ze=0;ze<De.length;ze+=1)Qe.indexOf(De[ze])===-1&&Qe.push(De[ze]);S(Qe);for(var Vt=Qe[0],Ct=Qe[Qe.length-1],dt=Vt;dt<Ct+1;dt++){this.pdf.setPage(dt);var St=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ot=dt===1?this.posY+this.margin[0]:this.margin[0],Ve=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],wt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],lt=dt===1?0:Ve+(dt-2)*wt;if(this.ctx.clip_path.length!==0){var Hn=this.path;Je=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=x(Je,this.posX+this.margin[3],-lt+Ot+this.ctx.prevPageLastElemOffset),C.call(this,"fill",!0),this.path=Hn}var Yt=JSON.parse(JSON.stringify(Ce));Yt=x([Yt],this.posX+this.margin[3],-lt+Ot+this.ctx.prevPageLastElemOffset)[0];var Et=(dt>Vt||dt<Ct)&&g.call(this);Et&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],St,wt,null).clip().discardPath()),this.pdf.addImage(D,"JPEG",Yt.x,Yt.y,Yt.w,Yt.h,null,
vendor: 1,474 bytes, line 613
613null,it),Et&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(D,"JPEG",Ce.x,Ce.y,Ce.w,Ce.h,null,null,it)};var w=function(D,G,ee){var ae=[];G=G||this.pdf.internal.pageSize.width,ee=ee||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var X=this.posY+this.ctx.prevPageLastElemOffset;switch(D.type){default:case"mt":case"lt":ae.push(Math.floor((D.y+X)/ee)+1);break;case"arc":ae.push(Math.floor((D.y+X-D.radius)/ee)+1),ae.push(Math.floor((D.y+X+D.radius)/ee)+1);break;case"qct":var Q=te(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x,D.y);ae.push(Math.floor((Q.y+X)/ee)+1),ae.push(Math.floor((Q.y+Q.h+X)/ee)+1);break;case"bct":var ue=he(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x2,D.y2,D.x,D.y);ae.push(Math.floor((ue.y+X)/ee)+1),ae.push(Math.floor((ue.y+ue.h+X)/ee)+1);break;case"rect":ae.push(Math.floor((D.y+X)/ee)+1),ae.push(Math.floor((D.y+D.h+X)/ee)+1)}for(var pe=0;pe<ae.length;pe+=1)for(;this.pdf.internal.getNumberOfPages()<ae[pe];)y.call(this);return ae},y=function(){var D=this.fillStyle,G=this.strokeStyle,ee=this.font,ae=this.lineCap,X=this.lineWidth,Q=this.lineJoin;this.pdf.addPage(),this.fillStyle=D,this.strokeStyle=G,this.font=ee,this.lineCap=ae,this.lineWidth=X,this.lineJoin=Q},x=function(D,G,ee){for(var ae=0;ae<D.length;ae++)switch(D[ae].type){case"bct":D[ae].x2+=G,D[ae].y2+=ee;case"qct":D[ae].x1+=G,D[ae].y1+=ee;default:D[ae].x+=G,D[ae].y+=ee}return D},S=function(D){return D.sort(function(G,ee){return G-ee})}
vendor: 45,386 bytes, lines 613-621
613,A=function(D,G){var ee=this.fillStyle,ae=this.strokeStyle,X=this.lineCap,Q=this.lineWidth,ue=Math.abs(Q*this.ctx.transform.scaleX),pe=this.lineJoin;if(this.autoPaging){for(var me,_e,Ee=JSON.parse(JSON.stringify(this.path)),ye=JSON.parse(JSON.stringify(this.path)),Re=[],Y=0;Y<ye.length;Y++)if(ye[Y].x!==void 0)for(var Te=w.call(this,ye[Y]),it=0;it<Te.length;it+=1)Re.indexOf(Te[it])===-1&&Re.push(Te[it]);for(var He=0;He<Re.length;He++)for(;this.pdf.internal.getNumberOfPages()<Re[He];)y.call(this);S(Re);for(var Ce=Re[0],Je=Re[Re.length-1],De=Ce;De<Je+1;De++){this.pdf.setPage(De),this.fillStyle=ee,this.strokeStyle=ae,this.lineCap=X,this.lineWidth=ue,this.lineJoin=pe;var Qe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ze=De===1?this.posY+this.margin[0]:this.margin[0],Vt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ct=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],dt=De===1?0:Vt+(De-2)*Ct;if(this.ctx.clip_path.length!==0){var St=this.path;me=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=x(me,this.posX+this.margin[3],-dt+ze+this.ctx.prevPageLastElemOffset),C.call(this,D,!0),this.path=St}if(_e=JSON.parse(JSON.stringify(Ee)),this.path=x(_e,this.posX+this.margin[3],-dt+ze+this.ctx.prevPageLastElemOffset),G===!1||De===0){var Ot=(De>Ce||De<Je)&&g.call(this);Ot&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Qe,Ct,null).clip().discardPath()),C.call(this,D,G),Ot&&this.pdf.restoreGraphicsState()}this.lineWidth=Q}this.path=Ee}else this.lineWidth=ue,C.call(this,D,G),this.lineWidth=Q},C=function(D,G){if((D!=="stroke"||G||!b.call(this))&&(D==="stroke"||G||!h.call(this))){for(var ee,ae,X=[],Q=this.path,ue=0;ue<Q.length;ue++){var pe=Q[ue];switch(pe.type){case"begin":X.push({begin:!0});break;case"close":X.push({close:!0});break;case"mt":X.push({start:pe,deltas:[],abs:[]});break;case"lt":var me=X.length;if(Q[ue-1]&&!isNaN(Q[ue-1].x)&&(ee=[pe.x-Q[ue-1].x,pe.y-Q[ue-1].y],me>0)){for(;me>=0;me--)if(X[me-1].close!==!0&&X[me-1].begin!==!0){X[me-1].deltas.push(ee),X[me-1].abs.push(pe);break}}break;case"bct":ee=[pe.x1-Q[ue-1].x,pe.y1-Q[ue-1].y,pe.x2-Q[ue-1].x,pe.y2-Q[ue-1].y,pe.x-Q[ue-1].x,pe.y-Q[ue-1].y],X[X.length-1].deltas.push(ee);break;case"qct":var _e=Q[ue-1].x+2/3*(pe.x1-Q[ue-1].x),Ee=Q[ue-1].y+2/3*(pe.y1-Q[ue-1].y),ye=pe.x+2/3*(pe.x1-pe.x),Re=pe.y+2/3*(pe.y1-pe.y),Y=pe.x,Te=pe.y;ee=[_e-Q[ue-1].x,Ee-Q[ue-1].y,ye-Q[ue-1].x,Re-Q[ue-1].y,Y-Q[ue-1].x,Te-Q[ue-1].y],X[X.length-1].deltas.push(ee);break;case"arc":X.push({deltas:[],abs:[],arc:!0}),Array.isArray(X[X.length-1].abs)&&X[X.length-1].abs.push(pe)}}ae=G?null:D==="stroke"?"stroke":"fill";for(var it=!1,He=0;He<X.length;He++)if(X[He].arc)for(var Ce=X[He].abs,Je=0;Je<Ce.length;Je++){var De=Ce[Je];De.type==="arc"?I.call(this,De.x,De.y,De.radius,De.startAngle,De.endAngle,De.counterclockwise,void 0,G,!it):J.call(this,De.x,De.y),it=!0}else if(X[He].close===!0)this.pdf.internal.out("h"),it=!1;else if(X[He].begin!==!0){var Qe=X[He].start.x,ze=X[He].start.y;H.call(this,X[He].deltas,Qe,ze),it=!0}ae&&L.call(this,ae),G&&V.call(this)}},T=function(D){var G=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,ee=G*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return D-ee;case"top":return D+G-ee;case"hanging":return D+G-2*ee;case"middle":return D+G/2-ee;default:return D}},R=function(D){return D+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var D=function(){};return D.colorStops=[],D.addColorStop=function(G,ee){this.colorStops.push([G,ee])},D.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},D.isCanvasGradient=!0,D},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var I=function(D,G,ee,ae,X,Q,ue,pe,me){for(var _e=oe.call(this,ee,ae,X,Q),Ee=0;Ee<_e.length;Ee++){var ye=_e[Ee];Ee===0&&(me?j.call(this,ye.x1+D,ye.y1+G):J.call(this,ye.x1+D,ye.y1+G)),le.call(this,D,G,ye.x2,ye.y2,ye.x3,ye.y3,ye.x4,ye.y4)}pe?V.call(this):L.call(this,ue)},L=function(D){switch(D){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},V=function(){this.pdf.clip(),this.pdf.discardPath()},j=function(D,G){this.pdf.internal.out(t(D)+" "+r(G)+" m")},$=function(D){var G;switch(D.align){case"right":case"end":G="right";break;case"center":G="center";break;default:G="left"}var ee,ae,X,Q=this.pdf.getTextDimensions(D.text),ue=T.call(this,D.y),pe=R.call(this,ue)-Q.h,me=this.ctx.transform.applyToPoint(new a(D.x,ue));if(this.autoPaging){var _e=this.ctx.transform.decompose(),Ee=new l;Ee=(Ee=(Ee=Ee.multiply(_e.translate)).multiply(_e.skew)).multiply(_e.scale);for(var ye=this.ctx.transform.applyToRectangle(new o(D.x,ue,Q.w,Q.h)),Re=Ee.applyToRectangle(new o(D.x,pe,Q.w,Q.h)),Y=w.call(this,Re),Te=[],it=0;it<Y.length;it+=1)Te.indexOf(Y[it])===-1&&Te.push(Y[it]);S(Te);for(var He=Te[0],Ce=Te[Te.length-1],Je=He;Je<Ce+1;Je++){this.pdf.setPage(Je);var De=Je===1?this.posY+this.margin[0]:this.margin[0],Qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ze=this.pdf.internal.pageSize.height-this.margin[2],Vt=ze-this.margin[0],Ct=this.pdf.internal.pageSize.width-this.margin[1],dt=Ct-this.margin[3],St=Je===1?0:Qe+(Je-2)*Vt;if(this.ctx.clip_path.length!==0){var Ot=this.path;ee=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=x(ee,this.posX+this.margin[3],-1*St+De),C.call(this,"fill",!0),this.path=Ot}var Ve=x([JSON.parse(JSON.stringify(Re))],this.posX+this.margin[3],-St+De+this.ctx.prevPageLastElemOffset)[0];D.scale>=.01&&(ae=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ae*D.scale),X=this.lineWidth,this.lineWidth=X*D.scale);var wt=this.autoPaging!=="text";if(wt||Ve.y+Ve.h<=ze){if(wt||Ve.y>=De&&Ve.x<=Ct){var lt=wt?D.text:this.pdf.splitTextToSize(D.text,D.maxWidth||Ct-Ve.x)[0],Hn=x([JSON.parse(JSON.stringify(ye))],this.posX+this.margin[3],-St+De+this.ctx.prevPageLastElemOffset)[0],Yt=wt&&(Je>He||Je<Ce)&&g.call(this);Yt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],dt,Vt,null).clip().discardPath()),this.pdf.text(lt,Hn.x,Hn.y,{angle:D.angle,align:G,renderingMode:D.renderingMode}),Yt&&this.pdf.restoreGraphicsState()}}else Ve.y<ze&&(this.ctx.prevPageLastElemOffset+=ze-Ve.y);D.scale>=.01&&(this.pdf.setFontSize(ae),this.lineWidth=X)}}else D.scale>=.01&&(ae=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ae*D.scale),X=this.lineWidth,this.lineWidth=X*D.scale),this.pdf.text(D.text,me.x+this.posX,me.y+this.posY,{angle:D.angle,align:G,renderingMode:D.renderingMode,maxWidth:D.maxWidth}),D.scale>=.01&&(this.pdf.setFontSize(ae),this.lineWidth=X)},J=function(D,G,ee,ae){ee=ee||0,ae=ae||0,this.pdf.internal.out(t(D+ee)+" "+r(G+ae)+" l")},H=function(D,G,ee){return this.pdf.lines(D,G,ee,null,null)},le=function(D,G,ee,ae,X,Q,ue,pe){this.pdf.internal.out([e(i(ee+D)),e(s(ae+G)),e(i(X+D)),e(s(Q+G)),e(i(ue+D)),e(s(pe+G)),"c"].join(" "))},oe=function(D,G,ee,ae){for(var X=2*Math.PI,Q=Math.PI/2;G>ee;)G-=X;var ue=Math.abs(ee-G);ue<X&&ae&&(ue=X-ue);for(var pe=[],me=ae?-1:1,_e=G;ue>1e-5;){var Ee=_e+me*Math.min(ue,Q);pe.push(se.call(this,D,_e,Ee)),ue-=Math.abs(Ee-_e),_e=Ee}return pe},se=function(D,G,ee){var ae=(ee-G)/2,X=D*Math.cos(ae),Q=D*Math.sin(ae),ue=X,pe=-Q,me=ue*ue+pe*pe,_e=me+ue*X+pe*Q,Ee=4/3*(Math.sqrt(2*me*_e)-_e)/(ue*Q-pe*X),ye=ue-Ee*pe,Re=pe+Ee*ue,Y=ye,Te=-Re,it=ae+G,He=Math.cos(it),Ce=Math.sin(it);return{x1:D*Math.cos(G),y1:D*Math.sin(G),x2:ye*He-Re*Ce,y2:ye*Ce+Re*He,x3:Y*He-Te*Ce,y3:Y*Ce+Te*He,x4:D*Math.cos(ee),y4:D*Math.sin(ee)}},O=function(D){return 180*D/Math.PI},te=function(D,G,ee,ae,X,Q){var ue=D+.5*(ee-D),pe=G+.5*(ae-G),me=X+.5*(ee-X),_e=Q+.5*(ae-Q),Ee=Math.min(D,X,ue,me),ye=Math.max(D,X,ue,me),Re=Math.min(G,Q,pe,_e),Y=Math.max(G,Q,pe,_e);return new o(Ee,Re,ye-Ee,Y-Re)},he=function(D,G,ee,ae,X,Q,ue,pe){var me,_e,Ee,ye,Re,Y,Te,it,He,Ce,Je,De,Qe,ze,Vt=ee-D,Ct=ae-G,dt=X-ee,St=Q-ae,Ot=ue-X,Ve=pe-Q;for(_e=0;_e<41;_e++)He=(Te=(Ee=D+(me=_e/40)*Vt)+me*((Re=ee+me*dt)-Ee))+me*(Re+me*(X+me*Ot-Re)-Te),Ce=(it=(ye=G+me*Ct)+me*((Y=ae+me*St)-ye))+me*(Y+me*(Q+me*Ve-Y)-it),_e==0?(Je=He,De=Ce,Qe=He,ze=Ce):(Je=Math.min(Je,He),De=Math.min(De,Ce),Qe=Math.max(Qe,He),ze=Math.max(ze,Ce));return new o(Math.round(Je),Math.round(De),Math.round(Qe-Je),Math.round(ze-De))},ge=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var D,G,ee=(D=this.ctx.lineDash,G=this.ctx.lineDashOffset,JSON.stringify({lineDash:D,lineDashOffset:G}));this.prevLineDash!==ee&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=ee)}}})(mt.API),function(n){var e=function(a){var o,l,c,u,f,p,h,b,g,w;for(l=[],c=0,u=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;u>c;c+=4)(f=(a.charCodeAt(c)<<24)+(a.charCodeAt(c+1)<<16)+(a.charCodeAt(c+2)<<8)+a.charCodeAt(c+3))!==0?(p=(f=((f=((f=((f=(f-(w=f%85))/85)-(g=f%85))/85)-(b=f%85))/85)-(h=f%85))/85)%85,l.push(p+33,h+33,b+33,g+33,w+33)):l.push(122);return function(y,x){for(var S=x;S>0;S--)y.pop()}(l,o.length),String.fromCharCode.apply(String,l)+"~>"},t=function(a){var o,l,c,u,f,p=String,h="length",b=255,g="charCodeAt",w="slice",y="replace";for(a[w](-2),a=a[w](0,-2)[y](/\s/g,"")[y]("z","!!!!!"),c=[],u=0,f=(a+=o="uuuuu"[w](a[h]%5||5))[h];f>u;u+=5)l=52200625*(a[g](u)-33)+614125*(a[g](u+1)-33)+7225*(a[g](u+2)-33)+85*(a[g](u+3)-33)+(a[g](u+4)-33),c.push(b&l>>24,b&l>>16,b&l>>8,b&l);return function(x,S){for(var A=S;A>0;A--)x.pop()}(c,o[h]),p.fromCharCode.apply(p,c)},r=function(a){return a.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var l="",c=0;c<a.length;c+=2)l+=String.fromCharCode("0x"+(a[c]+a[c+1]));return l},s=function(a){for(var o=new Uint8Array(a.length),l=a.length;l--;)o[l]=a.charCodeAt(l);return(o=DC(o)).reduce(function(c,u){return c+String.fromCharCode(u)},"")};n.processDataByFilters=function(a,o){var l=0,c=a||"",u=[];for(typeof(o=o||[])=="string"&&(o=[o]),l=0;l<o.length;l+=1)switch(o[l]){case"ASCII85Decode":case"/ASCII85Decode":c=t(c),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":c=e(c),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":c=i(c),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":c=r(c),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":c=s(c),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[l]+'" is not implemented')}return{data:c,reverseChain:u.reverse().join(" ")}}}(mt.API),function(n){n.loadFile=function(e,t,r){return function(i,s,a){s=s!==!1,a=typeof a=="function"?a:function(){};var o=void 0;try{o=function(l,c,u){var f=new XMLHttpRequest,p=0,h=function(b){var g=b.length,w=[],y=String.fromCharCode;for(p=0;p<g;p+=1)w.push(y(255&b.charCodeAt(p)));return w.join("")};if(f.open("GET",l,!c),f.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(f.onload=function(){f.status===200?u(h(this.responseText)):u(void 0)}),f.send(null),c&&f.status===200)return h(f.responseText)}(i,s,a)}catch{}return o}(e,t,r)},n.loadImageFile=n.loadFile}(mt.API),function(n){function e(){return(At.html2canvas?Promise.resolve(At.html2canvas):Vh(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function t(){return(At.DOMPurify?Promise.resolve(At.DOMPurify):Vh(()=>import("./purify.es-C5KSVp3G.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var l=wn(o);return l==="undefined"?"undefined":l==="string"||o instanceof String?"string":l==="number"||o instanceof Number?"number":l==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":l==="object"?"object":"unknown"},i=function(o,l){var c=document.createElement(o);for(var u in l.className&&(c.className=l.className),l.innerHTML&&l.dompurify&&(c.innerHTML=l.dompurify.sanitize(l.innerHTML)),l.style)c.style[u]=l.style[u];return c},s=function o(l,c){for(var u=l.nodeType===3?document.createTextNode(l.nodeValue):l.cloneNode(!1),f=l.firstChild;f;f=f.nextSibling)c!==!0&&f.nodeType===1&&f.nodeName==="SCRIPT"||u.appendChild(o(f,c));return l.nodeType===1&&(l.nodeName==="CANVAS"?(u.width=l.width,u.height=l.height,u.getContext("2d").drawImage(l,0,0)):l.nodeName!=="TEXTAREA"&&l.nodeName!=="SELECT"||(u.value=l.value),u.addEventListener("load",function(){u.scrollTop=l.scrollTop,u.scrollLeft=l.scrollLeft},!0)),u},a=function o(l){var c=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),u=o.convert(Promise.resolve(),c);return(u=u.setProgress(1,o,1,[o])).set(l)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,l){return o.__proto__=l||a.prototype,o},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(o,l){return this.then(function(){switch(l=l||function(c){switch(r(c)){case"string":return"string";case"element":return c.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),l){case"string":return this.then(t).then(function(c){return this.set({src:i("div",{innerHTML:o,dompurify:c})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){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 o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||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},l=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);l.tagName==="BODY"&&(o.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:o}),this.prop.container.appendChild(l),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 o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(l){var c=Object.assign({},this.opt.html2canvas);return delete c.onrendered,l(this.prop.container,c)}).then(function(l){(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(l){var c=this.opt.jsPDF,u=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,p=Object.assign({async:!0,allowTaint:!0,scale:f,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 p.onrendered,c.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,c.context2d.posX=this.opt.x,c.context2d.posY=this.opt.y,c.context2d.margin=this.opt.margin,c.context2d.fontFaces=u,u)for(var h=0;h<u.length;++h){var b=u[h],g=b.src.find(function(w){return w.format==="truetype"});g&&c.addFont(g.url,b.ref.name,b.ref.style)}return p.windowHeight=p.windowHeight||0,p.windowHeight=p.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):p.windowHeight,c.context2d.save(!0),l(this.prop.container,p)}).then(function(l){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},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(o,l,c){return(c=c||"pdf").toLowerCase()==="img"||c.toLowerCase()==="image"?this.outputImg(o,l):this.outputPdf(o,l)},a.prototype.outputPdf=function(o,l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,l)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){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 "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}: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(o){if(r(o)!=="object")return this;var l=Object.keys(o||{}).map(function(c){if(c in a.template.prop)return function(){this.prop[c]=o[c]};switch(c){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[c]=o[c]}}},this);return this.then(function(){return this.thenList(l)})},a.prototype.get=function(o,l){return this.then(function(){var c=o in a.template.prop?this.prop[o]:this.opt[o];return l?l(c):c})},a.prototype.setMargin=function(o){return this.then(function(){switch(r(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function l(c,u){return Math.floor(c*u/72*96)}return this.then(function(){(o=o||mt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:l(o.inner.width,o.k),height:l(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,l,c,u){return o!=null&&(this.progress.val=o),l!=null&&(this.progress.state=l),c!=null&&(this.progress.n=c),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(o,l,c,u){return this.setProgress(o?this.progress.val+o:null,l||null,c?this.progress.n+c:null,u?this.progress.stack.concat(u):null)},a.prototype.then=function(o,l){var c=this;return this.thenCore(o,l,function(u,f){return c.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(p){return c.updateProgress(null,u),p}).then(u,f).then(function(p){return c.updateProgress(1),p})})},a.prototype.thenCore=function(o,l,c){c=c||Promise.prototype.then;var u=this;o&&(o=o.bind(u)),l&&(l=l.bind(u));var f=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:a.convert(Object.assign({},u),Promise.prototype),p=c.call(f,o,l);return a.convert(p,u.__proto__)},a.prototype.thenExternal=function(o,l){return Promise.prototype.then.call(this,o,l)},a.prototype.thenList=function(o){var l=this;return o.forEach(function(c){l=l.thenCore(c)}),l},a.prototype.catch=function(o){o&&(o=o.bind(this));var l=Promise.prototype.catch.call(this,o);return a.convert(l,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,mt.getPageSize=function(o,l,c){if(wn(o)==="object"){var u=o;o=u.orientation,l=u.unit||l,c=u.format||c}l=l||"mm",c=c||"a4",o=(""+(o||"P")).toLowerCase();var f,p=(""+c).toLowerCase(),h={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(l){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+l}var b,g=0,w=0;if(h.hasOwnProperty(p))g=h[p][1]/f,w=h[p][0]/f;else try{g=c[1],w=c[0]}catch{throw new Error("Invalid format: "+c)}if(o==="p"||o==="portrait")o="p",w>g&&(b=w,w=g,g=b);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",g>w&&(b=w,w=g,g=b)}return{width:w,height:g,unit:l,k:f,orientation:o}},n.html=function(o,l){(l=l||{}).callback=l.callback||function(){},l.html2canvas=l.html2canvas||{},l.html2canvas.canvas=l.html2canvas.canvas||this.canvas,l.jsPDF=l.jsPDF||this,l.fontFaces=l.fontFaces?l.fontFaces.map(TE):null;var c=new a(l);return l.worker?c:c.from(o).doCallback()}}(mt.API),mt.API.addJS=function(n){return OI=n,this.internal.events.subscribe("postPutResources",function(){L2=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(L2+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),II=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+OI+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){L2!==void 0&&II!==void 0&&this.internal.out("/Names <</JavaScript "+L2+" 0 R>>")}),this},function(n){var e;n.events.push(["postPutResources",function(){var t=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=t.outline.render().split(/\r\n/),s=0;s<i.length;s++){var a=i[s],o=r.exec(a);if(o!=null){var l=o[1];t.internal.newObjectDeferredBegin(l,!1)}t.internal.write(a)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(s=0;s<c;s++){var f=t.internal.newObject();u.push(f);var p=t.internal.getPageInfo(s+1);t.internal.write("<< /D["+p.objId+" 0 R /XYZ null null null]>> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),s=0;s<u.length;s++)t.internal.write("(page_"+(s+1)+")"+u[s]+" 0 R");t.internal.write(" ] >>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),n.events.push(["putCatalog",function(){var t=this;t.outline.root.children.length>0&&(t.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&t.internal.write("/Names "+e+" 0 R"))}]),n.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(r,i,s){var a={title:i,options:s,children:[]};return r==null&&(r=this.root),r.children.push(a),a},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(r){r.id=t.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},t.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},t.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var a=r.children[s];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var o=this.count=this.count_r({count:0},a);if(o>0&&this.line("/Count "+o),a.options&&a.options.pageNumber){var l=t.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+l.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var c=0;c<r.children.length;c++)this.renderItems(r.children[c])},t.outline.line=function(r){this.ctx.val+=r+`\r
614`},t.outline.makeRef=function(r){return r.id+" 0 R"},t.outline.makeString=function(r){return"("+t.internal.pdfEscape(r)+")"},t.outline.objStart=function(r){this.ctx.val+=`\r
615`+r.id+` 0 obj\r
616<<\r
617`},t.outline.objEnd=function(){this.ctx.val+=`>> \r
618endobj\r
619`},t.outline.count_r=function(r,i){for(var s=0;s<i.children.length;s++)r.count++,this.count_r(r,i.children[s]);return r.count}}])}(mt.API),function(n){var e=[192,193,194,195,196,197,198,199];n.processJPEG=function(t,r,i,s,a,o){var l,c=this.decode.DCT_DECODE,u=null;if(typeof t=="string"||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=a||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,l=function(f){for(var p,h=256*f.charCodeAt(4)+f.charCodeAt(5),b=f.length,g={width:0,height:0,numcomponents:1},w=4;w<b;w+=2){if(w+=h,e.indexOf(f.charCodeAt(w+1))!==-1){p=256*f.charCodeAt(w+5)+f.charCodeAt(w+6),g={width:256*f.charCodeAt(w+7)+f.charCodeAt(w+8),height:p,numcomponents:f.charCodeAt(w+9)};break}h=256*f.charCodeAt(w+2)+f.charCodeAt(w+3)}return g}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t),l.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}u={data:t,width:l.width,height:l.height,colorSpace:o,bitsPerComponent:8,filter:c,index:r,alias:i}}return u}}(mt.API),mt.API.processPNG=function(n,e,t,r){if(this.__addimage__.isArrayBuffer(n)&&(n=new Uint8Array(n)),this.__addimage__.isArrayBufferView(n)){var i,s=dhe(n,{checkCrc:!0}),a=s.width,o=s.height,l=s.channels,c=s.palette,u=s.depth;i=c&&l===1?function(I){for(var L=I.width,V=I.height,j=I.data,$=I.palette,J=I.depth,H=!1,le=[],oe=[],se=void 0,O=!1,te=0,he=0;he<$.length;he++){var ge=TL($[he],4),D=ge[0],G=ge[1],ee=ge[2],ae=ge[3];le.push(D,G,ee),ae!=null&&(ae===0?(te++,oe.length<1&&oe.push(he)):ae<255&&(O=!0))}if(O||te>1){H=!0,oe=void 0;var X=L*V;se=new Uint8Array(X);for(var Q=new DataView(j.buffer),ue=0;ue<X;ue++){var pe=jE(Q,ue,J),me=TL($[pe],4)[3];se[ue]=me}}else te===0&&(oe=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:H?8:void 0,colorBytes:j,alphaBytes:se,needSMask:H,palette:le,mask:oe}}(s):l===2||l===4?function(I){for(var L=I.data,V=I.width,j=I.height,$=I.channels,J=I.depth,H=$===2?"DeviceGray":"DeviceRGB",le=$-1,oe=V*j,se=le,O=oe*se,te=1*oe,he=Math.ceil(O*J/8),ge=Math.ceil(te*J/8),D=new Uint8Array(he),G=new Uint8Array(ge),ee=new DataView(L.buffer),ae=new DataView(D.buffer),X=new DataView(G.buffer),Q=!1,ue=0;ue<oe;ue++){for(var pe=ue*$,me=0;me<se;me++)HI(ae,jE(ee,pe+me,J),ue*se+me,J);var _e=jE(ee,pe+se,J);_e<(1<<J)-1&&(Q=!0),HI(X,_e,1*ue,J)}return{colorSpace:H,colorsPerPixel:le,sMaskBitsPerComponent:Q?J:void 0,colorBytes:D,alphaBytes:G,needSMask:Q}}(s):function(I){var L=I.data,V=I.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:V,colorsPerPixel:V==="DeviceGray"?1:3,colorBytes:L instanceof Uint16Array?function(j){for(var $=j.length,J=new Uint8Array(2*$),H=new DataView(J.buffer,J.byteOffset,J.byteLength),le=0;le<$;le++)H.setUint16(2*le,j[le],!1);return J}(L):L,needSMask:!1}}(s);var f,p,h,b=i,g=b.colorSpace,w=b.colorsPerPixel,y=b.sMaskBitsPerComponent,x=b.colorBytes,S=b.alphaBytes,A=b.needSMask,C=b.palette,T=b.mask,R=null;return r!==mt.API.image_compression.NONE&&typeof DC=="function"?(R=function(I){var L;switch(I){case mt.API.image_compression.FAST:L=11;break;case mt.API.image_compression.MEDIUM:L=13;break;case mt.API.image_compression.SLOW:L=14;break;default:L=12}return L}(r),f=this.decode.FLATE_DECODE,p="/Predictor ".concat(R," /Colors ").concat(w," /BitsPerComponent ").concat(u," /Columns ").concat(a),n=BI(x,Math.ceil(a*w*u/8),w,u,r),A&&(h=BI(S,Math.ceil(a*y/8),1,y,r))):(f=void 0,p=void 0,n=x,A&&(h=S)),(this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n))&&(n=this.__addimage__.arrayBufferToBinaryString(n)),(h&&this.__addimage__.isArrayBuffer(h)||this.__addimage__.isArrayBufferView(h))&&(h=this.__addimage__.arrayBufferToBinaryString(h)),{alias:t,data:n,index:e,filter:f,decodeParameters:p,transparency:T,palette:C,sMask:h,predictor:R,width:a,height:o,bitsPerComponent:u,sMaskBitsPerComponent:y,colorSpace:g}}},function(n){n.processGIF89A=function(e,t,r,i){var s=new Rhe(e),a=s.width,o=s.height,l=[];s.decodeAndBlitFrameRGBA(0,l);var c={data:l,width:a,height:o},u=new RE(100).encode(c,100);return n.processJPEG.call(this,u,t,r,i)},n.processGIF87A=n.processGIF89A}(mt.API),Za.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,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var n=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(n);for(var e=0;e<n;e++){var t=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:t,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Za.prototype.parseBGR=function(){this.pos=this.offset;try{var n="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[n]()}catch(t){kn.log("bit decode error:"+t)}},Za.prototype.bit1=function(){var n,e=Math.ceil(this.width/8),t=e%4;for(n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++)for(var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,o=0;o<8&&8*i+o<this.width;o++){var l=this.palette[s>>7-o&1];this.data[a+4*o]=l.blue,this.data[a+4*o+1]=l.green,this.data[a+4*o+2]=l.red,this.data[a+4*o+3]=255}t!==0&&(this.pos+=4-t)}},Za.prototype.bit4=function(){for(var n=Math.ceil(this.width/2),e=n%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<n;i++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,o=s>>4,l=15&s,c=this.palette[o];if(this.data[a]=c.blue,this.data[a+1]=c.green,this.data[a+2]=c.red,this.data[a+3]=255,2*i+1>=this.width)break;c=this.palette[l],this.data[a+4]=c.blue,this.data[a+4+1]=c.green,this.data[a+4+2]=c.red,this.data[a+4+3]=255}e!==0&&(this.pos+=4-e)}},Za.prototype.bit8=function(){for(var n=this.width%4,e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[s]=a.red,this.data[s+1]=a.green,this.data[s+2]=a.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}n!==0&&(this.pos+=4-n)}},Za.prototype.bit15=function(){for(var n=this.width%3,e=parseInt("11111",2),t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&e)/e*255|0,o=(s>>5&e)/e*255|0,l=(s>>10&e)/e*255|0,c=s>>15?255:0,u=r*this.width*4+4*i;this.data[u]=l,this.data[u+1]=o,this.data[u+2]=a,this.data[u+3]=c}this.pos+=n}},Za.prototype.bit16=function(){for(var n=this.width%3,e=parseInt("11111",2),t=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,l=(a>>5&t)/t*255|0,c=(a>>11)/e*255|0,u=i*this.width*4+4*s;this.data[u]=c,this.data[u+1]=l,this.data[u+2]=o,this.data[u+3]=255}this.pos+=n}},Za.prototype.bit24=function(){for(var n=this.height-1;n>=0;n--){for(var e=this.bottom_up?n:this.height-1-n,t=0;t<this.width;t++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*t;this.data[a]=s,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},Za.prototype.bit32=function(){for(var n=this.height-1;n>=0;n--)for(var e=this.bottom_up?n:this.height-1-n,t=0;t<this.width;t++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*t;this.data[o]=s,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=a}},Za.prototype.getData=function(){return this.data},function(n){n.processBMP=function(e,t,r,i){var s=new Za(e,!1),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},c=new RE(100).encode(l,100);return n.processJPEG.call(this,c,t,r,i)}}(mt.API),VI.prototype.getData=function(){return this.data},function(n){n.processWEBP=function(e,t,r,i){var s=new VI(e),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},c=new RE(100).encode(l,100);return n.processJPEG.call(this,c,t,r,i)}}(mt.API),mt.API.processRGBA=function(n,e,t){for(var r=n.data,i=r.length,s=new Uint8Array(i/4*3),a=new Uint8Array(i/4),o=0,l=0,c=0;c<i;c+=4){var u=r[c],f=r[c+1],p=r[c+2],h=r[c+3];s[o++]=u,s[o++]=f,s[o++]=p,a[l++]=h}var b=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:b,index:e,alias:t,colorSpace:"DeviceRGB",bitsPerComponent:8,width:n.width,height:n.height}},mt.API.setLanguage=function(n){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{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"}[n]!==void 0&&(this.internal.languageSettings.languageCode=n,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},am=mt.API,I2=am.getCharWidthsArray=function(n,e){var t,r,i=(e=e||{}).font||this.internal.getFont(),s=e.fontSize||this.internal.getFontSize(),a=e.charSpace||this.internal.getCharSpace(),o=e.widths?e.widths:i.metadata.Unicode.widths,l=o.fof?o.fof:1,c=e.kerning?e.kerning:i.metadata.Unicode.kerning,u=c.fof?c.fof:1,f=e.doKerning!==!1,p=0,h=n.length,b=0,g=o[0]||l,w=[];for(t=0;t<h;t++)r=n.charCodeAt(t),typeof i.metadata.widthOfString=="function"?w.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/s)||0)/1e3):(p=f&&wn(c[r])==="object"&&!isNaN(parseInt(c[r][b],10))?c[r][b]/u:0,w.push((o[r]||g)/l+p)),b=r;return w},MI=am.getStringUnitWidth=function(n,e){var t=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return am.processArabic&&(n=am.processArabic(n)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(n,t,i)/t:I2.apply(this,arguments).reduce(function(s,a){return s+a},0)},DI=function(n,e,t,r){for(var i=[],s=0,a=n.length,o=0;s!==a&&o+e[s]<t;)o+=e[s],s++;i.push(n.slice(0,s));var l=s;for(o=0;s!==a;)o+e[s]>r&&(i.push(n.slice(l,s)),o=0,l=s),o+=e[s],s++;return l!==s&&i.push(n.slice(l,s)),i},FI=function(n,e,t){t||(t={});var r,i,s,a,o,l,c,u=[],f=[u],p=t.textIndent||0,h=0,b=0,g=n.split(" "),w=I2.apply(this,[" ",t])[0];if(l=t.lineIndent===-1?g[0].length+2:t.lineIndent||0){var y=Array(l).join(" "),x=[];g.map(function(A){(A=A.split(/\s*\n/)).length>1?x=x.concat(A.map(function(C,T){return(T&&C.length?`
620`:"")+C})):x.push(A[0])}),g=x,l=MI.apply(this,[y,t])}for(s=0,a=g.length;s<a;s++){var S=0;if(r=g[s],l&&r[0]==`
621`&&(r=r.substr(1),S=1),p+h+(b=(i=I2.apply(this,[r,t])).reduce(function(A,C){return A+C},0))>e||S){if(b>e){for(o=DI.apply(this,[r,i,e-(p+h),e]),u.push(o.shift()),u=[o.pop()];o.length;)f.push([o.shift()]);b=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(A,C){return A+C},0)}else u=[r];f.push(u),p=b+l,h=w}else u.push(r),p+=h+b,h=w}return c=l?function(A,C){return(C?y:"")+A.join(" ")}:function(A){return A.join(" ")},f.map(c)},am.splitTextToSize=function(n,e,t){var r,i=(t=t||{}).fontSize||this.internal.getFontSize(),s=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var f=this.internal.getFont(u.fontName,u.fontStyle),p="Unicode";return f.metadata[p]?{widths:f.metadata[p].widths||{0:1},kerning:f.metadata[p].kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);r=Array.isArray(n)?n:String(n).split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;s.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/i:0,s.lineIndent=t.lineIndent;var o,l,c=[];for(o=0,l=r.length;o<l;o++)c=c.concat(FI.apply(this,[r[o],a,s]));return c},function(n){n.__fontmetrics__=n.__fontmetrics__||{};for(var e="0123456789abcdef",t="klmnopqrstuvwxyz",r={},i={},s=0;s<16;s++)r[t[s]]=e[s],i[e[s]]=t[s];var a=function(p){return"0x"+parseInt(p,10).toString(16)},o=n.__fontmetrics__.compress=function(p){var h,b,g,w,y=["{"];for(var x in p){if(h=p[x],isNaN(parseInt(x,10))?b="'"+x+"'":(x=parseInt(x,10),b=(b=a(x).slice(2)).slice(0,-1)+i[b.slice(-1)]),typeof h=="number")h<0?(g=a(h).slice(3),w="-"):(g=a(h).slice(2),w=""),g=w+g.slice(0,-1)+i[g.slice(-1)];else{if(wn(h)!=="object")throw new Error("Don't know what to do with value type "+wn(h)+".");g=o(h)}y.push(b+g)}return y.push("}"),y.join("")},l=n.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var h,b,g,w,y={},x=1,S=y,A=[],C="",T="",R=p.length-1,I=1;I<R;I+=1)(w=p[I])=="'"?h?(g=h.join(""),h=void 0):h=[]:h?h.push(w):w=="{"?(A.push([S,g]),S={},g=void 0):w=="}"?((b=A.pop())[0][b[1]]=S,g=void 0,S=b[0]):w=="-"?x=-1:g===void 0?r.hasOwnProperty(w)?(C+=r[w],g=parseInt(C,16)*x,x=1,C=""):C+=w:r.hasOwnProperty(w)?(T+=r[w],S[g]=parseInt(T,16)*x,x=1,g=void 0,T=""):T+=w;return y},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:c,"Courier-Bold":c,"Courier-BoldOblique":c,"Courier-Oblique":c,Helvetica:c,"Helvetica-Bold":c,"Helvetica-BoldOblique":c,"Helvetica-Oblique":c,"Times-Roman":c,"Times-Bold":c,"Times-BoldItalic":c,"Times-Italic":c}},f
vendor: 2,567 bytes, line 621
621={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
vendor: 12,126 bytes, line 621
621dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};
vendor: 10,650 bytes, lines 621-649
621n.events.push(["addFont",function(p){var h=p.font,b=f.Unicode[h.postScriptName];b&&(h.metadata.Unicode={},h.metadata.Unicode.widths=b.widths,h.metadata.Unicode.kerning=b.kerning);var g=u.Unicode[h.postScriptName];g&&(h.metadata.Unicode.encoding=g,h.encoding=g.codePages[0])}])}(mt.API),function(n){var e=function(t){for(var r=t.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=t.charCodeAt(s);return i};n.API.events.push(["addFont",function(t){var r=void 0,i=t.font,s=t.instance;if(!i.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=s.existsFileInVFS(i.postScriptName)===!1?s.loadFile(i.postScriptName):s.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,o){o=/^\x00\x01\x00\x00/.test(o)?e(o):e(Ix(o)),a.metadata=n.API.TTFFont.open(o),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,r)}}])}(mt),mt.API.addSvgAsImage=function(n,e,t,r,i,s,a,o){if(isNaN(e)||isNaN(t))throw kn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw kn.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 c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(At.canvg?Promise.resolve(At.canvg):Vh(()=>import("./index.es-CFMt7B3f.js"),[])).catch(function(p){return Promise.reject(new Error("Could not load canvg: "+p))}).then(function(p){return p.default?p.default:p}).then(function(p){return p.fromString(c,n,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(p){return p.render(u)}).then(function(){f.addImage(l.toDataURL("image/jpeg",1),e,t,r,i,a,o)})},mt.API.putTotalPages=function(n){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(n,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(n,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,t);return this},mt.API.viewerPreferences=function(n,e){var t;n=n||{},e=e||!1;var r,i,s,a={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}},o=Object.keys(a),l=[],c=0,u=0,f=0;function p(b,g){var w,y=!1;for(w=0;w<b.length;w+=1)b[w]===g&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),t=this.internal.viewerpreferences.configuration,n==="reset"||e===!0){var h=o.length;for(f=0;f<h;f+=1)t[o[f]].value=t[o[f]].defaultValue,t[o[f]].explicitSet=!1}if(wn(n)==="object"){for(i in n)if(s=n[i],p(o,i)&&s!==void 0){if(t[i].type==="boolean"&&typeof s=="boolean")t[i].value=s;else if(t[i].type==="name"&&p(t[i].valueSet,s))t[i].value=s;else if(t[i].type==="integer"&&Number.isInteger(s))t[i].value=s;else if(t[i].type==="array"){for(c=0;c<s.length;c+=1)if(r=!0,s[c].length===1&&typeof s[c][0]=="number")l.push(String(s[c]-1));else if(s[c].length>1){for(u=0;u<s[c].length;u+=1)typeof s[c][u]!="number"&&(r=!1);r===!0&&l.push([s[c][0]-1,s[c][1]-1].join(" "))}t[i].value="["+l.join(" ")+"]"}else t[i].value=t[i].defaultValue;t[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var b,g=[];for(b in t)t[b].explicitSet===!0&&(t[b].type==="name"?g.push("/"+b+" /"+t[b].value):g.push("/"+b+" "+t[b].value));g.length!==0&&this.internal.write(`/ViewerPreferences
622<<
623`+g.join(`
624`)+`
625>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},function(n){var e=function(){var r='<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>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),s=unescape(encodeURIComponent(r)),a=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),o=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),l=unescape(encodeURIComponent("</x:xmpmeta>")),c=s.length+a.length+o.length+i.length+l.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+c+" >>"),this.internal.write("stream"),this.internal.write(i+s+a+o+l),this.internal.write("endstream"),this.internal.write("endobj")},t=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};n.addMetadata=function(r,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",t),this.internal.events.subscribe("postPutResources",e)),this}}(mt.API),function(n){var e=n.API,t=e.pdfEscape16=function(s,a){for(var o,l=a.metadata.Unicode.widths,c=["","0","00","000","0000"],u=[""],f=0,p=s.length;f<p;++f){if(o=a.metadata.characterToGlyph(s.charCodeAt(f)),a.metadata.glyIdsUsed.push(o),a.metadata.toUnicode[o]=s.charCodeAt(f),l.indexOf(o)==-1&&(l.push(o),l.push([parseInt(a.metadata.widthOfGlyph(o),10)])),o=="0")return u.join("");o=o.toString(16),u.push(c[4-o.length],o)}return u.join("")},r=function(s){var a,o,l,c,u,f,p;for(u=`/CIDInit /ProcSet findresource begin
62612 dict begin
627begincmap
628/CIDSystemInfo <<
629  /Registry (Adobe)
630  /Ordering (UCS)
631  /Supplement 0
632>> def
633/CMapName /Adobe-Identity-UCS def
634/CMapType 2 def
6351 begincodespacerange
636<0000><ffff>
637endcodespacerange`,l=[],f=0,p=(o=Object.keys(s).sort(function(h,b){return h-b})).length;f<p;f++)a=o[f],l.length>=100&&(u+=`
638`+l.length+` beginbfchar
639`+l.join(`
640`)+`
641endbfchar`,l=[]),s[a]!==void 0&&s[a]!==null&&typeof s[a].toString=="function"&&(c=("0000"+s[a].toString(16)).slice(-4),a=("0000"+(+a).toString(16)).slice(-4),l.push("<"+a+"><"+c+">"));return l.length&&(u+=`
642`+l.length+` beginbfchar
643`+l.join(`
644`)+`
645endbfchar
646`),u+`endcmap
647CMapName currentdict /CMap defineresource pop
648end
649end`};e.events.push(["putFont",function(s){(function(a){var o=a.font,l=a.out,c=a.newObject,u=a.putStream;if(o.metadata instanceof n.API.TTFFont&&o.encoding==="Identity-H"){for(var f=o.metadata.Unicode.widths,p=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),h="",b=0;b<p.length;b++)h+=String.fromCharCode(p[b]);var g=c();u({data:h,addLength1:!0,objectId:g}),l("endobj");var w=c();u({data:r(o.metadata.toUnicode),addLength1:!0,objectId:w}),l("endobj");var y=c();l("<<"),l("/Type /FontDescriptor"),l("/FontName /"+ym(o.fontName)),l("/FontFile2 "+g+" 0 R"),l("/FontBBox "+n.API.PDFObject.convert(o.metadata.bbox)),l("/Flags "+o.metadata.flags),l("/StemV "+o.metadata.stemV),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l(">>"),l("endobj");var x=c();l("<<"),l("/Type /Font"),l("/BaseFont /"+ym(o.fontName)),l("/FontDescriptor "+y+" 0 R"),l("/W "+n.API.PDFObject.convert(f)),l("/CIDToGIDMap /Identity"),l("/DW 1000"),l("/Subtype /CIDFontType2"),l("/CIDSystemInfo"),l("<<"),l("/Supplement 0"),l("/Registry (Adobe)"),l("/Ordering ("+o.encoding+")"),l(">>"),l(">>"),l("endobj"),o.objectNumber=c(),l("<<"),l("/Type /Font"),l("/Subtype /Type0"),l("/ToUnicode "+w+" 0 R"),l("/BaseFont /"+ym(o.fontName)),l("/Encoding /"+o.encoding),l("/DescendantFonts ["+x+" 0 R]"),l(">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]),e.events.push(["putFont",function(s){(function(a){var o=a.font,l=a.out,c=a.newObject,u=a.putStream;if(o.metadata instanceof n.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var f=o.metadata.rawData,p="",h=0;h<f.length;h++)p+=String.fromCharCode(f[h]);var b=c();u({data:p,addLength1:!0,objectId:b}),l("endobj");var g=c();u({data:r(o.metadata.toUnicode),addLength1:!0,objectId:g}),l("endobj");var w=c();l("<<"),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l("/StemV "+o.metadata.stemV),l("/Type /FontDescriptor"),l("/
649FontFile2 "+b+" 0 R"),l("/Flags 96"),l("/FontBBox "+n.API.PDFObject.convert(o.metadata.bbox)),l("/FontName /"+ym(o.fontName)),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l(">>"),l("endobj"),o.objectNumber=c();for(var y=0;y<o.metadata.hmtx.widths.length;y++)o.metadata.hmtx.widths[y]=parseInt(o.metadata.hmtx.widths[y]*(1e3/o.metadata.head.unitsPerEm));l("<</Subtype/TrueType/Type/Font/ToUnicode "+g+" 0 R/BaseFont/"+ym(o.fontName)+"/FontDescriptor "+w+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+n.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]);var i=function(s){var a,o=s.text||"",l=s.x,c=s.y,u=s.options||{},f=s.mutex||{},p=f.pdfEscape,h=f.activeFontKey,b=f.fonts,g=h,w="",y=0,x="",S=b[g].encoding;if(b[g].encoding!=="Identity-H")return{text:o,x:l,y:c,options:u,mutex:f};for(x=o,g=h,Array.isArray(o)&&(x=o[0]),y=0;y<x.length;y+=1)b[g].metadata.hasOwnProperty("cmap")&&(a=b[g].metadata.cmap.unicode.codeMap[x[y].charCodeAt(0)]),a||x[y].charCodeAt(0)<256&&b[g].metadata.hasOwnProperty("Unicode")?w+=x[y]:w+="";var A="";return parseInt(g.slice(1))<14||S==="WinAnsiEncoding"?A=p(w,g).split("").map(function(C){return C.charCodeAt(0).toString(16)}).join(""):S==="Identity-H"&&(A=t(w,b[g])),f.isHex=!0,{text:A,x:l,y:c,options:u,mutex:f}};e.events.push(["postProcessText",function(s){var a=s.text||"",o=[],l={text:a,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(a)){var c=0;for(c=0;c<a.length;c+=1)Array.isArray(a[c])&&a[c].length===3?o.push([i(Object.assign({},l,{text:a[c][0]})).text,a[c][1],a[c][2]]):o.push(i(Object.assign({},l,{text:a[c]})).text);s.text=o}else s.text=i(Object.assign({},l,{text:a})).text}])}(mt),function(n){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};n.existsFileInVFS=function(t){return e.call(this),this.internal.vFS[t]!==void 0},n.addFileToVFS=function(t,r){return e.call(this),this.internal.vFS[t]=r,this},n.getFileFromVFS=function(t){return e.call(this),this.internal.vFS[t]!==void 0?this.internal.vFS[t]:null}}(mt.API),function(n){n.__bidiEngine__=n.prototype.__bidiEngine__=function(r){var i,s,a,o,l,c,u,f=e,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],b={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},g={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},w=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],y=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)$/),x=!1,S=0;this.__bidiEngine__={};var A=function(j){var $=j.charCodeAt(),J=$>>8,H=g[J];return H!==void 0?f[256*H+(255&$)]:J===252||J===253?"AL":y.test(J)?"L":J===8?"R":"N"},C=function(j){for(var $,J=0;J<j.length;J++){if(($=A(j.charAt(J)))==="L")return!1;if($==="R")return!0}return!1},T=function(j,$,J,H){var le,oe,se,O,te=$[H];switch(te){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":x=!1;break;case"N":case"AN":break;case"EN":x&&(te="AN");break;case"AL":x=!0,te="R";break;case"WS":case"BN":te="N";break;case"CS":H<1||H+1>=$.length||(le=J[H-1])!=="EN"&&le!=="AN"||(oe=$[H+1])!=="EN"&&oe!=="AN"?te="N":x&&(oe="AN"),te=oe===le?oe:"N";break;case"ES":te=(le=H>0?J[H-1]:"B")==="EN"&&H+1<$.length&&$[H+1]==="EN"?"EN":"N";break;case"ET":if(H>0&&J[H-1]==="EN"){te="EN";break}if(x){te="N";break}for(se=H+1,O=$.length;se<O&&$[se]==="ET";)se++;te=se<O&&$[se]==="EN"?"EN":"N";break;case"NSM":if(a&&!o){for(O=$.length,se=H+1;se<O&&$[se]==="NSM";)se++;if(se<O){var he=j[H],ge=he>=1425&&he<=2303||he===64286;if(le=$[se],ge&&(le==="R"||le==="AL")){te="R";break}}}te=H<1||(le=$[H-1])==="B"?"N":J[H-1];break;case"B":x=!1,i=!0,te=S;break;case"S":s=!0,te="N"}return te},R=function(j,$,J){var H=j.split("");return J&&I(H,J,{hiLevel:S}),H.reverse(),$&&$.reverse(),H.join("")},I=function(j,$,J){var H,le,oe,se,O,te=-1,he=j.length,ge=0,D=[],G=S?h:p,ee=[];for(x=!1,i=!1,s=!1,le=0;le<he;le++)ee[le]=A(j[le]);for(oe=0;oe<he;oe++){if(O=ge,D[oe]=T(j,ee,D,oe),H=240&(ge=G[O][b[D[oe]]]),ge&=15,$[oe]=se=G[ge][5],H>
vendor: 30,567 bytes, line 649
6490)if(H===16){for(le=te;le<oe;le++)$[le]=1;te=-1}else te=-1;if(G[ge][6])te===-1&&(te=oe);else if(te>-1){for(le=te;le<oe;le++)$[le]=se;te=-1}ee[oe]==="B"&&($[oe]=0),J.hiLevel|=se}s&&function(ae,X,Q){for(var ue=0;ue<Q;ue++)if(ae[ue]==="S"){X[ue]=S;for(var pe=ue-1;pe>=0&&ae[pe]==="WS";pe--)X[pe]=S}}(ee,$,he)},L=function(j,$,J,H,le){if(!(le.hiLevel<j)){if(j===1&&S===1&&!i)return $.reverse(),void(J&&J.reverse());for(var oe,se,O,te,he=$.length,ge=0;ge<he;){if(H[ge]>=j){for(O=ge+1;O<he&&H[O]>=j;)O++;for(te=ge,se=O-1;te<se;te++,se--)oe=$[te],$[te]=$[se],$[se]=oe,J&&(oe=J[te],J[te]=J[se],J[se]=oe);ge=O}ge++}}},V=function(j,$,J){var H=j.split(""),le={hiLevel:S};return J||(J=[]),I(H,J,le),function(oe,se,O){if(O.hiLevel!==0&&u)for(var te,he=0;he<oe.length;he++)se[he]===1&&(te=w.indexOf(oe[he]))>=0&&(oe[he]=w[te+1])}(H,J,le),L(2,H,$,J,le),L(1,H,$,J,le),H.join("")};return this.__bidiEngine__.doBidiReorder=function(j,$,J){if(function(le,oe){if(oe)for(var se=0;se<le.length;se++)oe[se]=se;o===void 0&&(o=C(le)),c===void 0&&(c=C(le))}(j,$),a||!l||c)if(a&&l&&o^c)S=o?1:0,j=R(j,$,J);else if(!a&&l&&c)S=o?1:0,j=V(j,$,J),j=R(j,$);else if(!a||o||l||c){if(a&&!l&&o^c)j=R(j,$),o?(S=0,j=V(j,$,J)):(S=1,j=V(j,$,J),j=R(j,$));else if(a&&o&&!l&&c)S=1,j=V(j,$,J),j=R(j,$);else if(!a&&!l&&o^c){var H=u;o?(S=1,j=V(j,$,J),S=0,u=!1,j=V(j,$,J),u=H):(S=0,j=V(j,$,J),j=R(j,$),S=1,u=!1,j=V(j,$,J),u=H,j=R(j,$))}}else S=0,j=V(j,$,J);else S=o?1:0,j=V(j,$,J);return j},this.__bidiEngine__.setOptions=function(j){j&&(a=j.isInputVisual,l=j.isOutputVisual,o=j.isInputRtl,c=j.isOutputRtl,u=j.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["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"],t=new n.__bidiEngine__({isInputVisual:!0});n.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var a=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,t.setOptions(s),Object.prototype.toString.call(i)==="[object Array]"){var o=0;for(a=[],o=0;o<i.length;o+=1)Object.prototype.toString.call(i[o])==="[object Array]"?a.push([t.doBidiReorder(i[o][0]),i[o][1],i[o][2]]):a.push([t.doBidiReorder(i[o])]);r.text=a}else r.text=t.doBidiReorder(i);t.setOptions({isInputVisual:!0})}])}(mt),mt.API.TTFFont=function(){function n(e){var t;if(this.rawData=e,t=this.contents=new Vd(e),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Ghe(this),this.registerTTF()}return n.open=function(e){return new n(e)},n.prototype.parse=function(){return this.directory=new Lhe(this.contents),this.head=new Ohe(this),this.name=new $he(this),this.cmap=new j9(this),this.toUnicode={},this.hhea=new Mhe(this),this.maxp=new Uhe(this),this.hmtx=new zhe(this),this.post=new Fhe(this),this.os2=new Dhe(this),this.loca=new Vhe(this),this.glyf=new qhe(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]},n.prototype.registerTTF=function(){var e,t,r,i,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var a,o,l,c;for(c=[],a=0,o=(l=this.bbox).length;a<o;a++)e=l[a],c.push(Math.round(e*this.scaleFactor));return c}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(t=i>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+r)):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=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},n.prototype.characterToGlyph=function(e){var t;return((t=this.cmap.unicode)!=null?t.codeMap[e]:void 0)||0},n.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},n.prototype.widthOfString=function(e,t,r){var i,s,a,o;for(a=0,s=0,o=(e=""+e).length;0<=o?s<o:s>o;s=0<=o?++s:--s)i=e.charCodeAt(s),a+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/t)||0;return a*(t/1e3)},n.prototype.lineHeight=function(e,t){var r;return t==null&&(t=!1),r=t?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},n}();var Uo,Vd=function(){function n(e){this.data=e??[],this.pos=0,this.length=this.data.length}return n.prototype.readByte=function(){return this.data[this.pos++]},n.prototype.writeByte=function(e){return this.data[this.pos++]=e},n.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},n.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},n.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},n.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},n.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},n.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},n.prototype.readString=function(e){var t,r;for(r=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)r[t]=String.fromCharCode(this.readByte());return r.join("")},n.prototype.writeString=function(e){var t,r,i;for(i=[],t=0,r=e.length;0<=r?t<r:t>r;t=0<=r?++t:--t)i.push(this.writeByte(e.charCodeAt(t)));return i},n.prototype.readShort=function(){return this.readInt16()},n.prototype.writeShort=function(e){return this.writeInt16(e)},n.prototype.readLongLong=function(){var e,t,r,i,s,a,o,l;return e=this.readByte(),t=this.readByte(),r=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),l=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^s)+65536*(255^a)+256*(255^o)+(255^l)+1):72057594037927940*e+281474976710656*t+1099511627776*r+4294967296*i+16777216*s+65536*a+256*o+l},n.prototype.writeLongLong=function(e){var t,r;return t=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},n.prototype.readInt=function(){return this.readInt32()},n.prototype.writeInt=function(e){return this.writeInt32(e)},n.prototype.read=function(e){var t,r;for(t=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)t.push(this.readByte());return t},n.prototype.write=function(e){var t,r,i,s;for(s=[],r=0,i=e.length;r<i;r++)t=e[r],s.push(this.writeByte(t));return s},n}(),Lhe=function(){var n;function e(t){var r,i,s;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},i=0,s=this.tableCount;0<=s?i<s:i>s;i=0<=s?++i:--i)r={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(t){var r,i,s,a,o,l,c,u,f,p,h,b,g;for(g in h=Object.keys(t).length,l=Math.log(2),f=16*Math.floor(Math.log(h)/l),a=Math.floor(f/l),u=16*h-f,(i=new Vd).writeInt(this.scalarType),i.writeShort(h),i.writeShort(f),i.writeShort(a),i.writeShort(u),s=16*h,c=i.pos+s,o=null,b=[],t)for(p=t[g],i.writeString(g),i.writeInt(n(p)),i.writeInt(c),i.writeInt(p.length),b=b.concat(p),g==="head"&&(o=c),c+=p.length;c%4;)b.push(0),c++;return i.write(b),r=2981146554-n(i.data),i.pos=o+8,i.writeUInt32(r),i.data},n=function(t){var r,i,s,a;for(t=R9.call(t);t.length%4;)t.push(0);for(s=new Vd(t),i=0,r=0,a=t.length;r<a;r=r+=4)i+=s.readUInt32();return 4294967295&i},e}(),Ihe={}.hasOwnProperty,$l=function(n,e){for(var t in e)Ihe.call(e,t)&&(n[t]=e[t]);function r(){this.constructor=n}return r.prototype=e.prototype,n.prototype=new r,n.__super__=e.prototype,n};Uo=function(){function n(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 n.prototype.parse=function(){},n.prototype.encode=function(){},n.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},n}();var Ohe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="head",n.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()},n.prototype.encode=function(e){var t;return(t=new Vd).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},n}(),GI=function(){function n(e,t){var r,i,s,a,o,l,c,u,f,p,h,b,g,w,y,x,S;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),f=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(l=0;l<256;++l)this.codeMap[l]=e.readByte();break;case 4:for(h=e.readUInt16(),p=h/2,e.pos+=6,s=function(){var A,C;for(C=[],l=A=0;0<=p?A<p:A>p;l=0<=p?++A:--A)C.push(e.readUInt16());return C}(),e.pos+=2,g=function(){var A,C;for(C=[],l=A=0;0<=p?A<p:A>p;l=0<=p?++A:--A)C.push(e.readUInt16());return C}(),c=function(){var A,C;for(C=[],l=A=0;0<=p?A<p:A>p;l=0<=p?++A:--A)C.push(e.readUInt16());return C}(),u=function(){var A,C;for(C=[],l=A=0;0<=p?A<p:A>p;l=0<=p?++A:--A)C.push(e.readUInt16());return C}(),i=(this.length-e.pos+this.offset)/2,o=function(){var A,C;for(C=[],l=A=0;0<=i?A<i:A>i;l=0<=i?++A:--A)C.push(e.readUInt16());return C}(),l=y=0,S=s.length;y<S;l=++y)for(w=s[l],r=x=b=g[l];b<=w?x<=w:x>=w;r=b<=w?++x:--x)u[l]===0?a=r+c[l]:(a=o[u[l]/2+(r-b)-(p-l)]||0)!==0&&(a+=c[l]),this.codeMap[r]=65535&a}e.pos=f}return n.encode=function(e,t){var r,i,s,a,o,l,c,u,f,p,h,b,g,w,y,x,S,A,C,T,R,I,L,V,j,$,J,H,le,oe,se,O,te,he,ge,D,G,ee,ae,X,Q,ue,pe,me,_e,Ee;switch(H=new Vd,a=Object.keys(e).sort(function(ye,Re){return ye-Re}),t){case"macroman":for(g=0,w=function(){var ye=[];for(b=0;b<256;++b)ye.push(0);return ye}(),x={0:0},s={},le=0,te=a.length;le<te;le++)x[pe=e[i=a[le]]]==null&&(x[pe]=++g),s[i]={old:e[i],new:x[e[i]]},w[i]=x[e[i]];return H.writeUInt16(1),H.writeUInt16(0),H.writeUInt32(12),H.writeUInt16(0),H.writeUInt16(262),H.writeUInt16(0),H.write(w),{charMap:s,subtable:H.data,maxGlyphID:g+1};case"unicode":for($=[],f=[],S=0,x={},r={},y=c=null,oe=0,he=a.length;oe<he;oe++)x[C=e[i=a[oe]]]==null&&(x[C]=++S),r[i]={old:C,new:x[C]},o=x[C]-i,y!=null&&o===c||(y&&f.push(y),$.push(i),c=o),y=i;for(y&&f.push(y),f.push(65535),$.push(65535),V=2*(L=$.length),I=2*Math.pow(Math.log(L)/Math.LN2,2),p=Math.log(I/2)/Math.LN2,R=2*L-I,l=[],T=[],h=[],b=se=0,ge=$.length;se<ge;b=++se){if(j=$[b],u=f[b],j===65535){l.push(0),T.push(0);break}if(j-(J=r[j].new)>=32768)for(l.push(0),T.push(2*(h.length+L-b)),i=O=j;j<=u?O<=u:O>=u;i=j<=u?++O:--O)h.push(r[i].new);else l.push(J-j),T.push(0)}for(H.writeUInt16(3),H.writeUInt16(1),H.writeUInt32(12),H.writeUInt16(4),H.writeUInt16(16+8*L+2*h.length),H.writeUInt16(0),H.writeUInt16(V),H.writeUInt16(I),H.writeUInt16(p),H.writeUInt16(R),Q=0,D=f.length;Q<D;Q++)i=f[Q],H.writeUInt16(i);for(H.writeUInt16(0),ue=0,G=$.length;ue<G;ue++)i=$[ue],H.writeUInt16(i);for(me=0,ee=l.length;me<ee;me++)o=l[me],H.writeUInt16(o);for(_e=0,ae=T.length;_e<ae;_e++)A=T[_e],H.writeUInt16(A);for(Ee=0,X=h.length;Ee<X;Ee++)g=h[Ee],H.writeUInt16(g);return{charMap:r,subtable:H.data,maxGlyphID:S+1}}},n}(),j9=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="cmap",n.prototype.parse=function(e){var t,r,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)t=new GI(e,this.offset),this.tables.push(t),t.isUnicode&&this.unicode==null&&(this.unicode=t);return!0},n.encode=function(e,t){var r,i;return t==null&&(t="macroman"),r=GI.encode(e,t),(i=new Vd).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},n}(),Mhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="hhea",n.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()},n}(),Dhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="OS/2",n.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,r;for(r=[],t=0;t<10;++t)r.push(e.readByte());return r}(),this.charRange=function(){var t,r;for(r=[],t=0;t<4;++t)r.push(e.readInt());return r}(),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,r;for(r=[],t=0;t<2;t=++t)r.push(e.readInt());return r}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},n}(),Fhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="post",n.prototype.parse=function(e){var t,r,i;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 s;for(r=e.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)t=e.readByte(),i.push(this.names.push(e.readString(t)));return i;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=(function(){var a,o,l;for(l=[],s=a=0,o=this.file.maxp.numGlyphs;0<=o?a<o:a>o;s=0<=o?++a:--a)l.push(e.readUInt32());return l}).call(this)}},n}(),Bhe=function(n,e){this.raw=n,this.length=n.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},$he=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="name",n.prototype.parse=function(e){var t,r,i,s,a,o,l,c,u,f,p;for(e.pos=this.offset,e.readShort(),t=e.readShort(),o=e.readShort(),r=[],s=0;0<=t?s<t:s>t;s=0<=t?++s:--s)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+o+e.readShort()});for(l={},s=u=0,f=r.length;u<f;s=++u)i=r[s],e.pos=i.offset,c=e.readString(i.length),a=new Bhe(c,i),l[p=i.nameID]==null&&(l[p]=[]),l[i.nameID].push(a);this.strings=l,this.copyright=l[0],this.fontFamily=l[1],this.fontSubfamily=l[2],this.uniqueSubfamily=l[3],this.fontName=l[4],this.version=l[5];try{this.postscriptName=l[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=l[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=l[7],this.manufacturer=l[8],this.designer=l[9],this.description=l[10],this.vendorUrl=l[11],this.designerUrl=l[12],this.license=l[13],this.licenseUrl=l[14],this.preferredFamily=l[15],this.preferredSubfamily=l[17],this.compatibleFull=l[18],this.sampleText=l[19]},n}(),Uhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="maxp",n.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()},n}(),zhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="hmtx",n.prototype.parse=function(e){var t,r,i,s,a,o,l;for(e.pos=this.offset,this.metrics=[],t=0,o=this.file.hhea.numberOfMetrics;0<=o?t<o:t>o;t=0<=o?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var c,u;for(u=[],t=c=0;0<=i?c<i:c>i;t=0<=i?++c:--c)u.push(e.readInt16());return u}(),this.widths=(function(){var c,u,f,p;for(p=[],c=0,u=(f=this.metrics).length;c<u;c++)s=f[c],p.push(s.advance);return p}).call(this),r=this.widths[this.widths.length-1],l=[],t=a=0;0<=i?a<i:a>i;t=0<=i?++a:--a)l.push(this.widths.push(r));return l},n.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]}},n}(),R9=[].slice,qhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}return $l(n,Uo),n.prototype.tag="glyf",n.prototype.parse=function(){return this.cache={}},n.prototype.glyphFor=function(e){var t,r,i,s,a,o,l,c,u,f;return e in this.cache?this.cache[e]:(s=this.file.loca,t=this.file.contents,r=s.indexOf(e),(i=s.lengthOf(e))===0?this.cache[e]=null:(t.pos=this.offset+r,a=(o=new Vd(t.read(i))).readShort(),c=o.readShort(),f=o.readShort(),l=o.readShort(),u=o.readShort(),this.cache[e]=a===-1?new Whe(o,c,f,l,u):new Hhe(o,a,c,f,l,u),this.cache[e]))},n.prototype.encode=function(e,t,r){var i,s,a,o,l;for(a=[],s=[],o=0,l=t.length;o<l;o++)i=e[t[o]],s.push(a.length),i&&(a=a.concat(i.encode(r)));return s.push(a.length),{table:a,offsets:s}},n}(),Hhe=function(){function n(e,t,r,i,s,a){this.raw=e,this.numberOfContours=t,this.xMin=r,this.yMin=i,this.xMax=s,this.yMax=a,this.compound=!1}return n.prototype.encode=function(){return this.raw.data},n}(),Whe=function(){function n(e,t,r,i,s){var a,o;for(this.raw=e,this.xMin=t,this.yMin=r,this.xMax=i,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return n.prototype.encode=function(){var e,t,r;for(t=new Vd(R9.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)t.pos=this.glyphOffsets[e];return t.data},n}(),Vhe=function(){function n(){return n.__super__.constructor.apply(this,arguments)}
649return $l(n,Uo),n.prototype.tag="loca",n.prototype.parse=function(e){var t,r;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=t===0?(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=2)s.push(2*e.readUInt16());return s}).call(this):(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=4)s.push(e.readUInt32());return s}).call(this)},n.prototype.indexOf=function(e){return this.offsets[e]},n.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},n.prototype.encode=function(e,t){for(var r=new Uint32Array(this.offsets.length),i=0,s=0,a=0;a<r.length;++a)if(r[a]=i,s<t.length&&t[s]==a){++s,r[a]=i;var o=this.offsets[a],l=this.offsets[a+1]-o;l>0&&(i+=l)}for(var c=new Array(4*r.length),u=0;u<r.length;++u)c[4*u+3]=255&r[u],c[4*u+2]=(65280&r[u])>>8,c[4*u+1]=(16711680&r[u])>>16,c[4*u]=(4278190080&r[u])>>24;return c},n}(),Ghe=function(){function n(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return n.prototype.generateCmap=function(){var e,t,r,i,s;for(t in i=this.font.cmap.tables[0].codeMap,e={},s=this.subset)r=s[t],e[t]=i[r];return e},n.prototype.glyphsFor=function(e){var t,r,i,s,a,o,l;for(i={},a=0,o=e.length;a<o;a++)i[s=e[a]]=this.font.glyf.glyphFor(s);for(s in t=[],i)(r=i[s])!=null&&r.compound&&t.push.apply(t,r.glyphIDs);if(t.length>0)for(s in l=this.glyphsFor(t))r=l[s],i[s]=r;return i},n.prototype.encode=function(e,t){var r,i,s,a,o,l,c,u,f,p,h,b,g,w,y;for(i in r=j9.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(e),h={0:0},y=r.charMap)h[(l=y[i]).old]=l.new;for(b in p=r.maxGlyphID,a)b in h||(h[b]=p++);return u=function(x){var S,A;for(S in A={},x)A[x[S]]=S;return A}(h),f=Object.keys(u).sort(function(x,S){return x-S}),g=function(){var x,S,A;for(A=[],x=0,S=f.length;x<S;x++)o=f[x],A.push(u[o]);return A}(),s=this.font.glyf.encode(a,g,h),c=this.font.loca.encode(s.offsets,g),w={cmap:this.font.cmap.raw(),glyf:s.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&&(w["OS/2"]=this.font.os2.raw()),this.font.directory.encode(w)},n}();mt.API.PDFObject=function(){var n;function e(){}return n=function(t,r){return(Array(r+1).join("0")+t).slice(-r)},e.convert=function(t){var r,i,s,a;if(Array.isArray(t))return"["+function(){var o,l,c;for(c=[],o=0,l=t.length;o<l;o++)r=t[o],c.push(e.convert(r));return c}().join(" ")+"]";if(typeof t=="string")return"/"+t;if(t!=null&&t.isString)return"("+t+")";if(t instanceof Date)return"(D:"+n(t.getUTCFullYear(),4)+n(t.getUTCMonth(),2)+n(t.getUTCDate(),2)+n(t.getUTCHours(),2)+n(t.getUTCMinutes(),2)+n(t.getUTCSeconds(),2)+"Z)";if({}.toString.call(t)==="[object Object]"){for(i in s=["<<"],t)a=t[i],s.push("/"+i+" "+e.convert(a));return s.push(">>"),s.join(`
650`)}return""+t},e}();const KI=[{id:"individual",name:"Adhésion Individuelle",price:15,description:"Pour les passionnés du Ti Train",benefits:["Invitations aux événements"]},{id:"family",name:"Adhésion Famille",price:25,description:"Pour toute la famille (2 adultes + enfants)",benefits:["Invitations aux événements"],popular:!0},{id:"supporter",name:"Adhésion Soutien",price:50,description:"Pour les grands supporters du patrimoine",benefits:["Invitations aux événements"]}],Khe=[{icon:e8,title:"Soutenez le patrimoine",description:"Votre cotisation finance directement les travaux de restauration et d'entretien du Ti Train."},{icon:Mb,title:"Communauté passionnée",description:"Rejoignez une famille de plus de 500 membres unis par la passion du Ti Train."}];function Yhe(){const[n,e]=E.useState({firstName:"",lastName:"",email:"",phone:"",address:"",city:"",postalCode:"",membershipType:"family"}),t=s=>{const{id:a,value:o}=s.target;e(l=>({...l,[a]:o}))},r=s=>{e(a=>({...a,membershipType:s}))},i=async s=>{if(s.preventDefault(),!n.firstName||!n.lastName||!n.email){to.error("Veuillez remplir les champs obligatoires (Prénom, Nom, Email)");return}const a=KI.find(g=>g.id===n.membershipType),o=new mt,l=o.internal.pageSize.getWidth(),c=new Image;c.src=IT,await new Promise(g=>{c.onload=g,c.onerror=g});try{o.addImage(c,"JPEG",l/2-25,10,50,50)}catch{}o.setFontSize(24),o.setFont("helvetica","bold"),o.text("BULLETIN D'ADHÉSION",l/2,75,{align:"center"}),o.setFontSize(14),o.setFont("helvetica","normal"),o.text("Association Ti Train Réunion",l/2,85,{align:"center"}),o.setFillColor(245,245,245),o.roundedRect(20,95,l-40,30,3,3,"F"),o.setFontSize(12),o.setFont("helvetica","bold"),o.text("Type d'adhésion :",25,107),o.setFont("helvetica","normal"),o.text(`${a==null?void 0:a.name} - ${a==null?void 0:a.price}€ / an`,75,107),o.setFont("helvetica","bold"),o.text("Date :",25,117),o.setFont("helvetica","normal"),o.text(new Date().toLocaleDateString("fr-FR"),45,117),o.setFontSize(14),o.setFont("helvetica","bold"),o.text("Informations personnelles",20,140),o.setDrawColor(200,200,200),o.line(20,143,l-20,143),o.setFontSize(11);const u=155,f=12,p=[{label:"Nom",value:n.lastName},{label:"Prénom",value:n.firstName},{label:"Email",value:n.email},{label:"Téléphone",value:n.phone||"Non renseigné"},{label:"Adresse",value:n.address||"Non renseignée"},{label:"Ville",value:n.city||"Non renseignée"},{label:"Code postal",value:n.postalCode||"Non renseigné"}];p.forEach((g,w)=>{const y=u+w*f;o.setFont("helvetica","bold"),o.text(`${g.label} :`,25,y),o.setFont("helvetica","normal"),o.text(g.value,70,y)});const h=u+p.length*f+20;o.setFontSize(11),o.setFont("helvetica","normal"),o.text("Signature :",25,h),o.setDrawColor(150,150,150),o.line(60,h,120,h),o.text("Date :",130,h),o.line(150,h,l-25,h);const b=h+30;o.setFontSize(10),o.setFont("helvetica","normal"),o.setTextColor(100,100,100),o.text("Venir sur place à la grande chaloupe avec ce document, lors des évènements.",l/2,b,{align:"center"}),o.setTextColor(100,100,100),o.setFontSize(9),o.text("Association Ti Train Réunion - La Grande Chaloupe, La Possession",l/2,280,{align:"center"}),o.text("Contact : 0692 38 53 91 - [email protected]",l/2,286,{align:"center"}),o.save(`adhesion-titrain-${n.lastName.toLowerCase()}-${n.firstName.toLowerCase()}.pdf`),to.success("Votre bulletin d'adhésion a été téléchargé !")};return d.jsxs(jo,{children:[d.jsxs("section",{className:"py-16 lg:py-24 bg-sidebar text-sidebar-foreground relative overflow-hidden",children:[d.jsx("div",{className:"absolute inset-0 rail-pattern opacity-10"}),d.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-gold/10 rounded-full blur-3xl"}),d.jsx("div",{className:"container relative",children:d.jsxs("div",{className:"max-w-3xl",children:[d.jsx("span",{className:"inline-block text-sm font-medium text-gold uppercase tracking-wider mb-4",children:"Rejoignez-nous"}),d.jsxs("h1",{className:"text-4xl lg:text-5xl font-display font-bold mb-4",children:["Devenez membre de"," ",d.jsx("span",{className:"text-gold",children:"Ti Train Réunion"})]}
650),d.jsx("p",{className:"text-lg text-sidebar-foreground/80",children:"En adhérant à notre association, vous contribuez à préserver et faire vivre un patrimoine unique de La Réunion."})]})})]}),d.jsx("section",{className:"py-12 lg:py-16 bg-muted/50",children:d.jsx("div",{className:"container",children:d.jsx("div",{className:"grid sm:grid-cols-2 gap-6 max-w-2xl mx-auto",children:Khe.map((s,a)=>d.jsxs("div",{className:"bg-card p-6 rounded-xl shadow-card hover:shadow-elevated transition-shadow",children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/10 text-primary mb-4",children:d.jsx(s.icon,{className:"h-6 w-6"})}),d.jsx("h3",{className:"font-display font-semibold text-foreground mb-2",children:s.title}),d.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]},a))})})}),d.jsx("section",{className:"py-12 lg:py-16",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"max-w-4xl mx-auto",children:[d.jsxs("div",{className:"text-center mb-10",children:[d.jsx("h2",{className:"font-display text-3xl font-bold text-foreground mb-2",children:"Choisissez votre formule"}),d.jsx("p",{className:"text-muted-foreground",children:"Sélectionnez le type d'adhésion qui vous correspond."})]}),d.jsxs("form",{onSubmit:i,className:"space-y-8",children:[d.jsx(_U,{value:n.membershipType,onValueChange:r,className:"grid md:grid-cols-3 gap-4",children:KI.map(s=>d.jsx(pt,{htmlFor:s.id,className:"cursor-pointer",children:d.jsxs(On,{className:`relative h-full transition-all hover:shadow-lg ${s.popular?"ring-2 ring-primary":""}`,children:[s.popular&&d.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:d.jsx("span",{className:"bg-primary text-primary-foreground text-xs font-medium px-3 py-1 rounded-full",children:"Populaire"})}),d.jsxs(Mn,{className:"p-6",children:[d.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[d.jsx(SU,{value:s.id,id:s.id,className:"mt-1"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"font-display font-semibold text-foreground",children:s.name}),d.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]})]}),d.jsxs("div",{className:"mb-4",children:[d.jsxs("span",{className:"text-3xl font-display font-bold text-primary",children:[s.price,"€"]}),d.jsx("span",{className:"text-muted-foreground",children:" / an"})]}),d.jsx("ul",{className:"space-y-2",children:s.benefits.map((a,o)=>d.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[d.jsx(JM,{className:"h-4 w-4 text-accent shrink-0 mt-0.5"}),d.jsx("span",{className:"text-muted-foreground",children:a})]},o))})]})]})},s.id))}),d.jsx(On,{children:d.jsxs(Mn,{className:"p-6 lg:p-8",children:[d.jsx("h3",{className:"font-display text-xl font-semibold text-foreground mb-6",children:"Vos informations"}),d.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"firstName",children:"Prénom *"}),d.jsx(Rt,{id:"firstName",placeholder:"Votre prénom",value:n.firstName,onChange:t,required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"lastName",children:"Nom *"}),d.jsx(Rt,{id:"lastName",placeholder:"Votre nom",value:n.lastName,onChange:t,required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"email",children:"Email *"}),d.jsx(Rt,{id:"email",type:"email",placeholder:"[email protected]",value:n.email,onChange:t,required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"phone",children:"Téléphone"}),d.jsx(Rt,{id:"phone",type:"tel",placeholder:"0692 38 53 91",value:n.phone,onChange:t})]}),d.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[d.jsx(pt,{htmlFor:"address",children:"Adresse"}),d.jsx(Rt,{id:"address",placeholder:"Votre adresse complète",value:n.address,onChange:t})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"city",children:"Ville"}),d.jsx(Rt,{id:"city",placeholder:"Saint-Denis",value:n.city,onChange:t})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"postalCode",children:"Code postal"}),d.jsx(Rt,{id:"postalCode",placeholder:"97400",value:n.postalCode,onChange:t})]})]})]})}),d.jsxs("div",{className:"text-center space-y-4",children:[d.jsxs(Oe,{type:"submit",size:"lg",className:"px-12 gap-2",children:[d.jsx(RN,{className:"h-5 w-5"}),"Télécharger votre adhésion"]}),d.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:"Rapportez ce document lors de votre prochaine visite avec votre règlement."})]})]})]})})})]})}function Xhe(){return d.jsx(jo,{children:d.jsxs("div",{className:"container py-12 lg:py-16",children:[d.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-foreground mb-8",children:"Mentions légales"}),d.jsxs("div",{className:"prose prose-lg max-w-3xl",children:[d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-4",children:"Désignation"}),d.jsx("p",{className:"text-muted-foreground",children:d.jsx("strong",{children:"ASSOCIATION TITRAIN"})})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-4",children:"Objet social"}),d.jsx("p",{className:"text-muted-foreground",children:"Sauvegarde et rénovation de tout le patrimoine ferroviaire réunionnais ;
650 l'exploitation et la gestion des infrastructures ; elle exerce toutes activités de promotion de ce patrimoine."})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-4",children:"Siège social"}),d.jsxs("p",{className:"text-muted-foreground",children:["47, chemin Hilaire de Sainte Colombe",d.jsx("br",{}),"La Montagne",d.jsx("br",{}),"97417 Saint-Denis"]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-4",children:"Identification"}),d.jsxs("p",{className:"text-muted-foreground",children:[d.jsx("strong",{children:"SIREN :"})," 382 541 068"]})]}),d.jsxs("section",{className:"mb-8",children:[d.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-4",children:"Hébergeur"}),d.jsxs("p",{className:"text-muted-foreground",children:["Site Web Réunion",d.jsx("br",{}),"Tél : 0692 86 31 41"]})]})]})]})})}const Jhe=eP,Qhe=tP,Zhe=nP,L9=E.forwardRef(({className:n,...e},t)=>d.jsx(Hb,{className:We("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e,ref:t}));L9.displayName=Hb.displayName;const efe=Ob("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),I9=E.forwardRef(({side:n="right",className:e,children:t,...r},i)=>d.jsxs(Zhe,{children:[d.jsx(L9,{}),d.jsxs(Wb,{ref:i,className:We(efe({side:n}),e),...r,children:[t,d.jsxs(lS,{className:"absolute right-4 top-4 roun
650ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[d.jsx(Ba,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));I9.displayName=Wb.displayName;const O9=({className:n,...e})=>d.jsx("div",{className:We("flex flex-col space-y-2 text-center sm:text-left",n),...e});O9.displayName="SheetHeader";const M9=E.forwardRef(({className:n,...e},t)=>d.jsx(Vb,{ref:t,className:We("text-lg font-semibold text-foreground",n),...e}));M9.displayName=Vb.displayName;const tfe=E.forwardRef(({className:n,...e},t)=>d.jsx(Gb,{ref:t,className:We("text-sm text-muted-foreground",n),...e}));tfe.displayName=Gb.displayName;const YI=[{id:1,name:"T-shirt Ti Train Vintage",price:25,image:"https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=600&q=80",category:"Vêtements",description:"T-shirt 100% coton bio avec impression vintage du Ti Train.",inStock:!0},{id:2,name:"Mug Locomotive 1882",price:12,image:"https://images.unsplash.com/photo-1514228742587-6b1558fcca3d?w=600&q=80",category:"Accessoires",description:"Mug en céramique avec illustration de la locomotive historique.",inStock:!0},{id:3,name:"Affiche Grande Chaloupe",price:18,image:"https://images.unsplash.com/photo-1513475382585-d06e58bcb0e0?w=600&q=80",category:"Décoration",description:"Affiche format A2 sur papier épais, vue panoramique du site.",inStock:!0},{id:4,name:"Casquette Ti Train",price:20,image:"https://images.unsplash.com/photo-1588850561407-ed78c282e89b?w=600&q=80",category:"Vêtements",description:"Casquette brodée avec le logo Ti Train Réunion.",inStock:!0},{id:5,name:"Carte postale (lot de 5)",price:8,image:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&q=80",category:"Papeterie",description:"Lot de 5 cartes postales avec photos historiques du Ti Train.",inStock:!0},{id:6,name:"Livre 'Ti Train Lontan'",price:35,image:"https://images.unsplash.com/photo-1544947950-fa07a98d237f?w=600&q=80",category:"Livres",description:"Livre illustré de 200 pages sur l'histoire du chemin de fer réunionnais.",inStock:!0},{id:7,name:"Sac en toile Ti Train",price:15,image:"https://images.unsplash.com/photo-1544816155-12df9643f363?w=600&q=80",category:"Accessoires",description:"Sac en toile de coton réutilisable avec impression Ti Train.",inStock:!1},{id:8,name:"Porte-clés Locomotive",price:6,image:"https://images.unsplash.com/photo-1614252369475-531eba835eb1?w=600&q=80",category:"Accessoires",description:"Porte-clés en métal avec miniature de locomotive.",inStock:!0},{id:9,name:"Puzzle Ti Train 500 pièces",price:22,image:"https://images.unsplash.com/photo-1606503153255-59d8b2f3b8f2?w=600&q=80",category:"Jeux",description:"Puzzle 500 pièces représentant le Ti Train à la Grande Chaloupe.",inStock:!0}],nfe=["Tous","Vêtements","Accessoires","Décoration","Papeterie","Livres","Jeux"];function rfe(){const[n,e]=E.useState([]),[t,r]=E.useState("Tous"),[i,s]=E.useState(null);E.useEffect(()=>{(async()=>{const{data:h}=await Xe.from("settings").select("value").eq("key","boutique_enabled").single();s((h==null?void 0:h.value)!=="false")})()},[]);const a=t==="Tous"?YI:YI.filter(p=>p.category===t),o=p=>{e(h=>h.find(g=>g.id===p.id)?h.map(g=>g.id===p.id?{...g,quantity:g.quantity+1}:g):[...h,{...p,quantity:1}])},l=(p,h)=>{e(b=>b.map(g=>g.id===p?{...g,quantity:Math.max(0,g.quantity+h)}:g).filter(g=>g.quantity>0))},c=p=>{e(h=>h.filter(b=>b.id!==p))},u=n.reduce((p,h)=>p+h.price*h.quantity,0),f=n.reduce((p,h)=>p+h.quantity,0);return i===null?d.jsx(jo,{children:d.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:d.jsx("p",{className:"text-muted-foreground",children:"Chargement..."})})}):i?d.jsxs(jo,{children:[d.jsx("section",{className:"py-16 lg:py-24 bg-muted/50",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-end lg:justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("span",{className:"inline-block text-sm font-medium text-primary uppercase tracking-wider mb-4",children:"Souvenirs"}),d.jsx("h1",{className:"text-4xl lg:text-5xl font-display font-bold text-foreground mb-4",children:"La Boutique du Ti Train"}),d.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Repartez avec un souvenir unique de votre visite et soutenez notre association."})]}),d.jsxs(Jhe,{children:[d.jsx(Qhe,{asChild:!0,children:d.jsxs(Oe,{variant:"outline",size:"lg",className:"relative",children:[d.jsx(cK,{className:"h-5 w-5 mr-2"}),"Mon panier",f>0&&d.jsx(Nl,{className:"absolute -top-2 -right-2 h-6 w-6 p-0 flex items-center justify-center",children:f})]})}),d.jsxs(I9,{className:"w-full sm:max-w-lg",children:[d.jsx(O9,{children:d.jsxs(M9,{children:["Mon panier (",f," articles)"]})}),d.jsx("div",{className:"mt-6 flex-1 overflow-y-auto",children:n.length===0?d.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Votre panier est vide"}):d.jsx("div",{className:"space-y-4",children:n.map(p=>d.jsxs("div",{className:"flex gap-4 py-4 border-b border-border",children:[d.jsx("div",{className:"h-20 w-20 rounded-lg overflow-hidden bg-muted shrink-0",children:d.jsx("img",{src:p.image,alt:p.name,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h4",{className:"font-medium text-foreground truncate",children:p.name}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.price,"€"]}),d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx(Oe,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>l(p.id,-1),children:d.jsx(rK,{className:"h-3 w-3"})}),d.jsx("span",{className:"w-8 text-center text-sm",children:p.quantity}),d.jsx(Oe,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>l(p.id,1),children:d.jsx(v0,{className:"h-3 w-3"})})]})]}),d.jsxs("div",{className:"text-right",children:[d.jsxs("p",{className:"font-semibold text-foreground",children:[p.price*p.quantity,"€"]}),d.jsx(Oe,{variant:"ghost",size:"icon",className:"h-7 w-7 mt-1 text-muted-foreground hover:text-destructive",onClick:()=>c(p.id),children:d.jsx(Ba,{className:"h-4 w-4"})})]})]}
650,p.id))})}),n.length>0&&d.jsxs("div",{className:"border-t border-border pt-4 mt-4 space-y-4",children:[d.jsxs("div",{className:"flex justify-between text-lg font-semibold",children:[d.jsx("span",{children:"Total"}),d.jsxs("span",{children:[u,"€"]})]}),d.jsx(Oe,{className:"w-full",size:"lg",children:"Commander"}),d.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Paiement sécurisé par Stripe"})]})]})]})]})})}),d.jsx("section",{className:"py-6 border-b border-border sticky top-16 lg:top-20 bg-background/95 backdrop-blur z-40",children:d.jsx("div",{className:"container",children:d.jsx("div",{className:"flex flex-wrap gap-2",children:nfe.map(p=>d.jsx(Oe,{variant:t===p?"default":"outline",size:"sm",onClick:()=>r(p),children:p},p))})})}),d.jsx("section",{className:"py-12 lg:py-16",children:d.jsx("div",{className:"container",children:d.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:a.map(p=>d.jsxs(On,{className:"overflow-hidden group hover:shadow-elevated transition-all duration-300",children:[d.jsxs("div",{className:"relative aspect-square overflow-hidden bg-muted",children:[d.jsx("img",{src:p.image,alt:p.name,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),!p.inStock&&d.jsx("div",{className:"absolute inset-0 bg-background/80 flex items-center justify-center",children:d.jsx(Nl,{variant:"secondary",children:"Rupture de stock"})})]}),d.jsxs(Mn,{className:"p-4",children:[d.jsx("span",{className:"text-xs font-medium text-primary uppercase tracking-wider",children:p.category}),d.jsx("h3",{className:"font-display text-lg font-semibold text-foreground mt-1 group-hover:text-primary transition-colors",children:p.name}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:p.description}),d.jsxs("div",{className:"flex items-center justify-between mt-4",children:[d.jsxs("span",{className:"text-xl font-bold text-foreground",children:[p.price,"€"]}),d.jsxs(Oe,{size:"sm",disabled:!p.inStock,onClick:()=>o(p),children:[d.jsx(k5,{className:"h-4 w-4 mr-1"}),"Ajouter"]})]})]})]},p.id))})})}),d.jsx("section",{className:"py-12 bg-muted/50",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"grid md:grid-cols-3 gap-6 text-center",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-display font-semibold text-foreground mb-2",children:"Livraison"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Retrait gratuit sur place ou livraison à domicile (La Réunion uniquement)."})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-display font-semibold text-foreground mb-2",children:"Paiement sécurisé"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Paiement par carte bancaire via Stripe. Vos données sont protégées."})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-display font-semibold text-foreground mb-2",children:"Soutenez l'association"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"100% des bénéfices sont reversés aux projets de restauration."})]})]})})})]}):d.jsx(jo,{children:d.jsx("section",{className:"min-h-[60vh] flex items-center justify-center py-16",children:d.jsx("div",{className:"container",children:d.jsxs("div",{className:"max-w-lg mx-auto text-center",children:[d.jsx("div",{className:"flex justify-center mb-6",children:d.jsx("div",{className:"p-4 rounded-full bg-primary/10",children:d.jsx(QM,{className:"h-12 w-12 text-primary"})})}),d.jsx("h1",{className:"text-3xl font-display font-bold text-foreground mb-4",children:"Boutique en préparation"}),d.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Notre boutique en ligne est actuellement en cours de préparation. Revenez bientôt pour découvrir nos souvenirs et articles Ti Train !"}),d.jsx(Oe,{asChild:!0,children:d.jsx($n,{to:"/",children:"Retour à l'accueil"})})]})})})})}const ife=()=>{const n=su();return E.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",n.pathname)},[n.pathname]),d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:d.jsxs("div",{className:"text-center",children:[d.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),d.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),d.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};function sfe(){const[n,e]=E.useState(""),[t,r]=E.useState(""),[i,s]=E.useState(!1),{signIn:a}=RT(),o=Np(),{toast:l}=Qd(),c=async u=>{u.preventDefault(),s(!0);const{error:f}=await a(n,t);f?l({variant:"destructive",title:"Erreur de connexion",description:f.message==="Invalid login credentials"?"Email ou mot de passe incorrect":f.message}):o("/admin"),s(!1)};return d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-warm p-4",children:d.jsxs(On,{className:"w-full max-w-md 
650shadow-elevated",children:[d.jsxs(Ra,{className:"text-center space-y-4",children:[d.jsx("div",{className:"mx-auto w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center",children:d.jsx(C5,{className:"w-8 h-8 text-primary"})}),d.jsxs("div",{children:[d.jsx(La,{className:"text-2xl font-display",children:"Backoffice Ti Train"}),d.jsx(Ym,{children:"Administration du site"})]})]}),d.jsx(Mn,{children:d.jsxs("form",{onSubmit:c,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"login-email",children:"Email"}),d.jsx(Rt,{id:"login-email",type:"email",value:n,onChange:u=>e(u.target.value),placeholder:"[email protected]",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"login-password",children:"Mot de passe"}),d.jsx(Rt,{id:"login-password",type:"password",value:t,onChange:u=>r(u.target.value),placeholder:"••••••••",required:!0,minLength:6})]}),d.jsxs(Oe,{type:"submit",className:"w-full",disabled:i,children:[d.jsx(tK,{className:"w-4 h-4 mr-2"}),i?"Connexion...":"Se connecter"]})]})})]})})}const afe=[{to:"/admin",icon:ZG,label:"Tableau de bord",end:!0},{to:"/admin/blog",icon:E5,label:"Blog / Actualités"},{to:"/admin/modal-evenement",icon:Ml,label:"Modal Événement"},{to:"/admin/boutique",icon:k5,label:"Boutique"},{to:"/admin/membres",icon:Mb,label:"Adhérents"},{to:"/admin/galerie",icon:Rl,label:"Galerie"},{to:"/admin/parametres",icon:lK,label:"Paramètres"}];function Rp({children:n}){var o;const{user:e,signOut:t}=RT(),r=Np(),[i,s]=E.useState(!1),a=async()=>{await t(),r("/admin/login")};return d.jsxs("div",{className:"min-h-screen bg-background flex",children:[i&&d.jsx("div",{className:"fixed inset-0 bg-foreground
650/50 z-40 lg:hidden",onClick:()=>s(!1)}),d.jsx("aside",{className:We("fixed lg:static inset-y-0 left-0 z-50 w-64 bg-sidebar text-sidebar-foreground transform transition-transform duration-200 ease-in-out lg:translate-x-0",i?"translate-x-0":"-translate-x-full"),children:d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx("div",{className:"p-4 border-b border-sidebar-border",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 bg-sidebar-primary rounded-lg flex items-center justify-center",children:d.jsx(C5,{className:"w-6 h-6 text-sidebar-primary-foreground"})}),d.jsxs("div",{children:[d.jsx("h1",{className:"font-display font-semibold text-lg",children:"Ti Train"}),d.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:"Backoffice"})]})]}),d.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-lg hover:bg-sidebar-accent transition-colors",title:"Voir le site",children:d.jsx(KG,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})}),d.jsx("nav",{className:"flex-1 p-4 space-y-1",children:afe.map(l=>d.jsxs($Q,{to:l.to,end:l.end,onClick:()=>s(!1),className:({isActive:c})=>We("flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors",c?"bg-sidebar-primary text-sidebar-primary-foreground":"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[d.jsx(l.icon,{className:"w-5 h-5"}),l.label]},l.to))}),d.jsxs("div",{className:"p-4 border-t border-sidebar-border",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.jsx("div",{className:"w-9 h-9 bg-sidebar-accent rounded-full flex items-center justify-center",children:d.jsx("span",{className:"text-sm font-medium",children:(o=e==null?void 0:e.email)==null?void 0:o.charAt(0).toUpperCase()})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-medium truncate",children:e==null?void 0:e.email}),d.jsx("p",{className:"text-xs text-sidebar-foreground/60",children:"Admin"})]})]}),d.jsxs(Oe,{variant:"outline",size:"sm",className:"w-full border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent",onClick:a,children:[d.jsx(nK,{className:"w-4 h-4 mr-2"}),"Déconnexion"]})]})]})}),d.jsxs("div",{className:"flex-1 flex flex-col min-h-screen",children:[d.jsx("header",{className:"lg:hidden sticky top-0 z-30 bg-background border-b border-border p-4",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>s(!i),children:i?d.jsx(Ba,{className:"w-5 h-5"}):d.jsx(t8,{className:"w-5 h-5"})}),d.jsx("h1",{className:"font-display font-semibold",children:"Ti Train Backoffice"})]})}),d.jsx("main",{className:"flex-1 p-4 lg:p-8",children:n})]})]})}function ofe(){const[n,e]=E.useState({articles:0,products:0,members:0,galleryItems:0}),[t,r]=E.useState(!0);E.useEffect(()=>{(async()=>{const[a,o,l,c]=await Promise.all([Xe.from("blog_articles").select("id",{count:"exact",head:!0}),Xe.from("products").select("id",{count:"exact",head:!0}),Xe.from("members").select("id",{count:"exact",head:!0}),Xe.from("gallery_items").select("id",{count:"exact",head:!0})]);e({articles:a.count||0,products:o.count||0,members:l.count||0,galleryItems:c.count||0}),r(!1)})()},[]);const i=[{title:"Articles publiés",value:n.articles,icon:E5,color:"bg-ocean/10 text-ocean"},{title:"Produits",value:n.products,icon:k5,color:"bg-primary/10 text-primary"},{title:"Adhérents",value:n.members,icon:Mb,color:"bg-accent/10 text-accent"},{title:"Photos/Vidéos",value:n.galleryItems,icon:Rl,color:"bg-gold/10 text-gold"}];return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold text-foreground",children:"Tableau de bord"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Bienvenue dans le backoffice Ti Train Réunion"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:i.map(s=>d.jsxs(On,{className:"shadow-card",children:[d.jsxs(Ra,{className:"flex flex-row items-center justify-between pb-2",children:[d.jsx(La,{className:"text-sm font-medium text-muted-foreground",children:s.title}),d.jsx("div",{className:`p-2 rounded-lg ${s.color}`,children:d.jsx(s.icon,{className:"w-4 h-4"})})]}),d.jsx(Mn,{children:d.jsx("div",{className:"text-3xl font-bold",children:t?"—":s.value})})]},s.title))}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{children:d.jsx(La,{children:"Actions rapides"})}),d.jsxs(Mn,{className:"space-y-2",children:[d.jsxs("a",{href:"/admin/blog",className:"block p-3 rounded-lg bg-secondary hover:bg-secondary/80 transition-colors",children:[d.jsx("span",{className:"font-medium",children:"Nouvel article"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Publier une actualité"})]}),d.jsxs("a",{href:"/admin/boutique",className:"block p-3 rounded-lg bg-secondary hover:bg-secondary/80 transition-colors",children:[d.jsx("span",{className:"font-medium",children:"Nouveau produit"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Ajouter à la boutique"})]}),d.jsxs("a",{href:"/admin/galerie",className:"block p-3 rounded-lg bg-secondary hover:bg-secondary/80 transition-colors",children:[d.jsx("span",{className:"font-medium",children:"Ajouter des médias"}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Photos ou vidéos YouTube"})]})]})]}),d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{children:d.jsx(La,{children:"Aide"})}),d.jsxs(Mn,{className:"space-y-3 text-sm text-muted-foreground",children:[d.jsxs("p",{children:[d.jsx("strong",{className:"text-foreground",children:"Blog :"})," Gérez vos articles et actualités. Les articles non publiés ne sont pas visibles sur le site."]}),d.jsxs("p",{children:[d.jsx("strong",{className:"text-foreground",children:"Boutique :"})," Ajoutez vos produits avec prix, description et images. Gérez les stocks."]}),d.jsxs("p",{children:[d.jsx("strong",{className:"text-foreground",children:"Adhérents :"})," Consultez la liste des membres et leurs abonnements."]}),d.jsxs("p",{children:[d.jsx("strong",{className:"text-foreground",children:"Galerie :"})," Créez des albums et ajoutez photos ou vidéos YouTube."]})]})]})]})]})})}const lfe={maxWidth:1920,maxHeight:1080,quality:.8,outputFormat:"image/webp"},cfe=n=>new Promise((e,t)=>
650{const r=new Image;r.onload=()=>e(r),r.onerror=t,r.src=URL.createObjectURL(n)}),ufe=(n,e,t,r)=>{let i=n,s=e;if(n>t||e>r){const a=t/n,o=r/e,l=Math.min(a,o);i=Math.round(n*l),s=Math.round(e*l)}return{width:i,height:s}},D9=async(n,e={})=>{const t={...lfe,...e},r=n.size;if(n.type==="image/gif")return{blob:n,originalSize:r,compressedSize:n.size};try{const i=await cfe(n),{width:s,height:a}=ufe(i.naturalWidth,i.naturalHeight,t.maxWidth,t.maxHeight),o=document.createElement("canvas");o.width=s,o.height=a;const l=o.getContext("2d");if(!l)throw new Error("Could not get canvas context");l.imageSmoothingEnabled=!0,l.imageSmoothingQuality="high",l.drawImage(i,0,0,s,a),URL.revokeObjectURL(i.src);const c=await new Promise((u,f)=>{o.toBlob(p=>{p?u(p):f(new Error("Failed to compress image"))},t.outputFormat,t.quality)});return c.size>r?{blob:n,originalSize:r,compressedSize:n.size}:{blob:c,originalSize:r,compressedSize:c.size}}catch(i){return console.error("Image compression error:",i),{blob:n,originalSize:r,compressedSize:n.size}}},_1=n=>n<1024?`${n} o`:n<1024*1024?`${(n/1024).toFixed(1)} Ko`:`${(n/(1024*1024)).toFixed(1)} Mo`,F9=(n,e)=>n===0?0:Math.round((1-e/n)*100);function B9({value:n,onChange:e,folder:t="images",label:r="Image"}){const[i,s]=E.useState(!1),[a,o]=E.useState(!1),[l,c]=E.useState(null),[u,f]=E.useState(null),p=E.useRef(null),h=async w=>{var x;const y=(x=w.target.files)==null?void 0:x[0];if(y){if(!y.type.startsWith("image/")){c("Veuillez sélectionner une image");return}if(y.size>10*1024*1024){c("L'image ne doit pas dépasser 10 Mo");return}c(null),f(null),o(!0);try{const{blob:S,originalSize:A,compressedSize:C}=await D9(y,{maxWidth:1920,maxHeight:1080,quality:.85,outputFormat:"image/webp"});f({original:A,compressed:C}),o(!1),s(!0);const T=`${t}/${Date.now()}-${Math.random().toString(36).substring(7)}.webp`,{error:R}=await Xe.storage.from("uploads").upload(T,S,{contentType:"image/webp"});if(R)throw R;const{data:{publicUrl:I}}=Xe.storage.from("uploads").getPublicUrl(T);e(I)}catch(S){console.error("Upload error:",S),c("Erreur lors de l'upload")}finally{o(!1),s(!1),p.current&&(p.current.value="")}}},b=()=>{e(""),f(null)},g=u?F9(u.original,u.compressed):0;return d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:r}),n?d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"relative inline-block",children:[d.jsx("img",{src:n,alt:"Preview",className:"w-full max-w-xs h-32 object-cover rounded-md border"}),d.jsx(Oe,{type:"button",variant:"destructive",size:"icon",className:"absolute -top-2 -right-2 h-6 w-6",onClick:b,children:d.jsx(Ba,{className:"w-3 h-3"})})]}),u&&g>0&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-accent/50 rounded-md px-3 py-1.5 w-fit",children:[d.jsx(zG,{className:"w-3.5 h-3.5 text-green-600"}),d.jsxs("span",{children:["Image optimisée : ",_1(u.original)," → ",_1(u.compressed),d.jsxs("span",{className:"text-green-600 font-medium ml-1",children:["(-",g,"%)"]})]})]})]}):d.jsx("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-6 text-center cursor-pointer hover:border-muted-foreground/50 transition-colors",onClick:()=>{var w;return(w=p.current)==null?void 0:w.click()},children:a?d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx(U1,{className:"w-8 h-8 animate-spin text-muted-foreground"}),d.jsx("span",{className:"text-sm text-muted-foreground",children:"Optimisation en cours..."})]}):i?d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx(U1,{className:"w-8 h-8 animate-spin text-muted-foreground"}),d.jsx("span",{className:"text-sm text-muted-foreground",children:"Upload en cours..."})]}):d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx(ON,{className:"w-8 h-8 text-muted-foreground"}),d.jsx("span",{className:"text-sm text-muted-foreground",children:"Cliquez pour uploader une image"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:"JPG, PNG, WebP • Max 10 Mo • Auto-optimisée"})]})}),d.jsx(Rt,{ref:p,type:"file",accept:"image/*",onChange:h,className:"hidden"}),l&&d.jsx("p",{className:"text-sm text-destructive",children:l})]})}
vendor: 5,078 bytes, line 650
650var yS="Popover",[$9,age]=cs(yS,[M0]),ew=M0(),[dfe,nh]=$9(yS),U9=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=n,o=ew(e),l=E.useRef(null),[c,u]=E.useState(!1),[f,p]=Fa({prop:r,defaultProp:i??!1,onChange:s,caller:yS});return d.jsx(O8,{...o,children:d.jsx(dfe,{scope:e,contentId:Po(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>u(!0),[]),onCustomAnchorRemove:E.useCallback(()=>u(!1),[]),modal:a,children:t})})};U9.displayName=yS;var z9="PopoverAnchor",hfe=E.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=nh(z9,t),s=ew(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return E.useEffect(()=>(a(),()=>o()),[a,o]),d.jsx(R5,{...s,...r,ref:e})});hfe.displayName=z9;var q9="PopoverTrigger",H9=E.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=nh(q9,t),s=ew(t),a=Xt(e,i.triggerRef),o=d.jsx(yt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Y9(i.open),...r,ref:a,onClick:rt(n.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:d.jsx(R5,{asChild:!0,...s,children:o})});H9.displayName=q9;var SP="PopoverPortal",[ffe,pfe]=$9(SP,{forceMount:void 0}),W9=n=>{const{__scopePopover:e,forceMount:t,children:r,container:i}=n,s=nh(SP,e);return d.jsx(ffe,{scope:e,forceMount:t,children:d.jsx(Do,{present:t||s.open,children:d.jsx(Rb,{asChild:!0,container:i,children:r})})})};W9.displayName=SP;var k0="PopoverContent",V9=E.forwardRef((n,e)=>{const t=pfe(k0,n.__scopePopover),{forceMount:r=t.forceMount,...i}=n,s=nh(k0,n.__scopePopover);return d.jsx(Do,{present:r||s.open,children:s.modal?d.jsx(gfe,{...i,ref:e}):d.jsx(vfe,{...i,ref:e})})});V9.displayName=k0;var mfe=lp("PopoverContent.RemoveScroll"),gfe=E.forwardRef((n,e)=>{const t=nh(k0,n.__scopePopover),r=E.useRef(null),i=Xt(e,r),s=E.useRef(!1);return E.useEffect(()=>{const a=r.current;if(a)return XT(a)},[]),d.jsx(aS,{as:mfe,allowPinchZoom:!0,children:d.jsx(G9,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(n.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:rt(n.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,c=o.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:rt(n.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),vfe=E.forwardRef((n,e)=>{const t=nh(k0,n.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return d.jsx(G9,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=n.onCloseAutoFocus)==null||a.call(n,s),s.defaultPrevented||(r.current||(o=t.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=n.onInteractOutside)==null||l.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),G9=E.forwardRef((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=n,p=nh(k0,t),h=ew(t);return YT(),d.jsx(iS,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(j0,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:d.jsx(pT,{"data-state":Y9(p.open),role:"dialog",id:p.contentId,...h,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),K9="PopoverClose",yfe=E.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=nh(K9,t);return d.jsx(yt.button,{type:"button",...r,ref:e,onClick:rt(n.onClick,()=>i.onOpenChange(!1))})});yfe.displayName=K9;var bfe="PopoverArrow",wfe=E.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,i=ew(t);return d.jsx(mT,{...i,...r,ref:e})});wfe.displayName=bfe;function Y9(n){return n?"open":"closed"}var xfe=U9,_fe=H9,Sfe=W9,X9=V9;const Afe=xfe,Efe=_fe,J9=E.forwardRef(({className:n,align:e="center",sideOffset:t=4,...r},i)=>d.jsx(Sfe,{children:d.jsx(X9,{ref:i,align:e,sideOffset:t,className:We("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
650de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...r})}));J9.displayName=X9.displayName;function Nfe({onFileUploaded:n}){const[e,t]=E.useState(!1),[r,i]=E.useState(null),[s,a]=E.useState(""),[o,l]=E.useState(""),[c,u]=E.useState(!1),f=E.useRef(null),p=E.useRef(null),{toast:h}=Qd(),b=async y=>{var S;const x=(S=y.target.files)==null?void 0:S[0];if(x){if(!x.type.startsWith("image/")){h({variant:"destructive",title:"Erreur",description:"Veuillez sélectionner une image"});return}if(x.size>10*1024*1024){h({variant:"destructive",title:"Erreur",description:"L'image ne doit pas dépasser 10 Mo"});return}t(!0),i("image");try{const{blob:A,originalSize:C,compressedSize:T}=await D9(x,{maxWidth:1920,maxHeight:1080,quality:.85,outputFormat:"image/webp"}),R=F9(C,T),I=`blog-content/${Date.now()}-${Math.random().toString(36).substring(7)}.webp`,{error:L}=await Xe.storage.from("uploads").upload(I,A,{contentType:"image/webp"});if(L)throw L;const{data:{publicUrl:V}}=Xe.storage.from("uploads").getPublicUrl(I);n({type:"image",url:V,name:x.name}),R>0?h({title:"Image ajoutée",description:`Optimisée : ${_1(C)} → ${_1(T)} (-${R}%)`}):h({title:"Image ajoutée"})}catch(A){console.error("Upload error:",A),h({variant:"destructive",title:"Erreur",description:"Erreur lors de l'upload"})}finally{t(!1),i(null),f.current&&(f.current.value="")}}},g=async y=>{var S;const x=(S=y.target.files)==null?void 0:S[0];if(x){if(x.type!=="application/pdf"){h({variant:"destructive",title:"Erreur",description:"Veuillez sélectionner un fichier PDF"});return}if(x.size>20*1024*1024){h({variant:"destructive",title:"Erreur",description:"Le PDF ne doit pas dépasser 20 Mo"});return}t(!0),i("pdf");try{const A=`blog-content/${Date.now()}-${Math.random().toString(36).substring(7)}.pdf`,{error:C}=await Xe.storage.from("uploads").upload(A,x,{contentType:"application/pdf"});if(C)throw C;const{data:{publicUrl:T}}=Xe.storage.from("uploads").getPublicUrl(A);n({type:"pdf",url:T,name:x.name}),h({title:"PDF ajouté",description:_1(x.size)})}catch(A){console.error("Upload error:",A),h({variant:"destructive",title:"Erreur",description:"Erreur lors de l'upload"})}finally{t(!1),i(null),p.current&&(p.current.value="")}}},w=()=>{if(!s.trim()){h({variant:"destructive",title:"Erreur",description:"Veuillez entrer une URL"});return}const y=o.trim()||s.trim();n({type:"link",url:s.trim(),name:y}),h({title:"Lien ajouté"}),a(""),l(""),u(!1)};return d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{var y;return(y=f.current)==null?void 0:y.click()},disabled:e,children:[e&&r==="image"?d.jsx(U1,{className:"w-4 h-4 mr-2 animate-spin"}):d.jsx(Rl,{className:"w-4 h-4 mr-2"}),"Image"]}),d.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{var y;return(y=p.current)==null?void 0:y.click()},disabled:e,children:[e&&r==="pdf"?d.jsx(U1,{className:"w-4 h-4 mr-2 animate-spin"}):d.jsx(E5,{className:"w-4 h-4 mr-2"}),"PDF"]}),d.jsxs(Afe,{open:c,onOpenChange:u,children:[d.jsx(Efe,{asChild:!0,children:d.jsxs(Oe,{type:"button",variant:"outline",size:"sm",children:[d.jsx(eK,{className:"w-4 h-4 mr-2"}),"Lien"]})}),d.jsx(J9,{className:"w-80 z-50",align:"start",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"link-url",children:"URL du lien *"}),d.jsx(Rt,{id:"link-url",type:"url",placeholder:"https://example.com",value:s,onChange:y=>a(y.target.value)})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"link-text",children:"Texte du bouton"}),d.jsx(Rt,{id:"link-text",type:"text",placeholder:"Cliquez ici",value:o,onChange:y=>l(y.target.value)}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Si vide, l'URL sera affichée"})]}),d.jsx(Oe,{type:"button",onClick:w,className:"w-full",children:"Insérer le lien"})]})})]}),d.jsx(Rt,{ref:f,type:"file",accept:"image/*",onChange:b,className:"hidden"}),d.jsx(Rt,{ref:p,type:"file",accept:"application/pdf",onChange:g,className:"hidden"})]})}var bS="Switch",[kfe,oge]=cs(bS),[Cfe,Tfe]=kfe(bS),Q9=E.forwardRef((n,e)=>{const{__scopeSwitch:t,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:u,...f}=n,[p,h]=E.useState(null),b=Xt(e,S=>h(S)),g=E.useRef(!1),w=p?u||!!p.closest("form"):!0,[y,x]=Fa({prop:i,defaultProp:s??!1,onChange:c,caller:bS});return d.jsxs(Cfe,{scope:t,checked:y,disabled:o,children:[d.jsx(yt.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":nz(y),"data-disabled":o?"":void 0,disabled:o,value:l,...f,ref:b,onClick:rt(n.onClick,S=>{x(A=>!A),w&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),w&&d.jsx(tz,{control:p,bubbles:!g.current,name:r,value:l,checked:y,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Q9.displayName=bS;var Z9="SwitchThumb",ez=E.forwardRef((n,e)=>{const{__scopeSwitch:t,...r}=n,i=Tfe(Z9,t);return d.jsx(yt.span,{"data-state":nz(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});
vendor: 5,751 bytes, line 650
650ez.displayName=Z9;var Pfe="SwitchBubbleInput",tz=E.forwardRef(({__scopeSwitch:n,control:e,checked:t,bubbles:r=!0,...i},s)=>{const a=E.useRef(null),o=Xt(a,s),l=cP(t),c=dT(e);return E.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==t&&h){const b=new Event("click",{bubbles:r});h.call(u,t),u.dispatchEvent(b)}},[l,t,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...i,tabIndex:-1,ref:o,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});tz.displayName=Pfe;function nz(n){return n?"checked":"unchecked"}var rz=Q9,jfe=ez;const yp=E.forwardRef(({className:n,...e},t)=>d.jsx(rz,{className:We("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",n),...e,ref:t,children:d.jsx(jfe,{className:We("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));yp.displayName=rz.displayName;function XI(n,[e,t]){return Math.min(t,Math.max(e,n))}var Rfe=[" ","Enter","ArrowUp","ArrowDown"],Lfe=[" ","Enter"],bp="Select",[wS,xS,Ife]=S5(bp),[H0,lge]=cs(bp,[Ife,M0]),_S=M0(),[Ofe,rh]=H0(bp),[Mfe,Dfe]=H0(bp),iz=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:h,form:b}=n,g=_S(e),[w,y]=E.useState(null),[x,S]=E.useState(null),[A,C]=E.useState(!1),T=Kb(c),[R,I]=Fa({prop:r,defaultProp:i??!1,onChange:s,caller:bp}),[L,V]=Fa({prop:a,defaultProp:o,onChange:l,caller:bp}),j=E.useRef(null),$=w?b||!!w.closest("form"):!0,[J,H]=E.useState(new Set),le=Array.from(J).map(oe=>oe.props.value).join(";");return d.jsx(O8,{...g,children:d.jsxs(Ofe,{required:h,scope:e,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:A,onValueNodeHasChildrenChange:C,contentId:Po(),value:L,onValueChange:V,open:R,onOpenChange:I,dir:T,triggerPointerDownPosRef:j,disabled:p,children:[d.jsx(wS.Provider,{scope:e,children:d.jsx(Mfe,{scope:n.__scopeSelect,onNativeOptionAdd:E.useCallback(oe=>{H(se=>new Set(se).add(oe))},[]),onNativeOptionRemove:E.useCallback(oe=>{H(se=>{const O=new Set(se);return O.delete(oe),O})},[]),children:t})}),$?d.jsxs(Cz,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:L,onChange:oe=>V(oe.target.value),disabled:p,form:b,children:[L===void 0?d.jsx("option",{value:""}):null,Array.from(J)]},le):null]})})};iz.displayName=bp;var sz="SelectTrigger",az=E.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=_S(t),a=rh(sz,t),o=a.disabled||r,l=Xt(e,a.onTriggerChange),c=xS(t),u=E.useRef("touch"),[f,p,h]=Pz(g=>{const w=c().filter(S=>!S.disabled),y=w.find(S=>S.value===a.value),x=jz(w,g,y);x!==void 0&&a.onValueChange(x.value)}),b=g=>{o||(a.onOpenChange(!0),h()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return d.jsx(R5,{asChild:!0,...s,children:d.jsx(yt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Tz(a.value)?"":void 0,...i,ref:l,onClick:rt(i.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&b(g)}),onPointerDown:rt(i.onPointerDown,g=>{u.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:rt(i.onKeyDown,g=>{const w=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(w&&g.key===" ")&&Rfe.includes(g.key)&&(b(),g.preventDefault())})})})});az.displayName=sz;var oz="SelectValue",lz=E.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:a="",...o}=n,l=rh(oz,t),{onValueNodeHasChildrenChange:c}=l,u=s!==void 0,f=Xt(e,l.onValueNodeChange);return li(()=>{c(u)},[c,u]),d.jsx(yt.span,{...o,ref:f,style:{pointerEvents:"none"},children:Tz(l.value)?d.jsx(d.Fragment,{children:a}):s})});lz.displayName=oz;var Ffe="SelectIcon",cz=E.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return d.jsx(yt.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});cz.displayName=Ffe;var Bfe="SelectPortal",uz=n=>d.jsx(Rb,{asChild:!0,...n});uz.displayName=Bfe;var wp="SelectContent",dz=E.forwardRef((n,e)=>{const t=rh(wp,n.__scopeSelect),[r,i]=E.useState();if(li(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?Ep.createPortal(d.jsx(hz,{scope:n.__scopeSelect,children:d.jsx(wS.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),s):null}return d.jsx(fz,{...n,ref:e})});dz.displayName=wp;var no=10,[hz,ih]=H0(wp),$fe="SelectContentImpl",Ufe=lp("SelectContent.RemoveScroll"),fz=E.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:w,...y}=n,x=rh(wp,t),[S,A]=E.useState(null),[C,T]=E.useState(null),R=Xt(e,Q=>A(Q)),[I,L]=E.useState(null),[V,j]=E.useState(null),$=xS(t),[J,H]=E.useState(!1),le=E.useRef(!1);E.useEffect(()=>{if(S)return XT(S)},[S]),YT();const oe=E.useCallback(Q=>{const[ue,...pe]=$().map(Ee=>
vendor: 14,041 bytes, line 650
650Ee.ref.current),[me]=pe.slice(-1),_e=document.activeElement;for(const Ee of Q)if(Ee===_e||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===ue&&C&&(C.scrollTop=0),Ee===me&&C&&(C.scrollTop=C.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==_e))return},[$,C]),se=E.useCallback(()=>oe([I,S]),[oe,I,S]);E.useEffect(()=>{J&&se()},[J,se]);const{onOpenChange:O,triggerPointerDownPosRef:te}=x;E.useEffect(()=>{if(S){let Q={x:0,y:0};const ue=me=>{var _e,Ee;Q={x:Math.abs(Math.round(me.pageX)-(((_e=te.current)==null?void 0:_e.x)??0)),y:Math.abs(Math.round(me.pageY)-(((Ee=te.current)==null?void 0:Ee.y)??0))}},pe=me=>{Q.x<=10&&Q.y<=10?me.preventDefault():S.contains(me.target)||O(!1),document.removeEventListener("pointermove",ue),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",pe,{capture:!0})}}},[S,O,te]),E.useEffect(()=>{const Q=()=>O(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[O]);const[he,ge]=Pz(Q=>{const ue=$().filter(_e=>!_e.disabled),pe=ue.find(_e=>_e.ref.current===document.activeElement),me=jz(ue,Q,pe);me&&setTimeout(()=>me.ref.current.focus())}),D=E.useCallback((Q,ue,pe)=>{const me=!le.current&&!pe;(x.value!==void 0&&x.value===ue||me)&&(L(Q),me&&(le.current=!0))},[x.value]),G=E.useCallback(()=>S==null?void 0:S.focus(),[S]),ee=E.useCallback((Q,ue,pe)=>{const me=!le.current&&!pe;(x.value!==void 0&&x.value===ue||me)&&j(Q)},[x.value]),ae=r==="popper"?JC:pz,X=ae===JC?{side:o,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:w}:{};return d.jsx(hz,{scope:t,content:S,viewport:C,onViewportChange:T,itemRefCallback:D,selectedItem:I,onItemLeave:G,itemTextRefCallback:ee,focusSelectedItem:se,selectedItemText:V,position:r,isPositioned:J,searchRef:he,children:d.jsx(aS,{as:Ufe,allowPinchZoom:!0,children:d.jsx(iS,{asChild:!0,trapped:x.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:rt(i,Q=>{var ue;(ue=x.trigger)==null||ue.focus({preventScroll:!0}),Q.preventDefault()}),children:d.jsx(j0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:d.jsx(ae,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Q=>Q.preventDefault(),...y,...X,onPlaced:()=>H(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:rt(y.onKeyDown,Q=>{const ue=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ue&&Q.key.length===1&&ge(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let me=$().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const _e=Q.target,Ee=me.indexOf(_e);me=me.slice(Ee+1)}setTimeout(()=>oe(me)),Q.preventDefault()}})})})})})})});fz.displayName=$fe;var zfe="SelectItemAlignedPosition",pz=E.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=rh(wp,t),a=ih(wp,t),[o,l]=E.useState(null),[c,u]=E.useState(null),f=Xt(e,R=>u(R)),p=xS(t),h=E.useRef(!1),b=E.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:y,focusSelectedItem:x}=a,S=E.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&c&&g&&w&&y){const R=s.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),V=y.getBoundingClientRect();if(s.dir!=="rtl"){const _e=V.left-I.left,Ee=L.left-_e,ye=R.left-Ee,Re=R.width+ye,Y=Math.max(Re,I.width),Te=window.innerWidth-no,it=XI(Ee,[no,Math.max(no,Te-Y)]);o.style.minWidth=Re+"px",o.style.left=it+"px"}else{const _e=I.right-V.right,Ee=window.innerWidth-L.right-_e,ye=window.innerWidth-R.right-Ee,Re=R.width+ye,Y=Math.max(Re,I.width),Te=window.innerWidth-no,it=XI(Ee,[no,Math.max(no,Te-Y)]);o.style.minWidth=Re+"px",o.style.right=it+"px"}const j=p(),$=window.innerHeight-no*2,J=g.scrollHeight,H=window.getComputedStyle(c),le=parseInt(H.borderTopWidth,10),oe=parseInt(H.paddingTop,10),se=parseInt(H.borderBottomWidth,10),O=parseInt(H.paddingBottom,10),te=le+oe+J+O+se,he=Math.min(w.offsetHeight*5,te),ge=window.getComputedStyle(g),D=parseInt(ge.paddingTop,10),G=parseInt(ge.paddingBottom,10),ee=R.top+R.height/2-no,ae=$-ee,X=w.offsetHeight/2,Q=w.offsetTop+X,ue=le+oe+Q,pe=te-ue;if(ue<=ee){const _e=j.length>0&&w===j[j.length-1].ref.current;o.style.bottom="0px";const Ee=c.clientHeight-g.offsetTop-g.offsetHeight,ye=Math.max(ae,X+(_e?G:0)+Ee+se),Re=ue+ye;o.style.height=Re+"px"}else{const _e=j.length>0&&w===j[0].ref.current;o.style.top="0px";const ye=Math.max(ee,le+g.offsetTop+(_e?D:0)+X)+pe;o.style.height=ye+"px",g.scrollTop=ue-ee+g.offsetTop}o.style.margin=`${no}px 0`,o.style.minHeight=he+"px",o.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,o,c,g,w,y,s.dir,r]);li(()=>S(),[S]);const[A,C]=E.useState();li(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const T=E.useCallback(R=>{R&&b.current===!0&&(S(),x==null||x(),b.current=!1)},[S,x]);return d.jsx(Hfe,{scope:t,contentWrapper:o,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:d.jsx(yt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});pz.displayName=zfe;var qfe="SelectPopperPosition",JC=E.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=no,...s}=n,a=_S(t);return d.jsx(pT,{...a,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});JC.displayName=qfe;var[Hfe,AP]=H0(wp,{}),QC="SelectViewport",mz=E.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...i}=n,s=ih(QC,t),a=AP(QC,t),o=Xt(e,s.onViewportChange),l=E.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(wS.Slot,{scope:t,children:d.jsx(yt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:rt(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const h=Math.abs(l.current-u.scrollTop);if(h>0){const b=window.innerHeight-no*2,g=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),y=Math.max(g,w);if(y<b){const x=y+h,S=Math.min(b,x),A=x-S;f.style.height=S+"px",f.style.bottom==="0px"&&(u.scrollTop=A>0?A:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});mz.displayName=QC;var gz="SelectGroup",[Wfe,Vfe]=H0(gz),Gfe=E.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=Po();return d.jsx(Wfe,{scope:t,id:i,children:d.jsx(yt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});Gfe.displayName=gz;var vz="SelectLabel",yz=E.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=Vfe(vz,t);return d.jsx(yt.div,{id:i.id,...r,ref:e})});yz.displayName=vz;var z_="SelectItem",[Kfe,bz]=H0(z_),wz=E.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...a}=n,o=rh(z_,t),l=ih(z_,t),c=o.value===r,[u,f]=E.useState(s??""),[p,h]=E.useState(!1),b=Xt(e,x=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,x,r,i)}),g=Po(),w=E.useRef("touch"),y=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Kfe,{scope:t,value:r,disabled:i,textId:g,isSelected:c,onItemTextChange:E.useCallback(x=>{f(S=>S||((x==null?void 0:x.textContent)??"").trim())},[]),children:d.jsx(wS.ItemSlot,{scope:t,value:r,disabled:i,textValue:u,children:d.jsx(yt.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:b,onFocus:rt(a.onFocus,()=>h(!0)),onBlur:rt(a.onBlur,()=>h(!1)),onClick:rt(a.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:rt(a.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:rt(a.onPointerDown,x=>{w.current=x.pointerType}),onPointerMove:rt(a.onPointerMove,x=>{var S;w.current=x.pointerType,i?(S=l.onItemLeave)==null||S.call(l):w.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:rt(a.onPointerLeave,x=>{var S;x.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:rt(a.onKeyDown,x=>{var A;((A=l.searchRef)==null?void 0:A.current)!==""&&x.key===" "||(Lfe.includes(x.key)&&y(),x.key===" "&&x.preventDefault())})})})})});wz.displayName=z_;var s1="SelectItemText",xz=E.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,a=rh(s1,t),o=ih(s1,t),l=bz(s1,t),c=Dfe(s1,t),[u,f]=E.useState(null),p=Xt(e,y=>f(y),l.onItemTextChange,y=>{var x;return(x=o.itemTextRefCallback)==null?void 0:x.call(o,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,b=E.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=c;return li(()=>(g(b),()=>w(b)),[g,w,b]),d.jsxs(d.Fragment,{children:[d.jsx(yt.span,{id:l.textId,...s,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ep.createPortal(s.children,a.valueNode):null]})});xz.displayName=s1;var _z="SelectItemIndicator",Sz=E.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return bz(_z,t).isSelected?d.jsx(yt.span,{"aria-hidden":!0,...r,ref:e}):null});Sz.displayName=_z;var ZC="SelectScrollUpButton",Az=E.forwardRef((n,e)=>{const t=ih(ZC,n.__scopeSelect),r=AP(ZC,n.__scopeSelect),[i,s]=E.useState(!1),a=Xt(e,r.onScrollButtonChange);return li(()=>{if(t.viewport&&t.isPositioned){let o=function(){const c=l.scrollTop>0;s(c)};const l=t.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[t.viewport,t.isPositioned]),i?d.jsx(Nz,{...n,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=t;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});Az.displayName=ZC;var e4="SelectScrollDownButton",Ez=E.forwardRef((n,e)=>{const t=ih(e4,n.__scopeSelect),r=AP(e4,n.__scopeSelect),[i,s]=E.useState(!1),a=Xt(e,r.onScrollButtonChange);return li(()=>{if(t.viewport&&t.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;s(u)};const l=t.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[t.viewport,t.isPositioned]),i?d.jsx(Nz,{...n,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=t;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});Ez.displayName=e4;var Nz=E.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...i}=n,s=ih("SelectScrollButton",t),a=E.useRef(null),o=xS(t),l=E.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),li(()=>{var u;const c=o().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[o]),d.jsx(yt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:rt(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:rt(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:rt(i.onPointerLeave,()=>{l()})})}),Yfe="SelectSeparator",kz=E.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return d.jsx(yt.div,{"aria-hidden":!0,...r,ref:e})});kz.displayName=Yfe;var t4="SelectArrow",Xfe=E.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=_S(t),s=rh(t4,t),a=ih(t4,t);return s.open&&a.position==="popper"?d.jsx(mT,{...i,...r,ref:e}):null});Xfe.displayName=t4;var Jfe="SelectBubbleInput",Cz=E.forwardRef(({__scopeSelect:n,value:e,...t},r)=>{const i=E.useRef(null),s=Xt(r,i),a=cP(e);return E.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const f=new Event("change",{bubbles:!0});u.call(o,e),o.dispatchEvent(f)}},[a,e]),d.jsx(yt.select,{...t,style:{...TM,...t.style},ref:s,defaultValue:e})});Cz.displayName=Jfe;function Tz(n){return n===""||n===void 0}function Pz(n){const e=Da(n),t=E.useRef(""),r=E.useRef(0),i=E.useCallback(a=>{const o=t.current+a;e(o),function l(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[e]),s=E.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function jz(n,e,t){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let a=Qfe(n,Math.max(s,0));i.length===1&&(a=a.filter(c=>c!==t));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==t?l:void 0}function Qfe(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var Zfe=iz,Rz=az,epe=lz,tpe=cz,npe=uz,Lz=dz,rpe=mz,Iz=yz,Oz=wz,ipe=xz,spe=Sz,Mz=Az,Dz=Ez,Fz=kz;const ape=Zfe,ope=epe,Bz=E.forwardRef(({className:n,children:e,...t},r)=>d.jsxs(Rz,{ref:r,className:We("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
650ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...t,children:[e,d.jsx(tpe,{asChild:!0,children:d.jsx(eT,{className:"h-4 w-4 opacity-50"})})]}));Bz.displayName=Rz.displayName;const $z=E.forwardRef(({className:n,...e},t)=>d.jsx(Mz,{ref:t,className:We("flex cursor-default items-center justify-center py-1",n),...e,children:d.jsx(UG,{className:"h-4 w-4"})}));$z.displayName=Mz.displayName;const Uz=E.forwardRef(({className:n,...e},t)=>d.jsx(Dz,{ref:t,className:We("flex cursor-default items-center justify-center py-1",n),...e,children:d.jsx(eT,{className:"h-4 w-4"})}));Uz.displayName=Dz.displayName;const zz=E.forwardRef(({className:n,children:e,position:t="popper",...r},i)=>d.jsx(npe,{children:d.jsxs(Lz,{ref:i,className:We("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...r,children:[d.jsx($z,{}),d.jsx(rpe,{className:We("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),d.jsx(Uz,{})]})}));zz.displayName=Lz.displayName;const lpe=E.forwardRef(({className:n,...e},t)=>d.jsx(Iz,{ref:t,className:We("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));lpe.displayName=Iz.displayName;const qz=E.forwardRef(({className:n,children:e,...t},r)=>d.jsxs(Oz,{ref:r,className:We("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",n),...t,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(spe,{children:d.jsx(JM,{className:"h-4 w-4"})})}),d.jsx(ipe,{children:e})]}));qz.displayName=Oz.displayName;const cpe=E.forwardRef(({className:n,...e},t)=>d.jsx(Fz,{ref:t,className:We("-mx-1 my-1 h-px bg-muted",n),...e}));cpe.displayName=Fz.displayName;var SS="Tabs",[upe,cge]=cs(SS,[hS]),Hz=hS(),[dpe,EP]=upe(SS),Wz=E.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...c}=n,u=Kb(o),[f,p]=Fa({prop:r,onChange:i,defaultProp:s??"",caller:SS});return d.jsx(dpe,{scope:t,baseId:Po(),value:f,onValueChange:p,orientation:a,dir:u,activationMode:l,children:d.jsx(yt.div,{dir:u,"data-orientation":a,...c,ref:e})})});Wz.displayName=SS;var Vz="TabsList",Gz=E.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...i}=n,s=EP(Vz,t),a=Hz(t);return d.jsx(aU,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:d.jsx(yt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});Gz.displayName=Vz;var Kz="TabsTrigger",Yz=E.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:i=!1,...s}=n,a=EP(Kz,t),o=Hz(t),l=Qz(a.baseId,r),c=Zz(a.baseId,r),u=r===a.value;return d.jsx(oU,{asChild:!0,...o,focusable:!i,active:u,children:d.jsx(yt.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:e,onMouseDown:rt(n.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:rt(n.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:rt(n.onFocus,()=>{const f=a.activationMode!=="manual";!u&&!i&&f&&a.onValueChange(r)})})})});Yz.displayName=Kz;var Xz="TabsContent",Jz=E.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:i,children:s,...a}=n,o=EP(Xz,t),l=Qz(o.baseId,r),c=Zz(o.baseId,r),u=r===o.value,f=E.useRef(u);return E.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(Do,{present:i||u,children:({present:p})=>d.jsx(yt.div,{"data-state":u?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...a,ref:e,style:{...n.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});Jz.displayName=Xz;function Qz(n,e){return`${n}-trigger-${e}`}function Zz(n,e){return`${n}-content-${e}`}var hpe=Wz,eq=Gz,tq=Yz,nq=Jz;const rq=hpe,NP=E.forwardRef(({className:n,...e},t)=>d.jsx(eq,{ref:t,className:We("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));NP.displayName=eq.displayName;const oy=E.forwardRef(({className:n,...e},t)=>d.jsx(tq,{ref:t,className:We("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",n),...e}));oy.displayName=tq.displayName;const ly=E.forwardRef(({className:n,...e},t)=>d.jsx(nq,{ref:t,className:We("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));
650ly.displayName=nq.displayName;function fpe(){const[n,e]=E.useState([]),[t,r]=E.useState([]),[i,s]=E.useState(!0),[a,o]=E.useState(!1),[l,c]=E.useState(!1),[u,f]=E.useState(null),[p,h]=E.useState(null),{toast:b}=Qd(),g=E.useRef(null),[w,y]=E.useState({title:"",slug:"",excerpt:"",content:"",cover_image_url:"",published:!1,published_at:new Date,category_id:""}),[x,S]=E.useState({name:"",slug:"",color:"#6366f1"});E.useEffect(()=>{A(),C()},[]);const A=async()=>{const{data:O,error:te}=await Xe.from("blog_articles").select("*, category:blog_categories(*)").order("is_featured",{ascending:!1}).order("published_at",{ascending:!1,nullsFirst:!1});te?b({variant:"destructive",title:"Erreur",description:te.message}):e(O||[]),s(!1)},C=async()=>{const{data:O,error:te}=await Xe.from("blog_categories").select("*").order("sort_order",{ascending:!0});te?b({variant:"destructive",title:"Erreur",description:te.message}):r(O||[])},T=O=>O.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),R=async O=>{O.preventDefault();const te={title:w.title,slug:w.slug||T(w.title),excerpt:w.excerpt,content:w.content,cover_image_url:w.cover_image_url,published:w.published,published_at:w.published_at.toISOString(),category_id:w.category_id||null};if(u){const{error:he}=await Xe.from("blog_articles").update(te).eq("id",u.id);he?b({variant:"destructive",title:"Erreur",description:he.message}):(b({title:"Article mis à jour"}),o(!1),A())}else{const{error:he}=await Xe.from("blog_articles").insert(te);he?b({variant:"destructive",title:"Erreur",description:he.message}):(b({title:"Article créé"}),o(!1),A())}},I=async O=>{if(!confirm("Supprimer cet article ?"))return;const{error:te}=await Xe.from("blog_articles").delete().eq("id",O);te?b({variant:"destructive",title:"Erreur",description:te.message}):(b({title:"Article supprimé"}),A())},L=async O=>{const{error:te}=await Xe.from("blog_articles").update({published:!O.published,published_at:O.published?null:new Date().toISOString()}).eq("id",O.id);te?b({variant:"destructive",title:"Erreur",description:te.message}):A()},V=async O=>{const{error:te}=await Xe.from("blog_articles").update({is_featured:!O.is_featured}).eq("id",O.id);te?b({variant:"destructive",title:"Erreur",description:te.message}):A()},j=O=>{f(O),y({title:O.title,slug:O.slug,excerpt:O.excerpt||"",content:O.content||"",cover_image_url:O.cover_image_url||"",published:O.published,published_at:O.published_at?new Date(O.published_at):new Date,category_id:O.category_id||""}),o(!0)},$=()=>{f(null),y({title:"",slug:"",excerpt:"",content:"",cover_image_url:"",published:!1,published_at:new Date,category_id:""}),o(!0)},J=async O=>{O.preventDefault();const te={name:x.name,slug:x.slug||T(x.name),color:x.color};if(p){const{error:he}=await Xe.from("blog_categories").update(te).eq("id",p.id);he?b({variant:"destructive",title:"Erreur",description:he.message}):(b({title:"Catégorie mise à jour"}),c(!1),C())}else{const{error:he}=await Xe.from("blog_categories").insert(te);he?b({variant:"destructive",title:"Erreur",description:he.message}):(b({title:"Catégorie créée"}),c(!1),C())}},H=async O=>{if(!confirm("Supprimer cette catégorie ?"))return;const{error:te}=await Xe.from("blog_categories").delete().eq("id",O);te?b({variant:"destructive",title:"Erreur",description:te.message}):(b({title:"Catégorie supprimée"}),C())},le=()=>{h(null),S({name:"",slug:"",color:"#6366f1"}),c(!0)},oe=O=>{h(O),S({name:O.name,slug:O.slug,color:O.color}),c(!0)},se=O=>{let te;O.type==="image"?te=`[IMAGE:${O.url}]`:O.type==="pdf"?te=`[PDF:${O.url}]`:te=`[LIEN:${O.url}:${O.name}]`;const he=g.current;if(he){const ge=he.selectionStart,D=he.selectionEnd,G=w.content,ee=G.slice(0,ge)+`
651`+te+`
652`+G.slice(D);y({...w,content:ee}),setTimeout(()=>{he.focus();const ae=ge+te.length+2;he.setSelectionRange(ae,ae)},0)}else y({...w,content:w.content+`
653`+te+`
654`})};return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold",children:"Blog / Actualités"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Gérez vos articles et catégories"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ua,{open:l,onOpenChange:c,children:[d.jsx(Q1,{asChild:!0,children:d.jsxs(Oe,{variant:"outline",onClick:le,children:[d.jsx(dK,{className:"w-4 h-4 mr-2"}),"Catégories"]})}),d.jsxs(aa,{children:[d.jsx(Zc,{children:d.jsx(Fl,{children:p?"Modifier la catégorie":"Nouvelle catégorie"})}),d.jsxs("form",{onSubmit:J,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Nom *"}),d.jsx(Rt,{value:x.name,onChange:O=>S({...x,name:O.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Slug URL"}),d.jsx(Rt,{value:x.slug,onChange:O=>S({...x,slug:O.target.value}),placeholder:"Généré automatiquement si vide"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Couleur"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Rt,{type:"color",value:x.color,onChange:O=>S({...x,color:O.target.value}),className:"w-16 h-10 p-1"}),d.jsx(Rt,{value:x.color,onChange:O=>S({...x,color:O.target.value}),className:"flex-1"})]})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[d.jsx(Oe,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Annuler"}),d.jsx(Oe,{type:"submit",children:p?"Enregistrer":"Créer"})]})]}),t.length>0&&d.jsxs("div",{className:"border-t pt-4 mt-4",children:[d.jsx("h4",{className:"font-medium mb-3",children:"Catégories existantes"}),d.jsx("div",{className:"space-y-2",children:t.map(O=>d.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-muted/50",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:O.color}}),d.jsx("span",{children:O.name})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>oe(O),children:d.jsx(g0,{className:"w-4 h-4"})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>H(O.id),children:d.jsx(tp,{className:"w-4 h-4 text-destructive"})})]})]},O.id))})]})]})]}),d.jsxs(Ua,{open:a,onOpenChange:o,children:[d.jsx(Q1,{asChild:!0,children:d.jsxs(Oe,{onClick:$,children:[d.jsx(v0,{className:"w-4 h-4 mr-2"}),"Nouvel article"]})}),d.jsxs(aa,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[d.jsx(Zc,{children:d.jsx(Fl,{children:u?"Modifier l'article":"Nouvel article"})}),d.jsxs("form",{onSubmit:R,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"title",children:"Titre *"}),d.jsx(Rt,{id:"title",value:w.title,onChange:O=>y({...w,title:O.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"slug",children:"Slug URL"}),d.jsx(Rt,{id:"slug",value:w.slug,onChange:O=>y({...w,slug:O.target.value}),placeholder:"Généré automatiquement si vide"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"excerpt",children:"Extrait"}),d.jsx(Wd,{id:"excerpt",value:w.excerpt,onChange:O=>y({...w,excerpt:O.target.value}),rows:2})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(pt,{htmlFor:"content",children:"Contenu"}),d.jsx(Nfe,{onFileUploaded:se})]}),d.jsxs(rq,{defaultValue:"edit",className:"w-full",children:[d.jsxs(NP,{className:"grid w-full grid-cols-2",children:[d.jsx(oy,{value:"edit",children:"Édition"}),d.jsx(oy,{value:"preview",children:"Prévisualisation"})]}),d.jsxs(ly,{value:"edit",className:"mt-2",children:[d.jsx(Wd,{ref:g,id:"content",value:w.content,onChange:O=>y({...w,content:O.target.value}),rows:12,placeholder:"Rédigez votre contenu ici. Utilisez les boutons ci-dessus pour insérer des images ou PDFs optimisés."}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Les balises [IMAGE:url] et [PDF:url] seront automatiquement converties en médias visuels."})]}),d.jsx(ly,{value:"preview",className:"mt-2",children:d.jsx("div",{className:"border rounded-lg p-4 min-h-[300px] bg-background",children:w.
654content?d.jsx(eU,{content:w.content}):d.jsx("p",{className:"text-muted-foreground text-center py-8",children:"Aucun contenu à prévisualiser"})})})]})]}),d.jsx(B9,{label:"Image de couverture",value:w.cover_image_url,onChange:O=>y({...w,cover_image_url:O}),folder:"blog"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Catégorie"}),d.jsxs(ape,{value:w.category_id,onValueChange:O=>y({...w,category_id:O}),children:[d.jsx(Bz,{children:d.jsx(ope,{placeholder:"Sélectionner une catégorie"})}),d.jsx(zz,{children:t.map(O=>d.jsx(qz,{value:O.id,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:O.color}}),O.name]})},O.id))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Date de publication"}),d.jsx("div",{className:"flex gap-2",children:d.jsx(Rt,{type:"date",value:w.published_at?Ro(w.published_at,"yyyy-MM-dd"):"",onChange:O=>{const te=new Date(O.target.value);isNaN(te.getTime())||y({...w,published_at:te})},className:"flex-1"})})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(yp,{id:"published",checked:w.published,onCheckedChange:O=>y({...w,published:O})}),d.jsx(pt,{htmlFor:"published",children:"Publier"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[d.jsx(Oe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Annuler"}),d.jsx(Oe,{type:"submit",children:u?"Enregistrer":"Créer"})]})]})]})]})]})]}),i?d.jsx("p",{children:"Chargement..."}):n.length===0?d.jsx(On,{children:d.jsx(Mn,{className:"py-12 text-center text-muted-foreground",children:"Aucun article. Créez votre premier article !"})}):d.jsx("div",{className:"grid gap-4",children:n.map(O=>d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{className:"pb-2",children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(La,{className:"text-lg",children:O.title}),O.category&&d.jsx(Nl,{variant:"secondary",style:{backgroundColor:O.category.color+"20",color:O.category.color},children:O.category.name})]}),d.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["/",O.slug]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>V(O),title:O.is_featured?"Retirer des favoris":"Mettre en favori",children:d.jsx(uK,{className:`w-4 h-4 ${O.is_featured?"fill-primary text-primary":"text-muted-foreground"}`})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>L(O),title:O.published?"Dépublier":"Publier",children:O.published?d.jsx(IN,{className:"w-4 h-4 text-accent"}):d.jsx(LN,{className:"w-4 h-4 text-muted-foreground"})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>j(O),children:d.jsx(g0,{className:"w-4 h-4"})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>I(O.id),children:d.jsx(tp,{className:"w-4 h-4 text-destructive"})})]})]})}),O.excerpt&&d.jsx(Mn,{className:"pt-0",children:d.jsx("p",{className:"text-sm text-muted-foreground",children:O.excerpt})})]},O.id))})]})})}function ppe(){const[n,e]=E.useState([]),[t,r]=E.useState(!0),[i,s]=E.useState(!1),[a,o]=E.useState(null),{toast:l}=Qd(),[c,u]=E.useState({name:"",slug:"",description:"",price:"",sale_price:"",image_url:"",stock_quantity:"0",active:!0});E.useEffect(()=>{f()},[]);const f=async()=>{const{data:y,error:x}=await Xe.from("products").select("*").order("created_at",{ascending:!1});x?l({variant:"destructive",title:"Erreur",description:x.message}):e(y||[]),r(!1)},p=y=>y.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),h=async y=>{y.preventDefault();const x={name:c.name,slug:c.slug||p(c.name),description:c.description||null,price:parseFloat(c.price),sale_price:c.sale_price?parseFloat(c.sale_price):null,image_url:c.image_url||null,stock_quantity:parseInt(c.stock_quantity),active:c.active};if(a){const{error:S}=await Xe.from("products").update(x).eq("id",a.id);S?l({variant:"destructive",title:"Erreur",description:S.message}):(l({title:"Produit mis à jour"}),s(!1),f())}else{const{error:S}=await Xe.from("products").insert(x);S?l({variant:"destructive",title:"Erreur",description:S.message}):(l({title:"Produit créé"}),s(!1),f())}},b=async y=>{if(!confirm("Supprimer ce produit ?"))return;const{error:x}=await Xe.from("products").delete().eq("id",y);x?l({variant:"destructive",title:"Erreur",description:x.message}):(l({title:"Produit supprimé"}),f())},g=y=>{var x;o(y),u({name:y.name,slug:y.slug,description:y.description||"",price:y.price.toString(),sale_price:((x=y.sale_price)==null?void 0:x.toString())||"",image_url:y.image_url||"",stock_quantity:y.stock_quantity.toString(),active:y.active}),s(!0)},w=()=>{o(null),u({name:"",slug:"",description:"",price:"",sale_price:"",image_url:"",stock_quantity:"0",active:!0}),s(!0)};return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold",children:"Boutique"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Gérez vos produits"})]}),d.jsxs(Ua,{open:i,onOpenChange:s,children:[d.jsx(Q1,{asChild:!0,children:d.jsxs(Oe,{onClick:w,children:[d.jsx(v0,{className:"w-4 h-4 mr-2"}),"Nouveau produit"]})}),d.jsxs(aa,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[d.jsx(Zc,{children:d.jsx(Fl,{children:a?"Modifier le produit":"Nouveau produit"})}),d.jsxs("form",{onSubmit:h,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"name",children:"Nom du produit *"}),d.jsx(Rt,{id:"name",value:c.name,onChange:y=>u({...c,name:y.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"slug",children:"Slug URL"}),d.jsx(Rt,{id:"slug",value:c.slug,onChange:y=>u({...c,slug:y.target.value}),placeholder:"Généré automatiquement si vide"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"description",children:"Description"}),d.jsx(Wd,{id:"description",value:c.description,onChange:y=>u({...c,description:y.target.value}),rows:4})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"price",children:"Prix (€) *"}),d.jsx(Rt,{id:"price",type:"number",step:"0.01",min:"0",value:c.price,onChange:y=>u({...c,price:y.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"sale_price",children:"Prix soldé (€)"}),d.jsx(Rt,{id:"sale_price",type:"number",step:"0.01",min:"0",value:c.sale_price,onChange:y=>u({...c,sale_price:y.target.value})})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"stock",children:"Stock"}),d.jsx(Rt,{id:"stock",type:"number",min:"0",value:c.stock_quantity,onChange:y=>u({...c,stock_quantity:y.target.value})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"image",children:"URL de l'image"}),d.jsx(Rt,{id:"image",type:"url",value:c.image_url,onChange:y=>u({...c,image_url:y.target.value})})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(yp,{id:"active",checked:c.active,onCheckedChange:y=>u({...c,active:y})}),d.jsx(pt,{htmlFor:"active",children:"Produit actif (visible sur le site)"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[d.jsx(Oe,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Annuler"}),d.jsx(Oe,{type:"submit",children:a?"Enregistrer":"Créer"})]})]})]})]})]}),t?d.jsx("p",{children:"Chargement..."}):n.length===0?d.jsx(On,{children:d.jsx(Mn,{className:"py-12 text-center text-muted-foreground",children:"Aucun produit. Ajoutez votre premier produit !"})}):d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:n.map(y=>d.jsxs(On,{className:`shadow-card ${y.active?"":"opacity-60"}`,children:[y.image_url&&d.jsx("div",{className:"aspect-video overflow-hidden rounded-t-lg",children:d.jsx("img",{src:y.image_url,alt:y.name,className:"w-full h-full object-cover"})}),d.jsx(Ra,{className:"pb-2",children:d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsx(La,{className:"text-lg",children:y.name}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>g(y),children:d.jsx(g0,{className:"w-4 h-4"})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>b(y.id),children:d.jsx(tp,{className:"w-4 h-4 text-destructive"})})]})]})}),d.jsxs(Mn,{className:"pt-0 space-y-2",children:[d.jsx("div",{className:"flex items-center gap-2",children:y.sale_price?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-bold text-primary",children:[y.sale_price.toFixed(2)," €"]}),d.jsxs("span",{className:"text-sm text-muted-foreground line-through",children:[y.price.toFixed(2)," €"]})]}):d.jsxs("span",{className:"font-bold",children:[y.price.toFixed(2)," €"]})}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(iK,{className:"w-4 h-4"}),"Stock: ",y.stock_quantity]})]})]},y.id))})]})})}function mpe(){const[n,e]=E.useState([]),[t,r]=E.useState(!0),{toast:i}=Qd();E.useEffect(()=>{s()},[]);const s=async()=>{const{data:o,error:l}=await Xe.from("members").select(`
655        *,
656        membership_types (name, price)
657      `).order("created_at",{ascending:!1});l?i({variant:"destructive",title:"Erreur",description:l.message}):e(o||[]),r(!1)},a=o=>{switch(o){case"active":return d.jsx(Nl,{className:"bg-accent text-accent-foreground",children:"Actif"});
657case"pending":return d.jsx(Nl,{variant:"secondary",children:"En attente"});case"expired":return d.jsx(Nl,{variant:"destructive",children:"Expiré"});case"cancelled":return d.jsx(Nl,{variant:"outline",children:"Annulé"});default:return d.jsx(Nl,{variant:"outline",children:o})}};return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold",children:"Adhérents"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Liste des membres de l'association"})]}),t?d.jsx("p",{children:"Chargement..."}):n.length===0?d.jsx(On,{children:d.jsxs(Mn,{className:"py-12 text-center text-muted-foreground",children:[d.jsx(Mb,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),d.jsx("p",{children:"Aucun adhérent pour le moment."}),d.jsx("p",{className:"text-sm mt-2",children:"Les adhérents apparaîtront ici après leur inscription."})]})}):d.jsx("div",{className:"grid gap-4",children:n.map(o=>d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{className:"pb-2",children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsxs(La,{className:"text-lg",children:[o.first_name," ",o.last_name]}),o.membership_types&&d.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.membership_types.name," — ",o.membership_types.price.toFixed(2)," €/an"]})]}),a(o.status)]})}),d.jsx(Mn,{className:"pt-0",children:d.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4 text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(N5,{className:"w-4 h-4"}),o.email]}),o.phone&&d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(nT,{className:"w-4 h-4"}),o.phone]}),o.start_date&&d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(Ml,{className:"w-4 h-4"}),"Début: ",Ro(new Date(o.start_date),"dd MMM yyyy",{locale:zd})]}),o.end_date&&d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(Ml,{className:"w-4 h-4"}),"Fin: ",Ro(new Date(o.end_date),"dd MMM yyyy",{locale:zd})]})]})})]},o.id))})]})})}function gpe(){const[n,e]=E.useState([]),[t,r]=E.useState([]),[i,s]=E.useState(null),[a,o]=E.useState(!0),[l,c]=E.useState(!1),[u,f]=E.useState(!1),[p,h]=E.useState(null),[b,g]=E.useState(null),[w,y]=E.useState(!1),[x,S]=E.useState(!1),A=E.useRef(null),C=E.useRef(null),{toast:T}=Qd(),[R,I]=E.useState({title:"",slug:"",description:"",published:!0}),[L,V]=E.useState({type:"photo",videoSource:"youtube",title:"",description:"",url:"",video_url:"",thumbnail_url:""});E.useEffect(()=>{j(),$()},[]);const j=async()=>{const{data:X,error:Q}=await Xe.from("gallery_albums").select("*").order("sort_order",{ascending:!0});Q?T({variant:"destructive",title:"Erreur",description:Q.message}):e(X||[]),o(!1)},$=async X=>{let Q=Xe.from("gallery_items").select("*").order("sort_order",{ascending:!0});X&&(Q=Q.eq("album_id",X));const{data:ue,error:pe}=await Q;pe?T({variant:"destructive",title:"Erreur",description:pe.message}):r(ue||[])},J=X=>X.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),H=X=>{const Q=/(?:youtube\.com\/(?:shorts\/|[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,ue=X.match(Q);return ue?ue[1]:null},le=X=>{const Q=/(?:vimeo\.com\/(?:video\/|channels\/[^\/]+\/)?|player\.vimeo\.com\/video\/)(\d+)/,ue=X.match(Q);return ue?ue[1]:null},oe=async X=>{X.preventDefault();const Q={...R,slug:R.slug||J(R.title)};if(p){const{error:ue}=await Xe.from("gallery_albums").update(Q).eq("id",p.id);ue?T({variant:"destructive",title:"Erreur",description:ue.message}):(T({title:"Album mis à jour"}),c(!1),j())}else{const{error:ue}=await Xe.from("gallery_albums").insert(Q);ue?T({variant:"destructive",title:"Erreur",description:ue.message}):(T({title:"Album créé"}),c(!1),j())}},se=async X=>{X.preventDefault();let Q=L.url,ue=null,pe=L.thumbnail_url||null;if(L.type==="video"&&L.video_url){const _e=H(L.video_url);if(_e)ue=_e,Q=`https://www.youtube.com/watch?v=${ue}`,pe||(pe=`https://i.ytimg.com/vi/${ue}/hqdefault.jpg`);else{const Ee=le(L.video_url);if(Ee)Q=`https://vimeo.com/${Ee}`,pe||(pe=`https://vumbnail.com/${Ee}.jpg`);else{T({variant:"destructive",title:"Erreur",description:"URL vidéo invali
657de (YouTube ou Vimeo attendu)"});return}}}if(!Q){T({variant:"destructive",title:"Erreur",description:"URL requise"});return}const me={album_id:(i==null?void 0:i.id)||null,type:L.type,title:L.title||null,description:L.description||null,url:Q,youtube_id:ue,thumbnail_url:pe,published:!0,sort_order:t.length};if(b){const{error:_e}=await Xe.from("gallery_items").update({type:L.type,title:L.title||null,description:L.description||null,url:Q,youtube_id:ue,thumbnail_url:pe}).eq("id",b.id);_e?T({variant:"destructive",title:"Erreur",description:_e.message}):(T({title:"Média mis à jour"}),f(!1),g(null),$(i==null?void 0:i.id))}else{const{error:_e}=await Xe.from("gallery_items").insert(me);_e?T({variant:"destructive",title:"Erreur",description:_e.message}):(T({title:"Média ajouté"}),f(!1),$(i==null?void 0:i.id))}},O=async X=>{var ye;const Q=(ye=X.target.files)==null?void 0:ye[0];if(!Q)return;S(!0);const ue=Q.name.split(".").pop(),me=`gallery/thumbnails/${`thumb-${Date.now()}-${Math.random().toString(36).substr(2,9)}.${ue}`}`,{error:_e}=await Xe.storage.from("uploads").upload(me,Q);if(_e){T({variant:"destructive",title:"Erreur upload",description:_e.message}),S(!1);return}const{data:Ee}=Xe.storage.from("uploads").getPublicUrl(me);V({...L,thumbnail_url:Ee.publicUrl}),S(!1),T({title:"Miniature uploadée"}),C.current&&(C.current.value="")},te=async X=>{const Q=X.target.files;if(!(!Q||Q.length===0)){y(!0);for(const ue of Array.from(Q)){const pe=ue.name.split(".").pop(),_e=`gallery/${`${Date.now()}-${Math.random().toString(36).substr(2,9)}.${pe}`}`,{error:Ee}=await Xe.storage.from("uploads").upload(_e,ue);if(Ee){T({variant:"destructive",title:"Erreur upload",description:Ee.message});continue}const{data:ye}=Xe.storage.from("uploads").getPublicUrl(_e),{error:Re}=await Xe.from("gallery_items").insert({album_id:(i==null?void 0:i.id)||null,type:"photo",title:ue.name.replace(/\.[^/.]+$/,""),url:ye.publicUrl,published:!0,sort_order:t.length});Re&&T({variant:"destructive",title:"Erreur",description:Re.message})}T({title:"Photos uploadées"}),y(!1),$(i==null?void 0:i.id),A.current&&(A.current.value="")}},he=async X=>{if(!confirm("Supprimer ce média ?"))return;const{error:Q}=await Xe.from("gallery_items").delete().eq("id",X);Q?T({variant:"destructive",title:"Erreur",description:Q.message}):(T({title:"Média supprimé"}),$(i==null?void 0:i.id))},ge=async X=>{if(!confirm("Supprimer cet album et tous ses médias ?"))return;const{error:Q}=await Xe.from("gallery_albums").delete().eq("id",X);Q?T({variant:"destructive",title:"Erreur",description:Q.message}):(T({title:"Album supprimé"}),(i==null?void 0:i.id)===X&&s(null),j())},D=()=>{h(null),I({title:"",slug:"",description:"",published:!0}),c(!0)},G=X=>{h(X),I({title:X.title,slug:X.slug,description:X.description||"",published:X.published}),c(!0)},ee=()=>{g(null),V({type:"photo",videoSource:"youtube",title:"",description:"",url:"",video_url:"",thumbnail_url:""}),f(!0)},ae=X=>{g(X);const Q=X.youtube_id||H(X.url),ue=X.type==="video"||!!Q;V({type:ue?"video":"photo",videoSource:"youtube",title:X.title||"",description:X.description||"",url:ue?"":X.url,video_url:ue?X.url:"",thumbnail_url:X.thumbnail_url||""}),f(!0)};return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold",children:"Galerie"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Photos et vidéos (YouTube, Vimeo)"})]}),d.jsx("div",{className:"flex gap-2",children:d.jsxs(Ua,{open:l,onOpenChange:c,children:[d.jsx(Q1,{asChild:!0,children:d.jsxs(Oe,{variant:"outline",onClick:D,children:[d.jsx(ZM,{className:"w-4 h-4 mr-2"}),"Nouvel album"]})}),d.jsxs(aa,{children:[d.jsx(Zc,{children:d.jsx(Fl,{children:p?"Modifier l'album":"Nouvel album"})}),d.jsxs("form",{onSubmit:oe,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"album-title",children:"Titre *"}),d.jsx(Rt,{id:"album-title",value:R.title,onChange:X=>I({...R,title:X.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"album-desc",children:"Description"}),d.jsx(Wd,{id:"album-desc",value:R.description,onChange:X=>I({...R,description:X.target.value}),rows:3})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(yp,{id:"album-pub",checked:R.published,onCheckedChange:X=>I({...R,published:X})}),d.jsx(pt,{htmlFor:"album-pub",children:"Publié"})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Oe,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Annuler"}),d.jsx(Oe,{type:"submit",children:p?"Enregistrer":"Créer"})]})]})]})]})})]}),d.jsxs("div",{className:"grid lg:grid-cols-4 gap-6",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-2",children:[d.jsx(On,{className:`curs
657or-pointer transition-colors ${i?"":"ring-2 ring-primary"}`,onClick:()=>{s(null),$()},children:d.jsxs(Mn,{className:"p-4 flex items-center gap-3",children:[d.jsx(Rl,{className:"w-5 h-5 text-muted-foreground"}),d.jsx("span",{className:"font-medium",children:"Tous les médias"})]})}),n.map(X=>d.jsx(On,{className:`cursor-pointer transition-colors ${(i==null?void 0:i.id)===X.id?"ring-2 ring-primary":""}`,onClick:()=>{s(X),$(X.id)},children:d.jsx(Mn,{className:"p-4",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-medium truncate",children:X.title}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:Q=>{Q.stopPropagation(),G(X)},children:d.jsx(g0,{className:"w-3 h-3"})}),d.jsx(Oe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:Q=>{Q.stopPropagation(),ge(X.id)},children:d.jsx(tp,{className:"w-3 h-3 text-destructive"})})]})]})})},X.id))]}),d.jsxs("div",{className:"lg:col-span-3 space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx("input",{ref:A,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:te}),d.jsxs(Oe,{variant:"outline",onClick:()=>{var X;return(X=A.current)==null?void 0:X.click()},disabled:w,children:[d.jsx(ON,{className:"w-4 h-4 mr-2"}),w?"Upload...":"Uploader photos"]}),d.jsxs(Ua,{open:u,onOpenChange:f,children:[d.jsx(Q1,{asChild:!0,children:d.jsxs(Oe,{onClick:ee,children:[d.jsx(v0,{className:"w-4 h-4 mr-2"}),"Ajouter média"]})}),d.jsxs(aa,{children:[d.jsx(Zc,{children:d.jsx(Fl,{children:"Ajouter un média"})}),d.jsxs("form",{onSubmit:se,className:"space-y-4",children:[d.jsxs(rq,{value:L.type,onValueChange:X=>V({...L,type:X}),children:[d.jsxs(NP,{className:"grid grid-cols-2",children:[d.jsxs(oy,{value:"photo",children:[d.jsx(Rl,{className:"w-4 h-4 mr-2"}),"Photo"]}),d.jsxs(oy,{value:"video",children:[d.jsx(c_,{className:"w-4 h-4 mr-2"}),"Vidéo"]})]}),d.jsx(ly,{value:"photo",className:"space-y-4 mt-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"photo-url",children:"URL de l'image *"}),d.jsx(Rt,{id:"photo-url",type:"url",value:L.url,onChange:X=>V({...L,url:X.target.value}),placeholder:"https://...",required:L.type==="photo"})]})}),d.jsxs(ly,{value:"video",className:"space-y-4 mt-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"video-url",children:"URL YouTube ou Vimeo *"}),d.jsx(Rt,{id:"video-url",value:L.video_url,onChange:X=>V({...L,video_url:X.target.value}),placeholder:"https://www.youtube.com/watch?v=... ou https://vimeo.com/...",required:L.type==="video"&&!b}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Formats acceptés : YouTube (standard et Shorts), Vimeo"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Miniature personnalisée (recommandé)"}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:O}),d.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{var X;return(X=C.current)==null?void 0:X.click()},disabled:x,children:[d.jsx(ON,{className:"w-4 h-4 mr-2"}),x?"Upload...":"Uploader miniature"]}),L.thumbnail_url&&d.jsxs("div",{className:"relative w-16 h-12 rounded overflow-hidden border",children:[d.jsx("img",{src:L.thumbnail_url,alt:"Miniature",className:"w-full h-full object-cover"}),d.jsx("button",{type:"button",className:"absolute top-0 right-0 bg-destructive text-destructive-foreground p-0.5 rounded-bl",onClick:()=>V({...L,thumbnail_url:""}),children:d.jsx(tp,{className:"w-3 h-3"})})]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploadez une image pour remplacer la miniature YouTube/Vimeo par défaut"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"item-title",children:"Titre"}),d.jsx(Rt,{id:"item-title",value:L.title,onChange:X=>V({...L,title:X.target.value})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"item-desc",children:"Description"}),d.jsx(Wd,{id:"item-desc",value:L.description,onChange:X=>V({...L,description:X.target.value}),rows:2})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Oe,{type:"button",variant:"outline",onClick:()=>{f(!1),g(null)},children:"Annuler"}),d.jsx(Oe,{type:"submit",children:b?"Enregistrer":"Ajouter"})]})]})]})]})]}),a?d.jsx("p",{children:"Chargement..."}):t.length===0?d.jsx(On,{children:d.jsxs(Mn,{className:"py-12 text-center text-muted-foreground",children:[d.jsx(Rl,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),d.jsxs("p",{children:["Aucun média ",i?"dans cet album":"","."]}),d.jsx("p",{className:"text-sm mt-2",children:"Uploadez des photos ou ajoutez des vidéos YouTube."})]})}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:t.map(X=>{const Q=X.youtube_id||H(X.url),ue=X.type==="video"||Q;return d.jsxs(On,{className:"overflow-hidden group relative",children:[d.jsxs("div",{className:"aspect-square cursor-pointer",onClick:()=>ae(X),children:[X.thumbnail_url?d.jsx("img",{src:X.thumbnail_url,alt:X.title||"Média",className:"w-full h-full object-cover"}):Q?d.jsx("img",{src:`https://i.ytimg.com/vi/${Q}/0.jpg`,alt:X.title||"Video",className:"w-full h-full object-cover"}):d.jsx("img",{src:X.url,alt:X.title||"Photo",className:"w-full h-full object-cover"}),ue&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:d.jsx("div",{className:"w-12 h-12 bg-foreground
657/80 rounded-full flex items-center justify-center",children:d.jsx(c_,{className:"w-6 h-6 text-background"})})})]}),d.jsxs("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[d.jsx(Oe,{variant:"secondary",size:"icon",className:"h-8 w-8",onClick:()=>ae(X),children:d.jsx(g0,{className:"w-4 h-4"})}),d.jsx(Oe,{variant:"destructive",size:"icon",className:"h-8 w-8",onClick:()=>he(X.id),children:d.jsx(tp,{className:"w-4 h-4"})})]}),X.title&&d.jsx(Mn,{className:"p-2",children:d.jsx("p",{className:"text-sm truncate",children:X.title})})]},X.id)})})]})]})]})})}function vpe(){const[n,e]=E.useState([]),[t,r]=E.useState(!0),[i,s]=E.useState(!1),[a,o]=E.useState(!1),[l,c]=E.useState(""),[u,f]=E.useState({}),{toast:p}=Qd(),[h,b]=E.useState({});E.useEffect(()=>{g()},[]);const g=async()=>{const{data:T,error:R}=await Xe.from("settings").select("*").order("key");if(R)p({variant:"destructive",title:"Erreur",description:R.message});else{e(T||[]);const I={};T==null||T.forEach(L=>{I[L.key]=L.value||""}),b(I)}r(!1)},w=async()=>{s(!0);for(const T of n){const R=h[T.key];if(R!==(T.value||"")){const{error:I}=await Xe.from("settings").update({value:R}).eq("id",T.id);if(I){p({variant:"destructive",title:"Erreur",description:I.message}),s(!1);return}}}p({title:"Paramètres enregistrés"}),s(!1),g()},y=async()=>{if(!l){p({variant:"destructive",title:"Erreur",description:"Veuillez entrer une adresse email de test"});return}await w(),o(!0);try{const T=await Xe.functions.invoke("send-smtp-email",{body:{to:l,subject:"Test SMTP - Ti Train Réunion",body:`
658            <h1>Test de configuration SMTP</h1>
659            <p>Félicitations ! Votre configuration SMTP fonctionne correctement.</p>
660            <p>Cet email a été envoyé depuis votre site Ti Train Réunion.</p>
661            <hr>
662            <p style="color: #666; font-size: 12px;">
663              Association Ti Train Réunion<br>
664              La Grande Chaloupe, La Possession<br>
665              Contact : 0692 38 53 91 - [email protected]
666            </p>
667          `,isTest:!0}});if(T.error)throw new Error(T.error.message||"Erreur lors de l'envoi");const R=T.data;if(R.success)p({title:"Succès",description:R.message||"Email de test envoyé avec succès !"});else throw new Error(R.error||"Erreur inconnue")}catch(T){console.error("Test email error:",T),p({variant:"destructive",title:"Erreur",description:T.message||"Impossible d'envoyer l'email de test"})}finally{o(!1)}},x=T=>T.toLowerCase().includes("secret")||T.toLowerCase().includes("password")||T.toLowerCase().includes("key"),S=T=>{f(R=>({...R,[T]:!R[T]}))},A={stripe:n.filter(T=>T.key.includes("stripe")),smtp:n.filter(T=>T.key.includes("smtp")),general:n.filter(T=>!T.key.includes("stripe")&&!T.key.includes("smtp"))},C=["smtp_host","smtp_port","smtp_user","smtp_password","smtp_from_email","smtp_from_name"];return d.jsx(Rp,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-display font-bold",children:"Paramètres"}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Configuration du site"})]}),d.jsxs(Oe,{onClick:w,disabled:i,children:[d.jsx(sK,{className:"w-4 h-4 mr-2"}),i?"Enregistrement...":"Enregistrer"]})]}),t?d.jsx("p",{children:"Chargement..."}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:d.jsx(N5,{className:"w-5 h-5 text-accent"})}),d.jsxs("div",{children:[d.jsx(La,{children:"Configuration SMTP"}),d.jsx(Ym,{children:"Paramètres pour l'envoi des emails de contact"})]})]})}),d.jsxs(Mn,{className:"space-y-4",children:[d.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:C.map(T=>{const R=A.smtp.find(V=>V.key===T);if(!R)return null;const I=x(R.key),L=u[R.key];return d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:R.key,className:"flex items-center gap-2",children:R.description||R.key}),d.jsxs("div",{className:"relative",children:[d.jsx(Rt,{id:R.key,type:I&&!L?"password":"text",value:h[R.key]||"",onChange:V=>b({...h,[R.key]:V.target.value}),placeholder:I?"••••••••••••••••":"",className:"pr-10"}),I&&d.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>S(R.key),children:L?d.jsx(LN,{className:"w-4 h-4"}):d.jsx(IN,{className:"w-4 h-4"})})]})]},R.id)})}),d.jsxs("div",{className:"pt-4 border-t border-border",children:[d.jsx(pt,{className:"mb-2 block",children:"Tester la configuration"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Rt,{type:"email",placeholder:"Adresse email de test",value:l,onCh
667ange:T=>c(T.target.value),className:"flex-1"}),d.jsxs(Oe,{onClick:y,disabled:a||!l,variant:"secondary",children:[a?d.jsx(U1,{className:"w-4 h-4 mr-2 animate-spin"}):d.jsx(aK,{className:"w-4 h-4 mr-2"}),a?"Envoi...":"Envoyer un test"]})]}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Enregistrez d'abord vos paramètres, puis envoyez un email de test pour vérifier la configuration."})]})]})]}),A.stripe.length>0&&d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:d.jsx(VG,{className:"w-5 h-5 text-primary"})}),d.jsxs("div",{children:[d.jsx(La,{children:"Paiements Stripe"}),d.jsx(Ym,{children:"Configuration pour les paiements et abonnements"})]})]})}),d.jsxs(Mn,{className:"space-y-4",children:[A.stripe.map(T=>{const R=x(T.key),I=u[T.key];return d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:T.key,className:"flex items-center gap-2",children:T.description||T.key}),d.jsxs("div",{className:"relative",children:[d.jsx(Rt,{id:T.key,type:R&&!I?"password":"text",value:h[T.key]||"",onChange:L=>b({...h,[T.key]:L.target.value}),placeholder:R?"••••••••••••••••":"",className:"pr-10"}),R&&d.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>S(T.key),children:I?d.jsx(LN,{className:"w-4 h-4"}):d.jsx(IN,{className:"w-4 h-4"})})]})]},T.id)}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:["Obtenez vos clés API sur"," ",d.jsx("a",{href:"https://dashboard.stripe.com/apikeys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"dashboard.stripe.com"})]})]})]}),A.general.length>0&&d.jsxs(On,{className:"shadow-card",children:[d.jsx(Ra,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 rounded-lg bg-ocean/10",children:d.jsx(oK,{className:"w-5 h-5 text-ocean"})}),d.jsxs("div",{children:[d.jsx(La,{children:"Paramètres généraux"}),d.jsx(Ym,{children:"Configuration générale du site"})]})]})}),d.jsx(Mn,{className:"space-y-4",children:A.general.map(T=>T.key==="construction_notice_enabled"||T.key==="boutique_enabled"?d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(pt,{htmlFor:T.key,children:T.description||T.key}),d.jsx(yp,{id:T.key,checked:h[T.key]==="true",onCheckedChange:I=>b({...h,[T.key]:I?"true":"false"})})]},T.id):d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:T.key,children:T.description||T.key}),d.jsx(Rt,{id:T.key,value:h[T.key]||"",onChange:I=>b({...h,[T.key]:I.target.value})})]},T.id))})]})]})]})})}var iq="AlertDialog",[ype,uge]=cs(iq,[h$]),ou=h$(),sq=n=>{const{__scopeAlertDialog:e,...t}=n,r=ou(e);return d.jsx(eP,{...r,...t,modal:!0})};sq.displayName=iq;var bpe="AlertDialogTrigger",wpe=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=ou(t);return d.jsx(tP,{...i,...r,ref:e})});wpe.displayName=bpe;var xpe="AlertDialogPortal",aq=n=>{const{__scopeAlertDialog:e,...t}=n,r=ou(e);return d.jsx(nP,{...r,...t})};aq.displayName=xpe;var _pe="AlertDialogOverlay",oq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=ou(t);return d.jsx(Hb,{...i,...r,ref:e})});oq.displayName=_pe;var tg="AlertDialogContent",[Spe,Ape]=ype(tg),Epe=AM("AlertDialogContent"),lq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,children:r,...i}=n,s=ou(t),a=E.useRef(null),o=Xt(e,a),l=E.useRef(null);return d.jsx(Roe,{contentName:tg,titleName:cq,docsSlug:"alert-dialog",children:d.jsx(Spe,{scope:t,cancelRef:l,children:d.jsxs(Wb,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:rt(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[d.jsx(Epe,{children:r}),d.jsx(kpe,{contentRef:a})]})})})});lq.displayName=tg;var cq="AlertDialogTitle",uq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=ou(t);return d.jsx(Vb,{...i,...r,ref:e})});uq.displayName=cq;var dq="AlertDialogDescription",hq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=ou(t);return d.jsx(Gb,{...i,...r,ref:e})});
667hq.displayName=dq;var Npe="AlertDialogAction",fq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=ou(t);return d.jsx(lS,{...i,...r,ref:e})});fq.displayName=Npe;var pq="AlertDialogCancel",mq=E.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,{cancelRef:i}=Ape(pq,t),s=ou(t),a=Xt(e,i);return d.jsx(lS,{...s,...r,ref:a})});mq.displayName=pq;var kpe=({contentRef:n})=>{const e=`\`${tg}\` requires a description for the component to be accessible for screen reader users.
668
669You can add a description to the \`${tg}\` by passing a \`${dq}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
670
671Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${tg}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
672
673For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return E.useEffect(()=>{var r;document.getElementById((r=n.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,n]),null},Cpe=sq,Tpe=aq,gq=oq,vq=lq,yq=fq,bq=mq,wq=uq,xq=hq;const Ppe=Cpe,jpe=Tpe,_q=E.forwardRef(({className:n,...e},t)=>d.jsx(gq,{className:We("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e,ref:t}));_q.displayName=gq.displayName;const Sq=E.forwardRef(({className:n,...e},t)=>d.jsxs(jpe,{children:[d.jsx(_q,{}),d.jsx(vq,{ref:t,className:We("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...e})]}));Sq.displayName=vq.displayName;const Aq=({className:n,...e})=>d.jsx("div",{className:We("flex flex-col space-y-2 text-center sm:text-left",n),...e});Aq.displayName="AlertDialogHeader";const Eq=({className:n,...e})=>d.jsx("div",{className:We("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});Eq.displayName="AlertDialogFooter";const Nq=E.forwardRef(({className:n,...e},t)=>d.jsx(wq,{ref:t,className:We("text-lg font-semibold",n),...e}));Nq.displayName=wq.displayName;const kq=E.forwardRef(({className:n,...e},t)=>d.jsx(xq,{ref:t,className:We("text-sm text-muted-foreground",n),...e}));kq.displayName=xq.displayName;const Cq=E.forwardRef(({className:n,...e},t)=>d.jsx(yq,{ref:t,className:We(LT(),n),...e}));Cq.displayName=yq.displayName;const Tq=E.forwardRef(({className:n,...e},t)=>d.jsx(bq,{ref:t,className:We(LT({variant:"outline"}),"mt-2 sm:mt-0",n),...e}));Tq.displayName=bq.displayName;function Rpe(){const[n,e]=E.useState([]),[t,r]=E.useState(!0),[i,s]=E.useState(!1),[a,o]=E.useState(!1),[l,c]=E.useState(null),[u,f]=E.useState(!1),[p,h]=E.useState({title:"",description:"",image_url:"",button_text:"En savoir plus",button_link:"",event_date:"",event_time:"",event_price:"",active:!0});E.useEffect(()=>{b()},[]);const b=async()=>{try{const{data:C,error:T}=await Xe.from("event_modals").select("*").order("created_at",{ascending:!1});if(T)throw T;e(C||[])}catch(C){console.error("Error fetching modals:",C),to.error("Erreur lors du chargement des modales")}finally{r(!1)}},g=()=>{c(null),h({title:"",description:"",image_url:"",button_text:"En savoir plus",button_link:"",event_date:Ro(new Date,"yyyy-MM-dd"),event_time:"",event_price:"",active:!0}),s(!0)},w=C=>{c(C),h({title:C.title,description:C.description||"",image_url:C.image_url||"",button_text:C.button_text||"En savoir plus",button_link:C.button_link||"",event_date:C.event_date?Ro(new Date(C.event_date),"yyyy-MM-dd"):"",event_time:C.event_time||"",event_price:C.event_price||"",active:C.active}),s(!0)},y=async()=>
673{if(!p.title.trim()){to.error("Le titre est requis");return}f(!0);try{const C=new Date,T=new Date(Date.now()+365*24*60*60*1e3),R={title:p.title.trim(),description:p.description.trim()||null,image_url:p.image_url.trim()||null,button_text:p.button_text.trim()||null,button_link:p.button_link.trim()||null,event_date:p.event_date?new Date(p.event_date).toISOString():null,event_time:p.event_time.trim()||null,event_price:p.event_price.trim()||null,start_date:C.toISOString(),end_date:T.toISOString(),active:p.active};if(l){const{error:I}=await Xe.from("event_modals").update(R).eq("id",l.id);if(I)throw I;to.success("Modal mise à jour")}else{const{error:I}=await Xe.from("event_modals").insert([R]);if(I)throw I;to.success("Modal créée")}s(!1),b()}catch(C){console.error("Error saving modal:",C),to.error("Erreur lors de la sauvegarde")}finally{f(!1)}},x=async()=>{if(l)try{const{error:C}=await Xe.from("event_modals").delete().eq("id",l.id);if(C)throw C;to.success("Modal supprimée"),o(!1),c(null),b()}catch(C){console.error("Error deleting modal:",C),to.error("Erreur lors de la suppression")}},S=async C=>{try{const{error:T}=await Xe.from("event_modals").update({active:!C.active}).eq("id",C.id);if(T)throw T;to.success(C.active?"Modal désactivée":"Modal activée"),b()}catch(T){console.error("Error toggling modal:",T),to.error("Erreur lors de la modification")}},A=C=>{const T=new Date;return C.active&&new Date(C.start_date)<=T&&new Date(C.end_date)>=T};return d.jsxs(Rp,{children:[d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Modal Événement"}),d.jsx("p",{className:"text-muted-foreground",children:"Gérez les modales promotionnelles affichées en page d'accueil"})]}),d.jsxs(Oe,{onClick:g,children:[d.jsx(v0,{className:"mr-2 h-4 w-4"}),"Nouvelle modal"]})]}),t?d.jsx("div",{className:"flex justify-center py-12",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):n.length===0?d.jsx(On,{children:d.jsxs(Mn,{className:"flex flex-col items-center justify-center py-12",children:[d.jsx(Ml,{className:"h-12 w-12 text-muted-foreground mb-4"}),d.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Aucune modal"}),d.jsx("p",{className:"text-muted-foreground text-center mb-4",children:"Créez une modal pour promouvoir un événement sur la page d'accueil"}),d.jsxs(Oe,{onClick:g,children:[d.jsx(v0,{className:"mr-2 h-4 w-4"}),"Créer une modal"]})]})}):d.jsx("div",{className:"grid gap-4",children:n.map(C=>d.jsxs(On,{className:A(C)?"ring-2 ring-primary":"",children:[d.jsx(Ra,{className:"pb-3",children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[A(C)&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-primary/10 text-primary",children:"En cours"}),!C.active&&d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground",children:"Désactivée"})]}),d.jsx(La,{className:"text-lg",children:C.title}),(C.event_date||C.event_time)&&d.jsxs(Ym,{className:"flex items-center gap-1 mt-1",children:[d.jsx(Ml,{className:"h-3 w-3"}),C.event_date&&Ro(new Date(C.event_date),"d MMMM yyyy",{locale:zd}),C.event_date&&C.event_time&&" • ",C.event_time]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mr-2",children:[d.jsx(yp,{checked:C.active,onCheckedChange:()=>S(C),"aria-label":C.active?"Désactiver":"Activer"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:C.active?"Actif":"Inactif"})]}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>w(C),children:d.jsx(g0,{className:"h-4 w-4"})}),d.jsx(Oe,{variant:"ghost",size:"icon",onClick:()=>{c(C),o(!0)},children:d.jsx(tp,{className:"h-4 w-4 text-destructive"})})]})]})}),(C.description||C.image_url)&&d.jsx(Mn,{className:"pt-0",children:d.jsxs("div",{className:"flex gap-4",children:[C.image_url&&d.jsx("img",{src:C.image_url,alt:C.title,className:"w-24 h-16 object-cover rounded"}),C.description&&d.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C.description})]})})]},C.id))})]}),d.jsx(Ua,{open:i,onOpenChange:s,children:d.jsxs(aa,{className:"sm:max-w-xl max-h-[90vh] overflow-y-auto",children:[d.jsx(Zc,{children:d.jsx(Fl,{children:l?"Modifier la modal":"Nouvelle modal événement"})}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"title",children:"Titre *"}),d.jsx(Rt,{id:"title",value:p.title,onChange:C=>h({...p,title:C.target.value}),placeholder:"Ex: Grande exposition ferroviaire"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"description",children:"Description"}),d.jsx(Wd,{id:"description",value:p.description,onChange:C=>h({...p,description:C.target.value}),placeholder:"Description de l'événement...",rows:3})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{children:"Image"}),d.jsx(B9,{value:p.image_url,onChange:C=>h({...p,image_url:C}),folder:"event-modals"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"button_text",children:"Texte du bouton"}),d.jsx(Rt,{id:"button_text",value:p.button_text,onChange:C=>h({...p,button_text:C.target.value}),placeholder:"En savoir plus"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"button_link",children:"Lien du bouton"}),d.jsx(Rt,{id:"button_link",value:p.button_link,onChange:C=>h({...p,button_link:C.target.value}),placeholder:"https://..."})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"event_date",children:"Date"}),d.jsx(Rt,{id:"event_date",type:"date",value:p.event_date,onChange:C=>h({...p,event_date:C.target.value})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"event_time",children:"Horaires"}),d.jsx(Rt,{id:"event_time",type:"text",placeholder:"Ex: 10h - 18h",value:p.event_time,onChange:C=>h({...p,event_time:C.target.value})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(pt,{htmlFor:"event_price",children:"Tarif"}),d.jsx(Rt,{id:"event_price",type:"text",placeholder:"Ex: Gratuit ou 5€",value:p.event_price,onChange:C=>h({...p,event_price:C.target.value})})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(yp,{id:"active",checked:p.active,onCheckedChange:C=>h({...p,active:C})}),d.jsx(pt,{htmlFor:"active",children:"Activer la modal"})]})]}),d.jsxs(T$,{children:[d.jsx(Oe,{variant:"outline",onClick:()=>s(!1),children:"Annuler"}),d.jsx(Oe,{onClick:y,disabled:u,children:u?"Enregistrement...":l?"Mettre à jour":"Créer"})]})]})}),d.jsx(Ppe,{open:a,onOpenChange:o,children:d.jsxs(Sq,{children:[d.jsxs(Aq,{children:[d.jsx(Nq,{children:"Supprimer cette modal ?"}),d.jsxs(kq,{children:['Cette action est irréversible. La modal "',l==null?void 0:l.title,'" sera définitivement supprimée.']})]}),d.jsxs(Eq,{children:[d.jsx(Tq,{children:"Annuler"}),d.jsx(Cq,{onClick:x,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer"})]})]})})]})}const Lpe=new DJ;function Eh({children:n}){const{user:e,isLoading:t,isAdmin:r}=RT();return t?d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Chargement..."}):!e||!r?d.jsx(kQ,{to:"/admin/login",replace:!0}):d.jsx(d.Fragment,{children:n})}function Ipe(){return d.jsxs(aD,{children:[d.jsx(ii,{path:"login",element:d.jsx(sfe,{})}),d.jsx(ii,{path:"",element:d.jsx(Eh,{children:d.jsx(ofe,{})})}),d.jsx(ii,{path:"blog",element:d.jsx(Eh,{children:d.jsx(fpe,{})})}),d.jsx(ii,{path:"boutique",element:d.jsx(Eh,{children:d.jsx(ppe,{})})}),d.jsx(ii,{path:"membres",element:d.jsx(Eh,{children:d.jsx(mpe,{})})}),d.jsx(ii,{path:"galerie",element:d.jsx(Eh,{children:d.jsx(gpe,{})})}),d.jsx(ii,{path:"parametres",element:d.jsx(Eh,{children:d.jsx(vpe,{})})}),d.jsx(ii,{path:"modal-evenement",element:d.jsx(Eh,{children:d.jsx(Rpe,{})})})]})}const Ope=()=>d.jsx(BJ,{client:Lpe,children:d.jsxs(fJ,{children:[d.jsx(JK,{}),d.jsx(TY,{}),d.jsx(DQ,{children:d.jsxs(ute,{children:[d.jsxs(aD,{children:[d.jsx(ii,{path:"/",element:d.jsx(xle,{})}),d.jsx(ii,{path:"/galerie",element:d.jsx(Sle,{})}),d.jsx(ii,{path:"/blog",element:d.jsx(Ale,{})}),d.jsx(ii,{path:"/blog/:slug",element:d.jsx(Nle,{})}),d.jsx(ii,{path:"/adhesion",element:d.jsx(Yhe,{})}),d.jsx(ii,{path:"/mentions-legales",element:d.jsx(Xhe,{})}),d.jsx(ii,{path:"/boutique",element:d.jsx(rfe,{})}),d.jsx(ii,{path:"/admin/*",element:d.jsx(Ipe,{})}),d.jsx(ii,{path:"*",element:d.jsx(ife,{})})]}),d.jsx(dte,{})]})})]})});xM(document.getElementById("root")).render(d.jsx(Ope,{}));export{wn as _,Vp as c,a5 as g};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.