df-ae-forms-package 1.0.54 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/IOS-COMPATIBILITY.md +299 -0
- package/IOS-FIXES-SUMMARY.md +234 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/"production"===process.env.NODE_ENV?u.exports=function(){if(c)return h;c=1;var t=e,A=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var a,o={},l=null,c=null;for(a in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)n.call(t,a)&&!s.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===o[a]&&(o[a]=t[a]);return{$$typeof:A,type:e,key:l,ref:c,props:o,_owner:i.current}}return h.Fragment=r,h.jsx=a,h.jsxs=a,h}():u.exports=(d||(d=1,"production"!==process.env.NODE_ENV&&function(){var t,A=e,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,w=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function B(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),r=1;r<t;r++)A[r-1]=arguments[r];!function(e,t,A){var r=w.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",A=A.concat([r]));var n=A.map(function(e){return String(e)});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n)}("error",e,A)}function b(e){return e.displayName||"Context"}function y(e){if(null==e)return null;if("number"==typeof e.tag&&B("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case i:return"Fragment";case n:return"Portal";case a:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case h:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return b(e)+".Consumer";case o:return b(e._context)+".Provider";case c:return function(e,t,A){var r=e.displayName;if(r)return r;var n=t.displayName||t.name||"";return""!==n?A+"("+n+")":A}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:y(e.type)||"Memo";case p:var A=e,r=A._payload,f=A._init;try{return y(f(r))}catch(e){return null}}return null}t=Symbol.for("react.module.reference");var v,C,x,F,Q,U,S,E=Object.assign,N=0;function L(){}L.__reactDisabledLog=!0;var _,I=w.ReactCurrentDispatcher;function k(e,t,A){if(void 0===_)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);_=r&&r[1]||""}return"\n"+_+e}var T,H=!1,O="function"==typeof WeakMap?WeakMap:Map;function P(e,t){if(!e||H)return"";var A,r=T.get(e);if(void 0!==r)return r;H=!0;var n,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,n=I.current,I.current=null,function(){if(0===N){v=console.log,C=console.info,x=console.warn,F=console.error,Q=console.group,U=console.groupCollapsed,S=console.groupEnd;var e={configurable:!0,enumerable:!0,value:L,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}();try{if(t){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(e){A=e}Reflect.construct(e,[],s)}else{try{s.call()}catch(e){A=e}e.call(s.prototype)}}else{try{throw Error()}catch(e){A=e}e()}}catch(t){if(t&&A&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),o=A.stack.split("\n"),l=a.length-1,c=o.length-1;l>=1&&c>=0&&a[l]!==o[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==o[c]){if(1!==l||1!==c)do{if(l--,--c<0||a[l]!==o[c]){var u="\n"+a[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),"function"==typeof e&&T.set(e,u),u}}while(l>=1&&c>=0);break}}}finally{H=!1,I.current=n,function(){if(0===--N){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E({},e,{value:v}),info:E({},e,{value:C}),warn:E({},e,{value:x}),error:E({},e,{value:F}),group:E({},e,{value:Q}),groupCollapsed:E({},e,{value:U}),groupEnd:E({},e,{value:S})})}N<0&&B("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var h=e?e.displayName||e.name:"",d=h?k(h):"";return"function"==typeof e&&T.set(e,d),d}function D(e,t,A){if(null==e)return"";if("function"==typeof e)return P(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return k(e);switch(e){case u:return k("Suspense");case h:return k("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return P(e.render,!1);case d:return D(e.type,t,A);case p:var n=e,i=n._payload,s=n._init;try{return D(s(i),t,A)}catch(e){}}return""}T=new O;var M=Object.prototype.hasOwnProperty,j={},R=w.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,A=D(e.type,e._source,t?t.type:null);R.setExtraStackFrame(A)}else R.setExtraStackFrame(null)}var K=Array.isArray;function G(e){return K(e)}function z(e){return""+e}function q(e){if(function(e){try{return z(e),!1}catch(e){return!0}}(e))return B("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),z(e)}var W,X,Y,J=w.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,A,n,i){var s,a={},o=null,l=null;for(s in void 0!==A&&(q(A),o=""+A),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(q(t.key),o=""+t.key),function(e){if(M.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(l=t.ref,function(e,t){if("string"==typeof e.ref&&J.current&&t&&J.current.stateNode!==t){var A=y(J.current.type);Y[A]||(B('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',y(J.current.type),e.ref),Y[A]=!0)}}(t,i)),t)M.call(t,s)&&!$.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)void 0===a[s]&&(a[s]=c[s])}if(o||l){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;o&&function(e,t){var A=function(){W||(W=!0,B("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};A.isReactWarning=!0,Object.defineProperty(e,"key",{get:A,configurable:!0})}(a,u),l&&function(e,t){var A=function(){X||(X=!0,B("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};A.isReactWarning=!0,Object.defineProperty(e,"ref",{get:A,configurable:!0})}(a,u)}return function(e,t,A,n,i,s,a){var o={$$typeof:r,type:e,key:t,ref:A,props:a,_owner:s,_store:{}};return Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}(e,o,l,i,n,J.current,a)}Y={};var ee,te=w.ReactCurrentOwner,Ae=w.ReactDebugCurrentFrame;function re(e){if(e){var t=e._owner,A=D(e.type,e._source,t?t.type:null);Ae.setExtraStackFrame(A)}else Ae.setExtraStackFrame(null)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function ie(){if(te.current){var e=y(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var se={};function ae(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var A=function(e){var t=ie();if(!t){var A="string"==typeof e?e:e.displayName||e.name;A&&(t="\n\nCheck the top-level render call using <"+A+">.")}return t}(t);if(!se[A]){se[A]=!0;var r="";e&&e._owner&&e._owner!==te.current&&(r=" It was passed a child from "+y(e._owner.type)+"."),re(e),B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,r),re(null)}}}function oe(e,t){if("object"==typeof e)if(G(e))for(var A=0;A<e.length;A++){var r=e[A];ne(r)&&ae(r,t)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var n=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof n&&n!==e.entries)for(var i,s=n.call(e);!(i=s.next()).done;)ne(i.value)&&ae(i.value,t)}}function le(e){var t,A=e.type;if(null!=A&&"string"!=typeof A){if("function"==typeof A)t=A.propTypes;else{if("object"!=typeof A||A.$$typeof!==c&&A.$$typeof!==d)return;t=A.propTypes}if(t){var r=y(A);!function(e,t,A,r,n){var i=Function.call.bind(M);for(var s in e)if(i(e,s)){var a=void 0;try{if("function"!=typeof e[s]){var o=Error((r||"React class")+": "+A+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw o.name="Invariant Violation",o}a=e[s](t,s,r,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(V(n),B("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",A,s,typeof a),V(null)),a instanceof Error&&!(a.message in j)&&(j[a.message]=!0,V(n),B("Failed %s type: %s",A,a.message),V(null))}}(t,e.props,"prop",r,e)}else void 0===A.PropTypes||ee||(ee=!0,B("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y(A)||"Unknown"));"function"!=typeof A.getDefaultProps||A.getDefaultProps.isReactClassApproved||B("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ce={};function ue(e,A,n,f,m,w){var b=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===s||e===u||e===h||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===o||e.$$typeof===l||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var v="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C,x=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(m);v+=x||ie(),null===e?C="null":G(e)?C="array":void 0!==e&&e.$$typeof===r?(C="<"+(y(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):C=typeof e,B("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,v)}var F=Z(e,A,n,m,w);if(null==F)return F;if(b){var Q=A.children;if(void 0!==Q)if(f)if(G(Q)){for(var U=0;U<Q.length;U++)oe(Q[U],e);Object.freeze&&Object.freeze(Q)}else B("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else oe(Q,e)}if(M.call(A,"key")){var S=y(e),E=Object.keys(A).filter(function(e){return"key"!==e}),N=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";ce[S+N]||(B('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',N,S,E.length>0?"{"+E.join(": ..., ")+": ...}":"{}",S),ce[S+N]=!0)}return e===i?function(e){for(var t=Object.keys(e.props),A=0;A<t.length;A++){var r=t[A];if("children"!==r&&"key"!==r){re(e),B("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),re(null);break}}null!==e.ref&&(re(e),B("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}(F):le(F),F}var he=function(e,t,A){return ue(e,t,A,!1)},de=function(e,t,A){return ue(e,t,A,!0)};f.Fragment=i,f.jsx=he,f.jsxs=de}()),f);var p=u.exports;class g{constructor(){}static getInstance(){return g.instance||(g.instance=new g),g.instance}getAvailableComponentsForConditional(e,t){if(!e||!Array.isArray(e))return[];const A=e=>{let t=[];return e.forEach(e=>{t.push(e),"section"===e.name&&e.children&&(t=[...t,...A(e.children)]),"table"===e.name&&e.cells&&e.cells.forEach(e=>{e.forEach(e=>{e.components&&(t=[...t,...A(e.components)])})}),"datagrid"===e.name&&e.templateComponents&&(t=[...t,...A(e.templateComponents)])}),t},r=A(e).filter(e=>!t||e.id!==t).filter(e=>!["section","table","datagrid"].includes(e.name)).map(e=>{const t={id:e.id,label:e.basic?.label||e.id,type:e.name,key:e.id};return["segment","select","radio","checkbox"].includes(e.name)&&e.basic?.options&&(t.options=e.basic.options.map(e=>({label:e.label||e.value||String(e),value:String(void 0!==e.value?e.value:e)}))),t}).sort((e,t)=>e.label.localeCompare(t.label));return r}getApplicableOperators(e){switch(e){case"text-input":case"email-input":case"textarea":return["equals","notEquals","contains","notContains","isEmpty","isNotEmpty"];case"number-input":case"date-picker":case"datetime-picker":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","isEmpty","isNotEmpty"];case"select":case"radio":case"segment":default:return["equals","notEquals","isEmpty","isNotEmpty"];case"checkbox":return["checked","notChecked","contains","notContains","isEmpty","isNotEmpty"]}}findComponent(e,t){if(e&&Array.isArray(e))for(const A of e){if(A.id===t||A._id===t||A.basic?.label===t)return A;if("section"===A.name&&A.children){const e=this.findComponent(A.children,t);if(e)return e}if("table"===A.name&&A.cells)for(const e of A.cells)for(const A of e)if(A.components){const e=this.findComponent(A.components,t);if(e)return e}if("datagrid"===A.name&&A.templateComponents){const e=this.findComponent(A.templateComponents,t);if(e)return e}if("datagrid"===A.name&&A.entries)for(const e of A.entries)if(e.components){const A=this.findComponent(e.components,t);if(A)return A}}}getAllComponents(e){const t=[],A=e=>{if(e&&Array.isArray(e))for(const r of e){if(t.push(r),r.children&&A(r.children),r.templateComponents&&A(r.templateComponents),r.cells)for(const e of r.cells)for(const t of e)t.components&&A(t.components);if(r.entries)for(const e of r.entries)e.components&&A(e.components)}};return A(e),t}validateConditionalLogic(e,t){const A=[];return e?(["show","hide","always"].includes(e.action)||A.push("Invalid conditional action"),["all","any"].includes(e.when)||A.push("Invalid when condition"),e.conditions&&0!==e.conditions.length?e.conditions.forEach((e,r)=>{const n=this.findComponent(t,e.when);if(!n)return void A.push(`Condition ${r+1}: Component not found`);this.getApplicableOperators(n.name).includes(e.operator)||("checkbox"!==n.name||"checked"!==e.operator&&"notChecked"!==e.operator)&&A.push(`Condition ${r+1}: Operator not applicable for component type`),this.isValidConditionValue(e.value,n.name,e.operator)||A.push(`Condition ${r+1}: Invalid condition value`)}):A.push("At least one condition is required"),{isValid:0===A.length,errors:A}):{isValid:!0,errors:[]}}evaluateConditionalLogic(e,t,A){if("always"===e.action)return{shouldShow:!0,evaluatedConditions:[]};if(!e||!e.conditions||0===e.conditions.length)return{shouldShow:!0,evaluatedConditions:[]};const r=e.conditions.map(e=>{const r=this.getComponentValue(e.when,t,A);return{condition:e,result:this.evaluateCondition(e,r),componentValue:r}});return{shouldShow:this.determineFinalResult(e,r),evaluatedConditions:r}}getComponentValue(e,t,A){if(A&&void 0!==A[e])return A[e];let r=this.findComponent(t,e);if(!r){const e=this.getAllComponents(t),n=Object.keys(A||{});for(const t of e)if(n.includes(t.id)||n.includes(t._id)){r=t;break}}if(r){const e=[r.id,r._id,r.basic?.label].filter(Boolean);for(const t of e)if(A&&void 0!==A[t])return A[t];if(void 0!==r.basic?.value&&null!==r.basic?.value&&""!==r.basic?.value)return r.basic.value;if(void 0!==r.basic?.defaultValue&&null!==r.basic?.defaultValue&&""!==r.basic?.defaultValue)return r.basic.defaultValue}}evaluateCondition(e,t){const{operator:A,value:r}=e;if("checked"===r||"notChecked"===r||"checked"===A||"notChecked"===A){const e="checked"===r||"notChecked"===r?r:A;return this.evaluateCheckboxCondition(t,e)}switch(A){case"equals":return this.isEqual(t,r);case"notEquals":return!this.isEqual(t,r);case"isEmpty":return this.isEmpty(t);case"isNotEmpty":return!this.isEmpty(t);case"contains":return this.contains(t,r);case"notContains":return!this.contains(t,r);case"greaterThan":return this.isGreaterThan(t,r);case"lessThan":return this.isLessThan(t,r);case"greaterThanOrEqual":return this.isGreaterThanOrEqual(t,r);case"lessThanOrEqual":return this.isLessThanOrEqual(t,r);default:return!1}}evaluateCheckboxCondition(e,t){const A=this.isCheckboxChecked(e);return"checked"===t?A:"notChecked"===t&&!A}isCheckboxChecked(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLowerCase()||"1"===e||"checked"===e.toLowerCase()||e.length>0:Array.isArray(e)?e.length>0:"number"==typeof e&&e>0)}determineFinalResult(e,t){let A,r;return A="all"===e.when?t.every(e=>e.result):"any"===e.when&&t.some(e=>e.result),r="show"===e.action?A:"hide"===e.action?!A:(e.action,!0),r}isEqual(e,t){if(e==t)return!0;if(null==e||null==t)return!1;try{const A=String(e).trim(),r=String(t).trim();if(""!==A&&""!==r&&!isNaN(Number(A))&&!isNaN(Number(r))&&Number(A)===Number(r))return!0;if(A.toLowerCase()===r.toLowerCase())return!0}catch(e){}if(!Array.isArray(e)&&Array.isArray(t))return t.some(t=>this.isEqual(e,t));if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;const A=[...e].sort(),r=[...t].sort();return A.every((e,t)=>this.isEqual(e,r[t]))}if("object"==typeof e&&"object"==typeof t){const A=Object.keys(e),r=Object.keys(t);return A.length===r.length&&A.every(A=>this.isEqual(e[A],t[A]))}return!1}isEmpty(e){return null==e||void 0===e||("string"==typeof e?""===e.trim():Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}contains(e,t){return null!=e&&null!=t&&("string"==typeof e?e.trim().toLowerCase().includes(String(t).trim().toLowerCase()):Array.isArray(e)?Array.isArray(t)?t.some(t=>e.some(e=>this.isEqual(e,t))):e.some(e=>this.isEqual(e,t)):!("string"!=typeof e||!Array.isArray(t))&&t.some(t=>e.trim().toLowerCase().includes(String(t).trim().toLowerCase())))}isGreaterThan(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A>r}isLessThan(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A<r}isGreaterThanOrEqual(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A>=r}isLessThanOrEqual(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A<=r}isValidConditionValue(e,t,A){if(null==e)return["isEmpty","isNotEmpty"].includes(A);switch(t){case"number-input":return!isNaN(Number(e))||["isEmpty","isNotEmpty"].includes(A);case"date-picker":case"datetime-picker":return!isNaN(Date.parse(e))||["isEmpty","isNotEmpty"].includes(A);case"checkbox":return Array.isArray(e)||"string"==typeof e||"number"==typeof e;default:return!0}}createDefaultConditionalLogic(){return{action:"show",when:"all",conditions:[]}}getOperatorDisplayText(e){return{equals:"Is Equal To",notEquals:"Is Not Equal To",contains:"Contains",notContains:"Does Not Contain",isEmpty:"Is Empty",isNotEmpty:"Is Not Empty",greaterThan:"Is Greater Than",lessThan:"Is Less Than",greaterThanOrEqual:"Is Greater Than Or Equal To",lessThanOrEqual:"Is Less Than Or Equal To",checked:"Is Checked",notChecked:"Is Not Checked"}[e]||e}getActionDisplayText(e){return{show:"Show this field when",hide:"Hide this field when",always:"Always show this field"}[e]||e}getConditionalLogicSummary(e,t){if(!e||0===e.conditions.length)return"No conditions";if("always"===e.action)return"Always show";const A=this.getActionDisplayText(e.action),r=e.conditions.map(e=>{const A=t.find(t=>t.id===e.when);return`${A?.basic.label||"Unknown component"} ${this.getOperatorDisplayText(e.operator)} ${this.formatConditionValue(e.value)}`}),n="all"===e.when?" and ":" or ";return`${A} ${r.join(n)}`}formatConditionValue(e){return null==e?"empty":Array.isArray(e)?`[${e.join(", ")}]`:"string"==typeof e?`"${e}"`:String(e)}}const m=g.getInstance();const w=new class{constructor(){this.toasts=[],this.listeners=[],this.defaultDuration=3e3,this.timeouts={}}generateId(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}notifyListeners(){this.listeners.forEach(e=>e([...this.toasts]))}addToast(e){try{this.toasts.push(e),this.notifyListeners(),this.timeouts[e.id]=setTimeout(()=>{this.removeToast(e.id)},e.duration||this.defaultDuration)}catch(e){console.error("Error displaying toast message:",e)}}removeToast(e){this.timeouts[e]&&(clearTimeout(this.timeouts[e]),delete this.timeouts[e]),this.toasts=this.toasts.filter(t=>t.id!==e),this.notifyListeners()}showSuccess(e,t=3e3){const A={id:this.generateId(),message:e,type:"success",duration:t};this.addToast(A)}showError(e,t=5e3){const A={id:this.generateId(),message:e,type:"danger",duration:t};this.addToast(A)}showWarning(e,t){const A={id:this.generateId(),message:e,type:"warning",duration:t};this.addToast(A)}showInfo(e,t){const A={id:this.generateId(),message:e,type:"info",duration:t};this.addToast(A)}show(e,t="success",A){const r={id:this.generateId(),message:e,type:t,duration:A};this.addToast(r)}clearAll(){Object.values(this.timeouts).forEach(e=>clearTimeout(e)),this.timeouts={},this.toasts=[],this.notifyListeners()}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}getToasts(){return[...this.toasts]}},B=({validationErrors:e,fieldId:t,touchedFields:A,formSubmitted:r,properties:n,localValidation:i,isTouched:s,mode:a})=>{const o=e=>{const t=n.basic.label||"This field",A=n.name||"",r=n.validation?.customValidationMessage;if("number-input"===A)switch(e){case"required":return`${t} is required`;case"lowerLimit":return"Number is below the lower limit";case"upperLimit":return"Number is above the upper limit";default:return""}if(r)return r;const i="date-picker"===A||"datetime-picker"===A?n.basic?.dateTimeMode||("datetime-picker"===A?"datetime":"date"):null;switch(e){case"required":return`${t} is required`;case"invalidDate":return"time"===i?"Please select a valid time":"datetime"===i?"Please select a valid date and time":"date"===i?"Please select a valid date":`${t} is invalid`;case"minLength":return`${t} must be at least ${n.validation.minLength} characters long`;case"maxLength":return`${t} must be no more than ${n.validation.maxLength} characters long`;case"min":return`${t} must be at least ${n.validation.min}`;case"max":return`${t} must be no more than ${n.validation.max}`;case"lowerLimit":const e=n.validation,A=e?.lowerLimit;return`You are under the limit. ${t} must be at least ${A}`;case"upperLimit":const r=n.validation,s=r?.upperLimit;return`You crossed the limit. ${t} must be no more than ${s}`;case"pattern":return`${t} format is invalid`;case"email":return`${t} must be a valid email address`;default:return`${t} is invalid`}},l=(()=>{if("test"!==a)return"";if(!(s||A[t]||r))return"";if(i&&i.isValid)return"";if(i&&!i.isValid&&Object.keys(i.errors).length>0){const e=Object.keys(i.errors).filter(e=>!0===i.errors[e]);if(e.length>0){const t=e[0],A=n.name||"";return"pattern"===t&&"number-input"===A?"":o(t)}}const l=e[t];if(l&&"string"==typeof l&&""!==l.trim()){const e=n.name||"";if("number-input"===e&&i){const e=n.validation,t=e&&"lowerLimit"in e&&void 0!==e.lowerLimit&&null!==e.lowerLimit&&0!==e.lowerLimit,A=e&&"upperLimit"in e&&void 0!==e.upperLimit&&null!==e.upperLimit&&0!==e.upperLimit;return!l.includes("limit")&&!l.includes("Limit")||t||A?(i.isValid,""):""}if(("date-picker"===e||"datetime-picker"===e)&&l.includes("valid date")){const t=n.basic?.dateTimeMode||("datetime-picker"===e?"datetime":"date");if("time"===t)return"Please select a valid time";if("datetime"===t)return"Please select a valid date and time"}return l}return""})();return l?p.jsx("div",{className:"form-error-msg",children:l}):null},b=e=>{if(null==e||""===e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if("number"==typeof e){const t=new Date(e);return isNaN(t.getTime())?null:t}if("string"==typeof e){let t=e.trim();t.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/)&&(t=t.replace(" ","T"));const A=new Date(t);return isNaN(A.getTime())?null:A}return null};var y;!function(e){e.OPEN="Open",e.IN_PROGRESS="In-Progress",e.REJECTED="Rejected",e.RESOLVE="Resolve"}(y||(y={}));const v=({isOpen:r,onClose:n,onSuccess:i,component:s,formTemplateId:a,notes:o="",attachments:l=null,issue:c=null,onCreateIssue:u,onUpdateIssue:h,user:d,availableUsers:f=["Priya Das","Maria Garcia","John Smith","Sarah Johnson"],workOrderNumber:g,assetNumber:m,isStandalone:B,isEdit:v})=>{const[C,x]=e.useState(""),[F,Q]=e.useState(""),[U,S]=e.useState(""),[E,N]=e.useState(""),[L,_]=e.useState("Medium"),[I,k]=e.useState(y.OPEN),[T,H]=e.useState(""),[O,P]=e.useState(""),[D,M]=e.useState(!1),[j,R]=e.useState(l||[]),[V,K]=e.useState(!1),G=e.useRef(null),z=void 0!==v?v:!!c;e.useEffect(()=>{r&&(z&&c?.attachments&&c.attachments.length>0?R(c.attachments):l&&l.length>0?R(l):R(z&&c?.attachments?c.attachments:[]))},[r,l,c,z]);const q=e=>{if(!e)return"Attachment";if(e instanceof File)return e.name;if("string"==typeof e){if(e.startsWith("data:"))return"Attachment";const t=e.split("/");return t[t.length-1]||"Attachment"}return e.fileName||e.filename||e.name||"Attachment"},W=e=>{if(!e)return null;const t=e=>/\.(jpg|jpeg|png|gif|webp)$/i.test(e),A=e=>e.startsWith("data:image");return e instanceof File?e.type.startsWith("image/")?URL.createObjectURL(e):null:"string"==typeof e?A(e)||t(e)?e:null:e.data&&A(e.data)||e.fileName&&t(e.fileName)&&e.data?e.data:null};e.useEffect(()=>{if(r)if(c||z){x(c?.title||""),Q(c?.description||""),S(c?.workOrderNumber||g||""),N(c?.assetNumber||m||""),_(c?.priority||"Medium");const e=c?.status||y.OPEN,t=e===y.OPEN||e===y.IN_PROGRESS||e===y.REJECTED||e===y.RESOLVE?e:y.OPEN;k(t),H(c?.assignTo||""),P(c?.comments||"")}else s&&(s.basic,x(""),Q(""),P(o||""),g&&S(g),m&&N(m))},[r,s,o,c,g,m]);const X=e.useMemo(()=>{if(!C.trim())return!1;if(!F.trim())return!1;if(!I)return!1;if(!T)return!1;if(!B){if(!U.trim())return!1;if(!E.trim())return!1}return!0},[C,F,I,T,B,U,E]),Y=async e=>{if(c){M(!0);try{const t={title:String(C||"").trim(),description:String(F||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,formTemplateId:c.formTemplateId||"",component:c.component||{},priority:L,assignTo:String(T||"").trim()||void 0,status:e,comments:String(O||"").trim()||""};h&&c._id&&await h(c._id,t),k(e);const A={[y.IN_PROGRESS]:"Issue accepted and moved to In-Progress",[y.RESOLVE]:"Issue resolved successfully",[y.REJECTED]:"Issue rejected"};w.showSuccess(A[e]||"Issue status updated successfully"),i&&i(),n()}catch(e){const t=e?.message||e?.error?.message||"Failed to update issue status. Please try again.";w.showError(t)}finally{M(!1)}}};if(!r)return null;const J=p.jsx("div",{className:"raise-issue-modal-overlay",onClick:n,children:p.jsxs("div",{className:"raise-issue-modal",onClick:e=>e.stopPropagation(),children:[p.jsxs("div",{className:"raise-issue-modal-header",children:[p.jsxs("div",{className:"raise-issue-modal-header-left",children:[p.jsx(t.AlertTriangle,{className:"raise-issue-modal-icon",size:20}),p.jsx("div",{className:"raise-issue-modal-header-text",children:p.jsx("div",{className:"raise-issue-modal-title-main",children:z?"Issue Details":"Create Issue"})})]}),p.jsx("button",{className:"raise-issue-modal-close",onClick:n,"aria-label":"Close",children:p.jsx(t.X,{size:18})})]}),p.jsx("div",{className:"raise-issue-modal-content",children:p.jsxs("div",{className:"raise-issue-fields-grid",children:[z&&c?.issueNumber&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Issue ID"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:c.issueNumber,readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Task"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:z?c?.component?.basic?.label||"":s?.basic?.label||"",readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Task Value"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:z?c?.component?.basic?.value||"":s?.basic?.value||"",readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Title ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(z?"raise-issue-field-readonly":""),value:C,onChange:e=>x(e.target.value),placeholder:"Enter issue title",readOnly:z})]}),!B&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Work Order ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(z?"raise-issue-field-readonly":""),value:U,onChange:e=>S(e.target.value),placeholder:"N/A",readOnly:z})]}),!B&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Asset Number ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(z?"raise-issue-field-readonly":""),value:E,onChange:e=>N(e.target.value),placeholder:"Enter asset number",readOnly:z})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Raised By ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("div",{className:"raise-issue-field-value-with-icon",children:[p.jsx(t.User,{size:16}),p.jsx("span",{children:d&&`${d.firstName||""} ${d.lastName||""}`.trim()||"User"})]})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Created On"}),p.jsxs("div",{className:"raise-issue-field-value-with-icon",children:[p.jsx(t.Calendar,{size:16}),p.jsx("span",{children:z&&c?.createdAt?(b(c.createdAt)||new Date).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}):(new Date).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Description ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("textarea",{className:"raise-issue-field-textarea "+(z?"raise-issue-field-readonly":""),value:F,onChange:e=>Q(e.target.value),placeholder:"Enter issue description",rows:4,readOnly:z})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Status ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("select",{className:"raise-issue-field-select "+(z?"":"raise-issue-field-readonly"),value:I,onChange:e=>k(e.target.value),disabled:!z,children:[p.jsx("option",{value:y.OPEN,children:y.OPEN}),p.jsx("option",{value:y.IN_PROGRESS,children:y.IN_PROGRESS}),p.jsx("option",{value:y.REJECTED,children:y.REJECTED}),p.jsx("option",{value:y.RESOLVE,children:y.RESOLVE})]})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Assign to ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("select",{className:"raise-issue-field-select",value:T,onChange:e=>H(e.target.value),children:[p.jsx("option",{value:"",children:"Unassigned"}),f.map(e=>p.jsx("option",{value:e,children:e},e))]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Priority ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("div",{className:"raise-issue-priority-buttons",children:[p.jsx("button",{type:"button",className:"priority-button priority-low "+("Low"===L?"active":""),onClick:()=>_("Low"),children:"Low"}),p.jsx("button",{type:"button",className:"priority-button priority-medium "+("Medium"===L?"active":""),onClick:()=>_("Medium"),children:"Medium"}),p.jsx("button",{type:"button",className:"priority-button priority-high "+("High"===L?"active":""),onClick:()=>_("High"),children:"High"})]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label-with-icon",children:[p.jsx(t.MessageSquare,{size:16}),p.jsx("span",{children:"Comments"})]}),!O&&p.jsx("div",{className:"raise-issue-no-comments",children:"No comments yet"}),p.jsx("textarea",{className:"raise-issue-field-textarea raise-issue-comments-textarea "+(z?"raise-issue-field-readonly":""),value:O,onChange:e=>P(e.target.value),placeholder:"Add a comment...",rows:4,readOnly:z})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",style:{marginTop:"1rem"},children:[p.jsx("label",{className:"raise-issue-field-label",children:"Attachments"}),p.jsxs("div",{className:"raise-issue-attachments-container",children:[!z&&p.jsxs("div",{className:"raise-issue-dropzone "+(V?"dragging":""),onDragOver:e=>{e.preventDefault(),K(!0)},onDragLeave:e=>{e.preventDefault(),K(!1)},onDrop:e=>{if(e.preventDefault(),K(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);R(e=>[...e,...t])}},onClick:()=>G.current?.click(),children:[p.jsx("input",{type:"file",ref:G,style:{display:"none"},onChange:e=>{if(e.target.files&&e.target.files.length>0){const t=Array.from(e.target.files);R(e=>[...e,...t]),G.current&&(G.current.value="")}},multiple:!0}),p.jsx("div",{className:"raise-issue-dropzone-icon",children:p.jsx(t.UploadCloud,{size:24})}),p.jsx("div",{className:"raise-issue-dropzone-text",children:"Click to upload or drag and drop"}),p.jsx("div",{className:"raise-issue-dropzone-hint",children:"PNG, JPG up to 10MB"})]}),j.length>0&&p.jsx("div",{className:"raise-issue-attachments-list",children:j.map((e,A)=>p.jsxs("div",{className:"raise-issue-attachment-item",children:[p.jsx("div",{className:"raise-issue-attachment-thumbnail",children:W(e)?p.jsx("img",{src:W(e),alt:"Thumbnail"}):p.jsx(t.Paperclip,{size:20,color:"#9ca3af"})}),p.jsxs("div",{className:"raise-issue-attachment-info",children:[p.jsx("span",{className:"attachment-name",title:q(e),children:q(e)}),e instanceof File&&p.jsxs("span",{className:"attachment-size",children:[(e.size/1024).toFixed(1)," KB"]})]}),!z&&p.jsx("button",{type:"button",className:"attachment-remove-btn",onClick:()=>(e=>{R(t=>t.filter((t,A)=>A!==e))})(A),title:"Remove",children:p.jsx(t.X,{size:12})})]},A))})]})]})]})}),p.jsx("div",{className:"raise-issue-modal-actions",children:p.jsxs("div",{className:"raise-issue-modal-actions-buttons",children:[z&&c&&p.jsxs(p.Fragment,{children:[I===y.OPEN&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-accept",onClick:async()=>{await Y(y.IN_PROGRESS)},disabled:D,children:D?"Processing...":"Accept"}),I===y.IN_PROGRESS&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-resolve",onClick:async()=>{await Y(y.RESOLVE)},disabled:D,children:D?"Processing...":"Resolve"}),(I===y.OPEN||I===y.IN_PROGRESS)&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-reject",onClick:async()=>{await Y(y.REJECTED)},disabled:D,children:D?"Processing...":"Reject"})]}),!z&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-save "+(X?"":"disabled"),onClick:async()=>{if(String(C||"").trim())if(String(F||"").trim())if(B||String(U||"").trim())if(B||String(E||"").trim())if(String(T||"").trim()){M(!0);try{if(z&&c){const e={title:String(C||"").trim(),description:String(F||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,formTemplateId:c.formTemplateId||"",component:c.component||{},priority:L,assignTo:String(T||"").trim()||void 0,status:I,comments:String(O||"").trim()||"",task:c.component?.basic?.label||"",taskValue:c.component?.basic?.value||""};h&&c._id&&await h(c._id,e),w.showSuccess("Issue updated successfully"),i&&i(),n()}else{if(!s)return w.showError("Component is required"),void M(!1);if(!a||""===String(a||"").trim())return w.showError("Form template is required"),void M(!1);const e={...s,basic:{...s.basic,comments:String(o||"")}},t=d?`${d.firstName||""} ${d.lastName||""}`.trim():"User",A={title:String(C||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,component:e,description:String(F||"").trim(),formTemplateId:a,assignTo:String(T||"").trim()||void 0,priority:L,status:I,comments:String(O||"").trim()||"",createdBy:t,task:s?.basic?.label||"",taskValue:s?.basic?.value||""};let r;if(u&&(r=await u(A,j)),w.showSuccess("Issue raised successfully"),i){const e={_id:r?._id||"temp-id",issueNumber:r?.issueNumber||"",title:A.title,description:A.description,status:A.status,priority:A.priority,createdAt:r?.createdAt||(new Date).toISOString(),updatedAt:r?.updatedAt||(new Date).toISOString(),component:A.component,workOrderNumber:A.workOrderNumber,assetNumber:A.assetNumber,assignTo:A.assignTo,comments:A.comments,attachments:r?.attachments||j,...r};i(e)}n()}}catch(e){const t=e?.message||e?.error?.message||(z?"Failed to update issue. Please try again.":"Failed to raise issue. Please try again.");w.showError(t)}finally{M(!1)}}else w.showError("Assignee is required");else w.showError("Asset Number is required");else w.showError("Work Order is required");else w.showError("Description is required");else w.showError("Title is required")},disabled:D||!X,children:D?"Creating...":"Create Issue"})]})})]})});return A.createPortal(J,document.body)},C=({component:A,condition:r,currentValue:n,thresholdValue:i,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,onIssueRaised:c,isIssueRaised:u=!1,compact:h=!1})=>{const[d,f]=e.useState(!1),[g,m]=e.useState(null),[B,b]=e.useState(!1),[y,C]=e.useState(!1);e.useEffect(()=>{u&&C(!0)},[u]),e.useEffect(()=>{C(!1)},[r?.id]);const x=e=>({greaterThan:">",lessThan:"<",greaterThanOrEqual:"≥",lessThanOrEqual:"≤",equals:"=",notEquals:"≠"}[e]||e),F=e.useCallback(async()=>{if(u||y){if(g)return void f(!0);b(!0);try{m(null),f(!0)}catch(e){console.error("Error fetching issue:",e),w.showError("Failed to load issue details")}finally{b(!1)}}else m(null),f(!0)},[u,y,s,A,g]),Q=e.useCallback(()=>{f(!1),u||y||m(null)},[u,y]),U=e.useCallback(e=>{f(!1),m(e||null),C(!0),c&&r?.id&&c(r.id)},[c,r]);return u||y?p.jsx(p.Fragment,{children:d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})}):h?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"threshold-alert threshold-alert-unresolved threshold-alert-compact",children:[p.jsx("div",{className:"threshold-alert-border"}),p.jsxs("div",{className:"threshold-alert-content-compact",children:[p.jsx(t.AlertTriangle,{className:"threshold-alert-icon-compact",size:14}),p.jsx("span",{className:"threshold-alert-message-compact",children:`Threshold ${x(r.operator)} ${i}`}),p.jsx("button",{type:"button",onClick:F,className:"threshold-alert-raise-issue-btn-compact",title:"Raise Issue",children:"Raise Issue"})]})]}),d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"threshold-alert threshold-alert-unresolved",children:[p.jsx("div",{className:"threshold-alert-border"}),p.jsxs("div",{className:"threshold-alert-content",children:[p.jsx("div",{className:"threshold-alert-header",children:p.jsxs("div",{className:"threshold-alert-title-group",children:[p.jsx(t.AlertTriangle,{className:"threshold-alert-icon",size:20}),p.jsx("span",{className:"threshold-alert-title",children:"Threshold Condition Met - Action Required"})]})}),p.jsxs("div",{className:"threshold-alert-message",children:[(()=>{const e=x(r.operator);return`${A.basic?.label||"Value"}: Value ${n} exceeds threshold ${e} ${i}`})(),p.jsx("span",{className:"threshold-alert-warning",children:" You must raise an issue before submitting the form."})]}),p.jsx("div",{className:"threshold-alert-buttons",children:p.jsx("button",{type:"button",onClick:F,className:"threshold-alert-raise-issue-btn",children:"Raise Issue Now"})})]})]}),d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})]})},x=({id:t,properties:A,validationErrors:r={},formValue:n="",inputType:i="text",readonly:s=!1,disabled:a=!1,touchedFields:o={},formSubmitted:l=!1,mode:c="test",onValueChange:u,onBlur:h,onFocus:d,className:f="",hideLabel:g=!1,formTemplateId:m,onThresholdIssueRaised:w,raisedThresholdIssues:b=new Set,workOrderNumber:y,assetNumber:v,user:x})=>{const F=e=>null==e?"":"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?"":"value"in e?F(e.value):"label"in e?F(e.label):"":String(e||""),Q=e.useRef(t),U=e.useRef(null);e.useEffect(()=>{t!==Q.current&&(console.warn(`[DfFormInput] Component ID changed from ${Q.current} to ${t}`),Q.current=t)},[t]);const S=F(n||A?.basic?.defaultValue||""),[E,N]=e.useState(S),[L,_]=e.useState(!1),[I,k]=e.useState(!1),[T,H]=e.useState(new Set),[O,P]=e.useState(S),D=()=>{if(i)return i;const e=A?.name;return"text-input"===e?"text":"number-input"===e?"number":"email-input"===e?"email":"text"},M=e.useCallback(e=>{const t=(()=>{const e={};if(A?.validation?.required&&(e.required=!0),"email"===D()&&(e.email=!0),"text"===D()){const t=A.validation;t?.minLength&&(e.minLength=t.minLength),t?.maxLength&&(e.maxLength=t.maxLength)}if("number"===D()){const t=A.validation;t&&"lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&(e.lowerLimit=t.lowerLimit),t&&"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&(e.upperLimit=t.upperLimit)}return e})(),r={};let n=!0;const i="string"==typeof e?e:null!=e?String(e):"";if(!t.required||i&&""!==i.trim()||(r.required=!0,n=!1),t.email&&i&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(i)&&(r.email=!0,n=!1),t.minLength&&i&&i.length<t.minLength&&(r.minLength=!0,n=!1),t.maxLength&&i&&i.length>t.maxLength&&(r.maxLength=!0,n=!1),"number"===D())if(delete r.pattern,delete r.min,delete r.max,i&&""!==i.trim()){const e=i.trim(),A=parseFloat(e);isNaN(A)||("lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&A<t.lowerLimit&&(r.lowerLimit=!0,n=!1),"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&A>t.upperLimit&&(r.upperLimit=!0,n=!1))}else delete r.lowerLimit,delete r.upperLimit;return{isValid:n,errors:r}},[A,D]),j=e.useCallback(e=>{const A="string"==typeof e?e:null!=e?String(e):"";if(N(A),u){const e=M(A),r=Q.current,n={id:r,value:A,isValid:e.isValid,errors:e.errors};r!==t&&console.error(`[DfFormInput] ID mismatch in handleValueChange! ref: ${r}, prop: ${t}`),u(n)}},[t,u,M,Q]);e.useEffect(()=>{L&&(o[t]=!0)},[L,t,o]),e.useEffect(()=>{if("edit"===c){_(!1);N(A?.basic?.defaultValue||"")}else"test"===c&&(_(!1),N(""))},[c,A?.basic?.defaultValue]),e.useEffect(()=>{const e=Q.current,r=F(n||A?.basic?.defaultValue||"");r===E||I||""===r&&""!==String(E||"").trim()?""===r&&String(E||"").trim():null!=n&&(e===t?N(r):console.error(`[DfFormInput] ID mismatch! componentIdRef: ${e}, prop id: ${t}`))},[n,E,I,A?.basic?.defaultValue,t]),e.useEffect(()=>{l&&_(!0)},[l]),e.useEffect(()=>{"test"!==c&&N("")},[c]);const R=e.useCallback((e,t)=>{if(!t||""===t)return!1;const A="string"==typeof t?parseFloat(t):t,r="string"==typeof e.value?parseFloat(e.value):e.value;if(isNaN(A)||isNaN(r))return!1;switch(e.operator){case"greaterThan":return A>r;case"lessThan":return A<r;case"greaterThanOrEqual":return A>=r;case"lessThanOrEqual":return A<=r;case"equals":return A===r;case"notEquals":return A!==r;default:return!1}},[]),V=e.useMemo(()=>A?.condition?.conditions||[],[A?.condition]);e.useEffect(()=>{E!==O&&(H(new Set),P(E))},[E,O]);const K=e.useMemo(()=>{if("test"!==c||!E||""===E)return null;const e=V.filter(e=>R(e,E));if(0===e.length)return null;for(const t of e)if(!T.has(t.id))return t;return null},[E,V,T,c,R,b]),G=e.useCallback(e=>{H(t=>new Set(t).add(e))},[]),z=D(),q=a||s||A?.validation?.readonly;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!g&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",ref:U,children:[p.jsx("input",{type:z,id:t,value:E,onChange:e=>{const t=e.target.value;j(t)},onFocus:()=>{k(!0),d&&d()},onBlur:()=>{if(k(!1),_(!0),"test"===c&&u){const e="string"==typeof E?E:null!=E?String(E):"",A=M(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};u(r)}h&&h()},placeholder:A.basic.placeholder,disabled:q,readOnly:s||A?.validation?.readonly,className:(()=>{const e="form-control";if("test"===c){const A="string"==typeof E?E:null!=E?String(E):"",n=M(A);if(n.isValid)return`${e} ${f}`.trim();const i=!n.isValid&&L,s=r[t]&&(L||l)&&!n;return`${e} ${i||s?"is-invalid":""} ${f}`.trim()}return`${e} ${f}`.trim()})()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:o,formSubmitted:l,properties:A,localValidation:M(E),isTouched:L,mode:c})]})]}),K&&"test"===c&&(()=>{const e=b?.has(K.id)||!1,t=null!==U.current?.closest(".table-cell")||null!==U.current?.closest(".cell-content")||null!==U.current?.closest(".datagrid-table-view")||null!==U.current?.closest(".datagrid-list-view")||f.includes("table-cell")||f.includes("cell-content");return p.jsx(C,{component:A,condition:K,currentValue:E,thresholdValue:K.value,formTemplateId:m,workOrderNumber:y,assetNumber:v,user:x,onDismiss:()=>G(K.id),onIssueRaised:w,isIssueRaised:e,compact:t},`${K.id}-${e}`)})()]})},F=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),A?.validation?.minLength&&e&&e.length<A.validation.minLength&&(t.minLength=!0,r=!1),A?.validation?.maxLength&&e&&e.length>A.validation.maxLength&&(t.maxLength=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]);e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{""===g&&""!==n&&m(n)},[n]),e.useEffect(()=>{o&&b(!0)},[o]),e.useEffect(()=>{"test"!==l&&m("")},[l]);const C=s||i||A?.validation?.readonly,x=A?.validation?.rows||4;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("textarea",{id:t,value:g,onChange:e=>{const t=e.target.value;v(t)},onFocus:()=>{h&&h()},onBlur:()=>{b(!0),u&&u()},placeholder:A.basic.placeholder,disabled:C,readOnly:i||A?.validation?.readonly,rows:x,className:`form-textarea ${!y(g).isValid&&w?"is-invalid":""} ${d}`.trim()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})]})},Q=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=A?.validation?.multiple||!1,v=e.useCallback(e=>{const t={};let r=!0;return A?.validation?.required&&(y?Array.isArray(e)&&0!==e.length||(t.required=!0,r=!1):(!e||"string"==typeof e&&""===e.trim())&&(t.required=!0,r=!1)),{isValid:r,errors:t}},[A,y]),C=e.useCallback(e=>{if(m(e),c){const A=v(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,v]);e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{JSON.stringify(n)!==JSON.stringify(g)&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const x=s||i||A?.validation?.readonly;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsxs("select",{id:t,value:g,onChange:e=>{if(y){const t=Array.from(e.target.selectedOptions,e=>e.value);C(t)}else C(e.target.value)},onFocus:()=>{h&&h()},onBlur:()=>{b(!0),u&&u()},disabled:x,multiple:y,className:`form-select ${!v(g).isValid&&w?"is-invalid":""} ${d}`.trim(),children:[!y&&p.jsx("option",{value:"",children:A.basic.placeholder||"Select an option"}),(A.options||[]).map((e,t)=>p.jsx("option",{value:e.value,disabled:e.disabled,children:e.label},t))]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:v(g),isTouched:w,mode:l})]})]})},U=({id:t,properties:A,validationErrors:r={},formValue:n=[],readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(!1),w=Array.isArray(n)?n:[],b=e.useCallback(e=>{const t={};let r=!0;return A?.validation?.required&&0===e.length&&(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),y=e.useCallback(e=>{if(c){const A=b(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,b,w]),v=(e,t)=>{let A;A=t?[...w,e]:w.filter(t=>t!==e),y(A)},C=()=>{h&&h()},x=()=>{m(!0),u&&u()};e.useEffect(()=>{g&&(a[t]=!0)},[g,t,a]),e.useEffect(()=>{},[n,t,w]),e.useEffect(()=>{o&&m(!0)},[o]);const F=s||i||A?.validation?.readonly;return p.jsx(p.Fragment,{children:p.jsx("div",{className:`form-group checkbox-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${A?.basic?.inlineLayout?"inline-layout":"vertical-layout"} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"checkbox",id:`${t}-${A}`,name:t,value:e.value,checked:w.includes(e.value),onChange:t=>{v(e.value,t.target.checked)},onFocus:C,onBlur:x,disabled:F||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:b(w),isTouched:g,mode:l})]})]}):p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"checkbox",id:`${t}-${A}`,name:t,value:e.value,checked:w.includes(e.value),onChange:t=>{v(e.value,t.target.checked)},onFocus:C,onBlur:x,disabled:F||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:b(w),isTouched:g,mode:l})]})})})},S=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]),C=e=>{v(e)},x=()=>{h&&h()},F=()=>{b(!0),u&&u()};e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{n!==g&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const Q=s||i||A?.validation?.readonly;return p.jsx(p.Fragment,{children:p.jsx("div",{className:`form-group radio-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${A?.basic?.inlineLayout?"inline-layout":"vertical-layout"} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"radio",id:`${t}-${A}`,name:t,value:e.value,checked:g===e.value,onChange:()=>C(e.value),onFocus:x,onBlur:F,disabled:Q||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})]}):p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"radio",id:`${t}-${A}`,name:t,value:e.value,checked:g===e.value,onChange:()=>C(e.value),onFocus:x,onBlur:F,disabled:Q||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})})})},E=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),b(!0),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]),C=()=>{h&&h()},x=()=>{b(!0),u&&u()};e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{n!==g&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const F=()=>A?.basic?.inlineLayout?"inline-layout":"grid-layout",Q=e=>{const t=e?.toLowerCase();return"pass"===t||"yes"===t?"pass":"fail"===t||"no"===t?"fail":"pass"},U=e=>{if(void 0!==e?.icon&&""!==e.icon)return e.icon;return"pass"===Q(e?.value||e)?"✓":"×"},S=(e,t)=>e?.color||e?.backgroundColor?{color:t?"#ffffff":e.color||"#00814b",backgroundColor:t?e.color||"#00814b":e.backgroundColor||"#34bd4914",borderColor:e.color||"#00814b"}:{},E=e=>{if(e?.color||e?.backgroundColor)return"segment-button-label segment-button-custom";return"segment-button-label "+("pass"===Q(e?.value||e)?"pass-button":"fail-button")},N=s||i||A?.validation?.readonly;return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:`form-group segment-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsx("div",{className:"form-segment-wrapper",children:p.jsx("div",{className:`form-segment-container ${F()}`,children:(A.options||[]).map((e,A)=>{const r=g===e.value,n=S(e,r),i=E(e),s=U(e);return p.jsxs("div",{className:"form-segment-option "+(r?"selected":""),children:[p.jsx("input",{type:"radio",id:`${t}_option_${A}`,name:t,value:e.value,checked:r,onChange:()=>!N&&!e.disabled&&v(e.value),onFocus:C,onBlur:x,disabled:N||e.disabled,className:"form-segment-radio"}),p.jsxs("label",{htmlFor:`${t}_option_${A}`,className:i,style:Object.keys(n).length>0?n:void 0,children:[s&&p.jsx("span",{className:"segment-icon",children:s}),p.jsx("span",{className:"segment-text",children:e.value})]})]},A)})})})]}):p.jsx("div",{className:"form-segment-wrapper",children:p.jsx("div",{className:`form-segment-container ${F()}`,children:(A.options||[]).map((e,A)=>{const r=g===e.value,n=S(e,r),i=E(e),s=U(e);return p.jsxs("div",{className:"form-segment-option "+(r?"selected":""),children:[p.jsx("input",{type:"radio",id:`${t}_option_${A}`,name:t,value:e.value,checked:r,onChange:()=>!N&&!e.disabled&&v(e.value),onFocus:C,onBlur:x,disabled:N||e.disabled,className:"form-segment-radio"}),p.jsxs("label",{htmlFor:`${t}_option_${A}`,className:i,style:Object.keys(n).length>0?n:void 0,children:[s&&p.jsx("span",{className:"segment-icon",children:s}),p.jsx("span",{className:"segment-text",children:e.value})]})]},A)})})})}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})},N=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const g=e.useCallback(e=>{if(!e)return"";if("string"==typeof e){if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(e))return e;const t=b(e);if(t&&!isNaN(t.getTime())){const e=A.name||"",r=A.basic?.dateTimeMode||("datetime-picker"===e?"datetime":"date");if("datetime"===r){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}if("time"===r){return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}return e}if(e instanceof Date){if(isNaN(e.getTime()))return"";const t=A.name||"",r=A.basic?.dateTimeMode||("datetime-picker"===t?"datetime":"date");if("datetime"===r){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}if("time"===r){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}if("object"==typeof e&&null!==e){if("value"in e&&e.value)return g(e.value);if("date"in e&&e.date)return g(e.date);try{const t=String(e),A=b(t);if(A&&!isNaN(A.getTime()))return g(A)}catch(e){}return""}return""},[A]),m=g(n),[w,y]=e.useState(m),[v,C]=e.useState(!1),[x,F]=e.useState(!1),Q=e.useCallback(e=>{const t={};let r=!0;const n=A.name||"",i=A.basic?.dateTimeMode||("datetime-picker"===n?"datetime":"date"),s=e?String(e).trim():"";if(A?.validation?.required&&(!s||""===s))return t.required=!0,r=!1,{isValid:r,errors:t};if(s&&""!==s)if("time"===i){if(!/^([0-1][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/.test(s))return t.invalidDate=!0,r=!1,{isValid:r,errors:t}}else if("datetime"===i){const e=b(s);if(!e||isNaN(e.getTime()))return t.invalidDate=!0,r=!1,{isValid:r,errors:t};if(A?.validation?.minDate){const n=b(A.validation.minDate);n&&e<n&&(t.minDate=!0,t.minDateMessage=`Date and time must be on or after ${n.toLocaleDateString()}`,r=!1)}if(A?.validation?.maxDate){const n=b(A.validation.maxDate);n&&e>n&&(t.maxDate=!0,t.maxDateMessage=`Date and time must be on or before ${n.toLocaleDateString()}`,r=!1)}}else{const e=b(s);if(!e||isNaN(e.getTime()))return t.invalidDate=!0,r=!1,{isValid:r,errors:t};if(A?.validation?.minDate){const n=b(A.validation.minDate);n&&e<n&&(t.minDate=!0,t.minDateMessage=`Date must be on or after ${n.toLocaleDateString()}`,r=!1)}if(A?.validation?.maxDate){const n=b(A.validation.maxDate);n&&e>n&&(t.maxDate=!0,t.maxDateMessage=`Date must be on or before ${n.toLocaleDateString()}`,r=!1)}}return{isValid:r,errors:t}},[A]),U=e.useCallback(e=>{if(y(e),c){const A=Q(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,Q]);e.useEffect(()=>{v&&(a[t]=!0)},[v,t,a]),e.useEffect(()=>{const e=g(n);e===w||x||y(e)},[n,w,x,g]),e.useEffect(()=>{o&&C(!0)},[o]);const S=s||i||A?.validation?.readonly,E=A.name||"",N=A.basic?.dateTimeMode||("datetime-picker"===E?"datetime":"date"),L=(()=>{switch(N){case"time":return"time";case"datetime":return"datetime-local";default:return"date"}})();return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("input",{type:L,id:t,value:w,onChange:e=>{const t=e.target.value;U(t)},onFocus:()=>{F(!0),h&&h()},onBlur:()=>{if(F(!1),C(!0),c){const e=Q(w),A={id:t,value:w,isValid:e.isValid,errors:e.errors};c(A)}u&&u()},disabled:S,readOnly:i||A?.validation?.readonly,min:A?.validation?.minDate,max:A?.validation?.maxDate,className:`form-date ${!Q(w).isValid&&v?"is-invalid":""} ${d}`.trim()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(w),isTouched:v,mode:l})]})]})},L=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const g=e.useRef(null),[m,w]=e.useState(!1),[b,y]=e.useState(!1),[v,C]=e.useState(n),[x,F]=e.useState(!1),Q=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),U=e.useCallback(e=>{if(C(e),c){const A=Q(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,Q]),S=e.useCallback(()=>{const e=document.documentElement.classList.contains("dark")||"dark"===document.documentElement.getAttribute("data-theme");let t=getComputedStyle(document.documentElement).getPropertyValue("--df-color-fb-input-bg").trim();t||(t=e?"#2c2e34":"#ffffff");return{strokeColor:e?"#ffffff":"#000000",backgroundColor:t}},[]),E=e.useCallback(e=>{if(!e)return;const A=g.current;if(!A)return;const r=A.getContext("2d");if(!r)return;const n=new Image;n.onload=()=>{r.clearRect(0,0,A.width,A.height);const e=S();r.fillStyle=e.backgroundColor,r.fillRect(0,0,A.width,A.height);const t=A.width/A.height,i=n.width/n.height;let s=A.width,a=A.height,o=0,l=0;i>t?(a=A.width/i,l=(A.height-a)/2):(s=A.height*i,o=(A.width-s)/2),r.drawImage(n,o,l,s,a)},n.onerror=A=>{console.error("DfFormSignature: error loading image",{id:t,error:A,dataURL:e.substring(0,50)+"..."})},n.src=e},[S,t]),N=e.useCallback(()=>{const e=g.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const A=e.getBoundingClientRect();e.width=A.width,e.height=A.height,e.style.width=A.width+"px",e.style.height=A.height+"px";const r=S();t.strokeStyle=r.strokeColor,t.lineWidth=2,t.lineCap="round",t.lineJoin="round",v?E(v):(t.fillStyle=r.backgroundColor,t.fillRect(0,0,e.width,e.height))},[v,S,E]),L=e.useCallback(()=>{setTimeout(()=>{N()},100)},[N]);e.useEffect(()=>{const e=()=>{L()},t=new MutationObserver(e=>{e.forEach(e=>{if("attributes"===e.type&&"class"===e.attributeName){const t=e.target;t.classList.contains("form-canvas-container")&&(t.classList.contains("mobile-view")||t.classList.contains("tablet-view")||t.classList.contains("desktop-view"))&&L()}})});return t.observe(document.body,{attributes:!0,attributeFilter:["class"],subtree:!0}),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[L]);const _=e.useCallback(e=>{const t=g.current;if(!t)return{x:0,y:0};const A=t.getBoundingClientRect(),r=t.width/A.width,n=t.height/A.height,i=e.type.includes("mouse")?e.clientX:e.touches[0].clientX,s=e.type.includes("mouse")?e.clientY:e.touches[0].clientY;return{x:(i-A.left)*r,y:(s-A.top)*n}},[]),I=e=>{if(i||s||A?.validation?.readonly)return;if(e.target.closest(".clear-signature-btn"))return;e.preventDefault(),e.stopPropagation(),w(!0),y(!0);const t=g.current;if(!t)return;const r=t.getContext("2d");if(!r)return;const{x:n,y:a}=_(e),o=S();r.strokeStyle=o.strokeColor,r.lineWidth=2,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(n,a)},k=e=>{if(!m)return;e.preventDefault(),e.stopPropagation();const t=g.current;if(!t)return;const A=t.getContext("2d");if(!A)return;const{x:r,y:n}=_(e);A.lineTo(r,n),A.stroke()},T=()=>{if(!m)return;w(!1),F(!0);const e=g.current;if(e){(e=>{const t=e.getContext("2d");if(!t)return!1;const A=t.getImageData(0,0,e.width,e.height).data;for(let e=0;e<A.length;e+=4){const t=A[e],r=A[e+1],n=A[e+2];if(A[e+3]>0&&(t<255||r<255||n<255))return!0}})(e);const t=e.toDataURL("image/png");C(t),U(t),setTimeout(()=>{F(!1)},100)}else F(!1)},H=e.useCallback(()=>{const e=g.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const A=S();if(t.strokeStyle=A.strokeColor,v){const r=v,n=e.getBoundingClientRect();t.fillStyle=A.backgroundColor,t.fillRect(0,0,n.width,n.height),r&&E(r)}else{const r=e.getBoundingClientRect();t.fillStyle=A.backgroundColor,t.fillRect(0,0,r.width,r.height)}},[S,v,E]);e.useEffect(()=>{const e=new MutationObserver(e=>{e.forEach(e=>{"attributes"!==e.type||"class"!==e.attributeName&&"data-theme"!==e.attributeName||H()})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>{e.disconnect()}},[H]);e.useEffect(()=>{b&&(a[t]=!0)},[b,t,a]),e.useEffect(()=>{if(!(n===v||m||x||""!==v&&""===n)){if(n===v)return;C(n),n&&E(n)}},[n,v,m,x]),e.useEffect(()=>{o&&y(!0)},[o]),e.useEffect(()=>{if("test"!==l){C("");const e=g.current;if(e){const t=e.getContext("2d");if(t){const A=e.getBoundingClientRect();e.width=A.width,e.height=A.height;const r=S();t.fillStyle=r.backgroundColor,t.fillRect(0,0,A.width,A.height)}}}},[l]),e.useEffect(()=>{N()},[l]);const O=s||i||A?.validation?.readonly;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsxs("div",{className:"signature-container",style:{position:"relative",width:"100%",maxWidth:"100%",overflow:"hidden"},children:[p.jsx("canvas",{ref:g,id:t,className:`form-signature ${!Q(v).isValid&&b?"is-invalid":""} ${d}`.trim(),onMouseDown:I,onMouseMove:k,onMouseUp:T,onMouseLeave:T,onTouchStart:I,onTouchMove:k,onTouchEnd:T,onFocus:()=>{h&&h()},onBlur:()=>{u&&u()},style:{width:"100%",height:"150px",border:"2px solid var(--df-color-primary-border)",borderRadius:"6px",cursor:O?"not-allowed":"crosshair",backgroundColor:"var(--df-color-fb-input-bg)",touchAction:"none",userSelect:"none"}}),!O&&p.jsx("button",{type:"button",onClick:e=>(e=>{e?.preventDefault(),e?.stopPropagation();const t=g.current;if(!t)return;const A=t.getBoundingClientRect();t.width=A.width,t.height=A.height;const r=t.getContext("2d");if(!r)return;const n=S();r.fillStyle=n.backgroundColor,r.fillRect(0,0,A.width,A.height),r.strokeStyle=n.strokeColor,r.lineWidth=2,r.lineCap="round",r.lineJoin="round",C(""),U("")})(e),className:"clear-signature-btn",style:{position:"absolute",bottom:"8px",right:"8px",padding:"4px 8px",backgroundColor:"var(--df-color-error-primary)",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:"500",zIndex:10,transition:"all 0.2s ease",minWidth:"60px",minHeight:"28px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--df-color-error-dark, #dc2626)",e.currentTarget.style.transform="scale(1.05)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--df-color-error-primary)",e.currentTarget.style.transform="scale(1)"},children:"Clear"})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(v),isTouched:b,mode:l})]})]})},_=({id:t,properties:A,validationErrors:r={},formValue:n=null,readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="test",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState([]),[w,b]=e.useState(!1),[y,v]=e.useState(!1),C=e.useRef(null),x=e.useCallback((e,A=0)=>{if(!e)return[];const r="string"==typeof e?[e]:e,n=Array.isArray(r)?r:Array.from(r),i=[];return n.forEach(e=>{let r,n,s=0,a="",o="";if(e instanceof File||e instanceof Blob){const t=e;if(s=t.size||0,a=t.type||"",o=t.name||`file-${A+i.length}`,n=t,a.startsWith("image/"))try{r=URL.createObjectURL(t)}catch(e){console.error("Error creating object URL:",e),r=void 0}}else if("string"==typeof e){const t=e;if(o=`file-${A+i.length}`,t.startsWith("data:")){const e=t.indexOf(";");a=e>5?t.substring(5,e):"application/octet-stream"}else{const e=t.match(/\.(jpg|jpeg|png|gif|webp|svg|pdf|doc|docx|xls|xlsx|zip|rar)$/i);if(e){a={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",zip:"application/zip",rar:"application/x-rar-compressed"}[e[1].toLowerCase()]||"application/octet-stream"}else a="application/octet-stream"}(t.startsWith("data:image")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:"))&&(r=t),n=t}else{if(!e||"object"!=typeof e)return;{const t=e;if(o=t.name||t.fileName||`file-${A+i.length}`,s=t.size||t.fileSize||0,a=t.type||t.fileType||t.mimeType||"",t.url||t.path)r=t.url||t.path;else if(a.startsWith("image/")&&t.data){const e=t.data;r="string"==typeof e?e.startsWith("data:")?e:`data:${a};base64,${e}`:void 0}n=t}}i.push({file:n,id:`${t}-file-${A+i.length}`,size:s,type:a,name:o,preview:r})}),i},[t]),F=e.useCallback(()=>({isValid:!0,errors:{}}),[]),Q=e.useCallback(e=>{if(i||s)return;const r=A?.validation?.multiple||!1,n=A?.validation?.maxFiles||1/0,a=x(e,g.length);let o;o=r||1!==A?.validation?.maxFiles?[...g,...a]:x(e,0);const l=o.slice(0,n);if(m(l),v(!0),c){const e=F(),A={id:t,value:l.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(A)}},[g,A,i,s,c,F,x,t]),U=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},S=e=>e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎥":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("word")||e.includes("document")?"📝":e.includes("excel")||e.includes("spreadsheet")?"📊":e.includes("zip")||e.includes("rar")?"📦":"📁";e.useEffect(()=>{y&&(a[t]=!0)},[y,t,a]),e.useEffect(()=>{("edit"===l||"test"===l)&&v(!1)},[l]),e.useEffect(()=>{const e=x(n);m(e)},[n,x]),e.useEffect(()=>{o&&v(!0)},[o]),e.useEffect(()=>()=>{g.forEach(e=>{if(e.preview&&e.preview.startsWith("blob:"))try{URL.revokeObjectURL(e.preview)}catch(e){console.error("Error revoking object URL:",e)}})},[g]);const E=()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"},N=s||i||A?.validation?.readonly,L=A?.validation?.multiple||!1,_=A?.validation?.accept||"*/*",I=A?.validation?.maxFiles||1/0,k=g.length<I&&(L||I>1),T="edit"===l,H="preview"===l||"test"===l,O=g.filter(e=>e.type.startsWith("image/")),P=g.filter(e=>!e.type.startsWith("image/")),D=O.length>0;return H&&D?p.jsxs("div",{className:`form-group ${E()}`,children:[!f&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic?.label,A.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"file-upload-wrapper",children:[p.jsxs("div",{className:"file-image-display "+(A.basic?.horizontalView?"horizontal-view":"vertical-view"),children:[O.map(e=>p.jsxs("div",{className:"file-image-container",children:[e.preview&&p.jsx("img",{src:e.preview,alt:e.name,className:"file-image-preview"}),p.jsxs("div",{className:"file-image-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:U(e.size)})]})]},e.id)),P.length>0&&p.jsxs("div",{className:"file-other-files",children:[p.jsx("div",{className:"file-other-files-label",children:"Other Files:"}),P.map(e=>p.jsxs("div",{className:"file-item-minimal",children:[p.jsx("div",{className:"file-icon",children:S(e.type)}),p.jsxs("div",{className:"file-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:U(e.size)})]})]},e.id))]})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:F(),isTouched:y,mode:l})]})]}):p.jsxs("div",{className:`form-group ${E()}`,children:[!f&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic?.label,A.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"file-upload-wrapper",children:[p.jsxs("div",{className:`file-upload-area ${w?"drag-over":""} ${i?"readonly":""} ${s?"disabled":""} ${d}`.trim(),onDragOver:e=>{e.stopPropagation(),(e=>{e.preventDefault(),i||s||b(!0)})(e)},onDragLeave:e=>{e.stopPropagation(),(e=>{e.preventDefault(),b(!1)})(e)},onDrop:e=>{e.stopPropagation(),(e=>{if(e.preventDefault(),b(!1),i||s)return;const t=e.dataTransfer.files;t.length>0&&Q(t)})(e)},onClick:e=>{e.stopPropagation();const t=e.target,A=null!==t.closest(".file-item"),r=null!==t.closest(".file-remove");!T||N||0!==g.length||A||r||C.current?.click()},onFocus:e=>{e.stopPropagation(),h&&h()},onBlur:e=>{e.stopPropagation(),(()=>{if(v(!0),"test"===l&&c){const e=F(),A={id:t,value:g.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(A)}u&&u()})()},tabIndex:N?-1:0,children:[p.jsx("input",{ref:C,type:"file",id:t,multiple:L,accept:_,onChange:e=>{const t=e.target.files;t&&t.length>0&&(Q(t),e.target.value="")},disabled:N,style:{display:"none"}}),0===g.length?p.jsxs("div",{className:"upload-placeholder",onClick:e=>{e.stopPropagation(),T&&!N&&C.current?.click()},children:[p.jsx("div",{className:"upload-icon",children:"📁"}),p.jsx("div",{className:"upload-text",children:A.basic.placeholder&&p.jsx("p",{className:"upload-hint",children:A.basic.placeholder})})]}):p.jsx("div",{className:"file-list "+(A.basic?.horizontalView?"horizontal-view":"vertical-view"),children:g.map(e=>p.jsxs("div",{className:"file-item",children:[p.jsx("div",{className:"file-preview",children:e.preview?p.jsx("img",{src:e.preview,alt:e.name,className:"file-image"}):p.jsx("div",{className:"file-icon",children:S(e.type)})}),p.jsxs("div",{className:"file-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:U(e.size)})]}),T&&!N&&p.jsx("button",{type:"button",className:"file-remove",onClick:A=>{A.stopPropagation(),(e=>{if(i||s)return;const A=g.filter(t=>t.id!==e);if(m(A),v(!0),c){const e=F(),r={id:t,value:A.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(r)}})(e.id)},"aria-label":`Remove ${e.name}`,children:"✕"})]},e.id))})]}),g.length>0&&k&&!N&&T&&p.jsxs("button",{type:"button",className:"file-add-more",onClick:e=>{e.stopPropagation(),!N&&C.current&&T&&(C.current.value="",C.current.click())},"aria-label":"Add more files",children:[p.jsx("svg",{className:"file-add-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M12 5v14M5 12h14"})}),p.jsx("span",{className:"file-add-text",children:"Add More Files"})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:F(),isTouched:y,mode:l})]})]})},I=({id:A,properties:r,validationErrors:n={},formValue:i=null,readonly:s=!1,disabled:a=!1,touchedFields:o={},formSubmitted:l=!1,mode:c="test",onValueChange:u,onBlur:h,onFocus:d,className:f="",hideLabel:g=!1})=>{const[m,w]=e.useState(i),[y,v]=e.useState(!1),[C,x]=e.useState(""),[F,Q]=e.useState(!1),[U,S]=e.useState(!1),[E,N]=e.useState({lat:40.7128,lng:-74.006}),[L,_]=e.useState(null),[I,k]=e.useState(10),[T,H]=e.useState(""),[O,P]=e.useState(!1),D=e.useRef(null),[M,j]=e.useState(!1),[R,V]=e.useState(null),[K,G]=e.useState(!1);e.useEffect(()=>{if(i&&i.latitude&&i.longitude){40.7128===i.latitude&&-74.006===i.longitude||(w(i),_({lat:i.latitude,lng:i.longitude,isCurrentLocation:!1}),N({lat:i.latitude,lng:i.longitude}))}else null==i&&(w(null),_(null))},[i]),e.useEffect(()=>{U&&40.7128===E.lat&&E.lng},[U,E]),e.useEffect(()=>{(s||a)&&(U&&S(!1),T&&H(""),M&&(j(!1),V(null)))},[s,a]);const z=e.useCallback(async(e,t)=>{G(!0);try{const A=await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&addressdetails=1&zoom=18`),r=await A.json();if(r&&r.address){const e=r.address;return{placeName:r.display_name||"",city:e.city||e.town||e.village||e.municipality||"",country:e.country||""}}}catch(e){console.error("Reverse geocoding failed:",e)}finally{G(!1)}return{placeName:"",city:"",country:""}},[]),q=e.useCallback(async(e,t,r)=>{const n=await z(e,t),i={latitude:e,longitude:t,timestamp:Date.now(),placeName:n.placeName,city:n.city,country:n.country,address:n.placeName,...r};if(w(i),_({lat:e,lng:t,isCurrentLocation:!1}),Q(!0),u){u({id:A,value:i,isValid:!0,errors:{}})}},[z,A,u]),W=e.useCallback(async()=>{if(s||a)return;v(!0),x("");if(void 0!==window.Capacitor)try{const{Geolocation:e}=window.Capacitor.Plugins;if(e)try{if("granted"!==(await e.requestPermissions()).location)return v(!1),void x("Location permission is required. Please enable location access in your device settings.");const t=await e.getCurrentPosition({enableHighAccuracy:r.validation?.enableHighAccuracy??!0,timeout:r.validation?.timeout??1e4,maximumAge:r.validation?.maximumAge??3e5}),A=t.coords.latitude,n=t.coords.longitude;return _({lat:A,lng:n,isCurrentLocation:!0}),N({lat:A,lng:n}),Q(!0),await q(A,n,{accuracy:t.coords.accuracy,timestamp:Date.now()}),v(!1),void x("")}catch(e){return v(!1),void(e.message?.includes("permission")||e.message?.includes("denied")?x("Location permission is required. Please enable location access in your device settings."):e.message?.includes("timeout")?x("Location request timed out. Please try again."):x("Unable to retrieve your location. Please try again."))}}catch(e){console.warn("Capacitor Geolocation not available, falling back to web geolocation")}if(!navigator.geolocation)return v(!1),void x("Geolocation is not supported by this browser.");const e={enableHighAccuracy:r.validation?.enableHighAccuracy??!0,timeout:r.validation?.timeout??1e4,maximumAge:r.validation?.maximumAge??3e5};navigator.geolocation.getCurrentPosition(async e=>{const t=e.coords.latitude,A=e.coords.longitude;_({lat:t,lng:A,isCurrentLocation:!0}),N({lat:t,lng:A}),Q(!0),await q(t,A,{accuracy:e.coords.accuracy,timestamp:e.timestamp}),v(!1),x("")},e=>{v(!1);let t="Unable to retrieve your location.";switch(e.code){case e.PERMISSION_DENIED:t="Location access denied by user. Please enable location access in your browser/device settings.";break;case e.POSITION_UNAVAILABLE:t="Location information is unavailable.";break;case e.TIMEOUT:t="Location request timed out. Please try again."}x(t)},e)},[s,a,r,q]),X=e.useCallback(()=>{if(!s&&!a&&(w(null),_(null),x(""),Q(!0),u)){u({id:A,value:null,isValid:!0,errors:{}})}},[s,a,A,u]),Y=e.useCallback(()=>{s||a||S(!U)},[s,a,U]),J=e.useCallback((e,t,A,r,n,i)=>{const s=e-n/2,a=t-i/2,o=156543.03392*Math.cos(A.lat*Math.PI/180)/Math.pow(2,r),l=s*o,c=a*o;return{lat:A.lat+c/111320,lng:A.lng+l/(111320*Math.cos(A.lat*Math.PI/180))}},[]),$=e.useCallback(e=>{s||a||!D.current||0===e.button&&(j(!0),V({x:e.clientX,y:e.clientY}),e.preventDefault())},[s,a]),Z=e.useCallback(e=>{if(!M||!R||!D.current)return;const t=e.clientX-R.x,A=e.clientY-R.y,r=156543.03392*Math.cos(E.lat*Math.PI/180)/Math.pow(2,I),n=-A*r/111320,i=t*r/(111320*Math.cos(E.lat*Math.PI/180));N({lat:E.lat+n,lng:E.lng+i}),V({x:e.clientX,y:e.clientY})},[M,R,E,I]),ee=e.useCallback(async e=>{if(!D.current)return;if(M&&R){const t=Math.abs(e.clientX-R.x),A=Math.abs(e.clientY-R.y);if(t>5||A>5)return j(!1),void V(null)}if(s||a)return j(!1),void V(null);const t=D.current.getBoundingClientRect(),A=e.clientX-t.left,r=e.clientY-t.top,{lat:n,lng:i}=J(A,r,E,I,t.width,t.height);await q(n,i),j(!1),V(null)},[s,a,D,E,I,J,q,M,R]),te=e.useCallback(async e=>{if(e.trim()&&!s&&!a){P(!0),x("");try{const t=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(e)}&limit=5&addressdetails=1`),r=await t.json();if(r&&r.length>0){const e=r[0],t=parseFloat(e.lat),n=parseFloat(e.lon),i=e.address||{},s={latitude:t,longitude:n,address:e.display_name,placeName:e.display_name,city:i.city||i.town||i.village||i.municipality||"",country:i.country||"",timestamp:Date.now()};if(w(s),_({lat:t,lng:n,isCurrentLocation:!1}),N({lat:t,lng:n}),Q(!0),u){u({id:A,value:s,isValid:!0,errors:{}})}}else x("No locations found for your search.")}catch(e){x("Failed to search for location. Please try again.")}finally{P(!1)}}},[s,a,A,u]),Ae=()=>{d&&d()},re=()=>{Q(!0),h&&h()},ne=a||s||r?.validation?.readonly,ie=r?.basic?.label||"Location",se=r?.basic?.description||"";return p.jsxs("div",{className:`form-group ${r.basic?.horizontalView?"horizontal-view":"vertical-view"} ${g?"no-label":""} ${f}`,children:[!g&&p.jsxs("label",{htmlFor:A,className:"form-label",children:[ie,r?.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),se&&p.jsx("div",{className:"form-group-description",children:se}),p.jsxs("div",{className:"location-wrapper",children:[!(s&&m)&&p.jsxs("div",{className:"location-controls",children:[p.jsx("button",{type:"button",className:"location-btn "+(y?"loading":""),onClick:W,disabled:ne||y,onFocus:Ae,onBlur:re,tabIndex:ne?-1:0,children:y?p.jsxs(p.Fragment,{children:[p.jsx(t.Loader2,{size:16,className:"loading-spinner"}),"Getting Location..."]}):p.jsxs(p.Fragment,{children:[p.jsx(t.Navigation,{size:16}),"Get Current Location"]})}),p.jsxs("button",{type:"button",className:"location-btn secondary",onClick:Y,disabled:ne,onFocus:Ae,onBlur:re,tabIndex:ne?-1:0,children:[p.jsx(t.MapPin,{size:16}),U?"Hide Map":"Choose on Map"]})]}),m&&p.jsxs("div",{className:"location-display",children:[!s&&p.jsx("button",{type:"button",className:"location-clear-btn",onClick:X,disabled:ne,title:"Clear location",children:p.jsx(t.X,{size:16})}),m.placeName&&p.jsxs("div",{className:"location-place-name",children:[p.jsx("strong",{children:"Place:"})," ",m.placeName]}),(m.city||m.country)&&p.jsxs("div",{className:"location-address",children:[p.jsx("strong",{children:"Address:"})," ",[m.city,m.country].filter(Boolean).join(", ")]}),p.jsxs("div",{className:"location-coordinates",children:[p.jsx("strong",{children:"Coordinates:"})," ",(oe=m.latitude,le=m.longitude,void 0===oe||void 0===le||isNaN(oe)||isNaN(le)?"":`${Number(oe).toFixed(6)}, ${Number(le).toFixed(6)}`)]}),m.accuracy&&p.jsxs("div",{className:"location-accuracy",children:[p.jsx("strong",{children:"Accuracy:"})," ",(ae=m.accuracy,ae?`±${Math.round(ae)}m`:"")]}),m.timestamp&&p.jsxs("div",{className:"location-timestamp",children:[p.jsx("strong",{children:"Captured:"})," ",(b(m.timestamp)||new Date).toLocaleString()]})]}),U&&!s&&p.jsxs("div",{className:"location-map-container",children:[p.jsxs("div",{className:"location-map-header",children:[p.jsx("h4",{children:"Select Location on Map"}),p.jsx("p",{children:"Search for a place or click on the map to select a location"})]}),p.jsx("div",{className:"location-search",children:p.jsx("form",{onSubmit:e=>{e.preventDefault(),T.trim()&&te(T)},className:"search-form",children:p.jsxs("div",{className:"search-input-group",children:[p.jsx("input",{type:"text",value:T,onChange:e=>{H(e.target.value)},placeholder:"Search for a place (e.g., New York, Paris, Tokyo)",className:"search-input",disabled:ne||O}),p.jsx("button",{type:"submit",className:"search-btn",disabled:ne||O||!T.trim(),children:O?p.jsx(t.Loader2,{size:16,className:"loading-spinner"}):"Search"})]})})}),p.jsxs("div",{ref:D,className:"location-map "+(M?"dragging":""),onMouseDown:$,onMouseMove:Z,onMouseUp:ee,onMouseLeave:()=>{j(!1),V(null)},style:{position:"relative",height:"400px",border:"2px solid var(--df-color-fb-border)",borderRadius:"8px",overflow:"hidden",cursor:M?"grabbing":"grab",background:`url(https://tile.openstreetmap.org/${I}/${Math.floor((E.lng+180)/360*Math.pow(2,I))}/${Math.floor((1-Math.log(Math.tan(E.lat*Math.PI/180)+1/Math.cos(E.lat*Math.PI/180))/Math.PI)/2*Math.pow(2,I))}.png) center/cover no-repeat`,userSelect:"none"},children:[L&&p.jsx("div",{className:"map-marker "+(L.isCurrentLocation?"current-location":"selected-location"),style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -100%)",zIndex:10},children:p.jsx(t.MapPin,{size:24})}),p.jsx("div",{className:"map-center-indicator",style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",backgroundColor:"var(--df-color-primary)",borderRadius:"50%",zIndex:5}}),p.jsxs("div",{className:"map-controls",children:[p.jsx("button",{type:"button",className:"map-zoom-btn",onClick:()=>k(e=>Math.min(18,e+1)),disabled:I>=18,children:"+"}),p.jsx("button",{type:"button",className:"map-zoom-btn",onClick:()=>k(e=>Math.max(1,e-1)),disabled:I<=1,children:"−"})]})]}),p.jsxs("div",{className:"location-map-instructions",children:[p.jsx("p",{children:p.jsx("strong",{children:"Instructions:"})}),p.jsxs("ul",{children:[p.jsx("li",{children:"Search for a place using the search box above"}),p.jsx("li",{children:"Click anywhere on the map to select a location"}),p.jsx("li",{children:"Drag the map to pan around"}),p.jsx("li",{children:"Use the zoom buttons (+/−) to zoom in/out"}),p.jsx("li",{children:'Use "Get Current Location" to automatically detect your position'})]})]}),K&&p.jsxs("div",{className:"location-loading",children:[p.jsx(t.Loader2,{size:16,className:"loading-spinner"}),p.jsx("span",{children:"Loading address details..."})]})]}),C&&p.jsx("div",{className:"location-error",children:C})]}),p.jsx(B,{validationErrors:n,fieldId:A,touchedFields:o,formSubmitted:l,properties:r,localValidation:{isValid:!0,errors:{}},isTouched:F,mode:c})]});var ae,oe,le},k=({id:e,properties:t,className:A="",hideLabel:r=!1})=>{const n=t.styles?.level??t.basic.level??1,i=t.basic.label,s=()=>{const e={};return t?.styles?.fontSize&&(e.fontSize=t.styles.fontSize),t?.styles?.color&&(e.color=t.styles.color),e};return r?null:(()=>{const r={id:e,className:`form-heading h${n} ${t?.styles?.textAlign?`text-${t.styles.textAlign}`:""} ${A}`.trim(),style:s()};switch(n){case 1:default:return p.jsx("h1",{...r,children:i});case 2:return p.jsx("h2",{...r,children:i});case 3:return p.jsx("h3",{...r,children:i});case 4:return p.jsx("h4",{...r,children:i});case 5:return p.jsx("h5",{...r,children:i});case 6:return p.jsx("h6",{...r,children:i})}})()},T=({id:A,properties:r,mode:n="preview",formValue:i,onValueChange:s,className:a="",hideLabel:o=!1})=>{const[l,c]=e.useState(""),[u,h]=e.useState(r.validation?.listStyle||"numbers"),[d,f]=e.useState("#000000"),g=e.useRef(null),m=e.useRef(null),w=e.useRef(!1),B="edit"===n,b=e.useRef({instructions:[],listStyle:"numbers",formValue:void 0}),y=e.useRef(n);e.useEffect(()=>{let e=[],t="numbers";if(null!=i&&("object"==typeof i&&i.instructions?(Array.isArray(i.instructions)?e=i.instructions:"string"==typeof i.instructions&&(e=[i.instructions]),i.listStyle&&(t=i.listStyle)):Array.isArray(i)?e=i:"string"==typeof i&&(e=[i])),0===e.length&&r.basic?.value){const A=r.basic.value;A&&"object"==typeof A&&!Array.isArray(A)&&A.instructions?(Array.isArray(A.instructions)?e=A.instructions:"string"==typeof A.instructions&&(e=[A.instructions]),A.listStyle&&"string"==typeof A.listStyle&&(t=A.listStyle)):Array.isArray(A)?e=A:"string"==typeof A&&(e=[A])}0===e.length&&r.basic?.instructions&&(Array.isArray(r.basic.instructions)?e=r.basic.instructions:"string"==typeof r.basic.instructions&&(e=[r.basic.instructions])),t&&"numbers"!==t||(t=r.validation?.listStyle||r.basic?.value?.listStyle||"numbers");const A=JSON.stringify(e)!==JSON.stringify(b.current.instructions)||t!==b.current.listStyle,s=n!==y.current,a=JSON.stringify(i)!==JSON.stringify(b.current.formValue),o=!b.current.formValue||Array.isArray(b.current.formValue)&&0===b.current.formValue.length||"string"==typeof b.current.formValue&&""===b.current.formValue.trim(),l=null!=i&&(Array.isArray(i)&&i.length>0||"string"==typeof i&&""!==i.trim()||"object"==typeof i&&Object.keys(i).length>0);if(A||s||a||o&&l){const r=e=>"string"!=typeof e?e:e.replace(/\\u([0-9a-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16))),a=e.map(e=>"string"==typeof e?r(e):e),o=a.some(e=>"string"==typeof e&&/<[^>]+>/.test(e));let l="";if(a.length>0)if(o)l=a.join("");else{const e="numbers"===t?"ol":"bullets"===t?"ul":"div",A=a.filter(e=>e&&"string"==typeof e).map(e=>`<li>${e.replace(/\n/g,"<br>")}</li>`).join("");l="div"===e?a.filter(e=>e&&"string"==typeof e).map(e=>`<div>${e.replace(/\n/g,"<br>")}</div>`).join(""):`<${e}>${A}</${e}>`}h(t),c(l),B&&g.current&&(s||A&&g.current.innerHTML.trim()!==l.trim())&&(g.current.innerHTML=l),b.current={instructions:e,listStyle:t,formValue:i},y.current=n}},[i,r.basic?.instructions,r.validation?.listStyle,n,B]),e.useEffect(()=>{if(B&&g.current){const e=g.current.innerHTML.trim();l.trim()===e||w.current||(g.current.innerHTML=l)}if(w.current){const e=setTimeout(()=>{w.current=!1},200);return()=>clearTimeout(e)}},[l,B]);const v=e.useCallback(()=>{if(!g.current)return;w.current=!0;const e=g.current.innerHTML.trim();if(s){s({id:A,value:{instructions:e?[e]:[],listStyle:u},isValid:!0,errors:{}})}e!==l&&c(e)},[A,u,s,l]),C=e.useCallback(()=>{if(!g.current)return;const e=g.current.innerHTML.trim();if(s){s({id:A,value:{instructions:e?[e]:[],listStyle:u},isValid:!0,errors:{}})}c(e),w.current=!1},[A,u,s]),x=e.useCallback((e,t)=>{document.execCommand(e,!1,t),g.current?.focus(),v()},[v]),F=e.useCallback(()=>{x("bold")},[x]),Q=e.useCallback(()=>{x("italic")},[x]),U=e.useCallback(e=>{const t=e.target.value;f(t),x("foreColor",t)},[x]),S=e.useCallback(e=>{if(h(e),!g.current)return;const t=window.getSelection(),r=t&&t.rangeCount>0?t.getRangeAt(0):null;let n=g.current.innerHTML;if("numbers"===e){if(n=n.replace(/<ul>/gi,"<ol>").replace(/<\/ul>/gi,"</ol>"),!n.includes("<ol>")&&!n.includes("<ul>")){const e=n.split(/<br\s*\/?>/i).filter(e=>e.trim());e.length>0&&(n="<ol>"+e.map(e=>`<li>${e}</li>`).join("")+"</ol>")}}else if("bullets"===e){if(n=n.replace(/<ol>/gi,"<ul>").replace(/<\/ol>/gi,"</ul>"),!n.includes("<ol>")&&!n.includes("<ul>")){const e=n.split(/<br\s*\/?>/i).filter(e=>e.trim());e.length>0&&(n="<ul>"+e.map(e=>`<li>${e}</li>`).join("")+"</ul>")}}else n=n.replace(/<\/?[ou]l>/gi,"").replace(/<li>/gi,"<div>").replace(/<\/li>/gi,"</div>");if(g.current.innerHTML=n,c(n),r&&t)try{t.removeAllRanges(),t.addRange(r)}catch(e){}if(v(),s){s({id:A,value:{instructions:n?[n]:[],listStyle:e},isValid:!0,errors:{}})}},[A,v,s]),E=e.useCallback(e=>{const t=e.target.files?.[0];if(!t||!t.type.startsWith("image/"))return;const A=new FileReader;A.onload=e=>{const t=e.target?.result;if(t&&g.current){const e=document.createElement("img");e.src=t,e.style.maxWidth="100%",e.style.height="auto";const A=window.getSelection();if(A&&A.rangeCount>0){const t=A.getRangeAt(0);t.deleteContents(),t.insertNode(e)}else g.current.appendChild(e);v()}},A.readAsDataURL(t),m.current&&(m.current.value="")},[v]),N=e.useCallback(e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),A=window.getSelection();if(A&&A.rangeCount>0){const e=A.getRangeAt(0);e.deleteContents();const r=document.createTextNode(t);e.insertNode(r),e.setStartAfter(r),e.collapse(!0),A.removeAllRanges(),A.addRange(e)}v()},[v]),L=e.useCallback(e=>document.queryCommandState(e),[]);return p.jsxs("div",{className:`form-group instruction-group ${a}`,children:[!o&&p.jsx("label",{htmlFor:A,className:"instruction-label",children:"Instructions"}),B?p.jsxs("div",{className:"instruction-rich-editor",children:[p.jsxs("div",{className:"instruction-toolbar",children:[p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn "+(L("bold")?"active":""),onClick:F,title:"Bold","aria-label":"Bold",children:p.jsx(t.Bold,{size:16})}),p.jsx("button",{type:"button",className:"toolbar-btn "+(L("italic")?"active":""),onClick:Q,title:"Italic","aria-label":"Italic",children:p.jsx(t.Italic,{size:16})})]}),p.jsx("div",{className:"toolbar-separator"}),p.jsx("div",{className:"toolbar-group",children:p.jsxs("div",{className:"color-picker-wrapper",children:[p.jsx("input",{type:"color",value:d,onChange:U,className:"color-picker-input",title:"Text Color"}),p.jsx("label",{className:"color-picker-label",title:"Text Color",children:p.jsx("span",{style:{color:d},children:"A"})})]})}),p.jsx("div",{className:"toolbar-separator"}),p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn "+("bullets"===u?"active":""),onClick:()=>S("bullets"),title:"Bullet List","aria-label":"Bullet List",children:p.jsx(t.List,{size:16})}),p.jsx("button",{type:"button",className:"toolbar-btn "+("numbers"===u?"active":""),onClick:()=>S("numbers"),title:"Numbered List","aria-label":"Numbered List",children:p.jsx(t.ListOrdered,{size:16})})]}),p.jsx("div",{className:"toolbar-separator"}),p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn",onClick:()=>m.current?.click(),title:"Insert Image","aria-label":"Insert Image",children:p.jsx(t.Image,{size:16})}),p.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:E,style:{display:"none"}})]})]}),p.jsx("div",{ref:g,contentEditable:!0,className:"instruction-editor-content",onInput:v,onBlur:C,onPaste:N,"data-placeholder":"Enter instructions (press Enter for a new line)...",suppressContentEditableWarning:!0})]}):p.jsx("div",{className:"instruction-preview-wrapper "+("numbers"===u?"instruction-list-numbers":"bullets"===u?"instruction-list-bullets":""),children:l?p.jsx("div",{className:"instruction-preview-content",dangerouslySetInnerHTML:{__html:l}}):p.jsx("div",{className:"instruction-empty",children:p.jsx("p",{children:"No instructions provided"})})})]})},H=({attachments:A,onRemove:r})=>{const[n,i]=e.useState(new Map);return e.useEffect(()=>{if(!A)return void i(e=>(e.forEach(e=>URL.revokeObjectURL(e)),new Map));const e=new Map;return A.forEach((t,A)=>{if((t instanceof Blob||"undefined"!=typeof File&&t instanceof File)&&t&&t.type&&"string"==typeof t.type&&t.type.startsWith("image/"))try{const r=URL.createObjectURL(t);e.set(A,r)}catch(e){console.warn("Failed to create object URL for attachment:",e)}else t&&t.url&&t.type&&t.type.startsWith("image/")&&e.set(A,t.url)}),i(t=>(t.forEach((t,A)=>{e.has(A)||URL.revokeObjectURL(t)}),e)),()=>{e.forEach(e=>URL.revokeObjectURL(e))}},[A]),A&&0!==A.length?p.jsx("div",{className:"attachment-thumbnails-container",children:A.map((e,A)=>{const i=e&&e.type&&"string"==typeof e.type&&e.type.startsWith("image/"),s=n.get(A);return p.jsx("div",{className:"attachment-thumbnail",children:i&&s?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:s,alt:e?e.name:"Attachment"}),p.jsx("button",{type:"button",className:"thumbnail-remove-btn",onClick:()=>r(A),title:"Remove attachment",children:p.jsx(t.X,{size:14})})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"file-icon-placeholder",children:p.jsx(t.Paperclip,{size:20})}),p.jsx("span",{className:"file-name",children:e?e.name:"Unknown File"}),p.jsx("button",{type:"button",className:"thumbnail-remove-btn",onClick:()=>r(A),title:"Remove attachment",children:p.jsx(t.X,{size:14})})]})},A)})}):null},O=({component:A,mode:r,formTemplateId:n,formValue:i,formData:s,onNotesChange:a,onAttachmentChange:o,notes:l="",attachments:c=null,onThresholdActionCompletion:u,onThresholdIssueRaised:h,onBasicPropertyActionCompletion:d,workOrderNumber:f,assetNumber:g,isStandalone:m,user:w,onCreateIssue:B,onUpdateIssue:b})=>{const y=void 0!==i?i:s?s[A.id]:void 0,[C,x]=e.useState(l||""),[F,Q]=e.useState(c||null),[U,S]=e.useState(!1),[E,N]=e.useState(!1),[L,_]=e.useState(!1),[I,k]=e.useState(!1),[T,O]=e.useState(null),[P,D]=e.useState(!1),M=e.useRef(null),j=e.useRef(y),R=e.useRef(!1),V=e.useRef(!1);e.useEffect(()=>{l&&l!==C&&!R.current&&(x(l),R.current=!0)},[l,C]),e.useEffect(()=>{c&&c!==F&&!V.current&&(Q(c),V.current=!0)},[c,F]),e.useEffect(()=>{if(R.current&&!U&&null!=l){const e="string"==typeof l?l:String(l||"");C&&""!==String(C||"").trim()||!e||""===e.trim()?e&&""!==e.trim()&&e!==C&&x(e):x(e)}},[l,U,C]),e.useEffect(()=>{V.current&&void 0!==c&&(!F||c&&c.length>0&&c!==F)&&Q(c)},[c,F]),e.useEffect(()=>{const e=["select","radio","checkbox","segment"].includes(A.name||"");if(e){const e=j.current,t=y;let r=!1;if("checkbox"===A.name){const A=Array.isArray(e)?e:e?[e]:[],n=Array.isArray(t)?t:t?[t]:[];r=JSON.stringify(A.sort())!==JSON.stringify(n.sort())}else r=e!==t&&void 0!==e;r&&(_(!1),k(!1),O(null),N(!1),S(!1),D(!1),l&&""!==l.trim()||x(""),c&&0!==c.length||Q(null)),j.current=t}e||(j.current=y)},[y,A.name,l,c]);const K=e.useCallback((e,t)=>{const{operator:A,value:r}=e,n=String(t).toLowerCase(),i=String(r).toLowerCase();switch(A){case"equals":return n===i||String(t)===String(r);case"notEquals":return n!==i&&String(t)!==String(r);case"greaterThan":return Number(t)>Number(r);case"lessThan":return Number(t)<Number(r);case"greaterThanOrEqual":return Number(t)>=Number(r);case"lessThanOrEqual":return Number(t)<=Number(r);default:return!1}},[]),G=e.useCallback(()=>{if(!(null!=y&&""!==y&&!(Array.isArray(y)&&0===y.length)))return[];const e=A.condition;if(!e||!e.conditions||0===e.conditions.length)return[];const t=[];if("checkbox"===A.name&&Array.isArray(y))y.forEach(A=>{const r=e.conditions.find(e=>K(e,A));r&&!t.find(e=>e.id===r.id)&&t.push(r)});else{const A=e.conditions.find(e=>K(e,y));A&&t.push(A)}return t},[A,y,K]),z=e.useCallback(e=>{const t=e.target.value;x(t),a&&a(t);const r=G(),n=t.trim().length>0;r.forEach(e=>{!0===e.enableNotes&&u&&u(e.id,"notes",n)});const i=A.condition;!(i&&i.conditions&&i.conditions.length>0)&&d&&d("notes",n)},[a,G,u,A,d]),q=e.useCallback(()=>{if(a){const e="string"==typeof C?C:String(C||"");a(e),setTimeout(()=>{S(!1)},0)}else S(!1)},[C,a]),W=e.useCallback(()=>{q()},[q]),X=e.useCallback(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),q())},[q]),Y=e.useCallback(()=>{S(!0)},[]),J=e.useCallback(()=>{S(!0)},[]),$=e.useCallback(()=>{M.current?.click()},[]),Z=e.useCallback(e=>{const t=e.target.files;if(t&&t.length>0){const e=Array.from(t);Q(e),o&&o(e);G().forEach(e=>{!0===e.enableAttachment&&u&&u(e.id,"attachments",!0)});const r=A.condition;!(r&&r.conditions&&r.conditions.length>0)&&d&&d("attachments",!0)}M.current&&(M.current.value="")},[o,G,u,A,d]),ee=e.useCallback(e=>{if(F){const t=F.filter((t,A)=>A!==e);if(0===t.length){Q(null),o&&o(null);G().forEach(e=>{!0===e.enableAttachment&&u&&u(e.id,"attachments",!1)});const e=A.condition;!(e&&e.conditions&&e.conditions.length>0)&&d&&d("attachments",!1)}else Q(t),o&&o(t)}},[F,o,G,u,A,d]),te=e.useCallback(()=>{_(!0);G().forEach(e=>{!0===e.enableSendEmail&&u&&u(e.id,"email",!0)});const e=A.condition;!(e&&e.conditions&&e.conditions.length>0)&&d&&d("email",!0),setTimeout(()=>{_(!1)},3e3)},[G,u,A,d]),Ae=e.useCallback(()=>{I||N(!0)},[I]),re=e.useCallback(()=>{N(!1)},[]),ne=e.useCallback(e=>{N(!1),k(!0),e&&O(e);const t=A.condition;if(t&&t.conditions&&t.conditions.length>0){G().forEach(e=>{!0===e.enableRaiseIssue&&h&&h(e.id)})}else d&&d("issue",!0)},[A,d,G,h]);if("test"!==r)return null;const ie=["select","radio","checkbox","segment"].includes(A.name||""),se=A.basic?.options||A.options||[];let ae=!1,oe=!1,le=!1,ce=!1,ue=null;const he=null!=y&&""!==y&&!(Array.isArray(y)&&0===y.length),de=A.condition,fe=de&&de.conditions&&de.conditions.length>0;if(fe&&he)if("checkbox"===A.name&&Array.isArray(y)){const e=y;for(const t of e){const e=de.conditions.find(e=>K(e,t));e&&(ae=ae||!0===e.enableNotes,oe=oe||!0===e.enableAttachment,le=le||!0===e.enableRaiseIssue,ce=ce||!0===e.enableSendEmail)}}else if(ie){const e=de.conditions.find(e=>K(e,y));e&&(ae=!0===e.enableNotes,oe=!0===e.enableAttachment,le=!0===e.enableRaiseIssue,ce=!0===e.enableSendEmail)}else{const e=de.conditions.find(e=>K(e,y));e&&(ae=!0===e.enableNotes,oe=!0===e.enableAttachment,le=!0===e.enableRaiseIssue,ce=!0===e.enableSendEmail)}if(!fe){const e=A.basic,t=!0===e?.enableNotes,r=!0===e?.enableAttachment,n=!0===e?.enableRaiseIssue,i=!0===e?.enableSendEmail;if(ie)if(he)if("checkbox"===A.name){(Array.isArray(y)?y:[y]).forEach(e=>{const t=se.find(t=>!(!t||!t.value)&&(t.value===e||(String(t.value)===String(e)||(t.label===e||String(t.label)===String(e)))));t&&(ae=ae||!0===t.enableNotes,oe=oe||!0===t.enableAttachment,le=le||!0===t.enableRaiseIssue,ce=ce||!0===t.enableSendEmail,ue||(ue=t))}),ae=ae||t,oe=oe||r,le=le||n,ce=ce||i}else if(ue=se.find(e=>!(!e||!e.value)&&(e.value===y||(String(e.value)===String(y)||(e.label===y||String(e.label)===String(y))))),ue){const e=!0===ue.enableNotes,A=!0===ue.enableAttachment,s=!0===ue.enableRaiseIssue,a=!0===ue.enableSendEmail;ae=e||t,oe=A||r,le=s||n,ce=a||i}else ae=t,oe=r,le=n,ce=i;else ae=t,oe=r,le=n,ce=i;else ae=t,oe=r,le=n,ce=i}if(!(ae||oe||le||ce))return null;const pe=G(),ge=A.condition,me=ge&&ge.conditions&&ge.conditions.length>0,we=!!me&&pe.some(e=>!0===e.enableNotes),Be=!!me&&pe.some(e=>!0===e.enableAttachment),be=!!me&&pe.some(e=>!0===e.enableSendEmail),ye=!!me&&pe.some(e=>!0===e.enableRaiseIssue),ve=C.trim().length>0,Ce=F&&F.length>0,xe=F?F.length:0;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"component-action-features",children:[p.jsxs("div",{className:"action-icons-toolbar",children:[ae&&p.jsxs("button",{type:"button",className:`action-icon-button ${ve?"active":""} ${we?"mandatory":""}`,onClick:Y,title:"Add Notes",children:[p.jsx(t.MessageSquare,{size:14,fill:ve?"currentColor":"none"}),we&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),oe&&p.jsxs("button",{type:"button",className:`action-icon-button ${Ce?"active":""} ${Be?"mandatory":""}`,onClick:$,title:"Add Attachment",children:[p.jsx(t.Paperclip,{size:14,fill:Ce?"currentColor":"none"}),xe>0&&p.jsx("span",{className:"attachment-count-badge",children:xe}),Be&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),ce&&p.jsxs("button",{type:"button",className:`action-icon-button ${L?"active sent":""} ${be?"mandatory":""}`,onClick:te,disabled:L,title:"Send Email",children:[L?p.jsx(p.Fragment,{children:p.jsx(t.Check,{size:14})}):p.jsx(t.Mail,{size:14,fill:L?"currentColor":"none"}),be&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),le&&p.jsxs("button",{type:"button",className:`action-icon-button ${I?"active":""} ${ye?"mandatory":""}`,onClick:Ae,title:"Raise an Issue",children:[p.jsx(t.AlertCircle,{size:14,fill:I?"currentColor":"none"}),ye&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),(ve&&ae||Ce&&oe)&&p.jsx("button",{type:"button",className:"action-icon-button accordion-toggle",onClick:()=>D(!P),title:P?"Collapse":"Expand",children:P?p.jsx(t.ChevronUp,{size:14}):p.jsx(t.ChevronDown,{size:14})})]}),U&&ae&&p.jsxs("div",{className:"notes-input-overlay",children:[p.jsx("textarea",{className:"action-notes-textarea",value:C,onChange:z,onBlur:W,onKeyDown:X,placeholder:"Explain which protocols were not followed (Press Ctrl+Enter to save)",rows:4,autoFocus:!0}),p.jsxs("div",{className:"notes-input-actions",children:[p.jsx("button",{type:"button",className:"notes-save-button",onClick:q,title:"Save notes (Ctrl+Enter)",children:"Save"}),p.jsx("button",{type:"button",className:"notes-cancel-button",onClick:()=>{S(!1)},title:"Cancel",children:"Cancel"})]})]}),P&&p.jsxs("div",{className:"actions-content",children:[!U&&ve&&ae&&p.jsx("div",{className:"notes-summary-section",children:p.jsxs("div",{className:"notes-full-text",onClick:J,children:[p.jsx("span",{className:"notes-label",children:"Notes:"})," ",C]})}),Ce&&oe&&p.jsx("div",{className:"attachments-section",children:p.jsx(H,{attachments:F,onRemove:ee})})]}),oe&&p.jsx("input",{ref:M,type:"file",multiple:!0,accept:"image/*,.pdf",onChange:Z,style:{display:"none"}})]}),E&&p.jsx(v,{isOpen:E,onClose:re,onSuccess:ne,issue:T,component:(()=>{const e=null!=y?Array.isArray(y)?y.join(", "):String(y):A.basic?.value||"",t={...A,basic:{...A.basic||{},value:e}};return ue&&(t.basic.label=`${A.basic?.label||"Component"} - ${ue.label||ue.value}`,t.basic.value=ue.value||e),t})(),formTemplateId:n||"",notes:C,attachments:F,isStandalone:m,workOrderNumber:f,assetNumber:g,user:w,onCreateIssue:B,onUpdateIssue:b})]})},P=({attachments:e})=>e&&0!==e.length?p.jsx("div",{className:"attachment-thumbnails-container",children:e.map((e,A)=>{const r=e.type?.startsWith("image/")||!1,n=r?(e=>e.data?e.data.startsWith("data:")?e.data:`data:${e.type||"image/png"};base64,${e.data}`:"")(e):"";return p.jsx("div",{className:"attachment-thumbnail",children:r&&n?p.jsx("img",{src:n,alt:e.name||`Attachment ${A+1}`}):p.jsxs("div",{className:"file-icon-placeholder",children:[p.jsx(t.Paperclip,{size:20}),p.jsx("span",{className:"file-name",children:e.name||`File ${A+1}`})]})},A)})}):null,D=({component:e})=>{const t=e.basic?.notes||"",A=e.basic?.attachments||[],r=t&&t.trim().length>0,n=A&&A.length>0;return r||n?p.jsx("div",{className:"component-submission-actions",children:p.jsxs("div",{className:"actions-content",children:[r&&p.jsx("div",{className:"notes-summary-section",children:p.jsxs("div",{className:"notes-full-text",children:[p.jsx("span",{className:"notes-label",children:"Notes:"})," ",t]})}),n&&p.jsx("div",{className:"attachments-section",children:p.jsx(P,{attachments:A})})]})}):null},M=({component:e,selectedComponent:A,mode:r,onComponentSelect:s,onComponentDelete:a,onComponentEdit:o,renderFormComponent:l,isOverlay:c=!1,formData:u={},formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,shouldShowComponent:w})=>{const B=u[e.id],b=!w||w(e.id),y="preview"===r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0),{attributes:v,listeners:C,setNodeRef:x,transform:F,transition:Q,isDragging:U,isSorting:S}=n.useSortable({id:e.id,disabled:c}),E={transform:i.CSS.Transform.toString(F),transition:Q,opacity:U?.3:1,zIndex:U?1e3:"auto"};return p.jsxs("div",{ref:x,style:{...E,border:A?.id===e.id?"2px solid #3b82f6":"1px solid var(--df-color-fb-border)",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)",padding:"12px",position:"relative",minHeight:"80px",transition:"all 0.2s ease",boxShadow:A?.id===e.id?"0 4px 12px rgba(59, 130, 246, 0.15)":"0 1px 3px rgba(0, 0, 0, 0.1)",cursor:"pointer"},className:`form-component grid-component ${A?.id===e.id?"selected":""} ${U?"dragging":""} ${S?"sorting":""} ${b||"edit"===r?"":"conditionally-hidden"}`,onClick:()=>!U&&s(e),role:"button",tabIndex:0,children:["edit"===r&&p.jsx("div",{className:"component-drag-handle",...C,...v,onClick:e=>e.stopPropagation(),style:{position:"absolute",top:"50%",left:"4px",transform:"translateY(-50%)",padding:"4px",backgroundColor:"#f3f4f6",borderRadius:"4px",cursor:"grab",opacity:1,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(t.GripVertical,{size:12,color:"var(--df-color-text-light)"})}),p.jsxs("div",{className:"component-content",style:{paddingTop:"edit"===r?"24px":"0",paddingLeft:"edit"===r?"28px":"0",minHeight:"60px"},children:[l(e),"test"===r&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:h,formValue:B,formData:u,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g?t=>g(e.id,t):void 0,onAttachmentChange:m?t=>m(e.id,t):void 0}),y&&p.jsx(D,{component:e})]}),"edit"===r&&p.jsxs("div",{className:"component-actions",style:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"4px",opacity:1,zIndex:10},children:[o&&p.jsx("button",{className:"component-edit-btn",onClick:t=>{t.stopPropagation(),o(e)},type:"button",title:"Edit Component",style:{padding:"4px",backgroundColor:"#3b82f6",color:"#ffffff",border:"none",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#2563eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#3b82f6"},children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"component-delete-btn",onClick:t=>{t.stopPropagation(),a(e,t)},type:"button",title:"Delete Component",style:{padding:"4px",backgroundColor:"#ef4444",color:"#ffffff",border:"none",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#dc2626"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ef4444"},children:p.jsx(t.Trash2,{size:12})})]})]})},j=({gridComponents:e,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:s,onComponentUpdate:a,selectedComponent:o,renderFormComponent:l,gridId:c,formData:u,formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,columnView:w,shouldShowComponent:B})=>{const{setNodeRef:b,isOver:y}=r.useDroppable({id:`grid-drop-zone-${c}`,disabled:"edit"!==t,data:{isGridDropZone:!0,gridId:c}}),v=r.useSensors(r.useSensor(r.PointerSensor,{activationConstraint:{distance:8}}),r.useSensor(r.KeyboardSensor,{coordinateGetter:n.sortableKeyboardCoordinates}));return p.jsx("div",{ref:b,className:"grid-drop-zone "+(0===e.length?"empty":""),style:{border:y?"2px dashed #3b82f6":"1px dashed #d1d5db",borderRadius:"8px",padding:"16px",backgroundColor:y?"var(--df-color-primary-light)":"#f9fafb",minHeight:"100px",transition:"all 0.2s ease"},children:0===e.length?p.jsxs("div",{style:{textAlign:"center",color:"var(--df-color-text-light)",fontSize:"14px",padding:"40px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",backgroundColor:"var(--df-color-fb-container)",border:"1px dashed var(--df-color-fb-border)",borderRadius:"8px"},children:[p.jsx("div",{style:{fontWeight:"500",color:y?"var(--df-color-primary)":"var(--df-color-text-dark)"},children:y?"Drop components here":"Empty DataGrid"}),p.jsx("div",{style:{fontSize:"12px",color:"#9ca3af"},children:"Drag and drop components here to create your grid"})]}):p.jsxs(r.DndContext,{sensors:v,onDragEnd:t=>{const{active:A,over:r}=t;r&&A.id!==r.id&&(e.findIndex(e=>e.id===A.id),e.findIndex(e=>e.id===r.id))},children:[p.jsx(n.SortableContext,{items:e.map(e=>e.id),strategy:w?n.verticalListSortingStrategy:n.horizontalListSortingStrategy,children:p.jsx("div",{style:{display:"flex",flexDirection:w?"column":"row",flexWrap:"nowrap",gap:"12px",alignItems:w?"stretch":"start",marginBottom:e.length>0?"12px":"0",overflowX:w?"visible":"auto",width:"100%"},children:e.map(e=>p.jsx("div",{style:{flex:"1 1 0",minWidth:w?"100%":"200px",maxWidth:"100%"},children:p.jsx(M,{component:e,selectedComponent:o,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:s,onComponentUpdate:a,renderFormComponent:l,formData:u,formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,shouldShowComponent:B})},e.id))})}),p.jsx("div",{style:{border:y?"2px dashed #3b82f6":"1px dashed var(--df-color-fb-border)",borderRadius:"6px",padding:"12px",backgroundColor:y?"var(--df-color-primary-light)":"var(--df-color-fb-container)",textAlign:"center",color:"var(--df-color-text-light)",fontSize:"12px",transition:"all 0.2s ease",minHeight:"40px",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"12px"},children:y?p.jsx("span",{style:{color:"#3b82f6",fontWeight:"500"},children:"Drop component here to add to grid"}):p.jsx("span",{children:"+ Drop more components here"})})]})})},R=({templateComponents:t,dataEntries:A,renderFormComponent:r,mode:n,allowAddRemoveEntries:i,addAnotherText:s,removeText:a,maxEntries:o,minEntries:l,displayAsGrid:c=!0,onAddEntry:u,onRemoveEntry:h,formData:d,formTemplateId:f,onThresholdActionCompletion:g,onThresholdIssueRaised:m,onNotesChange:w,onAttachmentChange:B,columnView:b,shouldShowComponent:y})=>{const v=d||{},C=e.useMemo(()=>y?t.filter(e=>y(e.id)):t,[t,y]);return 0===C.length?p.jsx("div",{style:{textAlign:"center",padding:"40px",color:"var(--df-color-text-light)",border:"1px dashed #d1d5db",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)"},children:0===t.length?`No components defined. Add components to see the ${c?"table":"list"} view.`:"All components are hidden."}):c?p.jsxs("div",{className:"datagrid-table-view",style:{border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",overflow:"hidden",backgroundColor:"var(--df-color-fb-container)",maxWidth:"100%"},children:[p.jsx("div",{style:{position:"absolute",top:"8px",right:"8px",zIndex:10,fontSize:"12px",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--df-color-fb-border)",opacity:C.length>4&&!b?1:0,transition:"opacity 0.2s ease"},children:"← Scroll →"}),p.jsxs("div",{className:"table-scroll-container",style:{overflowX:b?"visible":"auto",overflowY:"hidden",maxWidth:"100%",scrollbarWidth:"thin",scrollbarColor:"var(--df-color-fb-border) var(--df-color-fb-icon-bg)",position:"relative"},children:[!b&&p.jsx("div",{className:"table-headers",style:{display:"grid",gridTemplateColumns:`repeat(${C.length}, minmax(150px, 1fr))`,backgroundColor:"var(--df-color-fb-container)",borderBottom:"2px solid var(--df-color-fb-border)",minWidth:150*C.length+"px"},children:C.map((e,t)=>p.jsx("div",{style:{padding:"12px 16px",fontWeight:"600",color:"var(--df-color-text-dark)",borderRight:t<C.length-1?"1px solid var(--df-color-fb-border)":"none",fontSize:"14px",minWidth:"150px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.basic?.label||`Column ${t+1}`},`header-${e.id}`))}),A.length>0?A.map((e,t)=>p.jsxs("div",{className:"table-row",style:{display:b?"flex":"grid",flexDirection:b?"column":"row",gridTemplateColumns:b?void 0:`repeat(${C.length}, minmax(150px, 1fr))`,borderBottom:t<A.length-1?"1px solid var(--df-color-fb-border)":"none",backgroundColor:t%2==0?"var(--df-color-fb-container)":"var(--df-color-fb-bg)",position:"relative",minWidth:b?"100%":150*C.length+"px",padding:b?"16px":"0"},children:[C.map((t,A)=>{let n=e.components?.[A];if(n)n={...n,id:n.id,basic:{...n.basic,showLabel:b}};else{const r=`${t.id}-${e.id}-${A}`;n={...t,id:r,basic:{...t.basic,showLabel:b}}}return p.jsx("div",{style:{padding:b?"12px 0":"12px 16px",borderRight:!b&&A<C.length-1?"1px solid var(--df-color-fb-border)":"none",borderBottom:b&&A<C.length-1?"1px dashed var(--df-color-fb-border)":"none",minHeight:b?"auto":"60px",minWidth:b?"100%":"150px",width:b?"100%":"auto",display:"flex",flexDirection:b?"column":"row",alignItems:b?"stretch":"center",overflow:"hidden",gap:b?"8px":"0"},children:p.jsx("div",{style:{width:"100%",minWidth:b?"100%":"120px",overflow:"hidden"},children:r(n,!b)})},`${e.id}-${A}`)}),"test"===n&&i&&A.length>l&&p.jsx("button",{onClick:()=>h(t),disabled:A.length<=l,style:{position:"absolute",top:"8px",right:"8px",padding:"4px 8px",backgroundColor:A.length<=l?"#f3f4f6":"#ef4444",color:A.length<=l?"#9ca3af":"#ffffff",border:"none",borderRadius:"4px",fontSize:"12px",fontWeight:"500",cursor:A.length<=l?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"4px",zIndex:10,minWidth:"24px",height:"24px",justifyContent:"center"},title:a,children:p.jsx("span",{style:{fontSize:"14px"},children:"×"})})]},e.id)):p.jsxs("div",{style:{padding:"40px",textAlign:"center",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",borderTop:"1px solid var(--df-color-fb-border)"},children:["No data entries. ","test"===n&&i?'Click "Add Another" to add entries.':"Use the properties panel to add entries."]})]}),"test"===n&&i&&p.jsx("div",{style:{padding:"16px",backgroundColor:"var(--df-color-fb-bg)",borderTop:"1px solid var(--df-color-fb-border)",display:"flex",justifyContent:"center",position:"sticky",bottom:0,zIndex:5},children:p.jsxs("button",{onClick:u,disabled:A.length>=o,style:{padding:"8px 16px",backgroundColor:A.length>=o?"#f3f4f6":"#10b981",color:A.length>=o?"#9ca3af":"#ffffff",border:"none",borderRadius:"6px",fontSize:"14px",fontWeight:"500",cursor:A.length>=o?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[p.jsx("span",{style:{fontSize:"16px"},children:"+"}),s]})})]}):p.jsxs("div",{className:"datagrid-list-view",style:{display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"var(--df-color-fb-container)"},children:[A.length>0?A.map((e,t)=>p.jsxs("div",{className:"list-entry",style:{border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",padding:"16px",backgroundColor:"var(--df-color-fb-container)",position:"relative",transition:"all 0.2s ease"},children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid var(--df-color-fb-border)"},children:[p.jsxs("span",{style:{fontWeight:"600",color:"var(--df-color-text-dark)",fontSize:"14px"},children:["Entry #",t+1]}),"test"===n&&i&&A.length>1&&p.jsx("button",{onClick:()=>h(t),disabled:A.length<=l,style:{padding:"4px 8px",backgroundColor:A.length<=l?"#f3f4f6":"#ef4444",color:A.length<=l?"#9ca3af":"#ffffff",border:"none",borderRadius:"4px",fontSize:"12px",fontWeight:"500",cursor:A.length<=l?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"4px",minWidth:"24px",height:"24px",justifyContent:"center"},title:a,children:p.jsx("span",{style:{fontSize:"14px"},children:"×"})})]}),p.jsx("div",{style:{display:b?"flex":"grid",flexDirection:b?"column":"row",gridTemplateColumns:b?void 0:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px"},children:C.map((t,A)=>{let i=e.components?.[A];if(i||(i=e.components?.find(e=>e.name===t.name&&e.basic?.label===t.basic?.label)),i)i={...i,id:i.id,basic:{...i.basic,showLabel:b}};else{const r=`${t.id}-${e.id}-${A}`;i={...t,id:r,basic:{...t.basic,showLabel:b}}}return i?p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[p.jsx("label",{style:{fontSize:"12px",fontWeight:"500",color:"var(--df-color-text-light)",textTransform:"uppercase",letterSpacing:"0.05em"},children:t.basic?.label||`Field ${A+1}`}),p.jsxs("div",{style:{minHeight:"40px",display:"flex",alignItems:"center",flexDirection:"column",width:"100%"},children:[r(i),"test"===n&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(i.name)&&p.jsx(O,{component:i,mode:"test",formTemplateId:f,formValue:v[i.id],onThresholdActionCompletion:g,onThresholdIssueRaised:m,onNotesChange:w?e=>w(i.id,e):void 0,onAttachmentChange:B?e=>B(i.id,e):void 0}),"preview"===n&&(i.basic?.notes&&i.basic.notes.trim().length>0||i.basic?.attachments&&Array.isArray(i.basic.attachments)&&i.basic.attachments.length>0?p.jsx(D,{component:i}):null)]})]},`${e.id}-${A}`):null})})]},e.id)):p.jsxs("div",{style:{padding:"40px",textAlign:"center",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",border:"1px dashed #d1d5db",borderRadius:"8px"},children:["No data entries. ","test"===n&&i?'Click "Add Another" to add entries.':"Use the properties panel to add entries."]}),"test"===n&&i&&p.jsx("div",{style:{padding:"16px",backgroundColor:"#f8f9fa",border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",display:"flex",justifyContent:"center"},children:p.jsxs("button",{onClick:u,disabled:A.length>=o,style:{padding:"8px 16px",backgroundColor:A.length>=o?"#f3f4f6":"#10b981",color:A.length>=o?"#9ca3af":"#ffffff",border:"none",borderRadius:"6px",fontSize:"14px",fontWeight:"500",cursor:A.length>=o?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"all 0.2s ease"},onMouseEnter:e=>{A.length<o&&(e.currentTarget.style.backgroundColor="#059669")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#10b981"},children:[p.jsx("span",{children:"+"}),s]})})]})},V=({id:A,properties:r,mode:n="edit",formData:i={},onValueChange:s,onSelect:a,isSelected:o=!1,className:l="",onDataGridSelect:c,onComponentSelect:u,onComponentDelete:h,onComponentEdit:d,onComponentUpdate:f,selectedComponent:g,renderFormComponent:m,onEntryAdd:w,onEntryRemove:B,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,shouldShowComponent:_})=>{const[I,H]=e.useState(!1),O=e.useRef(!1);let P=(r.templateComponents||[]).map(e=>({...e,basic:{...e.basic,value:""}}));const D=r.entries||[];0===P.length&&D.length>0&&D[0].components&&(P=D[0].components.map(e=>({...e,id:e.id?.replace(/-entry-\d+$/,"")||e.id,basic:{...e.basic,value:"",defaultValue:"",showLabel:!0}}))),e.useEffect(()=>{if("edit"===n&&!r.templateComponents&&s&&O.current){const e={...r,templateComponents:[]};JSON.stringify(e)!==JSON.stringify(r)&&s({id:A,value:e})}O.current=!0},[r.templateComponents,A,s,r,n]),e.useEffect(()=>{if(P.length>0){if("edit"!==n||!O.current)return;if(0===D.length){const e=`entry-${`${Date.now()}-${Math.random().toString(36).substr(2,5)}`}`,t={id:e,index:0,components:P.map((t,A)=>({...t,id:`${t.id}-${e}-${A}`,basic:{...t.basic,showLabel:!1}})),styles:{}};if(s){const e={...r,entries:[t]};JSON.stringify(e)!==JSON.stringify(r)&&s({id:A,value:e})}}else{if(D.some(e=>P.some((t,A)=>{const r=e.components?.[A];if(!r)return!0;return JSON.stringify(r.basic?.options)!==JSON.stringify(t.basic?.options)||r.basic?.placeholder!==t.basic?.placeholder||r.basic?.defaultValue!==t.basic?.defaultValue||r.basic?.label!==t.basic?.label||r.validation?.required!==t.validation?.required}))&&s){const e=D.map(e=>{const t=P.map((t,A)=>{let r=e.components?.[A];if(r||(r=e.components?.find(e=>e.name===t.name&&e.basic?.label===t.basic?.label)),r){return{...t,id:r.id,basic:{...t.basic,showLabel:!1,value:r.basic?.value||t.basic?.defaultValue||""}}}{const e=`${Date.now()}-${Math.random().toString(36).substr(2,5)}`,r=`${t.id}-${e}-${A}`;return{...t,id:r,basic:{...t.basic,showLabel:!1}}}});return{...e,components:t}}),t={...r,entries:e};JSON.stringify(t)!==JSON.stringify(r)&&s({id:A,value:t})}}}},[P,D,A,s,r,n,r.templateComponents]);const M=e.useCallback(e=>{e.stopPropagation(),a?.(),c?.(r)},[a,c,r]),V=e.useCallback((e,t)=>{t.stopPropagation(),h&&h(e,t);const n=P.filter(t=>t.id!==e.id),i=D.map(t=>({...t,components:t.components?.filter(t=>!(t.name===e.name&&t.basic?.label===e.basic?.label))||[]}));s&&s({id:A,value:{...r,templateComponents:n,entries:i}})},[h,r,s,A,P,D]),K=e.useCallback((e,t)=>{f&&f(e,t);const n=P.map(A=>A.id===e?{...A,...t}:A);s&&s({id:A,value:{...r,templateComponents:n}})},[f,r,s,A,P]),G=e.useCallback(e=>{"test"===n&&s&&s({id:e.id,value:e.value})},[n,s]),z=e.useCallback(()=>{const e=`entry-${`${Date.now()}-${Math.random().toString(36).substr(2,5)}`}`,t={id:e,index:r.entries.length,components:P.map((t,A)=>{const r=`${t.id}-${e}-${A}`;return{...t,id:r,basic:{...t.basic,value:"",showLabel:!1}}}),styles:{}},n=[...r.entries,t];s&&s({id:A,value:{...r,entries:n}}),w?.()},[r,s,A,w,P]),q=e.useCallback(e=>{const t=r.entries.filter((t,A)=>A!==e).map((e,t)=>({...e,index:t}));s&&s({id:A,value:{...r,entries:t}})},[r,s,A,B]),W=e.useCallback((e,t=!1)=>{const A="test"===n?i[e.id]||"defaultValue"in e.basic&&e.basic.defaultValue||"":"defaultValue"in e.basic&&e.basic.defaultValue||"",r={id:e.id,properties:e,validationErrors:{},formValue:A,touchedFields:{},formSubmitted:!1,mode:n,hideLabel:t,onValueChange:G,onBlur:()=>{},onFocus:()=>{}};switch(e.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...r,properties:e,inputType:"text-input"===e.name?"text":"number-input"===e.name?"number":"email",readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"textarea":return p.jsx(F,{...r,properties:e,readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"select":const A={...e,options:e.basic?.options||[]};return p.jsx(Q,{...r,properties:A,disabled:"edit"===n||"preview"===n,hideLabel:t});case"checkbox":const i={...e,options:e.basic?.options||[]};return p.jsx(U,{...r,properties:i,formValue:[],disabled:"edit"===n||"preview"===n,hideLabel:t});case"radio":const s={...e,options:e.basic?.options||[]};return p.jsx(S,{...r,properties:s,readonly:"edit"===n||"preview"===n,disabled:"edit"===n||"preview"===n,hideLabel:t});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...r,properties:e,readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"signature":return p.jsx(L,{...r,properties:e,hideLabel:t});case"heading":return p.jsx(k,{...r,properties:e,hideLabel:t});case"instructions":return p.jsx(T,{...r,properties:e,hideLabel:t});default:return p.jsxs("div",{className:"unknown-component",children:["Unknown component: ",e.name]})}},[n,G]),X={backgroundColor:r.styles.backgroundColor||"var(--df-color-fb-container)",borderColor:r.styles.borderColor||"var(--df-color-fb-border)",borderWidth:r.styles.borderWidth||"2px",borderRadius:r.styles.borderRadius||"8px",padding:r.styles.padding||"16px",margin:r.styles.margin||"16px 0"};return p.jsxs("div",{className:`form-group df-form-datagrid ${o?"selected":""} ${l}`,onClick:M,style:X,children:[p.jsx("div",{className:"grid-header",style:{backgroundColor:r.styles?.headerBackgroundColor,color:r.styles?.headerTextColor},children:p.jsx("div",{className:"grid-title",onClick:e=>{e.stopPropagation(),H(!I),s?.({id:A,value:{...r,basic:{...r.basic,collapsed:!I}}})},children:p.jsxs("div",{className:"title-content",style:{display:"flex",alignItems:"center",gap:"8px"},children:[I?p.jsx(t.ChevronRight,{size:16}):p.jsx(t.ChevronDown,{size:16}),p.jsx(t.Grid,{size:16}),p.jsx("span",{className:"grid-label",style:{fontWeight:"600",color:r.styles?.headerTextColor},children:r.basic.label}),r.validation.required&&p.jsx("span",{className:"required-indicator",style:{color:"#ef4444"},children:"*"})]})})}),r.basic.description&&r.basic.description.trim().length>0&&!I&&p.jsx("div",{className:"grid-description",style:{marginTop:"8px",color:"var(--df-color-text-light)",fontSize:"14px"},children:r.basic.description}),!I&&p.jsx("div",{className:"grid-content",style:{marginTop:"16px"},children:"edit"===n?p.jsx(j,{gridComponents:P,mode:n,onComponentSelect:u||(()=>{}),onComponentDelete:V,onComponentEdit:d,onComponentUpdate:K,selectedComponent:g||null,renderFormComponent:m||W,gridId:A,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,columnView:r.datagrid?.columnView,shouldShowComponent:_}):p.jsx(R,{templateComponents:P,dataEntries:D,renderFormComponent:m||W,mode:n,allowAddRemoveEntries:r.datagrid?.allowAddRemoveEntries??!0,addAnotherText:r.datagrid?.addAnotherText??"Add Entry",removeText:r.datagrid?.removeText??"Remove",maxEntries:r.datagrid?.maxEntries??10,minEntries:r.datagrid?.minEntries??1,displayAsGrid:r.datagrid?.displayAsGrid??!0,onAddEntry:w||z,onRemoveEntry:B||q,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,columnView:r.datagrid?.columnView,shouldShowComponent:_})})]})},K=({child:e,selectedChild:A,mode:r,onChildSelect:s,onChildDelete:a,renderFormComponent:o,isOverlay:l=!1,isChildrenEditMode:c=!1,formData:u={},formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v})=>{const C=u[e.id],x="preview"===r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0),{attributes:F,listeners:Q,setNodeRef:U,transform:S,transition:E,isDragging:N,isSorting:L}=n.useSortable({id:e.id,disabled:l||"edit"!==r}),_={transform:i.CSS.Transform.toString(S),transition:E,zIndex:N?1e3:"auto"};return p.jsxs("div",{ref:U,style:_,className:`form-component section-child ${A?.id===e.id?"selected":""} ${N?"dragging":""} ${L?"sorting":""} ${c?"children-edit-active":""}`,onClick:()=>!N&&s(e),role:"button",tabIndex:0,children:[("edit"===r||c)&&p.jsx("div",{className:"child-drag-handle",...Q,...F,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:p.jsx(t.GripVertical,{size:14})}),p.jsxs("div",{className:"form-component-content section-child-content",children:[("edit"===r||c)&&p.jsxs("div",{className:"component-actions child-actions",children:[p.jsx("button",{className:"btn edit-btn",onClick:t=>{t.stopPropagation(),s(e)},onMouseDown:e=>e.stopPropagation(),title:"Edit properties",children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"btn delete-btn",onClick:t=>a(e,t),onMouseDown:e=>e.stopPropagation(),title:"Delete component",children:p.jsx(t.Trash2,{size:12})})]}),p.jsxs("div",{className:"component-preview child-preview",children:[o(e),!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:h,formValue:C,formData:u,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g?t=>g(e.id,t):void 0,onAttachmentChange:m?t=>m(e.id,t):void 0,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v}),x&&p.jsx(D,{component:e})]})]})]})},G=({id:A,properties:i,mode:s="edit",formData:a={},onValueChange:o,onSelect:l,isSelected:c=!1,className:u="",onSectionSelect:h,onChildSelect:d,onChildDelete:f,selectedChild:g,renderFormComponent:m,formTemplateId:w,onThresholdActionCompletion:B,onThresholdIssueRaised:b,onNotesChange:y,onAttachmentChange:v,workOrderNumber:C,assetNumber:_,user:H,onCreateIssue:O,onUpdateIssue:P})=>{const[D,M]=e.useState(i.basic.collapsed),[j,R]=e.useState(!1),[G,z]=e.useState(!1),[q,W]=e.useState(i.basic.label),[X,Y]=e.useState(i.basic.description),[J,$]=e.useState(i.children||[]),[Z,ee]=e.useState(!1);e.useEffect(()=>{$(i.children||[])},[i.children]),e.useEffect(()=>{W(i.basic.label),Y(i.basic.description)},[i.basic.label,i.basic.description]);const{setNodeRef:te,isOver:Ae}=r.useDroppable({id:`section-${A}`,disabled:"edit"!==s}),re=!("preview"!==s&&"test"!==s||i.children&&i.children.length>0),ne=e.useCallback(e=>{W(e),o?.({id:A,value:{...i,basic:{...i.basic,label:e}}})},[A,i,o]),ie=e.useCallback(e=>{Y(e),o?.({id:A,value:{...i,basic:{...i.basic,description:e}}})},[A,i,o]),se=e.useCallback(e=>{d?.(e)},[d]),ae=e.useCallback((e,t)=>{t.stopPropagation();const A=J.filter(t=>t.id!==e.id);$(A),f?.(e.id)},[f,J,A]),oe=e.useCallback(()=>{h?.(i),l?.()},[h,l,i]),le=e.useCallback(e=>{e.stopPropagation(),"edit"===s&&J.length>0&&ee(!Z)},[s,J.length,Z]),ce=e.useCallback(e=>{e.stopPropagation(),M(!D),o?.({id:A,value:{...i,basic:{...i.basic,collapsed:!D}}})},[D,A,i,o]),ue=m||e.useCallback(e=>{const t=a[e.id]||"defaultValue"in e.basic&&e.basic.defaultValue||"";let A=t;"number-input"===e.name&&"number"==typeof t?A=String(t):"number-input"===e.name&&null==t&&(A="");const r={id:e.id,properties:e,validationErrors:{},formValue:A,touchedFields:{},formSubmitted:!1,mode:s,onValueChange:o,onBlur:()=>{},onFocus:()=>{}};switch(e.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...r,properties:e,inputType:"text-input"===e.name?"text":"number-input"===e.name?"number":"email",readonly:!1,disabled:!1});case"textarea":return p.jsx(F,{...r,properties:e,readonly:!1,disabled:!1});case"select":const t={...e,options:e.basic?.options||[]};return p.jsx(Q,{...r,properties:t,disabled:!1});case"checkbox":const A={...e,options:e.basic?.options||[]};return p.jsx(U,{...r,properties:A,formValue:[],disabled:!1});case"radio":const n={...e,options:e.basic?.options||[]};return p.jsx(S,{...r,properties:n,readonly:!1,disabled:!1});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...r,properties:e,readonly:!1,disabled:!1});case"signature":return p.jsx(L,{...r,properties:e});case"heading":return p.jsx(k,{...r,properties:e});case"instructions":return p.jsx(T,{...r,properties:e});case"location":return p.jsx(I,{...r,properties:e});case"datagrid":return p.jsx(V,{...r,properties:e,formData:a,mode:s,onNotesChange:()=>{},onAttachmentChange:()=>{}});case"segment":const i={...e,options:e.basic?.options||[]};return p.jsx(E,{...r,properties:i});default:return p.jsx("div",{className:"form-group",children:p.jsxs("div",{className:"form-group-label",children:["Unsupported Component: ",e.name]})})}},[s,o,a]);if(re)return null;const he={backgroundColor:i.styles?.backgroundColor||"var(--df-color-fb-container)",borderColor:i.styles?.borderColor||"var(--df-color-fb-border)",borderWidth:i.styles?.borderWidth||"2px",borderRadius:i.styles?.borderRadius||"8px",padding:i.styles?.padding||"16px",margin:i.styles?.margin||"16px 0"};return p.jsxs("div",{ref:te,className:`df-form-section ${c?"selected":""} ${Ae?"drag-over":""} ${u}`,style:he,children:[p.jsxs("div",{className:"section-header "+(Z?"children-edit-mode":""),onClick:oe,onDoubleClick:le,children:[p.jsx("div",{className:"section-header-content",children:p.jsxs("div",{className:"section-title",children:[p.jsx("span",{className:"section-toggle",title:D?"Expand section":"Collapse section",role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),ce(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ce(e))},style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:D?p.jsx(t.ChevronRight,{size:18}):p.jsx(t.ChevronDown,{size:18})}),"edit"===s&&j?p.jsx("input",{type:"text",value:q,onChange:e=>W(e.target.value),onBlur:()=>{R(!1),ne(q)},onKeyDown:e=>{"Enter"===e.key&&(R(!1),ne(q))},className:"section-title-input",autoFocus:!0}):p.jsx("h3",{className:"section-title-text",onDoubleClick:()=>"edit"===s&&R(!0),style:{display:"inline",margin:0},children:q||"Untitled Section"})]})}),(X||"edit"===s)&&p.jsx("div",{className:"section-description",children:"edit"===s&&G?p.jsx("textarea",{value:X,onChange:e=>Y(e.target.value),onBlur:()=>{z(!1),ie(X)},onKeyDown:e=>{"Enter"===e.key&&e.ctrlKey&&(z(!1),ie(X))},className:"section-description-input",placeholder:"Section description (optional)",autoFocus:!0}):p.jsx("p",{className:"section-description-text",onDoubleClick:()=>"edit"===s&&z(!0),children:X||"Section description"})})]}),!D&&p.jsx("div",{className:`section-content ${Ae?"drag-over":""} ${0===J.length?"empty":"has-children"}`,onClick:e=>{e.target===e.currentTarget&&oe()},children:p.jsx(n.SortableContext,{items:J.map(e=>e.id),strategy:n.verticalListSortingStrategy,children:0===J.length?p.jsxs("div",{className:"section-empty-state",onClick:oe,style:{textAlign:"center",color:"#6b7280",fontSize:"14px",padding:"40px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",border:"2px dotted #d1d5db",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)",transition:"all 0.3s ease",margin:"16px 0"},children:[p.jsx("div",{style:{fontWeight:"500",color:Ae?"#3b82f6":"#374151"},children:Ae?"Drop components here":"Empty Section"}),p.jsx("div",{style:{fontSize:"12px",color:"#9ca3af"},children:"Drag and drop components here to create your section"})]}):J.map(e=>p.jsx(K,{child:e,selectedChild:g||null,mode:s,onChildSelect:se,onChildDelete:ae,renderFormComponent:ue,isChildrenEditMode:Z,formData:a,formTemplateId:w,onNotesChange:y,onAttachmentChange:v,onThresholdActionCompletion:B,onThresholdIssueRaised:b,workOrderNumber:C,assetNumber:_,user:H,onCreateIssue:O,onUpdateIssue:P},e.id))})})]})},z=e.lazy(()=>Promise.resolve().then(function(){return $})),q=e=>e.id?e:{...e,id:s.v4()},W=({component:e,mode:t,renderFormComponent:A,formData:r={},formTemplateId:n,onThresholdActionCompletion:i,onThresholdIssueRaised:s,onNotesChange:a,onAttachmentChange:o,workOrderNumber:l,assetNumber:c,user:u,onCreateIssue:h,onUpdateIssue:d})=>{const f=r[e.id],g="preview"===t&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0);return p.jsxs("div",{className:"simple-table-component",children:[A(e),!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:n,formValue:f,formData:r,onThresholdActionCompletion:i,onThresholdIssueRaised:s,onNotesChange:a?t=>a(e.id,t):void 0,onAttachmentChange:o?t=>o(e.id,t):void 0,workOrderNumber:l,assetNumber:c,user:u,onCreateIssue:h,onUpdateIssue:d}),g&&p.jsx(D,{component:e})]})},X=({component:e,selectedComponent:A,mode:r,onComponentSelect:s,onComponentDelete:a,onComponentEdit:o,renderFormComponent:l,isOverlay:c=!1})=>{const{attributes:u,listeners:h,setNodeRef:d,transform:f,transition:g,isDragging:m,isSorting:w}=n.useSortable({id:e.id,disabled:c}),B={transform:i.CSS.Transform.toString(f),transition:g,opacity:m?.3:1,zIndex:m?1e3:"auto"};return p.jsxs("div",{ref:d,style:B,className:`form-component table-component ${A?.id===e.id?"selected":""} ${m?"dragging":""} ${w?"sorting":""}`,onClick:()=>!m&&s(e),role:"button",tabIndex:0,children:["edit"===r&&p.jsx("div",{className:"component-drag-handle",...h,...u,onClick:e=>e.stopPropagation(),style:{opacity:1},children:p.jsx(t.GripVertical,{size:14})}),p.jsx("div",{className:"component-content",children:l(e)}),"edit"===r&&p.jsxs("div",{className:"component-actions",style:{opacity:1},children:[o&&p.jsx("button",{className:"component-edit-btn",onClick:t=>{t.stopPropagation(),o(e)},type:"button",title:"Edit Component",children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"component-delete-btn",onClick:t=>{t.stopPropagation(),a(e,t)},type:"button",title:"Delete Component",children:p.jsx(t.Trash2,{size:12})})]})]})},Y=({cell:e,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:a,selectedComponent:o,renderFormComponent:l,formData:c={},formTemplateId:u,onThresholdActionCompletion:h,onThresholdIssueRaised:d,tableId:f,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v})=>{const C=`table-cell-${f}-${e.row}-${e.column}`,{setNodeRef:x,isOver:F}=r.useDroppable({id:C,disabled:"edit"!==t,data:{type:"table-cell",tableId:f,cell:e,row:e.row,column:e.column}}),Q={...e.styles,backgroundColor:F?"var(--df-color-primary-light)":e.styles?.backgroundColor||"transparent",minHeight:e.styles?.minHeight||"preview"===t||"test"===t?"40px":"60px",padding:(e.styles,"8px"),border:"preview"===t||"test"===t?"none":F?"2px dashed var(--df-color-primary)":e.styles?.borderColor?`1px solid ${e.styles.borderColor}`:"1px solid var(--df-color-fb-border)",borderRadius:"preview"===t||"test"===t?"0":"4px",position:"relative",verticalAlign:e.styles?.verticalAlign||"top"};return p.jsx("td",{ref:x,style:Q,className:"table-cell "+(F?"drag-over":""),children:p.jsx("div",{className:"cell-content",children:e.components&&Array.isArray(e.components)&&e.components.length>0?"edit"===t?p.jsx(n.SortableContext,{items:e.components.map(e=>e.id||s.v4()),strategy:n.verticalListSortingStrategy,children:e.components.map(e=>{const r=q(e);return p.jsx(X,{component:r,selectedComponent:o,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:a,renderFormComponent:l},r.id)})}):e.components.map(e=>{const A=e.id?e:q(e);return p.jsx(W,{component:A,mode:t,renderFormComponent:l,formData:c,formTemplateId:u,onThresholdActionCompletion:h,onThresholdIssueRaised:d,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v},A.id)}):"edit"===t?p.jsx("div",{className:"empty-cell-placeholder",children:p.jsxs("div",{className:"cell-info",children:[p.jsx("span",{className:"drop-zone-text",children:"Drag and Drop a form component"}),p.jsxs("span",{className:"cell-coordinates",children:["Cell (",e.row+1,", ",e.column+1,")"]})]})}):p.jsx("div",{style:{minHeight:"20px",backgroundColor:"transparent",visibility:"hidden"},children:" "})})})},J=({id:A,properties:r,mode:n="edit",formData:i={},validationErrors:s={},touchedFields:a={},formSubmitted:o=!1,onValueChange:l,onSelect:c,isSelected:u=!1,className:h="",onTableSelect:d,onComponentSelect:f,onComponentDelete:g,onComponentEdit:m,selectedComponent:w,renderFormComponent:B,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:_,workOrderNumber:H,assetNumber:O,user:P,onCreateIssue:D,onUpdateIssue:M})=>{const[j,R]=e.useState(!1),K=r.cells?.some(e=>e.some(e=>e.components&&e.components.length>0))||!1;e.useEffect(()=>{},[r.table?.rows,r.table?.columns,r.basic?.rows,r.basic?.columns,r.cells,A,l]);const G=e.useCallback(e=>{e.stopPropagation(),c?.(),d?.(r)},[c,d,r]),z=e.useCallback((e,t)=>{t.stopPropagation();const n=r.cells.map(t=>t.map(t=>{if(t.components&&t.components.some(t=>t.id===e.id)){const A=t.components.filter(t=>t.id!==e.id);return{...t,components:A}}return t}));l&&l({id:A,value:{...r,cells:n}})},[g,r,l,A]),W=e.useMemo(()=>r.cells?r.cells.map((e,t)=>e.map((e,r)=>({...e,components:e.components&&Array.isArray(e.components)?e.components.map((e,n)=>{if(e.id&&"string"==typeof e.id&&""!==e.id.trim())return e;const i=`${e.name||"component"}-table-${A}-row-${t}-cell-${r}-comp-${n}`;return{...e,id:i}}):[]}))):[],[r.cells,A]),X=B||e.useCallback(e=>{const t=e.id?e:q(e),A=i[t.id]||"defaultValue"in t.basic&&t.basic.defaultValue||"";let r=A;"number-input"===t.name&&"number"==typeof A?r=String(A):"number-input"===t.name&&null==A&&(r="");const s={id:t.id,properties:t,validationErrors:{},formValue:r,touchedFields:{},formSubmitted:!1,mode:n,onValueChange:e=>{l?.(e)},onBlur:()=>{},onFocus:()=>{}};switch(t.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...s,properties:t,inputType:"text-input"===t.name?"text":"number-input"===t.name?"number":"email",readonly:!1,disabled:!1});case"textarea":return p.jsx(F,{...s,properties:t,readonly:!1,disabled:!1});case"select":const e={...t,options:t.basic?.options||[]};return p.jsx(Q,{...s,properties:e,disabled:!1});case"checkbox":const A={...t,options:t.basic?.options||[]};return p.jsx(U,{...s,properties:A,formValue:[],disabled:!1});case"radio":const r={...t,options:t.basic?.options||[]};return p.jsx(S,{...s,properties:r,readonly:!1,disabled:!1});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...s,properties:t,readonly:!1,disabled:!1});case"signature":return p.jsx(L,{...s,properties:t});case"heading":return p.jsx(k,{...s,properties:t});case"instructions":return p.jsx(T,{...s,properties:t});case"location":return p.jsx(I,{...s,properties:t});case"datagrid":return p.jsx(V,{...s,properties:t,formData:i,mode:n,onNotesChange:()=>{},onAttachmentChange:()=>{}});case"segment":const a={...t,options:t.basic?.options||[]};return p.jsx(E,{...s,properties:a});default:return p.jsxs("div",{className:"unknown-component",children:["Unknown component: ",t.name]})}},[B,n,i,l]),J={backgroundColor:r.styles?.backgroundColor||"var(--df-color-fb-container)",borderColor:r.styles?.borderColor||"var(--df-color-fb-border)",borderWidth:r.styles?.borderWidth||"2px",borderRadius:r.styles?.borderRadius||"8px",padding:r.styles?.padding||"16px",margin:r.styles?.margin||"16px 0"},$={width:"100%",minWidth:"600px",borderCollapse:"preview"===n||"test"===n?"separate":"collapse",tableLayout:"fixed",border:"preview"===n||"test"===n?"1px solid var(--df-color-fb-border)":"none"};return K||"preview"!==n?p.jsxs("div",{className:`form-group df-form-table ${u?"selected":""} ${"preview"===n?"preview-mode":"test"===n?"test-mode":""} ${h}`,onClick:G,style:J,children:[p.jsx("div",{className:"table-header",children:p.jsx("div",{className:"table-title",onClick:e=>{e.stopPropagation(),R(!j),l?.({id:A,value:{...r,basic:{...r.basic||{},collapsed:!j}}})},children:p.jsxs("div",{className:"title-content",children:[j?p.jsx(t.ChevronRight,{size:16}):p.jsx(t.ChevronDown,{size:16}),p.jsx(t.Table,{size:16}),p.jsx("span",{className:"table-label",children:r.basic?.label||"Table"}),r.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]})})}),r.basic?.description&&!j&&p.jsx("div",{className:"table-description",children:r.basic.description}),!j&&p.jsxs("div",{className:"table-content",children:[null,p.jsxs("table",{style:$,children:[r.table?.displayAsTable&&("edit"===n||r.table?.showColumns)&&p.jsx("thead",{children:p.jsx("tr",{className:"table-header-row",children:Array.from({length:r.table?.columns||r.basic?.columns||3},(e,t)=>{const A=(r.table?.columnNames?.split(",").map(e=>e.trim())||[])[t]||`Column ${t+1}`;return p.jsx("th",{className:"table-header-cell",style:{backgroundColor:(r.styles.headerBackgroundColor,"var(--df-color-fb-container)"),color:r.styles.headerTextColor||"var(--df-color-text-dark)",padding:"12px",border:"1px solid var(--df-color-fb-border)",fontWeight:"600",fontSize:"14px",textAlign:"center"},children:A},`header-${t}`)})})}),p.jsx("tbody",{children:W.map((e,t)=>p.jsx("tr",{className:"table-row",children:e.map(e=>p.jsx(Y,{cell:e,mode:n,onComponentSelect:f||(()=>{}),onComponentDelete:z,onComponentEdit:m,selectedComponent:w||null,renderFormComponent:X,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,tableId:A,onNotesChange:C,onAttachmentChange:_,workOrderNumber:H,assetNumber:O,user:P,onCreateIssue:D,onUpdateIssue:M},e.id))},t))})]})]})]}):null};var $=Object.freeze({__proto__:null,DfFormTable:J,default:J});const Z={page:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',padding:"30px",backgroundColor:"#ffffff",color:"#000000",lineHeight:"1.4"},header:{marginBottom:"30px",paddingBottom:"15px",borderBottom:"2px solid #303992",display:"flex",justifyContent:"space-between",alignItems:"flex-end"},title:{margin:"0 0 5px 0",fontSize:"24px",fontWeight:"bold",color:"#303992"},description:{margin:"0",fontSize:"14px",color:"#666666"},submittedBy:{fontSize:"14px",color:"#333",textAlign:"right",whiteSpace:"nowrap",marginBottom:"2px"},formGroup:{marginBottom:"20px",breakInside:"avoid"},label:{fontWeight:"400",display:"block",marginBottom:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fontSize:"14px",lineHeight:"1.5",fontColor:"var(--df-color-text-dark)"},labelLeft:{fontWeight:"400",display:"block",marginRight:"10px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fontSize:"14px",lineHeight:"1.5",width:"60%",fontColor:"var(--df-color-text-dark)"},valueContainer:{border:"1px solid #e2e8f0",borderRadius:"6px",padding:"8px 12px",backgroundColor:"#ffffff",minHeight:"20px",fontSize:"14px",flex:1},value:{fontSize:"14px",color:"#000000"},gridRow:{display:"flex",flexWrap:"wrap",gap:"16px",marginBottom:"20px"},gridCol:e=>({flex:`0 0 calc(${e/12*100}% - 8px)`,minWidth:"0"}),img:{maxWidth:"100%",maxHeight:"300px",border:"1px solid #ddd",borderRadius:"4px",display:"block",marginTop:"5px"},table:{width:"100%",borderCollapse:"collapse",border:"1px solid #ddd",marginTop:"10px",tableLayout:"fixed"},th:{border:"1px solid #ddd",padding:"8px",backgroundColor:"#f5f5f5",fontWeight:"bold",textAlign:"left",fontSize:"13px"},td:{border:"1px solid #ddd",padding:"8px",fontSize:"13px",verticalAlign:"top"},section:{marginBottom:"25px",breakInside:"avoid"},sectionHeader:{fontSize:"18px",marginBottom:"15px",display:"block",fontWeight:"600"},sectionChildren:{marginLeft:"20px",paddingLeft:"20px",borderLeft:"2px solid #3b82f6",marginTop:"15px"},notesSection:{marginTop:"10px",padding:"10px",backgroundColor:"rgba(48, 57, 146, 0.05)",borderLeft:"3px solid #303992",borderRadius:"4px",fontSize:"13px",boxSizing:"border-box"},notesLabel:{fontWeight:"bold",color:"#303992",marginRight:"5px"},attachmentsSection:{marginTop:"10px",padding:"10px",backgroundColor:"rgba(48, 57, 146, 0.05)",borderLeft:"3px solid #303992",borderRadius:"4px",display:"flex",flexWrap:"wrap",gap:"10px",boxSizing:"border-box"},attachmentThumbnail:{width:"60px",height:"60px",border:"1px solid #e5e7eb",borderRadius:"4px",overflow:"hidden",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},attachmentImg:{width:"100%",height:"100%",objectFit:"cover"},segmentContainer:{display:"flex",gap:"8px",flexWrap:"wrap",alignItems:"center"},segmentButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:"6px",border:"1px solid #e0e0e0",backgroundColor:"#ffffff",fontSize:"10px",fontWeight:600,minWidth:"30px",color:"#666"},segmentIcon:{marginRight:"4px",fontSize:"9px",fontWeight:"bold",display:"inline-block",lineHeight:"1"},checkboxItem:{display:"flex",alignItems:"center",padding:"10px 14px",backgroundColor:"#f8f9fa",borderRadius:"6px",marginBottom:"8px",width:"100%",boxSizing:"border-box"}},ee=e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim();return t.startsWith("data:image")||t.startsWith("iVBORw0KGgo")||t.startsWith("/9j/4AAQ")||t.startsWith("UklGR")||t.startsWith("R0lGOD")},te=(e,t)=>{if(!e)return"";const A=e.trim();return A.startsWith("data:")||A.startsWith("http")||A.startsWith("blob:")||A.startsWith("/")?A:A.startsWith("iVBORw0KGgo")?`data:image/png;base64,${A}`:A.startsWith("/9j/4AAQ")?`data:image/jpeg;base64,${A}`:A.startsWith("UklGR")?`data:image/webp;base64,${A}`:A.startsWith("R0lGOD")?`data:image/gif;base64,${A}`:t&&t.startsWith("image/")?`data:${t};base64,${A}`:A},Ae=e=>{const t=String(e||"").toLowerCase();return"pass"===t||"yes"===t?"pass":"fail"===t||"no"===t?"fail":"pass"},re=({component:e})=>{const t=e.basic?.notes||"",A=e.basic?.attachments||[];return t.trim()||0!==A.length?p.jsxs("div",{style:{marginTop:"5px"},children:[t.trim().length>0&&p.jsxs("div",{style:Z.notesSection,children:[p.jsx("span",{style:Z.notesLabel,children:"Notes:"}),t]}),A.length>0&&p.jsx("div",{style:Z.attachmentsSection,children:A.map((e,t)=>{const A=!(!e.data&&!e.url),r=(e.type?.startsWith("image/")||ee(e.data||e.url||""))&&A?te(e.data||e.url||"",e.type):null;return p.jsx("div",{style:Z.attachmentThumbnail,children:r?p.jsx("img",{src:r,alt:e.name||"Attachment",style:Z.attachmentImg}):p.jsx("span",{style:{fontSize:"20px",color:"#999"},children:"📎"})},t)})})]}):null},ne=({component:e})=>{const t=void 0!==e.basic?.value?e.basic.value:e.basic?.defaultValue,{name:A}=e;if("signature"===A)return t&&ee(t)?p.jsx("div",{style:{marginTop:"5px"},children:p.jsx("img",{src:te(t),alt:"Signature",style:{...Z.img,maxHeight:"100px",width:"auto"}})}):p.jsx("span",{style:{color:"#999",fontStyle:"italic"},children:"No signature"});if("checkbox"===A){const A=e.basic?.options||[],r=(Array.isArray(t)?t:t?[t]:[]).map(e=>String(e));return p.jsx("div",{style:{marginTop:"5px",width:"100%"},children:A.map((e,t)=>{const A=r.includes(String(e.value));return p.jsxs("div",{style:Z.checkboxItem,children:[p.jsx("div",{style:{width:"18px",height:"18px",minWidth:"18px",border:"2px solid "+(A?"#303992":"#cbd5e1"),borderRadius:"4px",marginRight:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:A?"#303992":"#ffffff"},children:A&&p.jsx("span",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"bold",lineHeight:1},children:"✓"})}),p.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"#334155"},children:e.label})]},t)})})}if("radio"===A){const A=e.basic?.options||[];return p.jsx("div",{style:{marginTop:"5px",width:"100%"},children:A.map((e,A)=>{const r=String(t||"")===String(e.value||"");return p.jsxs("div",{style:Z.checkboxItem,children:[p.jsx("div",{style:{width:"18px",height:"18px",minWidth:"18px",border:"2px solid "+(r?"#303992":"#cbd5e1"),borderRadius:"50%",marginRight:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ffffff"},children:r&&p.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#303992"}})}),p.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"#334155"},children:e.label})]},A)})})}if("segment"===A){const A=e.basic?.options||[],r=t;return p.jsx("div",{style:Z.segmentContainer,children:A.map((e,t)=>{const A=String(r||"")===String(e.value||""),n=(e=>null!=e?.icon?e.icon:"pass"===Ae(e?.value||e)?"✓":"×")(e),i=e.color||e.backgroundColor,s=Ae(e.value);let a,o,l;i?A?(a=i,o="#ffffff",l=i):(a=`${i}20`,o=i,l=i):"pass"===s?A?(a="#00814b",o="#ffffff",l="#00814b"):(a="#34bd4914",o="#00814b",l="#e0e0e0"):A?(a="#dc3545",o="#ffffff",l="#dc3545"):(a="#fa323d14",o="#dc3545",l="#e0e0e0");const c={...Z.segmentButton,backgroundColor:a,color:o,borderColor:l,borderWidth:"1px",borderStyle:"solid"};return p.jsxs("div",{style:c,children:[p.jsx("span",{style:Z.segmentIcon,children:n}),p.jsx("span",{children:e.value})]},t)})})}if("file"===A){const e=(Array.isArray(t)?t:t?[t]:[]).filter(e=>{const t=!(!e.data&&!e.url),A=e.type&&e.type.startsWith("image/"),r=t&&ee(e.data||e.url);return A||r});return e.length>0?p.jsx("div",{style:{marginTop:"10px"},children:e.map((e,t)=>{const A=te(e.data||e.url,e.type);return A?p.jsx("img",{src:A,alt:e.name||"File",style:{...Z.img,marginBottom:"10px"}},t):null})}):p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No images uploaded"})}if("location"===A){if(t&&"object"==typeof t){const e=t;return p.jsxs("div",{style:{fontSize:"14px"},children:[e.placeName&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Place:"})," ",e.placeName]}),(e.city||e.country)&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Address:"})," ",[e.city,e.country].filter(Boolean).join(", ")]}),e.latitude&&e.longitude&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Coordinates:"})," ",e.latitude.toFixed(6),", ",e.longitude.toFixed(6)]}),e.timestamp&&p.jsxs("div",{children:[p.jsx("strong",{children:"Captured:"})," ",(b(e.timestamp)||new Date).toLocaleString()]})]})}return p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No location data"})}if("instructions"===A){const t=e.basic?.instructions||[],A=e.validation?.listStyle||"numbers";if(!Array.isArray(t)||0===t.length)return p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No instructions"});const r=()=>p.jsx("div",{dangerouslySetInnerHTML:{__html:t.join("")}});return"numbers"===A?p.jsx("ol",{style:{margin:"10px 0",paddingLeft:"25px"},children:p.jsx(r,{})}):"bullets"===A?p.jsx("ul",{style:{margin:"10px 0",paddingLeft:"25px"},children:p.jsx(r,{})}):p.jsx("div",{style:{margin:"10px 0"},children:p.jsx(r,{})})}if("select"===A){const A=e.basic?.options||[],r=t;let n="";if(Array.isArray(r))n=r.map(e=>{const t=A.find(t=>String(t.value)===String(e));return t?t.label:e}).join(", ");else{const e=r,t=A.find(t=>String(t.value)===String(e));n=t?t.label||t.value:null!=e?String(e):""}return p.jsx("div",{style:Z.valueContainer,children:p.jsx("div",{style:Z.value,children:n})})}const r="object"==typeof t?JSON.stringify(t):String(t);if(!["signature","checkbox","radio","segment","file","instructions","heading","section","table","datagrid","select"].includes(A)){const e="textarea"===A;return p.jsx("div",{style:{...Z.valueContainer,...e?{minHeight:"60px",whiteSpace:"pre-wrap"}:{}},children:p.jsx("div",{style:Z.value,children:r})})}return p.jsx("div",{style:Z.value,children:r})},ie=({component:e})=>{const{name:t,basic:A,styles:r,validation:n}=e,i=A?.label,s=n?.required,a="left"===(r?.labelAlignment||"top");if("section"===t){const t=r?.headerBackgroundColor,n=r?.headerTextColor,a={...Z.sectionHeader,...t?{backgroundColor:t,padding:"8px",borderRadius:"4px"}:{},...n?{color:n}:{},display:"flex",alignItems:"center"};return p.jsxs("div",{style:Z.section,children:[i&&p.jsx("label",{style:a,children:p.jsxs("span",{style:{flex:1},children:[i,s&&" *"]})}),A?.description&&p.jsx("p",{style:{...Z.description,marginBottom:"15px"},children:A.description}),p.jsx(re,{component:e}),p.jsx("div",{style:Z.sectionChildren,children:p.jsx(se,{components:e.children||[]})})]})}if("heading"===t){const e=`h${Math.max(1,Math.min(6,r?.level??A?.level??1))}`,t={...r?.headerBackgroundColor?{backgroundColor:r.headerBackgroundColor,padding:"8px",borderRadius:"4px"}:{},...r?.headerTextColor?{color:r.headerTextColor}:{},...r?.fontSize?{fontSize:r.fontSize}:{},...r?.textAlign?{textAlign:r.textAlign}:{},marginTop:0,marginBottom:"15px"};return p.jsx("div",{style:Z.formGroup,children:p.jsx(e,{style:t,children:A?.label||A?.value})})}if("table"===t){const t=e.cells||[],A=Math.max(0,...t.map(e=>e?e.length:0)),n=A>0?100/A:100,a=r?.headerBackgroundColor,o=r?.headerTextColor,l={...Z.label,...a?{backgroundColor:a,padding:"8px",borderRadius:"4px",marginBottom:"10px"}:{},...o?{color:o}:{}};return p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:l,children:[i,s&&" *"]}),p.jsx("table",{style:Z.table,children:p.jsx("tbody",{children:t.map((e,t)=>p.jsx("tr",{children:e&&e.map((e,t)=>p.jsx("td",{style:{...Z.td,width:`${n}%`},children:e.components&&e.components.map((e,t)=>p.jsxs("div",{style:{marginBottom:"8px"},children:[e.basic?.label&&p.jsxs("span",{style:{fontWeight:"bold",marginRight:"5px",fontSize:"12px"},children:[e.basic.label,":"]}),p.jsx(ne,{component:e}),p.jsx(re,{component:e})]},t))},t))},t))})})]})}if("datagrid"===t){const t=e.entries||[];let A=e.templateComponents||[];0===A.length&&t.length>0&&t[0]?.components&&(A=t[0].components.map(e=>({...e,basic:{...e.basic,label:e.basic?.label||e.name}})));const n=r?.headerBackgroundColor,a=r?.headerTextColor,o={...Z.label,...n?{backgroundColor:n,padding:"8px",borderRadius:"4px",marginBottom:"10px"}:{},...a?{color:a}:{}},l=t.filter(e=>!(!e.components||0===e.components.length)&&e.components.some(e=>{const t=void 0!==e.basic?.value?e.basic.value:e.basic?.defaultValue;return Array.isArray(t)?t.length>0:null!=t&&""!==String(t).trim()}));return 0===l.length?p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:o,children:[i,s&&" *"]}),p.jsx("div",{style:{fontStyle:"italic",color:"#999"},children:"No data"})]}):p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:o,children:[i,s&&" *"]}),p.jsxs("table",{style:Z.table,children:[p.jsx("thead",{children:p.jsx("tr",{children:A.map((e,t)=>p.jsx("th",{style:Z.th,children:e.basic?.label||e.name},t))})}),p.jsx("tbody",{children:l.map((e,t)=>p.jsx("tr",{children:A.map((t,A)=>{const r=e.components[A];return p.jsx("td",{style:Z.td,children:r?p.jsxs(p.Fragment,{children:[p.jsx(ne,{component:r}),p.jsx(re,{component:r})]}):"N/A"},A)})},t))})]})]})}if(a&&"instructions"!==t){const A=["segment"].includes(t);return p.jsxs("div",{style:Z.formGroup,children:[p.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[i&&p.jsxs("label",{style:Z.labelLeft,children:[i,s&&" *"]}),p.jsx("div",{style:{flex:1,...A?{display:"flex",justifyContent:"flex-end"}:{}},children:p.jsx(ne,{component:e})})]}),p.jsx(re,{component:e})]})}return p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:Z.label,children:[i,s&&" *"]}),p.jsx(ne,{component:e}),p.jsx(re,{component:e})]})},se=({components:e})=>{if(!e||0===e.length)return null;const t=[];let A=[],r=0;return e.forEach(e=>{const n=["section","table","datagrid","heading","instructions"].includes(e.name),i=n?12:e.styles?.column||12;r+i>12&&A.length>0&&(t.push(A),A=[],r=0),A.push(e),r+=i,(n||r>=12)&&r>0&&(t.push(A),A=[],r=0)}),A.length>0&&t.push(A),p.jsx(p.Fragment,{children:t.map((e,t)=>1===e.length?p.jsx(ie,{component:e[0]},e[0].id||t):p.jsx("div",{style:Z.gridRow,children:e.map((e,t)=>{const A=e.styles?.column||12;return p.jsx("div",{style:Z.gridCol(A),children:p.jsx(ie,{component:e})},e.id||t)})},t))})},ae=({formTitle:e,formDescription:t,userName:A,components:r})=>p.jsxs("div",{className:"pdf-container",style:Z.page,children:[p.jsxs("div",{style:Z.header,children:[p.jsxs("div",{children:[p.jsx("h1",{style:Z.title,children:e}),t&&p.jsx("p",{style:Z.description,children:t})]}),A&&p.jsxs("div",{style:Z.submittedBy,children:[p.jsx("strong",{children:"Submitted By:"})," ",A]})]}),p.jsx("div",{className:"form-content",children:p.jsx(se,{components:r})})]});var oe,le=A;if("production"===process.env.NODE_ENV)oe=le.createRoot,le.hydrateRoot;else{var ce=le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;oe=function(e,t){ce.usingClientEntryPoint=!0;try{return le.createRoot(e,t)}finally{ce.usingClientEntryPoint=!1}}}var ue={exports:{}};
|
|
10
|
+
*/"production"===process.env.NODE_ENV?u.exports=function(){if(c)return h;c=1;var t=e,A=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var a,o={},l=null,c=null;for(a in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)n.call(t,a)&&!s.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===o[a]&&(o[a]=t[a]);return{$$typeof:A,type:e,key:l,ref:c,props:o,_owner:i.current}}return h.Fragment=r,h.jsx=a,h.jsxs=a,h}():u.exports=(d||(d=1,"production"!==process.env.NODE_ENV&&function(){var t,A=e,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,w=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function B(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),r=1;r<t;r++)A[r-1]=arguments[r];!function(e,t,A){var r=w.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",A=A.concat([r]));var n=A.map(function(e){return String(e)});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n)}("error",e,A)}function b(e){return e.displayName||"Context"}function y(e){if(null==e)return null;if("number"==typeof e.tag&&B("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case i:return"Fragment";case n:return"Portal";case a:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case h:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return b(e)+".Consumer";case o:return b(e._context)+".Provider";case c:return function(e,t,A){var r=e.displayName;if(r)return r;var n=t.displayName||t.name||"";return""!==n?A+"("+n+")":A}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:y(e.type)||"Memo";case p:var A=e,r=A._payload,f=A._init;try{return y(f(r))}catch(e){return null}}return null}t=Symbol.for("react.module.reference");var v,C,x,F,Q,U,S,E=Object.assign,N=0;function L(){}L.__reactDisabledLog=!0;var _,I=w.ReactCurrentDispatcher;function k(e,t,A){if(void 0===_)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);_=r&&r[1]||""}return"\n"+_+e}var T,H=!1,O="function"==typeof WeakMap?WeakMap:Map;function P(e,t){if(!e||H)return"";var A,r=T.get(e);if(void 0!==r)return r;H=!0;var n,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,n=I.current,I.current=null,function(){if(0===N){v=console.log,C=console.info,x=console.warn,F=console.error,Q=console.group,U=console.groupCollapsed,S=console.groupEnd;var e={configurable:!0,enumerable:!0,value:L,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}();try{if(t){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(e){A=e}Reflect.construct(e,[],s)}else{try{s.call()}catch(e){A=e}e.call(s.prototype)}}else{try{throw Error()}catch(e){A=e}e()}}catch(t){if(t&&A&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),o=A.stack.split("\n"),l=a.length-1,c=o.length-1;l>=1&&c>=0&&a[l]!==o[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==o[c]){if(1!==l||1!==c)do{if(l--,--c<0||a[l]!==o[c]){var u="\n"+a[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),"function"==typeof e&&T.set(e,u),u}}while(l>=1&&c>=0);break}}}finally{H=!1,I.current=n,function(){if(0===--N){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:E({},e,{value:v}),info:E({},e,{value:C}),warn:E({},e,{value:x}),error:E({},e,{value:F}),group:E({},e,{value:Q}),groupCollapsed:E({},e,{value:U}),groupEnd:E({},e,{value:S})})}N<0&&B("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var h=e?e.displayName||e.name:"",d=h?k(h):"";return"function"==typeof e&&T.set(e,d),d}function D(e,t,A){if(null==e)return"";if("function"==typeof e)return P(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return k(e);switch(e){case u:return k("Suspense");case h:return k("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return P(e.render,!1);case d:return D(e.type,t,A);case p:var n=e,i=n._payload,s=n._init;try{return D(s(i),t,A)}catch(e){}}return""}T=new O;var M=Object.prototype.hasOwnProperty,j={},R=w.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,A=D(e.type,e._source,t?t.type:null);R.setExtraStackFrame(A)}else R.setExtraStackFrame(null)}var K=Array.isArray;function z(e){return K(e)}function G(e){return""+e}function q(e){if(function(e){try{return G(e),!1}catch(e){return!0}}(e))return B("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),G(e)}var W,X,Y,J=w.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,A,n,i){var s,a={},o=null,l=null;for(s in void 0!==A&&(q(A),o=""+A),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(q(t.key),o=""+t.key),function(e){if(M.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(l=t.ref,function(e,t){if("string"==typeof e.ref&&J.current&&t&&J.current.stateNode!==t){var A=y(J.current.type);Y[A]||(B('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',y(J.current.type),e.ref),Y[A]=!0)}}(t,i)),t)M.call(t,s)&&!$.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)void 0===a[s]&&(a[s]=c[s])}if(o||l){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;o&&function(e,t){var A=function(){W||(W=!0,B("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};A.isReactWarning=!0,Object.defineProperty(e,"key",{get:A,configurable:!0})}(a,u),l&&function(e,t){var A=function(){X||(X=!0,B("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};A.isReactWarning=!0,Object.defineProperty(e,"ref",{get:A,configurable:!0})}(a,u)}return function(e,t,A,n,i,s,a){var o={$$typeof:r,type:e,key:t,ref:A,props:a,_owner:s,_store:{}};return Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}(e,o,l,i,n,J.current,a)}Y={};var ee,te=w.ReactCurrentOwner,Ae=w.ReactDebugCurrentFrame;function re(e){if(e){var t=e._owner,A=D(e.type,e._source,t?t.type:null);Ae.setExtraStackFrame(A)}else Ae.setExtraStackFrame(null)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function ie(){if(te.current){var e=y(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var se={};function ae(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var A=function(e){var t=ie();if(!t){var A="string"==typeof e?e:e.displayName||e.name;A&&(t="\n\nCheck the top-level render call using <"+A+">.")}return t}(t);if(!se[A]){se[A]=!0;var r="";e&&e._owner&&e._owner!==te.current&&(r=" It was passed a child from "+y(e._owner.type)+"."),re(e),B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,r),re(null)}}}function oe(e,t){if("object"==typeof e)if(z(e))for(var A=0;A<e.length;A++){var r=e[A];ne(r)&&ae(r,t)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var n=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof n&&n!==e.entries)for(var i,s=n.call(e);!(i=s.next()).done;)ne(i.value)&&ae(i.value,t)}}function le(e){var t,A=e.type;if(null!=A&&"string"!=typeof A){if("function"==typeof A)t=A.propTypes;else{if("object"!=typeof A||A.$$typeof!==c&&A.$$typeof!==d)return;t=A.propTypes}if(t){var r=y(A);!function(e,t,A,r,n){var i=Function.call.bind(M);for(var s in e)if(i(e,s)){var a=void 0;try{if("function"!=typeof e[s]){var o=Error((r||"React class")+": "+A+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw o.name="Invariant Violation",o}a=e[s](t,s,r,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(V(n),B("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",A,s,typeof a),V(null)),a instanceof Error&&!(a.message in j)&&(j[a.message]=!0,V(n),B("Failed %s type: %s",A,a.message),V(null))}}(t,e.props,"prop",r,e)}else void 0===A.PropTypes||ee||(ee=!0,B("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y(A)||"Unknown"));"function"!=typeof A.getDefaultProps||A.getDefaultProps.isReactClassApproved||B("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ce={};function ue(e,A,n,f,m,w){var b=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===s||e===u||e===h||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===o||e.$$typeof===l||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)}(e);if(!b){var v="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C,x=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(m);v+=x||ie(),null===e?C="null":z(e)?C="array":void 0!==e&&e.$$typeof===r?(C="<"+(y(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):C=typeof e,B("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,v)}var F=Z(e,A,n,m,w);if(null==F)return F;if(b){var Q=A.children;if(void 0!==Q)if(f)if(z(Q)){for(var U=0;U<Q.length;U++)oe(Q[U],e);Object.freeze&&Object.freeze(Q)}else B("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else oe(Q,e)}if(M.call(A,"key")){var S=y(e),E=Object.keys(A).filter(function(e){return"key"!==e}),N=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";ce[S+N]||(B('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',N,S,E.length>0?"{"+E.join(": ..., ")+": ...}":"{}",S),ce[S+N]=!0)}return e===i?function(e){for(var t=Object.keys(e.props),A=0;A<t.length;A++){var r=t[A];if("children"!==r&&"key"!==r){re(e),B("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),re(null);break}}null!==e.ref&&(re(e),B("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}(F):le(F),F}var he=function(e,t,A){return ue(e,t,A,!1)},de=function(e,t,A){return ue(e,t,A,!0)};f.Fragment=i,f.jsx=he,f.jsxs=de}()),f);var p=u.exports;class g{constructor(){}static getInstance(){return g.instance||(g.instance=new g),g.instance}getAvailableComponentsForConditional(e,t){if(!e||!Array.isArray(e))return[];const A=e=>{let t=[];return e.forEach(e=>{t.push(e),"section"===e.name&&e.children&&(t=[...t,...A(e.children)]),"table"===e.name&&e.cells&&e.cells.forEach(e=>{e.forEach(e=>{e.components&&(t=[...t,...A(e.components)])})}),"datagrid"===e.name&&e.templateComponents&&(t=[...t,...A(e.templateComponents)])}),t},r=A(e).filter(e=>!t||e.id!==t).filter(e=>!["section","table","datagrid"].includes(e.name)).map(e=>{const t={id:e.id,label:e.basic?.label||e.id,type:e.name,key:e.id};return["segment","select","radio","checkbox"].includes(e.name)&&e.basic?.options&&(t.options=e.basic.options.map(e=>({label:e.label||e.value||String(e),value:String(void 0!==e.value?e.value:e)}))),t}).sort((e,t)=>e.label.localeCompare(t.label));return r}getApplicableOperators(e){switch(e){case"text-input":case"email-input":case"textarea":return["equals","notEquals","contains","notContains","isEmpty","isNotEmpty"];case"number-input":case"date-picker":case"datetime-picker":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","isEmpty","isNotEmpty"];case"select":case"radio":case"segment":default:return["equals","notEquals","isEmpty","isNotEmpty"];case"checkbox":return["checked","notChecked","contains","notContains","isEmpty","isNotEmpty"]}}findComponent(e,t){if(e&&Array.isArray(e))for(const A of e){if(A.id===t||A._id===t||A.basic?.label===t)return A;if("section"===A.name&&A.children){const e=this.findComponent(A.children,t);if(e)return e}if("table"===A.name&&A.cells)for(const e of A.cells)for(const A of e)if(A.components){const e=this.findComponent(A.components,t);if(e)return e}if("datagrid"===A.name&&A.templateComponents){const e=this.findComponent(A.templateComponents,t);if(e)return e}if("datagrid"===A.name&&A.entries)for(const e of A.entries)if(e.components){const A=this.findComponent(e.components,t);if(A)return A}}}getAllComponents(e){const t=[],A=e=>{if(e&&Array.isArray(e))for(const r of e){if(t.push(r),r.children&&A(r.children),r.templateComponents&&A(r.templateComponents),r.cells)for(const e of r.cells)for(const t of e)t.components&&A(t.components);if(r.entries)for(const e of r.entries)e.components&&A(e.components)}};return A(e),t}validateConditionalLogic(e,t){const A=[];return e?(["show","hide","always"].includes(e.action)||A.push("Invalid conditional action"),["all","any"].includes(e.when)||A.push("Invalid when condition"),e.conditions&&0!==e.conditions.length?e.conditions.forEach((e,r)=>{const n=this.findComponent(t,e.when);if(!n)return void A.push(`Condition ${r+1}: Component not found`);this.getApplicableOperators(n.name).includes(e.operator)||("checkbox"!==n.name||"checked"!==e.operator&&"notChecked"!==e.operator)&&A.push(`Condition ${r+1}: Operator not applicable for component type`),this.isValidConditionValue(e.value,n.name,e.operator)||A.push(`Condition ${r+1}: Invalid condition value`)}):A.push("At least one condition is required"),{isValid:0===A.length,errors:A}):{isValid:!0,errors:[]}}evaluateConditionalLogic(e,t,A){if("always"===e.action)return{shouldShow:!0,evaluatedConditions:[]};if(!e||!e.conditions||0===e.conditions.length)return{shouldShow:!0,evaluatedConditions:[]};const r=e.conditions.map(e=>{const r=this.getComponentValue(e.when,t,A);return{condition:e,result:this.evaluateCondition(e,r),componentValue:r}});return{shouldShow:this.determineFinalResult(e,r),evaluatedConditions:r}}getComponentValue(e,t,A){if(A&&void 0!==A[e])return A[e];let r=this.findComponent(t,e);if(!r){const e=this.getAllComponents(t),n=Object.keys(A||{});for(const t of e)if(n.includes(t.id)||n.includes(t._id)){r=t;break}}if(r){const e=[r.id,r._id,r.basic?.label].filter(Boolean);for(const t of e)if(A&&void 0!==A[t])return A[t];if(void 0!==r.basic?.value&&null!==r.basic?.value&&""!==r.basic?.value)return r.basic.value;if(void 0!==r.basic?.defaultValue&&null!==r.basic?.defaultValue&&""!==r.basic?.defaultValue)return r.basic.defaultValue}}evaluateCondition(e,t){const{operator:A,value:r}=e;if("checked"===r||"notChecked"===r||"checked"===A||"notChecked"===A){const e="checked"===r||"notChecked"===r?r:A;return this.evaluateCheckboxCondition(t,e)}switch(A){case"equals":return this.isEqual(t,r);case"notEquals":return!this.isEqual(t,r);case"isEmpty":return this.isEmpty(t);case"isNotEmpty":return!this.isEmpty(t);case"contains":return this.contains(t,r);case"notContains":return!this.contains(t,r);case"greaterThan":return this.isGreaterThan(t,r);case"lessThan":return this.isLessThan(t,r);case"greaterThanOrEqual":return this.isGreaterThanOrEqual(t,r);case"lessThanOrEqual":return this.isLessThanOrEqual(t,r);default:return!1}}evaluateCheckboxCondition(e,t){const A=this.isCheckboxChecked(e);return"checked"===t?A:"notChecked"===t&&!A}isCheckboxChecked(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLowerCase()||"1"===e||"checked"===e.toLowerCase()||e.length>0:Array.isArray(e)?e.length>0:"number"==typeof e&&e>0)}determineFinalResult(e,t){let A,r;return A="all"===e.when?t.every(e=>e.result):"any"===e.when&&t.some(e=>e.result),r="show"===e.action?A:"hide"===e.action?!A:(e.action,!0),r}isEqual(e,t){if(e==t)return!0;if(null==e||null==t)return!1;try{const A=String(e).trim(),r=String(t).trim();if(""!==A&&""!==r&&!isNaN(Number(A))&&!isNaN(Number(r))&&Number(A)===Number(r))return!0;if(A.toLowerCase()===r.toLowerCase())return!0}catch(e){}if(!Array.isArray(e)&&Array.isArray(t))return t.some(t=>this.isEqual(e,t));if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;const A=[...e].sort(),r=[...t].sort();return A.every((e,t)=>this.isEqual(e,r[t]))}if("object"==typeof e&&"object"==typeof t){const A=Object.keys(e),r=Object.keys(t);return A.length===r.length&&A.every(A=>this.isEqual(e[A],t[A]))}return!1}isEmpty(e){return null==e||void 0===e||("string"==typeof e?""===e.trim():Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}contains(e,t){return null!=e&&null!=t&&("string"==typeof e?e.trim().toLowerCase().includes(String(t).trim().toLowerCase()):Array.isArray(e)?Array.isArray(t)?t.some(t=>e.some(e=>this.isEqual(e,t))):e.some(e=>this.isEqual(e,t)):!("string"!=typeof e||!Array.isArray(t))&&t.some(t=>e.trim().toLowerCase().includes(String(t).trim().toLowerCase())))}isGreaterThan(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A>r}isLessThan(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A<r}isGreaterThanOrEqual(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A>=r}isLessThanOrEqual(e,t){const A="number"==typeof e?e:parseFloat(String(e)),r="number"==typeof t?t:parseFloat(String(t));return!isNaN(A)&&!isNaN(r)&&A<=r}isValidConditionValue(e,t,A){if(null==e)return["isEmpty","isNotEmpty"].includes(A);switch(t){case"number-input":return!isNaN(Number(e))||["isEmpty","isNotEmpty"].includes(A);case"date-picker":case"datetime-picker":return!isNaN(Date.parse(e))||["isEmpty","isNotEmpty"].includes(A);case"checkbox":return Array.isArray(e)||"string"==typeof e||"number"==typeof e;default:return!0}}createDefaultConditionalLogic(){return{action:"show",when:"all",conditions:[]}}getOperatorDisplayText(e){return{equals:"Is Equal To",notEquals:"Is Not Equal To",contains:"Contains",notContains:"Does Not Contain",isEmpty:"Is Empty",isNotEmpty:"Is Not Empty",greaterThan:"Is Greater Than",lessThan:"Is Less Than",greaterThanOrEqual:"Is Greater Than Or Equal To",lessThanOrEqual:"Is Less Than Or Equal To",checked:"Is Checked",notChecked:"Is Not Checked"}[e]||e}getActionDisplayText(e){return{show:"Show this field when",hide:"Hide this field when",always:"Always show this field"}[e]||e}getConditionalLogicSummary(e,t){if(!e||0===e.conditions.length)return"No conditions";if("always"===e.action)return"Always show";const A=this.getActionDisplayText(e.action),r=e.conditions.map(e=>{const A=t.find(t=>t.id===e.when);return`${A?.basic.label||"Unknown component"} ${this.getOperatorDisplayText(e.operator)} ${this.formatConditionValue(e.value)}`}),n="all"===e.when?" and ":" or ";return`${A} ${r.join(n)}`}formatConditionValue(e){return null==e?"empty":Array.isArray(e)?`[${e.join(", ")}]`:"string"==typeof e?`"${e}"`:String(e)}}const m=g.getInstance();const w=new class{constructor(){this.toasts=[],this.listeners=[],this.defaultDuration=3e3,this.timeouts={}}generateId(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}notifyListeners(){this.listeners.forEach(e=>e([...this.toasts]))}addToast(e){try{this.toasts.push(e),this.notifyListeners(),this.timeouts[e.id]=setTimeout(()=>{this.removeToast(e.id)},e.duration||this.defaultDuration)}catch(e){console.error("Error displaying toast message:",e)}}removeToast(e){this.timeouts[e]&&(clearTimeout(this.timeouts[e]),delete this.timeouts[e]),this.toasts=this.toasts.filter(t=>t.id!==e),this.notifyListeners()}showSuccess(e,t=3e3){const A={id:this.generateId(),message:e,type:"success",duration:t};this.addToast(A)}showError(e,t=5e3){const A={id:this.generateId(),message:e,type:"danger",duration:t};this.addToast(A)}showWarning(e,t){const A={id:this.generateId(),message:e,type:"warning",duration:t};this.addToast(A)}showInfo(e,t){const A={id:this.generateId(),message:e,type:"info",duration:t};this.addToast(A)}show(e,t="success",A){const r={id:this.generateId(),message:e,type:t,duration:A};this.addToast(r)}clearAll(){Object.values(this.timeouts).forEach(e=>clearTimeout(e)),this.timeouts={},this.toasts=[],this.notifyListeners()}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}getToasts(){return[...this.toasts]}},B=({validationErrors:e,fieldId:t,touchedFields:A,formSubmitted:r,properties:n,localValidation:i,isTouched:s,mode:a})=>{const o=e=>{const t=n.basic.label||"This field",A=n.name||"",r=n.validation?.customValidationMessage;if("number-input"===A)switch(e){case"required":return`${t} is required`;case"lowerLimit":return"Number is below the lower limit";case"upperLimit":return"Number is above the upper limit";default:return""}if(r)return r;const i="date-picker"===A||"datetime-picker"===A?n.basic?.dateTimeMode||("datetime-picker"===A?"datetime":"date"):null;switch(e){case"required":return`${t} is required`;case"invalidDate":return"time"===i?"Please select a valid time":"datetime"===i?"Please select a valid date and time":"date"===i?"Please select a valid date":`${t} is invalid`;case"minLength":return`${t} must be at least ${n.validation.minLength} characters long`;case"maxLength":return`${t} must be no more than ${n.validation.maxLength} characters long`;case"min":return`${t} must be at least ${n.validation.min}`;case"max":return`${t} must be no more than ${n.validation.max}`;case"lowerLimit":const e=n.validation,A=e?.lowerLimit;return`You are under the limit. ${t} must be at least ${A}`;case"upperLimit":const r=n.validation,s=r?.upperLimit;return`You crossed the limit. ${t} must be no more than ${s}`;case"pattern":return`${t} format is invalid`;case"email":return`${t} must be a valid email address`;default:return`${t} is invalid`}},l=(()=>{if("test"!==a)return"";if(!(s||A[t]||r))return"";if(i&&i.isValid)return"";if(i&&!i.isValid&&Object.keys(i.errors).length>0){const e=Object.keys(i.errors).filter(e=>!0===i.errors[e]);if(e.length>0){const t=e[0],A=n.name||"";return"pattern"===t&&"number-input"===A?"":o(t)}}const l=e[t];if(l&&"string"==typeof l&&""!==l.trim()){const e=n.name||"";if("number-input"===e&&i){const e=n.validation,t=e&&"lowerLimit"in e&&void 0!==e.lowerLimit&&null!==e.lowerLimit&&0!==e.lowerLimit,A=e&&"upperLimit"in e&&void 0!==e.upperLimit&&null!==e.upperLimit&&0!==e.upperLimit;return!l.includes("limit")&&!l.includes("Limit")||t||A?(i.isValid,""):""}if(("date-picker"===e||"datetime-picker"===e)&&l.includes("valid date")){const t=n.basic?.dateTimeMode||("datetime-picker"===e?"datetime":"date");if("time"===t)return"Please select a valid time";if("datetime"===t)return"Please select a valid date and time"}return l}return""})();return l?p.jsx("div",{className:"form-error-msg",children:l}):null},b=e=>{if(null==e||""===e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if("number"==typeof e){const t=new Date(e);return isNaN(t.getTime())?null:t}if("string"==typeof e){let t=e.trim();t.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/)&&(t=t.replace(" ","T"));const A=new Date(t);return isNaN(A.getTime())?null:A}return null};var y;!function(e){e.OPEN="Open",e.IN_PROGRESS="In-Progress",e.REJECTED="Rejected",e.RESOLVE="Resolve"}(y||(y={}));const v=({isOpen:r,onClose:n,onSuccess:i,component:s,formTemplateId:a,notes:o="",attachments:l=null,issue:c=null,onCreateIssue:u,onUpdateIssue:h,user:d,availableUsers:f=["Priya Das","Maria Garcia","John Smith","Sarah Johnson"],workOrderNumber:g,assetNumber:m,isStandalone:B,isEdit:v})=>{const[C,x]=e.useState(""),[F,Q]=e.useState(""),[U,S]=e.useState(""),[E,N]=e.useState(""),[L,_]=e.useState("Medium"),[I,k]=e.useState(y.OPEN),[T,H]=e.useState(""),[O,P]=e.useState(""),[D,M]=e.useState(!1),[j,R]=e.useState(l||[]),[V,K]=e.useState(!1),z=e.useRef(null),G=void 0!==v?v:!!c;e.useEffect(()=>{r&&(G&&c?.attachments&&c.attachments.length>0?R(c.attachments):l&&l.length>0?R(l):R(G&&c?.attachments?c.attachments:[]))},[r,l,c,G]);const q=e=>{if(!e)return"Attachment";if(e instanceof File)return e.name;if("string"==typeof e){if(e.startsWith("data:"))return"Attachment";const t=e.split("/");return t[t.length-1]||"Attachment"}return e.fileName||e.filename||e.name||"Attachment"},W=e=>{if(!e)return null;const t=e=>/\.(jpg|jpeg|png|gif|webp)$/i.test(e),A=e=>e.startsWith("data:image");return e instanceof File?e.type.startsWith("image/")?URL.createObjectURL(e):null:"string"==typeof e?A(e)||t(e)?e:null:e.data&&A(e.data)||e.fileName&&t(e.fileName)&&e.data?e.data:null};e.useEffect(()=>{if(r)if(c||G){x(c?.title||""),Q(c?.description||""),S(c?.workOrderNumber||g||""),N(c?.assetNumber||m||""),_(c?.priority||"Medium");const e=c?.status||y.OPEN,t=e===y.OPEN||e===y.IN_PROGRESS||e===y.REJECTED||e===y.RESOLVE?e:y.OPEN;k(t),H(c?.assignTo||""),P(c?.comments||"")}else s&&(s.basic,x(""),Q(""),P(o||""),g&&S(g),m&&N(m))},[r,s,o,c,g,m]);const X=e.useMemo(()=>{if(!C.trim())return!1;if(!F.trim())return!1;if(!I)return!1;if(!T)return!1;if(!B){if(!U.trim())return!1;if(!E.trim())return!1}return!0},[C,F,I,T,B,U,E]),Y=async e=>{if(c){M(!0);try{const t={title:String(C||"").trim(),description:String(F||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,formTemplateId:c.formTemplateId||"",component:c.component||{},priority:L,assignTo:String(T||"").trim()||void 0,status:e,comments:String(O||"").trim()||""};h&&c._id&&await h(c._id,t),k(e);const A={[y.IN_PROGRESS]:"Issue accepted and moved to In-Progress",[y.RESOLVE]:"Issue resolved successfully",[y.REJECTED]:"Issue rejected"};w.showSuccess(A[e]||"Issue status updated successfully"),i&&i(),n()}catch(e){const t=e?.message||e?.error?.message||"Failed to update issue status. Please try again.";w.showError(t)}finally{M(!1)}}};if(!r)return null;const J=p.jsx("div",{className:"raise-issue-modal-overlay",onClick:n,children:p.jsxs("div",{className:"raise-issue-modal",onClick:e=>e.stopPropagation(),children:[p.jsxs("div",{className:"raise-issue-modal-header",children:[p.jsxs("div",{className:"raise-issue-modal-header-left",children:[p.jsx(t.AlertTriangle,{className:"raise-issue-modal-icon",size:20}),p.jsx("div",{className:"raise-issue-modal-header-text",children:p.jsx("div",{className:"raise-issue-modal-title-main",children:G?"Issue Details":"Create Issue"})})]}),p.jsx("button",{className:"raise-issue-modal-close",onClick:n,"aria-label":"Close",children:p.jsx(t.X,{size:18})})]}),p.jsx("div",{className:"raise-issue-modal-content",children:p.jsxs("div",{className:"raise-issue-fields-grid",children:[G&&c?.issueNumber&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Issue ID"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:c.issueNumber,readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Task"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:G?c?.component?.basic?.label||"":s?.basic?.label||"",readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Task Value"}),p.jsx("input",{type:"text",className:"raise-issue-field-input raise-issue-field-readonly",value:G?c?.component?.basic?.value||"":s?.basic?.value||"",readOnly:!0})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Title ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(G?"raise-issue-field-readonly":""),value:C,onChange:e=>x(e.target.value),placeholder:"Enter issue title",readOnly:G})]}),!B&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Work Order ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(G?"raise-issue-field-readonly":""),value:U,onChange:e=>S(e.target.value),placeholder:"N/A",readOnly:G})]}),!B&&p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Asset Number ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("input",{type:"text",className:"raise-issue-field-input "+(G?"raise-issue-field-readonly":""),value:E,onChange:e=>N(e.target.value),placeholder:"Enter asset number",readOnly:G})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Raised By ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("div",{className:"raise-issue-field-value-with-icon",children:[p.jsx(t.User,{size:16}),p.jsx("span",{children:d&&`${d.firstName||""} ${d.lastName||""}`.trim()||"User"})]})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsx("label",{className:"raise-issue-field-label",children:"Created On"}),p.jsxs("div",{className:"raise-issue-field-value-with-icon",children:[p.jsx(t.Calendar,{size:16}),p.jsx("span",{children:G&&c?.createdAt?(b(c.createdAt)||new Date).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}):(new Date).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Description ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsx("textarea",{className:"raise-issue-field-textarea "+(G?"raise-issue-field-readonly":""),value:F,onChange:e=>Q(e.target.value),placeholder:"Enter issue description",rows:4,readOnly:G})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Status ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("select",{className:"raise-issue-field-select "+(G?"":"raise-issue-field-readonly"),value:I,onChange:e=>k(e.target.value),disabled:!G,children:[p.jsx("option",{value:y.OPEN,children:y.OPEN}),p.jsx("option",{value:y.IN_PROGRESS,children:y.IN_PROGRESS}),p.jsx("option",{value:y.REJECTED,children:y.REJECTED}),p.jsx("option",{value:y.RESOLVE,children:y.RESOLVE})]})]}),p.jsxs("div",{className:"raise-issue-field",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Assign to ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("select",{className:"raise-issue-field-select",value:T,onChange:e=>H(e.target.value),children:[p.jsx("option",{value:"",children:"Unassigned"}),f.map(e=>p.jsx("option",{value:e,children:e},e))]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label",children:["Priority ",p.jsx("span",{className:"raise-issue-required",children:"*"})]}),p.jsxs("div",{className:"raise-issue-priority-buttons",children:[p.jsx("button",{type:"button",className:"priority-button priority-low "+("Low"===L?"active":""),onClick:()=>_("Low"),children:"Low"}),p.jsx("button",{type:"button",className:"priority-button priority-medium "+("Medium"===L?"active":""),onClick:()=>_("Medium"),children:"Medium"}),p.jsx("button",{type:"button",className:"priority-button priority-high "+("High"===L?"active":""),onClick:()=>_("High"),children:"High"})]})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",children:[p.jsxs("label",{className:"raise-issue-field-label-with-icon",children:[p.jsx(t.MessageSquare,{size:16}),p.jsx("span",{children:"Comments"})]}),!O&&p.jsx("div",{className:"raise-issue-no-comments",children:"No comments yet"}),p.jsx("textarea",{className:"raise-issue-field-textarea raise-issue-comments-textarea "+(G?"raise-issue-field-readonly":""),value:O,onChange:e=>P(e.target.value),placeholder:"Add a comment...",rows:4,readOnly:G})]}),p.jsxs("div",{className:"raise-issue-field raise-issue-field-full-width",style:{marginTop:"1rem"},children:[p.jsx("label",{className:"raise-issue-field-label",children:"Attachments"}),p.jsxs("div",{className:"raise-issue-attachments-container",children:[!G&&p.jsxs("div",{className:"raise-issue-dropzone "+(V?"dragging":""),onDragOver:e=>{e.preventDefault(),K(!0)},onDragLeave:e=>{e.preventDefault(),K(!1)},onDrop:e=>{if(e.preventDefault(),K(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);R(e=>[...e,...t])}},onClick:()=>z.current?.click(),children:[p.jsx("input",{type:"file",ref:z,style:{display:"none"},onChange:e=>{if(e.target.files&&e.target.files.length>0){const t=Array.from(e.target.files);R(e=>[...e,...t]),z.current&&(z.current.value="")}},multiple:!0}),p.jsx("div",{className:"raise-issue-dropzone-icon",children:p.jsx(t.UploadCloud,{size:24})}),p.jsx("div",{className:"raise-issue-dropzone-text",children:"Click to upload or drag and drop"}),p.jsx("div",{className:"raise-issue-dropzone-hint",children:"PNG, JPG up to 10MB"})]}),j.length>0&&p.jsx("div",{className:"raise-issue-attachments-list",children:j.map((e,A)=>p.jsxs("div",{className:"raise-issue-attachment-item",children:[p.jsx("div",{className:"raise-issue-attachment-thumbnail",children:W(e)?p.jsx("img",{src:W(e),alt:"Thumbnail"}):p.jsx(t.Paperclip,{size:20,color:"#9ca3af"})}),p.jsxs("div",{className:"raise-issue-attachment-info",children:[p.jsx("span",{className:"attachment-name",title:q(e),children:q(e)}),e instanceof File&&p.jsxs("span",{className:"attachment-size",children:[(e.size/1024).toFixed(1)," KB"]})]}),!G&&p.jsx("button",{type:"button",className:"attachment-remove-btn",onClick:()=>(e=>{R(t=>t.filter((t,A)=>A!==e))})(A),title:"Remove",children:p.jsx(t.X,{size:12})})]},A))})]})]})]})}),p.jsx("div",{className:"raise-issue-modal-actions",children:p.jsxs("div",{className:"raise-issue-modal-actions-buttons",children:[G&&c&&p.jsxs(p.Fragment,{children:[I===y.OPEN&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-accept",onClick:async()=>{await Y(y.IN_PROGRESS)},disabled:D,children:D?"Processing...":"Accept"}),I===y.IN_PROGRESS&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-resolve",onClick:async()=>{await Y(y.RESOLVE)},disabled:D,children:D?"Processing...":"Resolve"}),(I===y.OPEN||I===y.IN_PROGRESS)&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-reject",onClick:async()=>{await Y(y.REJECTED)},disabled:D,children:D?"Processing...":"Reject"})]}),!G&&p.jsx("button",{className:"raise-issue-modal-button raise-issue-modal-button-save "+(X?"":"disabled"),onClick:async()=>{if(String(C||"").trim())if(String(F||"").trim())if(B||String(U||"").trim())if(B||String(E||"").trim())if(String(T||"").trim()){M(!0);try{if(G&&c){const e={title:String(C||"").trim(),description:String(F||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,formTemplateId:c.formTemplateId||"",component:c.component||{},priority:L,assignTo:String(T||"").trim()||void 0,status:I,comments:String(O||"").trim()||"",task:c.component?.basic?.label||"",taskValue:c.component?.basic?.value||""};h&&c._id&&await h(c._id,e),w.showSuccess("Issue updated successfully"),i&&i(),n()}else{if(!s)return w.showError("Component is required"),void M(!1);if(!a||""===String(a||"").trim())return w.showError("Form template is required"),void M(!1);const e={...s,basic:{...s.basic,comments:String(o||"")}},t=d?`${d.firstName||""} ${d.lastName||""}`.trim():"User",A={title:String(C||"").trim(),workOrderNumber:String(U||"").trim()||void 0,assetNumber:String(E||"").trim()||void 0,component:e,description:String(F||"").trim(),formTemplateId:a,assignTo:String(T||"").trim()||void 0,priority:L,status:I,comments:String(O||"").trim()||"",createdBy:t,task:s?.basic?.label||"",taskValue:s?.basic?.value||""};let r;if(u&&(r=await u(A,j)),w.showSuccess("Issue raised successfully"),i){const e={_id:r?._id||"temp-id",issueNumber:r?.issueNumber||"",title:A.title,description:A.description,status:A.status,priority:A.priority,createdAt:r?.createdAt||(new Date).toISOString(),updatedAt:r?.updatedAt||(new Date).toISOString(),component:A.component,workOrderNumber:A.workOrderNumber,assetNumber:A.assetNumber,assignTo:A.assignTo,comments:A.comments,attachments:r?.attachments||j,...r};i(e)}n()}}catch(e){const t=e?.message||e?.error?.message||(G?"Failed to update issue. Please try again.":"Failed to raise issue. Please try again.");w.showError(t)}finally{M(!1)}}else w.showError("Assignee is required");else w.showError("Asset Number is required");else w.showError("Work Order is required");else w.showError("Description is required");else w.showError("Title is required")},disabled:D||!X,children:D?"Creating...":"Create Issue"})]})})]})});return A.createPortal(J,document.body)},C=({component:A,condition:r,currentValue:n,thresholdValue:i,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,onIssueRaised:c,isIssueRaised:u=!1,compact:h=!1})=>{const[d,f]=e.useState(!1),[g,m]=e.useState(null),[B,b]=e.useState(!1),[y,C]=e.useState(!1);e.useEffect(()=>{u&&C(!0)},[u]),e.useEffect(()=>{C(!1)},[r?.id]);const x=e=>({greaterThan:">",lessThan:"<",greaterThanOrEqual:"≥",lessThanOrEqual:"≤",equals:"=",notEquals:"≠"}[e]||e),F=e.useCallback(async()=>{if(u||y){if(g)return void f(!0);b(!0);try{m(null),f(!0)}catch(e){console.error("Error fetching issue:",e),w.showError("Failed to load issue details")}finally{b(!1)}}else m(null),f(!0)},[u,y,s,A,g]),Q=e.useCallback(()=>{f(!1),u||y||m(null)},[u,y]),U=e.useCallback(e=>{f(!1),m(e||null),C(!0),c&&r?.id&&c(r.id)},[c,r]);return u||y?p.jsx(p.Fragment,{children:d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})}):h?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"threshold-alert threshold-alert-unresolved threshold-alert-compact",children:[p.jsx("div",{className:"threshold-alert-border"}),p.jsxs("div",{className:"threshold-alert-content-compact",children:[p.jsx(t.AlertTriangle,{className:"threshold-alert-icon-compact",size:14}),p.jsx("span",{className:"threshold-alert-message-compact",children:`Threshold ${x(r.operator)} ${i}`}),p.jsx("button",{type:"button",onClick:F,className:"threshold-alert-raise-issue-btn-compact",title:"Raise Issue",children:"Raise Issue"})]})]}),d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"threshold-alert threshold-alert-unresolved",children:[p.jsx("div",{className:"threshold-alert-border"}),p.jsxs("div",{className:"threshold-alert-content",children:[p.jsx("div",{className:"threshold-alert-header",children:p.jsxs("div",{className:"threshold-alert-title-group",children:[p.jsx(t.AlertTriangle,{className:"threshold-alert-icon",size:20}),p.jsx("span",{className:"threshold-alert-title",children:"Threshold Condition Met - Action Required"})]})}),p.jsxs("div",{className:"threshold-alert-message",children:[(()=>{const e=x(r.operator);return`${A.basic?.label||"Value"}: Value ${n} exceeds threshold ${e} ${i}`})(),p.jsx("span",{className:"threshold-alert-warning",children:" You must raise an issue before submitting the form."})]}),p.jsx("div",{className:"threshold-alert-buttons",children:p.jsx("button",{type:"button",onClick:F,className:"threshold-alert-raise-issue-btn",children:"Raise Issue Now"})})]})]}),d&&p.jsx(v,{isOpen:d,onClose:Q,onSuccess:U,component:A,formTemplateId:s,workOrderNumber:a,assetNumber:o,user:l,notes:"",attachments:null,issue:g})]})},x=({id:t,properties:A,validationErrors:r={},formValue:n="",inputType:i="text",readonly:s=!1,disabled:a=!1,touchedFields:o={},formSubmitted:l=!1,mode:c="test",onValueChange:u,onBlur:h,onFocus:d,className:f="",hideLabel:g=!1,formTemplateId:m,onThresholdIssueRaised:w,raisedThresholdIssues:b=new Set,workOrderNumber:y,assetNumber:v,user:x})=>{const F=e=>null==e?"":"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?"":"value"in e?F(e.value):"label"in e?F(e.label):"":String(e||""),Q=e.useRef(t),U=e.useRef(null);e.useEffect(()=>{t!==Q.current&&(console.warn(`[DfFormInput] Component ID changed from ${Q.current} to ${t}`),Q.current=t)},[t]);const S=F(n||A?.basic?.defaultValue||""),[E,N]=e.useState(S),[L,_]=e.useState(!1),[I,k]=e.useState(!1),[T,H]=e.useState(new Set),[O,P]=e.useState(S),D=()=>{if(i)return i;const e=A?.name;return"text-input"===e?"text":"number-input"===e?"number":"email-input"===e?"email":"text"},M=e.useCallback(e=>{const t=(()=>{const e={};if(A?.validation?.required&&(e.required=!0),"email"===D()&&(e.email=!0),"text"===D()){const t=A.validation;t?.minLength&&(e.minLength=t.minLength),t?.maxLength&&(e.maxLength=t.maxLength)}if("number"===D()){const t=A.validation;t&&"lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&(e.lowerLimit=t.lowerLimit),t&&"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&(e.upperLimit=t.upperLimit)}return e})(),r={};let n=!0;const i="string"==typeof e?e:null!=e?String(e):"";if(!t.required||i&&""!==i.trim()||(r.required=!0,n=!1),t.email&&i&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(i)&&(r.email=!0,n=!1),t.minLength&&i&&i.length<t.minLength&&(r.minLength=!0,n=!1),t.maxLength&&i&&i.length>t.maxLength&&(r.maxLength=!0,n=!1),"number"===D())if(delete r.pattern,delete r.min,delete r.max,i&&""!==i.trim()){const e=i.trim(),A=parseFloat(e);isNaN(A)||("lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&A<t.lowerLimit&&(r.lowerLimit=!0,n=!1),"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&A>t.upperLimit&&(r.upperLimit=!0,n=!1))}else delete r.lowerLimit,delete r.upperLimit;return{isValid:n,errors:r}},[A,D]),j=e.useCallback(e=>{const A="string"==typeof e?e:null!=e?String(e):"";if(N(A),u){const e=M(A),r=Q.current,n={id:r,value:A,isValid:e.isValid,errors:e.errors};r!==t&&console.error(`[DfFormInput] ID mismatch in handleValueChange! ref: ${r}, prop: ${t}`),u(n)}},[t,u,M,Q]);e.useEffect(()=>{L&&(o[t]=!0)},[L,t,o]),e.useEffect(()=>{if("edit"===c){_(!1);N(A?.basic?.defaultValue||"")}else"test"===c&&(_(!1),N(""))},[c,A?.basic?.defaultValue]),e.useEffect(()=>{const e=Q.current,r=F(n||A?.basic?.defaultValue||"");r===E||I||""===r&&""!==String(E||"").trim()?""===r&&String(E||"").trim():null!=n&&(e===t?N(r):console.error(`[DfFormInput] ID mismatch! componentIdRef: ${e}, prop id: ${t}`))},[n,E,I,A?.basic?.defaultValue,t]),e.useEffect(()=>{l&&_(!0)},[l]),e.useEffect(()=>{"test"!==c&&N("")},[c]);const R=e.useCallback((e,t)=>{if(!t||""===t)return!1;const A="string"==typeof t?parseFloat(t):t,r="string"==typeof e.value?parseFloat(e.value):e.value;if(isNaN(A)||isNaN(r))return!1;switch(e.operator){case"greaterThan":return A>r;case"lessThan":return A<r;case"greaterThanOrEqual":return A>=r;case"lessThanOrEqual":return A<=r;case"equals":return A===r;case"notEquals":return A!==r;default:return!1}},[]),V=e.useMemo(()=>A?.condition?.conditions||[],[A?.condition]);e.useEffect(()=>{E!==O&&(H(new Set),P(E))},[E,O]);const K=e.useMemo(()=>{if("test"!==c||!E||""===E)return null;const e=V.filter(e=>R(e,E));if(0===e.length)return null;for(const t of e)if(!T.has(t.id))return t;return null},[E,V,T,c,R,b]),z=e.useCallback(e=>{H(t=>new Set(t).add(e))},[]),G=D(),q=a||s||A?.validation?.readonly;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!g&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",ref:U,children:[p.jsx("input",{type:G,id:t,value:E,onChange:e=>{const t=e.target.value;j(t)},onFocus:()=>{k(!0),d&&d()},onBlur:()=>{if(k(!1),_(!0),"test"===c&&u){const e="string"==typeof E?E:null!=E?String(E):"",A=M(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};u(r)}h&&h()},placeholder:A.basic.placeholder,disabled:q,readOnly:s||A?.validation?.readonly,className:(()=>{const e="form-control";if("test"===c){const A="string"==typeof E?E:null!=E?String(E):"",n=M(A);if(n.isValid)return`${e} ${f}`.trim();const i=!n.isValid&&L,s=r[t]&&(L||l)&&!n;return`${e} ${i||s?"is-invalid":""} ${f}`.trim()}return`${e} ${f}`.trim()})()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:o,formSubmitted:l,properties:A,localValidation:M(E),isTouched:L,mode:c})]})]}),K&&"test"===c&&(()=>{const e=b?.has(K.id)||!1,t=null!==U.current?.closest(".table-cell")||null!==U.current?.closest(".cell-content")||null!==U.current?.closest(".datagrid-table-view")||null!==U.current?.closest(".datagrid-list-view")||f.includes("table-cell")||f.includes("cell-content");return p.jsx(C,{component:A,condition:K,currentValue:E,thresholdValue:K.value,formTemplateId:m,workOrderNumber:y,assetNumber:v,user:x,onDismiss:()=>z(K.id),onIssueRaised:w,isIssueRaised:e,compact:t},`${K.id}-${e}`)})()]})},F=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),A?.validation?.minLength&&e&&e.length<A.validation.minLength&&(t.minLength=!0,r=!1),A?.validation?.maxLength&&e&&e.length>A.validation.maxLength&&(t.maxLength=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]);e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{""===g&&""!==n&&m(n)},[n]),e.useEffect(()=>{o&&b(!0)},[o]),e.useEffect(()=>{"test"!==l&&m("")},[l]);const C=s||i||A?.validation?.readonly,x=A?.validation?.rows||4;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("textarea",{id:t,value:g,onChange:e=>{const t=e.target.value;v(t)},onFocus:()=>{h&&h()},onBlur:()=>{b(!0),u&&u()},placeholder:A.basic.placeholder,disabled:C,readOnly:i||A?.validation?.readonly,rows:x,className:`form-textarea ${!y(g).isValid&&w?"is-invalid":""} ${d}`.trim()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})]})},Q=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=A?.validation?.multiple||!1,v=e.useCallback(e=>{const t={};let r=!0;return A?.validation?.required&&(y?Array.isArray(e)&&0!==e.length||(t.required=!0,r=!1):(!e||"string"==typeof e&&""===e.trim())&&(t.required=!0,r=!1)),{isValid:r,errors:t}},[A,y]),C=e.useCallback(e=>{if(m(e),c){const A=v(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,v]);e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{JSON.stringify(n)!==JSON.stringify(g)&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const x=s||i||A?.validation?.readonly;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsxs("select",{id:t,value:g,onChange:e=>{if(y){const t=Array.from(e.target.selectedOptions,e=>e.value);C(t)}else C(e.target.value)},onFocus:()=>{h&&h()},onBlur:()=>{b(!0),u&&u()},disabled:x,multiple:y,className:`form-select ${!v(g).isValid&&w?"is-invalid":""} ${d}`.trim(),children:[!y&&p.jsx("option",{value:"",children:A.basic.placeholder||"Select an option"}),(A.options||[]).map((e,t)=>p.jsx("option",{value:e.value,disabled:e.disabled,children:e.label},t))]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:v(g),isTouched:w,mode:l})]})]})},U=({id:t,properties:A,validationErrors:r={},formValue:n=[],readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(!1),w=Array.isArray(n)?n:[],b=e.useCallback(e=>{const t={};let r=!0;return A?.validation?.required&&0===e.length&&(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),y=e.useCallback(e=>{if(c){const A=b(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,b,w]),v=(e,t)=>{let A;A=t?[...w,e]:w.filter(t=>t!==e),y(A)},C=()=>{h&&h()},x=()=>{m(!0),u&&u()};e.useEffect(()=>{g&&(a[t]=!0)},[g,t,a]),e.useEffect(()=>{},[n,t,w]),e.useEffect(()=>{o&&m(!0)},[o]);const F=s||i||A?.validation?.readonly;return p.jsx(p.Fragment,{children:p.jsx("div",{className:`form-group checkbox-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${A?.basic?.inlineLayout?"inline-layout":"vertical-layout"} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"checkbox",id:`${t}-${A}`,name:t,value:e.value,checked:w.includes(e.value),onChange:t=>{v(e.value,t.target.checked)},onFocus:C,onBlur:x,disabled:F||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:b(w),isTouched:g,mode:l})]})]}):p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"checkbox",id:`${t}-${A}`,name:t,value:e.value,checked:w.includes(e.value),onChange:t=>{v(e.value,t.target.checked)},onFocus:C,onBlur:x,disabled:F||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:b(w),isTouched:g,mode:l})]})})})},S=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]),C=e=>{v(e)},x=()=>{h&&h()},F=()=>{b(!0),u&&u()};e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{n!==g&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const Q=s||i||A?.validation?.readonly;return p.jsx(p.Fragment,{children:p.jsx("div",{className:`form-group radio-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${A?.basic?.inlineLayout?"inline-layout":"vertical-layout"} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"radio",id:`${t}-${A}`,name:t,value:e.value,checked:g===e.value,onChange:()=>C(e.value),onFocus:x,onBlur:F,disabled:Q||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})]}):p.jsxs("div",{className:"input-wrapper",children:[p.jsx("div",{className:"mt-2 "+(A?.basic?.inlineLayout?"inline-options-grid":"space-y-2"),children:(A.options||[]).map((e,A)=>p.jsxs("div",{className:"form-check",children:[p.jsx("input",{type:"radio",id:`${t}-${A}`,name:t,value:e.value,checked:g===e.value,onChange:()=>C(e.value),onFocus:x,onBlur:F,disabled:Q||e.disabled,className:"form-check-input"}),p.jsx("label",{htmlFor:`${t}-${A}`,className:"form-check-label",children:e.label})]},A))}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})})})},E=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState(n),[w,b]=e.useState(!1),y=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),v=e.useCallback(e=>{if(m(e),b(!0),c){const A=y(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,y]),C=()=>{h&&h()},x=()=>{b(!0),u&&u()};e.useEffect(()=>{w&&(a[t]=!0)},[w,t,a]),e.useEffect(()=>{n!==g&&m(n)},[n,g]),e.useEffect(()=>{o&&b(!0)},[o]);const F=()=>A?.basic?.inlineLayout?"inline-layout":"grid-layout",Q=e=>{const t=e?.toLowerCase();return"pass"===t||"yes"===t?"pass":"fail"===t||"no"===t?"fail":"pass"},U=e=>{if(void 0!==e?.icon&&""!==e.icon)return e.icon;return"pass"===Q(e?.value||e)?"✓":"×"},S=(e,t)=>e?.color||e?.backgroundColor?{color:t?"#ffffff":e.color||"#00814b",backgroundColor:t?e.color||"#00814b":e.backgroundColor||"#34bd4914",borderColor:e.color||"#00814b"}:{},E=e=>{if(e?.color||e?.backgroundColor)return"segment-button-label segment-button-custom";return"segment-button-label "+("pass"===Q(e?.value||e)?"pass-button":"fail-button")},N=s||i||A?.validation?.readonly;return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:`form-group segment-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()} ${d}`,children:!f&&A.basic.label?p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsx("div",{className:"form-segment-wrapper",children:p.jsx("div",{className:`form-segment-container ${F()}`,children:(A.options||[]).map((e,A)=>{const r=g===e.value,n=S(e,r),i=E(e),s=U(e);return p.jsxs("div",{className:"form-segment-option "+(r?"selected":""),children:[p.jsx("input",{type:"radio",id:`${t}_option_${A}`,name:t,value:e.value,checked:r,onChange:()=>!N&&!e.disabled&&v(e.value),onFocus:C,onBlur:x,disabled:N||e.disabled,className:"form-segment-radio"}),p.jsxs("label",{htmlFor:`${t}_option_${A}`,className:i,style:Object.keys(n).length>0?n:void 0,children:[s&&p.jsx("span",{className:"segment-icon",children:s}),p.jsx("span",{className:"segment-text",children:e.value})]})]},A)})})})]}):p.jsx("div",{className:"form-segment-wrapper",children:p.jsx("div",{className:`form-segment-container ${F()}`,children:(A.options||[]).map((e,A)=>{const r=g===e.value,n=S(e,r),i=E(e),s=U(e);return p.jsxs("div",{className:"form-segment-option "+(r?"selected":""),children:[p.jsx("input",{type:"radio",id:`${t}_option_${A}`,name:t,value:e.value,checked:r,onChange:()=>!N&&!e.disabled&&v(e.value),onFocus:C,onBlur:x,disabled:N||e.disabled,className:"form-segment-radio"}),p.jsxs("label",{htmlFor:`${t}_option_${A}`,className:i,style:Object.keys(n).length>0?n:void 0,children:[s&&p.jsx("span",{className:"segment-icon",children:s}),p.jsx("span",{className:"segment-text",children:e.value})]})]},A)})})})}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:y(g),isTouched:w,mode:l})]})},N=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const g=e.useCallback(e=>{if(!e)return"";if("string"==typeof e){if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(e))return e;const t=b(e);if(t&&!isNaN(t.getTime())){const e=A.name||"",r=A.basic?.dateTimeMode||("datetime-picker"===e?"datetime":"date");if("datetime"===r){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}if("time"===r){return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}return e}if(e instanceof Date){if(isNaN(e.getTime()))return"";const t=A.name||"",r=A.basic?.dateTimeMode||("datetime-picker"===t?"datetime":"date");if("datetime"===r){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}if("time"===r){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}if("object"==typeof e&&null!==e){if("value"in e&&e.value)return g(e.value);if("date"in e&&e.date)return g(e.date);try{const t=String(e),A=b(t);if(A&&!isNaN(A.getTime()))return g(A)}catch(e){}return""}return""},[A]),m=g(n),[w,y]=e.useState(m),[v,C]=e.useState(!1),[x,F]=e.useState(!1),Q=e.useCallback(e=>{const t={};let r=!0;const n=A.name||"",i=A.basic?.dateTimeMode||("datetime-picker"===n?"datetime":"date"),s=e?String(e).trim():"";if(A?.validation?.required&&(!s||""===s))return t.required=!0,r=!1,{isValid:r,errors:t};if(s&&""!==s)if("time"===i){if(!/^([0-1][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/.test(s))return t.invalidDate=!0,r=!1,{isValid:r,errors:t}}else if("datetime"===i){const e=b(s);if(!e||isNaN(e.getTime()))return t.invalidDate=!0,r=!1,{isValid:r,errors:t};if(A?.validation?.minDate){const n=b(A.validation.minDate);n&&e<n&&(t.minDate=!0,t.minDateMessage=`Date and time must be on or after ${n.toLocaleDateString()}`,r=!1)}if(A?.validation?.maxDate){const n=b(A.validation.maxDate);n&&e>n&&(t.maxDate=!0,t.maxDateMessage=`Date and time must be on or before ${n.toLocaleDateString()}`,r=!1)}}else{const e=b(s);if(!e||isNaN(e.getTime()))return t.invalidDate=!0,r=!1,{isValid:r,errors:t};if(A?.validation?.minDate){const n=b(A.validation.minDate);n&&e<n&&(t.minDate=!0,t.minDateMessage=`Date must be on or after ${n.toLocaleDateString()}`,r=!1)}if(A?.validation?.maxDate){const n=b(A.validation.maxDate);n&&e>n&&(t.maxDate=!0,t.maxDateMessage=`Date must be on or before ${n.toLocaleDateString()}`,r=!1)}}return{isValid:r,errors:t}},[A]),U=e.useCallback(e=>{if(y(e),c){const A=Q(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,Q]);e.useEffect(()=>{v&&(a[t]=!0)},[v,t,a]),e.useEffect(()=>{const e=g(n);e===w||x||y(e)},[n,w,x,g]),e.useEffect(()=>{o&&C(!0)},[o]);const S=s||i||A?.validation?.readonly,E=A.name||"",N=A.basic?.dateTimeMode||("datetime-picker"===E?"datetime":"date"),L=(()=>{switch(N){case"time":return"time";case"datetime":return"datetime-local";default:return"date"}})();return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsx("input",{type:L,id:t,value:w,onChange:e=>{const t=e.target.value;U(t)},onFocus:()=>{F(!0),h&&h()},onBlur:()=>{if(F(!1),C(!0),c){const e=Q(w),A={id:t,value:w,isValid:e.isValid,errors:e.errors};c(A)}u&&u()},disabled:S,readOnly:i||A?.validation?.readonly,min:A?.validation?.minDate,max:A?.validation?.maxDate,className:`form-date ${!Q(w).isValid&&v?"is-invalid":""} ${d}`.trim()}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(w),isTouched:v,mode:l})]})]})},L=({id:t,properties:A,validationErrors:r={},formValue:n="",readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="preview",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const g=e.useRef(null),[m,w]=e.useState(!1),[b,y]=e.useState(!1),[v,C]=e.useState(n),[x,F]=e.useState(!1),Q=e.useCallback(e=>{const t={};let r=!0;return!A?.validation?.required||e&&""!==e.trim()||(t.required=!0,r=!1),{isValid:r,errors:t}},[A]),U=e.useCallback(e=>{if(C(e),c){const A=Q(e),r={id:t,value:e,isValid:A.isValid,errors:A.errors};c(r)}},[t,c,Q]),S=e.useCallback(()=>{const e=document.documentElement.classList.contains("dark")||"dark"===document.documentElement.getAttribute("data-theme");let t=getComputedStyle(document.documentElement).getPropertyValue("--df-color-fb-input-bg").trim();t||(t=e?"#2c2e34":"#ffffff");return{strokeColor:e?"#ffffff":"#000000",backgroundColor:t}},[]),E=e.useCallback(e=>{if(!e)return;const A=g.current;if(!A)return;const r=A.getContext("2d");if(!r)return;const n=new Image;n.onload=()=>{r.clearRect(0,0,A.width,A.height);const e=S();r.fillStyle=e.backgroundColor,r.fillRect(0,0,A.width,A.height);const t=A.width/A.height,i=n.width/n.height;let s=A.width,a=A.height,o=0,l=0;i>t?(a=A.width/i,l=(A.height-a)/2):(s=A.height*i,o=(A.width-s)/2),r.drawImage(n,o,l,s,a)},n.onerror=A=>{console.error("DfFormSignature: error loading image",{id:t,error:A,dataURL:e.substring(0,50)+"..."})},n.src=e},[S,t]),N=e.useCallback(()=>{const e=g.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const A=e.getBoundingClientRect();e.width=A.width,e.height=A.height,e.style.width=A.width+"px",e.style.height=A.height+"px";const r=S();t.strokeStyle=r.strokeColor,t.lineWidth=2,t.lineCap="round",t.lineJoin="round",v?E(v):(t.fillStyle=r.backgroundColor,t.fillRect(0,0,e.width,e.height))},[v,S,E]),L=e.useCallback(()=>{setTimeout(()=>{N()},100)},[N]);e.useEffect(()=>{const e=()=>{L()},t=new MutationObserver(e=>{e.forEach(e=>{if("attributes"===e.type&&"class"===e.attributeName){const t=e.target;t.classList.contains("form-canvas-container")&&(t.classList.contains("mobile-view")||t.classList.contains("tablet-view")||t.classList.contains("desktop-view"))&&L()}})});return t.observe(document.body,{attributes:!0,attributeFilter:["class"],subtree:!0}),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[L]);const _=e.useCallback(e=>{const t=g.current;if(!t)return{x:0,y:0};const A=t.getBoundingClientRect(),r=t.width/A.width,n=t.height/A.height,i=e.type.includes("mouse")?e.clientX:e.touches[0].clientX,s=e.type.includes("mouse")?e.clientY:e.touches[0].clientY;return{x:(i-A.left)*r,y:(s-A.top)*n}},[]),I=e=>{if(i||s||A?.validation?.readonly)return;if(e.target.closest(".clear-signature-btn"))return;e.preventDefault(),e.stopPropagation(),w(!0),y(!0);const t=g.current;if(!t)return;const r=t.getContext("2d");if(!r)return;const{x:n,y:a}=_(e),o=S();r.strokeStyle=o.strokeColor,r.lineWidth=2,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(n,a)},k=e=>{if(!m)return;e.preventDefault(),e.stopPropagation();const t=g.current;if(!t)return;const A=t.getContext("2d");if(!A)return;const{x:r,y:n}=_(e);A.lineTo(r,n),A.stroke()},T=()=>{if(!m)return;w(!1),F(!0);const e=g.current;if(e){(e=>{const t=e.getContext("2d");if(!t)return!1;const A=t.getImageData(0,0,e.width,e.height).data;for(let e=0;e<A.length;e+=4){const t=A[e],r=A[e+1],n=A[e+2];if(A[e+3]>0&&(t<255||r<255||n<255))return!0}})(e);const t=e.toDataURL("image/png");C(t),U(t),setTimeout(()=>{F(!1)},100)}else F(!1)},H=e.useCallback(()=>{const e=g.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const A=S();if(t.strokeStyle=A.strokeColor,v){const r=v,n=e.getBoundingClientRect();t.fillStyle=A.backgroundColor,t.fillRect(0,0,n.width,n.height),r&&E(r)}else{const r=e.getBoundingClientRect();t.fillStyle=A.backgroundColor,t.fillRect(0,0,r.width,r.height)}},[S,v,E]);e.useEffect(()=>{const e=new MutationObserver(e=>{e.forEach(e=>{"attributes"!==e.type||"class"!==e.attributeName&&"data-theme"!==e.attributeName||H()})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>{e.disconnect()}},[H]);e.useEffect(()=>{b&&(a[t]=!0)},[b,t,a]),e.useEffect(()=>{if(!(n===v||m||x||""!==v&&""===n)){if(n===v)return;C(n),n&&E(n)}},[n,v,m,x]),e.useEffect(()=>{o&&y(!0)},[o]),e.useEffect(()=>{if("test"!==l){C("");const e=g.current;if(e){const t=e.getContext("2d");if(t){const A=e.getBoundingClientRect();e.width=A.width,e.height=A.height;const r=S();t.fillStyle=r.backgroundColor,t.fillRect(0,0,A.width,A.height)}}}},[l]),e.useEffect(()=>{N()},[l]);const O=s||i||A?.validation?.readonly;return p.jsxs("div",{className:`form-group ${(()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"})()}`,children:[!f&&A.basic.label&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic.label,A.validation.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"input-wrapper",children:[p.jsxs("div",{className:"signature-container",style:{position:"relative",width:"100%",maxWidth:"100%",overflow:"hidden"},children:[p.jsx("canvas",{ref:g,id:t,className:`form-signature ${!Q(v).isValid&&b?"is-invalid":""} ${d}`.trim(),onMouseDown:I,onMouseMove:k,onMouseUp:T,onMouseLeave:T,onTouchStart:I,onTouchMove:k,onTouchEnd:T,onFocus:()=>{h&&h()},onBlur:()=>{u&&u()},style:{width:"100%",height:"150px",border:"2px solid var(--df-color-primary-border)",borderRadius:"6px",cursor:O?"not-allowed":"crosshair",backgroundColor:"var(--df-color-fb-input-bg)",touchAction:"none",userSelect:"none"}}),!O&&p.jsx("button",{type:"button",onClick:e=>(e=>{e?.preventDefault(),e?.stopPropagation();const t=g.current;if(!t)return;const A=t.getBoundingClientRect();t.width=A.width,t.height=A.height;const r=t.getContext("2d");if(!r)return;const n=S();r.fillStyle=n.backgroundColor,r.fillRect(0,0,A.width,A.height),r.strokeStyle=n.strokeColor,r.lineWidth=2,r.lineCap="round",r.lineJoin="round",C(""),U("")})(e),className:"clear-signature-btn",style:{position:"absolute",bottom:"8px",right:"8px",padding:"4px 8px",backgroundColor:"var(--df-color-error-primary)",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"0.75rem",fontWeight:"500",zIndex:10,transition:"all 0.2s ease",minWidth:"60px",minHeight:"28px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--df-color-error-dark, #dc2626)",e.currentTarget.style.transform="scale(1.05)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--df-color-error-primary)",e.currentTarget.style.transform="scale(1)"},children:"Clear"})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(v),isTouched:b,mode:l})]})]})},_=({id:t,properties:A,validationErrors:r={},formValue:n=null,readonly:i=!1,disabled:s=!1,touchedFields:a={},formSubmitted:o=!1,mode:l="test",onValueChange:c,onBlur:u,onFocus:h,className:d="",hideLabel:f=!1})=>{const[g,m]=e.useState([]),[b,y]=e.useState(!1),[v,C]=e.useState(!1),x=e.useRef(null),F=e.useCallback((e,A=0)=>{if(!e)return[];const r="string"==typeof e?[e]:e,n=Array.isArray(r)?r:Array.from(r),i=[];return n.forEach(e=>{let r,n,s=0,a="",o="";if(e instanceof File||e instanceof Blob){const t=e;if(s=t.size||0,a=t.type||"",o=t.name||`file-${A+i.length}`,n=t,a.startsWith("image/"))try{r=URL.createObjectURL(t)}catch(e){console.error("Error creating object URL:",e),r=void 0}}else if("string"==typeof e){const t=e;if(o=`file-${A+i.length}`,t.startsWith("data:")){const e=t.indexOf(";");a=e>5?t.substring(5,e):"application/octet-stream"}else{const e=t.match(/\.(jpg|jpeg|png|gif|webp|svg|pdf|doc|docx|xls|xlsx|zip|rar)$/i);if(e){a={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",zip:"application/zip",rar:"application/x-rar-compressed"}[e[1].toLowerCase()]||"application/octet-stream"}else a="application/octet-stream"}(t.startsWith("data:image")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:"))&&(r=t),n=t}else{if(!e||"object"!=typeof e)return;{const t=e;if(o=t.name||t.fileName||`file-${A+i.length}`,s=t.size||t.fileSize||0,a=t.type||t.fileType||t.mimeType||"",t.url||t.path)r=t.url||t.path;else if(a.startsWith("image/")&&t.data){const e=t.data;r="string"==typeof e?e.startsWith("data:")?e:`data:${a};base64,${e}`:void 0}n=t}}i.push({file:n,id:`${t}-file-${A+i.length}`,size:s,type:a,name:o,preview:r})}),i},[t]),Q=e.useCallback(()=>({isValid:!0,errors:{}}),[]),U=e.useCallback(e=>{if(i||s)return;const r=A?.validation?.multiple||!1,n=A?.validation?.maxFiles||1/0,a=F(e,g.length).filter(e=>{const t=g.some(t=>t.name===e.name&&t.size===e.size);return t&&w.showWarning(`File '${e.name}' already exists`),!t});let o;o=r||1!==A?.validation?.maxFiles?[...g,...a]:F(e,0);const l=o.slice(0,n);if(m(l),C(!0),c){const e=Q(),A={id:t,value:l.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(A)}},[g,A,i,s,c,Q,F,t]),S=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},E=e=>e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎥":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("word")||e.includes("document")?"📝":e.includes("excel")||e.includes("spreadsheet")?"📊":e.includes("zip")||e.includes("rar")?"📦":"📁";e.useEffect(()=>{v&&(a[t]=!0)},[v,t,a]),e.useEffect(()=>{("edit"===l||"test"===l)&&C(!1)},[l]),e.useEffect(()=>{const e=F(n);m(e)},[n,F]),e.useEffect(()=>{o&&C(!0)},[o]),e.useEffect(()=>()=>{g.forEach(e=>{if(e.preview&&e.preview.startsWith("blob:"))try{URL.revokeObjectURL(e.preview)}catch(e){console.error("Error revoking object URL:",e)}})},[g]);const N=()=>{const e=A?.styles?.labelAlignment;return"left"===e?"label-left":"label-top"},L=s||i||A?.validation?.readonly,_=A?.validation?.multiple||!1,I=A?.validation?.accept||"*/*",k=A?.validation?.maxFiles||1/0,T=g.length<k&&(_||k>1),H="edit"===l,O="preview"===l||"test"===l,P=g.filter(e=>e.type.startsWith("image/")),D=g.filter(e=>!e.type.startsWith("image/")),M=P.length>0;return O&&M?p.jsxs("div",{className:`form-group ${N()}`,children:[!f&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic?.label,A.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"file-upload-wrapper",children:[p.jsxs("div",{className:"file-image-display "+(A.basic?.horizontalView?"horizontal-view":"vertical-view"),children:[P.map(e=>p.jsxs("div",{className:"file-image-container",children:[e.preview&&p.jsx("img",{src:e.preview,alt:e.name,className:"file-image-preview"}),p.jsxs("div",{className:"file-image-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:S(e.size)})]})]},e.id)),D.length>0&&p.jsxs("div",{className:"file-other-files",children:[p.jsx("div",{className:"file-other-files-label",children:"Other Files:"}),D.map(e=>p.jsxs("div",{className:"file-item-minimal",children:[p.jsx("div",{className:"file-icon",children:E(e.type)}),p.jsxs("div",{className:"file-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:S(e.size)})]})]},e.id))]})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(),isTouched:v,mode:l})]})]}):p.jsxs("div",{className:`form-group ${N()}`,children:[!f&&p.jsxs("label",{htmlFor:t,className:"form-label",children:[A.basic?.label,A.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),p.jsxs("div",{className:"file-upload-wrapper",children:[p.jsxs("div",{className:`file-upload-area ${b?"drag-over":""} ${i?"readonly":""} ${s?"disabled":""} ${d}`.trim(),onDragOver:e=>{e.stopPropagation(),(e=>{e.preventDefault(),i||s||y(!0)})(e)},onDragLeave:e=>{e.stopPropagation(),(e=>{e.preventDefault(),y(!1)})(e)},onDrop:e=>{e.stopPropagation(),(e=>{if(e.preventDefault(),y(!1),i||s)return;const t=e.dataTransfer.files;t.length>0&&U(t)})(e)},onClick:e=>{e.stopPropagation();const t=e.target,A=null!==t.closest(".file-item"),r=null!==t.closest(".file-remove");!H||L||0!==g.length||A||r||x.current?.click()},onFocus:e=>{e.stopPropagation(),h&&h()},onBlur:e=>{e.stopPropagation(),(()=>{if(C(!0),"test"===l&&c){const e=Q(),A={id:t,value:g.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(A)}u&&u()})()},tabIndex:L?-1:0,children:[p.jsx("input",{ref:x,type:"file",id:t,multiple:_,accept:I,onChange:e=>{const t=e.target.files;t&&t.length>0&&(U(t),e.target.value="")},disabled:L,style:{display:"none"}}),0===g.length?p.jsxs("div",{className:"upload-placeholder",onClick:e=>{e.stopPropagation(),H&&!L&&x.current?.click()},children:[p.jsx("div",{className:"upload-icon",children:"📁"}),p.jsx("div",{className:"upload-text",children:A.basic.placeholder&&p.jsx("p",{className:"upload-hint",children:A.basic.placeholder})})]}):p.jsx("div",{className:"file-list "+(A.basic?.horizontalView?"horizontal-view":"vertical-view"),children:g.map(e=>p.jsxs("div",{className:"file-item",children:[p.jsx("div",{className:"file-preview",children:e.preview?p.jsx("img",{src:e.preview,alt:e.name,className:"file-image"}):p.jsx("div",{className:"file-icon",children:E(e.type)})}),p.jsxs("div",{className:"file-info",children:[p.jsx("div",{className:"file-name",title:e.name,children:e.name}),p.jsx("div",{className:"file-size",children:S(e.size)})]}),H&&!L&&p.jsx("button",{type:"button",className:"file-remove",onClick:A=>{A.stopPropagation(),(e=>{if(i||s)return;const A=g.filter(t=>t.id!==e);if(m(A),C(!0),c){const e=Q(),r={id:t,value:A.map(e=>e.file),isValid:e.isValid,errors:e.errors};c(r)}})(e.id)},"aria-label":`Remove ${e.name}`,children:"✕"})]},e.id))})]}),g.length>0&&T&&!L&&H&&p.jsxs("button",{type:"button",className:"file-add-more",onClick:e=>{e.stopPropagation(),!L&&x.current&&H&&(x.current.value="",x.current.click())},"aria-label":"Add more files",children:[p.jsx("svg",{className:"file-add-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M12 5v14M5 12h14"})}),p.jsx("span",{className:"file-add-text",children:"Add More Files"})]}),p.jsx(B,{validationErrors:r,fieldId:t,touchedFields:a,formSubmitted:o,properties:A,localValidation:Q(),isTouched:v,mode:l})]})]})},I=({id:A,properties:r,validationErrors:n={},formValue:i=null,readonly:s=!1,disabled:a=!1,touchedFields:o={},formSubmitted:l=!1,mode:c="test",onValueChange:u,onBlur:h,onFocus:d,className:f="",hideLabel:g=!1})=>{const[m,w]=e.useState(i),[y,v]=e.useState(!1),[C,x]=e.useState(""),[F,Q]=e.useState(!1),[U,S]=e.useState(!1),[E,N]=e.useState({lat:40.7128,lng:-74.006}),[L,_]=e.useState(null),[I,k]=e.useState(10),[T,H]=e.useState(""),[O,P]=e.useState(!1),D=e.useRef(null),[M,j]=e.useState(!1),[R,V]=e.useState(null),[K,z]=e.useState(!1);e.useEffect(()=>{if(i&&i.latitude&&i.longitude){40.7128===i.latitude&&-74.006===i.longitude||(w(i),_({lat:i.latitude,lng:i.longitude,isCurrentLocation:!1}),N({lat:i.latitude,lng:i.longitude}))}else null==i&&(w(null),_(null))},[i]),e.useEffect(()=>{U&&40.7128===E.lat&&E.lng},[U,E]),e.useEffect(()=>{(s||a)&&(U&&S(!1),T&&H(""),M&&(j(!1),V(null)))},[s,a]);const G=e.useCallback(async(e,t)=>{z(!0);try{const A=await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&addressdetails=1&zoom=18`),r=await A.json();if(r&&r.address){const e=r.address;return{placeName:r.display_name||"",city:e.city||e.town||e.village||e.municipality||"",country:e.country||""}}}catch(e){console.error("Reverse geocoding failed:",e)}finally{z(!1)}return{placeName:"",city:"",country:""}},[]),q=e.useCallback(async(e,t,r)=>{const n=await G(e,t),i={latitude:e,longitude:t,timestamp:Date.now(),placeName:n.placeName,city:n.city,country:n.country,address:n.placeName,...r};if(w(i),_({lat:e,lng:t,isCurrentLocation:!1}),Q(!0),u){u({id:A,value:i,isValid:!0,errors:{}})}},[G,A,u]),W=e.useCallback(async()=>{if(s||a)return;v(!0),x("");if(void 0!==window.Capacitor)try{const{Geolocation:e}=window.Capacitor.Plugins;if(e)try{if("granted"!==(await e.requestPermissions()).location)return v(!1),void x("Location permission is required. Please enable location access in your device settings.");const t=await e.getCurrentPosition({enableHighAccuracy:r.validation?.enableHighAccuracy??!0,timeout:r.validation?.timeout??1e4,maximumAge:r.validation?.maximumAge??3e5}),A=t.coords.latitude,n=t.coords.longitude;return _({lat:A,lng:n,isCurrentLocation:!0}),N({lat:A,lng:n}),Q(!0),await q(A,n,{accuracy:t.coords.accuracy,timestamp:Date.now()}),v(!1),void x("")}catch(e){return v(!1),void(e.message?.includes("permission")||e.message?.includes("denied")?x("Location permission is required. Please enable location access in your device settings."):e.message?.includes("timeout")?x("Location request timed out. Please try again."):x("Unable to retrieve your location. Please try again."))}}catch(e){console.warn("Capacitor Geolocation not available, falling back to web geolocation")}if(!navigator.geolocation)return v(!1),void x("Geolocation is not supported by this browser.");const e={enableHighAccuracy:r.validation?.enableHighAccuracy??!0,timeout:r.validation?.timeout??1e4,maximumAge:r.validation?.maximumAge??3e5};navigator.geolocation.getCurrentPosition(async e=>{const t=e.coords.latitude,A=e.coords.longitude;_({lat:t,lng:A,isCurrentLocation:!0}),N({lat:t,lng:A}),Q(!0),await q(t,A,{accuracy:e.coords.accuracy,timestamp:e.timestamp}),v(!1),x("")},e=>{v(!1);let t="Unable to retrieve your location.";switch(e.code){case e.PERMISSION_DENIED:t="Location access denied by user. Please enable location access in your browser/device settings.";break;case e.POSITION_UNAVAILABLE:t="Location information is unavailable.";break;case e.TIMEOUT:t="Location request timed out. Please try again."}x(t)},e)},[s,a,r,q]),X=e.useCallback(()=>{if(!s&&!a&&(w(null),_(null),x(""),Q(!0),u)){u({id:A,value:null,isValid:!0,errors:{}})}},[s,a,A,u]),Y=e.useCallback(()=>{s||a||S(!U)},[s,a,U]),J=e.useCallback((e,t,A,r,n,i)=>{const s=e-n/2,a=t-i/2,o=156543.03392*Math.cos(A.lat*Math.PI/180)/Math.pow(2,r),l=s*o,c=a*o;return{lat:A.lat+c/111320,lng:A.lng+l/(111320*Math.cos(A.lat*Math.PI/180))}},[]),$=e.useCallback(e=>{s||a||!D.current||0===e.button&&(j(!0),V({x:e.clientX,y:e.clientY}),e.preventDefault())},[s,a]),Z=e.useCallback(e=>{if(!M||!R||!D.current)return;const t=e.clientX-R.x,A=e.clientY-R.y,r=156543.03392*Math.cos(E.lat*Math.PI/180)/Math.pow(2,I),n=-A*r/111320,i=t*r/(111320*Math.cos(E.lat*Math.PI/180));N({lat:E.lat+n,lng:E.lng+i}),V({x:e.clientX,y:e.clientY})},[M,R,E,I]),ee=e.useCallback(async e=>{if(!D.current)return;if(M&&R){const t=Math.abs(e.clientX-R.x),A=Math.abs(e.clientY-R.y);if(t>5||A>5)return j(!1),void V(null)}if(s||a)return j(!1),void V(null);const t=D.current.getBoundingClientRect(),A=e.clientX-t.left,r=e.clientY-t.top,{lat:n,lng:i}=J(A,r,E,I,t.width,t.height);await q(n,i),j(!1),V(null)},[s,a,D,E,I,J,q,M,R]),te=e.useCallback(async e=>{if(e.trim()&&!s&&!a){P(!0),x("");try{const t=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(e)}&limit=5&addressdetails=1`),r=await t.json();if(r&&r.length>0){const e=r[0],t=parseFloat(e.lat),n=parseFloat(e.lon),i=e.address||{},s={latitude:t,longitude:n,address:e.display_name,placeName:e.display_name,city:i.city||i.town||i.village||i.municipality||"",country:i.country||"",timestamp:Date.now()};if(w(s),_({lat:t,lng:n,isCurrentLocation:!1}),N({lat:t,lng:n}),Q(!0),u){u({id:A,value:s,isValid:!0,errors:{}})}}else x("No locations found for your search.")}catch(e){x("Failed to search for location. Please try again.")}finally{P(!1)}}},[s,a,A,u]),Ae=()=>{d&&d()},re=()=>{Q(!0),h&&h()},ne=a||s||r?.validation?.readonly,ie=r?.basic?.label||"Location",se=r?.basic?.description||"";return p.jsxs("div",{className:`form-group ${r.basic?.horizontalView?"horizontal-view":"vertical-view"} ${g?"no-label":""} ${f}`,children:[!g&&p.jsxs("label",{htmlFor:A,className:"form-label",children:[ie,r?.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]}),se&&p.jsx("div",{className:"form-group-description",children:se}),p.jsxs("div",{className:"location-wrapper",children:[!(s&&m)&&p.jsxs("div",{className:"location-controls",children:[p.jsx("button",{type:"button",className:"location-btn "+(y?"loading":""),onClick:W,disabled:ne||y,onFocus:Ae,onBlur:re,tabIndex:ne?-1:0,children:y?p.jsxs(p.Fragment,{children:[p.jsx(t.Loader2,{size:16,className:"loading-spinner"}),"Getting Location..."]}):p.jsxs(p.Fragment,{children:[p.jsx(t.Navigation,{size:16}),"Get Current Location"]})}),p.jsxs("button",{type:"button",className:"location-btn secondary",onClick:Y,disabled:ne,onFocus:Ae,onBlur:re,tabIndex:ne?-1:0,children:[p.jsx(t.MapPin,{size:16}),U?"Hide Map":"Choose on Map"]})]}),m&&p.jsxs("div",{className:"location-display",children:[!s&&p.jsx("button",{type:"button",className:"location-clear-btn",onClick:X,disabled:ne,title:"Clear location",children:p.jsx(t.X,{size:16})}),m.placeName&&p.jsxs("div",{className:"location-place-name",children:[p.jsx("strong",{children:"Place:"})," ",m.placeName]}),(m.city||m.country)&&p.jsxs("div",{className:"location-address",children:[p.jsx("strong",{children:"Address:"})," ",[m.city,m.country].filter(Boolean).join(", ")]}),p.jsxs("div",{className:"location-coordinates",children:[p.jsx("strong",{children:"Coordinates:"})," ",(oe=m.latitude,le=m.longitude,void 0===oe||void 0===le||isNaN(oe)||isNaN(le)?"":`${Number(oe).toFixed(6)}, ${Number(le).toFixed(6)}`)]}),m.accuracy&&p.jsxs("div",{className:"location-accuracy",children:[p.jsx("strong",{children:"Accuracy:"})," ",(ae=m.accuracy,ae?`±${Math.round(ae)}m`:"")]}),m.timestamp&&p.jsxs("div",{className:"location-timestamp",children:[p.jsx("strong",{children:"Captured:"})," ",(b(m.timestamp)||new Date).toLocaleString()]})]}),U&&!s&&p.jsxs("div",{className:"location-map-container",children:[p.jsxs("div",{className:"location-map-header",children:[p.jsx("h4",{children:"Select Location on Map"}),p.jsx("p",{children:"Search for a place or click on the map to select a location"})]}),p.jsx("div",{className:"location-search",children:p.jsx("form",{onSubmit:e=>{e.preventDefault(),T.trim()&&te(T)},className:"search-form",children:p.jsxs("div",{className:"search-input-group",children:[p.jsx("input",{type:"text",value:T,onChange:e=>{H(e.target.value)},placeholder:"Search for a place (e.g., New York, Paris, Tokyo)",className:"search-input",disabled:ne||O}),p.jsx("button",{type:"submit",className:"search-btn",disabled:ne||O||!T.trim(),children:O?p.jsx(t.Loader2,{size:16,className:"loading-spinner"}):"Search"})]})})}),p.jsxs("div",{ref:D,className:"location-map "+(M?"dragging":""),onMouseDown:$,onMouseMove:Z,onMouseUp:ee,onMouseLeave:()=>{j(!1),V(null)},style:{position:"relative",height:"400px",border:"2px solid var(--df-color-fb-border)",borderRadius:"8px",overflow:"hidden",cursor:M?"grabbing":"grab",background:`url(https://tile.openstreetmap.org/${I}/${Math.floor((E.lng+180)/360*Math.pow(2,I))}/${Math.floor((1-Math.log(Math.tan(E.lat*Math.PI/180)+1/Math.cos(E.lat*Math.PI/180))/Math.PI)/2*Math.pow(2,I))}.png) center/cover no-repeat`,userSelect:"none"},children:[L&&p.jsx("div",{className:"map-marker "+(L.isCurrentLocation?"current-location":"selected-location"),style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -100%)",zIndex:10},children:p.jsx(t.MapPin,{size:24})}),p.jsx("div",{className:"map-center-indicator",style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"4px",height:"4px",backgroundColor:"var(--df-color-primary)",borderRadius:"50%",zIndex:5}}),p.jsxs("div",{className:"map-controls",children:[p.jsx("button",{type:"button",className:"map-zoom-btn",onClick:()=>k(e=>Math.min(18,e+1)),disabled:I>=18,children:"+"}),p.jsx("button",{type:"button",className:"map-zoom-btn",onClick:()=>k(e=>Math.max(1,e-1)),disabled:I<=1,children:"−"})]})]}),p.jsxs("div",{className:"location-map-instructions",children:[p.jsx("p",{children:p.jsx("strong",{children:"Instructions:"})}),p.jsxs("ul",{children:[p.jsx("li",{children:"Search for a place using the search box above"}),p.jsx("li",{children:"Click anywhere on the map to select a location"}),p.jsx("li",{children:"Drag the map to pan around"}),p.jsx("li",{children:"Use the zoom buttons (+/−) to zoom in/out"}),p.jsx("li",{children:'Use "Get Current Location" to automatically detect your position'})]})]}),K&&p.jsxs("div",{className:"location-loading",children:[p.jsx(t.Loader2,{size:16,className:"loading-spinner"}),p.jsx("span",{children:"Loading address details..."})]})]}),C&&p.jsx("div",{className:"location-error",children:C})]}),p.jsx(B,{validationErrors:n,fieldId:A,touchedFields:o,formSubmitted:l,properties:r,localValidation:{isValid:!0,errors:{}},isTouched:F,mode:c})]});var ae,oe,le},k=({id:e,properties:t,className:A="",hideLabel:r=!1})=>{const n=t.styles?.level??t.basic.level??1,i=t.basic.label,s=()=>{const e={};return t?.styles?.fontSize&&(e.fontSize=t.styles.fontSize),t?.styles?.color&&(e.color=t.styles.color),e};return r?null:(()=>{const r={id:e,className:`form-heading h${n} ${t?.styles?.textAlign?`text-${t.styles.textAlign}`:""} ${A}`.trim(),style:s()};switch(n){case 1:default:return p.jsx("h1",{...r,children:i});case 2:return p.jsx("h2",{...r,children:i});case 3:return p.jsx("h3",{...r,children:i});case 4:return p.jsx("h4",{...r,children:i});case 5:return p.jsx("h5",{...r,children:i});case 6:return p.jsx("h6",{...r,children:i})}})()},T=({id:A,properties:r,mode:n="preview",formValue:i,onValueChange:s,className:a="",hideLabel:o=!1})=>{const[l,c]=e.useState(""),[u,h]=e.useState(r.validation?.listStyle||"numbers"),[d,f]=e.useState("#000000"),g=e.useRef(null),m=e.useRef(null),w=e.useRef(!1),B="edit"===n,b=e.useRef({instructions:[],listStyle:"numbers",formValue:void 0}),y=e.useRef(n);e.useEffect(()=>{let e=[],t="numbers";if(null!=i&&("object"==typeof i&&i.instructions?(Array.isArray(i.instructions)?e=i.instructions:"string"==typeof i.instructions&&(e=[i.instructions]),i.listStyle&&(t=i.listStyle)):Array.isArray(i)?e=i:"string"==typeof i&&(e=[i])),0===e.length&&r.basic?.value){const A=r.basic.value;A&&"object"==typeof A&&!Array.isArray(A)&&A.instructions?(Array.isArray(A.instructions)?e=A.instructions:"string"==typeof A.instructions&&(e=[A.instructions]),A.listStyle&&"string"==typeof A.listStyle&&(t=A.listStyle)):Array.isArray(A)?e=A:"string"==typeof A&&(e=[A])}0===e.length&&r.basic?.instructions&&(Array.isArray(r.basic.instructions)?e=r.basic.instructions:"string"==typeof r.basic.instructions&&(e=[r.basic.instructions])),t&&"numbers"!==t||(t=r.validation?.listStyle||r.basic?.value?.listStyle||"numbers");const A=JSON.stringify(e)!==JSON.stringify(b.current.instructions)||t!==b.current.listStyle,s=n!==y.current,a=JSON.stringify(i)!==JSON.stringify(b.current.formValue),o=!b.current.formValue||Array.isArray(b.current.formValue)&&0===b.current.formValue.length||"string"==typeof b.current.formValue&&""===b.current.formValue.trim(),l=null!=i&&(Array.isArray(i)&&i.length>0||"string"==typeof i&&""!==i.trim()||"object"==typeof i&&Object.keys(i).length>0);if(A||s||a||o&&l){const r=e=>"string"!=typeof e?e:e.replace(/\\u([0-9a-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16))),a=e.map(e=>"string"==typeof e?r(e):e),o=a.some(e=>"string"==typeof e&&/<[^>]+>/.test(e));let l="";if(a.length>0)if(o)l=a.join("");else{const e="numbers"===t?"ol":"bullets"===t?"ul":"div",A=a.filter(e=>e&&"string"==typeof e).map(e=>`<li>${e.replace(/\n/g,"<br>")}</li>`).join("");l="div"===e?a.filter(e=>e&&"string"==typeof e).map(e=>`<div>${e.replace(/\n/g,"<br>")}</div>`).join(""):`<${e}>${A}</${e}>`}h(t),c(l),B&&g.current&&(s||A&&g.current.innerHTML.trim()!==l.trim())&&(g.current.innerHTML=l),b.current={instructions:e,listStyle:t,formValue:i},y.current=n}},[i,r.basic?.instructions,r.validation?.listStyle,n,B]),e.useEffect(()=>{if(B&&g.current){const e=g.current.innerHTML.trim();l.trim()===e||w.current||(g.current.innerHTML=l)}if(w.current){const e=setTimeout(()=>{w.current=!1},200);return()=>clearTimeout(e)}},[l,B]);const v=e.useCallback(()=>{if(!g.current)return;w.current=!0;const e=g.current.innerHTML.trim();if(s){s({id:A,value:{instructions:e?[e]:[],listStyle:u},isValid:!0,errors:{}})}e!==l&&c(e)},[A,u,s,l]),C=e.useCallback(()=>{if(!g.current)return;const e=g.current.innerHTML.trim();if(s){s({id:A,value:{instructions:e?[e]:[],listStyle:u},isValid:!0,errors:{}})}c(e),w.current=!1},[A,u,s]),x=e.useCallback((e,t)=>{document.execCommand(e,!1,t),g.current?.focus(),v()},[v]),F=e.useCallback(()=>{x("bold")},[x]),Q=e.useCallback(()=>{x("italic")},[x]),U=e.useCallback(e=>{const t=e.target.value;f(t),x("foreColor",t)},[x]),S=e.useCallback(e=>{if(h(e),!g.current)return;const t=window.getSelection(),r=t&&t.rangeCount>0?t.getRangeAt(0):null;let n=g.current.innerHTML;if("numbers"===e){if(n=n.replace(/<ul>/gi,"<ol>").replace(/<\/ul>/gi,"</ol>"),!n.includes("<ol>")&&!n.includes("<ul>")){const e=n.split(/<br\s*\/?>/i).filter(e=>e.trim());e.length>0&&(n="<ol>"+e.map(e=>`<li>${e}</li>`).join("")+"</ol>")}}else if("bullets"===e){if(n=n.replace(/<ol>/gi,"<ul>").replace(/<\/ol>/gi,"</ul>"),!n.includes("<ol>")&&!n.includes("<ul>")){const e=n.split(/<br\s*\/?>/i).filter(e=>e.trim());e.length>0&&(n="<ul>"+e.map(e=>`<li>${e}</li>`).join("")+"</ul>")}}else n=n.replace(/<\/?[ou]l>/gi,"").replace(/<li>/gi,"<div>").replace(/<\/li>/gi,"</div>");if(g.current.innerHTML=n,c(n),r&&t)try{t.removeAllRanges(),t.addRange(r)}catch(e){}if(v(),s){s({id:A,value:{instructions:n?[n]:[],listStyle:e},isValid:!0,errors:{}})}},[A,v,s]),E=e.useCallback(e=>{const t=e.target.files?.[0];if(!t||!t.type.startsWith("image/"))return;const A=new FileReader;A.onload=e=>{const t=e.target?.result;if(t&&g.current){const e=document.createElement("img");e.src=t,e.style.maxWidth="100%",e.style.height="auto";const A=window.getSelection();if(A&&A.rangeCount>0){const t=A.getRangeAt(0);t.deleteContents(),t.insertNode(e)}else g.current.appendChild(e);v()}},A.readAsDataURL(t),m.current&&(m.current.value="")},[v]),N=e.useCallback(e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),A=window.getSelection();if(A&&A.rangeCount>0){const e=A.getRangeAt(0);e.deleteContents();const r=document.createTextNode(t);e.insertNode(r),e.setStartAfter(r),e.collapse(!0),A.removeAllRanges(),A.addRange(e)}v()},[v]),L=e.useCallback(e=>document.queryCommandState(e),[]);return p.jsxs("div",{className:`form-group instruction-group ${a}`,children:[!o&&p.jsx("label",{htmlFor:A,className:"instruction-label",children:"Instructions"}),B?p.jsxs("div",{className:"instruction-rich-editor",children:[p.jsxs("div",{className:"instruction-toolbar",children:[p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn "+(L("bold")?"active":""),onClick:F,title:"Bold","aria-label":"Bold",children:p.jsx(t.Bold,{size:16})}),p.jsx("button",{type:"button",className:"toolbar-btn "+(L("italic")?"active":""),onClick:Q,title:"Italic","aria-label":"Italic",children:p.jsx(t.Italic,{size:16})})]}),p.jsx("div",{className:"toolbar-separator"}),p.jsx("div",{className:"toolbar-group",children:p.jsxs("div",{className:"color-picker-wrapper",children:[p.jsx("input",{type:"color",value:d,onChange:U,className:"color-picker-input",title:"Text Color"}),p.jsx("label",{className:"color-picker-label",title:"Text Color",children:p.jsx("span",{style:{color:d},children:"A"})})]})}),p.jsx("div",{className:"toolbar-separator"}),p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn "+("bullets"===u?"active":""),onClick:()=>S("bullets"),title:"Bullet List","aria-label":"Bullet List",children:p.jsx(t.List,{size:16})}),p.jsx("button",{type:"button",className:"toolbar-btn "+("numbers"===u?"active":""),onClick:()=>S("numbers"),title:"Numbered List","aria-label":"Numbered List",children:p.jsx(t.ListOrdered,{size:16})})]}),p.jsx("div",{className:"toolbar-separator"}),p.jsxs("div",{className:"toolbar-group",children:[p.jsx("button",{type:"button",className:"toolbar-btn",onClick:()=>m.current?.click(),title:"Insert Image","aria-label":"Insert Image",children:p.jsx(t.Image,{size:16})}),p.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:E,style:{display:"none"}})]})]}),p.jsx("div",{ref:g,contentEditable:!0,className:"instruction-editor-content",onInput:v,onBlur:C,onPaste:N,"data-placeholder":"Enter instructions (press Enter for a new line)...",suppressContentEditableWarning:!0})]}):p.jsx("div",{className:"instruction-preview-wrapper "+("numbers"===u?"instruction-list-numbers":"bullets"===u?"instruction-list-bullets":""),children:l?p.jsx("div",{className:"instruction-preview-content",dangerouslySetInnerHTML:{__html:l}}):p.jsx("div",{className:"instruction-empty",children:p.jsx("p",{children:"No instructions provided"})})})]})},H=({attachments:A,onRemove:r})=>{const[n,i]=e.useState(new Map);return e.useEffect(()=>{if(!A)return void i(e=>(e.forEach(e=>URL.revokeObjectURL(e)),new Map));const e=new Map;return A.forEach((t,A)=>{if((t instanceof Blob||"undefined"!=typeof File&&t instanceof File)&&t&&t.type&&"string"==typeof t.type&&t.type.startsWith("image/"))try{const r=URL.createObjectURL(t);e.set(A,r)}catch(e){console.warn("Failed to create object URL for attachment:",e)}else t&&t.url&&t.type&&t.type.startsWith("image/")&&e.set(A,t.url)}),i(t=>(t.forEach((t,A)=>{e.has(A)||URL.revokeObjectURL(t)}),e)),()=>{e.forEach(e=>URL.revokeObjectURL(e))}},[A]),A&&0!==A.length?p.jsx("div",{className:"attachment-thumbnails-container",children:A.map((e,A)=>{const i=e&&e.type&&"string"==typeof e.type&&e.type.startsWith("image/"),s=n.get(A);return p.jsx("div",{className:"attachment-thumbnail",children:i&&s?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:s,alt:e?e.name:"Attachment"}),p.jsx("button",{type:"button",className:"thumbnail-remove-btn",onClick:()=>r(A),title:"Remove attachment",children:p.jsx(t.X,{size:14})})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"file-icon-placeholder",children:p.jsx(t.Paperclip,{size:20})}),p.jsx("span",{className:"file-name",children:e?e.name:"Unknown File"}),p.jsx("button",{type:"button",className:"thumbnail-remove-btn",onClick:()=>r(A),title:"Remove attachment",children:p.jsx(t.X,{size:14})})]})},A)})}):null},O=({component:A,mode:r,formTemplateId:n,formValue:i,formData:s,onNotesChange:a,onAttachmentChange:o,notes:l="",attachments:c=null,onThresholdActionCompletion:u,onThresholdIssueRaised:h,onBasicPropertyActionCompletion:d,workOrderNumber:f,assetNumber:g,isStandalone:m,user:w,onCreateIssue:B,onUpdateIssue:b})=>{const y=void 0!==i?i:s?s[A.id]:void 0,[C,x]=e.useState(l||""),[F,Q]=e.useState(c||null),[U,S]=e.useState(!1),[E,N]=e.useState(!1),[L,_]=e.useState(!1),[I,k]=e.useState(!1),[T,O]=e.useState(null),[P,D]=e.useState(!1),M=e.useRef(null),j=e.useRef(y),R=e.useRef(!1),V=e.useRef(!1);e.useEffect(()=>{l&&l!==C&&!R.current&&(x(l),R.current=!0)},[l,C]),e.useEffect(()=>{c&&c!==F&&!V.current&&(Q(c),V.current=!0)},[c,F]),e.useEffect(()=>{if(R.current&&!U&&null!=l){const e="string"==typeof l?l:String(l||"");C&&""!==String(C||"").trim()||!e||""===e.trim()?e&&""!==e.trim()&&e!==C&&x(e):x(e)}},[l,U,C]),e.useEffect(()=>{V.current&&void 0!==c&&(!F||c&&c.length>0&&c!==F)&&Q(c)},[c,F]),e.useEffect(()=>{const e=["select","radio","checkbox","segment"].includes(A.name||"");if(e){const e=j.current,t=y;let r=!1;if("checkbox"===A.name){const A=Array.isArray(e)?e:e?[e]:[],n=Array.isArray(t)?t:t?[t]:[];r=JSON.stringify(A.sort())!==JSON.stringify(n.sort())}else r=e!==t&&void 0!==e;r&&(_(!1),k(!1),O(null),N(!1),S(!1),D(!1),l&&""!==l.trim()||x(""),c&&0!==c.length||Q(null)),j.current=t}e||(j.current=y)},[y,A.name,l,c]);const K=e.useCallback((e,t)=>{const{operator:A,value:r}=e,n=String(t).toLowerCase(),i=String(r).toLowerCase();switch(A){case"equals":return n===i||String(t)===String(r);case"notEquals":return n!==i&&String(t)!==String(r);case"greaterThan":return Number(t)>Number(r);case"lessThan":return Number(t)<Number(r);case"greaterThanOrEqual":return Number(t)>=Number(r);case"lessThanOrEqual":return Number(t)<=Number(r);default:return!1}},[]),z=e.useCallback(()=>{if(!(null!=y&&""!==y&&!(Array.isArray(y)&&0===y.length)))return[];const e=A.condition;if(!e||!e.conditions||0===e.conditions.length)return[];const t=[];if("checkbox"===A.name&&Array.isArray(y))y.forEach(A=>{const r=e.conditions.find(e=>K(e,A));r&&!t.find(e=>e.id===r.id)&&t.push(r)});else{const A=e.conditions.find(e=>K(e,y));A&&t.push(A)}return t},[A,y,K]),G=e.useCallback(e=>{const t=e.target.value;x(t),a&&a(t);const r=z(),n=t.trim().length>0;r.forEach(e=>{!0===e.enableNotes&&u&&u(e.id,"notes",n)});const i=A.condition;!(i&&i.conditions&&i.conditions.length>0)&&d&&d("notes",n)},[a,z,u,A,d]),q=e.useCallback(()=>{if(a){const e="string"==typeof C?C:String(C||"");a(e),setTimeout(()=>{S(!1)},0)}else S(!1)},[C,a]),W=e.useCallback(()=>{q()},[q]),X=e.useCallback(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),q())},[q]),Y=e.useCallback(()=>{S(!0)},[]),J=e.useCallback(()=>{S(!0)},[]),$=e.useCallback(()=>{M.current?.click()},[]),Z=e.useCallback(e=>{const t=e.target.files;if(t&&t.length>0){const e=Array.from(t);Q(e),o&&o(e);z().forEach(e=>{!0===e.enableAttachment&&u&&u(e.id,"attachments",!0)});const r=A.condition;!(r&&r.conditions&&r.conditions.length>0)&&d&&d("attachments",!0)}M.current&&(M.current.value="")},[o,z,u,A,d]),ee=e.useCallback(e=>{if(F){const t=F.filter((t,A)=>A!==e);if(0===t.length){Q(null),o&&o(null);z().forEach(e=>{!0===e.enableAttachment&&u&&u(e.id,"attachments",!1)});const e=A.condition;!(e&&e.conditions&&e.conditions.length>0)&&d&&d("attachments",!1)}else Q(t),o&&o(t)}},[F,o,z,u,A,d]),te=e.useCallback(()=>{_(!0);z().forEach(e=>{!0===e.enableSendEmail&&u&&u(e.id,"email",!0)});const e=A.condition;!(e&&e.conditions&&e.conditions.length>0)&&d&&d("email",!0),setTimeout(()=>{_(!1)},3e3)},[z,u,A,d]),Ae=e.useCallback(()=>{I||N(!0)},[I]),re=e.useCallback(()=>{N(!1)},[]),ne=e.useCallback(e=>{N(!1),k(!0),e&&O(e);const t=A.condition;if(t&&t.conditions&&t.conditions.length>0){z().forEach(e=>{!0===e.enableRaiseIssue&&h&&h(e.id)})}else d&&d("issue",!0)},[A,d,z,h]);if("test"!==r)return null;const ie=["select","radio","checkbox","segment"].includes(A.name||""),se=A.basic?.options||A.options||[];let ae=!1,oe=!1,le=!1,ce=!1,ue=null;const he=null!=y&&""!==y&&!(Array.isArray(y)&&0===y.length),de=A.condition,fe=de&&de.conditions&&de.conditions.length>0;if(fe&&he)if("checkbox"===A.name&&Array.isArray(y)){const e=y;for(const t of e){const e=de.conditions.find(e=>K(e,t));e&&(ae=ae||!0===e.enableNotes,oe=oe||!0===e.enableAttachment,le=le||!0===e.enableRaiseIssue,ce=ce||!0===e.enableSendEmail)}}else if(ie){const e=de.conditions.find(e=>K(e,y));e&&(ae=!0===e.enableNotes,oe=!0===e.enableAttachment,le=!0===e.enableRaiseIssue,ce=!0===e.enableSendEmail)}else{const e=de.conditions.find(e=>K(e,y));e&&(ae=!0===e.enableNotes,oe=!0===e.enableAttachment,le=!0===e.enableRaiseIssue,ce=!0===e.enableSendEmail)}if(!fe){const e=A.basic,t=!0===e?.enableNotes,r=!0===e?.enableAttachment,n=!0===e?.enableRaiseIssue,i=!0===e?.enableSendEmail;if(ie)if(he)if("checkbox"===A.name){(Array.isArray(y)?y:[y]).forEach(e=>{const t=se.find(t=>!(!t||!t.value)&&(t.value===e||(String(t.value)===String(e)||(t.label===e||String(t.label)===String(e)))));t&&(ae=ae||!0===t.enableNotes,oe=oe||!0===t.enableAttachment,le=le||!0===t.enableRaiseIssue,ce=ce||!0===t.enableSendEmail,ue||(ue=t))}),ae=ae||t,oe=oe||r,le=le||n,ce=ce||i}else if(ue=se.find(e=>!(!e||!e.value)&&(e.value===y||(String(e.value)===String(y)||(e.label===y||String(e.label)===String(y))))),ue){const e=!0===ue.enableNotes,A=!0===ue.enableAttachment,s=!0===ue.enableRaiseIssue,a=!0===ue.enableSendEmail;ae=e||t,oe=A||r,le=s||n,ce=a||i}else ae=t,oe=r,le=n,ce=i;else ae=t,oe=r,le=n,ce=i;else ae=t,oe=r,le=n,ce=i}if(!(ae||oe||le||ce))return null;const pe=z(),ge=A.condition,me=ge&&ge.conditions&&ge.conditions.length>0,we=!!me&&pe.some(e=>!0===e.enableNotes),Be=!!me&&pe.some(e=>!0===e.enableAttachment),be=!!me&&pe.some(e=>!0===e.enableSendEmail),ye=!!me&&pe.some(e=>!0===e.enableRaiseIssue),ve=C.trim().length>0,Ce=F&&F.length>0,xe=F?F.length:0;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"component-action-features",children:[p.jsxs("div",{className:"action-icons-toolbar",children:[ae&&p.jsxs("button",{type:"button",className:`action-icon-button ${ve?"active":""} ${we?"mandatory":""}`,onClick:Y,title:"Add Notes",children:[p.jsx(t.MessageSquare,{size:14,fill:ve?"currentColor":"none"}),we&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),oe&&p.jsxs("button",{type:"button",className:`action-icon-button ${Ce?"active":""} ${Be?"mandatory":""}`,onClick:$,title:"Add Attachment",children:[p.jsx(t.Paperclip,{size:14,fill:Ce?"currentColor":"none"}),xe>0&&p.jsx("span",{className:"attachment-count-badge",children:xe}),Be&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),ce&&p.jsxs("button",{type:"button",className:`action-icon-button ${L?"active sent":""} ${be?"mandatory":""}`,onClick:te,disabled:L,title:"Send Email",children:[L?p.jsx(p.Fragment,{children:p.jsx(t.Check,{size:14})}):p.jsx(t.Mail,{size:14,fill:L?"currentColor":"none"}),be&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),le&&p.jsxs("button",{type:"button",className:`action-icon-button ${I?"active":""} ${ye?"mandatory":""}`,onClick:Ae,title:"Raise an Issue",children:[p.jsx(t.AlertCircle,{size:14,fill:I?"currentColor":"none"}),ye&&p.jsx("span",{className:"mandatory-indicator",children:"*"})]}),(ve&&ae||Ce&&oe)&&p.jsx("button",{type:"button",className:"action-icon-button accordion-toggle",onClick:()=>D(!P),title:P?"Collapse":"Expand",children:P?p.jsx(t.ChevronUp,{size:14}):p.jsx(t.ChevronDown,{size:14})})]}),U&&ae&&p.jsxs("div",{className:"notes-input-overlay",children:[p.jsx("textarea",{className:"action-notes-textarea",value:C,onChange:G,onBlur:W,onKeyDown:X,placeholder:"Explain which protocols were not followed (Press Ctrl+Enter to save)",rows:4,autoFocus:!0}),p.jsxs("div",{className:"notes-input-actions",children:[p.jsx("button",{type:"button",className:"notes-save-button",onClick:q,title:"Save notes (Ctrl+Enter)",children:"Save"}),p.jsx("button",{type:"button",className:"notes-cancel-button",onClick:()=>{S(!1)},title:"Cancel",children:"Cancel"})]})]}),P&&p.jsxs("div",{className:"actions-content",children:[!U&&ve&&ae&&p.jsx("div",{className:"notes-summary-section",children:p.jsxs("div",{className:"notes-full-text",onClick:J,children:[p.jsx("span",{className:"notes-label",children:"Notes:"})," ",C]})}),Ce&&oe&&p.jsx("div",{className:"attachments-section",children:p.jsx(H,{attachments:F,onRemove:ee})})]}),oe&&p.jsx("input",{ref:M,type:"file",multiple:!0,accept:"image/*,.pdf",onChange:Z,style:{display:"none"}})]}),E&&p.jsx(v,{isOpen:E,onClose:re,onSuccess:ne,issue:T,component:(()=>{const e=null!=y?Array.isArray(y)?y.join(", "):String(y):A.basic?.value||"",t={...A,basic:{...A.basic||{},value:e}};return ue&&(t.basic.label=`${A.basic?.label||"Component"} - ${ue.label||ue.value}`,t.basic.value=ue.value||e),t})(),formTemplateId:n||"",notes:C,attachments:F,isStandalone:m,workOrderNumber:f,assetNumber:g,user:w,onCreateIssue:B,onUpdateIssue:b})]})},P=({attachments:e})=>e&&0!==e.length?p.jsx("div",{className:"attachment-thumbnails-container",children:e.map((e,A)=>{const r=e.type?.startsWith("image/")||!1,n=r?(e=>e.data?e.data.startsWith("data:")?e.data:`data:${e.type||"image/png"};base64,${e.data}`:"")(e):"";return p.jsx("div",{className:"attachment-thumbnail",children:r&&n?p.jsx("img",{src:n,alt:e.name||`Attachment ${A+1}`}):p.jsxs("div",{className:"file-icon-placeholder",children:[p.jsx(t.Paperclip,{size:20}),p.jsx("span",{className:"file-name",children:e.name||`File ${A+1}`})]})},A)})}):null,D=({component:e})=>{const t=e.basic?.notes||"",A=e.basic?.attachments||[],r=t&&t.trim().length>0,n=A&&A.length>0;return r||n?p.jsx("div",{className:"component-submission-actions",children:p.jsxs("div",{className:"actions-content",children:[r&&p.jsx("div",{className:"notes-summary-section",children:p.jsxs("div",{className:"notes-full-text",children:[p.jsx("span",{className:"notes-label",children:"Notes:"})," ",t]})}),n&&p.jsx("div",{className:"attachments-section",children:p.jsx(P,{attachments:A})})]})}):null},M=({component:e,selectedComponent:A,mode:r,onComponentSelect:s,onComponentDelete:a,onComponentEdit:o,renderFormComponent:l,isOverlay:c=!1,formData:u={},formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,shouldShowComponent:w})=>{const B=u[e.id],b=!w||w(e.id),y="preview"===r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0),{attributes:v,listeners:C,setNodeRef:x,transform:F,transition:Q,isDragging:U,isSorting:S}=n.useSortable({id:e.id,disabled:c}),E={transform:i.CSS.Transform.toString(F),transition:Q,opacity:U?.3:1,zIndex:U?1e3:"auto"};return p.jsxs("div",{ref:x,style:{...E,border:A?.id===e.id?"2px solid #3b82f6":"1px solid var(--df-color-fb-border)",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)",padding:"12px",position:"relative",minHeight:"80px",transition:"all 0.2s ease",boxShadow:A?.id===e.id?"0 4px 12px rgba(59, 130, 246, 0.15)":"0 1px 3px rgba(0, 0, 0, 0.1)",cursor:"pointer"},className:`form-component grid-component ${A?.id===e.id?"selected":""} ${U?"dragging":""} ${S?"sorting":""} ${b||"edit"===r?"":"conditionally-hidden"}`,onClick:()=>!U&&s(e),role:"button",tabIndex:0,children:["edit"===r&&p.jsx("div",{className:"component-drag-handle",...C,...v,onClick:e=>e.stopPropagation(),style:{position:"absolute",top:"50%",left:"4px",transform:"translateY(-50%)",padding:"4px",backgroundColor:"#f3f4f6",borderRadius:"4px",cursor:"grab",opacity:1,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(t.GripVertical,{size:12,color:"var(--df-color-text-light)"})}),p.jsxs("div",{className:"component-content",style:{paddingTop:"edit"===r?"24px":"0",paddingLeft:"edit"===r?"28px":"0",minHeight:"60px"},children:[l(e),"test"===r&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:h,formValue:B,formData:u,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g?t=>g(e.id,t):void 0,onAttachmentChange:m?t=>m(e.id,t):void 0}),y&&p.jsx(D,{component:e})]}),"edit"===r&&p.jsxs("div",{className:"component-actions",style:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"4px",opacity:1,zIndex:10},children:[o&&p.jsx("button",{className:"component-edit-btn",onClick:t=>{t.stopPropagation(),o(e)},type:"button",title:"Edit Component",style:{padding:"4px",backgroundColor:"#3b82f6",color:"#ffffff",border:"none",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#2563eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#3b82f6"},children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"component-delete-btn",onClick:t=>{t.stopPropagation(),a(e,t)},type:"button",title:"Delete Component",style:{padding:"4px",backgroundColor:"#ef4444",color:"#ffffff",border:"none",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#dc2626"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ef4444"},children:p.jsx(t.Trash2,{size:12})})]})]})},j=({gridComponents:e,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:s,onComponentUpdate:a,selectedComponent:o,renderFormComponent:l,gridId:c,formData:u,formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,columnView:w,shouldShowComponent:B})=>{const{setNodeRef:b,isOver:y}=r.useDroppable({id:`grid-drop-zone-${c}`,disabled:"edit"!==t,data:{isGridDropZone:!0,gridId:c}}),v=r.useSensors(r.useSensor(r.PointerSensor,{activationConstraint:{distance:8}}),r.useSensor(r.KeyboardSensor,{coordinateGetter:n.sortableKeyboardCoordinates}));return p.jsx("div",{ref:b,className:"grid-drop-zone "+(0===e.length?"empty":""),style:{border:y?"2px dashed #3b82f6":"1px dashed #d1d5db",borderRadius:"8px",padding:"16px",backgroundColor:y?"var(--df-color-primary-light)":"#f9fafb",minHeight:"100px",transition:"all 0.2s ease"},children:0===e.length?p.jsxs("div",{style:{textAlign:"center",color:"var(--df-color-text-light)",fontSize:"14px",padding:"40px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",backgroundColor:"var(--df-color-fb-container)",border:"1px dashed var(--df-color-fb-border)",borderRadius:"8px"},children:[p.jsx("div",{style:{fontWeight:"500",color:y?"var(--df-color-primary)":"var(--df-color-text-dark)"},children:y?"Drop components here":"Empty DataGrid"}),p.jsx("div",{style:{fontSize:"12px",color:"#9ca3af"},children:"Drag and drop components here to create your grid"})]}):p.jsxs(r.DndContext,{sensors:v,onDragEnd:t=>{const{active:A,over:r}=t;r&&A.id!==r.id&&(e.findIndex(e=>e.id===A.id),e.findIndex(e=>e.id===r.id))},children:[p.jsx(n.SortableContext,{items:e.map(e=>e.id),strategy:w?n.verticalListSortingStrategy:n.horizontalListSortingStrategy,children:p.jsx("div",{style:{display:"flex",flexDirection:w?"column":"row",flexWrap:"nowrap",gap:"12px",alignItems:w?"stretch":"start",marginBottom:e.length>0?"12px":"0",overflowX:w?"visible":"auto",width:"100%"},children:e.map(e=>p.jsx("div",{style:{flex:"1 1 0",minWidth:w?"100%":"200px",maxWidth:"100%"},children:p.jsx(M,{component:e,selectedComponent:o,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:s,onComponentUpdate:a,renderFormComponent:l,formData:u,formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,shouldShowComponent:B})},e.id))})}),p.jsx("div",{style:{border:y?"2px dashed #3b82f6":"1px dashed var(--df-color-fb-border)",borderRadius:"6px",padding:"12px",backgroundColor:y?"var(--df-color-primary-light)":"var(--df-color-fb-container)",textAlign:"center",color:"var(--df-color-text-light)",fontSize:"12px",transition:"all 0.2s ease",minHeight:"40px",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"12px"},children:y?p.jsx("span",{style:{color:"#3b82f6",fontWeight:"500"},children:"Drop component here to add to grid"}):p.jsx("span",{children:"+ Drop more components here"})})]})})},R=({templateComponents:t,dataEntries:A,renderFormComponent:r,mode:n,allowAddRemoveEntries:i,addAnotherText:s,removeText:a,maxEntries:o,minEntries:l,displayAsGrid:c=!0,onAddEntry:u,onRemoveEntry:h,formData:d,formTemplateId:f,onThresholdActionCompletion:g,onThresholdIssueRaised:m,onNotesChange:w,onAttachmentChange:B,columnView:b,shouldShowComponent:y})=>{const v=d||{},C=e.useMemo(()=>y?t.filter(e=>y(e.id)):t,[t,y]);return 0===C.length?p.jsx("div",{style:{textAlign:"center",padding:"40px",color:"var(--df-color-text-light)",border:"1px dashed #d1d5db",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)"},children:0===t.length?`No components defined. Add components to see the ${c?"table":"list"} view.`:"All components are hidden."}):c?p.jsxs("div",{className:"datagrid-table-view",style:{border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",overflow:"hidden",backgroundColor:"var(--df-color-fb-container)",maxWidth:"100%"},children:[p.jsx("div",{style:{position:"absolute",top:"8px",right:"8px",zIndex:10,fontSize:"12px",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--df-color-fb-border)",opacity:C.length>4&&!b?1:0,transition:"opacity 0.2s ease"},children:"← Scroll →"}),p.jsxs("div",{className:"table-scroll-container",style:{overflowX:b?"visible":"auto",overflowY:"hidden",maxWidth:"100%",scrollbarWidth:"thin",scrollbarColor:"var(--df-color-fb-border) var(--df-color-fb-icon-bg)",position:"relative"},children:[!b&&p.jsx("div",{className:"table-headers",style:{display:"grid",gridTemplateColumns:`repeat(${C.length}, minmax(150px, 1fr))`,backgroundColor:"var(--df-color-fb-container)",borderBottom:"2px solid var(--df-color-fb-border)",minWidth:150*C.length+"px"},children:C.map((e,t)=>p.jsx("div",{style:{padding:"12px 16px",fontWeight:"600",color:"var(--df-color-text-dark)",borderRight:t<C.length-1?"1px solid var(--df-color-fb-border)":"none",fontSize:"14px",minWidth:"150px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.basic?.label||`Column ${t+1}`},`header-${e.id}`))}),A.length>0?A.map((e,t)=>p.jsxs("div",{className:"table-row",style:{display:b?"flex":"grid",flexDirection:b?"column":"row",gridTemplateColumns:b?void 0:`repeat(${C.length}, minmax(150px, 1fr))`,borderBottom:t<A.length-1?"1px solid var(--df-color-fb-border)":"none",backgroundColor:t%2==0?"var(--df-color-fb-container)":"var(--df-color-fb-bg)",position:"relative",minWidth:b?"100%":150*C.length+"px",padding:b?"16px":"0"},children:[C.map((t,A)=>{let n=e.components?.[A];if(n)n={...n,id:n.id,basic:{...n.basic,showLabel:b}};else{const r=`${t.id}-${e.id}-${A}`;n={...t,id:r,basic:{...t.basic,showLabel:b}}}return p.jsx("div",{style:{padding:b?"12px 0":"12px 16px",borderRight:!b&&A<C.length-1?"1px solid var(--df-color-fb-border)":"none",borderBottom:b&&A<C.length-1?"1px dashed var(--df-color-fb-border)":"none",minHeight:b?"auto":"60px",minWidth:b?"100%":"150px",width:b?"100%":"auto",display:"flex",flexDirection:b?"column":"row",alignItems:b?"stretch":"center",overflow:"hidden",gap:b?"8px":"0"},children:p.jsx("div",{style:{width:"100%",minWidth:b?"100%":"120px",overflow:"hidden"},children:r(n,!b)})},`${e.id}-${A}`)}),"test"===n&&i&&A.length>l&&p.jsx("button",{onClick:()=>h(t),disabled:A.length<=l,style:{position:"absolute",top:"8px",right:"8px",padding:"4px 8px",backgroundColor:A.length<=l?"#f3f4f6":"#ef4444",color:A.length<=l?"#9ca3af":"#ffffff",border:"none",borderRadius:"4px",fontSize:"12px",fontWeight:"500",cursor:A.length<=l?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"4px",zIndex:10,minWidth:"24px",height:"24px",justifyContent:"center"},title:a,children:p.jsx("span",{style:{fontSize:"14px"},children:"×"})})]},e.id)):p.jsxs("div",{style:{padding:"40px",textAlign:"center",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",borderTop:"1px solid var(--df-color-fb-border)"},children:["No data entries. ","test"===n&&i?'Click "Add Another" to add entries.':"Use the properties panel to add entries."]})]}),"test"===n&&i&&p.jsx("div",{style:{padding:"16px",backgroundColor:"var(--df-color-fb-bg)",borderTop:"1px solid var(--df-color-fb-border)",display:"flex",justifyContent:"center",position:"sticky",bottom:0,zIndex:5},children:p.jsxs("button",{onClick:u,disabled:A.length>=o,style:{padding:"8px 16px",backgroundColor:A.length>=o?"#f3f4f6":"#10b981",color:A.length>=o?"#9ca3af":"#ffffff",border:"none",borderRadius:"6px",fontSize:"14px",fontWeight:"500",cursor:A.length>=o?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[p.jsx("span",{style:{fontSize:"16px"},children:"+"}),s]})})]}):p.jsxs("div",{className:"datagrid-list-view",style:{display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"var(--df-color-fb-container)"},children:[A.length>0?A.map((e,t)=>p.jsxs("div",{className:"list-entry",style:{border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",padding:"16px",backgroundColor:"var(--df-color-fb-container)",position:"relative",transition:"all 0.2s ease"},children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid var(--df-color-fb-border)"},children:[p.jsxs("span",{style:{fontWeight:"600",color:"var(--df-color-text-dark)",fontSize:"14px"},children:["Entry #",t+1]}),"test"===n&&i&&A.length>1&&p.jsx("button",{onClick:()=>h(t),disabled:A.length<=l,style:{padding:"4px 8px",backgroundColor:A.length<=l?"#f3f4f6":"#ef4444",color:A.length<=l?"#9ca3af":"#ffffff",border:"none",borderRadius:"4px",fontSize:"12px",fontWeight:"500",cursor:A.length<=l?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"4px",minWidth:"24px",height:"24px",justifyContent:"center"},title:a,children:p.jsx("span",{style:{fontSize:"14px"},children:"×"})})]}),p.jsx("div",{style:{display:b?"flex":"grid",flexDirection:b?"column":"row",gridTemplateColumns:b?void 0:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px"},children:C.map((t,A)=>{let i=e.components?.[A];if(i||(i=e.components?.find(e=>e.name===t.name&&e.basic?.label===t.basic?.label)),i)i={...i,id:i.id,basic:{...i.basic,showLabel:b}};else{const r=`${t.id}-${e.id}-${A}`;i={...t,id:r,basic:{...t.basic,showLabel:b}}}return i?p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[p.jsx("label",{style:{fontSize:"12px",fontWeight:"500",color:"var(--df-color-text-light)",textTransform:"uppercase",letterSpacing:"0.05em"},children:t.basic?.label||`Field ${A+1}`}),p.jsxs("div",{style:{minHeight:"40px",display:"flex",alignItems:"center",flexDirection:"column",width:"100%"},children:[r(i),"test"===n&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(i.name)&&p.jsx(O,{component:i,mode:"test",formTemplateId:f,formValue:v[i.id],onThresholdActionCompletion:g,onThresholdIssueRaised:m,onNotesChange:w?e=>w(i.id,e):void 0,onAttachmentChange:B?e=>B(i.id,e):void 0}),"preview"===n&&(i.basic?.notes&&i.basic.notes.trim().length>0||i.basic?.attachments&&Array.isArray(i.basic.attachments)&&i.basic.attachments.length>0?p.jsx(D,{component:i}):null)]})]},`${e.id}-${A}`):null})})]},e.id)):p.jsxs("div",{style:{padding:"40px",textAlign:"center",color:"var(--df-color-text-light)",backgroundColor:"var(--df-color-fb-container)",border:"1px dashed #d1d5db",borderRadius:"8px"},children:["No data entries. ","test"===n&&i?'Click "Add Another" to add entries.':"Use the properties panel to add entries."]}),"test"===n&&i&&p.jsx("div",{style:{padding:"16px",backgroundColor:"#f8f9fa",border:"1px solid var(--df-color-fb-border)",borderRadius:"8px",display:"flex",justifyContent:"center"},children:p.jsxs("button",{onClick:u,disabled:A.length>=o,style:{padding:"8px 16px",backgroundColor:A.length>=o?"#f3f4f6":"#10b981",color:A.length>=o?"#9ca3af":"#ffffff",border:"none",borderRadius:"6px",fontSize:"14px",fontWeight:"500",cursor:A.length>=o?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"all 0.2s ease"},onMouseEnter:e=>{A.length<o&&(e.currentTarget.style.backgroundColor="#059669")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#10b981"},children:[p.jsx("span",{children:"+"}),s]})})]})},V=({id:A,properties:r,mode:n="edit",formData:i={},onValueChange:s,onSelect:a,isSelected:o=!1,className:l="",onDataGridSelect:c,onComponentSelect:u,onComponentDelete:h,onComponentEdit:d,onComponentUpdate:f,selectedComponent:g,renderFormComponent:m,onEntryAdd:w,onEntryRemove:B,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,shouldShowComponent:_})=>{const[I,H]=e.useState(!1),O=e.useRef(!1);let P=(r.templateComponents||[]).map(e=>({...e,basic:{...e.basic,value:""}}));const D=r.entries||[];0===P.length&&D.length>0&&D[0].components&&(P=D[0].components.map(e=>({...e,id:e.id?.replace(/-entry-\d+$/,"")||e.id,basic:{...e.basic,value:"",defaultValue:"",showLabel:!0}}))),e.useEffect(()=>{if("edit"===n&&!r.templateComponents&&s&&O.current){const e={...r,templateComponents:[]};JSON.stringify(e)!==JSON.stringify(r)&&s({id:A,value:e})}O.current=!0},[r.templateComponents,A,s,r,n]),e.useEffect(()=>{if(P.length>0){if("edit"!==n||!O.current)return;if(0===D.length){const e=`entry-${`${Date.now()}-${Math.random().toString(36).substr(2,5)}`}`,t={id:e,index:0,components:P.map((t,A)=>({...t,id:`${t.id}-${e}-${A}`,basic:{...t.basic,showLabel:!1}})),styles:{}};if(s){const e={...r,entries:[t]};JSON.stringify(e)!==JSON.stringify(r)&&s({id:A,value:e})}}else{if(D.some(e=>P.some((t,A)=>{const r=e.components?.[A];if(!r)return!0;return JSON.stringify(r.basic?.options)!==JSON.stringify(t.basic?.options)||r.basic?.placeholder!==t.basic?.placeholder||r.basic?.defaultValue!==t.basic?.defaultValue||r.basic?.label!==t.basic?.label||r.validation?.required!==t.validation?.required}))&&s){const e=D.map(e=>{const t=P.map((t,A)=>{let r=e.components?.[A];if(r||(r=e.components?.find(e=>e.name===t.name&&e.basic?.label===t.basic?.label)),r){return{...t,id:r.id,basic:{...t.basic,showLabel:!1,value:r.basic?.value||t.basic?.defaultValue||""}}}{const e=`${Date.now()}-${Math.random().toString(36).substr(2,5)}`,r=`${t.id}-${e}-${A}`;return{...t,id:r,basic:{...t.basic,showLabel:!1}}}});return{...e,components:t}}),t={...r,entries:e};JSON.stringify(t)!==JSON.stringify(r)&&s({id:A,value:t})}}}},[P,D,A,s,r,n,r.templateComponents]);const M=e.useCallback(e=>{e.stopPropagation(),a?.(),c?.(r)},[a,c,r]),V=e.useCallback((e,t)=>{t.stopPropagation(),h&&h(e,t);const n=P.filter(t=>t.id!==e.id),i=D.map(t=>({...t,components:t.components?.filter(t=>!(t.name===e.name&&t.basic?.label===e.basic?.label))||[]}));s&&s({id:A,value:{...r,templateComponents:n,entries:i}})},[h,r,s,A,P,D]),K=e.useCallback((e,t)=>{f&&f(e,t);const n=P.map(A=>A.id===e?{...A,...t}:A);s&&s({id:A,value:{...r,templateComponents:n}})},[f,r,s,A,P]),z=e.useCallback(e=>{"test"===n&&s&&s({id:e.id,value:e.value})},[n,s]),G=e.useCallback(()=>{const e=`entry-${`${Date.now()}-${Math.random().toString(36).substr(2,5)}`}`,t={id:e,index:r.entries.length,components:P.map((t,A)=>{const r=`${t.id}-${e}-${A}`;return{...t,id:r,basic:{...t.basic,value:"",showLabel:!1}}}),styles:{}},n=[...r.entries,t];s&&s({id:A,value:{...r,entries:n}}),w?.()},[r,s,A,w,P]),q=e.useCallback(e=>{const t=r.entries.filter((t,A)=>A!==e).map((e,t)=>({...e,index:t}));s&&s({id:A,value:{...r,entries:t}})},[r,s,A,B]),W=e.useCallback((e,t=!1)=>{const A="test"===n?i[e.id]||"defaultValue"in e.basic&&e.basic.defaultValue||"":"defaultValue"in e.basic&&e.basic.defaultValue||"",r={id:e.id,properties:e,validationErrors:{},formValue:A,touchedFields:{},formSubmitted:!1,mode:n,hideLabel:t,onValueChange:z,onBlur:()=>{},onFocus:()=>{}};switch(e.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...r,properties:e,inputType:"text-input"===e.name?"text":"number-input"===e.name?"number":"email",readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"textarea":return p.jsx(F,{...r,properties:e,readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"select":const A={...e,options:e.basic?.options||[]};return p.jsx(Q,{...r,properties:A,disabled:"edit"===n||"preview"===n,hideLabel:t});case"checkbox":const i={...e,options:e.basic?.options||[]};return p.jsx(U,{...r,properties:i,formValue:[],disabled:"edit"===n||"preview"===n,hideLabel:t});case"radio":const s={...e,options:e.basic?.options||[]};return p.jsx(S,{...r,properties:s,readonly:"edit"===n||"preview"===n,disabled:"edit"===n||"preview"===n,hideLabel:t});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...r,properties:e,readonly:"edit"===n||"preview"===n,disabled:"preview"===n,hideLabel:t});case"signature":return p.jsx(L,{...r,properties:e,hideLabel:t});case"heading":return p.jsx(k,{...r,properties:e,hideLabel:t});case"instructions":return p.jsx(T,{...r,properties:e,hideLabel:t});default:return p.jsxs("div",{className:"unknown-component",children:["Unknown component: ",e.name]})}},[n,z]),X={backgroundColor:r.styles.backgroundColor||"var(--df-color-fb-container)",borderColor:r.styles.borderColor||"var(--df-color-fb-border)",borderWidth:r.styles.borderWidth||"2px",borderRadius:r.styles.borderRadius||"8px",padding:r.styles.padding||"16px",margin:r.styles.margin||"16px 0"};return p.jsxs("div",{className:`form-group df-form-datagrid ${o?"selected":""} ${l}`,onClick:M,style:X,children:[p.jsx("div",{className:"grid-header",style:{backgroundColor:r.styles?.headerBackgroundColor,color:r.styles?.headerTextColor},children:p.jsx("div",{className:"grid-title",onClick:e=>{e.stopPropagation(),H(!I),s?.({id:A,value:{...r,basic:{...r.basic,collapsed:!I}}})},children:p.jsxs("div",{className:"title-content",style:{display:"flex",alignItems:"center",gap:"8px"},children:[I?p.jsx(t.ChevronRight,{size:16}):p.jsx(t.ChevronDown,{size:16}),p.jsx(t.Grid,{size:16}),p.jsx("span",{className:"grid-label",style:{fontWeight:"600",color:r.styles?.headerTextColor},children:r.basic.label}),r.validation.required&&p.jsx("span",{className:"required-indicator",style:{color:"#ef4444"},children:"*"})]})})}),r.basic.description&&r.basic.description.trim().length>0&&!I&&p.jsx("div",{className:"grid-description",style:{marginTop:"8px",color:"var(--df-color-text-light)",fontSize:"14px"},children:r.basic.description}),!I&&p.jsx("div",{className:"grid-content",style:{marginTop:"16px"},children:"edit"===n?p.jsx(j,{gridComponents:P,mode:n,onComponentSelect:u||(()=>{}),onComponentDelete:V,onComponentEdit:d,onComponentUpdate:K,selectedComponent:g||null,renderFormComponent:m||W,gridId:A,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,columnView:r.datagrid?.columnView,shouldShowComponent:_}):p.jsx(R,{templateComponents:P,dataEntries:D,renderFormComponent:m||W,mode:n,allowAddRemoveEntries:r.datagrid?.allowAddRemoveEntries??!0,addAnotherText:r.datagrid?.addAnotherText??"Add Entry",removeText:r.datagrid?.removeText??"Remove",maxEntries:r.datagrid?.maxEntries??10,minEntries:r.datagrid?.minEntries??1,displayAsGrid:r.datagrid?.displayAsGrid??!0,onAddEntry:w||G,onRemoveEntry:B||q,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:E,columnView:r.datagrid?.columnView,shouldShowComponent:_})})]})},K=({child:e,selectedChild:A,mode:r,onChildSelect:s,onChildDelete:a,renderFormComponent:o,isOverlay:l=!1,isChildrenEditMode:c=!1,formData:u={},formTemplateId:h,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v})=>{const C=u[e.id],x="preview"===r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0),{attributes:F,listeners:Q,setNodeRef:U,transform:S,transition:E,isDragging:N,isSorting:L}=n.useSortable({id:e.id,disabled:l||"edit"!==r}),_={transform:i.CSS.Transform.toString(S),transition:E,zIndex:N?1e3:"auto"};return p.jsxs("div",{ref:U,style:_,className:`form-component section-child ${A?.id===e.id?"selected":""} ${N?"dragging":""} ${L?"sorting":""} ${c?"children-edit-active":""}`,onClick:()=>!N&&s(e),role:"button",tabIndex:0,children:[("edit"===r||c)&&p.jsx("div",{className:"child-drag-handle",...Q,...F,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:p.jsx(t.GripVertical,{size:14})}),p.jsxs("div",{className:"form-component-content section-child-content",children:[("edit"===r||c)&&p.jsxs("div",{className:"component-actions child-actions",children:[p.jsx("button",{className:"btn edit-btn",onClick:t=>{t.stopPropagation(),s(e)},onMouseDown:e=>e.stopPropagation(),title:"Edit properties",children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"btn delete-btn",onClick:t=>a(e,t),onMouseDown:e=>e.stopPropagation(),title:"Delete component",children:p.jsx(t.Trash2,{size:12})})]}),p.jsxs("div",{className:"component-preview child-preview",children:[o(e),!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:h,formValue:C,formData:u,onThresholdActionCompletion:d,onThresholdIssueRaised:f,onNotesChange:g?t=>g(e.id,t):void 0,onAttachmentChange:m?t=>m(e.id,t):void 0,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v}),x&&p.jsx(D,{component:e})]})]})]})},z=({id:A,properties:i,mode:s="edit",formData:a={},onValueChange:o,onSelect:l,isSelected:c=!1,className:u="",onSectionSelect:h,onChildSelect:d,onChildDelete:f,selectedChild:g,renderFormComponent:m,formTemplateId:w,onThresholdActionCompletion:B,onThresholdIssueRaised:b,onNotesChange:y,onAttachmentChange:v,workOrderNumber:C,assetNumber:_,user:H,onCreateIssue:O,onUpdateIssue:P})=>{const[D,M]=e.useState(i.basic.collapsed),[j,R]=e.useState(!1),[z,G]=e.useState(!1),[q,W]=e.useState(i.basic.label),[X,Y]=e.useState(i.basic.description),[J,$]=e.useState(i.children||[]),[Z,ee]=e.useState(!1);e.useEffect(()=>{$(i.children||[])},[i.children]),e.useEffect(()=>{W(i.basic.label),Y(i.basic.description)},[i.basic.label,i.basic.description]);const{setNodeRef:te,isOver:Ae}=r.useDroppable({id:`section-${A}`,disabled:"edit"!==s}),re=!("preview"!==s&&"test"!==s||i.children&&i.children.length>0),ne=e.useCallback(e=>{W(e),o?.({id:A,value:{...i,basic:{...i.basic,label:e}}})},[A,i,o]),ie=e.useCallback(e=>{Y(e),o?.({id:A,value:{...i,basic:{...i.basic,description:e}}})},[A,i,o]),se=e.useCallback(e=>{d?.(e)},[d]),ae=e.useCallback((e,t)=>{t.stopPropagation();const A=J.filter(t=>t.id!==e.id);$(A),f?.(e.id)},[f,J,A]),oe=e.useCallback(()=>{h?.(i),l?.()},[h,l,i]),le=e.useCallback(e=>{e.stopPropagation(),"edit"===s&&J.length>0&&ee(!Z)},[s,J.length,Z]),ce=e.useCallback(e=>{e.stopPropagation(),M(!D),o?.({id:A,value:{...i,basic:{...i.basic,collapsed:!D}}})},[D,A,i,o]),ue=m||e.useCallback(e=>{const t=a[e.id]||"defaultValue"in e.basic&&e.basic.defaultValue||"";let A=t;"number-input"===e.name&&"number"==typeof t?A=String(t):"number-input"===e.name&&null==t&&(A="");const r={id:e.id,properties:e,validationErrors:{},formValue:A,touchedFields:{},formSubmitted:!1,mode:s,onValueChange:o,onBlur:()=>{},onFocus:()=>{}};switch(e.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...r,properties:e,inputType:"text-input"===e.name?"text":"number-input"===e.name?"number":"email",readonly:!1,disabled:!1});case"textarea":return p.jsx(F,{...r,properties:e,readonly:!1,disabled:!1});case"select":const t={...e,options:e.basic?.options||[]};return p.jsx(Q,{...r,properties:t,disabled:!1});case"checkbox":const A={...e,options:e.basic?.options||[]};return p.jsx(U,{...r,properties:A,formValue:[],disabled:!1});case"radio":const n={...e,options:e.basic?.options||[]};return p.jsx(S,{...r,properties:n,readonly:!1,disabled:!1});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...r,properties:e,readonly:!1,disabled:!1});case"signature":return p.jsx(L,{...r,properties:e});case"heading":return p.jsx(k,{...r,properties:e});case"instructions":return p.jsx(T,{...r,properties:e});case"location":return p.jsx(I,{...r,properties:e});case"datagrid":return p.jsx(V,{...r,properties:e,formData:a,mode:s,onNotesChange:()=>{},onAttachmentChange:()=>{}});case"segment":const i={...e,options:e.basic?.options||[]};return p.jsx(E,{...r,properties:i});default:return p.jsx("div",{className:"form-group",children:p.jsxs("div",{className:"form-group-label",children:["Unsupported Component: ",e.name]})})}},[s,o,a]);if(re)return null;const he={backgroundColor:i.styles?.backgroundColor||"var(--df-color-fb-container)",borderColor:i.styles?.borderColor||"var(--df-color-fb-border)",borderWidth:i.styles?.borderWidth||"2px",borderRadius:i.styles?.borderRadius||"8px",padding:i.styles?.padding||"16px",margin:i.styles?.margin||"16px 0"};return p.jsxs("div",{ref:te,className:`df-form-section ${c?"selected":""} ${Ae?"drag-over":""} ${u}`,style:he,children:[p.jsxs("div",{className:"section-header "+(Z?"children-edit-mode":""),onClick:oe,onDoubleClick:le,children:[p.jsx("div",{className:"section-header-content",children:p.jsxs("div",{className:"section-title",children:[p.jsx("span",{className:"section-toggle",title:D?"Expand section":"Collapse section",role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),ce(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ce(e))},style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:D?p.jsx(t.ChevronRight,{size:18}):p.jsx(t.ChevronDown,{size:18})}),"edit"===s&&j?p.jsx("input",{type:"text",value:q,onChange:e=>W(e.target.value),onBlur:()=>{R(!1),ne(q)},onKeyDown:e=>{"Enter"===e.key&&(R(!1),ne(q))},className:"section-title-input",autoFocus:!0}):p.jsx("h3",{className:"section-title-text",onDoubleClick:()=>"edit"===s&&R(!0),style:{display:"inline",margin:0},children:q||"Untitled Section"})]})}),(X||"edit"===s)&&p.jsx("div",{className:"section-description",children:"edit"===s&&z?p.jsx("textarea",{value:X,onChange:e=>Y(e.target.value),onBlur:()=>{G(!1),ie(X)},onKeyDown:e=>{"Enter"===e.key&&e.ctrlKey&&(G(!1),ie(X))},className:"section-description-input",placeholder:"Section description (optional)",autoFocus:!0}):p.jsx("p",{className:"section-description-text",onDoubleClick:()=>"edit"===s&&G(!0),children:X||"Section description"})})]}),!D&&p.jsx("div",{className:`section-content ${Ae?"drag-over":""} ${0===J.length?"empty":"has-children"}`,onClick:e=>{e.target===e.currentTarget&&oe()},children:p.jsx(n.SortableContext,{items:J.map(e=>e.id),strategy:n.verticalListSortingStrategy,children:0===J.length?p.jsxs("div",{className:"section-empty-state",onClick:oe,style:{textAlign:"center",color:"#6b7280",fontSize:"14px",padding:"40px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",border:"2px dotted #d1d5db",borderRadius:"8px",backgroundColor:"var(--df-color-fb-container)",transition:"all 0.3s ease",margin:"16px 0"},children:[p.jsx("div",{style:{fontWeight:"500",color:Ae?"#3b82f6":"#374151"},children:Ae?"Drop components here":"Empty Section"}),p.jsx("div",{style:{fontSize:"12px",color:"#9ca3af"},children:"Drag and drop components here to create your section"})]}):J.map(e=>p.jsx(K,{child:e,selectedChild:g||null,mode:s,onChildSelect:se,onChildDelete:ae,renderFormComponent:ue,isChildrenEditMode:Z,formData:a,formTemplateId:w,onNotesChange:y,onAttachmentChange:v,onThresholdActionCompletion:B,onThresholdIssueRaised:b,workOrderNumber:C,assetNumber:_,user:H,onCreateIssue:O,onUpdateIssue:P},e.id))})})]})},G=e.lazy(()=>Promise.resolve().then(function(){return $})),q=e=>e.id?e:{...e,id:s.v4()},W=({component:e,mode:t,renderFormComponent:A,formData:r={},formTemplateId:n,onThresholdActionCompletion:i,onThresholdIssueRaised:s,onNotesChange:a,onAttachmentChange:o,workOrderNumber:l,assetNumber:c,user:u,onCreateIssue:h,onUpdateIssue:d})=>{const f=r[e.id],g="preview"===t&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0);return p.jsxs("div",{className:"simple-table-component",children:[A(e),!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:"test",formTemplateId:n,formValue:f,formData:r,onThresholdActionCompletion:i,onThresholdIssueRaised:s,onNotesChange:a?t=>a(e.id,t):void 0,onAttachmentChange:o?t=>o(e.id,t):void 0,workOrderNumber:l,assetNumber:c,user:u,onCreateIssue:h,onUpdateIssue:d}),g&&p.jsx(D,{component:e})]})},X=({component:e,selectedComponent:A,mode:r,onComponentSelect:s,onComponentDelete:a,onComponentEdit:o,renderFormComponent:l,isOverlay:c=!1})=>{const{attributes:u,listeners:h,setNodeRef:d,transform:f,transition:g,isDragging:m,isSorting:w}=n.useSortable({id:e.id,disabled:c}),B={transform:i.CSS.Transform.toString(f),transition:g,opacity:m?.3:1,zIndex:m?1e3:"auto"};return p.jsxs("div",{ref:d,style:B,className:`form-component table-component ${A?.id===e.id?"selected":""} ${m?"dragging":""} ${w?"sorting":""}`,onClick:()=>!m&&s(e),role:"button",tabIndex:0,children:["edit"===r&&p.jsx("div",{className:"component-drag-handle",...h,...u,onClick:e=>e.stopPropagation(),style:{opacity:1},children:p.jsx(t.GripVertical,{size:14})}),p.jsx("div",{className:"component-content",children:l(e)}),"edit"===r&&p.jsxs("div",{className:"component-actions",style:{opacity:1},children:[o&&p.jsx("button",{className:"component-edit-btn",onClick:t=>{t.stopPropagation(),o(e)},type:"button",title:"Edit Component",children:p.jsx(t.Edit,{size:12})}),p.jsx("button",{className:"component-delete-btn",onClick:t=>{t.stopPropagation(),a(e,t)},type:"button",title:"Delete Component",children:p.jsx(t.Trash2,{size:12})})]})]})},Y=({cell:e,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:a,selectedComponent:o,renderFormComponent:l,formData:c={},formTemplateId:u,onThresholdActionCompletion:h,onThresholdIssueRaised:d,tableId:f,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v})=>{const C=`table-cell-${f}-${e.row}-${e.column}`,{setNodeRef:x,isOver:F}=r.useDroppable({id:C,disabled:"edit"!==t,data:{type:"table-cell",tableId:f,cell:e,row:e.row,column:e.column}}),Q={...e.styles,backgroundColor:F?"var(--df-color-primary-light)":e.styles?.backgroundColor||"transparent",minHeight:e.styles?.minHeight||"preview"===t||"test"===t?"40px":"60px",padding:(e.styles,"8px"),border:"preview"===t||"test"===t?"none":F?"2px dashed var(--df-color-primary)":e.styles?.borderColor?`1px solid ${e.styles.borderColor}`:"1px solid var(--df-color-fb-border)",borderRadius:"preview"===t||"test"===t?"0":"4px",position:"relative",verticalAlign:e.styles?.verticalAlign||"top"};return p.jsx("td",{ref:x,style:Q,className:"table-cell "+(F?"drag-over":""),children:p.jsx("div",{className:"cell-content",children:e.components&&Array.isArray(e.components)&&e.components.length>0?"edit"===t?p.jsx(n.SortableContext,{items:e.components.map(e=>e.id||s.v4()),strategy:n.verticalListSortingStrategy,children:e.components.map(e=>{const r=q(e);return p.jsx(X,{component:r,selectedComponent:o,mode:t,onComponentSelect:A,onComponentDelete:i,onComponentEdit:a,renderFormComponent:l},r.id)})}):e.components.map(e=>{const A=e.id?e:q(e);return p.jsx(W,{component:A,mode:t,renderFormComponent:l,formData:c,formTemplateId:u,onThresholdActionCompletion:h,onThresholdIssueRaised:d,onNotesChange:g,onAttachmentChange:m,workOrderNumber:w,assetNumber:B,user:b,onCreateIssue:y,onUpdateIssue:v},A.id)}):"edit"===t?p.jsx("div",{className:"empty-cell-placeholder",children:p.jsxs("div",{className:"cell-info",children:[p.jsx("span",{className:"drop-zone-text",children:"Drag and Drop a form component"}),p.jsxs("span",{className:"cell-coordinates",children:["Cell (",e.row+1,", ",e.column+1,")"]})]})}):p.jsx("div",{style:{minHeight:"20px",backgroundColor:"transparent",visibility:"hidden"},children:" "})})})},J=({id:A,properties:r,mode:n="edit",formData:i={},validationErrors:s={},touchedFields:a={},formSubmitted:o=!1,onValueChange:l,onSelect:c,isSelected:u=!1,className:h="",onTableSelect:d,onComponentSelect:f,onComponentDelete:g,onComponentEdit:m,selectedComponent:w,renderFormComponent:B,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,onNotesChange:C,onAttachmentChange:_,workOrderNumber:H,assetNumber:O,user:P,onCreateIssue:D,onUpdateIssue:M})=>{const[j,R]=e.useState(!1),K=r.cells?.some(e=>e.some(e=>e.components&&e.components.length>0))||!1;e.useEffect(()=>{},[r.table?.rows,r.table?.columns,r.basic?.rows,r.basic?.columns,r.cells,A,l]);const z=e.useCallback(e=>{e.stopPropagation(),c?.(),d?.(r)},[c,d,r]),G=e.useCallback((e,t)=>{t.stopPropagation();const n=r.cells.map(t=>t.map(t=>{if(t.components&&t.components.some(t=>t.id===e.id)){const A=t.components.filter(t=>t.id!==e.id);return{...t,components:A}}return t}));l&&l({id:A,value:{...r,cells:n}})},[g,r,l,A]),W=e.useMemo(()=>r.cells?r.cells.map((e,t)=>e.map((e,r)=>({...e,components:e.components&&Array.isArray(e.components)?e.components.map((e,n)=>{if(e.id&&"string"==typeof e.id&&""!==e.id.trim())return e;const i=`${e.name||"component"}-table-${A}-row-${t}-cell-${r}-comp-${n}`;return{...e,id:i}}):[]}))):[],[r.cells,A]),X=B||e.useCallback(e=>{const t=e.id?e:q(e),A=i[t.id]||"defaultValue"in t.basic&&t.basic.defaultValue||"";let r=A;"number-input"===t.name&&"number"==typeof A?r=String(A):"number-input"===t.name&&null==A&&(r="");const s={id:t.id,properties:t,validationErrors:{},formValue:r,touchedFields:{},formSubmitted:!1,mode:n,onValueChange:e=>{l?.(e)},onBlur:()=>{},onFocus:()=>{}};switch(t.name){case"text-input":case"email-input":case"number-input":return p.jsx(x,{...s,properties:t,inputType:"text-input"===t.name?"text":"number-input"===t.name?"number":"email",readonly:!1,disabled:!1});case"textarea":return p.jsx(F,{...s,properties:t,readonly:!1,disabled:!1});case"select":const e={...t,options:t.basic?.options||[]};return p.jsx(Q,{...s,properties:e,disabled:!1});case"checkbox":const A={...t,options:t.basic?.options||[]};return p.jsx(U,{...s,properties:A,formValue:[],disabled:!1});case"radio":const r={...t,options:t.basic?.options||[]};return p.jsx(S,{...s,properties:r,readonly:!1,disabled:!1});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...s,properties:t,readonly:!1,disabled:!1});case"signature":return p.jsx(L,{...s,properties:t});case"heading":return p.jsx(k,{...s,properties:t});case"instructions":return p.jsx(T,{...s,properties:t});case"location":return p.jsx(I,{...s,properties:t});case"datagrid":return p.jsx(V,{...s,properties:t,formData:i,mode:n,onNotesChange:()=>{},onAttachmentChange:()=>{}});case"segment":const a={...t,options:t.basic?.options||[]};return p.jsx(E,{...s,properties:a});default:return p.jsxs("div",{className:"unknown-component",children:["Unknown component: ",t.name]})}},[B,n,i,l]),J={backgroundColor:r.styles?.backgroundColor||"var(--df-color-fb-container)",borderColor:r.styles?.borderColor||"var(--df-color-fb-border)",borderWidth:r.styles?.borderWidth||"2px",borderRadius:r.styles?.borderRadius||"8px",padding:r.styles?.padding||"16px",margin:r.styles?.margin||"16px 0"},$={width:"100%",minWidth:"600px",borderCollapse:"preview"===n||"test"===n?"separate":"collapse",tableLayout:"fixed",border:"preview"===n||"test"===n?"1px solid var(--df-color-fb-border)":"none"};return K||"preview"!==n?p.jsxs("div",{className:`form-group df-form-table ${u?"selected":""} ${"preview"===n?"preview-mode":"test"===n?"test-mode":""} ${h}`,onClick:z,style:J,children:[p.jsx("div",{className:"table-header",children:p.jsx("div",{className:"table-title",onClick:e=>{e.stopPropagation(),R(!j),l?.({id:A,value:{...r,basic:{...r.basic||{},collapsed:!j}}})},children:p.jsxs("div",{className:"title-content",children:[j?p.jsx(t.ChevronRight,{size:16}):p.jsx(t.ChevronDown,{size:16}),p.jsx(t.Table,{size:16}),p.jsx("span",{className:"table-label",children:r.basic?.label||"Table"}),r.validation?.required&&p.jsx("span",{className:"required-indicator",children:"*"})]})})}),r.basic?.description&&!j&&p.jsx("div",{className:"table-description",children:r.basic.description}),!j&&p.jsxs("div",{className:"table-content",children:[null,p.jsxs("table",{style:$,children:[r.table?.displayAsTable&&("edit"===n||r.table?.showColumns)&&p.jsx("thead",{children:p.jsx("tr",{className:"table-header-row",children:Array.from({length:r.table?.columns||r.basic?.columns||3},(e,t)=>{const A=(r.table?.columnNames?.split(",").map(e=>e.trim())||[])[t]||`Column ${t+1}`;return p.jsx("th",{className:"table-header-cell",style:{backgroundColor:(r.styles.headerBackgroundColor,"var(--df-color-fb-container)"),color:r.styles.headerTextColor||"var(--df-color-text-dark)",padding:"12px",border:"1px solid var(--df-color-fb-border)",fontWeight:"600",fontSize:"14px",textAlign:"center"},children:A},`header-${t}`)})})}),p.jsx("tbody",{children:W.map((e,t)=>p.jsx("tr",{className:"table-row",children:e.map(e=>p.jsx(Y,{cell:e,mode:n,onComponentSelect:f||(()=>{}),onComponentDelete:G,onComponentEdit:m,selectedComponent:w||null,renderFormComponent:X,formData:i,formTemplateId:b,onThresholdActionCompletion:y,onThresholdIssueRaised:v,tableId:A,onNotesChange:C,onAttachmentChange:_,workOrderNumber:H,assetNumber:O,user:P,onCreateIssue:D,onUpdateIssue:M},e.id))},t))})]})]})]}):null};var $=Object.freeze({__proto__:null,DfFormTable:J,default:J});const Z={page:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',padding:"30px",backgroundColor:"#ffffff",color:"#000000",lineHeight:"1.4"},header:{marginBottom:"30px",paddingBottom:"15px",borderBottom:"2px solid #303992",display:"flex",justifyContent:"space-between",alignItems:"flex-end"},title:{margin:"0 0 5px 0",fontSize:"24px",fontWeight:"bold",color:"#303992"},description:{margin:"0",fontSize:"14px",color:"#666666"},submittedBy:{fontSize:"14px",color:"#333",textAlign:"right",whiteSpace:"nowrap",marginBottom:"2px"},formGroup:{marginBottom:"20px",breakInside:"avoid"},label:{fontWeight:"400",display:"block",marginBottom:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fontSize:"14px",lineHeight:"1.5",fontColor:"var(--df-color-text-dark)"},labelLeft:{fontWeight:"400",display:"block",marginRight:"10px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fontSize:"14px",lineHeight:"1.5",width:"60%",fontColor:"var(--df-color-text-dark)"},valueContainer:{border:"1px solid #e2e8f0",borderRadius:"6px",padding:"8px 12px",backgroundColor:"#ffffff",minHeight:"20px",fontSize:"14px",flex:1},value:{fontSize:"14px",color:"#000000"},gridRow:{display:"flex",flexWrap:"wrap",gap:"16px",marginBottom:"20px"},gridCol:e=>({flex:`0 0 calc(${e/12*100}% - 8px)`,minWidth:"0"}),img:{maxWidth:"100%",maxHeight:"300px",border:"1px solid #ddd",borderRadius:"4px",display:"block",marginTop:"5px"},table:{width:"100%",borderCollapse:"collapse",border:"1px solid #ddd",marginTop:"10px",tableLayout:"fixed"},th:{border:"1px solid #ddd",padding:"8px",backgroundColor:"#f5f5f5",fontWeight:"bold",textAlign:"left",fontSize:"13px"},td:{border:"1px solid #ddd",padding:"8px",fontSize:"13px",verticalAlign:"top"},section:{marginBottom:"25px",breakInside:"avoid"},sectionHeader:{fontSize:"18px",marginBottom:"15px",display:"block",fontWeight:"600"},sectionChildren:{marginLeft:"20px",paddingLeft:"20px",borderLeft:"2px solid #3b82f6",marginTop:"15px"},notesSection:{marginTop:"10px",padding:"10px",backgroundColor:"rgba(48, 57, 146, 0.05)",borderLeft:"3px solid #303992",borderRadius:"4px",fontSize:"13px",boxSizing:"border-box"},notesLabel:{fontWeight:"bold",color:"#303992",marginRight:"5px"},attachmentsSection:{marginTop:"10px",padding:"10px",backgroundColor:"rgba(48, 57, 146, 0.05)",borderLeft:"3px solid #303992",borderRadius:"4px",display:"flex",flexWrap:"wrap",gap:"10px",boxSizing:"border-box"},attachmentThumbnail:{width:"60px",height:"60px",border:"1px solid #e5e7eb",borderRadius:"4px",overflow:"hidden",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},attachmentImg:{width:"100%",height:"100%",objectFit:"cover"},segmentContainer:{display:"flex",gap:"8px",flexWrap:"wrap",alignItems:"center"},segmentButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:"6px",border:"1px solid #e0e0e0",backgroundColor:"#ffffff",fontSize:"10px",fontWeight:600,minWidth:"30px",color:"#666"},segmentIcon:{marginRight:"4px",fontSize:"9px",fontWeight:"bold",display:"inline-block",lineHeight:"1"},checkboxItem:{display:"flex",alignItems:"center",padding:"10px 14px",backgroundColor:"#f8f9fa",borderRadius:"6px",marginBottom:"8px",width:"100%",boxSizing:"border-box"}},ee=e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim();return t.startsWith("data:image")||t.startsWith("iVBORw0KGgo")||t.startsWith("/9j/4AAQ")||t.startsWith("UklGR")||t.startsWith("R0lGOD")},te=(e,t)=>{if(!e)return"";const A=e.trim();return A.startsWith("data:")||A.startsWith("http")||A.startsWith("blob:")||A.startsWith("/")?A:A.startsWith("iVBORw0KGgo")?`data:image/png;base64,${A}`:A.startsWith("/9j/4AAQ")?`data:image/jpeg;base64,${A}`:A.startsWith("UklGR")?`data:image/webp;base64,${A}`:A.startsWith("R0lGOD")?`data:image/gif;base64,${A}`:t&&t.startsWith("image/")?`data:${t};base64,${A}`:A},Ae=e=>{const t=String(e||"").toLowerCase();return"pass"===t||"yes"===t?"pass":"fail"===t||"no"===t?"fail":"pass"},re=({component:e})=>{const t=e.basic?.notes||"",A=e.basic?.attachments||[];return t.trim()||0!==A.length?p.jsxs("div",{style:{marginTop:"5px"},children:[t.trim().length>0&&p.jsxs("div",{style:Z.notesSection,children:[p.jsx("span",{style:Z.notesLabel,children:"Notes:"}),t]}),A.length>0&&p.jsx("div",{style:Z.attachmentsSection,children:A.map((e,t)=>{const A=!(!e.data&&!e.url),r=(e.type?.startsWith("image/")||ee(e.data||e.url||""))&&A?te(e.data||e.url||"",e.type):null;return p.jsx("div",{style:Z.attachmentThumbnail,children:r?p.jsx("img",{src:r,alt:e.name||"Attachment",style:Z.attachmentImg}):p.jsx("span",{style:{fontSize:"20px",color:"#999"},children:"📎"})},t)})})]}):null},ne=({component:e})=>{const t=void 0!==e.basic?.value?e.basic.value:e.basic?.defaultValue,{name:A}=e;if("signature"===A)return t&&ee(t)?p.jsx("div",{style:{marginTop:"5px"},children:p.jsx("img",{src:te(t),alt:"Signature",style:{...Z.img,maxHeight:"100px",width:"auto"}})}):p.jsx("span",{style:{color:"#999",fontStyle:"italic"},children:"No signature"});if("checkbox"===A){const A=e.basic?.options||[],r=(Array.isArray(t)?t:t?[t]:[]).map(e=>String(e));return p.jsx("div",{style:{marginTop:"5px",width:"100%"},children:A.map((e,t)=>{const A=r.includes(String(e.value));return p.jsxs("div",{style:Z.checkboxItem,children:[p.jsx("div",{style:{width:"18px",height:"18px",minWidth:"18px",border:"2px solid "+(A?"#303992":"#cbd5e1"),borderRadius:"4px",marginRight:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:A?"#303992":"#ffffff"},children:A&&p.jsx("span",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"bold",lineHeight:1},children:"✓"})}),p.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"#334155"},children:e.label})]},t)})})}if("radio"===A){const A=e.basic?.options||[];return p.jsx("div",{style:{marginTop:"5px",width:"100%"},children:A.map((e,A)=>{const r=String(t||"")===String(e.value||"");return p.jsxs("div",{style:Z.checkboxItem,children:[p.jsx("div",{style:{width:"18px",height:"18px",minWidth:"18px",border:"2px solid "+(r?"#303992":"#cbd5e1"),borderRadius:"50%",marginRight:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ffffff"},children:r&&p.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#303992"}})}),p.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"#334155"},children:e.label})]},A)})})}if("segment"===A){const A=e.basic?.options||[],r=t;return p.jsx("div",{style:Z.segmentContainer,children:A.map((e,t)=>{const A=String(r||"")===String(e.value||""),n=(e=>null!=e?.icon?e.icon:"pass"===Ae(e?.value||e)?"✓":"×")(e),i=e.color||e.backgroundColor,s=Ae(e.value);let a,o,l;i?A?(a=i,o="#ffffff",l=i):(a=`${i}20`,o=i,l=i):"pass"===s?A?(a="#00814b",o="#ffffff",l="#00814b"):(a="#34bd4914",o="#00814b",l="#e0e0e0"):A?(a="#dc3545",o="#ffffff",l="#dc3545"):(a="#fa323d14",o="#dc3545",l="#e0e0e0");const c={...Z.segmentButton,backgroundColor:a,color:o,borderColor:l,borderWidth:"1px",borderStyle:"solid"};return p.jsxs("div",{style:c,children:[p.jsx("span",{style:Z.segmentIcon,children:n}),p.jsx("span",{children:e.value})]},t)})})}if("file"===A){const e=(Array.isArray(t)?t:t?[t]:[]).filter(e=>{const t=!(!e.data&&!e.url),A=e.type&&e.type.startsWith("image/"),r=t&&ee(e.data||e.url);return A||r});return e.length>0?p.jsx("div",{style:{marginTop:"10px"},children:e.map((e,t)=>{const A=te(e.data||e.url,e.type);return A?p.jsx("img",{src:A,alt:e.name||"File",style:{...Z.img,marginBottom:"10px"}},t):null})}):p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No images uploaded"})}if("location"===A){if(t&&"object"==typeof t){const e=t;return p.jsxs("div",{style:{fontSize:"14px"},children:[e.placeName&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Place:"})," ",e.placeName]}),(e.city||e.country)&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Address:"})," ",[e.city,e.country].filter(Boolean).join(", ")]}),e.latitude&&e.longitude&&p.jsxs("div",{style:{marginBottom:"4px"},children:[p.jsx("strong",{children:"Coordinates:"})," ",e.latitude.toFixed(6),", ",e.longitude.toFixed(6)]}),e.timestamp&&p.jsxs("div",{children:[p.jsx("strong",{children:"Captured:"})," ",(b(e.timestamp)||new Date).toLocaleString()]})]})}return p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No location data"})}if("instructions"===A){const t=e.basic?.instructions||[],A=e.validation?.listStyle||"numbers";if(!Array.isArray(t)||0===t.length)return p.jsx("div",{style:{color:"#999",fontStyle:"italic"},children:"No instructions"});const r=()=>p.jsx("div",{dangerouslySetInnerHTML:{__html:t.join("")}});return"numbers"===A?p.jsx("ol",{style:{margin:"10px 0",paddingLeft:"25px"},children:p.jsx(r,{})}):"bullets"===A?p.jsx("ul",{style:{margin:"10px 0",paddingLeft:"25px"},children:p.jsx(r,{})}):p.jsx("div",{style:{margin:"10px 0"},children:p.jsx(r,{})})}if("select"===A){const A=e.basic?.options||[],r=t;let n="";if(Array.isArray(r))n=r.map(e=>{const t=A.find(t=>String(t.value)===String(e));return t?t.label:e}).join(", ");else{const e=r,t=A.find(t=>String(t.value)===String(e));n=t?t.label||t.value:null!=e?String(e):""}return p.jsx("div",{style:Z.valueContainer,children:p.jsx("div",{style:Z.value,children:n})})}const r="object"==typeof t?JSON.stringify(t):String(t);if(!["signature","checkbox","radio","segment","file","instructions","heading","section","table","datagrid","select"].includes(A)){const e="textarea"===A;return p.jsx("div",{style:{...Z.valueContainer,...e?{minHeight:"60px",whiteSpace:"pre-wrap"}:{}},children:p.jsx("div",{style:Z.value,children:r})})}return p.jsx("div",{style:Z.value,children:r})},ie=({component:e})=>{const{name:t,basic:A,styles:r,validation:n}=e,i=A?.label,s=n?.required,a="left"===(r?.labelAlignment||"top");if("section"===t){const t=r?.headerBackgroundColor,n=r?.headerTextColor,a={...Z.sectionHeader,...t?{backgroundColor:t,padding:"8px",borderRadius:"4px"}:{},...n?{color:n}:{},display:"flex",alignItems:"center"};return p.jsxs("div",{style:Z.section,children:[i&&p.jsx("label",{style:a,children:p.jsxs("span",{style:{flex:1},children:[i,s&&" *"]})}),A?.description&&p.jsx("p",{style:{...Z.description,marginBottom:"15px"},children:A.description}),p.jsx(re,{component:e}),p.jsx("div",{style:Z.sectionChildren,children:p.jsx(se,{components:e.children||[]})})]})}if("heading"===t){const e=`h${Math.max(1,Math.min(6,r?.level??A?.level??1))}`,t={...r?.headerBackgroundColor?{backgroundColor:r.headerBackgroundColor,padding:"8px",borderRadius:"4px"}:{},...r?.headerTextColor?{color:r.headerTextColor}:{},...r?.fontSize?{fontSize:r.fontSize}:{},...r?.textAlign?{textAlign:r.textAlign}:{},marginTop:0,marginBottom:"15px"};return p.jsx("div",{style:Z.formGroup,children:p.jsx(e,{style:t,children:A?.label||A?.value})})}if("table"===t){const t=e.cells||[],A=Math.max(0,...t.map(e=>e?e.length:0)),n=A>0?100/A:100,a=r?.headerBackgroundColor,o=r?.headerTextColor,l={...Z.label,...a?{backgroundColor:a,padding:"8px",borderRadius:"4px",marginBottom:"10px"}:{},...o?{color:o}:{}};return p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:l,children:[i,s&&" *"]}),p.jsx("table",{style:Z.table,children:p.jsx("tbody",{children:t.map((e,t)=>p.jsx("tr",{children:e&&e.map((e,t)=>p.jsx("td",{style:{...Z.td,width:`${n}%`},children:e.components&&e.components.map((e,t)=>p.jsxs("div",{style:{marginBottom:"8px"},children:[e.basic?.label&&p.jsxs("span",{style:{fontWeight:"bold",marginRight:"5px",fontSize:"12px"},children:[e.basic.label,":"]}),p.jsx(ne,{component:e}),p.jsx(re,{component:e})]},t))},t))},t))})})]})}if("datagrid"===t){const t=e.entries||[];let A=e.templateComponents||[];0===A.length&&t.length>0&&t[0]?.components&&(A=t[0].components.map(e=>({...e,basic:{...e.basic,label:e.basic?.label||e.name}})));const n=r?.headerBackgroundColor,a=r?.headerTextColor,o={...Z.label,...n?{backgroundColor:n,padding:"8px",borderRadius:"4px",marginBottom:"10px"}:{},...a?{color:a}:{}},l=t.filter(e=>!(!e.components||0===e.components.length)&&e.components.some(e=>{const t=void 0!==e.basic?.value?e.basic.value:e.basic?.defaultValue;return Array.isArray(t)?t.length>0:null!=t&&""!==String(t).trim()}));return 0===l.length?p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:o,children:[i,s&&" *"]}),p.jsx("div",{style:{fontStyle:"italic",color:"#999"},children:"No data"})]}):p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:o,children:[i,s&&" *"]}),p.jsxs("table",{style:Z.table,children:[p.jsx("thead",{children:p.jsx("tr",{children:A.map((e,t)=>p.jsx("th",{style:Z.th,children:e.basic?.label||e.name},t))})}),p.jsx("tbody",{children:l.map((e,t)=>p.jsx("tr",{children:A.map((t,A)=>{const r=e.components[A];return p.jsx("td",{style:Z.td,children:r?p.jsxs(p.Fragment,{children:[p.jsx(ne,{component:r}),p.jsx(re,{component:r})]}):"N/A"},A)})},t))})]})]})}if(a&&"instructions"!==t){const A=["segment"].includes(t);return p.jsxs("div",{style:Z.formGroup,children:[p.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[i&&p.jsxs("label",{style:Z.labelLeft,children:[i,s&&" *"]}),p.jsx("div",{style:{flex:1,...A?{display:"flex",justifyContent:"flex-end"}:{}},children:p.jsx(ne,{component:e})})]}),p.jsx(re,{component:e})]})}return p.jsxs("div",{style:Z.formGroup,children:[i&&p.jsxs("label",{style:Z.label,children:[i,s&&" *"]}),p.jsx(ne,{component:e}),p.jsx(re,{component:e})]})},se=({components:e})=>{if(!e||0===e.length)return null;const t=[];let A=[],r=0;return e.forEach(e=>{const n=["section","table","datagrid","heading","instructions"].includes(e.name),i=n?12:e.styles?.column||12;r+i>12&&A.length>0&&(t.push(A),A=[],r=0),A.push(e),r+=i,(n||r>=12)&&r>0&&(t.push(A),A=[],r=0)}),A.length>0&&t.push(A),p.jsx(p.Fragment,{children:t.map((e,t)=>1===e.length?p.jsx(ie,{component:e[0]},e[0].id||t):p.jsx("div",{style:Z.gridRow,children:e.map((e,t)=>{const A=e.styles?.column||12;return p.jsx("div",{style:Z.gridCol(A),children:p.jsx(ie,{component:e})},e.id||t)})},t))})},ae=({formTitle:e,formDescription:t,userName:A,components:r})=>p.jsxs("div",{className:"pdf-container",style:Z.page,children:[p.jsxs("div",{style:Z.header,children:[p.jsxs("div",{children:[p.jsx("h1",{style:Z.title,children:e}),t&&p.jsx("p",{style:Z.description,children:t})]}),A&&p.jsxs("div",{style:Z.submittedBy,children:[p.jsx("strong",{children:"Submitted By:"})," ",A]})]}),p.jsx("div",{className:"form-content",children:p.jsx(se,{components:r})})]});var oe,le=A;if("production"===process.env.NODE_ENV)oe=le.createRoot,le.hydrateRoot;else{var ce=le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;oe=function(e,t){ce.usingClientEntryPoint=!0;try{return le.createRoot(e,t)}finally{ce.usingClientEntryPoint=!1}}}var ue={exports:{}};
|
|
11
11
|
/*!
|
|
12
12
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
13
13
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
28
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
29
|
***************************************************************************** */
|
|
30
|
-
var e=function(t,A){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])},e(t,A)};function t(t,A){if("function"!=typeof A&&null!==A)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function r(){this.constructor=t}e(t,A),t.prototype=null===A?Object.create(A):(r.prototype=A.prototype,new r)}var A=function(){return A=Object.assign||function(e){for(var t,A=1,r=arguments.length;A<r;A++)for(var n in t=arguments[A])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},A.apply(this,arguments)};function r(e,t,A,r){function n(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,i){function s(e){try{o(r.next(e))}catch(e){i(e)}}function a(e){try{o(r.throw(e))}catch(e){i(e)}}function o(e){e.done?A(e.value):n(e.value).then(s,a)}o((r=r.apply(e,t||[])).next())})}function n(e,t){var A,r,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return o([e,t])}}function o(i){if(A)throw new TypeError("Generator is already executing.");for(;s;)try{if(A=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{A=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function i(e,t,A){if(A||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||t)}for(var s=function(){function e(e,t,A,r){this.left=e,this.top=t,this.width=A,this.height=r}return e.prototype.add=function(t,A,r,n){return new e(this.left+t,this.top+A,this.width+r,this.height+n)},e.fromClientRect=function(t,A){return new e(A.left+t.windowBounds.left,A.top+t.windowBounds.top,A.width,A.height)},e.fromDOMRectList=function(t,A){var r=Array.from(A).find(function(e){return 0!==e.width});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,t){return s.fromClientRect(e,t.getBoundingClientRect())},o=function(e){var t=e.body,A=e.documentElement;if(!t||!A)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,A.scrollWidth),Math.max(t.offsetWidth,A.offsetWidth),Math.max(t.clientWidth,A.clientWidth)),n=Math.max(Math.max(t.scrollHeight,A.scrollHeight),Math.max(t.offsetHeight,A.offsetHeight),Math.max(t.clientHeight,A.clientHeight));return new s(0,0,r,n)},l=function(e){for(var t=[],A=0,r=e.length;A<r;){var n=e.charCodeAt(A++);if(n>=55296&&n<=56319&&A<r){var i=e.charCodeAt(A++);56320==(64512&i)?t.push(((1023&n)<<10)+(1023&i)+65536):(t.push(n),A--)}else t.push(n)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var r=[],n=-1,i="";++n<A;){var s=e[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===A||r.length>16384)&&(i+=String.fromCharCode.apply(String,r),r.length=0)}return i},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<u.length;d++)h[u.charCodeAt(d)]=d;for(var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<f.length;g++)p[f.charCodeAt(g)]=g;for(var m=function(e){var t,A,r,n,i,s=.75*e.length,a=e.length,o=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<a;t+=4)A=p[e.charCodeAt(t)],r=p[e.charCodeAt(t+1)],n=p[e.charCodeAt(t+2)],i=p[e.charCodeAt(t+3)],c[o++]=A<<2|r>>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&i;return l},w=function(e){for(var t=e.length,A=[],r=0;r<t;r+=2)A.push(e[r+1]<<8|e[r]);return A},B=function(e){for(var t=e.length,A=[],r=0;r<t;r+=4)A.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return A},b=5,y=11,v=2,C=65536>>b,x=(1<<b)-1,F=C+(1024>>b)+32,Q=65536>>y,U=(1<<y-b)-1,S=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},E=function(e,t,A){return e.slice?e.slice(t,A):new Uint32Array(Array.prototype.slice.call(e,t,A))},N=function(e,t){var A=m(e),r=Array.isArray(A)?B(A):new Uint32Array(A),n=Array.isArray(A)?w(A):new Uint16Array(A),i=24,s=S(n,i/2,r[4]/2),a=2===r[5]?S(n,(i+r[4])/2):E(r,Math.ceil((i+r[4])/4));return new L(r[0],r[1],r[2],r[3],s,a)},L=function(){function e(e,t,A,r,n,i){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=r,this.index=n,this.data=i}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>b])<<v)+(e&x),this.data[t];if(e<=65535)return t=((t=this.index[C+(e-55296>>b)])<<v)+(e&x),this.data[t];if(e<this.highStart)return t=F-Q+(e>>y),t=this.index[t],t+=e>>b&U,t=((t=this.index[t])<<v)+(e&x),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="undefined"==typeof Uint8Array?[]:new Uint8Array(256),k=0;k<_.length;k++)I[_.charCodeAt(k)]=k;var T=50,H=1,O=2,P=3,D=4,M=5,j=7,R=8,V=9,K=10,G=11,z=12,q=13,W=14,X=15,Y=16,J=17,$=18,Z=19,ee=20,te=21,Ae=22,re=23,ne=24,ie=25,se=26,ae=27,oe=28,le=29,ce=30,ue=31,he=32,de=33,fe=34,pe=35,ge=36,me=37,we=38,Be=39,be=40,ye=41,ve=42,Ce=43,xe=[9001,65288],Fe="!",Qe="×",Ue="÷",Se=N("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),Ee=[ce,ge],Ne=[H,O,P,M],Le=[K,R],_e=[ae,se],Ie=Ne.concat(Le),ke=[we,Be,be,fe,pe],Te=[X,q],He=function(e,t){void 0===t&&(t="strict");var A=[],r=[],n=[];return e.forEach(function(e,i){var s=Se.get(e);if(s>T?(n.push(!0),s-=T):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(i),A.push(Y);if(s===D||s===G){if(0===i)return r.push(i),A.push(ce);var a=A[i-1];return-1===Ie.indexOf(a)?(r.push(r[i-1]),A.push(a)):(r.push(i),A.push(ce))}return r.push(i),s===ue?A.push("strict"===t?te:me):s===ve||s===le?A.push(ce):s===Ce?e>=131072&&e<=196605||e>=196608&&e<=262141?A.push(me):A.push(ce):void A.push(s)}),[r,A,n]},Oe=function(e,t,A,r){var n=r[A];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var i=A;i<=r.length;){if((o=r[++i])===t)return!0;if(o!==K)break}if(n===K)for(i=A;i>0;){var s=r[--i];if(Array.isArray(e)?-1!==e.indexOf(s):e===s)for(var a=A;a<=r.length;){var o;if((o=r[++a])===t)return!0;if(o!==K)break}if(s!==K)break}return!1},Pe=function(e,t){for(var A=e;A>=0;){var r=t[A];if(r!==K)return r;A--}return 0},De=function(e,t,A,r,n){if(0===A[r])return Qe;var i=r-1;if(Array.isArray(n)&&!0===n[i])return Qe;var s=i-1,a=i+1,o=t[i],l=s>=0?t[s]:0,c=t[a];if(o===O&&c===P)return Qe;if(-1!==Ne.indexOf(o))return Fe;if(-1!==Ne.indexOf(c))return Qe;if(-1!==Le.indexOf(c))return Qe;if(Pe(i,t)===R)return Ue;if(Se.get(e[i])===G)return Qe;if((o===he||o===de)&&Se.get(e[a])===G)return Qe;if(o===j||c===j)return Qe;if(o===V)return Qe;if(-1===[K,q,X].indexOf(o)&&c===V)return Qe;if(-1!==[J,$,Z,ne,oe].indexOf(c))return Qe;if(Pe(i,t)===Ae)return Qe;if(Oe(re,Ae,i,t))return Qe;if(Oe([J,$],te,i,t))return Qe;if(Oe(z,z,i,t))return Qe;if(o===K)return Ue;if(o===re||c===re)return Qe;if(c===Y||o===Y)return Ue;if(-1!==[q,X,te].indexOf(c)||o===W)return Qe;if(l===ge&&-1!==Te.indexOf(o))return Qe;if(o===oe&&c===ge)return Qe;if(c===ee)return Qe;if(-1!==Ee.indexOf(c)&&o===ie||-1!==Ee.indexOf(o)&&c===ie)return Qe;if(o===ae&&-1!==[me,he,de].indexOf(c)||-1!==[me,he,de].indexOf(o)&&c===se)return Qe;if(-1!==Ee.indexOf(o)&&-1!==_e.indexOf(c)||-1!==_e.indexOf(o)&&-1!==Ee.indexOf(c))return Qe;if(-1!==[ae,se].indexOf(o)&&(c===ie||-1!==[Ae,X].indexOf(c)&&t[a+1]===ie)||-1!==[Ae,X].indexOf(o)&&c===ie||o===ie&&-1!==[ie,oe,ne].indexOf(c))return Qe;if(-1!==[ie,oe,ne,J,$].indexOf(c))for(var u=i;u>=0;){if((h=t[u])===ie)return Qe;if(-1===[oe,ne].indexOf(h))break;u--}if(-1!==[ae,se].indexOf(c))for(u=-1!==[J,$].indexOf(o)?s:i;u>=0;){var h;if((h=t[u])===ie)return Qe;if(-1===[oe,ne].indexOf(h))break;u--}if(we===o&&-1!==[we,Be,fe,pe].indexOf(c)||-1!==[Be,fe].indexOf(o)&&-1!==[Be,be].indexOf(c)||-1!==[be,pe].indexOf(o)&&c===be)return Qe;if(-1!==ke.indexOf(o)&&-1!==[ee,se].indexOf(c)||-1!==ke.indexOf(c)&&o===ae)return Qe;if(-1!==Ee.indexOf(o)&&-1!==Ee.indexOf(c))return Qe;if(o===ne&&-1!==Ee.indexOf(c))return Qe;if(-1!==Ee.concat(ie).indexOf(o)&&c===Ae&&-1===xe.indexOf(e[a])||-1!==Ee.concat(ie).indexOf(c)&&o===$)return Qe;if(o===ye&&c===ye){for(var d=A[i],f=1;d>0&&t[--d]===ye;)f++;if(f%2!=0)return Qe}return o===he&&c===de?Qe:Ue},Me=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var A=He(e,t.lineBreak),r=A[0],n=A[1],i=A[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(n=n.map(function(e){return-1!==[ie,ce,ve].indexOf(e)?me:e}));var s="keep-all"===t.wordBreak?i.map(function(t,A){return t&&e[A]>=19968&&e[A]<=40959}):void 0;return[r,n,s]},je=function(){function e(e,t,A,r){this.codePoints=e,this.required=t===Fe,this.start=A,this.end=r}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Re=function(e,t){var A=l(e),r=Me(A,t),n=r[0],i=r[1],s=r[2],a=A.length,o=0,c=0;return{next:function(){if(c>=a)return{done:!0,value:null};for(var e=Qe;c<a&&(e=De(A,i,n,++c,s))===Qe;);if(e!==Qe||c===a){var t=new je(A,e,o,c);return o=c,{value:t,done:!1}}return{done:!0,value:null}}}},Ve=1,Ke=2,Ge=4,ze=8,qe=10,We=47,Xe=92,Ye=9,Je=32,$e=34,Ze=61,et=35,tt=36,At=37,rt=39,nt=40,it=41,st=95,at=45,ot=33,lt=60,ct=62,ut=64,ht=91,dt=93,ft=61,pt=123,gt=63,mt=125,wt=124,Bt=126,bt=128,yt=65533,vt=42,Ct=43,xt=44,Ft=58,Qt=59,Ut=46,St=0,Et=8,Nt=11,Lt=14,_t=31,It=127,kt=-1,Tt=48,Ht=97,Ot=101,Pt=102,Dt=117,Mt=122,jt=65,Rt=69,Vt=70,Kt=85,Gt=90,zt=function(e){return e>=Tt&&e<=57},qt=function(e){return e>=55296&&e<=57343},Wt=function(e){return zt(e)||e>=jt&&e<=Vt||e>=Ht&&e<=Pt},Xt=function(e){return e>=Ht&&e<=Mt},Yt=function(e){return e>=jt&&e<=Gt},Jt=function(e){return Xt(e)||Yt(e)},$t=function(e){return e>=bt},Zt=function(e){return e===qe||e===Ye||e===Je},eA=function(e){return Jt(e)||$t(e)||e===st},tA=function(e){return eA(e)||zt(e)||e===at},AA=function(e){return e>=St&&e<=Et||e===Nt||e>=Lt&&e<=_t||e===It},rA=function(e,t){return e===Xe&&t!==qe},nA=function(e,t,A){return e===at?eA(t)||rA(t,A):!!eA(e)||!(e!==Xe||!rA(e,t))},iA=function(e,t,A){return e===Ct||e===at?!!zt(t)||t===Ut&&zt(A):zt(e===Ut?t:e)},sA=function(e){var t=0,A=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(A=-1),t++);for(var r=[];zt(e[t]);)r.push(e[t++]);var n=r.length?parseInt(c.apply(void 0,r),10):0;e[t]===Ut&&t++;for(var i=[];zt(e[t]);)i.push(e[t++]);var s=i.length,a=s?parseInt(c.apply(void 0,i),10):0;e[t]!==Rt&&e[t]!==Ot||t++;var o=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(o=-1),t++);for(var l=[];zt(e[t]);)l.push(e[t++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return A*(n+a*Math.pow(10,-s))*Math.pow(10,o*u)},aA={type:2},oA={type:3},lA={type:4},cA={type:13},uA={type:8},hA={type:21},dA={type:9},fA={type:10},pA={type:11},gA={type:12},mA={type:14},wA={type:23},BA={type:1},bA={type:25},yA={type:24},vA={type:26},CA={type:27},xA={type:28},FA={type:29},QA={type:31},UA={type:32},SA=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(l(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==UA;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case $e:return this.consumeStringToken($e);case et:var t=this.peekCodePoint(0),A=this.peekCodePoint(1),r=this.peekCodePoint(2);if(tA(t)||rA(A,r)){var n=nA(t,A,r)?Ke:Ve;return{type:5,value:this.consumeName(),flags:n}}break;case tt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),cA;break;case rt:return this.consumeStringToken(rt);case nt:return aA;case it:return oA;case vt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),mA;break;case Ct:if(iA(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case xt:return lA;case at:var i=e,s=this.peekCodePoint(0),a=this.peekCodePoint(1);if(iA(i,s,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(nA(i,s,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===at&&a===ct)return this.consumeCodePoint(),this.consumeCodePoint(),yA;break;case Ut:if(iA(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case We:if(this.peekCodePoint(0)===vt)for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(o===vt&&(o=this.consumeCodePoint())===We)return this.consumeToken();if(o===kt)return this.consumeToken()}break;case Ft:return vA;case Qt:return CA;case lt:if(this.peekCodePoint(0)===ot&&this.peekCodePoint(1)===at&&this.peekCodePoint(2)===at)return this.consumeCodePoint(),this.consumeCodePoint(),bA;break;case ut:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),h=this.peekCodePoint(2);if(nA(l,u,h))return{type:7,value:this.consumeName()};break;case ht:return xA;case Xe:if(rA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case dt:return FA;case ft:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),uA;break;case pt:return pA;case mt:return gA;case Dt:case Kt:var d=this.peekCodePoint(0),f=this.peekCodePoint(1);return d!==Ct||!Wt(f)&&f!==gt||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case wt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),dA;if(this.peekCodePoint(0)===wt)return this.consumeCodePoint(),hA;break;case Bt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),fA;break;case kt:return UA}return Zt(e)?(this.consumeWhiteSpace(),QA):zt(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):eA(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Wt(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var A=!1;t===gt&&e.length<6;)e.push(t),t=this.consumeCodePoint(),A=!0;if(A)return{type:30,start:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Tt:e})),16),end:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Vt:e})),16)};var r=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===at&&Wt(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var n=[];Wt(t)&&n.length<6;)n.push(t),t=this.consumeCodePoint();return{type:30,start:r,end:parseInt(c.apply(void 0,n),16)}}return{type:30,start:r,end:r}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===nt?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===nt?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===kt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===rt||t===$e){var A=this.consumeStringToken(this.consumeCodePoint());return 0===A.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===kt||this.peekCodePoint(0)===it)?(this.consumeCodePoint(),{type:22,value:A.value}):(this.consumeBadUrlRemnants(),wA)}for(;;){var r=this.consumeCodePoint();if(r===kt||r===it)return{type:22,value:c.apply(void 0,e)};if(Zt(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===kt||this.peekCodePoint(0)===it?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),wA);if(r===$e||r===rt||r===nt||AA(r))return this.consumeBadUrlRemnants(),wA;if(r===Xe){if(!rA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),wA;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;Zt(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===it||e===kt)return;rA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,A="";e>0;){var r=Math.min(t,e);A+=c.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var t="",A=0;;){var r=this._value[A];if(r===kt||void 0===r||r===e)return{type:0,value:t+=this.consumeStringSlice(A)};if(r===qe)return this._value.splice(0,A),BA;if(r===Xe){var n=this._value[A+1];n!==kt&&void 0!==n&&(n===qe?(t+=this.consumeStringSlice(A),A=-1,this._value.shift()):rA(r,n)&&(t+=this.consumeStringSlice(A),t+=c(this.consumeEscapedCodePoint()),A=-1))}A++}},e.prototype.consumeNumber=function(){var e=[],t=Ge,A=this.peekCodePoint(0);for(A!==Ct&&A!==at||e.push(this.consumeCodePoint());zt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(A===Ut&&zt(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ze;zt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((A===Rt||A===Ot)&&((r===Ct||r===at)&&zt(n)||zt(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ze;zt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[sA(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],A=e[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);return nA(r,n,i)?{type:15,number:t,flags:A,unit:this.consumeName()}:r===At?(this.consumeCodePoint(),{type:16,number:t,flags:A}):{type:17,number:t,flags:A}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Wt(e)){for(var t=c(e);Wt(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());Zt(this.peekCodePoint(0))&&this.consumeCodePoint();var A=parseInt(t,16);return 0===A||qt(A)||A>1114111?yt:A}return e===kt?yt:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(tA(t))e+=c(t);else{if(!rA(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),EA=function(){function e(e){this._tokens=e}return e.create=function(t){var A=new SA;return A.write(t),new e(A.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},A=this.consumeToken();;){if(32===A.type||PA(A,e))return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue()),A=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var A=this.consumeToken();if(32===A.type||3===A.type)return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?UA:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),NA=function(e){return 15===e.type},LA=function(e){return 17===e.type},_A=function(e){return 20===e.type},IA=function(e){return 0===e.type},kA=function(e,t){return _A(e)&&e.value===t},TA=function(e){return 31!==e.type},HA=function(e){return 31!==e.type&&4!==e.type},OA=function(e){var t=[],A=[];return e.forEach(function(e){if(4===e.type){if(0===A.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(A),void(A=[])}31!==e.type&&A.push(e)}),A.length&&t.push(A),t},PA=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},DA=function(e){return 17===e.type||15===e.type},MA=function(e){return 16===e.type||DA(e)},jA=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},RA={type:17,number:0,flags:Ge},VA={type:16,number:50,flags:Ge},KA={type:16,number:100,flags:Ge},GA=function(e,t,A){var r=e[0],n=e[1];return[zA(r,t),zA(void 0!==n?n:r,A)]},zA=function(e,t){if(16===e.type)return e.number/100*t;if(NA(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},qA="deg",WA="grad",XA="rad",YA="turn",JA={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case qA:return Math.PI*t.number/180;case WA:return Math.PI/200*t.number;case XA:return t.number;case YA:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},$A=function(e){return 15===e.type&&(e.unit===qA||e.unit===WA||e.unit===XA||e.unit===YA)},ZA=function(e){switch(e.filter(_A).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[RA,RA];case"to top":case"bottom":return er(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[RA,KA];case"to right":case"left":return er(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[KA,KA];case"to bottom":case"top":return er(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[KA,RA];case"to left":case"right":return er(270)}return 0},er=function(e){return Math.PI*e/180},tr={name:"color",parse:function(e,t){if(18===t.type){var A=lr[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return A(e,t.values)}if(5===t.type){if(3===t.value.length){var r=t.value.substring(0,1),n=t.value.substring(1,2),i=t.value.substring(2,3);return nr(parseInt(r+r,16),parseInt(n+n,16),parseInt(i+i,16),1)}if(4===t.value.length){r=t.value.substring(0,1),n=t.value.substring(1,2),i=t.value.substring(2,3);var s=t.value.substring(3,4);return nr(parseInt(r+r,16),parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16)/255)}if(6===t.value.length)return r=t.value.substring(0,2),n=t.value.substring(2,4),i=t.value.substring(4,6),nr(parseInt(r,16),parseInt(n,16),parseInt(i,16),1);if(8===t.value.length)return r=t.value.substring(0,2),n=t.value.substring(2,4),i=t.value.substring(4,6),s=t.value.substring(6,8),nr(parseInt(r,16),parseInt(n,16),parseInt(i,16),parseInt(s,16)/255)}if(20===t.type){var a=ur[t.value.toUpperCase()];if(void 0!==a)return a}return ur.TRANSPARENT}},Ar=function(e){return!(255&e)},rr=function(e){var t=255&e,A=255&e>>8,r=255&e>>16,n=255&e>>24;return t<255?"rgba("+n+","+r+","+A+","+t/255+")":"rgb("+n+","+r+","+A+")"},nr=function(e,t,A,r){return(e<<24|t<<16|A<<8|Math.round(255*r))>>>0},ir=function(e,t){if(17===e.type)return e.number;if(16===e.type){var A=3===t?1:255;return 3===t?e.number/100*A:Math.round(e.number/100*A)}return 0},sr=function(e,t){var A=t.filter(HA);if(3===A.length){var r=A.map(ir),n=r[0],i=r[1],s=r[2];return nr(n,i,s,1)}if(4===A.length){var a=A.map(ir),o=(n=a[0],i=a[1],s=a[2],a[3]);return nr(n,i,s,o)}return 0};function ar(e,t,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(t-e)*A*6+e:A<.5?t:A<2/3?6*(t-e)*(2/3-A)+e:e}var or=function(e,t){var A=t.filter(HA),r=A[0],n=A[1],i=A[2],s=A[3],a=(17===r.type?er(r.number):JA.parse(e,r))/(2*Math.PI),o=MA(n)?n.number/100:0,l=MA(i)?i.number/100:0,c=void 0!==s&&MA(s)?zA(s,1):1;if(0===o)return nr(255*l,255*l,255*l,1);var u=l<=.5?l*(o+1):l+o-l*o,h=2*l-u,d=ar(h,u,a+1/3),f=ar(h,u,a),p=ar(h,u,a-1/3);return nr(255*d,255*f,255*p,c)},lr={hsl:or,hsla:or,rgb:sr,rgba:sr},cr=function(e,t){return tr.parse(e,EA.create(t).parseComponentValue())},ur={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},hr={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(_A(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},dr={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fr=function(e,t){var A=tr.parse(e,t[0]),r=t[1];return r&&MA(r)?{color:A,stop:r}:{color:A,stop:null}},pr=function(e,t){var A=e[0],r=e[e.length-1];null===A.stop&&(A.stop=RA),null===r.stop&&(r.stop=KA);for(var n=[],i=0,s=0;s<e.length;s++){var a=e[s].stop;if(null!==a){var o=zA(a,t);o>i?n.push(o):n.push(i),i=o}else n.push(null)}var l=null;for(s=0;s<n.length;s++){var c=n[s];if(null===c)null===l&&(l=s);else if(null!==l){for(var u=s-l,h=(c-n[l-1])/(u+1),d=1;d<=u;d++)n[l+d-1]=h*d;l=null}}return e.map(function(e,A){return{color:e.color,stop:Math.max(Math.min(1,n[A]/t),0)}})},gr=function(e,t,A){var r=t/2,n=A/2,i=zA(e[0],t)-r,s=n-zA(e[1],A);return(Math.atan2(s,i)+2*Math.PI)%(2*Math.PI)},mr=function(e,t,A){var r="number"==typeof e?e:gr(e,t,A),n=Math.abs(t*Math.sin(r))+Math.abs(A*Math.cos(r)),i=t/2,s=A/2,a=n/2,o=Math.sin(r-Math.PI/2)*a,l=Math.cos(r-Math.PI/2)*a;return[n,i-l,i+l,s-o,s+o]},wr=function(e,t){return Math.sqrt(e*e+t*t)},Br=function(e,t,A,r,n){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var i=t[0],s=t[1],a=wr(A-i,r-s);return(n?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},br=function(e,t,A,r,n){var i=0,s=0;switch(e.size){case 0:0===e.shape?i=s=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(A),Math.abs(A-n)):1===e.shape&&(i=Math.min(Math.abs(t),Math.abs(t-r)),s=Math.min(Math.abs(A),Math.abs(A-n)));break;case 2:if(0===e.shape)i=s=Math.min(wr(t,A),wr(t,A-n),wr(t-r,A),wr(t-r,A-n));else if(1===e.shape){var a=Math.min(Math.abs(A),Math.abs(A-n))/Math.min(Math.abs(t),Math.abs(t-r)),o=Br(r,n,t,A,!0),l=o[0],c=o[1];s=a*(i=wr(l-t,(c-A)/a))}break;case 1:0===e.shape?i=s=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(A),Math.abs(A-n)):1===e.shape&&(i=Math.max(Math.abs(t),Math.abs(t-r)),s=Math.max(Math.abs(A),Math.abs(A-n)));break;case 3:if(0===e.shape)i=s=Math.max(wr(t,A),wr(t,A-n),wr(t-r,A),wr(t-r,A-n));else if(1===e.shape){a=Math.max(Math.abs(A),Math.abs(A-n))/Math.max(Math.abs(t),Math.abs(t-r));var u=Br(r,n,t,A,!1);l=u[0],c=u[1],s=a*(i=wr(l-t,(c-A)/a))}}return Array.isArray(e.size)&&(i=zA(e.size[0],r),s=2===e.size.length?zA(e.size[1],n):i),[i,s]},yr=function(e,t){var A=er(180),r=[];return OA(t).forEach(function(t,n){if(0===n){var i=t[0];if(20===i.type&&"to"===i.value)return void(A=ZA(t));if($A(i))return void(A=JA.parse(e,i))}var s=fr(e,t);r.push(s)}),{angle:A,stops:r,type:1}},vr=function(e,t){var A=er(180),r=[];return OA(t).forEach(function(t,n){if(0===n){var i=t[0];if(20===i.type&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(A=ZA(t));if($A(i))return void(A=(JA.parse(e,i)+er(270))%er(360))}var s=fr(e,t);r.push(s)}),{angle:A,stops:r,type:1}},Cr=function(e,t){var A=er(180),r=[],n=1,i=0,s=3,a=[];return OA(t).forEach(function(t,A){var i=t[0];if(0===A){if(_A(i)&&"linear"===i.value)return void(n=1);if(_A(i)&&"radial"===i.value)return void(n=2)}if(18===i.type)if("from"===i.name){var s=tr.parse(e,i.values[0]);r.push({stop:RA,color:s})}else if("to"===i.name)s=tr.parse(e,i.values[0]),r.push({stop:KA,color:s});else if("color-stop"===i.name){var a=i.values.filter(HA);if(2===a.length){s=tr.parse(e,a[1]);var o=a[0];LA(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:s})}}}),1===n?{angle:(A+er(180))%er(360),stops:r,type:n}:{size:s,shape:i,stops:r,position:a,type:n}},xr="closest-side",Fr="farthest-side",Qr="closest-corner",Ur="farthest-corner",Sr="circle",Er="ellipse",Nr="cover",Lr="contain",_r=function(e,t){var A=0,r=3,n=[],i=[];return OA(t).forEach(function(t,s){var a=!0;if(0===s){var o=!1;a=t.reduce(function(e,t){if(o)if(_A(t))switch(t.value){case"center":return i.push(VA),e;case"top":case"left":return i.push(RA),e;case"right":case"bottom":return i.push(KA),e}else(MA(t)||DA(t))&&i.push(t);else if(_A(t))switch(t.value){case Sr:return A=0,!1;case Er:return A=1,!1;case"at":return o=!0,!1;case xr:return r=0,!1;case Nr:case Fr:return r=1,!1;case Lr:case Qr:return r=2,!1;case Ur:return r=3,!1}else if(DA(t)||MA(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},a)}if(a){var l=fr(e,t);n.push(l)}}),{size:r,shape:A,stops:n,position:i,type:2}},Ir=function(e,t){var A=0,r=3,n=[],i=[];return OA(t).forEach(function(t,s){var a=!0;if(0===s?a=t.reduce(function(e,t){if(_A(t))switch(t.value){case"center":return i.push(VA),!1;case"top":case"left":return i.push(RA),!1;case"right":case"bottom":return i.push(KA),!1}else if(MA(t)||DA(t))return i.push(t),!1;return e},a):1===s&&(a=t.reduce(function(e,t){if(_A(t))switch(t.value){case Sr:return A=0,!1;case Er:return A=1,!1;case Lr:case xr:return r=0,!1;case Fr:return r=1,!1;case Qr:return r=2,!1;case Nr:case Ur:return r=3,!1}else if(DA(t)||MA(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},a)),a){var o=fr(e,t);n.push(o)}}),{size:r,shape:A,stops:n,position:i,type:2}},kr=function(e){return 1===e.type},Tr=function(e){return 2===e.type},Hr={name:"image",parse:function(e,t){if(22===t.type){var A={url:t.value,type:0};return e.cache.addImage(t.value),A}if(18===t.type){var r=Dr[t.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Or(e){return!(20===e.type&&"none"===e.value||18===e.type&&!Dr[e.name])}var Pr,Dr={"linear-gradient":yr,"-moz-linear-gradient":vr,"-ms-linear-gradient":vr,"-o-linear-gradient":vr,"-webkit-linear-gradient":vr,"radial-gradient":_r,"-moz-radial-gradient":Ir,"-ms-radial-gradient":Ir,"-o-radial-gradient":Ir,"-webkit-radial-gradient":Ir,"-webkit-gradient":Cr},Mr={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t.filter(function(e){return HA(e)&&Or(e)}).map(function(t){return Hr.parse(e,t)})}},jr={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(_A(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Rr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return OA(t).map(function(e){return e.filter(MA)}).map(jA)}},Vr={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return OA(t).map(function(e){return e.filter(_A).map(function(e){return e.value}).join(" ")}).map(Kr)}},Kr=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Pr||(Pr={}));var Gr,zr={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return OA(t).map(function(e){return e.filter(qr)})}},qr=function(e){return _A(e)||MA(e)},Wr=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Xr=Wr("top"),Yr=Wr("right"),Jr=Wr("bottom"),$r=Wr("left"),Zr=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return jA(t.filter(MA))}}},en=Zr("top-left"),tn=Zr("top-right"),An=Zr("bottom-right"),rn=Zr("bottom-left"),nn=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sn=nn("top"),an=nn("right"),on=nn("bottom"),ln=nn("left"),cn=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return NA(t)?t.number:0}}},un=cn("top"),hn=cn("right"),dn=cn("bottom"),fn=cn("left"),pn={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},gn={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},mn={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).reduce(function(e,t){return e|wn(t.value)},0)}},wn=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Bn={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bn={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Gr||(Gr={}));var yn,vn={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Gr.STRICT:Gr.NORMAL}},Cn={name:"line-height",initialValue:"normal",prefix:!1,type:4},xn=function(e,t){return _A(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:MA(e)?zA(e,t):t},Fn={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Hr.parse(e,t)}},Qn={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Un={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Sn=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},En=Sn("top"),Nn=Sn("right"),Ln=Sn("bottom"),_n=Sn("left"),In={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},kn={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Tn=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Hn=Tn("top"),On=Tn("right"),Pn=Tn("bottom"),Dn=Tn("left"),Mn={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jn={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Rn={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&kA(t[0],"none")?[]:OA(t).map(function(t){for(var A={color:ur.TRANSPARENT,offsetX:RA,offsetY:RA,blur:RA},r=0,n=0;n<t.length;n++){var i=t[n];DA(i)?(0===r?A.offsetX=i:1===r?A.offsetY=i:A.blur=i,r++):A.color=tr.parse(e,i)}return A})}},Vn={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Kn={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var A=qn[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return A(t.values)}return null}},Gn=function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},zn=function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),A=t[0],r=t[1];t[2],t[3];var n=t[4],i=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var s=t[12],a=t[13];return t[14],t[15],16===t.length?[A,r,n,i,s,a]:null},qn={matrix:Gn,matrix3d:zn},Wn={type:16,number:50,flags:Ge},Xn=[Wn,Wn],Yn={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var A=t.filter(MA);return 2!==A.length?Xn:[A[0],A[1]]}},Jn={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(yn||(yn={}));for(var $n={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return yn.BREAK_ALL;case"keep-all":return yn.KEEP_ALL;default:return yn.NORMAL}}},Zn={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(LA(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},ei={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},ti={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return LA(t)?t.number:1}},Ai={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ri={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},ni={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var A=[],r=[];return t.forEach(function(e){switch(e.type){case 20:case 0:A.push(e.value);break;case 17:A.push(e.number.toString());break;case 4:r.push(A.join(" ")),A.length=0}}),A.length&&r.push(A.join(" ")),r.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},ii={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},si={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return LA(t)?t.number:_A(t)&&"bold"===t.value?700:400}},ai={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(_A).map(function(e){return e.value})}},oi={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},li=function(e,t){return 0!==(e&t)},ci={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t}},ui={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;for(var r=[],n=t.filter(TA),i=0;i<n.length;i++){var s=n[i],a=n[i+1];if(20===s.type){var o=a&&LA(a)?a.number:1;r.push({counter:s.value,increment:o})}}return r}},hi={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var A=[],r=t.filter(TA),n=0;n<r.length;n++){var i=r[n],s=r[n+1];if(_A(i)&&"none"!==i.value){var a=s&&LA(s)?s.number:0;A.push({counter:i.value,reset:a})}}return A}},di={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(NA).map(function(t){return ei.parse(e,t)})}},fi={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;var r=[],n=t.filter(IA);if(n.length%2!=0)return null;for(var i=0;i<n.length;i+=2){var s=n[i].value,a=n[i+1].value;r.push({open:s,close:a})}return r}},pi=function(e,t,A){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?A?r.open:r.close:""},gi={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&kA(t[0],"none")?[]:OA(t).map(function(t){for(var A={color:255,offsetX:RA,offsetY:RA,blur:RA,spread:RA,inset:!1},r=0,n=0;n<t.length;n++){var i=t[n];kA(i,"inset")?A.inset=!0:DA(i)?(0===r?A.offsetX=i:1===r?A.offsetY=i:2===r?A.blur=i:A.spread=i,r++):A.color=tr.parse(e,i)}return A})}},mi={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var A=[0,1,2],r=[];return t.filter(_A).forEach(function(e){switch(e.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2)}}),A.forEach(function(e){-1===r.indexOf(e)&&r.push(e)}),r}},wi={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Bi={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return NA(t)?t.number:0}},bi=function(){function e(e,t){var A,r;this.animationDuration=Ci(e,di,t.animationDuration),this.backgroundClip=Ci(e,hr,t.backgroundClip),this.backgroundColor=Ci(e,dr,t.backgroundColor),this.backgroundImage=Ci(e,Mr,t.backgroundImage),this.backgroundOrigin=Ci(e,jr,t.backgroundOrigin),this.backgroundPosition=Ci(e,Rr,t.backgroundPosition),this.backgroundRepeat=Ci(e,Vr,t.backgroundRepeat),this.backgroundSize=Ci(e,zr,t.backgroundSize),this.borderTopColor=Ci(e,Xr,t.borderTopColor),this.borderRightColor=Ci(e,Yr,t.borderRightColor),this.borderBottomColor=Ci(e,Jr,t.borderBottomColor),this.borderLeftColor=Ci(e,$r,t.borderLeftColor),this.borderTopLeftRadius=Ci(e,en,t.borderTopLeftRadius),this.borderTopRightRadius=Ci(e,tn,t.borderTopRightRadius),this.borderBottomRightRadius=Ci(e,An,t.borderBottomRightRadius),this.borderBottomLeftRadius=Ci(e,rn,t.borderBottomLeftRadius),this.borderTopStyle=Ci(e,sn,t.borderTopStyle),this.borderRightStyle=Ci(e,an,t.borderRightStyle),this.borderBottomStyle=Ci(e,on,t.borderBottomStyle),this.borderLeftStyle=Ci(e,ln,t.borderLeftStyle),this.borderTopWidth=Ci(e,un,t.borderTopWidth),this.borderRightWidth=Ci(e,hn,t.borderRightWidth),this.borderBottomWidth=Ci(e,dn,t.borderBottomWidth),this.borderLeftWidth=Ci(e,fn,t.borderLeftWidth),this.boxShadow=Ci(e,gi,t.boxShadow),this.color=Ci(e,pn,t.color),this.direction=Ci(e,gn,t.direction),this.display=Ci(e,mn,t.display),this.float=Ci(e,Bn,t.cssFloat),this.fontFamily=Ci(e,ni,t.fontFamily),this.fontSize=Ci(e,ii,t.fontSize),this.fontStyle=Ci(e,oi,t.fontStyle),this.fontVariant=Ci(e,ai,t.fontVariant),this.fontWeight=Ci(e,si,t.fontWeight),this.letterSpacing=Ci(e,bn,t.letterSpacing),this.lineBreak=Ci(e,vn,t.lineBreak),this.lineHeight=Ci(e,Cn,t.lineHeight),this.listStyleImage=Ci(e,Fn,t.listStyleImage),this.listStylePosition=Ci(e,Qn,t.listStylePosition),this.listStyleType=Ci(e,Un,t.listStyleType),this.marginTop=Ci(e,En,t.marginTop),this.marginRight=Ci(e,Nn,t.marginRight),this.marginBottom=Ci(e,Ln,t.marginBottom),this.marginLeft=Ci(e,_n,t.marginLeft),this.opacity=Ci(e,ti,t.opacity);var n=Ci(e,In,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=Ci(e,kn,t.overflowWrap),this.paddingTop=Ci(e,Hn,t.paddingTop),this.paddingRight=Ci(e,On,t.paddingRight),this.paddingBottom=Ci(e,Pn,t.paddingBottom),this.paddingLeft=Ci(e,Dn,t.paddingLeft),this.paintOrder=Ci(e,mi,t.paintOrder),this.position=Ci(e,jn,t.position),this.textAlign=Ci(e,Mn,t.textAlign),this.textDecorationColor=Ci(e,Ai,null!==(A=t.textDecorationColor)&&void 0!==A?A:t.color),this.textDecorationLine=Ci(e,ri,null!==(r=t.textDecorationLine)&&void 0!==r?r:t.textDecoration),this.textShadow=Ci(e,Rn,t.textShadow),this.textTransform=Ci(e,Vn,t.textTransform),this.transform=Ci(e,Kn,t.transform),this.transformOrigin=Ci(e,Yn,t.transformOrigin),this.visibility=Ci(e,Jn,t.visibility),this.webkitTextStrokeColor=Ci(e,wi,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Ci(e,Bi,t.webkitTextStrokeWidth),this.wordBreak=Ci(e,$n,t.wordBreak),this.zIndex=Ci(e,Zn,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return Ar(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return li(this.display,4)||li(this.display,33554432)||li(this.display,268435456)||li(this.display,536870912)||li(this.display,67108864)||li(this.display,134217728)},e}(),yi=function(){function e(e,t){this.content=Ci(e,ci,t.content),this.quotes=Ci(e,fi,t.quotes)}return e}(),vi=function(){function e(e,t){this.counterIncrement=Ci(e,ui,t.counterIncrement),this.counterReset=Ci(e,hi,t.counterReset)}return e}(),Ci=function(e,t,A){var r=new SA,n=null!=A?A.toString():t.initialValue;r.write(n);var i=new EA(r.read());switch(t.type){case 2:var s=i.parseComponentValue();return t.parse(e,_A(s)?s.value:t.initialValue);case 0:return t.parse(e,i.parseComponentValue());case 1:return t.parse(e,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(t.format){case"angle":return JA.parse(e,i.parseComponentValue());case"color":return tr.parse(e,i.parseComponentValue());case"image":return Hr.parse(e,i.parseComponentValue());case"length":var a=i.parseComponentValue();return DA(a)?a:RA;case"length-percentage":var o=i.parseComponentValue();return MA(o)?o:RA;case"time":return ei.parse(e,i.parseComponentValue())}}},xi="data-html2canvas-debug",Fi=function(e){switch(e.getAttribute(xi)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Qi=function(e,t){var A=Fi(e);return 1===A||t===A},Ui=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qi(t,3),this.styles=new bi(e,window.getComputedStyle(t,null)),fa(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=a(this.context,t),Qi(t,4)&&(this.flags|=16)}return e}(),Si="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Ei="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ni="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Li=0;Li<Ei.length;Li++)Ni[Ei.charCodeAt(Li)]=Li;for(var _i=function(e){var t,A,r,n,i,s=.75*e.length,a=e.length,o=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<a;t+=4)A=Ni[e.charCodeAt(t)],r=Ni[e.charCodeAt(t+1)],n=Ni[e.charCodeAt(t+2)],i=Ni[e.charCodeAt(t+3)],c[o++]=A<<2|r>>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&i;return l},Ii=function(e){for(var t=e.length,A=[],r=0;r<t;r+=2)A.push(e[r+1]<<8|e[r]);return A},ki=function(e){for(var t=e.length,A=[],r=0;r<t;r+=4)A.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return A},Ti=5,Hi=11,Oi=2,Pi=65536>>Ti,Di=(1<<Ti)-1,Mi=Pi+(1024>>Ti)+32,ji=65536>>Hi,Ri=(1<<Hi-Ti)-1,Vi=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},Ki=function(e,t,A){return e.slice?e.slice(t,A):new Uint32Array(Array.prototype.slice.call(e,t,A))},Gi=function(e,t){var A=_i(e),r=Array.isArray(A)?ki(A):new Uint32Array(A),n=Array.isArray(A)?Ii(A):new Uint16Array(A),i=24,s=Vi(n,i/2,r[4]/2),a=2===r[5]?Vi(n,(i+r[4])/2):Ki(r,Math.ceil((i+r[4])/4));return new zi(r[0],r[1],r[2],r[3],s,a)},zi=function(){function e(e,t,A,r,n,i){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=r,this.index=n,this.data=i}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>Ti])<<Oi)+(e&Di),this.data[t];if(e<=65535)return t=((t=this.index[Pi+(e-55296>>Ti)])<<Oi)+(e&Di),this.data[t];if(e<this.highStart)return t=Mi-ji+(e>>Hi),t=this.index[t],t+=e>>Ti&Ri,t=((t=this.index[t])<<Oi)+(e&Di),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xi=0;Xi<qi.length;Xi++)Wi[qi.charCodeAt(Xi)]=Xi;var Yi,Ji=1,$i=2,Zi=3,es=4,ts=5,As=7,rs=8,ns=9,is=10,ss=11,as=12,os=13,ls=14,cs=15,us=function(e){for(var t=[],A=0,r=e.length;A<r;){var n=e.charCodeAt(A++);if(n>=55296&&n<=56319&&A<r){var i=e.charCodeAt(A++);56320==(64512&i)?t.push(((1023&n)<<10)+(1023&i)+65536):(t.push(n),A--)}else t.push(n)}return t},hs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var r=[],n=-1,i="";++n<A;){var s=e[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===A||r.length>16384)&&(i+=String.fromCharCode.apply(String,r),r.length=0)}return i},ds=Gi(Si),fs="×",ps="÷",gs=function(e){return ds.get(e)},ms=function(e,t,A){var r=A-2,n=t[r],i=t[A-1],s=t[A];if(i===$i&&s===Zi)return fs;if(i===$i||i===Zi||i===es)return ps;if(s===$i||s===Zi||s===es)return ps;if(i===rs&&-1!==[rs,ns,ss,as].indexOf(s))return fs;if(!(i!==ss&&i!==ns||s!==ns&&s!==is))return fs;if((i===as||i===is)&&s===is)return fs;if(s===os||s===ts)return fs;if(s===As)return fs;if(i===Ji)return fs;if(i===os&&s===ls){for(;n===ts;)n=t[--r];if(n===ls)return fs}if(i===cs&&s===cs){for(var a=0;n===cs;)a++,n=t[--r];if(a%2==0)return fs}return ps},ws=function(e){var t=us(e),A=t.length,r=0,n=0,i=t.map(gs);return{next:function(){if(r>=A)return{done:!0,value:null};for(var e=fs;r<A&&(e=ms(t,i,++r))===fs;);if(e!==fs||r===A){var s=hs.apply(null,t.slice(n,r));return n=r,{value:s,done:!1}}return{done:!0,value:null}}}},Bs=function(e){for(var t,A=ws(e),r=[];!(t=A.next()).done;)t.value&&r.push(t.value.slice());return r},bs=function(e){var t=123;if(e.createRange){var A=e.createRange();if(A.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=t+"px",r.style.display="block",e.body.appendChild(r),A.selectNode(r);var n=A.getBoundingClientRect(),i=Math.round(n.height);if(e.body.removeChild(r),i===t)return!0}}return!1},ys=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var A=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var r=t.firstChild,n=l(r.data).map(function(e){return c(e)}),i=0,s={},a=n.every(function(e,t){A.setStart(r,i),A.setEnd(r,i+e.length);var n=A.getBoundingClientRect();i+=e.length;var a=n.x>s.x||n.y>s.y;return s=n,0===t||a});return e.body.removeChild(t),a},vs=function(){return void 0!==(new Image).crossOrigin},Cs=function(){return"string"==typeof(new XMLHttpRequest).responseType},xs=function(e){var t=new Image,A=e.createElement("canvas"),r=A.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),A.toDataURL()}catch(e){return!1}return!0},Fs=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Qs=function(e){var t=e.createElement("canvas"),A=100;t.width=A,t.height=A;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,A,A);var n=new Image,i=t.toDataURL();n.src=i;var s=Us(A,A,0,0,n);return r.fillStyle="red",r.fillRect(0,0,A,A),Ss(s).then(function(t){r.drawImage(t,0,0);var n=r.getImageData(0,0,A,A).data;r.fillStyle="red",r.fillRect(0,0,A,A);var s=e.createElement("div");return s.style.backgroundImage="url("+i+")",s.style.height=A+"px",Fs(n)?Ss(Us(A,A,0,0,s)):Promise.reject(!1)}).then(function(e){return r.drawImage(e,0,0),Fs(r.getImageData(0,0,A,A).data)}).catch(function(){return!1})},Us=function(e,t,A,r,n){var i="http://www.w3.org/2000/svg",s=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",A.toString()),a.setAttributeNS(null,"y",r.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(a),a.appendChild(n),s},Ss=function(e){return new Promise(function(t,A){var r=new Image;r.onload=function(){return t(r)},r.onerror=A,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},Es={get SUPPORT_RANGE_BOUNDS(){var e=bs(document);return Object.defineProperty(Es,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Es.SUPPORT_RANGE_BOUNDS&&ys(document);return Object.defineProperty(Es,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=xs(document);return Object.defineProperty(Es,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?Qs(document):Promise.resolve(!1);return Object.defineProperty(Es,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=vs();return Object.defineProperty(Es,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=Cs();return Object.defineProperty(Es,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Es,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Es,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Ns=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),Ls=function(e,t,A,r){var n=Hs(t,A),i=[],a=0;return n.forEach(function(t){if(A.textDecorationLine.length||t.trim().length>0)if(Es.SUPPORT_RANGE_BOUNDS){var n=Is(r,a,t.length).getClientRects();if(n.length>1){var o=ks(t),l=0;o.forEach(function(t){i.push(new Ns(t,s.fromDOMRectList(e,Is(r,l+a,t.length).getClientRects()))),l+=t.length})}else i.push(new Ns(t,s.fromDOMRectList(e,n)))}else{var c=r.splitText(t.length);i.push(new Ns(t,_s(e,r))),r=c}else Es.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));a+=t.length}),i},_s=function(e,t){var A=t.ownerDocument;if(A){var r=A.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var n=t.parentNode;if(n){n.replaceChild(r,t);var i=a(e,r);return r.firstChild&&n.replaceChild(r.firstChild,r),i}}return s.EMPTY},Is=function(e,t,A){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(e,t),n.setEnd(e,t+A),n},ks=function(e){if(Es.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return Bs(e)},Ts=function(e,t){if(Es.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return Ps(e,t)},Hs=function(e,t){return 0!==t.letterSpacing?ks(e):Ts(e,t)},Os=[32,160,4961,65792,65793,4153,4241],Ps=function(e,t){for(var A,r=Re(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),n=[],i=function(){if(A.value){var e=A.value.slice(),t=l(e),r="";t.forEach(function(e){-1===Os.indexOf(e)?r+=c(e):(r.length&&n.push(r),n.push(c(e)),r="")}),r.length&&n.push(r)}};!(A=r.next()).done;)i();return n},Ds=function(){function e(e,t,A){this.text=Ms(t.data,A.textTransform),this.textBounds=Ls(e,this.text,A,t)}return e}(),Ms=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(js,Rs);case 2:return e.toUpperCase();default:return e}},js=/(^|\s|:|-|\(|\))([a-z])/g,Rs=function(e,t,A){return e.length>0?t+A.toUpperCase():e},Vs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.src=A.currentSrc||A.src,r.intrinsicWidth=A.naturalWidth,r.intrinsicHeight=A.naturalHeight,r.context.cache.addImage(r.src),r}return t(A,e),A}(Ui),Ks=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.canvas=A,r.intrinsicWidth=A.width,r.intrinsicHeight=A.height,r}return t(A,e),A}(Ui),Gs=function(e){function A(t,A){var r=e.call(this,t,A)||this,n=new XMLSerializer,i=a(t,A);return A.setAttribute("width",i.width+"px"),A.setAttribute("height",i.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(A)),r.intrinsicWidth=A.width.baseVal.value,r.intrinsicHeight=A.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t(A,e),A}(Ui),zs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.value=A.value,r}return t(A,e),A}(Ui),qs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.start=A.start,r.reversed="boolean"==typeof A.reversed&&!0===A.reversed,r}return t(A,e),A}(Ui),Ws=[{type:15,flags:0,unit:"px",number:3}],Xs=[{type:16,flags:0,number:50}],Ys=function(e){return e.width>e.height?new s(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new s(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},Js=function(e){var t=e.type===ea?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},$s="checkbox",Zs="radio",ea="password",ta=707406591,Aa=function(e){function A(t,A){var r=e.call(this,t,A)||this;switch(r.type=A.type.toLowerCase(),r.checked=A.checked,r.value=Js(A),r.type!==$s&&r.type!==Zs||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=Ys(r.bounds)),r.type){case $s:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Ws;break;case Zs:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Xs}return r}return t(A,e),A}(Ui),ra=function(e){function A(t,A){var r=e.call(this,t,A)||this,n=A.options[A.selectedIndex||0];return r.value=n&&n.text||"",r}return t(A,e),A}(Ui),na=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.value=A.value,r}return t(A,e),A}(Ui),ia=function(e){function A(t,A){var r=e.call(this,t,A)||this;r.src=A.src,r.width=parseInt(A.width,10)||0,r.height=parseInt(A.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{if(A.contentWindow&&A.contentWindow.document&&A.contentWindow.document.documentElement){r.tree=la(t,A.contentWindow.document.documentElement);var n=A.contentWindow.document.documentElement?cr(t,getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):ur.TRANSPARENT,i=A.contentWindow.document.body?cr(t,getComputedStyle(A.contentWindow.document.body).backgroundColor):ur.TRANSPARENT;r.backgroundColor=Ar(n)?Ar(i)?r.styles.backgroundColor:i:n}}catch(e){}return r}return t(A,e),A}(Ui),sa=["OL","UL","MENU"],aa=function(e,t,A,r){for(var n=t.firstChild,i=void 0;n;n=i)if(i=n.nextSibling,ha(n)&&n.data.trim().length>0)A.textNodes.push(new Ds(e,n,A.styles));else if(da(n))if(Na(n)&&n.assignedNodes)n.assignedNodes().forEach(function(t){return aa(e,t,A,r)});else{var s=oa(e,n);s.styles.isVisible()&&(ca(n,s,r)?s.flags|=4:ua(s.styles)&&(s.flags|=2),-1!==sa.indexOf(n.tagName)&&(s.flags|=8),A.elements.push(s),n.slot,n.shadowRoot?aa(e,n.shadowRoot,s,r):Sa(n)||ba(n)||Ea(n)||aa(e,n,s,r))}},oa=function(e,t){return xa(t)?new Vs(e,t):va(t)?new Ks(e,t):ba(t)?new Gs(e,t):ga(t)?new zs(e,t):ma(t)?new qs(e,t):wa(t)?new Aa(e,t):Ea(t)?new ra(e,t):Sa(t)?new na(e,t):Fa(t)?new ia(e,t):new Ui(e,t)},la=function(e,t){var A=oa(e,t);return A.flags|=4,aa(e,t,A,A),A},ca=function(e,t,A){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ya(e)&&A.styles.isTransparent()},ua=function(e){return e.isPositioned()||e.isFloating()},ha=function(e){return e.nodeType===Node.TEXT_NODE},da=function(e){return e.nodeType===Node.ELEMENT_NODE},fa=function(e){return da(e)&&void 0!==e.style&&!pa(e)},pa=function(e){return"object"==typeof e.className},ga=function(e){return"LI"===e.tagName},ma=function(e){return"OL"===e.tagName},wa=function(e){return"INPUT"===e.tagName},Ba=function(e){return"HTML"===e.tagName},ba=function(e){return"svg"===e.tagName},ya=function(e){return"BODY"===e.tagName},va=function(e){return"CANVAS"===e.tagName},Ca=function(e){return"VIDEO"===e.tagName},xa=function(e){return"IMG"===e.tagName},Fa=function(e){return"IFRAME"===e.tagName},Qa=function(e){return"STYLE"===e.tagName},Ua=function(e){return"SCRIPT"===e.tagName},Sa=function(e){return"TEXTAREA"===e.tagName},Ea=function(e){return"SELECT"===e.tagName},Na=function(e){return"SLOT"===e.tagName},La=function(e){return e.tagName.indexOf("-")>0},_a=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,A=e.counterIncrement,r=e.counterReset,n=!0;null!==A&&A.forEach(function(e){var A=t.counters[e.counter];A&&0!==e.increment&&(n=!1,A.length||A.push(1),A[Math.max(0,A.length-1)]+=e.increment)});var i=[];return n&&r.forEach(function(e){var A=t.counters[e.counter];i.push(e.counter),A||(A=t.counters[e.counter]=[]),A.push(e.reset)}),i},e}(),Ia={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},ka={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Ta={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Ha={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Oa=function(e,t,A,r,n,i){return e<t||e>A?Ya(e,n,i.length>0):r.integers.reduce(function(t,A,n){for(;e>=A;)e-=A,t+=r.values[n];return t},"")+i},Pa=function(e,t,A,r){var n="";do{A||e--,n=r(e)+n,e/=t}while(e*t>=t);return n},Da=function(e,t,A,r,n){var i=A-t+1;return(e<0?"-":"")+(Pa(Math.abs(e),i,r,function(e){return c(Math.floor(e%i)+t)})+n)},Ma=function(e,t,A){void 0===A&&(A=". ");var r=t.length;return Pa(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+A},ja=1,Ra=2,Va=4,Ka=8,Ga=function(e,t,A,r,n,i){if(e<-9999||e>9999)return Ya(e,4,n.length>0);var s=Math.abs(e),a=n;if(0===s)return t[0]+a;for(var o=0;s>0&&o<=4;o++){var l=s%10;0===l&&li(i,ja)&&""!==a?a=t[l]+a:l>1||1===l&&0===o||1===l&&1===o&&li(i,Ra)||1===l&&1===o&&li(i,Va)&&e>100||1===l&&o>1&&li(i,Ka)?a=t[l]+(o>0?A[o-1]:"")+a:1===l&&o>0&&(a=A[o-1]+a),s=Math.floor(s/10)}return(e<0?r:"")+a},za="十百千萬",qa="拾佰仟萬",Wa="マイナス",Xa="마이너스",Ya=function(e,t,A){var r=A?". ":"",n=A?"、":"",i=A?", ":"",s=A?" ":"";switch(t){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var a=Da(e,48,57,!0,r);return a.length<4?"0"+a:a;case 4:return Ma(e,"〇一二三四五六七八九",n);case 6:return Oa(e,1,3999,Ia,3,r).toLowerCase();case 7:return Oa(e,1,3999,Ia,3,r);case 8:return Da(e,945,969,!1,r);case 9:return Da(e,97,122,!1,r);case 10:return Da(e,65,90,!1,r);case 11:return Da(e,1632,1641,!0,r);case 12:case 49:return Oa(e,1,9999,ka,3,r);case 35:return Oa(e,1,9999,ka,3,r).toLowerCase();case 13:return Da(e,2534,2543,!0,r);case 14:case 30:return Da(e,6112,6121,!0,r);case 15:return Ma(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return Ma(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return Ga(e,"零一二三四五六七八九",za,"負",n,Ra|Va|Ka);case 47:return Ga(e,"零壹貳參肆伍陸柒捌玖",qa,"負",n,ja|Ra|Va|Ka);case 42:return Ga(e,"零一二三四五六七八九",za,"负",n,Ra|Va|Ka);case 41:return Ga(e,"零壹贰叁肆伍陆柒捌玖",qa,"负",n,ja|Ra|Va|Ka);case 26:return Ga(e,"〇一二三四五六七八九","十百千万",Wa,n,0);case 25:return Ga(e,"零壱弐参四伍六七八九","拾百千万",Wa,n,ja|Ra|Va);case 31:return Ga(e,"영일이삼사오육칠팔구","십백천만",Xa,i,ja|Ra|Va);case 33:return Ga(e,"零一二三四五六七八九","十百千萬",Xa,i,0);case 32:return Ga(e,"零壹貳參四五六七八九","拾百千",Xa,i,ja|Ra|Va);case 18:return Da(e,2406,2415,!0,r);case 20:return Oa(e,1,19999,Ha,3,r);case 21:return Da(e,2790,2799,!0,r);case 22:return Da(e,2662,2671,!0,r);case 22:return Oa(e,1,10999,Ta,3,r);case 23:return Ma(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ma(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Da(e,3302,3311,!0,r);case 28:return Ma(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return Ma(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return Da(e,3792,3801,!0,r);case 37:return Da(e,6160,6169,!0,r);case 38:return Da(e,4160,4169,!0,r);case 39:return Da(e,2918,2927,!0,r);case 40:return Da(e,1776,1785,!0,r);case 43:return Da(e,3046,3055,!0,r);case 44:return Da(e,3174,3183,!0,r);case 45:return Da(e,3664,3673,!0,r);case 46:return Da(e,3872,3881,!0,r);default:return Da(e,48,57,!0,r)}},Ja="data-html2canvas-ignore",$a=function(){function e(e,t,A){if(this.context=e,this.options=A,this.scrolledElements=[],this.referenceElement=t,this.counters=new _a,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var A=this,i=eo(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,o=i.contentWindow,l=o.document,c=ro(i).then(function(){return r(A,void 0,void 0,function(){var e,A;return n(this,function(r){switch(r.label){case 0:return this.scrolledElements.forEach(oo),o&&(o.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===t.top&&o.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(A=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Ao(l)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(l,A)}).then(function(){return i})]:[2,i]}})})});return l.open(),l.write(so(document.doctype)+"<html></html>"),ao(this.referenceElement.ownerDocument,s,a),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),c},e.prototype.createElementClone=function(e){if(Qi(e,2),va(e))return this.createCanvasClone(e);if(Ca(e))return this.createVideoClone(e);if(Qa(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return xa(t)&&(xa(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),La(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return io(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var A=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),r=e.cloneNode(!1);return r.textContent=A,r}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var A=e.ownerDocument.createElement("img");try{return A.src=e.toDataURL(),A}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var n=e.getContext("2d"),i=r.getContext("2d");if(i)if(!this.options.allowTaint&&n)i.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var s=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(s){var a=s.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}i.drawImage(e,0,0)}return r}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var A=t.getContext("2d");try{return A&&(A.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||A.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,A){da(t)&&(Ua(t)||t.hasAttribute(Ja)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&da(t)&&Qa(t)||e.appendChild(this.cloneNode(t,A))},e.prototype.cloneChildNodes=function(e,t,A){for(var r=this,n=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;n;n=n.nextSibling)if(da(n)&&Na(n)&&"function"==typeof n.assignedNodes){var i=n.assignedNodes();i.length&&i.forEach(function(e){return r.appendChildNode(t,e,A)})}else this.appendChildNode(t,n,A)},e.prototype.cloneNode=function(e,t){if(ha(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var A=e.ownerDocument.defaultView;if(A&&da(e)&&(fa(e)||pa(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var n=A.getComputedStyle(e),i=A.getComputedStyle(e,":before"),s=A.getComputedStyle(e,":after");this.referenceElement===e&&fa(r)&&(this.clonedReferenceElement=r),ya(r)&&po(r);var a=this.counters.parse(new vi(this.context,n)),o=this.resolvePseudoContent(e,r,i,Yi.BEFORE);La(e)&&(t=!0),Ca(e)||this.cloneChildNodes(e,r,t),o&&r.insertBefore(o,r.firstChild);var l=this.resolvePseudoContent(e,r,s,Yi.AFTER);return l&&r.appendChild(l),this.counters.pop(a),(n&&(this.options.copyStyles||pa(e))&&!Fa(e)||t)&&io(n,r),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(Sa(e)||Ea(e))&&(Sa(r)||Ea(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,A,r){var n=this;if(A){var i=A.content,s=t.ownerDocument;if(s&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==A.display){this.counters.parse(new vi(this.context,A));var a=new yi(this.context,A),o=s.createElement("html2canvaspseudoelement");io(A,o),a.content.forEach(function(t){if(0===t.type)o.appendChild(s.createTextNode(t.value));else if(22===t.type){var A=s.createElement("img");A.src=t.value,A.style.opacity="1",o.appendChild(A)}else if(18===t.type){if("attr"===t.name){var r=t.values.filter(_A);r.length&&o.appendChild(s.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var i=t.values.filter(HA),l=i[0],c=i[1];if(l&&_A(l)){var u=n.counters.getCounterValue(l.value),h=c&&_A(c)?Un.parse(n.context,c.value):3;o.appendChild(s.createTextNode(Ya(u,h,!1)))}}else if("counters"===t.name){var d=t.values.filter(HA),f=(l=d[0],d[1]);if(c=d[2],l&&_A(l)){var p=n.counters.getCounterValues(l.value),g=c&&_A(c)?Un.parse(n.context,c.value):3,m=f&&0===f.type?f.value:"",w=p.map(function(e){return Ya(e,g,!1)}).join(m);o.appendChild(s.createTextNode(w))}}}else if(20===t.type)switch(t.value){case"open-quote":o.appendChild(s.createTextNode(pi(a.quotes,n.quoteDepth++,!0)));break;case"close-quote":o.appendChild(s.createTextNode(pi(a.quotes,--n.quoteDepth,!1)));break;default:o.appendChild(s.createTextNode(t.value))}}),o.className=uo+" "+ho;var l=r===Yi.BEFORE?" "+uo:" "+ho;return pa(t)?t.className.baseValue+=l:t.className+=l,o}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Yi||(Yi={}));var Za,eo=function(e,t){var A=e.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=t.width.toString(),A.height=t.height.toString(),A.scrolling="no",A.setAttribute(Ja,"true"),e.body.appendChild(A),A},to=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},Ao=function(e){return Promise.all([].slice.call(e.images,0).map(to))},ro=function(e){return new Promise(function(t,A){var r=e.contentWindow;if(!r)return A("No window assigned for iframe");var n=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var A=setInterval(function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(A),t(e))},50)}})},no=["all","d","content"],io=function(e,t){for(var A=e.length-1;A>=0;A--){var r=e.item(A);-1===no.indexOf(r)&&t.style.setProperty(r,e.getPropertyValue(r))}return t},so=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},ao=function(e,t,A){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||A!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,A)},oo=function(e){var t=e[0],A=e[1],r=e[2];t.scrollLeft=A,t.scrollTop=r},lo=":before",co=":after",uo="___html2canvas___pseudoelement_before",ho="___html2canvas___pseudoelement_after",fo='{\n content: "" !important;\n display: none !important;\n}',po=function(e){go(e,"."+uo+lo+fo+"\n ."+ho+co+fo)},go=function(e,t){var A=e.ownerDocument;if(A){var r=A.createElement("style");r.textContent=t,e.appendChild(r)}},mo=function(){function e(){}return e.getOrigin=function(t){var A=e._link;return A?(A.href=t,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),wo=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Fo(e)||vo(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s=this;return n(this,function(n){switch(n.label){case 0:return t=mo.isSameOrigin(e),A=!Co(e)&&!0===this._options.useCORS&&Es.SUPPORT_CORS_IMAGES&&!t,r=!Co(e)&&!t&&!Fo(e)&&"string"==typeof this._options.proxy&&Es.SUPPORT_CORS_XHR&&!A,t||!1!==this._options.allowTaint||Co(e)||Fo(e)||r||A?(i=e,r?[4,this.proxy(i)]:[3,2]):[2];case 1:i=n.sent(),n.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(xo(i)||A)&&(r.crossOrigin="anonymous"),r.src=i,!0===r.complete&&setTimeout(function(){return e(r)},500),s._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,n.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(n,i){var s=Es.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===s)n(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return n(e.result)},!1),e.addEventListener("error",function(e){return i(e)},!1),e.readAsDataURL(a.response)}else i("Failed to proxy resource "+r+" with status code "+a.status)},a.onerror=i;var o=A.indexOf("?")>-1?"&":"?";if(a.open("GET",""+A+o+"url="+encodeURIComponent(e)+"&responseType="+s),"text"!==s&&a instanceof XMLHttpRequest&&(a.responseType=s),t._options.imageTimeout){var l=t._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+r)}}a.send()})},e}(),Bo=/^data:image\/svg\+xml/i,bo=/^data:image\/.*;base64,/i,yo=/^data:image\/.*/i,vo=function(e){return Es.SUPPORT_SVG_DRAWING||!Qo(e)},Co=function(e){return yo.test(e)},xo=function(e){return bo.test(e)},Fo=function(e){return"blob"===e.substr(0,4)},Qo=function(e){return"svg"===e.substr(-3).toLowerCase()||Bo.test(e)},Uo=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,A){return new e(this.x+t,this.y+A)},e}(),So=function(e,t,A){return new Uo(e.x+(t.x-e.x)*A,e.y+(t.y-e.y)*A)},Eo=function(){function e(e,t,A,r){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=r}return e.prototype.subdivide=function(t,A){var r=So(this.start,this.startControl,t),n=So(this.startControl,this.endControl,t),i=So(this.endControl,this.end,t),s=So(r,n,t),a=So(n,i,t),o=So(s,a,t);return A?new e(this.start,r,s,o):new e(o,a,i,this.end)},e.prototype.add=function(t,A){return new e(this.start.add(t,A),this.startControl.add(t,A),this.endControl.add(t,A),this.end.add(t,A))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),No=function(e){return 1===e.type},Lo=function(){function e(e){var t=e.styles,A=e.bounds,r=GA(t.borderTopLeftRadius,A.width,A.height),n=r[0],i=r[1],s=GA(t.borderTopRightRadius,A.width,A.height),a=s[0],o=s[1],l=GA(t.borderBottomRightRadius,A.width,A.height),c=l[0],u=l[1],h=GA(t.borderBottomLeftRadius,A.width,A.height),d=h[0],f=h[1],p=[];p.push((n+a)/A.width),p.push((d+c)/A.width),p.push((i+f)/A.height),p.push((o+u)/A.height);var g=Math.max.apply(Math,p);g>1&&(n/=g,i/=g,a/=g,o/=g,c/=g,u/=g,d/=g,f/=g);var m=A.width-a,w=A.height-u,B=A.width-c,b=A.height-f,y=t.borderTopWidth,v=t.borderRightWidth,C=t.borderBottomWidth,x=t.borderLeftWidth,F=zA(t.paddingTop,e.bounds.width),Q=zA(t.paddingRight,e.bounds.width),U=zA(t.paddingBottom,e.bounds.width),S=zA(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||i>0?_o(A.left+x/3,A.top+y/3,n-x/3,i-y/3,Za.TOP_LEFT):new Uo(A.left+x/3,A.top+y/3),this.topRightBorderDoubleOuterBox=n>0||i>0?_o(A.left+m,A.top+y/3,a-v/3,o-y/3,Za.TOP_RIGHT):new Uo(A.left+A.width-v/3,A.top+y/3),this.bottomRightBorderDoubleOuterBox=c>0||u>0?_o(A.left+B,A.top+w,c-v/3,u-C/3,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v/3,A.top+A.height-C/3),this.bottomLeftBorderDoubleOuterBox=d>0||f>0?_o(A.left+x/3,A.top+b,d-x/3,f-C/3,Za.BOTTOM_LEFT):new Uo(A.left+x/3,A.top+A.height-C/3),this.topLeftBorderDoubleInnerBox=n>0||i>0?_o(A.left+2*x/3,A.top+2*y/3,n-2*x/3,i-2*y/3,Za.TOP_LEFT):new Uo(A.left+2*x/3,A.top+2*y/3),this.topRightBorderDoubleInnerBox=n>0||i>0?_o(A.left+m,A.top+2*y/3,a-2*v/3,o-2*y/3,Za.TOP_RIGHT):new Uo(A.left+A.width-2*v/3,A.top+2*y/3),this.bottomRightBorderDoubleInnerBox=c>0||u>0?_o(A.left+B,A.top+w,c-2*v/3,u-2*C/3,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-2*v/3,A.top+A.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=d>0||f>0?_o(A.left+2*x/3,A.top+b,d-2*x/3,f-2*C/3,Za.BOTTOM_LEFT):new Uo(A.left+2*x/3,A.top+A.height-2*C/3),this.topLeftBorderStroke=n>0||i>0?_o(A.left+x/2,A.top+y/2,n-x/2,i-y/2,Za.TOP_LEFT):new Uo(A.left+x/2,A.top+y/2),this.topRightBorderStroke=n>0||i>0?_o(A.left+m,A.top+y/2,a-v/2,o-y/2,Za.TOP_RIGHT):new Uo(A.left+A.width-v/2,A.top+y/2),this.bottomRightBorderStroke=c>0||u>0?_o(A.left+B,A.top+w,c-v/2,u-C/2,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v/2,A.top+A.height-C/2),this.bottomLeftBorderStroke=d>0||f>0?_o(A.left+x/2,A.top+b,d-x/2,f-C/2,Za.BOTTOM_LEFT):new Uo(A.left+x/2,A.top+A.height-C/2),this.topLeftBorderBox=n>0||i>0?_o(A.left,A.top,n,i,Za.TOP_LEFT):new Uo(A.left,A.top),this.topRightBorderBox=a>0||o>0?_o(A.left+m,A.top,a,o,Za.TOP_RIGHT):new Uo(A.left+A.width,A.top),this.bottomRightBorderBox=c>0||u>0?_o(A.left+B,A.top+w,c,u,Za.BOTTOM_RIGHT):new Uo(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=d>0||f>0?_o(A.left,A.top+b,d,f,Za.BOTTOM_LEFT):new Uo(A.left,A.top+A.height),this.topLeftPaddingBox=n>0||i>0?_o(A.left+x,A.top+y,Math.max(0,n-x),Math.max(0,i-y),Za.TOP_LEFT):new Uo(A.left+x,A.top+y),this.topRightPaddingBox=a>0||o>0?_o(A.left+Math.min(m,A.width-v),A.top+y,m>A.width+v?0:Math.max(0,a-v),Math.max(0,o-y),Za.TOP_RIGHT):new Uo(A.left+A.width-v,A.top+y),this.bottomRightPaddingBox=c>0||u>0?_o(A.left+Math.min(B,A.width-x),A.top+Math.min(w,A.height-C),Math.max(0,c-v),Math.max(0,u-C),Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v,A.top+A.height-C),this.bottomLeftPaddingBox=d>0||f>0?_o(A.left+x,A.top+Math.min(b,A.height-C),Math.max(0,d-x),Math.max(0,f-C),Za.BOTTOM_LEFT):new Uo(A.left+x,A.top+A.height-C),this.topLeftContentBox=n>0||i>0?_o(A.left+x+S,A.top+y+F,Math.max(0,n-(x+S)),Math.max(0,i-(y+F)),Za.TOP_LEFT):new Uo(A.left+x+S,A.top+y+F),this.topRightContentBox=a>0||o>0?_o(A.left+Math.min(m,A.width+x+S),A.top+y+F,m>A.width+x+S?0:a-x+S,o-(y+F),Za.TOP_RIGHT):new Uo(A.left+A.width-(v+Q),A.top+y+F),this.bottomRightContentBox=c>0||u>0?_o(A.left+Math.min(B,A.width-(x+S)),A.top+Math.min(w,A.height+y+F),Math.max(0,c-(v+Q)),u-(C+U),Za.BOTTOM_RIGHT):new Uo(A.left+A.width-(v+Q),A.top+A.height-(C+U)),this.bottomLeftContentBox=d>0||f>0?_o(A.left+x+S,A.top+b,Math.max(0,d-(x+S)),f-(C+U),Za.BOTTOM_LEFT):new Uo(A.left+x+S,A.top+A.height-(C+U))}return e}();!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Za||(Za={}));var _o=function(e,t,A,r,n){var i=(Math.sqrt(2)-1)/3*4,s=A*i,a=r*i,o=e+A,l=t+r;switch(n){case Za.TOP_LEFT:return new Eo(new Uo(e,l),new Uo(e,l-a),new Uo(o-s,t),new Uo(o,t));case Za.TOP_RIGHT:return new Eo(new Uo(e,t),new Uo(e+s,t),new Uo(o,l-a),new Uo(o,l));case Za.BOTTOM_RIGHT:return new Eo(new Uo(o,t),new Uo(o,t+a),new Uo(e+s,l),new Uo(e,l));case Za.BOTTOM_LEFT:default:return new Eo(new Uo(o,l),new Uo(o-s,l),new Uo(e,t+a),new Uo(e,t))}},Io=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},ko=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},To=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Ho=function(){function e(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6}return e}(),Oo=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Po=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Do=function(e){return 0===e.type},Mo=function(e){return 1===e.type},jo=function(e){return 2===e.type},Ro=function(e,t){return e.length===t.length&&e.some(function(e,A){return e===t[A]})},Vo=function(e,t,A,r,n){return e.map(function(e,i){switch(i){case 0:return e.add(t,A);case 1:return e.add(t+r,A);case 2:return e.add(t+r,A+n);case 3:return e.add(t,A+n)}return e})},Ko=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Go=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Lo(this.container),this.container.styles.opacity<1&&this.effects.push(new Po(this.container.styles.opacity)),null!==this.container.styles.transform){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new Ho(A,r,n))}if(0!==this.container.styles.overflowX){var i=Io(this.curves),s=To(this.curves);Ro(i,s)?this.effects.push(new Oo(i,6)):(this.effects.push(new Oo(i,2)),this.effects.push(new Oo(s,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),A=this.parent,r=this.effects.slice(0);A;){var n=A.effects.filter(function(e){return!Mo(e)});if(t||0!==A.container.styles.position||!A.parent){if(r.unshift.apply(r,n),t=-1===[2,3].indexOf(A.container.styles.position),0!==A.container.styles.overflowX){var i=Io(A.curves),s=To(A.curves);Ro(i,s)||r.unshift(new Oo(s,6))}}else r.unshift.apply(r,n);A=A.parent}return r.filter(function(t){return li(t.target,e)})},e}(),zo=function(e,t,A,r){e.container.elements.forEach(function(n){var i=li(n.flags,4),s=li(n.flags,2),a=new Go(n,e);li(n.styles.display,2048)&&r.push(a);var o=li(n.flags,8)?[]:r;if(i||s){var l=i||n.styles.isPositioned()?A:t,c=new Ko(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var h=0;l.negativeZIndex.some(function(e,t){return u>e.element.container.styles.zIndex.order?(h=t,!1):h>0}),l.negativeZIndex.splice(h,0,c)}else if(u>0){var d=0;l.positiveZIndex.some(function(e,t){return u>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0}),l.positiveZIndex.splice(d,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);zo(a,c,i?c:A,o)}else n.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),zo(a,t,A,o);li(n.flags,8)&&qo(n,o)})},qo=function(e,t){for(var A=e instanceof qs?e.start:1,r=e instanceof qs&&e.reversed,n=0;n<t.length;n++){var i=t[n];i.container instanceof zs&&"number"==typeof i.container.value&&0!==i.container.value&&(A=i.container.value),i.listValue=Ya(A,i.container.styles.listStyleType,!0),A+=r?-1:1}},Wo=function(e){var t=new Go(e,null),A=new Ko(t),r=[];return zo(t,A,A,r),qo(t.container,r),A},Xo=function(e,t){switch(t){case 0:return el(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return el(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return el(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return el(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Yo=function(e,t){switch(t){case 0:return el(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return el(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return el(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return el(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Jo=function(e,t){switch(t){case 0:return el(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return el(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return el(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return el(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},$o=function(e,t){switch(t){case 0:return Zo(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Zo(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Zo(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Zo(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Zo=function(e,t){var A=[];return No(e)?A.push(e.subdivide(.5,!1)):A.push(e),No(t)?A.push(t.subdivide(.5,!0)):A.push(t),A},el=function(e,t,A,r){var n=[];return No(e)?n.push(e.subdivide(.5,!1)):n.push(e),No(A)?n.push(A.subdivide(.5,!0)):n.push(A),No(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),No(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},tl=function(e){var t=e.bounds,A=e.styles;return t.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Al=function(e){var t=e.styles,A=e.bounds,r=zA(t.paddingLeft,A.width),n=zA(t.paddingRight,A.width),i=zA(t.paddingTop,A.width),s=zA(t.paddingBottom,A.width);return A.add(r+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+n),-(t.borderTopWidth+t.borderBottomWidth+i+s))},rl=function(e,t){return 0===e?t.bounds:2===e?Al(t):tl(t)},nl=function(e,t){return 0===e?t.bounds:2===e?Al(t):tl(t)},il=function(e,t,A){var r=rl(ll(e.styles.backgroundOrigin,t),e),n=nl(ll(e.styles.backgroundClip,t),e),i=ol(ll(e.styles.backgroundSize,t),A,r),s=i[0],a=i[1],o=GA(ll(e.styles.backgroundPosition,t),r.width-s,r.height-a);return[cl(ll(e.styles.backgroundRepeat,t),o,i,r,n),Math.round(r.left+o[0]),Math.round(r.top+o[1]),s,a]},sl=function(e){return _A(e)&&e.value===Pr.AUTO},al=function(e){return"number"==typeof e},ol=function(e,t,A){var r=t[0],n=t[1],i=t[2],s=e[0],a=e[1];if(!s)return[0,0];if(MA(s)&&a&&MA(a))return[zA(s,A.width),zA(a,A.height)];var o=al(i);if(_A(s)&&(s.value===Pr.CONTAIN||s.value===Pr.COVER))return al(i)?A.width/A.height<i!=(s.value===Pr.COVER)?[A.width,A.width/i]:[A.height*i,A.height]:[A.width,A.height];var l=al(r),c=al(n),u=l||c;if(sl(s)&&(!a||sl(a)))return l&&c?[r,n]:o||u?u&&o?[l?r:n*i,c?n:r/i]:[l?r:A.width,c?n:A.height]:[A.width,A.height];if(o){var h=0,d=0;return MA(s)?h=zA(s,A.width):MA(a)&&(d=zA(a,A.height)),sl(s)?h=d*i:a&&!sl(a)||(d=h/i),[h,d]}var f=null,p=null;if(MA(s)?f=zA(s,A.width):a&&MA(a)&&(p=zA(a,A.height)),null===f||a&&!sl(a)||(p=l&&c?f/r*n:A.height),null!==p&&sl(s)&&(f=l&&c?p/n*r:A.width),null!==f&&null!==p)return[f,p];throw new Error("Unable to calculate background-size for element")},ll=function(e,t){var A=e[t];return void 0===A?e[0]:A},cl=function(e,t,A,r,n){var i=t[0],s=t[1],a=A[0],o=A[1];switch(e){case 2:return[new Uo(Math.round(r.left),Math.round(r.top+s)),new Uo(Math.round(r.left+r.width),Math.round(r.top+s)),new Uo(Math.round(r.left+r.width),Math.round(o+r.top+s)),new Uo(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new Uo(Math.round(r.left+i),Math.round(r.top)),new Uo(Math.round(r.left+i+a),Math.round(r.top)),new Uo(Math.round(r.left+i+a),Math.round(r.height+r.top)),new Uo(Math.round(r.left+i),Math.round(r.height+r.top))];case 1:return[new Uo(Math.round(r.left+i),Math.round(r.top+s)),new Uo(Math.round(r.left+i+a),Math.round(r.top+s)),new Uo(Math.round(r.left+i+a),Math.round(r.top+s+o)),new Uo(Math.round(r.left+i),Math.round(r.top+s+o))];default:return[new Uo(Math.round(n.left),Math.round(n.top)),new Uo(Math.round(n.left+n.width),Math.round(n.top)),new Uo(Math.round(n.left+n.width),Math.round(n.height+n.top)),new Uo(Math.round(n.left),Math.round(n.height+n.top))]}},ul="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hl="Hidden Text",dl=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),i=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",i.appendChild(A),r.src=ul,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(hl)),A.appendChild(n),A.appendChild(r);var s=r.offsetTop-n.offsetTop+2;A.removeChild(n),A.appendChild(this._document.createTextNode(hl)),A.style.lineHeight="normal",r.style.verticalAlign="super";var a=r.offsetTop-A.offsetTop+2;return i.removeChild(A),{baseline:s,middle:a}},e.prototype.getMetrics=function(e,t){var A=e+" "+t;return void 0===this._data[A]&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},e}(),fl=function(){function e(e,t){this.context=e,this.options=t}return e}(),pl=1e4,gl=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r._activeEffects=[],r.canvas=A.canvas?A.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),A.canvas||(r.canvas.width=Math.floor(A.width*A.scale),r.canvas.height=Math.floor(A.height*A.scale),r.canvas.style.width=A.width+"px",r.canvas.style.height=A.height+"px"),r.fontMetrics=new dl(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-A.x,-A.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),r}return t(A,e),A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},A.prototype.applyEffect=function(e){this.ctx.save(),jo(e)&&(this.ctx.globalAlpha=e.opacity),Do(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Mo(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return li(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,A){var r=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+A):ks(e.text).reduce(function(t,n){return r.ctx.fillText(n,t,e.bounds.top+A),t+r.ctx.measureText(n).width},e.bounds.left)},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),A=yl(e.fontFamily).join(", "),r=NA(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,r,A].join(" "),A,r]},A.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var A,r,i,s,a,o,l,c,u=this;return n(this,function(n){return A=this.createFontStyle(t),r=A[0],i=A[1],s=A[2],this.ctx.font=r,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,s),o=a.baseline,l=a.middle,c=t.paintOrder,e.textBounds.forEach(function(e){c.forEach(function(A){switch(A){case 0:u.ctx.fillStyle=rr(t.color),u.renderTextWithLetterSpacing(e,t.letterSpacing,o);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(A){u.ctx.shadowColor=rr(A.color),u.ctx.shadowOffsetX=A.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=A.offsetY.number*u.options.scale,u.ctx.shadowBlur=A.blur.number,u.renderTextWithLetterSpacing(e,t.letterSpacing,o)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),t.textDecorationLine.length&&(u.ctx.fillStyle=rr(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+o),e.bounds.width,1);break;case 2:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:u.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=rr(t.webkitTextStrokeColor),u.ctx.lineWidth=t.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+o)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,A){if(A&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=Al(e),n=To(t);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(A,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,i,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y;return n(this,function(n){switch(n.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,i=t.styles,a=0,o=t.textNodes,n.label=1;case 1:return a<o.length?(l=o[a],[4,this.renderTextNode(l,i)]):[3,4];case 2:n.sent(),n.label=3;case 3:return a++,[3,1];case 4:if(!(t instanceof Vs))return[3,8];n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return w=n.sent(),this.renderReplacedElement(t,r,w),[3,8];case 7:return n.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Ks&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof Gs))return[3,12];n.label=9;case 9:return n.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return w=n.sent(),this.renderReplacedElement(t,r,w),[3,12];case 11:return n.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof ia&&t.tree?[4,new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:c=n.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),n.label=14;case 14:if(t instanceof Aa&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===$s?t.checked&&(this.ctx.save(),this.path([new Uo(t.bounds.left+.39363*u,t.bounds.top+.79*u),new Uo(t.bounds.left+.16*u,t.bounds.top+.5549*u),new Uo(t.bounds.left+.27347*u,t.bounds.top+.44071*u),new Uo(t.bounds.left+.39694*u,t.bounds.top+.5649*u),new Uo(t.bounds.left+.72983*u,t.bounds.top+.23*u),new Uo(t.bounds.left+.84*u,t.bounds.top+.34085*u),new Uo(t.bounds.left+.39363*u,t.bounds.top+.79*u)]),this.ctx.fillStyle=rr(ta),this.ctx.fill(),this.ctx.restore()):t.type===Zs&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=rr(ta),this.ctx.fill(),this.ctx.restore())),ml(t)&&t.value.length){switch(h=this.createFontStyle(i),b=h[0],d=h[1],f=this.fontMetrics.getMetrics(b,d).baseline,this.ctx.font=b,this.ctx.fillStyle=rr(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Bl(t.styles.textAlign),y=Al(t),p=0,t.styles.textAlign){case 1:p+=y.width/2;break;case 2:p+=y.width}g=y.add(p,0,0,-y.height/2+1),this.ctx.save(),this.path([new Uo(y.left,y.top),new Uo(y.left+y.width,y.top),new Uo(y.left+y.width,y.top+y.height),new Uo(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ns(t.value,g),i.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!li(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];w=void 0,B=m.url,n.label=15;case 15:return n.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return w=n.sent(),this.ctx.drawImage(w,t.bounds.left-(w.width+10),t.bounds.top),[3,18];case 17:return n.sent(),this.context.logger.error("Error loading list-style-image "+B),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(b=this.createFontStyle(i)[0],this.ctx.font=b,this.ctx.fillStyle=rr(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new s(t.bounds.left,t.bounds.top+zA(t.styles.paddingTop,t.bounds.width),t.bounds.width,xn(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ns(e.listValue,y),i.letterSpacing,xn(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),n.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a,o,l,c,u,h,d,f,p,g;return n(this,function(n){switch(n.label){case 0:return li(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:n.sent(),t=0,A=e.negativeZIndex,n.label=2;case 2:return t<A.length?(g=A[t],[4,this.renderStack(g)]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:n.sent(),r=0,i=e.nonInlineLevel,n.label=7;case 7:return r<i.length?(g=i[r],[4,this.renderNode(g)]):[3,10];case 8:n.sent(),n.label=9;case 9:return r++,[3,7];case 10:s=0,a=e.nonPositionedFloats,n.label=11;case 11:return s<a.length?(g=a[s],[4,this.renderStack(g)]):[3,14];case 12:n.sent(),n.label=13;case 13:return s++,[3,11];case 14:o=0,l=e.nonPositionedInlineLevel,n.label=15;case 15:return o<l.length?(g=l[o],[4,this.renderStack(g)]):[3,18];case 16:n.sent(),n.label=17;case 17:return o++,[3,15];case 18:c=0,u=e.inlineLevel,n.label=19;case 19:return c<u.length?(g=u[c],[4,this.renderNode(g)]):[3,22];case 20:n.sent(),n.label=21;case 21:return c++,[3,19];case 22:h=0,d=e.zeroOrAutoZIndexOrTransformedOrOpacity,n.label=23;case 23:return h<d.length?(g=d[h],[4,this.renderStack(g)]):[3,26];case 24:n.sent(),n.label=25;case 25:return h++,[3,23];case 26:f=0,p=e.positiveZIndex,n.label=27;case 27:return f<p.length?(g=p[f],[4,this.renderStack(g)]):[3,30];case 28:n.sent(),n.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(e,A){var r=No(e)?e.start:e;0===A?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),No(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},A.prototype.renderRepeat=function(e,t,A,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(A,r),this.ctx.fill(),this.ctx.translate(-A,-r)},A.prototype.resizeImage=function(e,t,A){var r;if(e.width===t&&e.height===A)return e;var n=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return n.width=Math.max(1,t),n.height=Math.max(1,A),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,A),n},A.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a;return n(this,function(o){switch(o.label){case 0:t=e.styles.backgroundImage.length-1,A=function(A){var i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T;return n(this,function(n){switch(n.label){case 0:if(0!==A.type)return[3,5];i=void 0,s=A.url,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.context.cache.match(s)];case 2:return i=n.sent(),[3,4];case 3:return n.sent(),r.context.logger.error("Error loading background-image "+s),[3,4];case 4:return i&&(a=il(e,t,[i.width,i.height,i.width/i.height]),b=a[0],Q=a[1],U=a[2],C=a[3],x=a[4],w=r.ctx.createPattern(r.resizeImage(i,C,x),"repeat"),r.renderRepeat(b,w,Q,U)),[3,6];case 5:kr(A)?(o=il(e,t,[null,null,null]),b=o[0],Q=o[1],U=o[2],C=o[3],x=o[4],l=mr(A.angle,C,x),c=l[0],u=l[1],h=l[2],d=l[3],f=l[4],(p=document.createElement("canvas")).width=C,p.height=x,g=p.getContext("2d"),m=g.createLinearGradient(u,d,h,f),pr(A.stops,c).forEach(function(e){return m.addColorStop(e.stop,rr(e.color))}),g.fillStyle=m,g.fillRect(0,0,C,x),C>0&&x>0&&(w=r.ctx.createPattern(p,"repeat"),r.renderRepeat(b,w,Q,U))):Tr(A)&&(B=il(e,t,[null,null,null]),b=B[0],y=B[1],v=B[2],C=B[3],x=B[4],F=0===A.position.length?[VA]:A.position,Q=zA(F[0],C),U=zA(F[F.length-1],x),S=br(A,Q,U,C,x),E=S[0],N=S[1],E>0&&N>0&&(L=r.ctx.createRadialGradient(y+Q,v+U,0,y+Q,v+U,E),pr(A.stops,2*E).forEach(function(e){return L.addColorStop(e.stop,rr(e.color))}),r.path(b),r.ctx.fillStyle=L,E!==N?(_=e.bounds.left+.5*e.bounds.width,I=e.bounds.top+.5*e.bounds.height,T=1/(k=N/E),r.ctx.save(),r.ctx.translate(_,I),r.ctx.transform(1,0,0,k,0,0),r.ctx.translate(-_,-I),r.ctx.fillRect(y,T*(v-I)+I,C,x*T),r.ctx.restore()):r.ctx.fill())),n.label=6;case 6:return t--,[2]}})},r=this,i=0,s=e.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return i<s.length?(a=s[i],[5,A(a)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,A){return r(this,void 0,void 0,function(){return n(this,function(r){return this.path(Xo(A,t)),this.ctx.fillStyle=rr(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,A,i){return r(this,void 0,void 0,function(){var r,s;return n(this,function(n){switch(n.label){case 0:return t<3?[4,this.renderSolidBorder(e,A,i)]:[3,2];case 1:return n.sent(),[2];case 2:return r=Yo(i,A),this.path(r),this.ctx.fillStyle=rr(e),this.ctx.fill(),s=Jo(i,A),this.path(s),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a,o,l,c=this;return n(this,function(n){switch(n.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,A=!Ar(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=wl(ll(t.backgroundClip,0),e.curves),A||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ar(t.backgroundColor)||(this.ctx.fillStyle=rr(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:n.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){c.ctx.save();var A=Io(e.curves),r=t.inset?0:pl,n=Vo(A,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(c.path(A),c.ctx.clip(),c.mask(n)):(c.mask(A),c.ctx.clip(),c.path(n)),c.ctx.shadowOffsetX=t.offsetX.number+r,c.ctx.shadowOffsetY=t.offsetY.number,c.ctx.shadowColor=rr(t.color),c.ctx.shadowBlur=t.blur.number,c.ctx.fillStyle=t.inset?rr(t.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()}),n.label=2;case 2:s=0,a=0,o=r,n.label=3;case 3:return a<o.length?0!==(l=o[a]).style&&!Ar(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,s,e.curves,2)]:[3,11]:[3,13];case 4:return n.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,s,e.curves,3)];case 6:return n.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,s,e.curves)];case 8:return n.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,s,e.curves)];case 10:n.sent(),n.label=11;case 11:s++,n.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,A,i,s){return r(this,void 0,void 0,function(){var r,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y;return n(this,function(n){return this.ctx.save(),r=$o(i,A),a=Xo(i,A),2===s&&(this.path(a),this.ctx.clip()),No(a[0])?(o=a[0].start.x,l=a[0].start.y):(o=a[0].x,l=a[0].y),No(a[1])?(c=a[1].end.x,u=a[1].end.y):(c=a[1].x,u=a[1].y),h=0===A||2===A?Math.abs(o-c):Math.abs(l-u),this.ctx.beginPath(),3===s?this.formatPath(r):this.formatPath(a.slice(0,2)),d=t<3?3*t:2*t,f=t<3?2*t:t,3===s&&(d=t,f=t),p=!0,h<=2*d?p=!1:h<=2*d+f?(d*=g=h/(2*d+f),f*=g):(m=Math.floor((h+f)/(d+f)),w=(h-m*d)/(m-1),f=(B=(h-(m+1)*d)/m)<=0||Math.abs(f-w)<Math.abs(f-B)?w:B),p&&(3===s?this.ctx.setLineDash([0,d+f]):this.ctx.setLineDash([d,f])),3===s?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=rr(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===s&&(No(a[0])&&(b=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Uo(b.end.x,b.end.y),new Uo(y.start.x,y.start.y)]),this.ctx.stroke()),No(a[1])&&(b=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Uo(b.end.x,b.end.y),new Uo(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return n(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=rr(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Wo(e),[4,this.renderStack(t)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(fl),ml=function(e){return e instanceof na||e instanceof ra||e instanceof Aa&&e.type!==Zs&&e.type!==$s},wl=function(e,t){switch(e){case 0:return Io(t);case 2:return ko(t);default:return To(t)}},Bl=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},bl=["-apple-system","system-ui"],yl=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===bl.indexOf(e)}):e},vl=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.canvas=A.canvas?A.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=A,r.canvas.width=Math.floor(A.width*A.scale),r.canvas.height=Math.floor(A.height*A.scale),r.canvas.style.width=A.width+"px",r.canvas.style.height=A.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-A.x,-A.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),r}return t(A,e),A.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,A;return n(this,function(r){switch(r.label){case 0:return t=Us(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Cl(t)];case 1:return A=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=rr(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(A,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(fl),Cl=function(e){return new Promise(function(t,A){var r=new Image;r.onload=function(){t(r)},r.onerror=A,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},xl=function(){function e(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,i([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),Fl=function(){function e(t,A){var r;this.windowBounds=A,this.instanceName="#"+e.instanceCount++,this.logger=new xl({id:this.instanceName,enabled:t.logging}),this.cache=null!==(r=t.cache)&&void 0!==r?r:new wo(this,t)}return e.instanceCount=1,e}(),Ql=function(e,t){return void 0===t&&(t={}),Ul(e,t)};"undefined"!=typeof window&&mo.setContext(window);var Ul=function(e,t){return r(void 0,void 0,void 0,function(){var r,i,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T,H,O,P,D,M,j,R,V,K;return n(this,function(n){switch(n.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(r=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=r.defaultView))throw new Error("Document is not attached to a Window");return l={allowTaint:null!==(S=t.allowTaint)&&void 0!==S&&S,imageTimeout:null!==(E=t.imageTimeout)&&void 0!==E?E:15e3,proxy:t.proxy,useCORS:null!==(N=t.useCORS)&&void 0!==N&&N},c=A({logging:null===(L=t.logging)||void 0===L||L,cache:t.cache},l),u={windowWidth:null!==(_=t.windowWidth)&&void 0!==_?_:i.innerWidth,windowHeight:null!==(I=t.windowHeight)&&void 0!==I?I:i.innerHeight,scrollX:null!==(k=t.scrollX)&&void 0!==k?k:i.pageXOffset,scrollY:null!==(T=t.scrollY)&&void 0!==T?T:i.pageYOffset},h=new s(u.scrollX,u.scrollY,u.windowWidth,u.windowHeight),d=new Fl(c,h),f=null!==(H=t.foreignObjectRendering)&&void 0!==H&&H,p={allowTaint:null!==(O=t.allowTaint)&&void 0!==O&&O,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:f,copyStyles:f},d.logger.debug("Starting document clone with size "+h.width+"x"+h.height+" scrolled to "+-h.left+","+-h.top),g=new $a(d,e,p),(m=g.clonedReferenceElement)?[4,g.toIFrame(r,h)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return w=n.sent(),B=ya(m)||Ba(m)?o(m.ownerDocument):a(d,m),b=B.width,y=B.height,v=B.left,C=B.top,x=Sl(d,m,t.backgroundColor),F={canvas:t.canvas,backgroundColor:x,scale:null!==(D=null!==(P=t.scale)&&void 0!==P?P:i.devicePixelRatio)&&void 0!==D?D:1,x:(null!==(M=t.x)&&void 0!==M?M:0)+v,y:(null!==(j=t.y)&&void 0!==j?j:0)+C,width:null!==(R=t.width)&&void 0!==R?R:Math.ceil(b),height:null!==(V=t.height)&&void 0!==V?V:Math.ceil(y)},f?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new vl(d,F).render(m)]):[3,3];case 2:return Q=n.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+v+","+C+" with size "+b+"x"+y+" using computed rendering"),d.logger.debug("Starting DOM parsing"),U=la(d,m),x===U.styles.backgroundColor&&(U.styles.backgroundColor=ur.TRANSPARENT),d.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),[4,new gl(d,F).render(U)];case 4:Q=n.sent(),n.label=5;case 5:return(null===(K=t.removeContainer)||void 0===K||K)&&($a.destroy(w)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,Q]}})})},Sl=function(e,t,A){var r=t.ownerDocument,n=r.documentElement?cr(e,getComputedStyle(r.documentElement).backgroundColor):ur.TRANSPARENT,i=r.body?cr(e,getComputedStyle(r.body).backgroundColor):ur.TRANSPARENT,s="string"==typeof A?cr(e,A):null===A?ur.TRANSPARENT:4294967295;return t===r.documentElement?Ar(n)?Ar(i)?s:i:n:s};return Ql}();var he=ue.exports,de=l(he),fe=a({__proto__:null,default:de},[he]);function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}var ge=Uint8Array,me=Uint16Array,we=Int32Array,Be=new ge([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]),be=new ge([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]),ye=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ve=function(e,t){for(var A=new me(31),r=0;r<31;++r)A[r]=t+=1<<e[r-1];var n=new we(A[30]);for(r=1;r<30;++r)for(var i=A[r];i<A[r+1];++i)n[i]=i-A[r]<<5|r;return{b:A,r:n}},Ce=ve(Be,2),xe=Ce.b,Fe=Ce.r;xe[28]=258,Fe[258]=28;for(var Qe=ve(be,0).r,Ue=new me(32768),Se=0;Se<32768;++Se){var Ee=(43690&Se)>>1|(21845&Se)<<1;Ee=(61680&(Ee=(52428&Ee)>>2|(13107&Ee)<<2))>>4|(3855&Ee)<<4,Ue[Se]=((65280&Ee)>>8|(255&Ee)<<8)>>1}var Ne=function(e,t,A){for(var r=e.length,n=0,i=new me(t);n<r;++n)e[n]&&++i[e[n]-1];var s,a=new me(t);for(n=1;n<t;++n)a[n]=a[n-1]+i[n-1]<<1;if(A){s=new me(1<<t);var o=15-t;for(n=0;n<r;++n)if(e[n])for(var l=n<<4|e[n],c=t-e[n],u=a[e[n]-1]++<<c,h=u|(1<<c)-1;u<=h;++u)s[Ue[u]>>o]=l}else for(s=new me(r),n=0;n<r;++n)e[n]&&(s[n]=Ue[a[e[n]-1]++]>>15-e[n]);return s},Le=new ge(288);for(Se=0;Se<144;++Se)Le[Se]=8;for(Se=144;Se<256;++Se)Le[Se]=9;for(Se=256;Se<280;++Se)Le[Se]=7;for(Se=280;Se<288;++Se)Le[Se]=8;var _e=new ge(32);for(Se=0;Se<32;++Se)_e[Se]=5;var Ie=Ne(Le,9,0),ke=Ne(_e,5,0),Te=function(e){return(e+7)/8|0},He=function(e,t,A){A<<=7&t;var r=t/8|0;e[r]|=A,e[r+1]|=A>>8},Oe=function(e,t,A){A<<=7&t;var r=t/8|0;e[r]|=A,e[r+1]|=A>>8,e[r+2]|=A>>16},Pe=function(e,t){for(var A=[],r=0;r<e.length;++r)e[r]&&A.push({s:r,f:e[r]});var n=A.length,i=A.slice();if(!n)return{t:Ge,l:0};if(1==n){var s=new ge(A[0].s+1);return s[A[0].s]=1,{t:s,l:1}}A.sort(function(e,t){return e.f-t.f}),A.push({s:-1,f:25001});var a=A[0],o=A[1],l=0,c=1,u=2;for(A[0]={s:-1,f:a.f+o.f,l:a,r:o};c!=n-1;)a=A[A[l].f<A[u].f?l++:u++],o=A[l!=c&&A[l].f<A[u].f?l++:u++],A[c++]={s:-1,f:a.f+o.f,l:a,r:o};var h=i[0].s;for(r=1;r<n;++r)i[r].s>h&&(h=i[r].s);var d=new me(h+1),f=De(A[c-1],d,0);if(f>t){r=0;var p=0,g=f-t,m=1<<g;for(i.sort(function(e,t){return d[t.s]-d[e.s]||e.f-t.f});r<n;++r){var w=i[r].s;if(!(d[w]>t))break;p+=m-(1<<f-d[w]),d[w]=t}for(p>>=g;p>0;){var B=i[r].s;d[B]<t?p-=1<<t-d[B]++-1:++r}for(;r>=0&&p;--r){var b=i[r].s;d[b]==t&&(--d[b],++p)}f=t}return{t:new ge(d),l:f}},De=function(e,t,A){return-1==e.s?Math.max(De(e.l,t,A+1),De(e.r,t,A+1)):t[e.s]=A},Me=function(e){for(var t=e.length;t&&!e[--t];);for(var A=new me(++t),r=0,n=e[0],i=1,s=function(e){A[r++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=e[a]}return{c:A.subarray(0,r),n:t}},je=function(e,t){for(var A=0,r=0;r<t.length;++r)A+=e[r]*t[r];return A},Re=function(e,t,A){var r=A.length,n=Te(t+2);e[n]=255&r,e[n+1]=r>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i<r;++i)e[n+i+4]=A[i];return 8*(n+4+r)},Ve=function(e,t,A,r,n,i,s,a,o,l,c){He(t,c++,A),++n[256];for(var u=Pe(n,15),h=u.t,d=u.l,f=Pe(i,15),p=f.t,g=f.l,m=Me(h),w=m.c,B=m.n,b=Me(p),y=b.c,v=b.n,C=new me(19),x=0;x<w.length;++x)++C[31&w[x]];for(x=0;x<y.length;++x)++C[31&y[x]];for(var F=Pe(C,7),Q=F.t,U=F.l,S=19;S>4&&!Q[ye[S-1]];--S);var E,N,L,_,I=l+5<<3,k=je(n,Le)+je(i,_e)+s,T=je(n,h)+je(i,p)+s+14+3*S+je(C,Q)+2*C[16]+3*C[17]+7*C[18];if(o>=0&&I<=k&&I<=T)return Re(t,c,e.subarray(o,o+l));if(He(t,c,1+(T<k)),c+=2,T<k){E=Ne(h,d,0),N=h,L=Ne(p,g,0),_=p;var H=Ne(Q,U,0);He(t,c,B-257),He(t,c+5,v-1),He(t,c+10,S-4),c+=14;for(x=0;x<S;++x)He(t,c+3*x,Q[ye[x]]);c+=3*S;for(var O=[w,y],P=0;P<2;++P){var D=O[P];for(x=0;x<D.length;++x){var M=31&D[x];He(t,c,H[M]),c+=Q[M],M>15&&(He(t,c,D[x]>>5&127),c+=D[x]>>12)}}}else E=Ie,N=Le,L=ke,_=_e;for(x=0;x<a;++x){var j=r[x];if(j>255){Oe(t,c,E[(M=j>>18&31)+257]),c+=N[M+257],M>7&&(He(t,c,j>>23&31),c+=Be[M]);var R=31&j;Oe(t,c,L[R]),c+=_[R],R>3&&(Oe(t,c,j>>5&8191),c+=be[R])}else Oe(t,c,E[j]),c+=N[j]}return Oe(t,c,E[256]),c+N[256]},Ke=new we([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ge=new ge(0),ze=function(e,t,A,r,n,i){var s=i.z||e.length,a=new ge(r+s+5*(1+Math.ceil(s/7e3))+n),o=a.subarray(r,a.length-n),l=i.l,c=7&(i.r||0);if(t){c&&(o[0]=i.r>>3);for(var u=Ke[t-1],h=u>>13,d=8191&u,f=(1<<A)-1,p=i.p||new me(32768),g=i.h||new me(f+1),m=Math.ceil(A/3),w=2*m,B=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<w)&f},b=new we(25e3),y=new me(288),v=new me(32),C=0,x=0,F=i.i||0,Q=0,U=i.w||0,S=0;F+2<s;++F){var E=B(F),N=32767&F,L=g[E];if(p[N]=L,g[E]=N,U<=F){var _=s-F;if((C>7e3||Q>24576)&&(_>423||!l)){c=Ve(e,o,0,b,y,v,x,Q,S,F-S,c),Q=C=x=0,S=F;for(var I=0;I<286;++I)y[I]=0;for(I=0;I<30;++I)v[I]=0}var k=2,T=0,H=d,O=N-L&32767;if(_>2&&E==B(F-O))for(var P=Math.min(h,_)-1,D=Math.min(32767,F),M=Math.min(258,_);O<=D&&--H&&N!=L;){if(e[F+k]==e[F+k-O]){for(var j=0;j<M&&e[F+j]==e[F+j-O];++j);if(j>k){if(k=j,T=O,j>P)break;var R=Math.min(O,j-2),V=0;for(I=0;I<R;++I){var K=F-O+I&32767,G=K-p[K]&32767;G>V&&(V=G,L=K)}}}O+=(N=L)-(L=p[N])&32767}if(T){b[Q++]=268435456|Fe[k]<<18|Qe[T];var z=31&Fe[k],q=31&Qe[T];x+=Be[z]+be[q],++y[257+z],++v[q],U=F+k,++C}else b[Q++]=e[F],++y[e[F]]}}for(F=Math.max(F,U);F<s;++F)b[Q++]=e[F],++y[e[F]];c=Ve(e,o,l,b,y,v,x,Q,S,F-S,c),l||(i.r=7&c|o[c/8|0]<<3,c-=7,i.h=g,i.p=p,i.i=F,i.w=U)}else{for(F=i.w||0;F<s+l;F+=65535){var W=F+65535;W>=s&&(o[c/8|0]=l,W=s),c=Re(o,c+1,e.subarray(F,W))}i.i=s}return function(e,t,A){return(null==t||t<0)&&(t=0),(null==A||A>e.length)&&(A=e.length),new ge(e.subarray(t,A))}(a,0,r+Te(c)+n)},qe=function(){var e=1,t=0;return{p:function(A){for(var r=e,n=t,i=0|A.length,s=0;s!=i;){for(var a=Math.min(s+2655,i);s<a;++s)n+=r+=A[s];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}e=r,t=n},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},We=function(e,t,A){for(;A;++t)e[t]=A,A>>>=8};function Xe(e,t){t||(t={});var A=qe();A.p(e);var r=function(e,t,A,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new ge(i.length+e.length);s.set(i),s.set(e,i.length),e=s,n.w=i.length}return ze(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,A,r,n)}(e,t,t.dictionary?6:2,4);return function(e,t){var A=t.level,r=0==A?0:A<6?1:9==A?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var n=qe();n.p(t.dictionary),We(e,2,n.d())}}(r,t),We(r,r.length-4,A.d()),r}var Ye="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ye.decode(Ge,{stream:!0})}catch(e){}function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,r=Array(t);A<t;A++)r[A]=e[A];return r}function $e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var r,n,i,s,a=[],o=!0,l=!1;try{if(i=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;o=!1}else for(;!(o=(r=i.call(A)).done)&&(a.push(r.value),a.length!==t);o=!0);}catch(e){l=!0,n=e}finally{try{if(!o&&null!=A.return&&(s=A.return(),Object(s)!==s))return}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Je(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Je(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(e,t="utf8"){return new TextDecoder(t).decode(e)}const et=new TextEncoder;const tt=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),At={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 rt{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=8192,t={}){let A=!1;"number"==typeof e?e=new ArrayBuffer(e):(A=!0,this.lastWrittenByte=e.byteLength);const r=t.offset?t.offset>>>0:0,n=e.byteLength-r;let i=r;(ArrayBuffer.isView(e)||e instanceof rt)&&(e.byteLength!==e.buffer.byteLength&&(i=e.byteOffset+r),e=e.buffer),this.lastWrittenByte=A?n:0,this.buffer=e,this.length=n,this.byteLength=n,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,n),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const t=2*(this.offset+e),A=new Uint8Array(t);A.set(new Uint8Array(this.buffer)),this.buffer=A.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const A=At[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,n=this.buffer.slice(r,r+A);if(this.littleEndian===tt&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(r,r+A));e.reverse();const n=new At[t](e.buffer);return this.offset+=A,n.reverse(),n}const i=new At[t](n);return this.offset+=A,i}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 A=0;A<e;A++)t+=this.readChar();return t}readUtf8(e=1){return Ze(this.readBytes(e))}decodeText(e=1,t="utf8"){return Ze(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(function(e){return et.encode(e)}(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}
|
|
31
|
-
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function nt(e){let t=e.length;for(;--t>=0;)e[t]=0}const it=256,st=286,at=30,ot=15,lt=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]),ct=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]),ut=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ht=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dt=new Array(576);nt(dt);const ft=new Array(60);nt(ft);const pt=new Array(512);nt(pt);const gt=new Array(256);nt(gt);const mt=new Array(29);nt(mt);const wt=new Array(at);function Bt(e,t,A,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=A,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let bt,yt,vt;function Ct(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}nt(wt);const xt=e=>e<256?pt[e]:pt[256+(e>>>7)],Ft=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Qt=(e,t,A)=>{e.bi_valid>16-A?(e.bi_buf|=t<<e.bi_valid&65535,Ft(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=A-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=A)},Ut=(e,t,A)=>{Qt(e,A[2*t],A[2*t+1])},St=(e,t)=>{let A=0;do{A|=1&e,e>>>=1,A<<=1}while(--t>0);return A>>>1},Et=(e,t,A)=>{const r=new Array(16);let n,i,s=0;for(n=1;n<=ot;n++)s=s+A[n-1]<<1,r[n]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=St(r[t]++,t))}},Nt=e=>{let t;for(t=0;t<st;t++)e.dyn_ltree[2*t]=0;for(t=0;t<at;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Lt=e=>{e.bi_valid>8?Ft(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},_t=(e,t,A,r)=>{const n=2*t,i=2*A;return e[n]<e[i]||e[n]===e[i]&&r[t]<=r[A]},It=(e,t,A)=>{const r=e.heap[A];let n=A<<1;for(;n<=e.heap_len&&(n<e.heap_len&&_t(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!_t(t,r,e.heap[n],e.depth));)e.heap[A]=e.heap[n],A=n,n<<=1;e.heap[A]=r},kt=(e,t,A)=>{let r,n,i,s,a=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,n=e.pending_buf[e.sym_buf+a++],0===r?Ut(e,n,t):(i=gt[n],Ut(e,i+it+1,t),s=lt[i],0!==s&&(n-=mt[i],Qt(e,n,s)),r--,i=xt(r),Ut(e,i,A),s=ct[i],0!==s&&(r-=wt[i],Qt(e,r,s)))}while(a<e.sym_next);Ut(e,256,t)},Tt=(e,t)=>{const A=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,a,o,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==A[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):A[2*s+1]=0;for(;e.heap_len<2;)o=e.heap[++e.heap_len]=l<2?++l:0,A[2*o]=1,e.depth[o]=0,e.opt_len--,n&&(e.static_len-=r[2*o+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)It(e,A,s);o=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],It(e,A,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,A[2*o]=A[2*s]+A[2*a],e.depth[o]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,A[2*s+1]=A[2*a+1]=o,e.heap[1]=o++,It(e,A,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const A=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,o=t.stat_desc.max_length;let l,c,u,h,d,f,p=0;for(h=0;h<=ot;h++)e.bl_count[h]=0;for(A[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],h=A[2*A[2*c+1]+1]+1,h>o&&(h=o,p++),A[2*c+1]=h,c>r||(e.bl_count[h]++,d=0,c>=a&&(d=s[c-a]),f=A[2*c],e.opt_len+=f*(h+d),i&&(e.static_len+=f*(n[2*c+1]+d)));if(0!==p){do{for(h=o-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[o]--,p-=2}while(p>0);for(h=o;0!==h;h--)for(c=e.bl_count[h];0!==c;)u=e.heap[--l],u>r||(A[2*u+1]!==h&&(e.opt_len+=(h-A[2*u+1])*A[2*u],A[2*u+1]=h),c--)}})(e,t),Et(A,l,e.bl_count)},Ht=(e,t,A)=>{let r,n,i=-1,s=t[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),t[2*(A+1)+1]=65535,r=0;r<=A;r++)n=s,s=t[2*(r+1)+1],++a<o&&n===s||(a<l?e.bl_tree[2*n]+=a:0!==n?(n!==i&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,i=n,0===s?(o=138,l=3):n===s?(o=6,l=3):(o=7,l=4))},Ot=(e,t,A)=>{let r,n,i=-1,s=t[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),r=0;r<=A;r++)if(n=s,s=t[2*(r+1)+1],!(++a<o&&n===s)){if(a<l)do{Ut(e,n,e.bl_tree)}while(0!==--a);else 0!==n?(n!==i&&(Ut(e,n,e.bl_tree),a--),Ut(e,16,e.bl_tree),Qt(e,a-3,2)):a<=10?(Ut(e,17,e.bl_tree),Qt(e,a-3,3)):(Ut(e,18,e.bl_tree),Qt(e,a-11,7));a=0,i=n,0===s?(o=138,l=3):n===s?(o=6,l=3):(o=7,l=4)}};let Pt=!1;const Dt=(e,t,A,r)=>{Qt(e,0+(r?1:0),3),Lt(e),Ft(e,A),Ft(e,~A),A&&e.pending_buf.set(e.window.subarray(t,t+A),e.pending),e.pending+=A};var Mt=e=>{Pt||((()=>{let e,t,A,r,n;const i=new Array(16);for(A=0,r=0;r<28;r++)for(mt[r]=A,e=0;e<1<<lt[r];e++)gt[A++]=r;for(gt[A-1]=r,n=0,r=0;r<16;r++)for(wt[r]=n,e=0;e<1<<ct[r];e++)pt[n++]=r;for(n>>=7;r<at;r++)for(wt[r]=n<<7,e=0;e<1<<ct[r]-7;e++)pt[256+n++]=r;for(t=0;t<=ot;t++)i[t]=0;for(e=0;e<=143;)dt[2*e+1]=8,e++,i[8]++;for(;e<=255;)dt[2*e+1]=9,e++,i[9]++;for(;e<=279;)dt[2*e+1]=7,e++,i[7]++;for(;e<=287;)dt[2*e+1]=8,e++,i[8]++;for(Et(dt,287,i),e=0;e<at;e++)ft[2*e+1]=5,ft[2*e]=St(e,5);bt=new Bt(dt,lt,257,st,ot),yt=new Bt(ft,ct,0,at,ot),vt=new Bt(new Array(0),ut,0,19,7)})(),Pt=!0),e.l_desc=new Ct(e.dyn_ltree,bt),e.d_desc=new Ct(e.dyn_dtree,yt),e.bl_desc=new Ct(e.bl_tree,vt),e.bi_buf=0,e.bi_valid=0,Nt(e)},jt=(e,t,A,r)=>{let n,i,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,A=4093624447;for(t=0;t<=31;t++,A>>>=1)if(1&A&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<it;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Tt(e,e.l_desc),Tt(e,e.d_desc),s=(e=>{let t;for(Ht(e,e.dyn_ltree,e.l_desc.max_code),Ht(e,e.dyn_dtree,e.d_desc.max_code),Tt(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ht[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=A+5,A+4<=n&&-1!==t?Dt(e,t,A,r):4===e.strategy||i===n?(Qt(e,2+(r?1:0),3),kt(e,dt,ft)):(Qt(e,4+(r?1:0),3),((e,t,A,r)=>{let n;for(Qt(e,t-257,5),Qt(e,A-1,5),Qt(e,r-4,4),n=0;n<r;n++)Qt(e,e.bl_tree[2*ht[n]+1],3);Ot(e,e.dyn_ltree,t-1),Ot(e,e.dyn_dtree,A-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),kt(e,e.dyn_ltree,e.dyn_dtree)),Nt(e),r&&Lt(e)},Rt=(e,t,A)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=A,0===t?e.dyn_ltree[2*A]++:(e.matches++,t--,e.dyn_ltree[2*(gt[A]+it+1)]++,e.dyn_dtree[2*xt(t)]++),e.sym_next===e.sym_end),Vt=e=>{Qt(e,2,3),Ut(e,256,dt),(e=>{16===e.bi_valid?(Ft(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)},Kt={_tr_init:Mt,_tr_stored_block:Dt,_tr_flush_block:jt,_tr_tally:Rt,_tr_align:Vt};var Gt=(e,t,A,r)=>{let n=65535&e,i=e>>>16&65535,s=0;for(;0!==A;){s=A>2e3?2e3:A,A-=s;do{n=n+t[r++]|0,i=i+n|0}while(--s);n%=65521,i%=65521}return n|i<<16};const zt=new Uint32Array((()=>{let e,t=[];for(var A=0;A<256;A++){e=A;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[A]=e}return t})());var qt=(e,t,A,r)=>{const n=zt,i=r+A;e^=-1;for(let A=r;A<i;A++)e=e>>>8^n[255&(e^t[A])];return-1^e},Wt={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"},Xt={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:Yt,_tr_stored_block:Jt,_tr_flush_block:$t,_tr_tally:Zt,_tr_align:eA}=Kt,{Z_NO_FLUSH:tA,Z_PARTIAL_FLUSH:AA,Z_FULL_FLUSH:rA,Z_FINISH:nA,Z_BLOCK:iA,Z_OK:sA,Z_STREAM_END:aA,Z_STREAM_ERROR:oA,Z_DATA_ERROR:lA,Z_BUF_ERROR:cA,Z_DEFAULT_COMPRESSION:uA,Z_FILTERED:hA,Z_HUFFMAN_ONLY:dA,Z_RLE:fA,Z_FIXED:pA,Z_DEFAULT_STRATEGY:gA,Z_UNKNOWN:mA,Z_DEFLATED:wA}=Xt,BA=258,bA=262,yA=42,vA=113,CA=666,xA=(e,t)=>(e.msg=Wt[t],t),FA=e=>2*e-(e>4?9:0),QA=e=>{let t=e.length;for(;--t>=0;)e[t]=0},UA=e=>{let t,A,r,n=e.w_size;t=e.hash_size,r=t;do{A=e.head[--r],e.head[r]=A>=n?A-n:0}while(--t);t=n,r=t;do{A=e.prev[--r],e.prev[r]=A>=n?A-n:0}while(--t)};let SA=(e,t,A)=>(t<<e.hash_shift^A)&e.hash_mask;const EA=e=>{const t=e.state;let A=t.pending;A>e.avail_out&&(A=e.avail_out),0!==A&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+A),e.next_out),e.next_out+=A,t.pending_out+=A,e.total_out+=A,e.avail_out-=A,t.pending-=A,0===t.pending&&(t.pending_out=0))},NA=(e,t)=>{$t(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,EA(e.strm)},LA=(e,t)=>{e.pending_buf[e.pending++]=t},_A=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},IA=(e,t,A,r)=>{let n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),A),1===e.state.wrap?e.adler=Gt(e.adler,t,n,A):2===e.state.wrap&&(e.adler=qt(e.adler,t,n,A)),e.next_in+=n,e.total_in+=n,n)},kA=(e,t)=>{let A,r,n=e.max_chain_length,i=e.strstart,s=e.prev_length,a=e.nice_match;const o=e.strstart>e.w_size-bA?e.strstart-(e.w_size-bA):0,l=e.window,c=e.w_mask,u=e.prev,h=e.strstart+BA;let d=l[i+s-1],f=l[i+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(A=t,l[A+s]===f&&l[A+s-1]===d&&l[A]===l[i]&&l[++A]===l[i+1]){i+=2,A++;do{}while(l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&i<h);if(r=BA-(h-i),i=h-BA,r>s){if(e.match_start=t,s=r,r>=a)break;d=l[i+s-1],f=l[i+s]}}}while((t=u[t&c])>o&&0!==--n);return s<=e.lookahead?s:e.lookahead},TA=e=>{const t=e.w_size;let A,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-bA)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),UA(e),r+=t),0===e.strm.avail_in)break;if(A=IA(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=A,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=SA(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=SA(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<bA&&0!==e.strm.avail_in)},HA=(e,t)=>{let A,r,n,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(A=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,r=e.strstart-e.block_start,A>r+e.strm.avail_in&&(A=r+e.strm.avail_in),A>n&&(A=n),A<i&&(0===A&&t!==nA||t===tA||A!==r+e.strm.avail_in))break;s=t===nA&&A===r+e.strm.avail_in?1:0,Jt(e,0,0,s),e.pending_buf[e.pending-4]=A,e.pending_buf[e.pending-3]=A>>8,e.pending_buf[e.pending-2]=~A,e.pending_buf[e.pending-1]=~A>>8,EA(e.strm),r&&(r>A&&(r=A),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,A-=r),A&&(IA(e.strm,e.strm.output,e.strm.next_out,A),e.strm.next_out+=A,e.strm.avail_out-=A,e.strm.total_out+=A)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==tA&&t!==nA&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(IA(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,i=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=i||(r||t===nA)&&t!==tA&&0===e.strm.avail_in&&r<=n)&&(A=r>n?n:r,s=t===nA&&0===e.strm.avail_in&&A===r?1:0,Jt(e,e.block_start,A,s),e.block_start+=A,EA(e.strm)),s?3:1)},OA=(e,t)=>{let A,r;for(;;){if(e.lookahead<bA){if(TA(e),e.lookahead<bA&&t===tA)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==A&&e.strstart-A<=e.w_size-bA&&(e.match_length=kA(e,A)),e.match_length>=3)if(r=Zt(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=SA(e,e.ins_h,e.window[e.strstart+1]);else r=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2},PA=(e,t)=>{let A,r,n;for(;;){if(e.lookahead<bA){if(TA(e),e.lookahead<bA&&t===tA)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==A&&e.prev_length<e.max_lazy_match&&e.strstart-A<=e.w_size-bA&&(e.match_length=kA(e,A),e.match_length<=5&&(e.strategy===hA||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=Zt(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(NA(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Zt(e,0,e.window[e.strstart-1]),r&&NA(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Zt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2};function DA(e,t,A,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=A,this.max_chain=r,this.func=n}const MA=[new DA(0,0,0,0,HA),new DA(4,4,8,4,OA),new DA(4,5,16,8,OA),new DA(4,6,32,32,OA),new DA(4,4,16,16,PA),new DA(8,16,32,32,PA),new DA(8,16,128,128,PA),new DA(8,32,128,256,PA),new DA(32,128,258,1024,PA),new DA(32,258,258,4096,PA)];function jA(){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=wA,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),QA(this.dyn_ltree),QA(this.dyn_dtree),QA(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),QA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),QA(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 RA=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==yA&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==vA&&t.status!==CA?1:0},VA=e=>{if(RA(e))return xA(e,oA);e.total_in=e.total_out=0,e.data_type=mA;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?yA:vA,e.adler=2===t.wrap?0:1,t.last_flush=-2,Yt(t),sA},KA=e=>{const t=VA(e);return t===sA&&(e=>{e.window_size=2*e.w_size,QA(e.head),e.max_lazy_match=MA[e.level].max_lazy,e.good_match=MA[e.level].good_length,e.nice_match=MA[e.level].nice_length,e.max_chain_length=MA[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},GA=(e,t,A,r,n,i)=>{if(!e)return oA;let s=1;if(t===uA&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>9||A!==wA||r<8||r>15||t<0||t>9||i<0||i>pA||8===r&&1!==s)return xA(e,oA);8===r&&(r=9);const a=new jA;return e.state=a,a.strm=e,a.status=yA,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=i,a.method=A,KA(e)};var zA=(e,t)=>{if(RA(e)||t>iA||t<0)return e?xA(e,oA):oA;const A=e.state;if(!e.output||0!==e.avail_in&&!e.input||A.status===CA&&t!==nA)return xA(e,0===e.avail_out?cA:oA);const r=A.last_flush;if(A.last_flush=t,0!==A.pending){if(EA(e),0===e.avail_out)return A.last_flush=-1,sA}else if(0===e.avail_in&&FA(t)<=FA(r)&&t!==nA)return xA(e,cA);if(A.status===CA&&0!==e.avail_in)return xA(e,cA);if(A.status===yA&&0===A.wrap&&(A.status=vA),A.status===yA){let t=wA+(A.w_bits-8<<4)<<8,r=-1;if(r=A.strategy>=dA||A.level<2?0:A.level<6?1:6===A.level?2:3,t|=r<<6,0!==A.strstart&&(t|=32),t+=31-t%31,_A(A,t),0!==A.strstart&&(_A(A,e.adler>>>16),_A(A,65535&e.adler)),e.adler=1,A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA}if(57===A.status)if(e.adler=0,LA(A,31),LA(A,139),LA(A,8),A.gzhead)LA(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),LA(A,255&A.gzhead.time),LA(A,A.gzhead.time>>8&255),LA(A,A.gzhead.time>>16&255),LA(A,A.gzhead.time>>24&255),LA(A,9===A.level?2:A.strategy>=dA||A.level<2?4:0),LA(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(LA(A,255&A.gzhead.extra.length),LA(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(e.adler=qt(e.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69;else if(LA(A,0),LA(A,0),LA(A,0),LA(A,0),LA(A,0),LA(A,9===A.level?2:A.strategy>=dA||A.level<2?4:0),LA(A,3),A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA;if(69===A.status){if(A.gzhead.extra){let t=A.pending,r=(65535&A.gzhead.extra.length)-A.gzindex;for(;A.pending+r>A.pending_buf_size;){let n=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+n),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>t&&(e.adler=qt(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex+=n,EA(e),0!==A.pending)return A.last_flush=-1,sA;t=0,r-=n}let n=new Uint8Array(A.gzhead.extra);A.pending_buf.set(n.subarray(A.gzindex,A.gzindex+r),A.pending),A.pending+=r,A.gzhead.hcrc&&A.pending>t&&(e.adler=qt(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex=0}A.status=73}if(73===A.status){if(A.gzhead.name){let t,r=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),EA(e),0!==A.pending)return A.last_flush=-1,sA;r=0}t=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,LA(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),A.gzindex=0}A.status=91}if(91===A.status){if(A.gzhead.comment){let t,r=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),EA(e),0!==A.pending)return A.last_flush=-1,sA;r=0}t=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,LA(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r))}A.status=103}if(103===A.status){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(EA(e),0!==A.pending))return A.last_flush=-1,sA;LA(A,255&e.adler),LA(A,e.adler>>8&255),e.adler=0}if(A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA}if(0!==e.avail_in||0!==A.lookahead||t!==tA&&A.status!==CA){let r=0===A.level?HA(A,t):A.strategy===dA?((e,t)=>{let A;for(;;){if(0===e.lookahead&&(TA(e),0===e.lookahead)){if(t===tA)return 1;break}if(e.match_length=0,A=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,A&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2})(A,t):A.strategy===fA?((e,t)=>{let A,r,n,i;const s=e.window;for(;;){if(e.lookahead<=BA){if(TA(e),e.lookahead<=BA&&t===tA)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){i=e.strstart+BA;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<i);e.match_length=BA-(i-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(A=Zt(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(A=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),A&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2})(A,t):MA[A.level].func(A,t);if(3!==r&&4!==r||(A.status=CA),1===r||3===r)return 0===e.avail_out&&(A.last_flush=-1),sA;if(2===r&&(t===AA?eA(A):t!==iA&&(Jt(A,0,0,!1),t===rA&&(QA(A.head),0===A.lookahead&&(A.strstart=0,A.block_start=0,A.insert=0))),EA(e),0===e.avail_out))return A.last_flush=-1,sA}return t!==nA?sA:A.wrap<=0?aA:(2===A.wrap?(LA(A,255&e.adler),LA(A,e.adler>>8&255),LA(A,e.adler>>16&255),LA(A,e.adler>>24&255),LA(A,255&e.total_in),LA(A,e.total_in>>8&255),LA(A,e.total_in>>16&255),LA(A,e.total_in>>24&255)):(_A(A,e.adler>>>16),_A(A,65535&e.adler)),EA(e),A.wrap>0&&(A.wrap=-A.wrap),0!==A.pending?sA:aA)},qA=(e,t)=>{let A=t.length;if(RA(e))return oA;const r=e.state,n=r.wrap;if(2===n||1===n&&r.status!==yA||r.lookahead)return oA;if(1===n&&(e.adler=Gt(e.adler,t,A,0)),r.wrap=0,A>=r.w_size){0===n&&(QA(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(A-r.w_size,A),0),t=e,A=r.w_size}const i=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=A,e.next_in=0,e.input=t,TA(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=SA(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,TA(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=i,r.wrap=n,sA},WA={deflateInit:(e,t)=>GA(e,t,wA,15,8,gA),deflateInit2:GA,deflateReset:KA,deflateResetKeep:VA,deflateSetHeader:(e,t)=>RA(e)||2!==e.state.wrap?oA:(e.state.gzhead=t,sA),deflate:zA,deflateEnd:e=>{if(RA(e))return oA;const t=e.state.status;return e.state=null,t===vA?xA(e,lA):sA},deflateSetDictionary:qA,deflateInfo:"pako deflate (from Nodeca project)"};const XA=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var YA=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const A=t.shift();if(A){if("object"!=typeof A)throw new TypeError(A+"must be non-object");for(const t in A)XA(A,t)&&(e[t]=A[t])}}return e},JA=e=>{let t=0;for(let A=0,r=e.length;A<r;A++)t+=e[A].length;const A=new Uint8Array(t);for(let t=0,r=0,n=e.length;t<n;t++){let n=e[t];A.set(n,r),r+=n.length}return A};let $A=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){$A=!1}const ZA=new Uint8Array(256);for(let e=0;e<256;e++)ZA[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ZA[254]=ZA[254]=1;var er=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,A,r,n,i,s=e.length,a=0;for(n=0;n<s;n++)A=e.charCodeAt(n),55296==(64512&A)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(A=65536+(A-55296<<10)+(r-56320),n++)),a+=A<128?1:A<2048?2:A<65536?3:4;for(t=new Uint8Array(a),i=0,n=0;i<a;n++)A=e.charCodeAt(n),55296==(64512&A)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(A=65536+(A-55296<<10)+(r-56320),n++)),A<128?t[i++]=A:A<2048?(t[i++]=192|A>>>6,t[i++]=128|63&A):A<65536?(t[i++]=224|A>>>12,t[i++]=128|A>>>6&63,t[i++]=128|63&A):(t[i++]=240|A>>>18,t[i++]=128|A>>>12&63,t[i++]=128|A>>>6&63,t[i++]=128|63&A);return t},tr=(e,t)=>{const A=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,n;const i=new Array(2*A);for(n=0,r=0;r<A;){let t=e[r++];if(t<128){i[n++]=t;continue}let s=ZA[t];if(s>4)i[n++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<A;)t=t<<6|63&e[r++],s--;s>1?i[n++]=65533:t<65536?i[n++]=t:(t-=65536,i[n++]=55296|t>>10&1023,i[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&$A)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let A="";for(let r=0;r<t;r++)A+=String.fromCharCode(e[r]);return A})(i,n)},Ar=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let A=t-1;for(;A>=0&&128==(192&e[A]);)A--;return A<0||0===A?t:A+ZA[e[A]]>t?A:t};var rr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const nr=Object.prototype.toString,{Z_NO_FLUSH:ir,Z_SYNC_FLUSH:sr,Z_FULL_FLUSH:ar,Z_FINISH:or,Z_OK:lr,Z_STREAM_END:cr,Z_DEFAULT_COMPRESSION:ur,Z_DEFAULT_STRATEGY:hr,Z_DEFLATED:dr}=Xt;function fr(e){this.options=YA({level:ur,method:dr,chunkSize:16384,windowBits:15,memLevel:8,strategy:hr},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new rr,this.strm.avail_out=0;let A=WA.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(A!==lr)throw new Error(Wt[A]);if(t.header&&WA.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?er(t.dictionary):"[object ArrayBuffer]"===nr.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,A=WA.deflateSetDictionary(this.strm,e),A!==lr)throw new Error(Wt[A]);this._dict_set=!0}}fr.prototype.push=function(e,t){const A=this.strm,r=this.options.chunkSize;let n,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?or:ir,"string"==typeof e?A.input=er(e):"[object ArrayBuffer]"===nr.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;)if(0===A.avail_out&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),(i===sr||i===ar)&&A.avail_out<=6)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else{if(n=WA.deflate(A,i),n===cr)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),n=WA.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===lr;if(0!==A.avail_out){if(i>0&&A.next_out>0)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else if(0===A.avail_in)break}else this.onData(A.output)}return!0},fr.prototype.onData=function(e){this.chunks.push(e)},fr.prototype.onEnd=function(e){e===lr&&(this.result=JA(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const pr=16209;var gr=function(e,t){let A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F;const Q=e.state;A=e.next_in,x=e.input,r=A+(e.avail_in-5),n=e.next_out,F=e.output,i=n-(t-e.avail_out),s=n+(e.avail_out-257),a=Q.dmax,o=Q.wsize,l=Q.whave,c=Q.wnext,u=Q.window,h=Q.hold,d=Q.bits,f=Q.lencode,p=Q.distcode,g=(1<<Q.lenbits)-1,m=(1<<Q.distbits)-1;e:do{d<15&&(h+=x[A++]<<d,d+=8,h+=x[A++]<<d,d+=8),w=f[h&g];t:for(;;){if(B=w>>>24,h>>>=B,d-=B,B=w>>>16&255,0===B)F[n++]=65535&w;else{if(!(16&B)){if(64&B){if(32&B){Q.mode=16191;break e}e.msg="invalid literal/length code",Q.mode=pr;break e}w=f[(65535&w)+(h&(1<<B)-1)];continue t}for(b=65535&w,B&=15,B&&(d<B&&(h+=x[A++]<<d,d+=8),b+=h&(1<<B)-1,h>>>=B,d-=B),d<15&&(h+=x[A++]<<d,d+=8,h+=x[A++]<<d,d+=8),w=p[h&m];;){if(B=w>>>24,h>>>=B,d-=B,B=w>>>16&255,16&B){if(y=65535&w,B&=15,d<B&&(h+=x[A++]<<d,d+=8,d<B&&(h+=x[A++]<<d,d+=8)),y+=h&(1<<B)-1,y>a){e.msg="invalid distance too far back",Q.mode=pr;break e}if(h>>>=B,d-=B,B=n-i,y>B){if(B=y-B,B>l&&Q.sane){e.msg="invalid distance too far back",Q.mode=pr;break e}if(v=0,C=u,0===c){if(v+=o-B,B<b){b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}}else if(c<B){if(v+=o+c-B,B-=c,B<b){b-=B;do{F[n++]=u[v++]}while(--B);if(v=0,c<b){B=c,b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}}}else if(v+=c-B,B<b){b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}for(;b>2;)F[n++]=C[v++],F[n++]=C[v++],F[n++]=C[v++],b-=3;b&&(F[n++]=C[v++],b>1&&(F[n++]=C[v++]))}else{v=n-y;do{F[n++]=F[v++],F[n++]=F[v++],F[n++]=F[v++],b-=3}while(b>2);b&&(F[n++]=F[v++],b>1&&(F[n++]=F[v++]))}break}if(64&B){e.msg="invalid distance code",Q.mode=pr;break e}w=p[(65535&w)+(h&(1<<B)-1)]}}break}}while(A<r&&n<s);b=d>>3,A-=b,d-=b<<3,h&=(1<<d)-1,e.next_in=A,e.next_out=n,e.avail_in=A<r?r-A+5:5-(A-r),e.avail_out=n<s?s-n+257:257-(n-s),Q.hold=h,Q.bits=d};const mr=15,wr=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]),Br=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]),br=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]),yr=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var vr=(e,t,A,r,n,i,s,a)=>{const o=a.bits;let l,c,u,h,d,f,p=0,g=0,m=0,w=0,B=0,b=0,y=0,v=0,C=0,x=0,F=null;const Q=new Uint16Array(16),U=new Uint16Array(16);let S,E,N,L=null;for(p=0;p<=mr;p++)Q[p]=0;for(g=0;g<r;g++)Q[t[A+g]]++;for(B=o,w=mr;w>=1&&0===Q[w];w--);if(B>w&&(B=w),0===w)return n[i++]=20971520,n[i++]=20971520,a.bits=1,0;for(m=1;m<w&&0===Q[m];m++);for(B<m&&(B=m),v=1,p=1;p<=mr;p++)if(v<<=1,v-=Q[p],v<0)return-1;if(v>0&&(0===e||1!==w))return-1;for(U[1]=0,p=1;p<mr;p++)U[p+1]=U[p]+Q[p];for(g=0;g<r;g++)0!==t[A+g]&&(s[U[t[A+g]]++]=g);if(0===e?(F=L=s,f=20):1===e?(F=wr,L=Br,f=257):(F=br,L=yr,f=0),x=0,g=0,p=m,d=i,b=B,y=0,u=-1,C=1<<B,h=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){S=p-y,s[g]+1<f?(E=0,N=s[g]):s[g]>=f?(E=L[s[g]-f],N=F[s[g]-f]):(E=96,N=0),l=1<<p-y,c=1<<b,m=c;do{c-=l,n[d+(x>>y)+c]=S<<24|E<<16|N}while(0!==c);for(l=1<<p-1;x&l;)l>>=1;if(0!==l?(x&=l-1,x+=l):x=0,g++,0===--Q[p]){if(p===w)break;p=t[A+s[g]]}if(p>B&&(x&h)!==u){for(0===y&&(y=B),d+=m,b=p-y,v=1<<b;b+y<w&&(v-=Q[b+y],!(v<=0));)b++,v<<=1;if(C+=1<<b,1===e&&C>852||2===e&&C>592)return 1;u=x&h,n[u]=B<<24|b<<16|d-i}}return 0!==x&&(n[d+x]=p-y<<24|64<<16),a.bits=B,0};const{Z_FINISH:Cr,Z_BLOCK:xr,Z_TREES:Fr,Z_OK:Qr,Z_STREAM_END:Ur,Z_NEED_DICT:Sr,Z_STREAM_ERROR:Er,Z_DATA_ERROR:Nr,Z_MEM_ERROR:Lr,Z_BUF_ERROR:_r,Z_DEFLATED:Ir}=Xt,kr=16180,Tr=16190,Hr=16191,Or=16192,Pr=16194,Dr=16199,Mr=16200,jr=16206,Rr=16209,Vr=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Kr(){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 Gr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<kr||t.mode>16211?1:0},zr=e=>{if(Gr(e))return Er;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=kr,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Qr},qr=e=>{if(Gr(e))return Er;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zr(e)},Wr=(e,t)=>{let A;if(Gr(e))return Er;const r=e.state;return t<0?(A=0,t=-t):(A=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Er:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=A,r.wbits=t,qr(e))},Xr=(e,t)=>{if(!e)return Er;const A=new Kr;e.state=A,A.strm=e,A.window=null,A.mode=kr;const r=Wr(e,t);return r!==Qr&&(e.state=null),r};let Yr,Jr,$r=!0;const Zr=e=>{if($r){Yr=new Int32Array(512),Jr=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(vr(1,e.lens,0,288,Yr,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;vr(2,e.lens,0,32,Jr,0,e.work,{bits:5}),$r=!1}e.lencode=Yr,e.lenbits=9,e.distcode=Jr,e.distbits=5},en=(e,t,A,r)=>{let n;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(A-i.wsize,A),0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>r&&(n=r),i.window.set(t.subarray(A-r,A-r+n),i.wnext),(r-=n)?(i.window.set(t.subarray(A-r,A),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0};var tn=(e,t)=>{let A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x=0;const F=new Uint8Array(4);let Q,U;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gr(e)||!e.output||!e.input&&0!==e.avail_in)return Er;A=e.state,A.mode===Hr&&(A.mode=Or),s=e.next_out,n=e.output,o=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,l=A.hold,c=A.bits,u=a,h=o,C=Qr;e:for(;;)switch(A.mode){case kr:if(0===A.wrap){A.mode=Or;break}for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(2&A.wrap&&35615===l){0===A.wbits&&(A.wbits=15),A.check=0,F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0),l=0,c=0,A.mode=16181;break}if(A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",A.mode=Rr;break}if((15&l)!==Ir){e.msg="unknown compression method",A.mode=Rr;break}if(l>>>=4,c-=4,v=8+(15&l),0===A.wbits&&(A.wbits=v),v>15||v>A.wbits){e.msg="invalid window size",A.mode=Rr;break}A.dmax=1<<A.wbits,A.flags=0,e.adler=A.check=1,A.mode=512&l?16189:Hr,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(A.flags=l,(255&A.flags)!==Ir){e.msg="unknown compression method",A.mode=Rr;break}if(57344&A.flags){e.msg="unknown header flags set",A.mode=Rr;break}A.head&&(A.head.text=l>>8&1),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0,A.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.head&&(A.head.time=l),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,F[2]=l>>>16&255,F[3]=l>>>24&255,A.check=qt(A.check,F,4,0)),l=0,c=0,A.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.head&&(A.head.xflags=255&l,A.head.os=l>>8),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0,A.mode=16184;case 16184:if(1024&A.flags){for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.length=l,A.head&&(A.head.extra_len=l),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0}else A.head&&(A.head.extra=null);A.mode=16185;case 16185:if(1024&A.flags&&(d=A.length,d>a&&(d=a),d&&(A.head&&(v=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(r.subarray(i,i+d),v)),512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,A.length-=d),A.length))break e;A.length=0,A.mode=16186;case 16186:if(2048&A.flags){if(0===a)break e;d=0;do{v=r[i+d++],A.head&&v&&A.length<65536&&(A.head.name+=String.fromCharCode(v))}while(v&&d<a);if(512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,v)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=16187;case 16187:if(4096&A.flags){if(0===a)break e;d=0;do{v=r[i+d++],A.head&&v&&A.length<65536&&(A.head.comment+=String.fromCharCode(v))}while(v&&d<a);if(512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,v)break e}else A.head&&(A.head.comment=null);A.mode=16188;case 16188:if(512&A.flags){for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(4&A.wrap&&l!==(65535&A.check)){e.msg="header crc mismatch",A.mode=Rr;break}l=0,c=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),e.adler=A.check=0,A.mode=Hr;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}e.adler=A.check=Vr(l),l=0,c=0,A.mode=Tr;case Tr:if(0===A.havedict)return e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,Sr;e.adler=A.check=1,A.mode=Hr;case Hr:if(t===xr||t===Fr)break e;case Or:if(A.last){l>>>=7&c,c-=7&c,A.mode=jr;break}for(;c<3;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}switch(A.last=1&l,l>>>=1,c-=1,3&l){case 0:A.mode=16193;break;case 1:if(Zr(A),A.mode=Dr,t===Fr){l>>>=2,c-=2;break e}break;case 2:A.mode=16196;break;case 3:e.msg="invalid block type",A.mode=Rr}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",A.mode=Rr;break}if(A.length=65535&l,l=0,c=0,A.mode=Pr,t===Fr)break e;case Pr:A.mode=16195;case 16195:if(d=A.length,d){if(d>a&&(d=a),d>o&&(d=o),0===d)break e;n.set(r.subarray(i,i+d),s),a-=d,i+=d,o-=d,s+=d,A.length-=d;break}A.mode=Hr;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(A.nlen=257+(31&l),l>>>=5,c-=5,A.ndist=1+(31&l),l>>>=5,c-=5,A.ncode=4+(15&l),l>>>=4,c-=4,A.nlen>286||A.ndist>30){e.msg="too many length or distance symbols",A.mode=Rr;break}A.have=0,A.mode=16197;case 16197:for(;A.have<A.ncode;){for(;c<3;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.lens[S[A.have++]]=7&l,l>>>=3,c-=3}for(;A.have<19;)A.lens[S[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,Q={bits:A.lenbits},C=vr(0,A.lens,0,19,A.lencode,0,A.work,Q),A.lenbits=Q.bits,C){e.msg="invalid code lengths set",A.mode=Rr;break}A.have=0,A.mode=16198;case 16198:for(;A.have<A.nlen+A.ndist;){for(;x=A.lencode[l&(1<<A.lenbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(w<16)l>>>=g,c-=g,A.lens[A.have++]=w;else{if(16===w){for(U=g+2;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(l>>>=g,c-=g,0===A.have){e.msg="invalid bit length repeat",A.mode=Rr;break}v=A.lens[A.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===w){for(U=g+3;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=g,c-=g,v=0,d=3+(7&l),l>>>=3,c-=3}else{for(U=g+7;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=g,c-=g,v=0,d=11+(127&l),l>>>=7,c-=7}if(A.have+d>A.nlen+A.ndist){e.msg="invalid bit length repeat",A.mode=Rr;break}for(;d--;)A.lens[A.have++]=v}}if(A.mode===Rr)break;if(0===A.lens[256]){e.msg="invalid code -- missing end-of-block",A.mode=Rr;break}if(A.lenbits=9,Q={bits:A.lenbits},C=vr(1,A.lens,0,A.nlen,A.lencode,0,A.work,Q),A.lenbits=Q.bits,C){e.msg="invalid literal/lengths set",A.mode=Rr;break}if(A.distbits=6,A.distcode=A.distdyn,Q={bits:A.distbits},C=vr(2,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,Q),A.distbits=Q.bits,C){e.msg="invalid distances set",A.mode=Rr;break}if(A.mode=Dr,t===Fr)break e;case Dr:A.mode=Mr;case Mr:if(a>=6&&o>=258){e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,gr(e,h),s=e.next_out,n=e.output,o=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,l=A.hold,c=A.bits,A.mode===Hr&&(A.back=-1);break}for(A.back=0;x=A.lencode[l&(1<<A.lenbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(m&&!(240&m)){for(B=g,b=m,y=w;x=A.lencode[y+((l&(1<<B+b)-1)>>B)],g=x>>>24,m=x>>>16&255,w=65535&x,!(B+g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=B,c-=B,A.back+=B}if(l>>>=g,c-=g,A.back+=g,A.length=w,0===m){A.mode=16205;break}if(32&m){A.back=-1,A.mode=Hr;break}if(64&m){e.msg="invalid literal/length code",A.mode=Rr;break}A.extra=15&m,A.mode=16201;case 16201:if(A.extra){for(U=A.extra;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.length+=l&(1<<A.extra)-1,l>>>=A.extra,c-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=16202;case 16202:for(;x=A.distcode[l&(1<<A.distbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(!(240&m)){for(B=g,b=m,y=w;x=A.distcode[y+((l&(1<<B+b)-1)>>B)],g=x>>>24,m=x>>>16&255,w=65535&x,!(B+g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=B,c-=B,A.back+=B}if(l>>>=g,c-=g,A.back+=g,64&m){e.msg="invalid distance code",A.mode=Rr;break}A.offset=w,A.extra=15&m,A.mode=16203;case 16203:if(A.extra){for(U=A.extra;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.offset+=l&(1<<A.extra)-1,l>>>=A.extra,c-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){e.msg="invalid distance too far back",A.mode=Rr;break}A.mode=16204;case 16204:if(0===o)break e;if(d=h-o,A.offset>d){if(d=A.offset-d,d>A.whave&&A.sane){e.msg="invalid distance too far back",A.mode=Rr;break}d>A.wnext?(d-=A.wnext,f=A.wsize-d):f=A.wnext-d,d>A.length&&(d=A.length),p=A.window}else p=n,f=s-A.offset,d=A.length;d>o&&(d=o),o-=d,A.length-=d;do{n[s++]=p[f++]}while(--d);0===A.length&&(A.mode=Mr);break;case 16205:if(0===o)break e;n[s++]=A.length,o--,A.mode=Mr;break;case jr:if(A.wrap){for(;c<32;){if(0===a)break e;a--,l|=r[i++]<<c,c+=8}if(h-=o,e.total_out+=h,A.total+=h,4&A.wrap&&h&&(e.adler=A.check=A.flags?qt(A.check,n,h,s-h):Gt(A.check,n,h,s-h)),h=o,4&A.wrap&&(A.flags?l:Vr(l))!==A.check){e.msg="incorrect data check",A.mode=Rr;break}l=0,c=0}A.mode=16207;case 16207:if(A.wrap&&A.flags){for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(4&A.wrap&&l!==(4294967295&A.total)){e.msg="incorrect length check",A.mode=Rr;break}l=0,c=0}A.mode=16208;case 16208:C=Ur;break e;case Rr:C=Nr;break e;case 16210:return Lr;default:return Er}return e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,(A.wsize||h!==e.avail_out&&A.mode<Rr&&(A.mode<jr||t!==Cr))&&en(e,e.output,e.next_out,h-e.avail_out),u-=e.avail_in,h-=e.avail_out,e.total_in+=u,e.total_out+=h,A.total+=h,4&A.wrap&&h&&(e.adler=A.check=A.flags?qt(A.check,n,h,e.next_out-h):Gt(A.check,n,h,e.next_out-h)),e.data_type=A.bits+(A.last?64:0)+(A.mode===Hr?128:0)+(A.mode===Dr||A.mode===Pr?256:0),(0===u&&0===h||t===Cr)&&C===Qr&&(C=_r),C},An={inflateReset:qr,inflateReset2:Wr,inflateResetKeep:zr,inflateInit:e=>Xr(e,15),inflateInit2:Xr,inflate:tn,inflateEnd:e=>{if(Gr(e))return Er;let t=e.state;return t.window&&(t.window=null),e.state=null,Qr},inflateGetHeader:(e,t)=>{if(Gr(e))return Er;const A=e.state;return 2&A.wrap?(A.head=t,t.done=!1,Qr):Er},inflateSetDictionary:(e,t)=>{const A=t.length;let r,n,i;return Gr(e)?Er:(r=e.state,0!==r.wrap&&r.mode!==Tr?Er:r.mode===Tr&&(n=1,n=Gt(n,t,A,0),n!==r.check)?Nr:(i=en(e,t,A,A),i?(r.mode=16210,Lr):(r.havedict=1,Qr)))},inflateInfo:"pako inflate (from Nodeca project)"};var rn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const nn=Object.prototype.toString,{Z_NO_FLUSH:sn,Z_FINISH:an,Z_OK:on,Z_STREAM_END:ln,Z_NEED_DICT:cn,Z_STREAM_ERROR:un,Z_DATA_ERROR:hn,Z_MEM_ERROR:dn}=Xt;function fn(e){this.options=YA({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new rr,this.strm.avail_out=0;let A=An.inflateInit2(this.strm,t.windowBits);if(A!==on)throw new Error(Wt[A]);if(this.header=new rn,An.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=er(t.dictionary):"[object ArrayBuffer]"===nn.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(A=An.inflateSetDictionary(this.strm,t.dictionary),A!==on)))throw new Error(Wt[A])}function pn(e,t){const A=new fn(t);if(A.push(e),A.err)throw A.msg||Wt[A.err];return A.result}fn.prototype.push=function(e,t){const A=this.strm,r=this.options.chunkSize,n=this.options.dictionary;let i,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?an:sn,"[object ArrayBuffer]"===nn.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;){for(0===A.avail_out&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),i=An.inflate(A,s),i===cn&&n&&(i=An.inflateSetDictionary(A,n),i===on?i=An.inflate(A,s):i===hn&&(i=cn));A.avail_in>0&&i===ln&&A.state.wrap>0&&0!==e[A.next_in];)An.inflateReset(A),i=An.inflate(A,s);switch(i){case un:case hn:case cn:case dn:return this.onEnd(i),this.ended=!0,!1}if(a=A.avail_out,A.next_out&&(0===A.avail_out||i===ln))if("string"===this.options.to){let e=Ar(A.output,A.next_out),t=A.next_out-e,n=tr(A.output,e);A.next_out=t,A.avail_out=r-t,t&&A.output.set(A.output.subarray(e,e+t),0),this.onData(n)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(i!==on||0!==a){if(i===ln)return i=An.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===A.avail_in)break}}return!0},fn.prototype.onData=function(e){this.chunks.push(e)},fn.prototype.onEnd=function(e){e===on&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=JA(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var gn={Inflate:fn,inflate:pn,inflateRaw:function(e,t){return(t=t||{}).raw=!0,pn(e,t)},ungzip:pn,constants:Xt};const{Inflate:mn,inflate:wn,inflateRaw:Bn,ungzip:bn}=gn;var yn=mn,vn=wn;const Cn=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;Cn[e]=t}const xn=4294967295;function Fn(e,t){return(function(e,t,A){let r=e;for(let e=0;e<A;e++)r=Cn[255&(r^t[e])]^r>>>8;return r}(xn,e,t)^xn)>>>0}function Qn(e,t,A){const r=e.readUint32(),n=Fn(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(n!==r)throw new Error(`CRC mismatch for chunk ${A}. Expected ${r}, found ${n}`)}function Un(e,t,A){for(let r=0;r<A;r++)t[r]=e[r]}function Sn(e,t,A,r){let n=0;for(;n<r;n++)t[n]=e[n];for(;n<A;n++)t[n]=e[n]+t[n-r]&255}function En(e,t,A,r){let n=0;if(0===A.length)for(;n<r;n++)t[n]=e[n];else for(;n<r;n++)t[n]=e[n]+A[n]&255}function Nn(e,t,A,r,n){let i=0;if(0===A.length){for(;i<n;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+(t[i-n]>>1)&255}else{for(;i<n;i++)t[i]=e[i]+(A[i]>>1)&255;for(;i<r;i++)t[i]=e[i]+(t[i-n]+A[i]>>1)&255}}function Ln(e,t,A,r,n){let i=0;if(0===A.length){for(;i<n;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-n]&255}else{for(;i<n;i++)t[i]=e[i]+A[i]&255;for(;i<r;i++)t[i]=e[i]+_n(t[i-n],A[i],A[i-n])&255}}function _n(e,t,A){const r=e+t-A,n=Math.abs(r-e),i=Math.abs(r-t),s=Math.abs(r-A);return n<=i&&n<=s?e:i<=s?t:A}function In(e,t,A,r,n,i){switch(e){case 0:Un(t,A,n);break;case 1:Sn(t,A,n,i);break;case 2:En(t,A,r,n);break;case 3:Nn(t,A,r,n,i);break;case 4:Ln(t,A,r,n,i);break;default:throw new Error(`Unsupported filter: ${e}`)}}const kn=new Uint16Array([255]),Tn=255===new Uint8Array(kn.buffer)[0];function Hn(e){return(255&e)<<8|e>>8&255}const On=new Uint16Array([255]),Pn=255===new Uint8Array(On.buffer)[0],Dn=new Uint8Array(0);function Mn(e){const{data:t,width:A,height:r,channels:n,depth:i}=e,s=Math.ceil(i/8)*n,a=Math.ceil(i/8*n*A),o=new Uint8Array(r*a);let l,c,u=Dn,h=0;for(let e=0;e<r;e++){switch(l=t.subarray(h+1,h+1+a),c=o.subarray(e*a,(e+1)*a),t[h]){case 0:Un(l,c,a);break;case 1:Sn(l,c,a,s);break;case 2:En(l,c,u,a);break;case 3:Nn(l,c,u,a,s);break;case 4:Ln(l,c,u,a,s);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}u=c,h+=a+1}if(16===i){const e=new Uint16Array(o.buffer);if(Pn)for(let t=0;t<e.length;t++)e[t]=jn(e[t]);return e}return o}function jn(e){return(255&e)<<8|e>>8&255}const Rn=Uint8Array.of(137,80,78,71,13,10,26,10);function Vn(e){if(!function(e){if(e.length<Rn.length)return!1;for(let t=0;t<Rn.length;t++)if(e[t]!==Rn[t])return!1;return!0}(e.readBytes(Rn.length)))throw new Error("wrong PNG signature")}const Kn=new TextDecoder("latin1");function Gn(e){if(function(e){if(!zn.test(e))throw new Error("invalid latin1 text")}(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const zn=/^[\u0000-\u00FF]*$/;function qn(e,t,A){const r=Wn(t);e[r]=function(e,t){return Kn.decode(e.readBytes(t))}(t,A-r.length-1)}function Wn(e){for(e.mark();0!==e.readByte(););const t=e.offset;e.reset();const A=Kn.decode(e.readBytes(t-e.offset-1));return e.skip(1),Gn(A),A}const Xn=-1,Yn=0,Jn=2,$n=3,Zn=4,ei=6,ti=-1,Ai=0,ri=-1,ni=0,ii=-1,si=0,ai=1,oi=0,li=1,ci=2,ui=0,hi=1;class di extends rt{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:A=!1}=t;this._checkCrc=A,this._inflator=new yn,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=ti,this._filterMethod=ri,this._interlaceMethod=ii,this._colorType=Xn,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Vn(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(Vn(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const A=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case"tEXt":qn(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-A!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Qn(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const A=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=A+e}if(this.offset-A!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Qn(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}(this.readUint8());const t=this.readUint8();let A;switch(this._colorType=t,t){case Yn:A=1;break;case Jn:A=3;break;case $n:A=1;break;case Zn:A=2;break;case ei:A=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=A,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ai)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const A=[];this._palette=A;for(let e=0;e<t;e++)A.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,A=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,A,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,A=this.offset+this.byteOffset;if(A+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,A,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case Yn:case Jn:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case $n:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=Wn(this),A=this.readUint8();if(A!==Ai)throw new Error(`Unsupported iCCP compression method: ${A}`);const r=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:vn(r)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),A=this.readByte();this._png.resolution={x:e,y:t,unit:A}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},A=this._frames.at(e);if(A){if(A.data=Mn({data:A.data,width:A.width,height:A.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===A.xOffset&&0===A.yOffset&&A.width===this._png.width&&A.height===this._png.height)t.data=A.data;else{const r=this._apng.frames.at(e-1);this.disposeFrame(A,r,t),this.addFrameDataToCanvas(t,A)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,A){switch(e.disposeOp){case oi:break;case li:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const n=(t*e.width+r)*this._png.channels;for(let e=0;e<this._png.channels;e++)A.data[n+e]=0}break;case ci:A.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const A=1<<this._png.depth,r=(e,A)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+A)*this._png.channels,frameIndex:(e*t.width+A)*this._png.channels});switch(t.blendOp){case ui:for(let A=0;A<t.height;A++)for(let n=0;n<t.width;n++){const{index:i,frameIndex:s}=r(A,n);for(let A=0;A<this._png.channels;A++)e.data[i+A]=t.data[s+A]}break;case hi:for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const{index:s,frameIndex:a}=r(n,i);for(let r=0;r<this._png.channels;r++){const n=t.data[a+this._png.channels-1]/A,i=r%(this._png.channels-1)==0?1:t.data[a+r],o=Math.floor(n*i+(1-n)*e.data[s+r]);e.data[s+r]+=o}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==ni)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===si)this._png.data=Mn({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==ai)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(e){const{data:t,width:A,height:r,channels:n,depth:i}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(i/8)*n,o=new Uint8Array(r*A*a);let l=0;for(let e=0;e<7;e++){const n=s[e],i=Math.ceil((A-n.x)/n.xStep),c=Math.ceil((r-n.y)/n.yStep);if(i<=0||c<=0)continue;const u=i*a,h=new Uint8Array(u);for(let e=0;e<c;e++){const s=t[l++],c=t.subarray(l,l+u);l+=u;const d=new Uint8Array(u);In(s,c,d,h,u,a),h.set(d);for(let t=0;t<i;t++){const i=n.x+t*n.xStep,s=n.y+e*n.yStep;if(!(i>=A||s>=r))for(let e=0;e<a;e++)o[(s*A+i)*a+e]=d[t*a+e]}}}if(16===i){const e=new Uint16Array(o.buffer);if(Tn)for(let t=0;t<e.length;t++)e[t]=Hn(e[t]);return e}return o}({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:oi,blendOp:ui,data:e}),this._inflator=new yn,this._writingDataChunks=!1}}var fi;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"}(fi||(fi={}));
|
|
30
|
+
var e=function(t,A){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])},e(t,A)};function t(t,A){if("function"!=typeof A&&null!==A)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function r(){this.constructor=t}e(t,A),t.prototype=null===A?Object.create(A):(r.prototype=A.prototype,new r)}var A=function(){return A=Object.assign||function(e){for(var t,A=1,r=arguments.length;A<r;A++)for(var n in t=arguments[A])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},A.apply(this,arguments)};function r(e,t,A,r){function n(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,i){function s(e){try{o(r.next(e))}catch(e){i(e)}}function a(e){try{o(r.throw(e))}catch(e){i(e)}}function o(e){e.done?A(e.value):n(e.value).then(s,a)}o((r=r.apply(e,t||[])).next())})}function n(e,t){var A,r,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return o([e,t])}}function o(i){if(A)throw new TypeError("Generator is already executing.");for(;s;)try{if(A=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{A=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function i(e,t,A){if(A||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||t)}for(var s=function(){function e(e,t,A,r){this.left=e,this.top=t,this.width=A,this.height=r}return e.prototype.add=function(t,A,r,n){return new e(this.left+t,this.top+A,this.width+r,this.height+n)},e.fromClientRect=function(t,A){return new e(A.left+t.windowBounds.left,A.top+t.windowBounds.top,A.width,A.height)},e.fromDOMRectList=function(t,A){var r=Array.from(A).find(function(e){return 0!==e.width});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,t){return s.fromClientRect(e,t.getBoundingClientRect())},o=function(e){var t=e.body,A=e.documentElement;if(!t||!A)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,A.scrollWidth),Math.max(t.offsetWidth,A.offsetWidth),Math.max(t.clientWidth,A.clientWidth)),n=Math.max(Math.max(t.scrollHeight,A.scrollHeight),Math.max(t.offsetHeight,A.offsetHeight),Math.max(t.clientHeight,A.clientHeight));return new s(0,0,r,n)},l=function(e){for(var t=[],A=0,r=e.length;A<r;){var n=e.charCodeAt(A++);if(n>=55296&&n<=56319&&A<r){var i=e.charCodeAt(A++);56320==(64512&i)?t.push(((1023&n)<<10)+(1023&i)+65536):(t.push(n),A--)}else t.push(n)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var r=[],n=-1,i="";++n<A;){var s=e[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===A||r.length>16384)&&(i+=String.fromCharCode.apply(String,r),r.length=0)}return i},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<u.length;d++)h[u.charCodeAt(d)]=d;for(var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<f.length;g++)p[f.charCodeAt(g)]=g;for(var m=function(e){var t,A,r,n,i,s=.75*e.length,a=e.length,o=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<a;t+=4)A=p[e.charCodeAt(t)],r=p[e.charCodeAt(t+1)],n=p[e.charCodeAt(t+2)],i=p[e.charCodeAt(t+3)],c[o++]=A<<2|r>>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&i;return l},w=function(e){for(var t=e.length,A=[],r=0;r<t;r+=2)A.push(e[r+1]<<8|e[r]);return A},B=function(e){for(var t=e.length,A=[],r=0;r<t;r+=4)A.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return A},b=5,y=11,v=2,C=65536>>b,x=(1<<b)-1,F=C+(1024>>b)+32,Q=65536>>y,U=(1<<y-b)-1,S=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},E=function(e,t,A){return e.slice?e.slice(t,A):new Uint32Array(Array.prototype.slice.call(e,t,A))},N=function(e,t){var A=m(e),r=Array.isArray(A)?B(A):new Uint32Array(A),n=Array.isArray(A)?w(A):new Uint16Array(A),i=24,s=S(n,i/2,r[4]/2),a=2===r[5]?S(n,(i+r[4])/2):E(r,Math.ceil((i+r[4])/4));return new L(r[0],r[1],r[2],r[3],s,a)},L=function(){function e(e,t,A,r,n,i){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=r,this.index=n,this.data=i}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>b])<<v)+(e&x),this.data[t];if(e<=65535)return t=((t=this.index[C+(e-55296>>b)])<<v)+(e&x),this.data[t];if(e<this.highStart)return t=F-Q+(e>>y),t=this.index[t],t+=e>>b&U,t=((t=this.index[t])<<v)+(e&x),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="undefined"==typeof Uint8Array?[]:new Uint8Array(256),k=0;k<_.length;k++)I[_.charCodeAt(k)]=k;var T=50,H=1,O=2,P=3,D=4,M=5,j=7,R=8,V=9,K=10,z=11,G=12,q=13,W=14,X=15,Y=16,J=17,$=18,Z=19,ee=20,te=21,Ae=22,re=23,ne=24,ie=25,se=26,ae=27,oe=28,le=29,ce=30,ue=31,he=32,de=33,fe=34,pe=35,ge=36,me=37,we=38,Be=39,be=40,ye=41,ve=42,Ce=43,xe=[9001,65288],Fe="!",Qe="×",Ue="÷",Se=N("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),Ee=[ce,ge],Ne=[H,O,P,M],Le=[K,R],_e=[ae,se],Ie=Ne.concat(Le),ke=[we,Be,be,fe,pe],Te=[X,q],He=function(e,t){void 0===t&&(t="strict");var A=[],r=[],n=[];return e.forEach(function(e,i){var s=Se.get(e);if(s>T?(n.push(!0),s-=T):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(i),A.push(Y);if(s===D||s===z){if(0===i)return r.push(i),A.push(ce);var a=A[i-1];return-1===Ie.indexOf(a)?(r.push(r[i-1]),A.push(a)):(r.push(i),A.push(ce))}return r.push(i),s===ue?A.push("strict"===t?te:me):s===ve||s===le?A.push(ce):s===Ce?e>=131072&&e<=196605||e>=196608&&e<=262141?A.push(me):A.push(ce):void A.push(s)}),[r,A,n]},Oe=function(e,t,A,r){var n=r[A];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var i=A;i<=r.length;){if((o=r[++i])===t)return!0;if(o!==K)break}if(n===K)for(i=A;i>0;){var s=r[--i];if(Array.isArray(e)?-1!==e.indexOf(s):e===s)for(var a=A;a<=r.length;){var o;if((o=r[++a])===t)return!0;if(o!==K)break}if(s!==K)break}return!1},Pe=function(e,t){for(var A=e;A>=0;){var r=t[A];if(r!==K)return r;A--}return 0},De=function(e,t,A,r,n){if(0===A[r])return Qe;var i=r-1;if(Array.isArray(n)&&!0===n[i])return Qe;var s=i-1,a=i+1,o=t[i],l=s>=0?t[s]:0,c=t[a];if(o===O&&c===P)return Qe;if(-1!==Ne.indexOf(o))return Fe;if(-1!==Ne.indexOf(c))return Qe;if(-1!==Le.indexOf(c))return Qe;if(Pe(i,t)===R)return Ue;if(Se.get(e[i])===z)return Qe;if((o===he||o===de)&&Se.get(e[a])===z)return Qe;if(o===j||c===j)return Qe;if(o===V)return Qe;if(-1===[K,q,X].indexOf(o)&&c===V)return Qe;if(-1!==[J,$,Z,ne,oe].indexOf(c))return Qe;if(Pe(i,t)===Ae)return Qe;if(Oe(re,Ae,i,t))return Qe;if(Oe([J,$],te,i,t))return Qe;if(Oe(G,G,i,t))return Qe;if(o===K)return Ue;if(o===re||c===re)return Qe;if(c===Y||o===Y)return Ue;if(-1!==[q,X,te].indexOf(c)||o===W)return Qe;if(l===ge&&-1!==Te.indexOf(o))return Qe;if(o===oe&&c===ge)return Qe;if(c===ee)return Qe;if(-1!==Ee.indexOf(c)&&o===ie||-1!==Ee.indexOf(o)&&c===ie)return Qe;if(o===ae&&-1!==[me,he,de].indexOf(c)||-1!==[me,he,de].indexOf(o)&&c===se)return Qe;if(-1!==Ee.indexOf(o)&&-1!==_e.indexOf(c)||-1!==_e.indexOf(o)&&-1!==Ee.indexOf(c))return Qe;if(-1!==[ae,se].indexOf(o)&&(c===ie||-1!==[Ae,X].indexOf(c)&&t[a+1]===ie)||-1!==[Ae,X].indexOf(o)&&c===ie||o===ie&&-1!==[ie,oe,ne].indexOf(c))return Qe;if(-1!==[ie,oe,ne,J,$].indexOf(c))for(var u=i;u>=0;){if((h=t[u])===ie)return Qe;if(-1===[oe,ne].indexOf(h))break;u--}if(-1!==[ae,se].indexOf(c))for(u=-1!==[J,$].indexOf(o)?s:i;u>=0;){var h;if((h=t[u])===ie)return Qe;if(-1===[oe,ne].indexOf(h))break;u--}if(we===o&&-1!==[we,Be,fe,pe].indexOf(c)||-1!==[Be,fe].indexOf(o)&&-1!==[Be,be].indexOf(c)||-1!==[be,pe].indexOf(o)&&c===be)return Qe;if(-1!==ke.indexOf(o)&&-1!==[ee,se].indexOf(c)||-1!==ke.indexOf(c)&&o===ae)return Qe;if(-1!==Ee.indexOf(o)&&-1!==Ee.indexOf(c))return Qe;if(o===ne&&-1!==Ee.indexOf(c))return Qe;if(-1!==Ee.concat(ie).indexOf(o)&&c===Ae&&-1===xe.indexOf(e[a])||-1!==Ee.concat(ie).indexOf(c)&&o===$)return Qe;if(o===ye&&c===ye){for(var d=A[i],f=1;d>0&&t[--d]===ye;)f++;if(f%2!=0)return Qe}return o===he&&c===de?Qe:Ue},Me=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var A=He(e,t.lineBreak),r=A[0],n=A[1],i=A[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(n=n.map(function(e){return-1!==[ie,ce,ve].indexOf(e)?me:e}));var s="keep-all"===t.wordBreak?i.map(function(t,A){return t&&e[A]>=19968&&e[A]<=40959}):void 0;return[r,n,s]},je=function(){function e(e,t,A,r){this.codePoints=e,this.required=t===Fe,this.start=A,this.end=r}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Re=function(e,t){var A=l(e),r=Me(A,t),n=r[0],i=r[1],s=r[2],a=A.length,o=0,c=0;return{next:function(){if(c>=a)return{done:!0,value:null};for(var e=Qe;c<a&&(e=De(A,i,n,++c,s))===Qe;);if(e!==Qe||c===a){var t=new je(A,e,o,c);return o=c,{value:t,done:!1}}return{done:!0,value:null}}}},Ve=1,Ke=2,ze=4,Ge=8,qe=10,We=47,Xe=92,Ye=9,Je=32,$e=34,Ze=61,et=35,tt=36,At=37,rt=39,nt=40,it=41,st=95,at=45,ot=33,lt=60,ct=62,ut=64,ht=91,dt=93,ft=61,pt=123,gt=63,mt=125,wt=124,Bt=126,bt=128,yt=65533,vt=42,Ct=43,xt=44,Ft=58,Qt=59,Ut=46,St=0,Et=8,Nt=11,Lt=14,_t=31,It=127,kt=-1,Tt=48,Ht=97,Ot=101,Pt=102,Dt=117,Mt=122,jt=65,Rt=69,Vt=70,Kt=85,zt=90,Gt=function(e){return e>=Tt&&e<=57},qt=function(e){return e>=55296&&e<=57343},Wt=function(e){return Gt(e)||e>=jt&&e<=Vt||e>=Ht&&e<=Pt},Xt=function(e){return e>=Ht&&e<=Mt},Yt=function(e){return e>=jt&&e<=zt},Jt=function(e){return Xt(e)||Yt(e)},$t=function(e){return e>=bt},Zt=function(e){return e===qe||e===Ye||e===Je},eA=function(e){return Jt(e)||$t(e)||e===st},tA=function(e){return eA(e)||Gt(e)||e===at},AA=function(e){return e>=St&&e<=Et||e===Nt||e>=Lt&&e<=_t||e===It},rA=function(e,t){return e===Xe&&t!==qe},nA=function(e,t,A){return e===at?eA(t)||rA(t,A):!!eA(e)||!(e!==Xe||!rA(e,t))},iA=function(e,t,A){return e===Ct||e===at?!!Gt(t)||t===Ut&&Gt(A):Gt(e===Ut?t:e)},sA=function(e){var t=0,A=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(A=-1),t++);for(var r=[];Gt(e[t]);)r.push(e[t++]);var n=r.length?parseInt(c.apply(void 0,r),10):0;e[t]===Ut&&t++;for(var i=[];Gt(e[t]);)i.push(e[t++]);var s=i.length,a=s?parseInt(c.apply(void 0,i),10):0;e[t]!==Rt&&e[t]!==Ot||t++;var o=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(o=-1),t++);for(var l=[];Gt(e[t]);)l.push(e[t++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return A*(n+a*Math.pow(10,-s))*Math.pow(10,o*u)},aA={type:2},oA={type:3},lA={type:4},cA={type:13},uA={type:8},hA={type:21},dA={type:9},fA={type:10},pA={type:11},gA={type:12},mA={type:14},wA={type:23},BA={type:1},bA={type:25},yA={type:24},vA={type:26},CA={type:27},xA={type:28},FA={type:29},QA={type:31},UA={type:32},SA=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(l(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==UA;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case $e:return this.consumeStringToken($e);case et:var t=this.peekCodePoint(0),A=this.peekCodePoint(1),r=this.peekCodePoint(2);if(tA(t)||rA(A,r)){var n=nA(t,A,r)?Ke:Ve;return{type:5,value:this.consumeName(),flags:n}}break;case tt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),cA;break;case rt:return this.consumeStringToken(rt);case nt:return aA;case it:return oA;case vt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),mA;break;case Ct:if(iA(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case xt:return lA;case at:var i=e,s=this.peekCodePoint(0),a=this.peekCodePoint(1);if(iA(i,s,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(nA(i,s,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===at&&a===ct)return this.consumeCodePoint(),this.consumeCodePoint(),yA;break;case Ut:if(iA(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case We:if(this.peekCodePoint(0)===vt)for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(o===vt&&(o=this.consumeCodePoint())===We)return this.consumeToken();if(o===kt)return this.consumeToken()}break;case Ft:return vA;case Qt:return CA;case lt:if(this.peekCodePoint(0)===ot&&this.peekCodePoint(1)===at&&this.peekCodePoint(2)===at)return this.consumeCodePoint(),this.consumeCodePoint(),bA;break;case ut:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),h=this.peekCodePoint(2);if(nA(l,u,h))return{type:7,value:this.consumeName()};break;case ht:return xA;case Xe:if(rA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case dt:return FA;case ft:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),uA;break;case pt:return pA;case mt:return gA;case Dt:case Kt:var d=this.peekCodePoint(0),f=this.peekCodePoint(1);return d!==Ct||!Wt(f)&&f!==gt||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case wt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),dA;if(this.peekCodePoint(0)===wt)return this.consumeCodePoint(),hA;break;case Bt:if(this.peekCodePoint(0)===Ze)return this.consumeCodePoint(),fA;break;case kt:return UA}return Zt(e)?(this.consumeWhiteSpace(),QA):Gt(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):eA(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Wt(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var A=!1;t===gt&&e.length<6;)e.push(t),t=this.consumeCodePoint(),A=!0;if(A)return{type:30,start:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Tt:e})),16),end:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Vt:e})),16)};var r=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===at&&Wt(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var n=[];Wt(t)&&n.length<6;)n.push(t),t=this.consumeCodePoint();return{type:30,start:r,end:parseInt(c.apply(void 0,n),16)}}return{type:30,start:r,end:r}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===nt?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===nt?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===kt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===rt||t===$e){var A=this.consumeStringToken(this.consumeCodePoint());return 0===A.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===kt||this.peekCodePoint(0)===it)?(this.consumeCodePoint(),{type:22,value:A.value}):(this.consumeBadUrlRemnants(),wA)}for(;;){var r=this.consumeCodePoint();if(r===kt||r===it)return{type:22,value:c.apply(void 0,e)};if(Zt(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===kt||this.peekCodePoint(0)===it?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),wA);if(r===$e||r===rt||r===nt||AA(r))return this.consumeBadUrlRemnants(),wA;if(r===Xe){if(!rA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),wA;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;Zt(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===it||e===kt)return;rA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,A="";e>0;){var r=Math.min(t,e);A+=c.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var t="",A=0;;){var r=this._value[A];if(r===kt||void 0===r||r===e)return{type:0,value:t+=this.consumeStringSlice(A)};if(r===qe)return this._value.splice(0,A),BA;if(r===Xe){var n=this._value[A+1];n!==kt&&void 0!==n&&(n===qe?(t+=this.consumeStringSlice(A),A=-1,this._value.shift()):rA(r,n)&&(t+=this.consumeStringSlice(A),t+=c(this.consumeEscapedCodePoint()),A=-1))}A++}},e.prototype.consumeNumber=function(){var e=[],t=ze,A=this.peekCodePoint(0);for(A!==Ct&&A!==at||e.push(this.consumeCodePoint());Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(A===Ut&&Gt(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ge;Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((A===Rt||A===Ot)&&((r===Ct||r===at)&&Gt(n)||Gt(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ge;Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[sA(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],A=e[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);return nA(r,n,i)?{type:15,number:t,flags:A,unit:this.consumeName()}:r===At?(this.consumeCodePoint(),{type:16,number:t,flags:A}):{type:17,number:t,flags:A}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Wt(e)){for(var t=c(e);Wt(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());Zt(this.peekCodePoint(0))&&this.consumeCodePoint();var A=parseInt(t,16);return 0===A||qt(A)||A>1114111?yt:A}return e===kt?yt:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(tA(t))e+=c(t);else{if(!rA(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),EA=function(){function e(e){this._tokens=e}return e.create=function(t){var A=new SA;return A.write(t),new e(A.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},A=this.consumeToken();;){if(32===A.type||PA(A,e))return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue()),A=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var A=this.consumeToken();if(32===A.type||3===A.type)return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?UA:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),NA=function(e){return 15===e.type},LA=function(e){return 17===e.type},_A=function(e){return 20===e.type},IA=function(e){return 0===e.type},kA=function(e,t){return _A(e)&&e.value===t},TA=function(e){return 31!==e.type},HA=function(e){return 31!==e.type&&4!==e.type},OA=function(e){var t=[],A=[];return e.forEach(function(e){if(4===e.type){if(0===A.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(A),void(A=[])}31!==e.type&&A.push(e)}),A.length&&t.push(A),t},PA=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},DA=function(e){return 17===e.type||15===e.type},MA=function(e){return 16===e.type||DA(e)},jA=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},RA={type:17,number:0,flags:ze},VA={type:16,number:50,flags:ze},KA={type:16,number:100,flags:ze},zA=function(e,t,A){var r=e[0],n=e[1];return[GA(r,t),GA(void 0!==n?n:r,A)]},GA=function(e,t){if(16===e.type)return e.number/100*t;if(NA(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},qA="deg",WA="grad",XA="rad",YA="turn",JA={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case qA:return Math.PI*t.number/180;case WA:return Math.PI/200*t.number;case XA:return t.number;case YA:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},$A=function(e){return 15===e.type&&(e.unit===qA||e.unit===WA||e.unit===XA||e.unit===YA)},ZA=function(e){switch(e.filter(_A).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[RA,RA];case"to top":case"bottom":return er(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[RA,KA];case"to right":case"left":return er(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[KA,KA];case"to bottom":case"top":return er(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[KA,RA];case"to left":case"right":return er(270)}return 0},er=function(e){return Math.PI*e/180},tr={name:"color",parse:function(e,t){if(18===t.type){var A=lr[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return A(e,t.values)}if(5===t.type){if(3===t.value.length){var r=t.value.substring(0,1),n=t.value.substring(1,2),i=t.value.substring(2,3);return nr(parseInt(r+r,16),parseInt(n+n,16),parseInt(i+i,16),1)}if(4===t.value.length){r=t.value.substring(0,1),n=t.value.substring(1,2),i=t.value.substring(2,3);var s=t.value.substring(3,4);return nr(parseInt(r+r,16),parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16)/255)}if(6===t.value.length)return r=t.value.substring(0,2),n=t.value.substring(2,4),i=t.value.substring(4,6),nr(parseInt(r,16),parseInt(n,16),parseInt(i,16),1);if(8===t.value.length)return r=t.value.substring(0,2),n=t.value.substring(2,4),i=t.value.substring(4,6),s=t.value.substring(6,8),nr(parseInt(r,16),parseInt(n,16),parseInt(i,16),parseInt(s,16)/255)}if(20===t.type){var a=ur[t.value.toUpperCase()];if(void 0!==a)return a}return ur.TRANSPARENT}},Ar=function(e){return!(255&e)},rr=function(e){var t=255&e,A=255&e>>8,r=255&e>>16,n=255&e>>24;return t<255?"rgba("+n+","+r+","+A+","+t/255+")":"rgb("+n+","+r+","+A+")"},nr=function(e,t,A,r){return(e<<24|t<<16|A<<8|Math.round(255*r))>>>0},ir=function(e,t){if(17===e.type)return e.number;if(16===e.type){var A=3===t?1:255;return 3===t?e.number/100*A:Math.round(e.number/100*A)}return 0},sr=function(e,t){var A=t.filter(HA);if(3===A.length){var r=A.map(ir),n=r[0],i=r[1],s=r[2];return nr(n,i,s,1)}if(4===A.length){var a=A.map(ir),o=(n=a[0],i=a[1],s=a[2],a[3]);return nr(n,i,s,o)}return 0};function ar(e,t,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(t-e)*A*6+e:A<.5?t:A<2/3?6*(t-e)*(2/3-A)+e:e}var or=function(e,t){var A=t.filter(HA),r=A[0],n=A[1],i=A[2],s=A[3],a=(17===r.type?er(r.number):JA.parse(e,r))/(2*Math.PI),o=MA(n)?n.number/100:0,l=MA(i)?i.number/100:0,c=void 0!==s&&MA(s)?GA(s,1):1;if(0===o)return nr(255*l,255*l,255*l,1);var u=l<=.5?l*(o+1):l+o-l*o,h=2*l-u,d=ar(h,u,a+1/3),f=ar(h,u,a),p=ar(h,u,a-1/3);return nr(255*d,255*f,255*p,c)},lr={hsl:or,hsla:or,rgb:sr,rgba:sr},cr=function(e,t){return tr.parse(e,EA.create(t).parseComponentValue())},ur={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},hr={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(_A(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},dr={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fr=function(e,t){var A=tr.parse(e,t[0]),r=t[1];return r&&MA(r)?{color:A,stop:r}:{color:A,stop:null}},pr=function(e,t){var A=e[0],r=e[e.length-1];null===A.stop&&(A.stop=RA),null===r.stop&&(r.stop=KA);for(var n=[],i=0,s=0;s<e.length;s++){var a=e[s].stop;if(null!==a){var o=GA(a,t);o>i?n.push(o):n.push(i),i=o}else n.push(null)}var l=null;for(s=0;s<n.length;s++){var c=n[s];if(null===c)null===l&&(l=s);else if(null!==l){for(var u=s-l,h=(c-n[l-1])/(u+1),d=1;d<=u;d++)n[l+d-1]=h*d;l=null}}return e.map(function(e,A){return{color:e.color,stop:Math.max(Math.min(1,n[A]/t),0)}})},gr=function(e,t,A){var r=t/2,n=A/2,i=GA(e[0],t)-r,s=n-GA(e[1],A);return(Math.atan2(s,i)+2*Math.PI)%(2*Math.PI)},mr=function(e,t,A){var r="number"==typeof e?e:gr(e,t,A),n=Math.abs(t*Math.sin(r))+Math.abs(A*Math.cos(r)),i=t/2,s=A/2,a=n/2,o=Math.sin(r-Math.PI/2)*a,l=Math.cos(r-Math.PI/2)*a;return[n,i-l,i+l,s-o,s+o]},wr=function(e,t){return Math.sqrt(e*e+t*t)},Br=function(e,t,A,r,n){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var i=t[0],s=t[1],a=wr(A-i,r-s);return(n?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},br=function(e,t,A,r,n){var i=0,s=0;switch(e.size){case 0:0===e.shape?i=s=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(A),Math.abs(A-n)):1===e.shape&&(i=Math.min(Math.abs(t),Math.abs(t-r)),s=Math.min(Math.abs(A),Math.abs(A-n)));break;case 2:if(0===e.shape)i=s=Math.min(wr(t,A),wr(t,A-n),wr(t-r,A),wr(t-r,A-n));else if(1===e.shape){var a=Math.min(Math.abs(A),Math.abs(A-n))/Math.min(Math.abs(t),Math.abs(t-r)),o=Br(r,n,t,A,!0),l=o[0],c=o[1];s=a*(i=wr(l-t,(c-A)/a))}break;case 1:0===e.shape?i=s=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(A),Math.abs(A-n)):1===e.shape&&(i=Math.max(Math.abs(t),Math.abs(t-r)),s=Math.max(Math.abs(A),Math.abs(A-n)));break;case 3:if(0===e.shape)i=s=Math.max(wr(t,A),wr(t,A-n),wr(t-r,A),wr(t-r,A-n));else if(1===e.shape){a=Math.max(Math.abs(A),Math.abs(A-n))/Math.max(Math.abs(t),Math.abs(t-r));var u=Br(r,n,t,A,!1);l=u[0],c=u[1],s=a*(i=wr(l-t,(c-A)/a))}}return Array.isArray(e.size)&&(i=GA(e.size[0],r),s=2===e.size.length?GA(e.size[1],n):i),[i,s]},yr=function(e,t){var A=er(180),r=[];return OA(t).forEach(function(t,n){if(0===n){var i=t[0];if(20===i.type&&"to"===i.value)return void(A=ZA(t));if($A(i))return void(A=JA.parse(e,i))}var s=fr(e,t);r.push(s)}),{angle:A,stops:r,type:1}},vr=function(e,t){var A=er(180),r=[];return OA(t).forEach(function(t,n){if(0===n){var i=t[0];if(20===i.type&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(A=ZA(t));if($A(i))return void(A=(JA.parse(e,i)+er(270))%er(360))}var s=fr(e,t);r.push(s)}),{angle:A,stops:r,type:1}},Cr=function(e,t){var A=er(180),r=[],n=1,i=0,s=3,a=[];return OA(t).forEach(function(t,A){var i=t[0];if(0===A){if(_A(i)&&"linear"===i.value)return void(n=1);if(_A(i)&&"radial"===i.value)return void(n=2)}if(18===i.type)if("from"===i.name){var s=tr.parse(e,i.values[0]);r.push({stop:RA,color:s})}else if("to"===i.name)s=tr.parse(e,i.values[0]),r.push({stop:KA,color:s});else if("color-stop"===i.name){var a=i.values.filter(HA);if(2===a.length){s=tr.parse(e,a[1]);var o=a[0];LA(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:s})}}}),1===n?{angle:(A+er(180))%er(360),stops:r,type:n}:{size:s,shape:i,stops:r,position:a,type:n}},xr="closest-side",Fr="farthest-side",Qr="closest-corner",Ur="farthest-corner",Sr="circle",Er="ellipse",Nr="cover",Lr="contain",_r=function(e,t){var A=0,r=3,n=[],i=[];return OA(t).forEach(function(t,s){var a=!0;if(0===s){var o=!1;a=t.reduce(function(e,t){if(o)if(_A(t))switch(t.value){case"center":return i.push(VA),e;case"top":case"left":return i.push(RA),e;case"right":case"bottom":return i.push(KA),e}else(MA(t)||DA(t))&&i.push(t);else if(_A(t))switch(t.value){case Sr:return A=0,!1;case Er:return A=1,!1;case"at":return o=!0,!1;case xr:return r=0,!1;case Nr:case Fr:return r=1,!1;case Lr:case Qr:return r=2,!1;case Ur:return r=3,!1}else if(DA(t)||MA(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},a)}if(a){var l=fr(e,t);n.push(l)}}),{size:r,shape:A,stops:n,position:i,type:2}},Ir=function(e,t){var A=0,r=3,n=[],i=[];return OA(t).forEach(function(t,s){var a=!0;if(0===s?a=t.reduce(function(e,t){if(_A(t))switch(t.value){case"center":return i.push(VA),!1;case"top":case"left":return i.push(RA),!1;case"right":case"bottom":return i.push(KA),!1}else if(MA(t)||DA(t))return i.push(t),!1;return e},a):1===s&&(a=t.reduce(function(e,t){if(_A(t))switch(t.value){case Sr:return A=0,!1;case Er:return A=1,!1;case Lr:case xr:return r=0,!1;case Fr:return r=1,!1;case Qr:return r=2,!1;case Nr:case Ur:return r=3,!1}else if(DA(t)||MA(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},a)),a){var o=fr(e,t);n.push(o)}}),{size:r,shape:A,stops:n,position:i,type:2}},kr=function(e){return 1===e.type},Tr=function(e){return 2===e.type},Hr={name:"image",parse:function(e,t){if(22===t.type){var A={url:t.value,type:0};return e.cache.addImage(t.value),A}if(18===t.type){var r=Dr[t.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Or(e){return!(20===e.type&&"none"===e.value||18===e.type&&!Dr[e.name])}var Pr,Dr={"linear-gradient":yr,"-moz-linear-gradient":vr,"-ms-linear-gradient":vr,"-o-linear-gradient":vr,"-webkit-linear-gradient":vr,"radial-gradient":_r,"-moz-radial-gradient":Ir,"-ms-radial-gradient":Ir,"-o-radial-gradient":Ir,"-webkit-radial-gradient":Ir,"-webkit-gradient":Cr},Mr={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t.filter(function(e){return HA(e)&&Or(e)}).map(function(t){return Hr.parse(e,t)})}},jr={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(_A(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Rr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return OA(t).map(function(e){return e.filter(MA)}).map(jA)}},Vr={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return OA(t).map(function(e){return e.filter(_A).map(function(e){return e.value}).join(" ")}).map(Kr)}},Kr=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Pr||(Pr={}));var zr,Gr={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return OA(t).map(function(e){return e.filter(qr)})}},qr=function(e){return _A(e)||MA(e)},Wr=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Xr=Wr("top"),Yr=Wr("right"),Jr=Wr("bottom"),$r=Wr("left"),Zr=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return jA(t.filter(MA))}}},en=Zr("top-left"),tn=Zr("top-right"),An=Zr("bottom-right"),rn=Zr("bottom-left"),nn=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sn=nn("top"),an=nn("right"),on=nn("bottom"),ln=nn("left"),cn=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return NA(t)?t.number:0}}},un=cn("top"),hn=cn("right"),dn=cn("bottom"),fn=cn("left"),pn={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},gn={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},mn={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).reduce(function(e,t){return e|wn(t.value)},0)}},wn=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Bn={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bn={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(zr||(zr={}));var yn,vn={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?zr.STRICT:zr.NORMAL}},Cn={name:"line-height",initialValue:"normal",prefix:!1,type:4},xn=function(e,t){return _A(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:MA(e)?GA(e,t):t},Fn={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Hr.parse(e,t)}},Qn={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Un={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Sn=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},En=Sn("top"),Nn=Sn("right"),Ln=Sn("bottom"),_n=Sn("left"),In={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},kn={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Tn=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Hn=Tn("top"),On=Tn("right"),Pn=Tn("bottom"),Dn=Tn("left"),Mn={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jn={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Rn={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&kA(t[0],"none")?[]:OA(t).map(function(t){for(var A={color:ur.TRANSPARENT,offsetX:RA,offsetY:RA,blur:RA},r=0,n=0;n<t.length;n++){var i=t[n];DA(i)?(0===r?A.offsetX=i:1===r?A.offsetY=i:A.blur=i,r++):A.color=tr.parse(e,i)}return A})}},Vn={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Kn={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var A=qn[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return A(t.values)}return null}},zn=function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},Gn=function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),A=t[0],r=t[1];t[2],t[3];var n=t[4],i=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var s=t[12],a=t[13];return t[14],t[15],16===t.length?[A,r,n,i,s,a]:null},qn={matrix:zn,matrix3d:Gn},Wn={type:16,number:50,flags:ze},Xn=[Wn,Wn],Yn={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var A=t.filter(MA);return 2!==A.length?Xn:[A[0],A[1]]}},Jn={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(yn||(yn={}));for(var $n={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return yn.BREAK_ALL;case"keep-all":return yn.KEEP_ALL;default:return yn.NORMAL}}},Zn={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(LA(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},ei={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},ti={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return LA(t)?t.number:1}},Ai={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ri={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(_A).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},ni={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var A=[],r=[];return t.forEach(function(e){switch(e.type){case 20:case 0:A.push(e.value);break;case 17:A.push(e.number.toString());break;case 4:r.push(A.join(" ")),A.length=0}}),A.length&&r.push(A.join(" ")),r.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},ii={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},si={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return LA(t)?t.number:_A(t)&&"bold"===t.value?700:400}},ai={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(_A).map(function(e){return e.value})}},oi={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},li=function(e,t){return 0!==(e&t)},ci={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t}},ui={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;for(var r=[],n=t.filter(TA),i=0;i<n.length;i++){var s=n[i],a=n[i+1];if(20===s.type){var o=a&&LA(a)?a.number:1;r.push({counter:s.value,increment:o})}}return r}},hi={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var A=[],r=t.filter(TA),n=0;n<r.length;n++){var i=r[n],s=r[n+1];if(_A(i)&&"none"!==i.value){var a=s&&LA(s)?s.number:0;A.push({counter:i.value,reset:a})}}return A}},di={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(NA).map(function(t){return ei.parse(e,t)})}},fi={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;var r=[],n=t.filter(IA);if(n.length%2!=0)return null;for(var i=0;i<n.length;i+=2){var s=n[i].value,a=n[i+1].value;r.push({open:s,close:a})}return r}},pi=function(e,t,A){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?A?r.open:r.close:""},gi={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&kA(t[0],"none")?[]:OA(t).map(function(t){for(var A={color:255,offsetX:RA,offsetY:RA,blur:RA,spread:RA,inset:!1},r=0,n=0;n<t.length;n++){var i=t[n];kA(i,"inset")?A.inset=!0:DA(i)?(0===r?A.offsetX=i:1===r?A.offsetY=i:2===r?A.blur=i:A.spread=i,r++):A.color=tr.parse(e,i)}return A})}},mi={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var A=[0,1,2],r=[];return t.filter(_A).forEach(function(e){switch(e.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2)}}),A.forEach(function(e){-1===r.indexOf(e)&&r.push(e)}),r}},wi={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Bi={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return NA(t)?t.number:0}},bi=function(){function e(e,t){var A,r;this.animationDuration=Ci(e,di,t.animationDuration),this.backgroundClip=Ci(e,hr,t.backgroundClip),this.backgroundColor=Ci(e,dr,t.backgroundColor),this.backgroundImage=Ci(e,Mr,t.backgroundImage),this.backgroundOrigin=Ci(e,jr,t.backgroundOrigin),this.backgroundPosition=Ci(e,Rr,t.backgroundPosition),this.backgroundRepeat=Ci(e,Vr,t.backgroundRepeat),this.backgroundSize=Ci(e,Gr,t.backgroundSize),this.borderTopColor=Ci(e,Xr,t.borderTopColor),this.borderRightColor=Ci(e,Yr,t.borderRightColor),this.borderBottomColor=Ci(e,Jr,t.borderBottomColor),this.borderLeftColor=Ci(e,$r,t.borderLeftColor),this.borderTopLeftRadius=Ci(e,en,t.borderTopLeftRadius),this.borderTopRightRadius=Ci(e,tn,t.borderTopRightRadius),this.borderBottomRightRadius=Ci(e,An,t.borderBottomRightRadius),this.borderBottomLeftRadius=Ci(e,rn,t.borderBottomLeftRadius),this.borderTopStyle=Ci(e,sn,t.borderTopStyle),this.borderRightStyle=Ci(e,an,t.borderRightStyle),this.borderBottomStyle=Ci(e,on,t.borderBottomStyle),this.borderLeftStyle=Ci(e,ln,t.borderLeftStyle),this.borderTopWidth=Ci(e,un,t.borderTopWidth),this.borderRightWidth=Ci(e,hn,t.borderRightWidth),this.borderBottomWidth=Ci(e,dn,t.borderBottomWidth),this.borderLeftWidth=Ci(e,fn,t.borderLeftWidth),this.boxShadow=Ci(e,gi,t.boxShadow),this.color=Ci(e,pn,t.color),this.direction=Ci(e,gn,t.direction),this.display=Ci(e,mn,t.display),this.float=Ci(e,Bn,t.cssFloat),this.fontFamily=Ci(e,ni,t.fontFamily),this.fontSize=Ci(e,ii,t.fontSize),this.fontStyle=Ci(e,oi,t.fontStyle),this.fontVariant=Ci(e,ai,t.fontVariant),this.fontWeight=Ci(e,si,t.fontWeight),this.letterSpacing=Ci(e,bn,t.letterSpacing),this.lineBreak=Ci(e,vn,t.lineBreak),this.lineHeight=Ci(e,Cn,t.lineHeight),this.listStyleImage=Ci(e,Fn,t.listStyleImage),this.listStylePosition=Ci(e,Qn,t.listStylePosition),this.listStyleType=Ci(e,Un,t.listStyleType),this.marginTop=Ci(e,En,t.marginTop),this.marginRight=Ci(e,Nn,t.marginRight),this.marginBottom=Ci(e,Ln,t.marginBottom),this.marginLeft=Ci(e,_n,t.marginLeft),this.opacity=Ci(e,ti,t.opacity);var n=Ci(e,In,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=Ci(e,kn,t.overflowWrap),this.paddingTop=Ci(e,Hn,t.paddingTop),this.paddingRight=Ci(e,On,t.paddingRight),this.paddingBottom=Ci(e,Pn,t.paddingBottom),this.paddingLeft=Ci(e,Dn,t.paddingLeft),this.paintOrder=Ci(e,mi,t.paintOrder),this.position=Ci(e,jn,t.position),this.textAlign=Ci(e,Mn,t.textAlign),this.textDecorationColor=Ci(e,Ai,null!==(A=t.textDecorationColor)&&void 0!==A?A:t.color),this.textDecorationLine=Ci(e,ri,null!==(r=t.textDecorationLine)&&void 0!==r?r:t.textDecoration),this.textShadow=Ci(e,Rn,t.textShadow),this.textTransform=Ci(e,Vn,t.textTransform),this.transform=Ci(e,Kn,t.transform),this.transformOrigin=Ci(e,Yn,t.transformOrigin),this.visibility=Ci(e,Jn,t.visibility),this.webkitTextStrokeColor=Ci(e,wi,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Ci(e,Bi,t.webkitTextStrokeWidth),this.wordBreak=Ci(e,$n,t.wordBreak),this.zIndex=Ci(e,Zn,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return Ar(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return li(this.display,4)||li(this.display,33554432)||li(this.display,268435456)||li(this.display,536870912)||li(this.display,67108864)||li(this.display,134217728)},e}(),yi=function(){function e(e,t){this.content=Ci(e,ci,t.content),this.quotes=Ci(e,fi,t.quotes)}return e}(),vi=function(){function e(e,t){this.counterIncrement=Ci(e,ui,t.counterIncrement),this.counterReset=Ci(e,hi,t.counterReset)}return e}(),Ci=function(e,t,A){var r=new SA,n=null!=A?A.toString():t.initialValue;r.write(n);var i=new EA(r.read());switch(t.type){case 2:var s=i.parseComponentValue();return t.parse(e,_A(s)?s.value:t.initialValue);case 0:return t.parse(e,i.parseComponentValue());case 1:return t.parse(e,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(t.format){case"angle":return JA.parse(e,i.parseComponentValue());case"color":return tr.parse(e,i.parseComponentValue());case"image":return Hr.parse(e,i.parseComponentValue());case"length":var a=i.parseComponentValue();return DA(a)?a:RA;case"length-percentage":var o=i.parseComponentValue();return MA(o)?o:RA;case"time":return ei.parse(e,i.parseComponentValue())}}},xi="data-html2canvas-debug",Fi=function(e){switch(e.getAttribute(xi)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Qi=function(e,t){var A=Fi(e);return 1===A||t===A},Ui=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qi(t,3),this.styles=new bi(e,window.getComputedStyle(t,null)),fa(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=a(this.context,t),Qi(t,4)&&(this.flags|=16)}return e}(),Si="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Ei="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ni="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Li=0;Li<Ei.length;Li++)Ni[Ei.charCodeAt(Li)]=Li;for(var _i=function(e){var t,A,r,n,i,s=.75*e.length,a=e.length,o=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<a;t+=4)A=Ni[e.charCodeAt(t)],r=Ni[e.charCodeAt(t+1)],n=Ni[e.charCodeAt(t+2)],i=Ni[e.charCodeAt(t+3)],c[o++]=A<<2|r>>4,c[o++]=(15&r)<<4|n>>2,c[o++]=(3&n)<<6|63&i;return l},Ii=function(e){for(var t=e.length,A=[],r=0;r<t;r+=2)A.push(e[r+1]<<8|e[r]);return A},ki=function(e){for(var t=e.length,A=[],r=0;r<t;r+=4)A.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return A},Ti=5,Hi=11,Oi=2,Pi=65536>>Ti,Di=(1<<Ti)-1,Mi=Pi+(1024>>Ti)+32,ji=65536>>Hi,Ri=(1<<Hi-Ti)-1,Vi=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},Ki=function(e,t,A){return e.slice?e.slice(t,A):new Uint32Array(Array.prototype.slice.call(e,t,A))},zi=function(e,t){var A=_i(e),r=Array.isArray(A)?ki(A):new Uint32Array(A),n=Array.isArray(A)?Ii(A):new Uint16Array(A),i=24,s=Vi(n,i/2,r[4]/2),a=2===r[5]?Vi(n,(i+r[4])/2):Ki(r,Math.ceil((i+r[4])/4));return new Gi(r[0],r[1],r[2],r[3],s,a)},Gi=function(){function e(e,t,A,r,n,i){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=r,this.index=n,this.data=i}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>Ti])<<Oi)+(e&Di),this.data[t];if(e<=65535)return t=((t=this.index[Pi+(e-55296>>Ti)])<<Oi)+(e&Di),this.data[t];if(e<this.highStart)return t=Mi-ji+(e>>Hi),t=this.index[t],t+=e>>Ti&Ri,t=((t=this.index[t])<<Oi)+(e&Di),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xi=0;Xi<qi.length;Xi++)Wi[qi.charCodeAt(Xi)]=Xi;var Yi,Ji=1,$i=2,Zi=3,es=4,ts=5,As=7,rs=8,ns=9,is=10,ss=11,as=12,os=13,ls=14,cs=15,us=function(e){for(var t=[],A=0,r=e.length;A<r;){var n=e.charCodeAt(A++);if(n>=55296&&n<=56319&&A<r){var i=e.charCodeAt(A++);56320==(64512&i)?t.push(((1023&n)<<10)+(1023&i)+65536):(t.push(n),A--)}else t.push(n)}return t},hs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var r=[],n=-1,i="";++n<A;){var s=e[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===A||r.length>16384)&&(i+=String.fromCharCode.apply(String,r),r.length=0)}return i},ds=zi(Si),fs="×",ps="÷",gs=function(e){return ds.get(e)},ms=function(e,t,A){var r=A-2,n=t[r],i=t[A-1],s=t[A];if(i===$i&&s===Zi)return fs;if(i===$i||i===Zi||i===es)return ps;if(s===$i||s===Zi||s===es)return ps;if(i===rs&&-1!==[rs,ns,ss,as].indexOf(s))return fs;if(!(i!==ss&&i!==ns||s!==ns&&s!==is))return fs;if((i===as||i===is)&&s===is)return fs;if(s===os||s===ts)return fs;if(s===As)return fs;if(i===Ji)return fs;if(i===os&&s===ls){for(;n===ts;)n=t[--r];if(n===ls)return fs}if(i===cs&&s===cs){for(var a=0;n===cs;)a++,n=t[--r];if(a%2==0)return fs}return ps},ws=function(e){var t=us(e),A=t.length,r=0,n=0,i=t.map(gs);return{next:function(){if(r>=A)return{done:!0,value:null};for(var e=fs;r<A&&(e=ms(t,i,++r))===fs;);if(e!==fs||r===A){var s=hs.apply(null,t.slice(n,r));return n=r,{value:s,done:!1}}return{done:!0,value:null}}}},Bs=function(e){for(var t,A=ws(e),r=[];!(t=A.next()).done;)t.value&&r.push(t.value.slice());return r},bs=function(e){var t=123;if(e.createRange){var A=e.createRange();if(A.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=t+"px",r.style.display="block",e.body.appendChild(r),A.selectNode(r);var n=A.getBoundingClientRect(),i=Math.round(n.height);if(e.body.removeChild(r),i===t)return!0}}return!1},ys=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var A=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var r=t.firstChild,n=l(r.data).map(function(e){return c(e)}),i=0,s={},a=n.every(function(e,t){A.setStart(r,i),A.setEnd(r,i+e.length);var n=A.getBoundingClientRect();i+=e.length;var a=n.x>s.x||n.y>s.y;return s=n,0===t||a});return e.body.removeChild(t),a},vs=function(){return void 0!==(new Image).crossOrigin},Cs=function(){return"string"==typeof(new XMLHttpRequest).responseType},xs=function(e){var t=new Image,A=e.createElement("canvas"),r=A.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),A.toDataURL()}catch(e){return!1}return!0},Fs=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Qs=function(e){var t=e.createElement("canvas"),A=100;t.width=A,t.height=A;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,A,A);var n=new Image,i=t.toDataURL();n.src=i;var s=Us(A,A,0,0,n);return r.fillStyle="red",r.fillRect(0,0,A,A),Ss(s).then(function(t){r.drawImage(t,0,0);var n=r.getImageData(0,0,A,A).data;r.fillStyle="red",r.fillRect(0,0,A,A);var s=e.createElement("div");return s.style.backgroundImage="url("+i+")",s.style.height=A+"px",Fs(n)?Ss(Us(A,A,0,0,s)):Promise.reject(!1)}).then(function(e){return r.drawImage(e,0,0),Fs(r.getImageData(0,0,A,A).data)}).catch(function(){return!1})},Us=function(e,t,A,r,n){var i="http://www.w3.org/2000/svg",s=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",A.toString()),a.setAttributeNS(null,"y",r.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(a),a.appendChild(n),s},Ss=function(e){return new Promise(function(t,A){var r=new Image;r.onload=function(){return t(r)},r.onerror=A,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},Es={get SUPPORT_RANGE_BOUNDS(){var e=bs(document);return Object.defineProperty(Es,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Es.SUPPORT_RANGE_BOUNDS&&ys(document);return Object.defineProperty(Es,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=xs(document);return Object.defineProperty(Es,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?Qs(document):Promise.resolve(!1);return Object.defineProperty(Es,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=vs();return Object.defineProperty(Es,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=Cs();return Object.defineProperty(Es,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Es,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Es,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Ns=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),Ls=function(e,t,A,r){var n=Hs(t,A),i=[],a=0;return n.forEach(function(t){if(A.textDecorationLine.length||t.trim().length>0)if(Es.SUPPORT_RANGE_BOUNDS){var n=Is(r,a,t.length).getClientRects();if(n.length>1){var o=ks(t),l=0;o.forEach(function(t){i.push(new Ns(t,s.fromDOMRectList(e,Is(r,l+a,t.length).getClientRects()))),l+=t.length})}else i.push(new Ns(t,s.fromDOMRectList(e,n)))}else{var c=r.splitText(t.length);i.push(new Ns(t,_s(e,r))),r=c}else Es.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));a+=t.length}),i},_s=function(e,t){var A=t.ownerDocument;if(A){var r=A.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var n=t.parentNode;if(n){n.replaceChild(r,t);var i=a(e,r);return r.firstChild&&n.replaceChild(r.firstChild,r),i}}return s.EMPTY},Is=function(e,t,A){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(e,t),n.setEnd(e,t+A),n},ks=function(e){if(Es.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return Bs(e)},Ts=function(e,t){if(Es.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return Ps(e,t)},Hs=function(e,t){return 0!==t.letterSpacing?ks(e):Ts(e,t)},Os=[32,160,4961,65792,65793,4153,4241],Ps=function(e,t){for(var A,r=Re(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),n=[],i=function(){if(A.value){var e=A.value.slice(),t=l(e),r="";t.forEach(function(e){-1===Os.indexOf(e)?r+=c(e):(r.length&&n.push(r),n.push(c(e)),r="")}),r.length&&n.push(r)}};!(A=r.next()).done;)i();return n},Ds=function(){function e(e,t,A){this.text=Ms(t.data,A.textTransform),this.textBounds=Ls(e,this.text,A,t)}return e}(),Ms=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(js,Rs);case 2:return e.toUpperCase();default:return e}},js=/(^|\s|:|-|\(|\))([a-z])/g,Rs=function(e,t,A){return e.length>0?t+A.toUpperCase():e},Vs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.src=A.currentSrc||A.src,r.intrinsicWidth=A.naturalWidth,r.intrinsicHeight=A.naturalHeight,r.context.cache.addImage(r.src),r}return t(A,e),A}(Ui),Ks=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.canvas=A,r.intrinsicWidth=A.width,r.intrinsicHeight=A.height,r}return t(A,e),A}(Ui),zs=function(e){function A(t,A){var r=e.call(this,t,A)||this,n=new XMLSerializer,i=a(t,A);return A.setAttribute("width",i.width+"px"),A.setAttribute("height",i.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(A)),r.intrinsicWidth=A.width.baseVal.value,r.intrinsicHeight=A.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t(A,e),A}(Ui),Gs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.value=A.value,r}return t(A,e),A}(Ui),qs=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.start=A.start,r.reversed="boolean"==typeof A.reversed&&!0===A.reversed,r}return t(A,e),A}(Ui),Ws=[{type:15,flags:0,unit:"px",number:3}],Xs=[{type:16,flags:0,number:50}],Ys=function(e){return e.width>e.height?new s(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new s(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},Js=function(e){var t=e.type===ea?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},$s="checkbox",Zs="radio",ea="password",ta=707406591,Aa=function(e){function A(t,A){var r=e.call(this,t,A)||this;switch(r.type=A.type.toLowerCase(),r.checked=A.checked,r.value=Js(A),r.type!==$s&&r.type!==Zs||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=Ys(r.bounds)),r.type){case $s:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Ws;break;case Zs:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=Xs}return r}return t(A,e),A}(Ui),ra=function(e){function A(t,A){var r=e.call(this,t,A)||this,n=A.options[A.selectedIndex||0];return r.value=n&&n.text||"",r}return t(A,e),A}(Ui),na=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.value=A.value,r}return t(A,e),A}(Ui),ia=function(e){function A(t,A){var r=e.call(this,t,A)||this;r.src=A.src,r.width=parseInt(A.width,10)||0,r.height=parseInt(A.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{if(A.contentWindow&&A.contentWindow.document&&A.contentWindow.document.documentElement){r.tree=la(t,A.contentWindow.document.documentElement);var n=A.contentWindow.document.documentElement?cr(t,getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):ur.TRANSPARENT,i=A.contentWindow.document.body?cr(t,getComputedStyle(A.contentWindow.document.body).backgroundColor):ur.TRANSPARENT;r.backgroundColor=Ar(n)?Ar(i)?r.styles.backgroundColor:i:n}}catch(e){}return r}return t(A,e),A}(Ui),sa=["OL","UL","MENU"],aa=function(e,t,A,r){for(var n=t.firstChild,i=void 0;n;n=i)if(i=n.nextSibling,ha(n)&&n.data.trim().length>0)A.textNodes.push(new Ds(e,n,A.styles));else if(da(n))if(Na(n)&&n.assignedNodes)n.assignedNodes().forEach(function(t){return aa(e,t,A,r)});else{var s=oa(e,n);s.styles.isVisible()&&(ca(n,s,r)?s.flags|=4:ua(s.styles)&&(s.flags|=2),-1!==sa.indexOf(n.tagName)&&(s.flags|=8),A.elements.push(s),n.slot,n.shadowRoot?aa(e,n.shadowRoot,s,r):Sa(n)||ba(n)||Ea(n)||aa(e,n,s,r))}},oa=function(e,t){return xa(t)?new Vs(e,t):va(t)?new Ks(e,t):ba(t)?new zs(e,t):ga(t)?new Gs(e,t):ma(t)?new qs(e,t):wa(t)?new Aa(e,t):Ea(t)?new ra(e,t):Sa(t)?new na(e,t):Fa(t)?new ia(e,t):new Ui(e,t)},la=function(e,t){var A=oa(e,t);return A.flags|=4,aa(e,t,A,A),A},ca=function(e,t,A){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ya(e)&&A.styles.isTransparent()},ua=function(e){return e.isPositioned()||e.isFloating()},ha=function(e){return e.nodeType===Node.TEXT_NODE},da=function(e){return e.nodeType===Node.ELEMENT_NODE},fa=function(e){return da(e)&&void 0!==e.style&&!pa(e)},pa=function(e){return"object"==typeof e.className},ga=function(e){return"LI"===e.tagName},ma=function(e){return"OL"===e.tagName},wa=function(e){return"INPUT"===e.tagName},Ba=function(e){return"HTML"===e.tagName},ba=function(e){return"svg"===e.tagName},ya=function(e){return"BODY"===e.tagName},va=function(e){return"CANVAS"===e.tagName},Ca=function(e){return"VIDEO"===e.tagName},xa=function(e){return"IMG"===e.tagName},Fa=function(e){return"IFRAME"===e.tagName},Qa=function(e){return"STYLE"===e.tagName},Ua=function(e){return"SCRIPT"===e.tagName},Sa=function(e){return"TEXTAREA"===e.tagName},Ea=function(e){return"SELECT"===e.tagName},Na=function(e){return"SLOT"===e.tagName},La=function(e){return e.tagName.indexOf("-")>0},_a=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,A=e.counterIncrement,r=e.counterReset,n=!0;null!==A&&A.forEach(function(e){var A=t.counters[e.counter];A&&0!==e.increment&&(n=!1,A.length||A.push(1),A[Math.max(0,A.length-1)]+=e.increment)});var i=[];return n&&r.forEach(function(e){var A=t.counters[e.counter];i.push(e.counter),A||(A=t.counters[e.counter]=[]),A.push(e.reset)}),i},e}(),Ia={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},ka={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Ta={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Ha={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Oa=function(e,t,A,r,n,i){return e<t||e>A?Ya(e,n,i.length>0):r.integers.reduce(function(t,A,n){for(;e>=A;)e-=A,t+=r.values[n];return t},"")+i},Pa=function(e,t,A,r){var n="";do{A||e--,n=r(e)+n,e/=t}while(e*t>=t);return n},Da=function(e,t,A,r,n){var i=A-t+1;return(e<0?"-":"")+(Pa(Math.abs(e),i,r,function(e){return c(Math.floor(e%i)+t)})+n)},Ma=function(e,t,A){void 0===A&&(A=". ");var r=t.length;return Pa(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+A},ja=1,Ra=2,Va=4,Ka=8,za=function(e,t,A,r,n,i){if(e<-9999||e>9999)return Ya(e,4,n.length>0);var s=Math.abs(e),a=n;if(0===s)return t[0]+a;for(var o=0;s>0&&o<=4;o++){var l=s%10;0===l&&li(i,ja)&&""!==a?a=t[l]+a:l>1||1===l&&0===o||1===l&&1===o&&li(i,Ra)||1===l&&1===o&&li(i,Va)&&e>100||1===l&&o>1&&li(i,Ka)?a=t[l]+(o>0?A[o-1]:"")+a:1===l&&o>0&&(a=A[o-1]+a),s=Math.floor(s/10)}return(e<0?r:"")+a},Ga="十百千萬",qa="拾佰仟萬",Wa="マイナス",Xa="마이너스",Ya=function(e,t,A){var r=A?". ":"",n=A?"、":"",i=A?", ":"",s=A?" ":"";switch(t){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var a=Da(e,48,57,!0,r);return a.length<4?"0"+a:a;case 4:return Ma(e,"〇一二三四五六七八九",n);case 6:return Oa(e,1,3999,Ia,3,r).toLowerCase();case 7:return Oa(e,1,3999,Ia,3,r);case 8:return Da(e,945,969,!1,r);case 9:return Da(e,97,122,!1,r);case 10:return Da(e,65,90,!1,r);case 11:return Da(e,1632,1641,!0,r);case 12:case 49:return Oa(e,1,9999,ka,3,r);case 35:return Oa(e,1,9999,ka,3,r).toLowerCase();case 13:return Da(e,2534,2543,!0,r);case 14:case 30:return Da(e,6112,6121,!0,r);case 15:return Ma(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return Ma(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return za(e,"零一二三四五六七八九",Ga,"負",n,Ra|Va|Ka);case 47:return za(e,"零壹貳參肆伍陸柒捌玖",qa,"負",n,ja|Ra|Va|Ka);case 42:return za(e,"零一二三四五六七八九",Ga,"负",n,Ra|Va|Ka);case 41:return za(e,"零壹贰叁肆伍陆柒捌玖",qa,"负",n,ja|Ra|Va|Ka);case 26:return za(e,"〇一二三四五六七八九","十百千万",Wa,n,0);case 25:return za(e,"零壱弐参四伍六七八九","拾百千万",Wa,n,ja|Ra|Va);case 31:return za(e,"영일이삼사오육칠팔구","십백천만",Xa,i,ja|Ra|Va);case 33:return za(e,"零一二三四五六七八九","十百千萬",Xa,i,0);case 32:return za(e,"零壹貳參四五六七八九","拾百千",Xa,i,ja|Ra|Va);case 18:return Da(e,2406,2415,!0,r);case 20:return Oa(e,1,19999,Ha,3,r);case 21:return Da(e,2790,2799,!0,r);case 22:return Da(e,2662,2671,!0,r);case 22:return Oa(e,1,10999,Ta,3,r);case 23:return Ma(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ma(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Da(e,3302,3311,!0,r);case 28:return Ma(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return Ma(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return Da(e,3792,3801,!0,r);case 37:return Da(e,6160,6169,!0,r);case 38:return Da(e,4160,4169,!0,r);case 39:return Da(e,2918,2927,!0,r);case 40:return Da(e,1776,1785,!0,r);case 43:return Da(e,3046,3055,!0,r);case 44:return Da(e,3174,3183,!0,r);case 45:return Da(e,3664,3673,!0,r);case 46:return Da(e,3872,3881,!0,r);default:return Da(e,48,57,!0,r)}},Ja="data-html2canvas-ignore",$a=function(){function e(e,t,A){if(this.context=e,this.options=A,this.scrolledElements=[],this.referenceElement=t,this.counters=new _a,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var A=this,i=eo(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,o=i.contentWindow,l=o.document,c=ro(i).then(function(){return r(A,void 0,void 0,function(){var e,A;return n(this,function(r){switch(r.label){case 0:return this.scrolledElements.forEach(oo),o&&(o.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===t.top&&o.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(A=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Ao(l)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(l,A)}).then(function(){return i})]:[2,i]}})})});return l.open(),l.write(so(document.doctype)+"<html></html>"),ao(this.referenceElement.ownerDocument,s,a),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),c},e.prototype.createElementClone=function(e){if(Qi(e,2),va(e))return this.createCanvasClone(e);if(Ca(e))return this.createVideoClone(e);if(Qa(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return xa(t)&&(xa(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),La(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return io(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var A=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),r=e.cloneNode(!1);return r.textContent=A,r}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var A=e.ownerDocument.createElement("img");try{return A.src=e.toDataURL(),A}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var n=e.getContext("2d"),i=r.getContext("2d");if(i)if(!this.options.allowTaint&&n)i.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var s=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(s){var a=s.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}i.drawImage(e,0,0)}return r}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var A=t.getContext("2d");try{return A&&(A.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||A.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,A){da(t)&&(Ua(t)||t.hasAttribute(Ja)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&da(t)&&Qa(t)||e.appendChild(this.cloneNode(t,A))},e.prototype.cloneChildNodes=function(e,t,A){for(var r=this,n=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;n;n=n.nextSibling)if(da(n)&&Na(n)&&"function"==typeof n.assignedNodes){var i=n.assignedNodes();i.length&&i.forEach(function(e){return r.appendChildNode(t,e,A)})}else this.appendChildNode(t,n,A)},e.prototype.cloneNode=function(e,t){if(ha(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var A=e.ownerDocument.defaultView;if(A&&da(e)&&(fa(e)||pa(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var n=A.getComputedStyle(e),i=A.getComputedStyle(e,":before"),s=A.getComputedStyle(e,":after");this.referenceElement===e&&fa(r)&&(this.clonedReferenceElement=r),ya(r)&&po(r);var a=this.counters.parse(new vi(this.context,n)),o=this.resolvePseudoContent(e,r,i,Yi.BEFORE);La(e)&&(t=!0),Ca(e)||this.cloneChildNodes(e,r,t),o&&r.insertBefore(o,r.firstChild);var l=this.resolvePseudoContent(e,r,s,Yi.AFTER);return l&&r.appendChild(l),this.counters.pop(a),(n&&(this.options.copyStyles||pa(e))&&!Fa(e)||t)&&io(n,r),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(Sa(e)||Ea(e))&&(Sa(r)||Ea(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,A,r){var n=this;if(A){var i=A.content,s=t.ownerDocument;if(s&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==A.display){this.counters.parse(new vi(this.context,A));var a=new yi(this.context,A),o=s.createElement("html2canvaspseudoelement");io(A,o),a.content.forEach(function(t){if(0===t.type)o.appendChild(s.createTextNode(t.value));else if(22===t.type){var A=s.createElement("img");A.src=t.value,A.style.opacity="1",o.appendChild(A)}else if(18===t.type){if("attr"===t.name){var r=t.values.filter(_A);r.length&&o.appendChild(s.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var i=t.values.filter(HA),l=i[0],c=i[1];if(l&&_A(l)){var u=n.counters.getCounterValue(l.value),h=c&&_A(c)?Un.parse(n.context,c.value):3;o.appendChild(s.createTextNode(Ya(u,h,!1)))}}else if("counters"===t.name){var d=t.values.filter(HA),f=(l=d[0],d[1]);if(c=d[2],l&&_A(l)){var p=n.counters.getCounterValues(l.value),g=c&&_A(c)?Un.parse(n.context,c.value):3,m=f&&0===f.type?f.value:"",w=p.map(function(e){return Ya(e,g,!1)}).join(m);o.appendChild(s.createTextNode(w))}}}else if(20===t.type)switch(t.value){case"open-quote":o.appendChild(s.createTextNode(pi(a.quotes,n.quoteDepth++,!0)));break;case"close-quote":o.appendChild(s.createTextNode(pi(a.quotes,--n.quoteDepth,!1)));break;default:o.appendChild(s.createTextNode(t.value))}}),o.className=uo+" "+ho;var l=r===Yi.BEFORE?" "+uo:" "+ho;return pa(t)?t.className.baseValue+=l:t.className+=l,o}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Yi||(Yi={}));var Za,eo=function(e,t){var A=e.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=t.width.toString(),A.height=t.height.toString(),A.scrolling="no",A.setAttribute(Ja,"true"),e.body.appendChild(A),A},to=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},Ao=function(e){return Promise.all([].slice.call(e.images,0).map(to))},ro=function(e){return new Promise(function(t,A){var r=e.contentWindow;if(!r)return A("No window assigned for iframe");var n=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var A=setInterval(function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(A),t(e))},50)}})},no=["all","d","content"],io=function(e,t){for(var A=e.length-1;A>=0;A--){var r=e.item(A);-1===no.indexOf(r)&&t.style.setProperty(r,e.getPropertyValue(r))}return t},so=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},ao=function(e,t,A){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||A!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,A)},oo=function(e){var t=e[0],A=e[1],r=e[2];t.scrollLeft=A,t.scrollTop=r},lo=":before",co=":after",uo="___html2canvas___pseudoelement_before",ho="___html2canvas___pseudoelement_after",fo='{\n content: "" !important;\n display: none !important;\n}',po=function(e){go(e,"."+uo+lo+fo+"\n ."+ho+co+fo)},go=function(e,t){var A=e.ownerDocument;if(A){var r=A.createElement("style");r.textContent=t,e.appendChild(r)}},mo=function(){function e(){}return e.getOrigin=function(t){var A=e._link;return A?(A.href=t,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),wo=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Fo(e)||vo(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s=this;return n(this,function(n){switch(n.label){case 0:return t=mo.isSameOrigin(e),A=!Co(e)&&!0===this._options.useCORS&&Es.SUPPORT_CORS_IMAGES&&!t,r=!Co(e)&&!t&&!Fo(e)&&"string"==typeof this._options.proxy&&Es.SUPPORT_CORS_XHR&&!A,t||!1!==this._options.allowTaint||Co(e)||Fo(e)||r||A?(i=e,r?[4,this.proxy(i)]:[3,2]):[2];case 1:i=n.sent(),n.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(xo(i)||A)&&(r.crossOrigin="anonymous"),r.src=i,!0===r.complete&&setTimeout(function(){return e(r)},500),s._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,n.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(n,i){var s=Es.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===s)n(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return n(e.result)},!1),e.addEventListener("error",function(e){return i(e)},!1),e.readAsDataURL(a.response)}else i("Failed to proxy resource "+r+" with status code "+a.status)},a.onerror=i;var o=A.indexOf("?")>-1?"&":"?";if(a.open("GET",""+A+o+"url="+encodeURIComponent(e)+"&responseType="+s),"text"!==s&&a instanceof XMLHttpRequest&&(a.responseType=s),t._options.imageTimeout){var l=t._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+r)}}a.send()})},e}(),Bo=/^data:image\/svg\+xml/i,bo=/^data:image\/.*;base64,/i,yo=/^data:image\/.*/i,vo=function(e){return Es.SUPPORT_SVG_DRAWING||!Qo(e)},Co=function(e){return yo.test(e)},xo=function(e){return bo.test(e)},Fo=function(e){return"blob"===e.substr(0,4)},Qo=function(e){return"svg"===e.substr(-3).toLowerCase()||Bo.test(e)},Uo=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,A){return new e(this.x+t,this.y+A)},e}(),So=function(e,t,A){return new Uo(e.x+(t.x-e.x)*A,e.y+(t.y-e.y)*A)},Eo=function(){function e(e,t,A,r){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=r}return e.prototype.subdivide=function(t,A){var r=So(this.start,this.startControl,t),n=So(this.startControl,this.endControl,t),i=So(this.endControl,this.end,t),s=So(r,n,t),a=So(n,i,t),o=So(s,a,t);return A?new e(this.start,r,s,o):new e(o,a,i,this.end)},e.prototype.add=function(t,A){return new e(this.start.add(t,A),this.startControl.add(t,A),this.endControl.add(t,A),this.end.add(t,A))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),No=function(e){return 1===e.type},Lo=function(){function e(e){var t=e.styles,A=e.bounds,r=zA(t.borderTopLeftRadius,A.width,A.height),n=r[0],i=r[1],s=zA(t.borderTopRightRadius,A.width,A.height),a=s[0],o=s[1],l=zA(t.borderBottomRightRadius,A.width,A.height),c=l[0],u=l[1],h=zA(t.borderBottomLeftRadius,A.width,A.height),d=h[0],f=h[1],p=[];p.push((n+a)/A.width),p.push((d+c)/A.width),p.push((i+f)/A.height),p.push((o+u)/A.height);var g=Math.max.apply(Math,p);g>1&&(n/=g,i/=g,a/=g,o/=g,c/=g,u/=g,d/=g,f/=g);var m=A.width-a,w=A.height-u,B=A.width-c,b=A.height-f,y=t.borderTopWidth,v=t.borderRightWidth,C=t.borderBottomWidth,x=t.borderLeftWidth,F=GA(t.paddingTop,e.bounds.width),Q=GA(t.paddingRight,e.bounds.width),U=GA(t.paddingBottom,e.bounds.width),S=GA(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||i>0?_o(A.left+x/3,A.top+y/3,n-x/3,i-y/3,Za.TOP_LEFT):new Uo(A.left+x/3,A.top+y/3),this.topRightBorderDoubleOuterBox=n>0||i>0?_o(A.left+m,A.top+y/3,a-v/3,o-y/3,Za.TOP_RIGHT):new Uo(A.left+A.width-v/3,A.top+y/3),this.bottomRightBorderDoubleOuterBox=c>0||u>0?_o(A.left+B,A.top+w,c-v/3,u-C/3,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v/3,A.top+A.height-C/3),this.bottomLeftBorderDoubleOuterBox=d>0||f>0?_o(A.left+x/3,A.top+b,d-x/3,f-C/3,Za.BOTTOM_LEFT):new Uo(A.left+x/3,A.top+A.height-C/3),this.topLeftBorderDoubleInnerBox=n>0||i>0?_o(A.left+2*x/3,A.top+2*y/3,n-2*x/3,i-2*y/3,Za.TOP_LEFT):new Uo(A.left+2*x/3,A.top+2*y/3),this.topRightBorderDoubleInnerBox=n>0||i>0?_o(A.left+m,A.top+2*y/3,a-2*v/3,o-2*y/3,Za.TOP_RIGHT):new Uo(A.left+A.width-2*v/3,A.top+2*y/3),this.bottomRightBorderDoubleInnerBox=c>0||u>0?_o(A.left+B,A.top+w,c-2*v/3,u-2*C/3,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-2*v/3,A.top+A.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=d>0||f>0?_o(A.left+2*x/3,A.top+b,d-2*x/3,f-2*C/3,Za.BOTTOM_LEFT):new Uo(A.left+2*x/3,A.top+A.height-2*C/3),this.topLeftBorderStroke=n>0||i>0?_o(A.left+x/2,A.top+y/2,n-x/2,i-y/2,Za.TOP_LEFT):new Uo(A.left+x/2,A.top+y/2),this.topRightBorderStroke=n>0||i>0?_o(A.left+m,A.top+y/2,a-v/2,o-y/2,Za.TOP_RIGHT):new Uo(A.left+A.width-v/2,A.top+y/2),this.bottomRightBorderStroke=c>0||u>0?_o(A.left+B,A.top+w,c-v/2,u-C/2,Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v/2,A.top+A.height-C/2),this.bottomLeftBorderStroke=d>0||f>0?_o(A.left+x/2,A.top+b,d-x/2,f-C/2,Za.BOTTOM_LEFT):new Uo(A.left+x/2,A.top+A.height-C/2),this.topLeftBorderBox=n>0||i>0?_o(A.left,A.top,n,i,Za.TOP_LEFT):new Uo(A.left,A.top),this.topRightBorderBox=a>0||o>0?_o(A.left+m,A.top,a,o,Za.TOP_RIGHT):new Uo(A.left+A.width,A.top),this.bottomRightBorderBox=c>0||u>0?_o(A.left+B,A.top+w,c,u,Za.BOTTOM_RIGHT):new Uo(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=d>0||f>0?_o(A.left,A.top+b,d,f,Za.BOTTOM_LEFT):new Uo(A.left,A.top+A.height),this.topLeftPaddingBox=n>0||i>0?_o(A.left+x,A.top+y,Math.max(0,n-x),Math.max(0,i-y),Za.TOP_LEFT):new Uo(A.left+x,A.top+y),this.topRightPaddingBox=a>0||o>0?_o(A.left+Math.min(m,A.width-v),A.top+y,m>A.width+v?0:Math.max(0,a-v),Math.max(0,o-y),Za.TOP_RIGHT):new Uo(A.left+A.width-v,A.top+y),this.bottomRightPaddingBox=c>0||u>0?_o(A.left+Math.min(B,A.width-x),A.top+Math.min(w,A.height-C),Math.max(0,c-v),Math.max(0,u-C),Za.BOTTOM_RIGHT):new Uo(A.left+A.width-v,A.top+A.height-C),this.bottomLeftPaddingBox=d>0||f>0?_o(A.left+x,A.top+Math.min(b,A.height-C),Math.max(0,d-x),Math.max(0,f-C),Za.BOTTOM_LEFT):new Uo(A.left+x,A.top+A.height-C),this.topLeftContentBox=n>0||i>0?_o(A.left+x+S,A.top+y+F,Math.max(0,n-(x+S)),Math.max(0,i-(y+F)),Za.TOP_LEFT):new Uo(A.left+x+S,A.top+y+F),this.topRightContentBox=a>0||o>0?_o(A.left+Math.min(m,A.width+x+S),A.top+y+F,m>A.width+x+S?0:a-x+S,o-(y+F),Za.TOP_RIGHT):new Uo(A.left+A.width-(v+Q),A.top+y+F),this.bottomRightContentBox=c>0||u>0?_o(A.left+Math.min(B,A.width-(x+S)),A.top+Math.min(w,A.height+y+F),Math.max(0,c-(v+Q)),u-(C+U),Za.BOTTOM_RIGHT):new Uo(A.left+A.width-(v+Q),A.top+A.height-(C+U)),this.bottomLeftContentBox=d>0||f>0?_o(A.left+x+S,A.top+b,Math.max(0,d-(x+S)),f-(C+U),Za.BOTTOM_LEFT):new Uo(A.left+x+S,A.top+A.height-(C+U))}return e}();!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Za||(Za={}));var _o=function(e,t,A,r,n){var i=(Math.sqrt(2)-1)/3*4,s=A*i,a=r*i,o=e+A,l=t+r;switch(n){case Za.TOP_LEFT:return new Eo(new Uo(e,l),new Uo(e,l-a),new Uo(o-s,t),new Uo(o,t));case Za.TOP_RIGHT:return new Eo(new Uo(e,t),new Uo(e+s,t),new Uo(o,l-a),new Uo(o,l));case Za.BOTTOM_RIGHT:return new Eo(new Uo(o,t),new Uo(o,t+a),new Uo(e+s,l),new Uo(e,l));case Za.BOTTOM_LEFT:default:return new Eo(new Uo(o,l),new Uo(o-s,l),new Uo(e,t+a),new Uo(e,t))}},Io=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},ko=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},To=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Ho=function(){function e(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6}return e}(),Oo=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Po=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Do=function(e){return 0===e.type},Mo=function(e){return 1===e.type},jo=function(e){return 2===e.type},Ro=function(e,t){return e.length===t.length&&e.some(function(e,A){return e===t[A]})},Vo=function(e,t,A,r,n){return e.map(function(e,i){switch(i){case 0:return e.add(t,A);case 1:return e.add(t+r,A);case 2:return e.add(t+r,A+n);case 3:return e.add(t,A+n)}return e})},Ko=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),zo=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Lo(this.container),this.container.styles.opacity<1&&this.effects.push(new Po(this.container.styles.opacity)),null!==this.container.styles.transform){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new Ho(A,r,n))}if(0!==this.container.styles.overflowX){var i=Io(this.curves),s=To(this.curves);Ro(i,s)?this.effects.push(new Oo(i,6)):(this.effects.push(new Oo(i,2)),this.effects.push(new Oo(s,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),A=this.parent,r=this.effects.slice(0);A;){var n=A.effects.filter(function(e){return!Mo(e)});if(t||0!==A.container.styles.position||!A.parent){if(r.unshift.apply(r,n),t=-1===[2,3].indexOf(A.container.styles.position),0!==A.container.styles.overflowX){var i=Io(A.curves),s=To(A.curves);Ro(i,s)||r.unshift(new Oo(s,6))}}else r.unshift.apply(r,n);A=A.parent}return r.filter(function(t){return li(t.target,e)})},e}(),Go=function(e,t,A,r){e.container.elements.forEach(function(n){var i=li(n.flags,4),s=li(n.flags,2),a=new zo(n,e);li(n.styles.display,2048)&&r.push(a);var o=li(n.flags,8)?[]:r;if(i||s){var l=i||n.styles.isPositioned()?A:t,c=new Ko(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var h=0;l.negativeZIndex.some(function(e,t){return u>e.element.container.styles.zIndex.order?(h=t,!1):h>0}),l.negativeZIndex.splice(h,0,c)}else if(u>0){var d=0;l.positiveZIndex.some(function(e,t){return u>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0}),l.positiveZIndex.splice(d,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Go(a,c,i?c:A,o)}else n.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),Go(a,t,A,o);li(n.flags,8)&&qo(n,o)})},qo=function(e,t){for(var A=e instanceof qs?e.start:1,r=e instanceof qs&&e.reversed,n=0;n<t.length;n++){var i=t[n];i.container instanceof Gs&&"number"==typeof i.container.value&&0!==i.container.value&&(A=i.container.value),i.listValue=Ya(A,i.container.styles.listStyleType,!0),A+=r?-1:1}},Wo=function(e){var t=new zo(e,null),A=new Ko(t),r=[];return Go(t,A,A,r),qo(t.container,r),A},Xo=function(e,t){switch(t){case 0:return el(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return el(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return el(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return el(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Yo=function(e,t){switch(t){case 0:return el(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return el(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return el(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return el(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Jo=function(e,t){switch(t){case 0:return el(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return el(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return el(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return el(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},$o=function(e,t){switch(t){case 0:return Zo(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Zo(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Zo(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Zo(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Zo=function(e,t){var A=[];return No(e)?A.push(e.subdivide(.5,!1)):A.push(e),No(t)?A.push(t.subdivide(.5,!0)):A.push(t),A},el=function(e,t,A,r){var n=[];return No(e)?n.push(e.subdivide(.5,!1)):n.push(e),No(A)?n.push(A.subdivide(.5,!0)):n.push(A),No(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),No(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},tl=function(e){var t=e.bounds,A=e.styles;return t.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Al=function(e){var t=e.styles,A=e.bounds,r=GA(t.paddingLeft,A.width),n=GA(t.paddingRight,A.width),i=GA(t.paddingTop,A.width),s=GA(t.paddingBottom,A.width);return A.add(r+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+n),-(t.borderTopWidth+t.borderBottomWidth+i+s))},rl=function(e,t){return 0===e?t.bounds:2===e?Al(t):tl(t)},nl=function(e,t){return 0===e?t.bounds:2===e?Al(t):tl(t)},il=function(e,t,A){var r=rl(ll(e.styles.backgroundOrigin,t),e),n=nl(ll(e.styles.backgroundClip,t),e),i=ol(ll(e.styles.backgroundSize,t),A,r),s=i[0],a=i[1],o=zA(ll(e.styles.backgroundPosition,t),r.width-s,r.height-a);return[cl(ll(e.styles.backgroundRepeat,t),o,i,r,n),Math.round(r.left+o[0]),Math.round(r.top+o[1]),s,a]},sl=function(e){return _A(e)&&e.value===Pr.AUTO},al=function(e){return"number"==typeof e},ol=function(e,t,A){var r=t[0],n=t[1],i=t[2],s=e[0],a=e[1];if(!s)return[0,0];if(MA(s)&&a&&MA(a))return[GA(s,A.width),GA(a,A.height)];var o=al(i);if(_A(s)&&(s.value===Pr.CONTAIN||s.value===Pr.COVER))return al(i)?A.width/A.height<i!=(s.value===Pr.COVER)?[A.width,A.width/i]:[A.height*i,A.height]:[A.width,A.height];var l=al(r),c=al(n),u=l||c;if(sl(s)&&(!a||sl(a)))return l&&c?[r,n]:o||u?u&&o?[l?r:n*i,c?n:r/i]:[l?r:A.width,c?n:A.height]:[A.width,A.height];if(o){var h=0,d=0;return MA(s)?h=GA(s,A.width):MA(a)&&(d=GA(a,A.height)),sl(s)?h=d*i:a&&!sl(a)||(d=h/i),[h,d]}var f=null,p=null;if(MA(s)?f=GA(s,A.width):a&&MA(a)&&(p=GA(a,A.height)),null===f||a&&!sl(a)||(p=l&&c?f/r*n:A.height),null!==p&&sl(s)&&(f=l&&c?p/n*r:A.width),null!==f&&null!==p)return[f,p];throw new Error("Unable to calculate background-size for element")},ll=function(e,t){var A=e[t];return void 0===A?e[0]:A},cl=function(e,t,A,r,n){var i=t[0],s=t[1],a=A[0],o=A[1];switch(e){case 2:return[new Uo(Math.round(r.left),Math.round(r.top+s)),new Uo(Math.round(r.left+r.width),Math.round(r.top+s)),new Uo(Math.round(r.left+r.width),Math.round(o+r.top+s)),new Uo(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new Uo(Math.round(r.left+i),Math.round(r.top)),new Uo(Math.round(r.left+i+a),Math.round(r.top)),new Uo(Math.round(r.left+i+a),Math.round(r.height+r.top)),new Uo(Math.round(r.left+i),Math.round(r.height+r.top))];case 1:return[new Uo(Math.round(r.left+i),Math.round(r.top+s)),new Uo(Math.round(r.left+i+a),Math.round(r.top+s)),new Uo(Math.round(r.left+i+a),Math.round(r.top+s+o)),new Uo(Math.round(r.left+i),Math.round(r.top+s+o))];default:return[new Uo(Math.round(n.left),Math.round(n.top)),new Uo(Math.round(n.left+n.width),Math.round(n.top)),new Uo(Math.round(n.left+n.width),Math.round(n.height+n.top)),new Uo(Math.round(n.left),Math.round(n.height+n.top))]}},ul="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hl="Hidden Text",dl=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),i=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",i.appendChild(A),r.src=ul,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(hl)),A.appendChild(n),A.appendChild(r);var s=r.offsetTop-n.offsetTop+2;A.removeChild(n),A.appendChild(this._document.createTextNode(hl)),A.style.lineHeight="normal",r.style.verticalAlign="super";var a=r.offsetTop-A.offsetTop+2;return i.removeChild(A),{baseline:s,middle:a}},e.prototype.getMetrics=function(e,t){var A=e+" "+t;return void 0===this._data[A]&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},e}(),fl=function(){function e(e,t){this.context=e,this.options=t}return e}(),pl=1e4,gl=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r._activeEffects=[],r.canvas=A.canvas?A.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),A.canvas||(r.canvas.width=Math.floor(A.width*A.scale),r.canvas.height=Math.floor(A.height*A.scale),r.canvas.style.width=A.width+"px",r.canvas.style.height=A.height+"px"),r.fontMetrics=new dl(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-A.x,-A.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),r}return t(A,e),A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},A.prototype.applyEffect=function(e){this.ctx.save(),jo(e)&&(this.ctx.globalAlpha=e.opacity),Do(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Mo(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return li(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,A){var r=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+A):ks(e.text).reduce(function(t,n){return r.ctx.fillText(n,t,e.bounds.top+A),t+r.ctx.measureText(n).width},e.bounds.left)},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),A=yl(e.fontFamily).join(", "),r=NA(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,r,A].join(" "),A,r]},A.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var A,r,i,s,a,o,l,c,u=this;return n(this,function(n){return A=this.createFontStyle(t),r=A[0],i=A[1],s=A[2],this.ctx.font=r,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,s),o=a.baseline,l=a.middle,c=t.paintOrder,e.textBounds.forEach(function(e){c.forEach(function(A){switch(A){case 0:u.ctx.fillStyle=rr(t.color),u.renderTextWithLetterSpacing(e,t.letterSpacing,o);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(A){u.ctx.shadowColor=rr(A.color),u.ctx.shadowOffsetX=A.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=A.offsetY.number*u.options.scale,u.ctx.shadowBlur=A.blur.number,u.renderTextWithLetterSpacing(e,t.letterSpacing,o)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),t.textDecorationLine.length&&(u.ctx.fillStyle=rr(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+o),e.bounds.width,1);break;case 2:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:u.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=rr(t.webkitTextStrokeColor),u.ctx.lineWidth=t.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+o)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,A){if(A&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=Al(e),n=To(t);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(A,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,i,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y;return n(this,function(n){switch(n.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,i=t.styles,a=0,o=t.textNodes,n.label=1;case 1:return a<o.length?(l=o[a],[4,this.renderTextNode(l,i)]):[3,4];case 2:n.sent(),n.label=3;case 3:return a++,[3,1];case 4:if(!(t instanceof Vs))return[3,8];n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return w=n.sent(),this.renderReplacedElement(t,r,w),[3,8];case 7:return n.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Ks&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof zs))return[3,12];n.label=9;case 9:return n.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return w=n.sent(),this.renderReplacedElement(t,r,w),[3,12];case 11:return n.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof ia&&t.tree?[4,new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:c=n.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),n.label=14;case 14:if(t instanceof Aa&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===$s?t.checked&&(this.ctx.save(),this.path([new Uo(t.bounds.left+.39363*u,t.bounds.top+.79*u),new Uo(t.bounds.left+.16*u,t.bounds.top+.5549*u),new Uo(t.bounds.left+.27347*u,t.bounds.top+.44071*u),new Uo(t.bounds.left+.39694*u,t.bounds.top+.5649*u),new Uo(t.bounds.left+.72983*u,t.bounds.top+.23*u),new Uo(t.bounds.left+.84*u,t.bounds.top+.34085*u),new Uo(t.bounds.left+.39363*u,t.bounds.top+.79*u)]),this.ctx.fillStyle=rr(ta),this.ctx.fill(),this.ctx.restore()):t.type===Zs&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=rr(ta),this.ctx.fill(),this.ctx.restore())),ml(t)&&t.value.length){switch(h=this.createFontStyle(i),b=h[0],d=h[1],f=this.fontMetrics.getMetrics(b,d).baseline,this.ctx.font=b,this.ctx.fillStyle=rr(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Bl(t.styles.textAlign),y=Al(t),p=0,t.styles.textAlign){case 1:p+=y.width/2;break;case 2:p+=y.width}g=y.add(p,0,0,-y.height/2+1),this.ctx.save(),this.path([new Uo(y.left,y.top),new Uo(y.left+y.width,y.top),new Uo(y.left+y.width,y.top+y.height),new Uo(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ns(t.value,g),i.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!li(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];w=void 0,B=m.url,n.label=15;case 15:return n.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return w=n.sent(),this.ctx.drawImage(w,t.bounds.left-(w.width+10),t.bounds.top),[3,18];case 17:return n.sent(),this.context.logger.error("Error loading list-style-image "+B),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(b=this.createFontStyle(i)[0],this.ctx.font=b,this.ctx.fillStyle=rr(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new s(t.bounds.left,t.bounds.top+GA(t.styles.paddingTop,t.bounds.width),t.bounds.width,xn(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ns(e.listValue,y),i.letterSpacing,xn(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),n.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a,o,l,c,u,h,d,f,p,g;return n(this,function(n){switch(n.label){case 0:return li(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:n.sent(),t=0,A=e.negativeZIndex,n.label=2;case 2:return t<A.length?(g=A[t],[4,this.renderStack(g)]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:n.sent(),r=0,i=e.nonInlineLevel,n.label=7;case 7:return r<i.length?(g=i[r],[4,this.renderNode(g)]):[3,10];case 8:n.sent(),n.label=9;case 9:return r++,[3,7];case 10:s=0,a=e.nonPositionedFloats,n.label=11;case 11:return s<a.length?(g=a[s],[4,this.renderStack(g)]):[3,14];case 12:n.sent(),n.label=13;case 13:return s++,[3,11];case 14:o=0,l=e.nonPositionedInlineLevel,n.label=15;case 15:return o<l.length?(g=l[o],[4,this.renderStack(g)]):[3,18];case 16:n.sent(),n.label=17;case 17:return o++,[3,15];case 18:c=0,u=e.inlineLevel,n.label=19;case 19:return c<u.length?(g=u[c],[4,this.renderNode(g)]):[3,22];case 20:n.sent(),n.label=21;case 21:return c++,[3,19];case 22:h=0,d=e.zeroOrAutoZIndexOrTransformedOrOpacity,n.label=23;case 23:return h<d.length?(g=d[h],[4,this.renderStack(g)]):[3,26];case 24:n.sent(),n.label=25;case 25:return h++,[3,23];case 26:f=0,p=e.positiveZIndex,n.label=27;case 27:return f<p.length?(g=p[f],[4,this.renderStack(g)]):[3,30];case 28:n.sent(),n.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(e,A){var r=No(e)?e.start:e;0===A?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),No(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},A.prototype.renderRepeat=function(e,t,A,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(A,r),this.ctx.fill(),this.ctx.translate(-A,-r)},A.prototype.resizeImage=function(e,t,A){var r;if(e.width===t&&e.height===A)return e;var n=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return n.width=Math.max(1,t),n.height=Math.max(1,A),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,A),n},A.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a;return n(this,function(o){switch(o.label){case 0:t=e.styles.backgroundImage.length-1,A=function(A){var i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T;return n(this,function(n){switch(n.label){case 0:if(0!==A.type)return[3,5];i=void 0,s=A.url,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.context.cache.match(s)];case 2:return i=n.sent(),[3,4];case 3:return n.sent(),r.context.logger.error("Error loading background-image "+s),[3,4];case 4:return i&&(a=il(e,t,[i.width,i.height,i.width/i.height]),b=a[0],Q=a[1],U=a[2],C=a[3],x=a[4],w=r.ctx.createPattern(r.resizeImage(i,C,x),"repeat"),r.renderRepeat(b,w,Q,U)),[3,6];case 5:kr(A)?(o=il(e,t,[null,null,null]),b=o[0],Q=o[1],U=o[2],C=o[3],x=o[4],l=mr(A.angle,C,x),c=l[0],u=l[1],h=l[2],d=l[3],f=l[4],(p=document.createElement("canvas")).width=C,p.height=x,g=p.getContext("2d"),m=g.createLinearGradient(u,d,h,f),pr(A.stops,c).forEach(function(e){return m.addColorStop(e.stop,rr(e.color))}),g.fillStyle=m,g.fillRect(0,0,C,x),C>0&&x>0&&(w=r.ctx.createPattern(p,"repeat"),r.renderRepeat(b,w,Q,U))):Tr(A)&&(B=il(e,t,[null,null,null]),b=B[0],y=B[1],v=B[2],C=B[3],x=B[4],F=0===A.position.length?[VA]:A.position,Q=GA(F[0],C),U=GA(F[F.length-1],x),S=br(A,Q,U,C,x),E=S[0],N=S[1],E>0&&N>0&&(L=r.ctx.createRadialGradient(y+Q,v+U,0,y+Q,v+U,E),pr(A.stops,2*E).forEach(function(e){return L.addColorStop(e.stop,rr(e.color))}),r.path(b),r.ctx.fillStyle=L,E!==N?(_=e.bounds.left+.5*e.bounds.width,I=e.bounds.top+.5*e.bounds.height,T=1/(k=N/E),r.ctx.save(),r.ctx.translate(_,I),r.ctx.transform(1,0,0,k,0,0),r.ctx.translate(-_,-I),r.ctx.fillRect(y,T*(v-I)+I,C,x*T),r.ctx.restore()):r.ctx.fill())),n.label=6;case 6:return t--,[2]}})},r=this,i=0,s=e.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return i<s.length?(a=s[i],[5,A(a)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,A){return r(this,void 0,void 0,function(){return n(this,function(r){return this.path(Xo(A,t)),this.ctx.fillStyle=rr(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,A,i){return r(this,void 0,void 0,function(){var r,s;return n(this,function(n){switch(n.label){case 0:return t<3?[4,this.renderSolidBorder(e,A,i)]:[3,2];case 1:return n.sent(),[2];case 2:return r=Yo(i,A),this.path(r),this.ctx.fillStyle=rr(e),this.ctx.fill(),s=Jo(i,A),this.path(s),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,A,r,i,s,a,o,l,c=this;return n(this,function(n){switch(n.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,A=!Ar(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=wl(ll(t.backgroundClip,0),e.curves),A||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ar(t.backgroundColor)||(this.ctx.fillStyle=rr(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:n.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){c.ctx.save();var A=Io(e.curves),r=t.inset?0:pl,n=Vo(A,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(c.path(A),c.ctx.clip(),c.mask(n)):(c.mask(A),c.ctx.clip(),c.path(n)),c.ctx.shadowOffsetX=t.offsetX.number+r,c.ctx.shadowOffsetY=t.offsetY.number,c.ctx.shadowColor=rr(t.color),c.ctx.shadowBlur=t.blur.number,c.ctx.fillStyle=t.inset?rr(t.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()}),n.label=2;case 2:s=0,a=0,o=r,n.label=3;case 3:return a<o.length?0!==(l=o[a]).style&&!Ar(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,s,e.curves,2)]:[3,11]:[3,13];case 4:return n.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,s,e.curves,3)];case 6:return n.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,s,e.curves)];case 8:return n.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,s,e.curves)];case 10:n.sent(),n.label=11;case 11:s++,n.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,A,i,s){return r(this,void 0,void 0,function(){var r,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y;return n(this,function(n){return this.ctx.save(),r=$o(i,A),a=Xo(i,A),2===s&&(this.path(a),this.ctx.clip()),No(a[0])?(o=a[0].start.x,l=a[0].start.y):(o=a[0].x,l=a[0].y),No(a[1])?(c=a[1].end.x,u=a[1].end.y):(c=a[1].x,u=a[1].y),h=0===A||2===A?Math.abs(o-c):Math.abs(l-u),this.ctx.beginPath(),3===s?this.formatPath(r):this.formatPath(a.slice(0,2)),d=t<3?3*t:2*t,f=t<3?2*t:t,3===s&&(d=t,f=t),p=!0,h<=2*d?p=!1:h<=2*d+f?(d*=g=h/(2*d+f),f*=g):(m=Math.floor((h+f)/(d+f)),w=(h-m*d)/(m-1),f=(B=(h-(m+1)*d)/m)<=0||Math.abs(f-w)<Math.abs(f-B)?w:B),p&&(3===s?this.ctx.setLineDash([0,d+f]):this.ctx.setLineDash([d,f])),3===s?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=rr(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===s&&(No(a[0])&&(b=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Uo(b.end.x,b.end.y),new Uo(y.start.x,y.start.y)]),this.ctx.stroke()),No(a[1])&&(b=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Uo(b.end.x,b.end.y),new Uo(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return n(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=rr(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Wo(e),[4,this.renderStack(t)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(fl),ml=function(e){return e instanceof na||e instanceof ra||e instanceof Aa&&e.type!==Zs&&e.type!==$s},wl=function(e,t){switch(e){case 0:return Io(t);case 2:return ko(t);default:return To(t)}},Bl=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},bl=["-apple-system","system-ui"],yl=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===bl.indexOf(e)}):e},vl=function(e){function A(t,A){var r=e.call(this,t,A)||this;return r.canvas=A.canvas?A.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=A,r.canvas.width=Math.floor(A.width*A.scale),r.canvas.height=Math.floor(A.height*A.scale),r.canvas.style.width=A.width+"px",r.canvas.style.height=A.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-A.x,-A.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),r}return t(A,e),A.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,A;return n(this,function(r){switch(r.label){case 0:return t=Us(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Cl(t)];case 1:return A=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=rr(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(A,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(fl),Cl=function(e){return new Promise(function(t,A){var r=new Image;r.onload=function(){t(r)},r.onerror=A,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},xl=function(){function e(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,i([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,i([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),Fl=function(){function e(t,A){var r;this.windowBounds=A,this.instanceName="#"+e.instanceCount++,this.logger=new xl({id:this.instanceName,enabled:t.logging}),this.cache=null!==(r=t.cache)&&void 0!==r?r:new wo(this,t)}return e.instanceCount=1,e}(),Ql=function(e,t){return void 0===t&&(t={}),Ul(e,t)};"undefined"!=typeof window&&mo.setContext(window);var Ul=function(e,t){return r(void 0,void 0,void 0,function(){var r,i,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T,H,O,P,D,M,j,R,V,K;return n(this,function(n){switch(n.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(r=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=r.defaultView))throw new Error("Document is not attached to a Window");return l={allowTaint:null!==(S=t.allowTaint)&&void 0!==S&&S,imageTimeout:null!==(E=t.imageTimeout)&&void 0!==E?E:15e3,proxy:t.proxy,useCORS:null!==(N=t.useCORS)&&void 0!==N&&N},c=A({logging:null===(L=t.logging)||void 0===L||L,cache:t.cache},l),u={windowWidth:null!==(_=t.windowWidth)&&void 0!==_?_:i.innerWidth,windowHeight:null!==(I=t.windowHeight)&&void 0!==I?I:i.innerHeight,scrollX:null!==(k=t.scrollX)&&void 0!==k?k:i.pageXOffset,scrollY:null!==(T=t.scrollY)&&void 0!==T?T:i.pageYOffset},h=new s(u.scrollX,u.scrollY,u.windowWidth,u.windowHeight),d=new Fl(c,h),f=null!==(H=t.foreignObjectRendering)&&void 0!==H&&H,p={allowTaint:null!==(O=t.allowTaint)&&void 0!==O&&O,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:f,copyStyles:f},d.logger.debug("Starting document clone with size "+h.width+"x"+h.height+" scrolled to "+-h.left+","+-h.top),g=new $a(d,e,p),(m=g.clonedReferenceElement)?[4,g.toIFrame(r,h)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return w=n.sent(),B=ya(m)||Ba(m)?o(m.ownerDocument):a(d,m),b=B.width,y=B.height,v=B.left,C=B.top,x=Sl(d,m,t.backgroundColor),F={canvas:t.canvas,backgroundColor:x,scale:null!==(D=null!==(P=t.scale)&&void 0!==P?P:i.devicePixelRatio)&&void 0!==D?D:1,x:(null!==(M=t.x)&&void 0!==M?M:0)+v,y:(null!==(j=t.y)&&void 0!==j?j:0)+C,width:null!==(R=t.width)&&void 0!==R?R:Math.ceil(b),height:null!==(V=t.height)&&void 0!==V?V:Math.ceil(y)},f?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new vl(d,F).render(m)]):[3,3];case 2:return Q=n.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+v+","+C+" with size "+b+"x"+y+" using computed rendering"),d.logger.debug("Starting DOM parsing"),U=la(d,m),x===U.styles.backgroundColor&&(U.styles.backgroundColor=ur.TRANSPARENT),d.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),[4,new gl(d,F).render(U)];case 4:Q=n.sent(),n.label=5;case 5:return(null===(K=t.removeContainer)||void 0===K||K)&&($a.destroy(w)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,Q]}})})},Sl=function(e,t,A){var r=t.ownerDocument,n=r.documentElement?cr(e,getComputedStyle(r.documentElement).backgroundColor):ur.TRANSPARENT,i=r.body?cr(e,getComputedStyle(r.body).backgroundColor):ur.TRANSPARENT,s="string"==typeof A?cr(e,A):null===A?ur.TRANSPARENT:4294967295;return t===r.documentElement?Ar(n)?Ar(i)?s:i:n:s};return Ql}();var he=ue.exports,de=l(he),fe=a({__proto__:null,default:de},[he]);function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}var ge=Uint8Array,me=Uint16Array,we=Int32Array,Be=new ge([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]),be=new ge([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]),ye=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ve=function(e,t){for(var A=new me(31),r=0;r<31;++r)A[r]=t+=1<<e[r-1];var n=new we(A[30]);for(r=1;r<30;++r)for(var i=A[r];i<A[r+1];++i)n[i]=i-A[r]<<5|r;return{b:A,r:n}},Ce=ve(Be,2),xe=Ce.b,Fe=Ce.r;xe[28]=258,Fe[258]=28;for(var Qe=ve(be,0).r,Ue=new me(32768),Se=0;Se<32768;++Se){var Ee=(43690&Se)>>1|(21845&Se)<<1;Ee=(61680&(Ee=(52428&Ee)>>2|(13107&Ee)<<2))>>4|(3855&Ee)<<4,Ue[Se]=((65280&Ee)>>8|(255&Ee)<<8)>>1}var Ne=function(e,t,A){for(var r=e.length,n=0,i=new me(t);n<r;++n)e[n]&&++i[e[n]-1];var s,a=new me(t);for(n=1;n<t;++n)a[n]=a[n-1]+i[n-1]<<1;if(A){s=new me(1<<t);var o=15-t;for(n=0;n<r;++n)if(e[n])for(var l=n<<4|e[n],c=t-e[n],u=a[e[n]-1]++<<c,h=u|(1<<c)-1;u<=h;++u)s[Ue[u]>>o]=l}else for(s=new me(r),n=0;n<r;++n)e[n]&&(s[n]=Ue[a[e[n]-1]++]>>15-e[n]);return s},Le=new ge(288);for(Se=0;Se<144;++Se)Le[Se]=8;for(Se=144;Se<256;++Se)Le[Se]=9;for(Se=256;Se<280;++Se)Le[Se]=7;for(Se=280;Se<288;++Se)Le[Se]=8;var _e=new ge(32);for(Se=0;Se<32;++Se)_e[Se]=5;var Ie=Ne(Le,9,0),ke=Ne(_e,5,0),Te=function(e){return(e+7)/8|0},He=function(e,t,A){A<<=7&t;var r=t/8|0;e[r]|=A,e[r+1]|=A>>8},Oe=function(e,t,A){A<<=7&t;var r=t/8|0;e[r]|=A,e[r+1]|=A>>8,e[r+2]|=A>>16},Pe=function(e,t){for(var A=[],r=0;r<e.length;++r)e[r]&&A.push({s:r,f:e[r]});var n=A.length,i=A.slice();if(!n)return{t:ze,l:0};if(1==n){var s=new ge(A[0].s+1);return s[A[0].s]=1,{t:s,l:1}}A.sort(function(e,t){return e.f-t.f}),A.push({s:-1,f:25001});var a=A[0],o=A[1],l=0,c=1,u=2;for(A[0]={s:-1,f:a.f+o.f,l:a,r:o};c!=n-1;)a=A[A[l].f<A[u].f?l++:u++],o=A[l!=c&&A[l].f<A[u].f?l++:u++],A[c++]={s:-1,f:a.f+o.f,l:a,r:o};var h=i[0].s;for(r=1;r<n;++r)i[r].s>h&&(h=i[r].s);var d=new me(h+1),f=De(A[c-1],d,0);if(f>t){r=0;var p=0,g=f-t,m=1<<g;for(i.sort(function(e,t){return d[t.s]-d[e.s]||e.f-t.f});r<n;++r){var w=i[r].s;if(!(d[w]>t))break;p+=m-(1<<f-d[w]),d[w]=t}for(p>>=g;p>0;){var B=i[r].s;d[B]<t?p-=1<<t-d[B]++-1:++r}for(;r>=0&&p;--r){var b=i[r].s;d[b]==t&&(--d[b],++p)}f=t}return{t:new ge(d),l:f}},De=function(e,t,A){return-1==e.s?Math.max(De(e.l,t,A+1),De(e.r,t,A+1)):t[e.s]=A},Me=function(e){for(var t=e.length;t&&!e[--t];);for(var A=new me(++t),r=0,n=e[0],i=1,s=function(e){A[r++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=e[a]}return{c:A.subarray(0,r),n:t}},je=function(e,t){for(var A=0,r=0;r<t.length;++r)A+=e[r]*t[r];return A},Re=function(e,t,A){var r=A.length,n=Te(t+2);e[n]=255&r,e[n+1]=r>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i<r;++i)e[n+i+4]=A[i];return 8*(n+4+r)},Ve=function(e,t,A,r,n,i,s,a,o,l,c){He(t,c++,A),++n[256];for(var u=Pe(n,15),h=u.t,d=u.l,f=Pe(i,15),p=f.t,g=f.l,m=Me(h),w=m.c,B=m.n,b=Me(p),y=b.c,v=b.n,C=new me(19),x=0;x<w.length;++x)++C[31&w[x]];for(x=0;x<y.length;++x)++C[31&y[x]];for(var F=Pe(C,7),Q=F.t,U=F.l,S=19;S>4&&!Q[ye[S-1]];--S);var E,N,L,_,I=l+5<<3,k=je(n,Le)+je(i,_e)+s,T=je(n,h)+je(i,p)+s+14+3*S+je(C,Q)+2*C[16]+3*C[17]+7*C[18];if(o>=0&&I<=k&&I<=T)return Re(t,c,e.subarray(o,o+l));if(He(t,c,1+(T<k)),c+=2,T<k){E=Ne(h,d,0),N=h,L=Ne(p,g,0),_=p;var H=Ne(Q,U,0);He(t,c,B-257),He(t,c+5,v-1),He(t,c+10,S-4),c+=14;for(x=0;x<S;++x)He(t,c+3*x,Q[ye[x]]);c+=3*S;for(var O=[w,y],P=0;P<2;++P){var D=O[P];for(x=0;x<D.length;++x){var M=31&D[x];He(t,c,H[M]),c+=Q[M],M>15&&(He(t,c,D[x]>>5&127),c+=D[x]>>12)}}}else E=Ie,N=Le,L=ke,_=_e;for(x=0;x<a;++x){var j=r[x];if(j>255){Oe(t,c,E[(M=j>>18&31)+257]),c+=N[M+257],M>7&&(He(t,c,j>>23&31),c+=Be[M]);var R=31&j;Oe(t,c,L[R]),c+=_[R],R>3&&(Oe(t,c,j>>5&8191),c+=be[R])}else Oe(t,c,E[j]),c+=N[j]}return Oe(t,c,E[256]),c+N[256]},Ke=new we([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ze=new ge(0),Ge=function(e,t,A,r,n,i){var s=i.z||e.length,a=new ge(r+s+5*(1+Math.ceil(s/7e3))+n),o=a.subarray(r,a.length-n),l=i.l,c=7&(i.r||0);if(t){c&&(o[0]=i.r>>3);for(var u=Ke[t-1],h=u>>13,d=8191&u,f=(1<<A)-1,p=i.p||new me(32768),g=i.h||new me(f+1),m=Math.ceil(A/3),w=2*m,B=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<w)&f},b=new we(25e3),y=new me(288),v=new me(32),C=0,x=0,F=i.i||0,Q=0,U=i.w||0,S=0;F+2<s;++F){var E=B(F),N=32767&F,L=g[E];if(p[N]=L,g[E]=N,U<=F){var _=s-F;if((C>7e3||Q>24576)&&(_>423||!l)){c=Ve(e,o,0,b,y,v,x,Q,S,F-S,c),Q=C=x=0,S=F;for(var I=0;I<286;++I)y[I]=0;for(I=0;I<30;++I)v[I]=0}var k=2,T=0,H=d,O=N-L&32767;if(_>2&&E==B(F-O))for(var P=Math.min(h,_)-1,D=Math.min(32767,F),M=Math.min(258,_);O<=D&&--H&&N!=L;){if(e[F+k]==e[F+k-O]){for(var j=0;j<M&&e[F+j]==e[F+j-O];++j);if(j>k){if(k=j,T=O,j>P)break;var R=Math.min(O,j-2),V=0;for(I=0;I<R;++I){var K=F-O+I&32767,z=K-p[K]&32767;z>V&&(V=z,L=K)}}}O+=(N=L)-(L=p[N])&32767}if(T){b[Q++]=268435456|Fe[k]<<18|Qe[T];var G=31&Fe[k],q=31&Qe[T];x+=Be[G]+be[q],++y[257+G],++v[q],U=F+k,++C}else b[Q++]=e[F],++y[e[F]]}}for(F=Math.max(F,U);F<s;++F)b[Q++]=e[F],++y[e[F]];c=Ve(e,o,l,b,y,v,x,Q,S,F-S,c),l||(i.r=7&c|o[c/8|0]<<3,c-=7,i.h=g,i.p=p,i.i=F,i.w=U)}else{for(F=i.w||0;F<s+l;F+=65535){var W=F+65535;W>=s&&(o[c/8|0]=l,W=s),c=Re(o,c+1,e.subarray(F,W))}i.i=s}return function(e,t,A){return(null==t||t<0)&&(t=0),(null==A||A>e.length)&&(A=e.length),new ge(e.subarray(t,A))}(a,0,r+Te(c)+n)},qe=function(){var e=1,t=0;return{p:function(A){for(var r=e,n=t,i=0|A.length,s=0;s!=i;){for(var a=Math.min(s+2655,i);s<a;++s)n+=r+=A[s];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}e=r,t=n},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},We=function(e,t,A){for(;A;++t)e[t]=A,A>>>=8};function Xe(e,t){t||(t={});var A=qe();A.p(e);var r=function(e,t,A,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new ge(i.length+e.length);s.set(i),s.set(e,i.length),e=s,n.w=i.length}return Ge(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,A,r,n)}(e,t,t.dictionary?6:2,4);return function(e,t){var A=t.level,r=0==A?0:A<6?1:9==A?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var n=qe();n.p(t.dictionary),We(e,2,n.d())}}(r,t),We(r,r.length-4,A.d()),r}var Ye="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ye.decode(ze,{stream:!0})}catch(e){}function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,r=Array(t);A<t;A++)r[A]=e[A];return r}function $e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var r,n,i,s,a=[],o=!0,l=!1;try{if(i=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;o=!1}else for(;!(o=(r=i.call(A)).done)&&(a.push(r.value),a.length!==t);o=!0);}catch(e){l=!0,n=e}finally{try{if(!o&&null!=A.return&&(s=A.return(),Object(s)!==s))return}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Je(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Je(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(e,t="utf8"){return new TextDecoder(t).decode(e)}const et=new TextEncoder;const tt=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),At={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 rt{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=8192,t={}){let A=!1;"number"==typeof e?e=new ArrayBuffer(e):(A=!0,this.lastWrittenByte=e.byteLength);const r=t.offset?t.offset>>>0:0,n=e.byteLength-r;let i=r;(ArrayBuffer.isView(e)||e instanceof rt)&&(e.byteLength!==e.buffer.byteLength&&(i=e.byteOffset+r),e=e.buffer),this.lastWrittenByte=A?n:0,this.buffer=e,this.length=n,this.byteLength=n,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,n),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const t=2*(this.offset+e),A=new Uint8Array(t);A.set(new Uint8Array(this.buffer)),this.buffer=A.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const A=At[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,n=this.buffer.slice(r,r+A);if(this.littleEndian===tt&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(r,r+A));e.reverse();const n=new At[t](e.buffer);return this.offset+=A,n.reverse(),n}const i=new At[t](n);return this.offset+=A,i}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 A=0;A<e;A++)t+=this.readChar();return t}readUtf8(e=1){return Ze(this.readBytes(e))}decodeText(e=1,t="utf8"){return Ze(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(function(e){return et.encode(e)}(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}
|
|
31
|
+
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function nt(e){let t=e.length;for(;--t>=0;)e[t]=0}const it=256,st=286,at=30,ot=15,lt=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]),ct=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]),ut=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ht=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dt=new Array(576);nt(dt);const ft=new Array(60);nt(ft);const pt=new Array(512);nt(pt);const gt=new Array(256);nt(gt);const mt=new Array(29);nt(mt);const wt=new Array(at);function Bt(e,t,A,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=A,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let bt,yt,vt;function Ct(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}nt(wt);const xt=e=>e<256?pt[e]:pt[256+(e>>>7)],Ft=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Qt=(e,t,A)=>{e.bi_valid>16-A?(e.bi_buf|=t<<e.bi_valid&65535,Ft(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=A-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=A)},Ut=(e,t,A)=>{Qt(e,A[2*t],A[2*t+1])},St=(e,t)=>{let A=0;do{A|=1&e,e>>>=1,A<<=1}while(--t>0);return A>>>1},Et=(e,t,A)=>{const r=new Array(16);let n,i,s=0;for(n=1;n<=ot;n++)s=s+A[n-1]<<1,r[n]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=St(r[t]++,t))}},Nt=e=>{let t;for(t=0;t<st;t++)e.dyn_ltree[2*t]=0;for(t=0;t<at;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Lt=e=>{e.bi_valid>8?Ft(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},_t=(e,t,A,r)=>{const n=2*t,i=2*A;return e[n]<e[i]||e[n]===e[i]&&r[t]<=r[A]},It=(e,t,A)=>{const r=e.heap[A];let n=A<<1;for(;n<=e.heap_len&&(n<e.heap_len&&_t(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!_t(t,r,e.heap[n],e.depth));)e.heap[A]=e.heap[n],A=n,n<<=1;e.heap[A]=r},kt=(e,t,A)=>{let r,n,i,s,a=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,n=e.pending_buf[e.sym_buf+a++],0===r?Ut(e,n,t):(i=gt[n],Ut(e,i+it+1,t),s=lt[i],0!==s&&(n-=mt[i],Qt(e,n,s)),r--,i=xt(r),Ut(e,i,A),s=ct[i],0!==s&&(r-=wt[i],Qt(e,r,s)))}while(a<e.sym_next);Ut(e,256,t)},Tt=(e,t)=>{const A=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,a,o,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==A[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):A[2*s+1]=0;for(;e.heap_len<2;)o=e.heap[++e.heap_len]=l<2?++l:0,A[2*o]=1,e.depth[o]=0,e.opt_len--,n&&(e.static_len-=r[2*o+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)It(e,A,s);o=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],It(e,A,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,A[2*o]=A[2*s]+A[2*a],e.depth[o]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,A[2*s+1]=A[2*a+1]=o,e.heap[1]=o++,It(e,A,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const A=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,o=t.stat_desc.max_length;let l,c,u,h,d,f,p=0;for(h=0;h<=ot;h++)e.bl_count[h]=0;for(A[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],h=A[2*A[2*c+1]+1]+1,h>o&&(h=o,p++),A[2*c+1]=h,c>r||(e.bl_count[h]++,d=0,c>=a&&(d=s[c-a]),f=A[2*c],e.opt_len+=f*(h+d),i&&(e.static_len+=f*(n[2*c+1]+d)));if(0!==p){do{for(h=o-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[o]--,p-=2}while(p>0);for(h=o;0!==h;h--)for(c=e.bl_count[h];0!==c;)u=e.heap[--l],u>r||(A[2*u+1]!==h&&(e.opt_len+=(h-A[2*u+1])*A[2*u],A[2*u+1]=h),c--)}})(e,t),Et(A,l,e.bl_count)},Ht=(e,t,A)=>{let r,n,i=-1,s=t[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),t[2*(A+1)+1]=65535,r=0;r<=A;r++)n=s,s=t[2*(r+1)+1],++a<o&&n===s||(a<l?e.bl_tree[2*n]+=a:0!==n?(n!==i&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,i=n,0===s?(o=138,l=3):n===s?(o=6,l=3):(o=7,l=4))},Ot=(e,t,A)=>{let r,n,i=-1,s=t[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),r=0;r<=A;r++)if(n=s,s=t[2*(r+1)+1],!(++a<o&&n===s)){if(a<l)do{Ut(e,n,e.bl_tree)}while(0!==--a);else 0!==n?(n!==i&&(Ut(e,n,e.bl_tree),a--),Ut(e,16,e.bl_tree),Qt(e,a-3,2)):a<=10?(Ut(e,17,e.bl_tree),Qt(e,a-3,3)):(Ut(e,18,e.bl_tree),Qt(e,a-11,7));a=0,i=n,0===s?(o=138,l=3):n===s?(o=6,l=3):(o=7,l=4)}};let Pt=!1;const Dt=(e,t,A,r)=>{Qt(e,0+(r?1:0),3),Lt(e),Ft(e,A),Ft(e,~A),A&&e.pending_buf.set(e.window.subarray(t,t+A),e.pending),e.pending+=A};var Mt=e=>{Pt||((()=>{let e,t,A,r,n;const i=new Array(16);for(A=0,r=0;r<28;r++)for(mt[r]=A,e=0;e<1<<lt[r];e++)gt[A++]=r;for(gt[A-1]=r,n=0,r=0;r<16;r++)for(wt[r]=n,e=0;e<1<<ct[r];e++)pt[n++]=r;for(n>>=7;r<at;r++)for(wt[r]=n<<7,e=0;e<1<<ct[r]-7;e++)pt[256+n++]=r;for(t=0;t<=ot;t++)i[t]=0;for(e=0;e<=143;)dt[2*e+1]=8,e++,i[8]++;for(;e<=255;)dt[2*e+1]=9,e++,i[9]++;for(;e<=279;)dt[2*e+1]=7,e++,i[7]++;for(;e<=287;)dt[2*e+1]=8,e++,i[8]++;for(Et(dt,287,i),e=0;e<at;e++)ft[2*e+1]=5,ft[2*e]=St(e,5);bt=new Bt(dt,lt,257,st,ot),yt=new Bt(ft,ct,0,at,ot),vt=new Bt(new Array(0),ut,0,19,7)})(),Pt=!0),e.l_desc=new Ct(e.dyn_ltree,bt),e.d_desc=new Ct(e.dyn_dtree,yt),e.bl_desc=new Ct(e.bl_tree,vt),e.bi_buf=0,e.bi_valid=0,Nt(e)},jt=(e,t,A,r)=>{let n,i,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,A=4093624447;for(t=0;t<=31;t++,A>>>=1)if(1&A&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<it;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Tt(e,e.l_desc),Tt(e,e.d_desc),s=(e=>{let t;for(Ht(e,e.dyn_ltree,e.l_desc.max_code),Ht(e,e.dyn_dtree,e.d_desc.max_code),Tt(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ht[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=A+5,A+4<=n&&-1!==t?Dt(e,t,A,r):4===e.strategy||i===n?(Qt(e,2+(r?1:0),3),kt(e,dt,ft)):(Qt(e,4+(r?1:0),3),((e,t,A,r)=>{let n;for(Qt(e,t-257,5),Qt(e,A-1,5),Qt(e,r-4,4),n=0;n<r;n++)Qt(e,e.bl_tree[2*ht[n]+1],3);Ot(e,e.dyn_ltree,t-1),Ot(e,e.dyn_dtree,A-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),kt(e,e.dyn_ltree,e.dyn_dtree)),Nt(e),r&&Lt(e)},Rt=(e,t,A)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=A,0===t?e.dyn_ltree[2*A]++:(e.matches++,t--,e.dyn_ltree[2*(gt[A]+it+1)]++,e.dyn_dtree[2*xt(t)]++),e.sym_next===e.sym_end),Vt=e=>{Qt(e,2,3),Ut(e,256,dt),(e=>{16===e.bi_valid?(Ft(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)},Kt={_tr_init:Mt,_tr_stored_block:Dt,_tr_flush_block:jt,_tr_tally:Rt,_tr_align:Vt};var zt=(e,t,A,r)=>{let n=65535&e,i=e>>>16&65535,s=0;for(;0!==A;){s=A>2e3?2e3:A,A-=s;do{n=n+t[r++]|0,i=i+n|0}while(--s);n%=65521,i%=65521}return n|i<<16};const Gt=new Uint32Array((()=>{let e,t=[];for(var A=0;A<256;A++){e=A;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[A]=e}return t})());var qt=(e,t,A,r)=>{const n=Gt,i=r+A;e^=-1;for(let A=r;A<i;A++)e=e>>>8^n[255&(e^t[A])];return-1^e},Wt={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"},Xt={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:Yt,_tr_stored_block:Jt,_tr_flush_block:$t,_tr_tally:Zt,_tr_align:eA}=Kt,{Z_NO_FLUSH:tA,Z_PARTIAL_FLUSH:AA,Z_FULL_FLUSH:rA,Z_FINISH:nA,Z_BLOCK:iA,Z_OK:sA,Z_STREAM_END:aA,Z_STREAM_ERROR:oA,Z_DATA_ERROR:lA,Z_BUF_ERROR:cA,Z_DEFAULT_COMPRESSION:uA,Z_FILTERED:hA,Z_HUFFMAN_ONLY:dA,Z_RLE:fA,Z_FIXED:pA,Z_DEFAULT_STRATEGY:gA,Z_UNKNOWN:mA,Z_DEFLATED:wA}=Xt,BA=258,bA=262,yA=42,vA=113,CA=666,xA=(e,t)=>(e.msg=Wt[t],t),FA=e=>2*e-(e>4?9:0),QA=e=>{let t=e.length;for(;--t>=0;)e[t]=0},UA=e=>{let t,A,r,n=e.w_size;t=e.hash_size,r=t;do{A=e.head[--r],e.head[r]=A>=n?A-n:0}while(--t);t=n,r=t;do{A=e.prev[--r],e.prev[r]=A>=n?A-n:0}while(--t)};let SA=(e,t,A)=>(t<<e.hash_shift^A)&e.hash_mask;const EA=e=>{const t=e.state;let A=t.pending;A>e.avail_out&&(A=e.avail_out),0!==A&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+A),e.next_out),e.next_out+=A,t.pending_out+=A,e.total_out+=A,e.avail_out-=A,t.pending-=A,0===t.pending&&(t.pending_out=0))},NA=(e,t)=>{$t(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,EA(e.strm)},LA=(e,t)=>{e.pending_buf[e.pending++]=t},_A=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},IA=(e,t,A,r)=>{let n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),A),1===e.state.wrap?e.adler=zt(e.adler,t,n,A):2===e.state.wrap&&(e.adler=qt(e.adler,t,n,A)),e.next_in+=n,e.total_in+=n,n)},kA=(e,t)=>{let A,r,n=e.max_chain_length,i=e.strstart,s=e.prev_length,a=e.nice_match;const o=e.strstart>e.w_size-bA?e.strstart-(e.w_size-bA):0,l=e.window,c=e.w_mask,u=e.prev,h=e.strstart+BA;let d=l[i+s-1],f=l[i+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(A=t,l[A+s]===f&&l[A+s-1]===d&&l[A]===l[i]&&l[++A]===l[i+1]){i+=2,A++;do{}while(l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&l[++i]===l[++A]&&i<h);if(r=BA-(h-i),i=h-BA,r>s){if(e.match_start=t,s=r,r>=a)break;d=l[i+s-1],f=l[i+s]}}}while((t=u[t&c])>o&&0!==--n);return s<=e.lookahead?s:e.lookahead},TA=e=>{const t=e.w_size;let A,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-bA)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),UA(e),r+=t),0===e.strm.avail_in)break;if(A=IA(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=A,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=SA(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=SA(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<bA&&0!==e.strm.avail_in)},HA=(e,t)=>{let A,r,n,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(A=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,r=e.strstart-e.block_start,A>r+e.strm.avail_in&&(A=r+e.strm.avail_in),A>n&&(A=n),A<i&&(0===A&&t!==nA||t===tA||A!==r+e.strm.avail_in))break;s=t===nA&&A===r+e.strm.avail_in?1:0,Jt(e,0,0,s),e.pending_buf[e.pending-4]=A,e.pending_buf[e.pending-3]=A>>8,e.pending_buf[e.pending-2]=~A,e.pending_buf[e.pending-1]=~A>>8,EA(e.strm),r&&(r>A&&(r=A),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,A-=r),A&&(IA(e.strm,e.strm.output,e.strm.next_out,A),e.strm.next_out+=A,e.strm.avail_out-=A,e.strm.total_out+=A)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==tA&&t!==nA&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(IA(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,i=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=i||(r||t===nA)&&t!==tA&&0===e.strm.avail_in&&r<=n)&&(A=r>n?n:r,s=t===nA&&0===e.strm.avail_in&&A===r?1:0,Jt(e,e.block_start,A,s),e.block_start+=A,EA(e.strm)),s?3:1)},OA=(e,t)=>{let A,r;for(;;){if(e.lookahead<bA){if(TA(e),e.lookahead<bA&&t===tA)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==A&&e.strstart-A<=e.w_size-bA&&(e.match_length=kA(e,A)),e.match_length>=3)if(r=Zt(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=SA(e,e.ins_h,e.window[e.strstart+1]);else r=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2},PA=(e,t)=>{let A,r,n;for(;;){if(e.lookahead<bA){if(TA(e),e.lookahead<bA&&t===tA)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==A&&e.prev_length<e.max_lazy_match&&e.strstart-A<=e.w_size-bA&&(e.match_length=kA(e,A),e.match_length<=5&&(e.strategy===hA||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=Zt(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=SA(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(NA(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Zt(e,0,e.window[e.strstart-1]),r&&NA(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Zt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2};function DA(e,t,A,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=A,this.max_chain=r,this.func=n}const MA=[new DA(0,0,0,0,HA),new DA(4,4,8,4,OA),new DA(4,5,16,8,OA),new DA(4,6,32,32,OA),new DA(4,4,16,16,PA),new DA(8,16,32,32,PA),new DA(8,16,128,128,PA),new DA(8,32,128,256,PA),new DA(32,128,258,1024,PA),new DA(32,258,258,4096,PA)];function jA(){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=wA,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),QA(this.dyn_ltree),QA(this.dyn_dtree),QA(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),QA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),QA(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 RA=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==yA&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==vA&&t.status!==CA?1:0},VA=e=>{if(RA(e))return xA(e,oA);e.total_in=e.total_out=0,e.data_type=mA;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?yA:vA,e.adler=2===t.wrap?0:1,t.last_flush=-2,Yt(t),sA},KA=e=>{const t=VA(e);return t===sA&&(e=>{e.window_size=2*e.w_size,QA(e.head),e.max_lazy_match=MA[e.level].max_lazy,e.good_match=MA[e.level].good_length,e.nice_match=MA[e.level].nice_length,e.max_chain_length=MA[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},zA=(e,t,A,r,n,i)=>{if(!e)return oA;let s=1;if(t===uA&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>9||A!==wA||r<8||r>15||t<0||t>9||i<0||i>pA||8===r&&1!==s)return xA(e,oA);8===r&&(r=9);const a=new jA;return e.state=a,a.strm=e,a.status=yA,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=i,a.method=A,KA(e)};var GA=(e,t)=>{if(RA(e)||t>iA||t<0)return e?xA(e,oA):oA;const A=e.state;if(!e.output||0!==e.avail_in&&!e.input||A.status===CA&&t!==nA)return xA(e,0===e.avail_out?cA:oA);const r=A.last_flush;if(A.last_flush=t,0!==A.pending){if(EA(e),0===e.avail_out)return A.last_flush=-1,sA}else if(0===e.avail_in&&FA(t)<=FA(r)&&t!==nA)return xA(e,cA);if(A.status===CA&&0!==e.avail_in)return xA(e,cA);if(A.status===yA&&0===A.wrap&&(A.status=vA),A.status===yA){let t=wA+(A.w_bits-8<<4)<<8,r=-1;if(r=A.strategy>=dA||A.level<2?0:A.level<6?1:6===A.level?2:3,t|=r<<6,0!==A.strstart&&(t|=32),t+=31-t%31,_A(A,t),0!==A.strstart&&(_A(A,e.adler>>>16),_A(A,65535&e.adler)),e.adler=1,A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA}if(57===A.status)if(e.adler=0,LA(A,31),LA(A,139),LA(A,8),A.gzhead)LA(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),LA(A,255&A.gzhead.time),LA(A,A.gzhead.time>>8&255),LA(A,A.gzhead.time>>16&255),LA(A,A.gzhead.time>>24&255),LA(A,9===A.level?2:A.strategy>=dA||A.level<2?4:0),LA(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(LA(A,255&A.gzhead.extra.length),LA(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(e.adler=qt(e.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69;else if(LA(A,0),LA(A,0),LA(A,0),LA(A,0),LA(A,0),LA(A,9===A.level?2:A.strategy>=dA||A.level<2?4:0),LA(A,3),A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA;if(69===A.status){if(A.gzhead.extra){let t=A.pending,r=(65535&A.gzhead.extra.length)-A.gzindex;for(;A.pending+r>A.pending_buf_size;){let n=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+n),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>t&&(e.adler=qt(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex+=n,EA(e),0!==A.pending)return A.last_flush=-1,sA;t=0,r-=n}let n=new Uint8Array(A.gzhead.extra);A.pending_buf.set(n.subarray(A.gzindex,A.gzindex+r),A.pending),A.pending+=r,A.gzhead.hcrc&&A.pending>t&&(e.adler=qt(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex=0}A.status=73}if(73===A.status){if(A.gzhead.name){let t,r=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),EA(e),0!==A.pending)return A.last_flush=-1,sA;r=0}t=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,LA(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),A.gzindex=0}A.status=91}if(91===A.status){if(A.gzhead.comment){let t,r=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r)),EA(e),0!==A.pending)return A.last_flush=-1,sA;r=0}t=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,LA(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>r&&(e.adler=qt(e.adler,A.pending_buf,A.pending-r,r))}A.status=103}if(103===A.status){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(EA(e),0!==A.pending))return A.last_flush=-1,sA;LA(A,255&e.adler),LA(A,e.adler>>8&255),e.adler=0}if(A.status=vA,EA(e),0!==A.pending)return A.last_flush=-1,sA}if(0!==e.avail_in||0!==A.lookahead||t!==tA&&A.status!==CA){let r=0===A.level?HA(A,t):A.strategy===dA?((e,t)=>{let A;for(;;){if(0===e.lookahead&&(TA(e),0===e.lookahead)){if(t===tA)return 1;break}if(e.match_length=0,A=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,A&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2})(A,t):A.strategy===fA?((e,t)=>{let A,r,n,i;const s=e.window;for(;;){if(e.lookahead<=BA){if(TA(e),e.lookahead<=BA&&t===tA)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){i=e.strstart+BA;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<i);e.match_length=BA-(i-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(A=Zt(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(A=Zt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),A&&(NA(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===nA?(NA(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(NA(e,!1),0===e.strm.avail_out)?1:2})(A,t):MA[A.level].func(A,t);if(3!==r&&4!==r||(A.status=CA),1===r||3===r)return 0===e.avail_out&&(A.last_flush=-1),sA;if(2===r&&(t===AA?eA(A):t!==iA&&(Jt(A,0,0,!1),t===rA&&(QA(A.head),0===A.lookahead&&(A.strstart=0,A.block_start=0,A.insert=0))),EA(e),0===e.avail_out))return A.last_flush=-1,sA}return t!==nA?sA:A.wrap<=0?aA:(2===A.wrap?(LA(A,255&e.adler),LA(A,e.adler>>8&255),LA(A,e.adler>>16&255),LA(A,e.adler>>24&255),LA(A,255&e.total_in),LA(A,e.total_in>>8&255),LA(A,e.total_in>>16&255),LA(A,e.total_in>>24&255)):(_A(A,e.adler>>>16),_A(A,65535&e.adler)),EA(e),A.wrap>0&&(A.wrap=-A.wrap),0!==A.pending?sA:aA)},qA=(e,t)=>{let A=t.length;if(RA(e))return oA;const r=e.state,n=r.wrap;if(2===n||1===n&&r.status!==yA||r.lookahead)return oA;if(1===n&&(e.adler=zt(e.adler,t,A,0)),r.wrap=0,A>=r.w_size){0===n&&(QA(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(A-r.w_size,A),0),t=e,A=r.w_size}const i=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=A,e.next_in=0,e.input=t,TA(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=SA(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,TA(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=i,r.wrap=n,sA},WA={deflateInit:(e,t)=>zA(e,t,wA,15,8,gA),deflateInit2:zA,deflateReset:KA,deflateResetKeep:VA,deflateSetHeader:(e,t)=>RA(e)||2!==e.state.wrap?oA:(e.state.gzhead=t,sA),deflate:GA,deflateEnd:e=>{if(RA(e))return oA;const t=e.state.status;return e.state=null,t===vA?xA(e,lA):sA},deflateSetDictionary:qA,deflateInfo:"pako deflate (from Nodeca project)"};const XA=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var YA=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const A=t.shift();if(A){if("object"!=typeof A)throw new TypeError(A+"must be non-object");for(const t in A)XA(A,t)&&(e[t]=A[t])}}return e},JA=e=>{let t=0;for(let A=0,r=e.length;A<r;A++)t+=e[A].length;const A=new Uint8Array(t);for(let t=0,r=0,n=e.length;t<n;t++){let n=e[t];A.set(n,r),r+=n.length}return A};let $A=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){$A=!1}const ZA=new Uint8Array(256);for(let e=0;e<256;e++)ZA[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ZA[254]=ZA[254]=1;var er=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,A,r,n,i,s=e.length,a=0;for(n=0;n<s;n++)A=e.charCodeAt(n),55296==(64512&A)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(A=65536+(A-55296<<10)+(r-56320),n++)),a+=A<128?1:A<2048?2:A<65536?3:4;for(t=new Uint8Array(a),i=0,n=0;i<a;n++)A=e.charCodeAt(n),55296==(64512&A)&&n+1<s&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(A=65536+(A-55296<<10)+(r-56320),n++)),A<128?t[i++]=A:A<2048?(t[i++]=192|A>>>6,t[i++]=128|63&A):A<65536?(t[i++]=224|A>>>12,t[i++]=128|A>>>6&63,t[i++]=128|63&A):(t[i++]=240|A>>>18,t[i++]=128|A>>>12&63,t[i++]=128|A>>>6&63,t[i++]=128|63&A);return t},tr=(e,t)=>{const A=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,n;const i=new Array(2*A);for(n=0,r=0;r<A;){let t=e[r++];if(t<128){i[n++]=t;continue}let s=ZA[t];if(s>4)i[n++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<A;)t=t<<6|63&e[r++],s--;s>1?i[n++]=65533:t<65536?i[n++]=t:(t-=65536,i[n++]=55296|t>>10&1023,i[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&$A)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let A="";for(let r=0;r<t;r++)A+=String.fromCharCode(e[r]);return A})(i,n)},Ar=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let A=t-1;for(;A>=0&&128==(192&e[A]);)A--;return A<0||0===A?t:A+ZA[e[A]]>t?A:t};var rr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const nr=Object.prototype.toString,{Z_NO_FLUSH:ir,Z_SYNC_FLUSH:sr,Z_FULL_FLUSH:ar,Z_FINISH:or,Z_OK:lr,Z_STREAM_END:cr,Z_DEFAULT_COMPRESSION:ur,Z_DEFAULT_STRATEGY:hr,Z_DEFLATED:dr}=Xt;function fr(e){this.options=YA({level:ur,method:dr,chunkSize:16384,windowBits:15,memLevel:8,strategy:hr},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new rr,this.strm.avail_out=0;let A=WA.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(A!==lr)throw new Error(Wt[A]);if(t.header&&WA.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?er(t.dictionary):"[object ArrayBuffer]"===nr.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,A=WA.deflateSetDictionary(this.strm,e),A!==lr)throw new Error(Wt[A]);this._dict_set=!0}}fr.prototype.push=function(e,t){const A=this.strm,r=this.options.chunkSize;let n,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?or:ir,"string"==typeof e?A.input=er(e):"[object ArrayBuffer]"===nr.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;)if(0===A.avail_out&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),(i===sr||i===ar)&&A.avail_out<=6)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else{if(n=WA.deflate(A,i),n===cr)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),n=WA.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===lr;if(0!==A.avail_out){if(i>0&&A.next_out>0)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else if(0===A.avail_in)break}else this.onData(A.output)}return!0},fr.prototype.onData=function(e){this.chunks.push(e)},fr.prototype.onEnd=function(e){e===lr&&(this.result=JA(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const pr=16209;var gr=function(e,t){let A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F;const Q=e.state;A=e.next_in,x=e.input,r=A+(e.avail_in-5),n=e.next_out,F=e.output,i=n-(t-e.avail_out),s=n+(e.avail_out-257),a=Q.dmax,o=Q.wsize,l=Q.whave,c=Q.wnext,u=Q.window,h=Q.hold,d=Q.bits,f=Q.lencode,p=Q.distcode,g=(1<<Q.lenbits)-1,m=(1<<Q.distbits)-1;e:do{d<15&&(h+=x[A++]<<d,d+=8,h+=x[A++]<<d,d+=8),w=f[h&g];t:for(;;){if(B=w>>>24,h>>>=B,d-=B,B=w>>>16&255,0===B)F[n++]=65535&w;else{if(!(16&B)){if(64&B){if(32&B){Q.mode=16191;break e}e.msg="invalid literal/length code",Q.mode=pr;break e}w=f[(65535&w)+(h&(1<<B)-1)];continue t}for(b=65535&w,B&=15,B&&(d<B&&(h+=x[A++]<<d,d+=8),b+=h&(1<<B)-1,h>>>=B,d-=B),d<15&&(h+=x[A++]<<d,d+=8,h+=x[A++]<<d,d+=8),w=p[h&m];;){if(B=w>>>24,h>>>=B,d-=B,B=w>>>16&255,16&B){if(y=65535&w,B&=15,d<B&&(h+=x[A++]<<d,d+=8,d<B&&(h+=x[A++]<<d,d+=8)),y+=h&(1<<B)-1,y>a){e.msg="invalid distance too far back",Q.mode=pr;break e}if(h>>>=B,d-=B,B=n-i,y>B){if(B=y-B,B>l&&Q.sane){e.msg="invalid distance too far back",Q.mode=pr;break e}if(v=0,C=u,0===c){if(v+=o-B,B<b){b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}}else if(c<B){if(v+=o+c-B,B-=c,B<b){b-=B;do{F[n++]=u[v++]}while(--B);if(v=0,c<b){B=c,b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}}}else if(v+=c-B,B<b){b-=B;do{F[n++]=u[v++]}while(--B);v=n-y,C=F}for(;b>2;)F[n++]=C[v++],F[n++]=C[v++],F[n++]=C[v++],b-=3;b&&(F[n++]=C[v++],b>1&&(F[n++]=C[v++]))}else{v=n-y;do{F[n++]=F[v++],F[n++]=F[v++],F[n++]=F[v++],b-=3}while(b>2);b&&(F[n++]=F[v++],b>1&&(F[n++]=F[v++]))}break}if(64&B){e.msg="invalid distance code",Q.mode=pr;break e}w=p[(65535&w)+(h&(1<<B)-1)]}}break}}while(A<r&&n<s);b=d>>3,A-=b,d-=b<<3,h&=(1<<d)-1,e.next_in=A,e.next_out=n,e.avail_in=A<r?r-A+5:5-(A-r),e.avail_out=n<s?s-n+257:257-(n-s),Q.hold=h,Q.bits=d};const mr=15,wr=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]),Br=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]),br=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]),yr=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var vr=(e,t,A,r,n,i,s,a)=>{const o=a.bits;let l,c,u,h,d,f,p=0,g=0,m=0,w=0,B=0,b=0,y=0,v=0,C=0,x=0,F=null;const Q=new Uint16Array(16),U=new Uint16Array(16);let S,E,N,L=null;for(p=0;p<=mr;p++)Q[p]=0;for(g=0;g<r;g++)Q[t[A+g]]++;for(B=o,w=mr;w>=1&&0===Q[w];w--);if(B>w&&(B=w),0===w)return n[i++]=20971520,n[i++]=20971520,a.bits=1,0;for(m=1;m<w&&0===Q[m];m++);for(B<m&&(B=m),v=1,p=1;p<=mr;p++)if(v<<=1,v-=Q[p],v<0)return-1;if(v>0&&(0===e||1!==w))return-1;for(U[1]=0,p=1;p<mr;p++)U[p+1]=U[p]+Q[p];for(g=0;g<r;g++)0!==t[A+g]&&(s[U[t[A+g]]++]=g);if(0===e?(F=L=s,f=20):1===e?(F=wr,L=Br,f=257):(F=br,L=yr,f=0),x=0,g=0,p=m,d=i,b=B,y=0,u=-1,C=1<<B,h=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){S=p-y,s[g]+1<f?(E=0,N=s[g]):s[g]>=f?(E=L[s[g]-f],N=F[s[g]-f]):(E=96,N=0),l=1<<p-y,c=1<<b,m=c;do{c-=l,n[d+(x>>y)+c]=S<<24|E<<16|N}while(0!==c);for(l=1<<p-1;x&l;)l>>=1;if(0!==l?(x&=l-1,x+=l):x=0,g++,0===--Q[p]){if(p===w)break;p=t[A+s[g]]}if(p>B&&(x&h)!==u){for(0===y&&(y=B),d+=m,b=p-y,v=1<<b;b+y<w&&(v-=Q[b+y],!(v<=0));)b++,v<<=1;if(C+=1<<b,1===e&&C>852||2===e&&C>592)return 1;u=x&h,n[u]=B<<24|b<<16|d-i}}return 0!==x&&(n[d+x]=p-y<<24|64<<16),a.bits=B,0};const{Z_FINISH:Cr,Z_BLOCK:xr,Z_TREES:Fr,Z_OK:Qr,Z_STREAM_END:Ur,Z_NEED_DICT:Sr,Z_STREAM_ERROR:Er,Z_DATA_ERROR:Nr,Z_MEM_ERROR:Lr,Z_BUF_ERROR:_r,Z_DEFLATED:Ir}=Xt,kr=16180,Tr=16190,Hr=16191,Or=16192,Pr=16194,Dr=16199,Mr=16200,jr=16206,Rr=16209,Vr=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Kr(){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 zr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<kr||t.mode>16211?1:0},Gr=e=>{if(zr(e))return Er;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=kr,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Qr},qr=e=>{if(zr(e))return Er;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Gr(e)},Wr=(e,t)=>{let A;if(zr(e))return Er;const r=e.state;return t<0?(A=0,t=-t):(A=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Er:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=A,r.wbits=t,qr(e))},Xr=(e,t)=>{if(!e)return Er;const A=new Kr;e.state=A,A.strm=e,A.window=null,A.mode=kr;const r=Wr(e,t);return r!==Qr&&(e.state=null),r};let Yr,Jr,$r=!0;const Zr=e=>{if($r){Yr=new Int32Array(512),Jr=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(vr(1,e.lens,0,288,Yr,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;vr(2,e.lens,0,32,Jr,0,e.work,{bits:5}),$r=!1}e.lencode=Yr,e.lenbits=9,e.distcode=Jr,e.distbits=5},en=(e,t,A,r)=>{let n;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(A-i.wsize,A),0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>r&&(n=r),i.window.set(t.subarray(A-r,A-r+n),i.wnext),(r-=n)?(i.window.set(t.subarray(A-r,A),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0};var tn=(e,t)=>{let A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x=0;const F=new Uint8Array(4);let Q,U;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zr(e)||!e.output||!e.input&&0!==e.avail_in)return Er;A=e.state,A.mode===Hr&&(A.mode=Or),s=e.next_out,n=e.output,o=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,l=A.hold,c=A.bits,u=a,h=o,C=Qr;e:for(;;)switch(A.mode){case kr:if(0===A.wrap){A.mode=Or;break}for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(2&A.wrap&&35615===l){0===A.wbits&&(A.wbits=15),A.check=0,F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0),l=0,c=0,A.mode=16181;break}if(A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",A.mode=Rr;break}if((15&l)!==Ir){e.msg="unknown compression method",A.mode=Rr;break}if(l>>>=4,c-=4,v=8+(15&l),0===A.wbits&&(A.wbits=v),v>15||v>A.wbits){e.msg="invalid window size",A.mode=Rr;break}A.dmax=1<<A.wbits,A.flags=0,e.adler=A.check=1,A.mode=512&l?16189:Hr,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(A.flags=l,(255&A.flags)!==Ir){e.msg="unknown compression method",A.mode=Rr;break}if(57344&A.flags){e.msg="unknown header flags set",A.mode=Rr;break}A.head&&(A.head.text=l>>8&1),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0,A.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.head&&(A.head.time=l),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,F[2]=l>>>16&255,F[3]=l>>>24&255,A.check=qt(A.check,F,4,0)),l=0,c=0,A.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.head&&(A.head.xflags=255&l,A.head.os=l>>8),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0,A.mode=16184;case 16184:if(1024&A.flags){for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.length=l,A.head&&(A.head.extra_len=l),512&A.flags&&4&A.wrap&&(F[0]=255&l,F[1]=l>>>8&255,A.check=qt(A.check,F,2,0)),l=0,c=0}else A.head&&(A.head.extra=null);A.mode=16185;case 16185:if(1024&A.flags&&(d=A.length,d>a&&(d=a),d&&(A.head&&(v=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(r.subarray(i,i+d),v)),512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,A.length-=d),A.length))break e;A.length=0,A.mode=16186;case 16186:if(2048&A.flags){if(0===a)break e;d=0;do{v=r[i+d++],A.head&&v&&A.length<65536&&(A.head.name+=String.fromCharCode(v))}while(v&&d<a);if(512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,v)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=16187;case 16187:if(4096&A.flags){if(0===a)break e;d=0;do{v=r[i+d++],A.head&&v&&A.length<65536&&(A.head.comment+=String.fromCharCode(v))}while(v&&d<a);if(512&A.flags&&4&A.wrap&&(A.check=qt(A.check,r,d,i)),a-=d,i+=d,v)break e}else A.head&&(A.head.comment=null);A.mode=16188;case 16188:if(512&A.flags){for(;c<16;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(4&A.wrap&&l!==(65535&A.check)){e.msg="header crc mismatch",A.mode=Rr;break}l=0,c=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),e.adler=A.check=0,A.mode=Hr;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}e.adler=A.check=Vr(l),l=0,c=0,A.mode=Tr;case Tr:if(0===A.havedict)return e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,Sr;e.adler=A.check=1,A.mode=Hr;case Hr:if(t===xr||t===Fr)break e;case Or:if(A.last){l>>>=7&c,c-=7&c,A.mode=jr;break}for(;c<3;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}switch(A.last=1&l,l>>>=1,c-=1,3&l){case 0:A.mode=16193;break;case 1:if(Zr(A),A.mode=Dr,t===Fr){l>>>=2,c-=2;break e}break;case 2:A.mode=16196;break;case 3:e.msg="invalid block type",A.mode=Rr}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",A.mode=Rr;break}if(A.length=65535&l,l=0,c=0,A.mode=Pr,t===Fr)break e;case Pr:A.mode=16195;case 16195:if(d=A.length,d){if(d>a&&(d=a),d>o&&(d=o),0===d)break e;n.set(r.subarray(i,i+d),s),a-=d,i+=d,o-=d,s+=d,A.length-=d;break}A.mode=Hr;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(A.nlen=257+(31&l),l>>>=5,c-=5,A.ndist=1+(31&l),l>>>=5,c-=5,A.ncode=4+(15&l),l>>>=4,c-=4,A.nlen>286||A.ndist>30){e.msg="too many length or distance symbols",A.mode=Rr;break}A.have=0,A.mode=16197;case 16197:for(;A.have<A.ncode;){for(;c<3;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.lens[S[A.have++]]=7&l,l>>>=3,c-=3}for(;A.have<19;)A.lens[S[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,Q={bits:A.lenbits},C=vr(0,A.lens,0,19,A.lencode,0,A.work,Q),A.lenbits=Q.bits,C){e.msg="invalid code lengths set",A.mode=Rr;break}A.have=0,A.mode=16198;case 16198:for(;A.have<A.nlen+A.ndist;){for(;x=A.lencode[l&(1<<A.lenbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(w<16)l>>>=g,c-=g,A.lens[A.have++]=w;else{if(16===w){for(U=g+2;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(l>>>=g,c-=g,0===A.have){e.msg="invalid bit length repeat",A.mode=Rr;break}v=A.lens[A.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===w){for(U=g+3;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=g,c-=g,v=0,d=3+(7&l),l>>>=3,c-=3}else{for(U=g+7;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=g,c-=g,v=0,d=11+(127&l),l>>>=7,c-=7}if(A.have+d>A.nlen+A.ndist){e.msg="invalid bit length repeat",A.mode=Rr;break}for(;d--;)A.lens[A.have++]=v}}if(A.mode===Rr)break;if(0===A.lens[256]){e.msg="invalid code -- missing end-of-block",A.mode=Rr;break}if(A.lenbits=9,Q={bits:A.lenbits},C=vr(1,A.lens,0,A.nlen,A.lencode,0,A.work,Q),A.lenbits=Q.bits,C){e.msg="invalid literal/lengths set",A.mode=Rr;break}if(A.distbits=6,A.distcode=A.distdyn,Q={bits:A.distbits},C=vr(2,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,Q),A.distbits=Q.bits,C){e.msg="invalid distances set",A.mode=Rr;break}if(A.mode=Dr,t===Fr)break e;case Dr:A.mode=Mr;case Mr:if(a>=6&&o>=258){e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,gr(e,h),s=e.next_out,n=e.output,o=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,l=A.hold,c=A.bits,A.mode===Hr&&(A.back=-1);break}for(A.back=0;x=A.lencode[l&(1<<A.lenbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(m&&!(240&m)){for(B=g,b=m,y=w;x=A.lencode[y+((l&(1<<B+b)-1)>>B)],g=x>>>24,m=x>>>16&255,w=65535&x,!(B+g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=B,c-=B,A.back+=B}if(l>>>=g,c-=g,A.back+=g,A.length=w,0===m){A.mode=16205;break}if(32&m){A.back=-1,A.mode=Hr;break}if(64&m){e.msg="invalid literal/length code",A.mode=Rr;break}A.extra=15&m,A.mode=16201;case 16201:if(A.extra){for(U=A.extra;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.length+=l&(1<<A.extra)-1,l>>>=A.extra,c-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=16202;case 16202:for(;x=A.distcode[l&(1<<A.distbits)-1],g=x>>>24,m=x>>>16&255,w=65535&x,!(g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(!(240&m)){for(B=g,b=m,y=w;x=A.distcode[y+((l&(1<<B+b)-1)>>B)],g=x>>>24,m=x>>>16&255,w=65535&x,!(B+g<=c);){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}l>>>=B,c-=B,A.back+=B}if(l>>>=g,c-=g,A.back+=g,64&m){e.msg="invalid distance code",A.mode=Rr;break}A.offset=w,A.extra=15&m,A.mode=16203;case 16203:if(A.extra){for(U=A.extra;c<U;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}A.offset+=l&(1<<A.extra)-1,l>>>=A.extra,c-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){e.msg="invalid distance too far back",A.mode=Rr;break}A.mode=16204;case 16204:if(0===o)break e;if(d=h-o,A.offset>d){if(d=A.offset-d,d>A.whave&&A.sane){e.msg="invalid distance too far back",A.mode=Rr;break}d>A.wnext?(d-=A.wnext,f=A.wsize-d):f=A.wnext-d,d>A.length&&(d=A.length),p=A.window}else p=n,f=s-A.offset,d=A.length;d>o&&(d=o),o-=d,A.length-=d;do{n[s++]=p[f++]}while(--d);0===A.length&&(A.mode=Mr);break;case 16205:if(0===o)break e;n[s++]=A.length,o--,A.mode=Mr;break;case jr:if(A.wrap){for(;c<32;){if(0===a)break e;a--,l|=r[i++]<<c,c+=8}if(h-=o,e.total_out+=h,A.total+=h,4&A.wrap&&h&&(e.adler=A.check=A.flags?qt(A.check,n,h,s-h):zt(A.check,n,h,s-h)),h=o,4&A.wrap&&(A.flags?l:Vr(l))!==A.check){e.msg="incorrect data check",A.mode=Rr;break}l=0,c=0}A.mode=16207;case 16207:if(A.wrap&&A.flags){for(;c<32;){if(0===a)break e;a--,l+=r[i++]<<c,c+=8}if(4&A.wrap&&l!==(4294967295&A.total)){e.msg="incorrect length check",A.mode=Rr;break}l=0,c=0}A.mode=16208;case 16208:C=Ur;break e;case Rr:C=Nr;break e;case 16210:return Lr;default:return Er}return e.next_out=s,e.avail_out=o,e.next_in=i,e.avail_in=a,A.hold=l,A.bits=c,(A.wsize||h!==e.avail_out&&A.mode<Rr&&(A.mode<jr||t!==Cr))&&en(e,e.output,e.next_out,h-e.avail_out),u-=e.avail_in,h-=e.avail_out,e.total_in+=u,e.total_out+=h,A.total+=h,4&A.wrap&&h&&(e.adler=A.check=A.flags?qt(A.check,n,h,e.next_out-h):zt(A.check,n,h,e.next_out-h)),e.data_type=A.bits+(A.last?64:0)+(A.mode===Hr?128:0)+(A.mode===Dr||A.mode===Pr?256:0),(0===u&&0===h||t===Cr)&&C===Qr&&(C=_r),C},An={inflateReset:qr,inflateReset2:Wr,inflateResetKeep:Gr,inflateInit:e=>Xr(e,15),inflateInit2:Xr,inflate:tn,inflateEnd:e=>{if(zr(e))return Er;let t=e.state;return t.window&&(t.window=null),e.state=null,Qr},inflateGetHeader:(e,t)=>{if(zr(e))return Er;const A=e.state;return 2&A.wrap?(A.head=t,t.done=!1,Qr):Er},inflateSetDictionary:(e,t)=>{const A=t.length;let r,n,i;return zr(e)?Er:(r=e.state,0!==r.wrap&&r.mode!==Tr?Er:r.mode===Tr&&(n=1,n=zt(n,t,A,0),n!==r.check)?Nr:(i=en(e,t,A,A),i?(r.mode=16210,Lr):(r.havedict=1,Qr)))},inflateInfo:"pako inflate (from Nodeca project)"};var rn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const nn=Object.prototype.toString,{Z_NO_FLUSH:sn,Z_FINISH:an,Z_OK:on,Z_STREAM_END:ln,Z_NEED_DICT:cn,Z_STREAM_ERROR:un,Z_DATA_ERROR:hn,Z_MEM_ERROR:dn}=Xt;function fn(e){this.options=YA({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new rr,this.strm.avail_out=0;let A=An.inflateInit2(this.strm,t.windowBits);if(A!==on)throw new Error(Wt[A]);if(this.header=new rn,An.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=er(t.dictionary):"[object ArrayBuffer]"===nn.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(A=An.inflateSetDictionary(this.strm,t.dictionary),A!==on)))throw new Error(Wt[A])}function pn(e,t){const A=new fn(t);if(A.push(e),A.err)throw A.msg||Wt[A.err];return A.result}fn.prototype.push=function(e,t){const A=this.strm,r=this.options.chunkSize,n=this.options.dictionary;let i,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?an:sn,"[object ArrayBuffer]"===nn.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;){for(0===A.avail_out&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),i=An.inflate(A,s),i===cn&&n&&(i=An.inflateSetDictionary(A,n),i===on?i=An.inflate(A,s):i===hn&&(i=cn));A.avail_in>0&&i===ln&&A.state.wrap>0&&0!==e[A.next_in];)An.inflateReset(A),i=An.inflate(A,s);switch(i){case un:case hn:case cn:case dn:return this.onEnd(i),this.ended=!0,!1}if(a=A.avail_out,A.next_out&&(0===A.avail_out||i===ln))if("string"===this.options.to){let e=Ar(A.output,A.next_out),t=A.next_out-e,n=tr(A.output,e);A.next_out=t,A.avail_out=r-t,t&&A.output.set(A.output.subarray(e,e+t),0),this.onData(n)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(i!==on||0!==a){if(i===ln)return i=An.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===A.avail_in)break}}return!0},fn.prototype.onData=function(e){this.chunks.push(e)},fn.prototype.onEnd=function(e){e===on&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=JA(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var gn={Inflate:fn,inflate:pn,inflateRaw:function(e,t){return(t=t||{}).raw=!0,pn(e,t)},ungzip:pn,constants:Xt};const{Inflate:mn,inflate:wn,inflateRaw:Bn,ungzip:bn}=gn;var yn=mn,vn=wn;const Cn=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;Cn[e]=t}const xn=4294967295;function Fn(e,t){return(function(e,t,A){let r=e;for(let e=0;e<A;e++)r=Cn[255&(r^t[e])]^r>>>8;return r}(xn,e,t)^xn)>>>0}function Qn(e,t,A){const r=e.readUint32(),n=Fn(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(n!==r)throw new Error(`CRC mismatch for chunk ${A}. Expected ${r}, found ${n}`)}function Un(e,t,A){for(let r=0;r<A;r++)t[r]=e[r]}function Sn(e,t,A,r){let n=0;for(;n<r;n++)t[n]=e[n];for(;n<A;n++)t[n]=e[n]+t[n-r]&255}function En(e,t,A,r){let n=0;if(0===A.length)for(;n<r;n++)t[n]=e[n];else for(;n<r;n++)t[n]=e[n]+A[n]&255}function Nn(e,t,A,r,n){let i=0;if(0===A.length){for(;i<n;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+(t[i-n]>>1)&255}else{for(;i<n;i++)t[i]=e[i]+(A[i]>>1)&255;for(;i<r;i++)t[i]=e[i]+(t[i-n]+A[i]>>1)&255}}function Ln(e,t,A,r,n){let i=0;if(0===A.length){for(;i<n;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-n]&255}else{for(;i<n;i++)t[i]=e[i]+A[i]&255;for(;i<r;i++)t[i]=e[i]+_n(t[i-n],A[i],A[i-n])&255}}function _n(e,t,A){const r=e+t-A,n=Math.abs(r-e),i=Math.abs(r-t),s=Math.abs(r-A);return n<=i&&n<=s?e:i<=s?t:A}function In(e,t,A,r,n,i){switch(e){case 0:Un(t,A,n);break;case 1:Sn(t,A,n,i);break;case 2:En(t,A,r,n);break;case 3:Nn(t,A,r,n,i);break;case 4:Ln(t,A,r,n,i);break;default:throw new Error(`Unsupported filter: ${e}`)}}const kn=new Uint16Array([255]),Tn=255===new Uint8Array(kn.buffer)[0];function Hn(e){return(255&e)<<8|e>>8&255}const On=new Uint16Array([255]),Pn=255===new Uint8Array(On.buffer)[0],Dn=new Uint8Array(0);function Mn(e){const{data:t,width:A,height:r,channels:n,depth:i}=e,s=Math.ceil(i/8)*n,a=Math.ceil(i/8*n*A),o=new Uint8Array(r*a);let l,c,u=Dn,h=0;for(let e=0;e<r;e++){switch(l=t.subarray(h+1,h+1+a),c=o.subarray(e*a,(e+1)*a),t[h]){case 0:Un(l,c,a);break;case 1:Sn(l,c,a,s);break;case 2:En(l,c,u,a);break;case 3:Nn(l,c,u,a,s);break;case 4:Ln(l,c,u,a,s);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}u=c,h+=a+1}if(16===i){const e=new Uint16Array(o.buffer);if(Pn)for(let t=0;t<e.length;t++)e[t]=jn(e[t]);return e}return o}function jn(e){return(255&e)<<8|e>>8&255}const Rn=Uint8Array.of(137,80,78,71,13,10,26,10);function Vn(e){if(!function(e){if(e.length<Rn.length)return!1;for(let t=0;t<Rn.length;t++)if(e[t]!==Rn[t])return!1;return!0}(e.readBytes(Rn.length)))throw new Error("wrong PNG signature")}const Kn=new TextDecoder("latin1");function zn(e){if(function(e){if(!Gn.test(e))throw new Error("invalid latin1 text")}(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const Gn=/^[\u0000-\u00FF]*$/;function qn(e,t,A){const r=Wn(t);e[r]=function(e,t){return Kn.decode(e.readBytes(t))}(t,A-r.length-1)}function Wn(e){for(e.mark();0!==e.readByte(););const t=e.offset;e.reset();const A=Kn.decode(e.readBytes(t-e.offset-1));return e.skip(1),zn(A),A}const Xn=-1,Yn=0,Jn=2,$n=3,Zn=4,ei=6,ti=-1,Ai=0,ri=-1,ni=0,ii=-1,si=0,ai=1,oi=0,li=1,ci=2,ui=0,hi=1;class di extends rt{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:A=!1}=t;this._checkCrc=A,this._inflator=new yn,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=ti,this._filterMethod=ri,this._interlaceMethod=ii,this._colorType=Xn,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Vn(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(Vn(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const A=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case"tEXt":qn(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-A!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Qn(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const A=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=A+e}if(this.offset-A!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Qn(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}(this.readUint8());const t=this.readUint8();let A;switch(this._colorType=t,t){case Yn:A=1;break;case Jn:A=3;break;case $n:A=1;break;case Zn:A=2;break;case ei:A=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=A,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ai)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const A=[];this._palette=A;for(let e=0;e<t;e++)A.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,A=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,A,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,A=this.offset+this.byteOffset;if(A+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,A,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case Yn:case Jn:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case $n:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=Wn(this),A=this.readUint8();if(A!==Ai)throw new Error(`Unsupported iCCP compression method: ${A}`);const r=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:vn(r)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),A=this.readByte();this._png.resolution={x:e,y:t,unit:A}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},A=this._frames.at(e);if(A){if(A.data=Mn({data:A.data,width:A.width,height:A.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===A.xOffset&&0===A.yOffset&&A.width===this._png.width&&A.height===this._png.height)t.data=A.data;else{const r=this._apng.frames.at(e-1);this.disposeFrame(A,r,t),this.addFrameDataToCanvas(t,A)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,A){switch(e.disposeOp){case oi:break;case li:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const n=(t*e.width+r)*this._png.channels;for(let e=0;e<this._png.channels;e++)A.data[n+e]=0}break;case ci:A.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const A=1<<this._png.depth,r=(e,A)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+A)*this._png.channels,frameIndex:(e*t.width+A)*this._png.channels});switch(t.blendOp){case ui:for(let A=0;A<t.height;A++)for(let n=0;n<t.width;n++){const{index:i,frameIndex:s}=r(A,n);for(let A=0;A<this._png.channels;A++)e.data[i+A]=t.data[s+A]}break;case hi:for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const{index:s,frameIndex:a}=r(n,i);for(let r=0;r<this._png.channels;r++){const n=t.data[a+this._png.channels-1]/A,i=r%(this._png.channels-1)==0?1:t.data[a+r],o=Math.floor(n*i+(1-n)*e.data[s+r]);e.data[s+r]+=o}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==ni)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===si)this._png.data=Mn({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==ai)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(e){const{data:t,width:A,height:r,channels:n,depth:i}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(i/8)*n,o=new Uint8Array(r*A*a);let l=0;for(let e=0;e<7;e++){const n=s[e],i=Math.ceil((A-n.x)/n.xStep),c=Math.ceil((r-n.y)/n.yStep);if(i<=0||c<=0)continue;const u=i*a,h=new Uint8Array(u);for(let e=0;e<c;e++){const s=t[l++],c=t.subarray(l,l+u);l+=u;const d=new Uint8Array(u);In(s,c,d,h,u,a),h.set(d);for(let t=0;t<i;t++){const i=n.x+t*n.xStep,s=n.y+e*n.yStep;if(!(i>=A||s>=r))for(let e=0;e<a;e++)o[(s*A+i)*a+e]=d[t*a+e]}}}if(16===i){const e=new Uint16Array(o.buffer);if(Tn)for(let t=0;t<e.length;t++)e[t]=Hn(e[t]);return e}return o}({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:oi,blendOp:ui,data:e}),this._inflator=new yn,this._writingDataChunks=!1}}var fi;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"}(fi||(fi={}));
|
|
32
32
|
/** @license
|
|
33
33
|
*
|
|
34
34
|
* jsPDF - PDF Document creation from JavaScript
|
|
@@ -112,7 +112,7 @@ var pi=function(){return"undefined"!=typeof window?window:"undefined"!=typeof gl
|
|
|
112
112
|
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
113
113
|
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
114
114
|
* http://www.fpdf.org/en/script/script37.php
|
|
115
|
-
*/var Mi={print:4,modify:8,copy:16,"annot-forms":32};function ji(e,t,A,r){this.v=1,this.r=2;var n=192;e.forEach(function(e){if(void 0!==Mi.perm)throw new Error("Invalid permission: "+e);n+=Mi[e]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(t+this.padding).substr(0,32),s=(A+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,s),this.P=-(1+(255^n)),this.encryptionKey=Hi(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Di(this.encryptionKey,this.padding)}function Ri(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",A=e.length,r=0;r<A;r++){var n=e.charCodeAt(r);t+=n<33||35===n||37===n||40===n||41===n||47===n||60===n||62===n||91===n||93===n||123===n||125===n||n>126?"#"+("0"+n.toString(16)).slice(-2):e[r]}return t}function Vi(e){if("object"!==pe(e))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,A,r){if(r=r||!1,"string"!=typeof e||"function"!=typeof A||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var n=Math.random().toString(35);return t[e][n]=[A,!!r],n},this.unsubscribe=function(e){for(var A in t)if(t[A][e])return delete t[A][e],0===Object.keys(t[A]).length&&delete t[A],!0;return!1},this.publish=function(A){if(t.hasOwnProperty(A)){var r=Array.prototype.slice.call(arguments,1),n=[];for(var i in t[A]){var s=t[A][i];try{s[0].apply(e,r)}catch(e){pi.console&&mi.error("jsPDF PubSub Error",e.message,e)}s[1]&&n.push(i)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Ki(e){if(!(this instanceof Ki))return new Ki(e);var t="opacity,stroke-opacity".split(",");for(var A in e)e.hasOwnProperty(A)&&t.indexOf(A)>=0&&(this[A]=e[A]);this.id="",this.objectNumber=-1}function Gi(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function zi(e,t,A,r,n){if(!(this instanceof zi))return new zi(e,t,A,r,n);this.type="axial"===e?2:3,this.coords=t,this.colors=A,Gi.call(this,r,n)}function qi(e,t,A,r,n){if(!(this instanceof qi))return new qi(e,t,A,r,n);this.boundingBox=e,this.xStep=t,this.yStep=A,this.stream="",this.cloneIndex=0,Gi.call(this,r,n)}function Wi(e){var t,A="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],n=arguments[2],i=arguments[3],s=[],a=1,o=16,l="S",c=null;"object"===pe(e=e||{})&&(A=e.orientation,r=e.unit||r,n=e.format||n,i=e.compress||e.compressPdf||i,null!==(c=e.encryption||null)&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),a="number"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(t=e.precision),void 0!==e.floatPrecision&&(o=e.floatPrecision),l=e.defaultPathOperation||"S"),s=e.filters||(!0===i?["FlateEncode"]:s),r=r||"mm",A=(""+(A||"P")).toLowerCase();var u=e.putOnlyUsedFonts||!1,h={},d={internal:{},__private__:{}};d.__private__.PubSub=Vi;var f="1.3",p=d.__private__.getPdfVersion=function(){return f};d.__private__.setPdfVersion=function(e){f=e};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return g};var m=d.__private__.getPageFormat=function(e){return g[e]};n=n||"a4";var w="compat",B="advanced",b=w;function y(){this.saveGraphicsState(),J(new _e(he,0,0,-he,0,dA()*he).toString()+" cm"),this.setFontSize(this.getFontSize()/he),l="n",b=B}function v(){this.restoreGraphicsState(),l="S",b=w}var C=d.__private__.combineFontStyleAndFontWeight=function(e,t){if("bold"==e&&"normal"==t||"bold"==e&&400==t||"normal"==e&&"italic"==t||"bold"==e&&"italic"==t)throw new Error("Invalid Combination of fontweight and fontstyle");return t&&(e=400==t||"normal"===t?"italic"===e?"italic":"normal":700!=t&&"bold"!==t||"normal"!==e?(700==t?"bold":t)+""+e:"bold"),e};d.advancedAPI=function(e){var t=b===w;return t&&y.call(this),"function"!=typeof e||(e(this),t&&v.call(this)),this},d.compatAPI=function(e){var t=b===B;return t&&v.call(this),"function"!=typeof e||(e(this),t&&y.call(this)),this},d.isAdvancedAPI=function(){return b===B};var x,F=function(e){if(b!==B)throw new Error(e+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},Q=d.roundToPrecision=d.__private__.roundToPrecision=function(e,A){var r=t||A;if(isNaN(e)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return e.toFixed(r).replace(/0+$/,"")};x=d.hpf=d.__private__.hpf="number"==typeof o?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,o)}:"smart"===o?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,16)};var U=d.f2=d.__private__.f2=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f2");return Q(e,2)},S=d.__private__.f3=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f3");return Q(e,3)},E=d.scale=d.__private__.scale=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.scale");return b===w?e*he:b===B?e:void 0},N=function(e){return E(function(e){return b===w?dA()-e:b===B?e:void 0}(e))};d.__private__.setPrecision=d.setPrecision=function(e){"number"==typeof parseInt(e,10)&&(t=parseInt(e,10))};var L,_="00000000000000000000000000000000",I=d.__private__.getFileId=function(){return _},k=d.__private__.setFileId=function(e){return _=void 0!==e&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():_.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==c&&(Bt=new ji(c.userPermissions,c.userPassword,c.ownerPassword,_)),_};d.setFileId=function(e){return k(e),this},d.getFileId=function(){return I()};var T=d.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),A=t<0?"+":"-",r=Math.floor(Math.abs(t/60)),n=Math.abs(t%60),i=[A,M(r),"'",M(n),"'"].join("");return["D:",e.getFullYear(),M(e.getMonth()+1),M(e.getDate()),M(e.getHours()),M(e.getMinutes()),M(e.getSeconds()),i].join("")},H=d.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),A=parseInt(e.substr(6,2),10)-1,r=parseInt(e.substr(8,2),10),n=parseInt(e.substr(10,2),10),i=parseInt(e.substr(12,2),10),s=parseInt(e.substr(14,2),10);return new Date(t,A,r,n,i,s,0)},O=d.__private__.setCreationDate=function(e){var t;if(void 0===e&&(e=new Date),e instanceof Date)t=T(e);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))throw new Error("Invalid argument passed to jsPDF.setCreationDate");t=e}return L=t},P=d.__private__.getCreationDate=function(e){var t=L;return"jsDate"===e&&(t=H(L)),t};d.setCreationDate=function(e){return O(e),this},d.getCreationDate=function(e){return P(e)};var D,M=d.__private__.padd2=function(e){return("0"+parseInt(e)).slice(-2)},j=d.__private__.padd2Hex=function(e){return("00"+(e=e.toString())).substr(e.length)},R=0,V=[],K=[],G=0,z=[],q=[],W=!1,X=K;d.__private__.setCustomOutputDestination=function(e){W=!0,X=e};var Y=function(e){W||(X=e)};d.__private__.resetCustomOutputDestination=function(){W=!1,X=K};var J=d.__private__.out=function(e){return e=e.toString(),G+=e.length+1,X.push(e),X},$=d.__private__.write=function(e){return J(1===arguments.length?e.toString():Array.prototype.join.call(arguments," "))},Z=d.__private__.getArrayBuffer=function(e){for(var t=e.length,A=new ArrayBuffer(t),r=new Uint8Array(A);t--;)r[t]=e.charCodeAt(t);return A},ee=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return ee};var te=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(e){return te=b===B?e/he:e,this};var Ae,re=d.__private__.getFontSize=d.getFontSize=function(){return b===w?te:te*he},ne=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(e){return ne=e,this},d.__private__.getR2L=d.getR2L=function(){return ne};var ie,se=d.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))Ae=e;else if(isNaN(e)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(e))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+e+'" is not recognized.');Ae=e}else Ae=parseInt(e,10)};d.__private__.getZoomMode=function(){return Ae};var ae,oe=d.__private__.setPageMode=function(e){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');ie=e};d.__private__.getPageMode=function(){return ie};var le=d.__private__.setLayoutMode=function(e){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(e))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+e+'" is not recognized.');ae=e};d.__private__.getLayoutMode=function(){return ae},d.__private__.setDisplayMode=d.setDisplayMode=function(e,t,A){return se(e),le(t),oe(A),this};var ce={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(e){if(-1===Object.keys(ce).indexOf(e))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ce[e]},d.__private__.getDocumentProperties=function(){return ce},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(e){for(var t in ce)ce.hasOwnProperty(t)&&e[t]&&(ce[t]=e[t]);return this},d.__private__.setDocumentProperty=function(e,t){if(-1===Object.keys(ce).indexOf(e))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ce[e]=t};var ue,he,de,fe,ge,me={},we={},Be=[],be={},ye={},ve={},Ce={},xe=null,Fe=0,Qe=[],Ue=new Vi(d),Se=e.hotfixes||[],Ee={},Ne={},Le=[],_e=function e(t,A,r,n,i,s){if(!(this instanceof e))return new e(t,A,r,n,i,s);isNaN(t)&&(t=1),isNaN(A)&&(A=0),isNaN(r)&&(r=0),isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(s)&&(s=0),this._matrix=[t,A,r,n,i,s]};Object.defineProperty(_e.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(_e.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(_e.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(_e.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(_e.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(_e.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(_e.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(_e.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(_e.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(_e.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(_e.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(_e.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(_e.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(_e.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(_e.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(_e.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),_e.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(x).join(e)},_e.prototype.multiply=function(e){var t=e.sx*this.sx+e.shy*this.shx,A=e.sx*this.shy+e.shy*this.sy,r=e.shx*this.sx+e.sy*this.shx,n=e.shx*this.shy+e.sy*this.sy,i=e.tx*this.sx+e.ty*this.shx+this.tx,s=e.tx*this.shy+e.ty*this.sy+this.ty;return new _e(t,A,r,n,i,s)},_e.prototype.decompose=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty,s=Math.sqrt(e*e+t*t),a=(e/=s)*A+(t/=s)*r;A-=e*a,r-=t*a;var o=Math.sqrt(A*A+r*r);return a/=o,e*(r/=o)<t*(A/=o)&&(e=-e,t=-t,a=-a,s=-s),{scale:new _e(s,0,0,o,0,0),translate:new _e(1,0,0,1,n,i),rotate:new _e(e,t,-t,e,0,0),skew:new _e(1,0,a,1,0,0)}},_e.prototype.toString=function(e){return this.join(" ")},_e.prototype.inversed=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty,s=1/(e*r-t*A),a=r*s,o=-t*s,l=-A*s,c=e*s;return new _e(a,o,l,c,-a*n-l*i,-o*n-c*i)},_e.prototype.applyToPoint=function(e){var t=e.x*this.sx+e.y*this.shx+this.tx,A=e.x*this.shy+e.y*this.sy+this.ty;return new AA(t,A)},_e.prototype.applyToRectangle=function(e){var t=this.applyToPoint(e),A=this.applyToPoint(new AA(e.x+e.w,e.y+e.h));return new rA(t.x,t.y,A.x-t.x,A.y-t.y)},_e.prototype.clone=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty;return new _e(e,t,A,r,n,i)},d.Matrix=_e;var Ie=d.matrixMult=function(e,t){return t.multiply(e)},ke=new _e(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=ke;var Te=function(e,t){if(!ye[e]){var A=(t instanceof zi?"Sh":"P")+(Object.keys(be).length+1).toString(10);t.id=A,ye[e]=A,be[A]=t,Ue.publish("addPattern",t)}};d.ShadingPattern=zi,d.TilingPattern=qi,d.addShadingPattern=function(e,t){return F("addShadingPattern()"),Te(e,t),this},d.beginTilingPattern=function(e){F("beginTilingPattern()"),iA(e.boundingBox[0],e.boundingBox[1],e.boundingBox[2]-e.boundingBox[0],e.boundingBox[3]-e.boundingBox[1],e.matrix)},d.endTilingPattern=function(e,t){F("endTilingPattern()"),t.stream=q[D].join("\n"),Te(e,t),Ue.publish("endTilingPattern",t),Le.pop().restore()};var He,Oe=d.__private__.newObject=function(){var e=Pe();return De(e,!0),e},Pe=d.__private__.newObjectDeferred=function(){return R++,V[R]=function(){return G},R},De=function(e,t){return t="boolean"==typeof t&&t,V[e]=G,t&&J(e+" 0 obj"),e},Me=d.__private__.newAdditionalObject=function(){var e={objId:Pe(),content:""};return z.push(e),e},je=Pe(),Re=Pe(),Ve=d.__private__.decodeColorString=function(e){var t=e.split(" ");if(2!==t.length||"g"!==t[1]&&"G"!==t[1])5!==t.length||"k"!==t[4]&&"K"!==t[4]||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),"r"]);else{var A=parseFloat(t[0]);t=[A,A,A,"r"]}for(var r="#",n=0;n<3;n++)r+=("0"+Math.floor(255*parseFloat(t[n])).toString(16)).slice(-2);return r},Ke=d.__private__.encodeColorString=function(e){var t;"string"==typeof e&&(e={ch1:e});var A=e.ch1,r=e.ch2,n=e.ch3,i=e.ch4,s="draw"===e.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof A&&"#"!==A.charAt(0)){var a=new vi(A);if(a.ok)A=a.toHex();else if(!/^\d*\.?\d*$/.test(A))throw new Error('Invalid color "'+A+'" passed to jsPDF.encodeColorString.')}if("string"==typeof A&&/^#[0-9A-Fa-f]{3}$/.test(A)&&(A="#"+A[1]+A[1]+A[2]+A[2]+A[3]+A[3]),"string"==typeof A&&/^#[0-9A-Fa-f]{6}$/.test(A)){var o=parseInt(A.substr(1),16);A=o>>16&255,r=o>>8&255,n=255&o}if(void 0===r||void 0===i&&A===r&&r===n)t="string"==typeof A?A+" "+s[0]:2===e.precision?U(A/255)+" "+s[0]:S(A/255)+" "+s[0];else if(void 0===i||"object"===pe(i)){if(i&&!isNaN(i.a)&&0===i.a)return["1.","1.","1.",s[1]].join(" ");t="string"==typeof A?[A,r,n,s[1]].join(" "):2===e.precision?[U(A/255),U(r/255),U(n/255),s[1]].join(" "):[S(A/255),S(r/255),S(n/255),s[1]].join(" ")}else t="string"==typeof A?[A,r,n,i,s[2]].join(" "):2===e.precision?[U(A),U(r),U(n),U(i),s[2]].join(" "):[S(A),S(r),S(n),S(i),s[2]].join(" ");return t},Ge=d.__private__.getFilters=function(){return s},ze=d.__private__.putStream=function(e){var t=(e=e||{}).data||"",A=e.filters||Ge(),r=e.alreadyAppliedFilters||[],n=e.addLength1||!1,i=t.length,s=e.objectId,a=function(e){return e};if(null!==c&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==c&&(a=Bt.encryptor(s,0));var o={};!0===A&&(A=["FlateEncode"]);var l=e.additionalKeyValues||[],u=(o=void 0!==Wi.API.processDataByFilters?Wi.API.processDataByFilters(t,A):{data:t,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==o.data.length&&(l.push({key:"Length",value:o.data.length}),!0===n&&l.push({key:"Length1",value:i})),0!=u.length)if(u.split("/").length-1==1)l.push({key:"Filter",value:u});else{l.push({key:"Filter",value:"["+u+"]"});for(var h=0;h<l.length;h+=1)if("DecodeParms"===l[h].key){for(var d=[],f=0;f<o.reverseChain.split("/").length-1;f+=1)d.push("null");d.push(l[h].value),l[h].value="["+d.join(" ")+"]"}}J("<<");for(var p=0;p<l.length;p++)J("/"+l[p].key+" "+l[p].value);J(">>"),0!==o.data.length&&(J("stream"),J(a(o.data)),J("endstream"))},qe=d.__private__.putPage=function(e){var t=e.number,A=e.data,r=e.objId,n=e.contentsObjId;De(r,!0),J("<</Type /Page"),J("/Parent "+e.rootDictionaryObjId+" 0 R"),J("/Resources "+e.resourceDictionaryObjId+" 0 R"),J("/MediaBox ["+parseFloat(x(e.mediaBox.bottomLeftX))+" "+parseFloat(x(e.mediaBox.bottomLeftY))+" "+x(e.mediaBox.topRightX)+" "+x(e.mediaBox.topRightY)+"]"),null!==e.cropBox&&J("/CropBox ["+x(e.cropBox.bottomLeftX)+" "+x(e.cropBox.bottomLeftY)+" "+x(e.cropBox.topRightX)+" "+x(e.cropBox.topRightY)+"]"),null!==e.bleedBox&&J("/BleedBox ["+x(e.bleedBox.bottomLeftX)+" "+x(e.bleedBox.bottomLeftY)+" "+x(e.bleedBox.topRightX)+" "+x(e.bleedBox.topRightY)+"]"),null!==e.trimBox&&J("/TrimBox ["+x(e.trimBox.bottomLeftX)+" "+x(e.trimBox.bottomLeftY)+" "+x(e.trimBox.topRightX)+" "+x(e.trimBox.topRightY)+"]"),null!==e.artBox&&J("/ArtBox ["+x(e.artBox.bottomLeftX)+" "+x(e.artBox.bottomLeftY)+" "+x(e.artBox.topRightX)+" "+x(e.artBox.topRightY)+"]"),"number"==typeof e.userUnit&&1!==e.userUnit&&J("/UserUnit "+e.userUnit),Ue.publish("putPage",{objId:r,pageContext:Qe[t],pageNumber:t,page:A}),J("/Contents "+n+" 0 R"),J(">>"),J("endobj");var i=A.join("\n");return b===B&&(i+="\nQ"),De(n,!0),ze({data:i,filters:Ge(),objectId:n}),J("endobj"),r},We=d.__private__.putPages=function(){var e,t,A=[];for(e=1;e<=Fe;e++)Qe[e].objId=Pe(),Qe[e].contentsObjId=Pe();for(e=1;e<=Fe;e++)A.push(qe({number:e,data:q[e],objId:Qe[e].objId,contentsObjId:Qe[e].contentsObjId,mediaBox:Qe[e].mediaBox,cropBox:Qe[e].cropBox,bleedBox:Qe[e].bleedBox,trimBox:Qe[e].trimBox,artBox:Qe[e].artBox,userUnit:Qe[e].userUnit,rootDictionaryObjId:je,resourceDictionaryObjId:Re}));De(je,!0),J("<</Type /Pages");var r="/Kids [";for(t=0;t<Fe;t++)r+=A[t]+" 0 R ";J(r+"]"),J("/Count "+Fe),J(">>"),J("endobj"),Ue.publish("postPutPages")},Xe=function(e){Ue.publish("putFont",{font:e,out:J,newObject:Oe,putStream:ze}),!0!==e.isAlreadyPutted&&(e.objectNumber=Oe(),J("<<"),J("/Type /Font"),J("/BaseFont /"+Ri(e.postScriptName)),J("/Subtype /Type1"),"string"==typeof e.encoding&&J("/Encoding /"+e.encoding),J("/FirstChar 32"),J("/LastChar 255"),J(">>"),J("endobj"))},Ye=function(e){e.objectNumber=Oe();var t=[];t.push({key:"Type",value:"/XObject"}),t.push({key:"Subtype",value:"/Form"}),t.push({key:"BBox",value:"["+[x(e.x),x(e.y),x(e.x+e.width),x(e.y+e.height)].join(" ")+"]"}),t.push({key:"Matrix",value:"["+e.matrix.toString()+"]"});var A=e.pages[1].join("\n");ze({data:A,additionalKeyValues:t,objectId:e.objectNumber}),J("endobj")},Je=function(e,t){t||(t=21);var A=Oe(),r=function(e,t){var A,r=[],n=1/(t-1);for(A=0;A<1;A+=n)r.push(A);if(r.push(1),0!=e[0].offset){var i={offset:0,color:e[0].color};e.unshift(i)}if(1!=e[e.length-1].offset){var s={offset:1,color:e[e.length-1].color};e.push(s)}for(var a="",o=0,l=0;l<r.length;l++){for(A=r[l];A>e[o+1].offset;)o++;var c=e[o].offset,u=(A-c)/(e[o+1].offset-c),h=e[o].color,d=e[o+1].color;a+=j(Math.round((1-u)*h[0]+u*d[0]).toString(16))+j(Math.round((1-u)*h[1]+u*d[1]).toString(16))+j(Math.round((1-u)*h[2]+u*d[2]).toString(16))}return a.trim()}(e.colors,t),n=[];n.push({key:"FunctionType",value:"0"}),n.push({key:"Domain",value:"[0.0 1.0]"}),n.push({key:"Size",value:"["+t+"]"}),n.push({key:"BitsPerSample",value:"8"}),n.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),n.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ze({data:r,additionalKeyValues:n,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:A}),J("endobj"),e.objectNumber=Oe(),J("<< /ShadingType "+e.type),J("/ColorSpace /DeviceRGB");var i="/Coords ["+x(parseFloat(e.coords[0]))+" "+x(parseFloat(e.coords[1]))+" ";2===e.type?i+=x(parseFloat(e.coords[2]))+" "+x(parseFloat(e.coords[3])):i+=x(parseFloat(e.coords[2]))+" "+x(parseFloat(e.coords[3]))+" "+x(parseFloat(e.coords[4]))+" "+x(parseFloat(e.coords[5])),J(i+="]"),e.matrix&&J("/Matrix ["+e.matrix.toString()+"]"),J("/Function "+A+" 0 R"),J("/Extend [true true]"),J(">>"),J("endobj")},$e=function(e,t){var A=Pe(),r=Oe();t.push({resourcesOid:A,objectOid:r}),e.objectNumber=r;var n=[];n.push({key:"Type",value:"/Pattern"}),n.push({key:"PatternType",value:"1"}),n.push({key:"PaintType",value:"1"}),n.push({key:"TilingType",value:"1"}),n.push({key:"BBox",value:"["+e.boundingBox.map(x).join(" ")+"]"}),n.push({key:"XStep",value:x(e.xStep)}),n.push({key:"YStep",value:x(e.yStep)}),n.push({key:"Resources",value:A+" 0 R"}),e.matrix&&n.push({key:"Matrix",value:"["+e.matrix.toString()+"]"}),ze({data:e.stream,additionalKeyValues:n,objectId:e.objectNumber}),J("endobj")},Ze=function(e){for(var t in e.objectNumber=Oe(),J("<<"),e)switch(t){case"opacity":J("/ca "+U(e[t]));break;case"stroke-opacity":J("/CA "+U(e[t]))}J(">>"),J("endobj")},et=function(e){De(e.resourcesOid,!0),J("<<"),J("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var e in J("/Font <<"),me)me.hasOwnProperty(e)&&(!1===u||!0===u&&h.hasOwnProperty(e))&&J("/"+e+" "+me[e].objectNumber+" 0 R");J(">>")}(),function(){if(Object.keys(be).length>0){for(var e in J("/Shading <<"),be)be.hasOwnProperty(e)&&be[e]instanceof zi&&be[e].objectNumber>=0&&J("/"+e+" "+be[e].objectNumber+" 0 R");Ue.publish("putShadingPatternDict"),J(">>")}}(),function(e){if(Object.keys(be).length>0){for(var t in J("/Pattern <<"),be)be.hasOwnProperty(t)&&be[t]instanceof d.TilingPattern&&be[t].objectNumber>=0&&be[t].objectNumber<e&&J("/"+t+" "+be[t].objectNumber+" 0 R");Ue.publish("putTilingPatternDict"),J(">>")}}(e.objectOid),function(){if(Object.keys(ve).length>0){var e;for(e in J("/ExtGState <<"),ve)ve.hasOwnProperty(e)&&ve[e].objectNumber>=0&&J("/"+e+" "+ve[e].objectNumber+" 0 R");Ue.publish("putGStateDict"),J(">>")}}(),function(){for(var e in J("/XObject <<"),Ee)Ee.hasOwnProperty(e)&&Ee[e].objectNumber>=0&&J("/"+e+" "+Ee[e].objectNumber+" 0 R");Ue.publish("putXobjectDict"),J(">>")}(),J(">>"),J("endobj")},tt=function(e){we[e.fontName]=we[e.fontName]||{},we[e.fontName][e.fontStyle]=e.id},At=function(e,t,A,r,n){var i={id:"F"+(Object.keys(me).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:A,encoding:r,isStandardFont:n||!1,metadata:{}};return Ue.publish("addFont",{font:i,instance:this}),me[i.id]=i,tt(i),i.id},rt=d.__private__.pdfEscape=d.pdfEscape=function(e,t){return function(e,t){var A,r,n,i,s,a,o,l,c;if(n=(t=t||{}).sourceEncoding||"Unicode",s=t.outputEncoding,(t.autoencode||s)&&me[ue].metadata&&me[ue].metadata[n]&&me[ue].metadata[n].encoding&&(i=me[ue].metadata[n].encoding,!s&&me[ue].encoding&&(s=me[ue].encoding),!s&&i.codePages&&(s=i.codePages[0]),"string"==typeof s&&(s=i[s]),s)){for(o=!1,a=[],A=0,r=e.length;A<r;A++)(l=s[e.charCodeAt(A)])?a.push(String.fromCharCode(l)):a.push(e[A]),a[A].charCodeAt(0)>>8&&(o=!0);e=a.join("")}for(A=e.length;void 0===o&&0!==A;)e.charCodeAt(A-1)>>8&&(o=!0),A--;if(!o)return e;for(a=t.noBOM?[]:[254,255],A=0,r=e.length;A<r;A++){if((c=(l=e.charCodeAt(A))>>8)>>8)throw new Error("Character at position "+A+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(l-(c<<8))}return String.fromCharCode.apply(void 0,a)}(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},nt=d.__private__.beginPage=function(e){q[++Fe]=[],Qe[Fe]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},at(Fe),Y(q[D])},it=function(e,t){var r,i,s;switch(A=t||A,"string"==typeof e&&(r=m(e.toLowerCase()),Array.isArray(r)&&(i=r[0],s=r[1])),Array.isArray(e)&&(i=e[0]*he,s=e[1]*he),isNaN(i)&&(i=n[0],s=n[1]),(i>14400||s>14400)&&(mi.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),i=Math.min(14400,i),s=Math.min(14400,s)),n=[i,s],A.substr(0,1)){case"l":s>i&&(n=[s,i]);break;case"p":i>s&&(n=[s,i])}nt(n),Dt(Ot),J(qt),0!==Zt&&J(Zt+" J"),0!==eA&&J(eA+" j"),Ue.publish("addPage",{pageNumber:Fe})},st=function(e){e>0&&e<=Fe&&(q.splice(e,1),Qe.splice(e,1),Fe--,D>Fe&&(D=Fe),this.setPage(D))},at=function(e){e>0&&e<=Fe&&(D=e)},ot=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return q.length-1},lt=function(e,t,A){var r,n=void 0;return A=A||{},e=void 0!==e?e:me[ue].fontName,t=void 0!==t?t:me[ue].fontStyle,r=e.toLowerCase(),void 0!==we[r]&&void 0!==we[r][t]?n=we[r][t]:void 0!==we[e]&&void 0!==we[e][t]?n=we[e][t]:!1===A.disableWarning&&mi.warn("Unable to look up font label for font '"+e+"', '"+t+"'. Refer to getFontList() for available fonts."),n||A.noFallback||null==(n=we.times[t])&&(n=we.times.normal),n},ct=d.__private__.putInfo=function(){var e=Oe(),t=function(e){return e};for(var A in null!==c&&(t=Bt.encryptor(e,0)),J("<<"),J("/Producer ("+rt(t("jsPDF "+Wi.version))+")"),ce)ce.hasOwnProperty(A)&&ce[A]&&J("/"+A.substr(0,1).toUpperCase()+A.substr(1)+" ("+rt(t(ce[A]))+")");J("/CreationDate ("+rt(t(L))+")"),J(">>"),J("endobj")},ut=d.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||je;switch(Oe(),J("<<"),J("/Type /Catalog"),J("/Pages "+t+" 0 R"),Ae||(Ae="fullwidth"),Ae){case"fullwidth":J("/OpenAction [3 0 R /FitH null]");break;case"fullheight":J("/OpenAction [3 0 R /FitV null]");break;case"fullpage":J("/OpenAction [3 0 R /Fit]");break;case"original":J("/OpenAction [3 0 R /XYZ null null 1]");break;default:var A=""+Ae;"%"===A.substr(A.length-1)&&(Ae=parseInt(Ae)/100),"number"==typeof Ae&&J("/OpenAction [3 0 R /XYZ null null "+U(Ae)+"]")}switch(ae||(ae="continuous"),ae){case"continuous":J("/PageLayout /OneColumn");break;case"single":J("/PageLayout /SinglePage");break;case"two":case"twoleft":J("/PageLayout /TwoColumnLeft");break;case"tworight":J("/PageLayout /TwoColumnRight")}ie&&J("/PageMode /"+ie),Ue.publish("putCatalog"),J(">>"),J("endobj")},ht=d.__private__.putTrailer=function(){J("trailer"),J("<<"),J("/Size "+(R+1)),J("/Root "+R+" 0 R"),J("/Info "+(R-1)+" 0 R"),null!==c&&J("/Encrypt "+Bt.oid+" 0 R"),J("/ID [ <"+_+"> <"+_+"> ]"),J(">>")},dt=d.__private__.putHeader=function(){J("%PDF-"+f),J("%ºß¬à")},ft=d.__private__.putXRef=function(){var e="0000000000";J("xref"),J("0 "+(R+1)),J("0000000000 65535 f ");for(var t=1;t<=R;t++)"function"==typeof V[t]?J((e+V[t]()).slice(-10)+" 00000 n "):void 0!==V[t]?J((e+V[t]).slice(-10)+" 00000 n "):J("0000000000 00000 n ")},pt=d.__private__.buildDocument=function(){var e;R=0,G=0,K=[],V=[],z=[],je=Pe(),Re=Pe(),Y(K),Ue.publish("buildDocument"),dt(),We(),function(){Ue.publish("putAdditionalObjects");for(var e=0;e<z.length;e++){var t=z[e];De(t.objId,!0),J(t.content),J("endobj")}Ue.publish("postPutAdditionalObjects")}(),e=[],function(){for(var e in me)me.hasOwnProperty(e)&&(!1===u||!0===u&&h.hasOwnProperty(e))&&Xe(me[e])}(),function(){var e;for(e in ve)ve.hasOwnProperty(e)&&Ze(ve[e])}(),function(){for(var e in Ee)Ee.hasOwnProperty(e)&&Ye(Ee[e])}(),function(e){var t;for(t in be)be.hasOwnProperty(t)&&(be[t]instanceof zi?Je(be[t]):be[t]instanceof qi&&$e(be[t],e))}(e),Ue.publish("putResources"),e.forEach(et),et({resourcesOid:Re,objectOid:Number.MAX_SAFE_INTEGER}),Ue.publish("postPutResources"),null!==c&&(Bt.oid=Oe(),J("<<"),J("/Filter /Standard"),J("/V "+Bt.v),J("/R "+Bt.r),J("/U <"+Bt.toHexString(Bt.U)+">"),J("/O <"+Bt.toHexString(Bt.O)+">"),J("/P "+Bt.P),J(">>"),J("endobj")),ct(),ut();var t=G;return ft(),ht(),J("startxref"),J(""+t),J("%%EOF"),Y(q[D]),K.join("\n")},gt=d.__private__.getBlob=function(e){return new Blob([Z(e)],{type:"application/pdf"})},mt=d.output=d.__private__.output=(He=function(e,t){switch("string"==typeof(t=t||{})?t={filename:t}:t.filename=t.filename||"generated.pdf",e){case void 0:return pt();case"save":d.save(t.filename);break;case"arraybuffer":return Z(pt());case"blob":return gt(pt());case"bloburi":case"bloburl":if(void 0!==pi.URL&&"function"==typeof pi.URL.createObjectURL)return pi.URL&&pi.URL.createObjectURL(gt(pt()))||void 0;mi.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var A="",r=pt();try{A=xi(r)}catch(e){A=xi(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+t.filename+";base64,"+A;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(pi)){var n="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",i=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';t.pdfObjectUrl&&(n=t.pdfObjectUrl,i="");var s='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+n+'"'+i+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(t)+");<\/script></body></html>",a=pi.open();return null!==a&&a.document.write(s),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(pi)){var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(t.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+t.filename+'" width="500px" height="400px" /></body></html>',l=pi.open();if(null!==l){l.document.write(o);var c=this;l.document.documentElement.querySelector("#pdfViewer").onload=function(){l.document.title=t.filename,l.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(c.output("bloburl"))}}return l}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(pi))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",t)+'"></iframe></body></html>',h=pi.open();if(null!==h&&(h.document.write(u),h.document.title=t.filename),h||"undefined"==typeof safari)return h;break;case"datauri":case"dataurl":return pi.document.location.href=this.output("datauristring",t);default:return null}},He.foo=function(){try{return He.apply(this,arguments)}catch(A){var e=A.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var t="Error in function "+e.split("\n")[0].split("<")[0]+": "+A.message;if(!pi.console)throw new Error(t);pi.console.error(t,A),pi.alert&&alert(t)}},He.foo.bar=He,He.foo),wt=function(e){return!0===Array.isArray(Se)&&Se.indexOf(e)>-1};switch(r){case"pt":he=1;break;case"mm":he=72/25.4;break;case"cm":he=72/2.54;break;case"in":he=72;break;case"px":he=1==wt("px_scaling")?.75:96/72;break;case"pc":case"em":he=12;break;case"ex":he=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);he=r}var Bt=null;O(),k();var bt=d.__private__.getPageInfo=d.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Qe[e].objId,pageNumber:e,pageContext:Qe[e]}},yt=d.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var t in Qe)if(Qe[t].objId===e)break;return bt(t)},vt=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Qe[D].objId,pageNumber:D,pageContext:Qe[D]}};d.addPage=function(){return it.apply(this,arguments),this},d.setPage=function(){return at.apply(this,arguments),Y.call(this,q[D]),this},d.insertPage=function(e){return this.addPage(),this.movePage(D,e),this},d.movePage=function(e,t){var A,r;if(e>t){A=q[e],r=Qe[e];for(var n=e;n>t;n--)q[n]=q[n-1],Qe[n]=Qe[n-1];q[t]=A,Qe[t]=r,this.setPage(t)}else if(e<t){A=q[e],r=Qe[e];for(var i=e;i<t;i++)q[i]=q[i+1],Qe[i]=Qe[i+1];q[t]=A,Qe[t]=r,this.setPage(t)}return this},d.deletePage=function(){return st.apply(this,arguments),this},d.__private__.text=d.text=function(e,t,A,r,n){var i,s,a,o,l,c,u,d,f,p=(r=r||{}).scope||this;if("number"==typeof e&&"number"==typeof t&&("string"==typeof A||Array.isArray(A))){var g=A;A=t,t=e,e=g}if(arguments[3]instanceof _e==0?(a=arguments[4],o=arguments[5],"object"===pe(u=arguments[3])&&null!==u||("string"==typeof a&&(o=a,a=null),"string"==typeof u&&(o=u,u=null),"number"==typeof u&&(a=u,u=null),r={flags:u,angle:a,align:o})):(F("The transform parameter of text() with a Matrix value"),f=n),isNaN(t)||isNaN(A)||null==e)throw new Error("Invalid arguments passed to jsPDF.text");if(0===e.length)return p;var m,w="",y="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Ht,v=p.internal.scaleFactor;function C(e){return e=e.split("\t").join(Array(r.TabLen||9).join(" ")),rt(e,u)}function Q(e){for(var t,A=e.concat(),r=[],n=A.length;n--;)"string"==typeof(t=A.shift())?r.push(t):Array.isArray(e)&&(1===t.length||void 0===t[1]&&void 0===t[2])?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function U(e,t){var A;if("string"==typeof e)A=t(e)[0];else if(Array.isArray(e)){for(var r,n,i=e.concat(),s=[],a=i.length;a--;)"string"==typeof(r=i.shift())?s.push(t(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(n=t(r[0],r[1],r[2]),s.push([n[0],n[1],n[2]]));A=s}return A}var S=!1,N=!0;if("string"==typeof e)S=!0;else if(Array.isArray(e)){var L=e.concat();s=[];for(var _,I=L.length;I--;)("string"!=typeof(_=L.shift())||Array.isArray(_)&&"string"!=typeof _[0])&&(N=!1);S=N}if(!1===S)throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');"string"==typeof e&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var k=te/p.internal.scaleFactor,T=k*(y-1);switch(r.baseline){case"bottom":A-=T;break;case"top":A+=k-T;break;case"hanging":A+=k-2*T;break;case"middle":A+=k/2-T}if((c=r.maxWidth||0)>0&&("string"==typeof e?e=p.splitTextToSize(e,c):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(p.splitTextToSize(t,c))},[]))),i={text:e,x:t,y:A,options:r,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:me,activeFontSize:te}},Ue.publish("preProcessText",i),e=i.text,a=(r=i.options).angle,f instanceof _e==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),b===B&&(a=-a);var H=Math.cos(a),O=Math.sin(a);f=new _e(H,O,-O,H,0,0)}else a&&a instanceof _e&&(f=a);b!==B||f||(f=ke),void 0!==(l=r.charSpace||Jt)&&(w+=x(E(l))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(w+=x(100*d)+" Tz\n"),r.lang;var P=-1,D=void 0!==r.renderingMode?r.renderingMode:r.stroke,M=p.internal.getCurrentPageInfo().pageContext;switch(D){case 0:case!1:case"fill":P=0;break;case 1:case!0:case"stroke":P=1;break;case 2:case"fillThenStroke":P=2;break;case 3:case"invisible":P=3;break;case 4:case"fillAndAddForClipping":P=4;break;case 5:case"strokeAndAddPathForClipping":P=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":P=6;break;case 7:case"addToPathForClipping":P=7}var j=void 0!==M.usedRenderingMode?M.usedRenderingMode:-1;-1!==P?w+=P+" Tr\n":-1!==j&&(w+="0 Tr\n"),-1!==P&&(M.usedRenderingMode=P),o=r.align||"left";var R,V=te*y,K=p.internal.pageSize.getWidth(),G=me[ue];l=r.charSpace||Jt,c=r.maxWidth||0,u=Object.assign({autoencode:!0,noBOM:!0},r.flags);var z=[],q=function(e){return p.getStringUnitWidth(e,{font:G,charSpace:l,fontSize:te,doKerning:!1})*te/v};if("[object Array]"===Object.prototype.toString.call(e)){var W;s=Q(e),"left"!==o&&(R=s.map(q));var X,Y=0;if("right"===o){t-=R[0],e=[],I=s.length;for(var $=0;$<I;$++)0===$?(X=Vt(t),W=Kt(A)):(X=E(Y-R[$]),W=-V),e.push([s[$],X,W]),Y=R[$]}else if("center"===o){t-=R[0]/2,e=[],I=s.length;for(var Z=0;Z<I;Z++)0===Z?(X=Vt(t),W=Kt(A)):(X=E((Y-R[Z])/2),W=-V),e.push([s[Z],X,W]),Y=R[Z]}else if("left"===o){e=[],I=s.length;for(var ee=0;ee<I;ee++)e.push(s[ee])}else if("justify"===o&&"Identity-H"===G.encoding){e=[],I=s.length,c=0!==c?c:K;for(var Ae=0,re=0;re<I;re++)if(W=0===re?Kt(A):-V,X=0===re?Vt(t):Ae,re<I-1){var ie=E((c-R[re])/(s[re].split(" ").length-1)),se=s[re].split(" ");e.push([se[0]+" ",X,W]),Ae=0;for(var ae=1;ae<se.length;ae++){var oe=(q(se[ae-1]+" "+se[ae])-q(se[ae]))*v+ie;ae==se.length-1?e.push([se[ae],oe,0]):e.push([se[ae]+" ",oe,0]),Ae-=oe}}else e.push([s[re],X,W]);e.push(["",Ae,0])}else{if("justify"!==o)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(e=[],I=s.length,c=0!==c?c:K,re=0;re<I;re++){W=0===re?Kt(A):-V,X=0===re?Vt(t):0;var le=s[re].split(" ").length-1,ce=le>0?(c-R[re])/le:0;re<I-1?z.push(x(E(ce))):z.push(0),e.push([s[re],X,W])}}}!0===("boolean"==typeof r.R2L?r.R2L:ne)&&(e=U(e,function(e,t,A){return[e.split("").reverse().join(""),t,A]})),i={text:e,x:t,y:A,options:r,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:me,activeFontSize:te}},Ue.publish("postProcessText",i),e=i.text,m=i.mutex.isHex||!1;var he=me[ue].encoding;"WinAnsiEncoding"!==he&&"StandardEncoding"!==he||(e=U(e,function(e,t,A){return[C(e),t,A]})),s=Q(e),e=[];for(var de,fe,ge,we=Array.isArray(s[0])?1:0,Be="",be=function(e,t,A){var n="";return A instanceof _e?(A="number"==typeof r.angle?Ie(A,new _e(1,0,0,1,e,t)):Ie(new _e(1,0,0,1,e,t),A),b===B&&(A=Ie(new _e(1,0,0,-1,0,0),A)),n=A.join(" ")+" Tm\n"):n=x(e)+" "+x(t)+" Td\n",n},ye=0;ye<s.length;ye++){switch(Be="",we){case 1:ge=(m?"<":"(")+s[ye][0]+(m?">":")"),de=parseFloat(s[ye][1]),fe=parseFloat(s[ye][2]);break;case 0:ge=(m?"<":"(")+s[ye]+(m?">":")"),de=Vt(t),fe=Kt(A)}void 0!==z&&void 0!==z[ye]&&(Be=z[ye]+" Tw\n"),0===ye?e.push(Be+be(de,fe,f)+ge):0===we?e.push(Be+ge):1===we&&e.push(Be+be(de,fe,f)+ge)}e=0===we?e.join(" Tj\nT* "):e.join(" Tj\n"),e+=" Tj\n";var ve="BT\n/";return ve+=ue+" "+te+" Tf\n",ve+=x(te*y)+" TL\n",ve+=Xt+"\n",ve+=w,ve+=e,J(ve+="ET"),h[ue]=!0,p};var Ct=d.__private__.clip=d.clip=function(e){return J("evenodd"===e?"W*":"W"),this};d.clipEvenOdd=function(){return Ct("evenodd")},d.__private__.discardPath=d.discardPath=function(){return J("n"),this};var xt=d.__private__.isValidStyle=function(e){var t=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(e)&&(t=!0),t};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(e){return xt(e)&&(l=e),this};var Ft=d.__private__.getStyle=d.getStyle=function(e){var t=l;switch(e){case"D":case"S":t="S";break;case"F":t="f";break;case"FD":case"DF":t="B";break;case"f":case"f*":case"B":case"B*":t=e}return t},Qt=d.close=function(){return J("h"),this};d.stroke=function(){return J("S"),this},d.fill=function(e){return Ut("f",e),this},d.fillEvenOdd=function(e){return Ut("f*",e),this},d.fillStroke=function(e){return Ut("B",e),this},d.fillStrokeEvenOdd=function(e){return Ut("B*",e),this};var Ut=function(e,t){"object"===pe(t)?Nt(t,e):J(e)},St=function(e){null===e||b===B&&void 0===e||(e=Ft(e),J(e))};function Et(e,t,A,r,n){var i=new qi(t||this.boundingBox,A||this.xStep,r||this.yStep,this.gState,n||this.matrix);i.stream=this.stream;var s=e+"$$"+this.cloneIndex+++"$$";return Te(s,i),i}var Nt=function(e,t){var A=ye[e.key],r=be[A];if(r instanceof zi)J("q"),J(Lt(t)),r.gState&&d.setGState(r.gState),J(e.matrix.toString()+" cm"),J("/"+A+" sh"),J("Q");else if(r instanceof qi){var n=new _e(1,0,0,-1,0,dA());e.matrix&&(n=n.multiply(e.matrix||ke),A=Et.call(r,e.key,e.boundingBox,e.xStep,e.yStep,n).id),J("q"),J("/Pattern cs"),J("/"+A+" scn"),r.gState&&d.setGState(r.gState),J(t),J("Q")}},Lt=function(e){switch(e){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},_t=d.moveTo=function(e,t){return J(x(E(e))+" "+x(N(t))+" m"),this},It=d.lineTo=function(e,t){return J(x(E(e))+" "+x(N(t))+" l"),this},kt=d.curveTo=function(e,t,A,r,n,i){return J([x(E(e)),x(N(t)),x(E(A)),x(N(r)),x(E(n)),x(N(i)),"c"].join(" ")),this};d.__private__.line=d.line=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.line");return b===w?this.lines([[A-e,r-t]],e,t,[1,1],n||"S"):this.lines([[A-e,r-t]],e,t,[1,1]).stroke()},d.__private__.lines=d.lines=function(e,t,A,r,n,i){var s,a,o,l,c,u,h,d,f,p,g,m;if("number"==typeof e&&(m=A,A=t,t=e,e=m),r=r||[1,1],i=i||!1,isNaN(t)||isNaN(A)||!Array.isArray(e)||!Array.isArray(r)||!xt(n)||"boolean"!=typeof i)throw new Error("Invalid arguments passed to jsPDF.lines");for(_t(t,A),s=r[0],a=r[1],l=e.length,p=t,g=A,o=0;o<l;o++)2===(c=e[o]).length?(p=c[0]*s+p,g=c[1]*a+g,It(p,g)):(u=c[0]*s+p,h=c[1]*a+g,d=c[2]*s+p,f=c[3]*a+g,p=c[4]*s+p,g=c[5]*a+g,kt(u,h,d,f,p,g));return i&&Qt(),St(n),this},d.path=function(e){for(var t=0;t<e.length;t++){var A=e[t],r=A.c;switch(A.op){case"m":_t(r[0],r[1]);break;case"l":It(r[0],r[1]);break;case"c":kt.apply(this,r);break;case"h":Qt()}}return this},d.__private__.rect=d.rect=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.rect");return b===w&&(r=-r),J([x(E(e)),x(N(t)),x(E(A)),x(E(r)),"re"].join(" ")),St(n),this},d.__private__.triangle=d.triangle=function(e,t,A,r,n,i,s){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[A-e,r-t],[n-A,i-r],[e-n,t-i]],e,t,[1,1],s,!0),this},d.__private__.roundedRect=d.roundedRect=function(e,t,A,r,n,i,s){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return n=Math.min(n,.5*A),i=Math.min(i,.5*r),this.lines([[A-2*n,0],[n*a,0,n,i-i*a,n,i],[0,r-2*i],[0,i*a,-n*a,i,-n,i],[2*n-A,0],[-n*a,0,-n,-i*a,-n,-i],[0,2*i-r],[0,-i*a,n*a,-i,n,-i]],e+n,t,[1,1],s,!0),this},d.__private__.ellipse=d.ellipse=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.ellipse");var i=4/3*(Math.SQRT2-1)*A,s=4/3*(Math.SQRT2-1)*r;return _t(e+A,t),kt(e+A,t-s,e+i,t-r,e,t-r),kt(e-i,t-r,e-A,t-s,e-A,t),kt(e-A,t+s,e-i,t+r,e,t+r),kt(e+i,t+r,e+A,t+s,e+A,t),St(n),this},d.__private__.circle=d.circle=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||!xt(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(e,t,A,A,r)},d.setFont=function(e,t,A){return A&&(t=C(t,A)),ue=lt(e,t,{disableWarning:!1}),this};var Tt=d.__private__.getFont=d.getFont=function(){return me[lt.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var e,t,A={};for(e in we)if(we.hasOwnProperty(e))for(t in A[e]=[],we[e])we[e].hasOwnProperty(t)&&A[e].push(t);return A},d.addFont=function(e,t,A,r,n){var i=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==i.indexOf(arguments[3])?n=arguments[3]:arguments[3]&&-1==i.indexOf(arguments[3])&&(A=C(A,r)),At.call(this,e,t,A,n=n||"Identity-H")};var Ht,Ot=e.lineWidth||.200025,Pt=d.__private__.getLineWidth=d.getLineWidth=function(){return Ot},Dt=d.__private__.setLineWidth=d.setLineWidth=function(e){return Ot=e,J(x(E(e))+" w"),this};d.__private__.setLineDash=Wi.API.setLineDash=Wi.API.setLineDashPattern=function(e,t){if(e=e||[],t=t||0,isNaN(t)||!Array.isArray(e))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return e=e.map(function(e){return x(E(e))}).join(" "),t=x(E(t)),J("["+e+"] "+t+" d"),this};var Mt=d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ht};d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ht};var jt=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(e){return"number"==typeof(e=e||1.15)&&(Ht=e),this},Rt=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Ht};jt(e.lineHeight);var Vt=d.__private__.getHorizontalCoordinate=function(e){return E(e)},Kt=d.__private__.getVerticalCoordinate=function(e){return b===B?e:Qe[D].mediaBox.topRightY-Qe[D].mediaBox.bottomLeftY-E(e)},Gt=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(e){return x(Vt(e))},zt=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(e){return x(Kt(e))},qt=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Ve(qt)},d.__private__.setStrokeColor=d.setDrawColor=function(e,t,A,r){return qt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"draw",precision:2}),J(qt),this};var Wt=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Ve(Wt)},d.__private__.setFillColor=d.setFillColor=function(e,t,A,r){return Wt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"fill",precision:2}),J(Wt),this};var Xt=e.textColor||"0 g",Yt=d.__private__.getTextColor=d.getTextColor=function(){return Ve(Xt)};d.__private__.setTextColor=d.setTextColor=function(e,t,A,r){return Xt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"text",precision:3}),this};var Jt=e.charSpace,$t=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(Jt||0)};d.__private__.setCharSpace=d.setCharSpace=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Jt=e,this};var Zt=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Zt=t,J(t+" J"),this};var eA=0;d.__private__.setLineJoin=d.setLineJoin=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return eA=t,J(t+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(e){if(e=e||0,isNaN(e))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return J(x(E(e))+" M"),this},d.GState=Ki,d.setGState=function(e){(e="string"==typeof e?ve[Ce[e]]:tA(null,e)).equals(xe)||(J("/"+e.id+" gs"),xe=e)};var tA=function(e,t){if(!e||!Ce[e]){var A=!1;for(var r in ve)if(ve.hasOwnProperty(r)&&ve[r].equals(t)){A=!0;break}if(A)t=ve[r];else{var n="GS"+(Object.keys(ve).length+1).toString(10);ve[n]=t,t.id=n}return e&&(Ce[e]=t.id),Ue.publish("addGState",t),t}};d.addGState=function(e,t){return tA(e,t),this},d.saveGraphicsState=function(){return J("q"),Be.push({key:ue,size:te,color:Xt}),this},d.restoreGraphicsState=function(){J("Q");var e=Be.pop();return ue=e.key,te=e.size,Xt=e.color,xe=null,this},d.setCurrentTransformationMatrix=function(e){return J(e.toString()+" cm"),this},d.comment=function(e){return J("#"+e),this};var AA=function(e,t){var A=e||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return A},set:function(e){isNaN(e)||(A=parseFloat(e))}});var r=t||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(e){isNaN(e)||(r=parseFloat(e))}});var n="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return n},set:function(e){n=e.toString()}}),this},rA=function(e,t,A,r){AA.call(this,e,t),this.type="rect";var n=A||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return n},set:function(e){isNaN(e)||(n=parseFloat(e))}});var i=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return i},set:function(e){isNaN(e)||(i=parseFloat(e))}}),this},nA=function(){this.page=Fe,this.currentPage=D,this.pages=q.slice(0),this.pagesContext=Qe.slice(0),this.x=de,this.y=fe,this.matrix=ge,this.width=aA(D),this.height=lA(D),this.outputDestination=X,this.id="",this.objectNumber=-1};nA.prototype.restore=function(){Fe=this.page,D=this.currentPage,Qe=this.pagesContext,q=this.pages,de=this.x,fe=this.y,ge=this.matrix,oA(D,this.width),cA(D,this.height),X=this.outputDestination};var iA=function(e,t,A,r,n){Le.push(new nA),Fe=D=0,q=[],de=e,fe=t,ge=n,nt([A,r])};for(var sA in d.beginFormObject=function(e,t,A,r,n){return iA(e,t,A,r,n),this},d.endFormObject=function(e){return function(e){if(Ne[e])Le.pop().restore();else{var t=new nA,A="Xo"+(Object.keys(Ee).length+1).toString(10);t.id=A,Ne[e]=A,Ee[A]=t,Ue.publish("addFormObject",t),Le.pop().restore()}}(e),this},d.doFormObject=function(e,t){var A=Ee[Ne[e]];return J("q"),J(t.toString()+" cm"),J("/"+A.id+" Do"),J("Q"),this},d.getFormObject=function(e){var t=Ee[Ne[e]];return{x:t.x,y:t.y,width:t.width,height:t.height,matrix:t.matrix}},d.save=function(e,t){return e=e||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1===t.returnPromise?(yi(gt(pt()),e),"function"==typeof yi.unload&&pi.setTimeout&&setTimeout(yi.unload,911),this):new Promise(function(t,A){try{var r=yi(gt(pt()),e);"function"==typeof yi.unload&&pi.setTimeout&&setTimeout(yi.unload,911),t(r)}catch(e){A(e.message)}})},Wi.API)Wi.API.hasOwnProperty(sA)&&("events"===sA&&Wi.API.events.length?function(e,t){var A,r,n;for(n=t.length-1;-1!==n;n--)A=t[n][0],r=t[n][1],e.subscribe.apply(e,[A].concat("function"==typeof r?[r]:r))}(Ue,Wi.API.events):d[sA]=Wi.API[sA]);function aA(e){return Qe[e].mediaBox.topRightX-Qe[e].mediaBox.bottomLeftX}function oA(e,t){Qe[e].mediaBox.topRightX=t+Qe[e].mediaBox.bottomLeftX}function lA(e){return Qe[e].mediaBox.topRightY-Qe[e].mediaBox.bottomLeftY}function cA(e,t){Qe[e].mediaBox.topRightY=t+Qe[e].mediaBox.bottomLeftY}var uA=d.getPageWidth=function(e){return aA(e=e||D)/he},hA=d.setPageWidth=function(e,t){oA(e,t*he)},dA=d.getPageHeight=function(e){return lA(e=e||D)/he},fA=d.setPageHeight=function(e,t){cA(e,t*he)};return d.internal={pdfEscape:rt,getStyle:Ft,getFont:Tt,getFontSize:re,getCharSpace:$t,getTextColor:Yt,getLineHeight:Mt,getLineHeightFactor:Rt,getLineWidth:Pt,write:$,getHorizontalCoordinate:Vt,getVerticalCoordinate:Kt,getCoordinateString:Gt,getVerticalCoordinateString:zt,collections:{},newObject:Oe,newAdditionalObject:Me,newObjectDeferred:Pe,newObjectDeferredBegin:De,getFilters:Ge,putStream:ze,events:Ue,scaleFactor:he,pageSize:{getWidth:function(){return uA(D)},setWidth:function(e){hA(D,e)},getHeight:function(){return dA(D)},setHeight:function(e){fA(D,e)}},encryptionOptions:c,encryption:Bt,getEncryptor:function(e){return null!==c?Bt.encryptor(e,0):function(e){return e}},output:mt,getNumberOfPages:ot,get pages(){return q},out:J,f2:U,f3:S,getPageInfo:bt,getPageInfoByObjId:yt,getCurrentPageInfo:vt,getPDFVersion:p,Point:AA,Rectangle:rA,Matrix:_e,hasHotfix:wt},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return uA(D)},set:function(e){hA(D,e)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return dA(D)},set:function(e){fA(D,e)},enumerable:!0,configurable:!0}),function(e){for(var t=0,A=ee.length;t<A;t++){var r=At.call(this,e[t][0],e[t][1],e[t][2],ee[t][3],!0);!1===u&&(h[r]=!0);var n=e[t][0].split("-");tt({id:r,fontName:n[0],fontStyle:n[1]||""})}Ue.publish("addFonts",{fonts:me,dictionary:we})}.call(d,ee),ue="F1",it(n,A),Ue.publish("initialized"),d}ji.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},ji.prototype.toHexString=function(e){return e.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},ji.prototype.hexToBytes=function(e){for(var t=[],A=0;A<e.length;A+=2)t.push(String.fromCharCode(parseInt(e.substr(A,2),16)));return t.join("")},ji.prototype.processOwnerPassword=function(e,t){return Di(Hi(t).substr(0,5),e)},ji.prototype.encryptor=function(e,t){var A=Hi(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return Di(A,e)}},Ki.prototype.equals=function(e){var t,A="id,objectNumber,equals";if(!e||pe(e)!==pe(this))return!1;var r=0;for(t in this)if(!(A.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t))return!1;if(this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&A.indexOf(t)<0&&r--;return 0===r},Wi.API={events:[]},Wi.version="4.0.0";var Xi=Wi.API,Yi=1,Ji=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},$i=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Zi=function(e){return e.toFixed(2)},es=function(e){return e.toFixed(5)};Xi.__acroform__={};var ts=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},As=function(e){return e*Yi},rs=function(e){var t=new Bs,A=Is.internal.getHeight(e)||0,r=Is.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Zi(r)),Number(Zi(A))],t},ns=Xi.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},is=Xi.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},ss=Xi.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},as=Xi.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return ss(e,t-1)},os=Xi.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return ns(e,t-1)},ls=Xi.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return is(e,t-1)},cs=Xi.__acroform__.calculateCoordinates=function(e,t){var A=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,n=e[0],i=e[1],s=e[2],a=e[3],o={};return o.lowerLeft_X=A(n)||0,o.lowerLeft_Y=r(i+a)||0,o.upperRight_X=A(n+s)||0,o.upperRight_Y=r(i)||0,[Number(Zi(o.lowerLeft_X)),Number(Zi(o.lowerLeft_Y)),Number(Zi(o.upperRight_X)),Number(Zi(o.upperRight_Y))]},us=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],A=e._V||e.DV,r=hs(e,A),n=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+n+" "+Zi(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var i=rs(e);return i.scope=e.scope,i.stream=t.join("\n"),i}},hs=function(e,t){var A=0===e.fontSize?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},n=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" ");n=e.multiline?n.map(function(e){return e.split("\n")}):n.map(function(e){return[e]});var i=A,s=Is.internal.getHeight(e)||0;s=s<0?-s:s;var a=Is.internal.getWidth(e)||0;a=a<0?-a:a;var o=function(t,A,r){if(t+1<n.length){var i=A+" "+n[t+1][0];return ds(i,e,r).width<=a-4}return!1};i++;e:for(;i>0;){t="",i--;var l,c,u=ds("3",e,i).height,h=e.multiline?s-i:(s-u)/2,d=h+=2,f=0,p=0,g=0;if(i<=0){t="(...) Tj\n",t+="% Width of Text: "+ds(t,e,i=12).width+", FieldWidth:"+a+"\n";break}for(var m="",w=0,B=0;B<n.length;B++)if(n.hasOwnProperty(B)){var b=!1;if(1!==n[B].length&&g!==n[B].length-1){if((u+2)*(w+2)+2>s)continue e;m+=n[B][g],b=!0,p=B,B--}else{m=" "==(m+=n[B][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var y=parseInt(B),v=o(y,m,i),C=B>=n.length-1;if(v&&!C){m+=" ",g=0;continue}if(v||C){if(C)p=y;else if(e.multiline&&(u+2)*(w+2)+2>s)continue e}else{if(!e.multiline)continue e;if((u+2)*(w+2)+2>s)continue e;p=y}}for(var x="",F=f;F<=p;F++){var Q=n[F];if(e.multiline){if(F===p){x+=Q[g]+" ",g=(g+1)%Q.length;continue}if(F===f){x+=Q[Q.length-1]+" ";continue}}x+=Q[0]+" "}switch(x=" "==x.substr(x.length-1)?x.substr(0,x.length-1):x,c=ds(x,e,i).width,e.textAlign){case"right":l=a-c-2;break;case"center":l=(a-c)/2;break;default:l=2}t+=Zi(l)+" "+Zi(d)+" Td\n",t+="("+Ji(x)+") Tj\n",t+=-Zi(l)+" 0 Td\n",d=-(i+2),c=0,f=b?p:p+1,w++,m=""}break}return r.text=t,r.fontSize=i,r},ds=function(e,t,A){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),n=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(A),charSpace:0})*parseFloat(A);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(A),charSpace:0})*parseFloat(A)*1.5,width:n}},fs={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},ps=function(e,t){var A={type:"reference",object:e};void 0===t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===A.type&&e.object===A.object})&&t.internal.getPageInfo(e.page).pageContext.annotations.push(A)},gs=Xi.__acroform__.arrayToPdfArray=function(e,t,A){var r=function(e){return e};if(Array.isArray(e)){for(var n="[",i=0;i<e.length;i++)switch(0!==i&&(n+=" "),pe(e[i])){case"boolean":case"number":case"object":n+=e[i].toString();break;case"string":"/"!==e[i].substr(0,1)?(void 0!==t&&A&&(r=A.internal.getEncryptor(t)),n+="("+Ji(r(e[i].toString()))+")"):n+=e[i].toString()}return n+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},ms=function(e,t,A){var r=function(e){return e};return void 0!==t&&A&&(r=A.internal.getEncryptor(t)),(e=e||"").toString(),"("+Ji(r(e))+")"},ws=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};ws.prototype.toString=function(){return this.objId+" 0 R"},ws.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},ws.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return"content"!=e&&"appearanceStreamContent"!=e&&"scope"!=e&&"objId"!=e&&"_"!=e.substring(0,1)});for(var A in t)if(!1===Object.getOwnPropertyDescriptor(this,t[A]).configurable){var r=t[A],n=this[r];n&&(Array.isArray(n)?e.push({key:r,value:gs(n,this.objId,this.scope)}):n instanceof ws?(n.scope=this.scope,e.push({key:r,value:n.objId+" 0 R"})):"function"!=typeof n&&e.push({key:r,value:n}))}return e};var Bs=function(){ws.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};ts(Bs,ws);var bs=function(){ws.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Ji(t(e))+")"}},set:function(t){e=t}})};ts(bs,ws);var ys=function e(){ws.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(t,3))},set:function(e){!0===Boolean(e)?this.F=os(t,3):this.F=ls(t,3)}});var A=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return A},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute Ff supplied.');A=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(e){r=void 0!==e?e:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var n="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){switch(e){case"/Btn":case"/Tx":case"/Ch":case"/Sig":n=e;break;default:throw new Error('Invalid value "'+e+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof Es)return;i="FieldObject"+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Ji(t(i))+")"},set:function(e){i=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(e){i=e}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(e){a=e}});var o=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return o},set:function(e){o=e}});var l=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===l?50/Yi:l},set:function(e){l=e}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(e){c=e}});var u="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!u||this instanceof Es||this instanceof Ls))return ms(u,this.objId,this.scope)},set:function(e){e=e.toString(),u=e}});var h=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof Qs==0?ms(h,this.objId,this.scope):h},set:function(e){e=e.toString(),h=this instanceof Qs==0?"("===e.substr(0,1)?$i(e.substr(1,e.length-2)):$i(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Qs==1?$i(h.substr(1,h.length-1)):h},set:function(e){e=e.toString(),h=this instanceof Qs==1?"/"+e:e}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Qs==0?ms(d,this.objId,this.scope):d},set:function(e){e=e.toString(),d=this instanceof Qs==0?"("===e.substr(0,1)?$i(e.substr(1,e.length-2)):$i(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Qs==1?$i(d.substr(1,d.length-1)):d},set:function(e){e=e.toString(),d=this instanceof Qs==1?"/"+e:e}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var f,p=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return p},set:function(e){e=Boolean(e),p=e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(f)return f},set:function(e){f=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,1))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,1):this.Ff=ls(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,2))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,2):this.Ff=ls(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,3))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,3):this.Ff=ls(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(e){if(-1===[0,1,2].indexOf(e))throw new Error('Invalid value "'+e+'" for attribute Q supplied.');g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e="left";break;case 1:e="center";break;case 2:e="right"}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};ts(ys,ws);var vs=function(){ys.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return gs(t,this.objId,this.scope)},set:function(e){var A,r;r=[],"string"==typeof(A=e)&&(r=function(e,t,A){A||(A=1);for(var r,n=[];r=t.exec(e);)n.push(r[A]);return n}(A,/\((.*?)\)/g)),t=r}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||"").toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,A){for(A=A||!1,e=(e=e||"").toString();-1!==t.indexOf(e)&&(t.splice(t.indexOf(e),1),!1!==A););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,18))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,18):this.Ff=ls(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,19))},set:function(e){!0===this.combo&&(!0===Boolean(e)?this.Ff=os(this.Ff,19):this.Ff=ls(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,20))},set:function(e){!0===Boolean(e)?(this.Ff=os(this.Ff,20),t.sort()):this.Ff=ls(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,22))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,22):this.Ff=ls(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,23):this.Ff=ls(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,27))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,27):this.Ff=ls(this.Ff,27)}}),this.hasAppearanceStream=!1};ts(vs,ys);var Cs=function(){vs.call(this),this.fontName="helvetica",this.combo=!1};ts(Cs,vs);var xs=function(){Cs.call(this),this.combo=!0};ts(xs,Cs);var Fs=function(){xs.call(this),this.edit=!0};ts(Fs,xs);var Qs=function(){ys.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,15))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,15):this.Ff=ls(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,16))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,16):this.Ff=ls(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,17))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,17):this.Ff=ls(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,26):this.Ff=ls(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(t).length){var A,r=[];for(A in r.push("<<"),t)r.push("/"+A+" ("+Ji(e(t[A]))+")");return r.push(">>"),r.join("\n")}},set:function(e){"object"===pe(e)&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};ts(Qs,ys);var Us=function(){Qs.call(this),this.pushButton=!0};ts(Us,Qs);var Ss=function(){Qs.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};ts(Ss,Qs);var Es=function(){var e,t;ys.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var A,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,A=[];for(t in A.push("<<"),r)A.push("/"+t+" ("+Ji(e(r[t]))+")");return A.push(">>"),A.join("\n")},set:function(e){"object"===pe(e)&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(e){"string"==typeof e&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return A},set:function(e){A=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return A.substr(1,A.length-1)},set:function(e){A="/"+e}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Is.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ts(Es,ys),Ss.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var A=this.Kids[t];A.appearanceStreamContent=e.createAppearanceStream(A.optionName),A.caption=e.getCA()}},Ss.prototype.createOption=function(e){var t=new Es;return t.Parent=this,t.optionName=e,this.Kids.push(t),ks.call(this.scope,t),t};var Ns=function(){Qs.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Is.CheckBox.createAppearanceStream()};ts(Ns,Qs);var Ls=function(){ys.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,13))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,13):this.Ff=ls(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,21))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,21):this.Ff=ls(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,23):this.Ff=ls(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,24))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,24):this.Ff=ls(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,25))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,25):this.Ff=ls(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,26):this.Ff=ls(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ts(Ls,ys);var _s=function(){Ls.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,14))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,14):this.Ff=ls(this.Ff,14)}}),this.password=!0};ts(_s,Ls);var Is={CheckBox:{createAppearanceStream:function(){return{N:{On:Is.CheckBox.YesNormal},D:{On:Is.CheckBox.YesPushDown,Off:Is.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),i=hs(e,e.caption);return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),A.push("BMC"),A.push("q"),A.push("0 0 1 rg"),A.push("/"+r+" "+Zi(i.fontSize)+" Tf "+n),A.push("BT"),A.push(i.text),A.push("ET"),A.push("Q"),A.push("EMC"),t.stream=A.join("\n"),t},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),n=[],i=Is.internal.getHeight(e),s=Is.internal.getWidth(e),a=hs(e,e.caption);return n.push("1 g"),n.push("0 0 "+Zi(s)+" "+Zi(i)+" re"),n.push("f"),n.push("q"),n.push("0 0 1 rg"),n.push("0 0 "+Zi(s-1)+" "+Zi(i-1)+" re"),n.push("W"),n.push("n"),n.push("0 g"),n.push("BT"),n.push("/"+A+" "+Zi(a.fontSize)+" Tf "+r),n.push(a.text),n.push("ET"),n.push("Q"),t.stream=n.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[];return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),t.stream=A.join("\n"),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Is.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Is.RadioButton.Circle.YesNormal,t.D[e]=Is.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Is.internal.Bezier_C,i=Number((r*n).toFixed(5));return A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(r+" 0 m"),A.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),A.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),A.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),A.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Number((2*r).toFixed(5)),i=Number((n*Is.internal.Bezier_C).toFixed(5)),s=Number((r*Is.internal.Bezier_C).toFixed(5));return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),A.push("0 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(r+" 0 m"),A.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),A.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),A.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),A.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Number((2*r).toFixed(5)),i=Number((n*Is.internal.Bezier_C).toFixed(5));return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Is.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Is.RadioButton.Cross.YesNormal,t.D[e]=Is.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.calculateCross(e);return A.push("q"),A.push("1 1 "+Zi(Is.internal.getWidth(e)-2)+" "+Zi(Is.internal.getHeight(e)-2)+" re"),A.push("W"),A.push("n"),A.push(Zi(r.x1.x)+" "+Zi(r.x1.y)+" m"),A.push(Zi(r.x2.x)+" "+Zi(r.x2.y)+" l"),A.push(Zi(r.x4.x)+" "+Zi(r.x4.y)+" m"),A.push(Zi(r.x3.x)+" "+Zi(r.x3.y)+" l"),A.push("s"),A.push("Q"),t.stream=A.join("\n"),t},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=Is.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Zi(Is.internal.getWidth(e)-2)+" "+Zi(Is.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Zi(A.x1.x)+" "+Zi(A.x1.y)+" m"),r.push(Zi(A.x2.x)+" "+Zi(A.x2.y)+" l"),r.push(Zi(A.x4.x)+" "+Zi(A.x4.y)+" m"),r.push(Zi(A.x3.x)+" "+Zi(A.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[];return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),t.stream=A.join("\n"),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,A=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+A}};Is.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Is.internal.getWidth(e),A=Is.internal.getHeight(e),r=Math.min(t,A);return{x1:{x:(t-r)/2,y:(A-r)/2+r},x2:{x:(t-r)/2+r,y:(A-r)/2},x3:{x:(t-r)/2,y:(A-r)/2},x4:{x:(t-r)/2+r,y:(A-r)/2+r}}}},Is.internal.getWidth=function(e){var t=0;return"object"===pe(e)&&(t=As(e.Rect[2])),t},Is.internal.getHeight=function(e){var t=0;return"object"===pe(e)&&(t=As(e.Rect[3])),t};var ks=Xi.addField=function(e){if(function(e,t){if(t.scope=e,void 0!==e.internal&&(void 0===e.internal.acroformPlugin||!1===e.internal.acroformPlugin.isInitialized)){if(ys.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(fs)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Yi=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new bs,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){!function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0}(e)}),e.internal.events.subscribe("buildDocument",function(){!function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var A in t)if(t.hasOwnProperty(A)){var r=t[A];r.objId=void 0,r.hasAnnotation&&ps(r,e)}}(e)}),e.internal.events.subscribe("putCatalog",function(){!function(e){if(void 0===e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");e.internal.write("/AcroForm "+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(e)}),e.internal.events.subscribe("postPutPages",function(t){!function(e,t){var A=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var n=e[r],i=[],s=n.Rect;if(n.Rect&&(n.Rect=cs(n.Rect,t)),t.internal.newObjectDeferredBegin(n.objId,!0),n.DA=Is.createDefaultAppearanceStream(n),"object"===pe(n)&&"function"==typeof n.getKeyValueListForStream&&(i=n.getKeyValueListForStream()),n.Rect=s,n.hasAppearanceStream&&!n.appearanceStreamContent){var a=us(n);i.push({key:"AP",value:"<</N "+a+">>"}),t.internal.acroformPlugin.xForms.push(a)}if(n.appearanceStreamContent){var o="";for(var l in n.appearanceStreamContent)if(n.appearanceStreamContent.hasOwnProperty(l)){var c=n.appearanceStreamContent[l];if(o+="/"+l+" ",o+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var r in c)if(c.hasOwnProperty(r)){var u=c[r];"function"==typeof u&&(u=u.call(t,n)),o+="/"+r+" "+u+" ",t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=c)&&(u=u.call(t,n)),o+="/"+r+" "+u,t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u);o+=">>"}i.push({key:"AP",value:"<<\n"+o+">>"})}t.internal.putStream({additionalKeyValues:i,objectId:n.objId}),t.internal.out("endobj")}A&&function(e,t){for(var A in e)if(e.hasOwnProperty(A)){var r=A,n=e[A];t.internal.newObjectDeferredBegin(n.objId,!0),"object"===pe(n)&&"function"==typeof n.putStream&&n.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)}(t,e)}),e.internal.acroformPlugin.isInitialized=!0}}(this,e),!(e instanceof ys))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};function Ts(e){return e.reduce(function(e,t,A){return e[t]=A,e},{})}Xi.AcroFormChoiceField=vs,Xi.AcroFormListBox=Cs,Xi.AcroFormComboBox=xs,Xi.AcroFormEditBox=Fs,Xi.AcroFormButton=Qs,Xi.AcroFormPushButton=Us,Xi.AcroFormRadioButton=Ss,Xi.AcroFormCheckBox=Ns,Xi.AcroFormTextField=Ls,Xi.AcroFormPasswordField=_s,Xi.AcroFormAppearance=Is,Xi.AcroForm={ChoiceField:vs,ListBox:Cs,ComboBox:xs,EditBox:Fs,Button:Qs,PushButton:Us,RadioButton:Ss,CheckBox:Ns,TextField:Ls,PasswordField:_s,Appearance:Is},Wi.AcroForm={ChoiceField:vs,ListBox:Cs,ComboBox:xs,EditBox:Fs,Button:Qs,PushButton:Us,RadioButton:Ss,CheckBox:Ns,TextField:Ls,PasswordField:_s,Appearance:Is},function(e){var t="addImage_";e.__addimage__={};var A="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]]},n=e.__addimage__.getImageFileTypeByImageData=function(e,t){var n,i,s,a,o,l=A;if("RGBA"===(t=t||A)||void 0!==e.data&&e.data instanceof Uint8ClampedArray&&"height"in e&&"width"in e)return"RGBA";if(v(e))for(o in r)for(s=r[o],n=0;n<s.length;n+=1){for(a=!0,i=0;i<s[n].length;i+=1)if(void 0!==s[n][i]&&s[n][i]!==e[i]){a=!1;break}if(!0===a){l=o;break}}else for(o in r)for(s=r[o],n=0;n<s.length;n+=1){for(a=!0,i=0;i<s[n].length;i+=1)if(void 0!==s[n][i]&&s[n][i]!==e.charCodeAt(i)){a=!1;break}if(!0===a){l=o;break}}return l===A&&t!==A&&(l=t),l},i=function e(t){for(var A=this.internal.write,r=this.internal.putStream,n=(0,this.internal.getFilters)();-1!==n.indexOf("FlateEncode");)n.splice(n.indexOf("FlateEncode"),1);t.objectId=this.internal.newObject();var i=[];if(i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Image"}),i.push({key:"Width",value:t.width}),i.push({key:"Height",value:t.height}),t.colorSpace===m.INDEXED?i.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(i.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===m.DEVICE_CMYK&&i.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),i.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&i.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var s="",a=0,o=t.transparency.length;a<o;a++)s+=t.transparency[a]+" "+t.transparency[a]+" ";i.push({key:"Mask",value:"["+s+"]"})}void 0!==t.sMask&&i.push({key:"SMask",value:t.objectId+1+" 0 R"});var l=void 0!==t.filter?["/"+t.filter]:void 0;if(r({data:t.data,additionalKeyValues:i,alreadyAppliedFilters:l,objectId:t.objectId}),A("endobj"),"sMask"in t&&void 0!==t.sMask){var c,u=null!==(c=t.sMaskBitsPerComponent)&&void 0!==c?c:t.bitsPerComponent,h={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:u,data:t.sMask};"filter"in t&&(h.decodeParameters="/Predictor ".concat(t.predictor," /Colors 1 /BitsPerComponent ").concat(u," /Columns ").concat(t.width),h.filter=t.filter),e.call(this,h)}if(t.colorSpace===m.INDEXED){var d=this.internal.newObject();r({data:x(new Uint8Array(t.palette)),objectId:d}),A("endobj")}},s=function(){var e=this.internal.collections[t+"images"];for(var A in e)i.call(this,e[A])},a=function(){var e,A=this.internal.collections[t+"images"],r=this.internal.write;for(var n in A)r("/I"+(e=A[n]).index,e.objectId,"0","R")},o=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",a))},l=function(){var e=this.internal.collections[t+"images"];return o.call(this),e},c=function(){return Object.keys(this.internal.collections[t+"images"]).length},u=function(t){return"function"==typeof e["process"+t.toUpperCase()]},h=function(e){return"object"===pe(e)&&1===e.nodeType},d=function(t,A){if("IMG"===t.nodeName&&t.hasAttribute("src")){var r=""+t.getAttribute("src");if(0===r.indexOf("data:image/"))return Ci(unescape(r).split("base64,").pop());var n=e.loadFile(r,!0);if(void 0!==n)return n}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw new Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);var i;switch(A){case"PNG":i="image/png";break;case"WEBP":i="image/webp";break;default:i="image/jpeg"}return Ci(t.toDataURL(i,1).split("base64,").pop())}},f=function(e){var A=this.internal.collections[t+"images"];if(A)for(var r in A)if(e===A[r].alias)return A[r]},p=function(e,t,A){return e||t||(e=-96,t=-96),e<0&&(e=-1*A.width*72/e/this.internal.scaleFactor),t<0&&(t=-1*A.height*72/t/this.internal.scaleFactor),0===e&&(e=t*A.width/A.height),0===t&&(t=e*A.height/A.width),[e,t]},g=function(e,t,A,r,n,i){var s=p.call(this,A,r,n),a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,c=l.call(this);if(A=s[0],r=s[1],c[n.index]=n,i){i*=Math.PI/180;var u=Math.cos(i),h=Math.sin(i),d=function(e){return e.toFixed(4)},f=[d(u),d(h),d(-1*h),d(u),0,0,"cm"]}this.internal.write("q"),i?(this.internal.write([1,"0","0",1,a(e),o(t+r),"cm"].join(" ")),this.internal.write(f.join(" ")),this.internal.write([a(A),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(A),"0","0",a(r),a(e),o(t+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+n.index+" Do"),this.internal.write("Q")},m=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var w=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},B=e.__addimage__.sHashCode=function(e){var t,A,r=0;if("string"==typeof e)for(A=e.length,t=0;t<A;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;else if(v(e))for(A=e.byteLength/2,t=0;t<A;t++)r=(r<<5)-r+e[t],r|=0;return r},b=e.__addimage__.validateStringAsBase64=function(e){(e=e||"").toString().trim();var t=!0;return 0===e.length&&(t=!1),e.length%4!=0&&(t=!1),!1===/^[A-Za-z0-9+/]+$/.test(e.substr(0,e.length-2))&&(t=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2))&&(t=!1),t},y=e.__addimage__.extractImageFromDataUrl=function(e){if(null==e)return null;if(!(e=e.trim()).startsWith("data:"))return null;var t=e.indexOf(",");return t<0?null:e.substring(0,t).trim().endsWith("base64")?e.substring(t+1):null};e.__addimage__.isArrayBuffer=function(e){return e instanceof ArrayBuffer};var v=e.__addimage__.isArrayBufferView=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},C=e.__addimage__.binaryStringToUint8Array=function(e){for(var t=e.length,A=new Uint8Array(t),r=0;r<t;r++)A[r]=e.charCodeAt(r);return A},x=e.__addimage__.arrayBufferToBinaryString=function(e){for(var t="",A=v(e)?e:new Uint8Array(e),r=0;r<A.length;r+=8192)t+=String.fromCharCode.apply(null,A.subarray(r,r+8192));return t};e.addImage=function(){var e,t,r,n,i,s,a,l,c;if("number"==typeof arguments[1]?(t=A,r=arguments[1],n=arguments[2],i=arguments[3],s=arguments[4],a=arguments[5],l=arguments[6],c=arguments[7]):(t=arguments[1],r=arguments[2],n=arguments[3],i=arguments[4],s=arguments[5],a=arguments[6],l=arguments[7],c=arguments[8]),"object"===pe(e=arguments[0])&&!h(e)&&"imageData"in e){var u=e;e=u.imageData,t=u.format||t||A,r=u.x||r||0,n=u.y||n||0,i=u.w||u.width||i,s=u.h||u.height||s,a=u.alias||a,l=u.compression||l,c=u.rotation||u.angle||c}var d=this.internal.getFilters();if(void 0===l&&-1!==d.indexOf("FlateEncode")&&(l="SLOW"),isNaN(r)||isNaN(n))throw new Error("Invalid coordinates passed to jsPDF.addImage");o.call(this);var f=F.call(this,e,t,a,l);return g.call(this,r,n,i,s,f,c),this};var F=function(t,r,i,s){var a,o,l;if("string"==typeof t&&n(t)===A){t=unescape(t);var p=Q(t,!1);(""!==p||void 0!==(p=e.loadFile(t,!0)))&&(t=p)}if(h(t)&&(t=d(t,r)),r=n(t,r),!u(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if((null==(l=i)||0===l.length)&&(i=function(e){return"string"==typeof e||v(e)?B(e):v(e.data)?B(e.data):null}(t)),(a=f.call(this,i))||(t instanceof Uint8Array||"RGBA"===r||(o=t,t=C(t)),a=this["process"+r.toUpperCase()](t,c.call(this),i,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:w.NONE}(s),o)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},Q=e.__addimage__.convertBase64ToBinaryString=function(e,t){t="boolean"!=typeof t||t;var A,r="";if("string"==typeof e){var n;A=null!==(n=y(e))&&void 0!==n?n:e;try{r=Ci(A)}catch(e){if(t)throw b(A)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};e.getImageProperties=function(t){var r,i,s="";if(h(t)&&(t=d(t)),"string"==typeof t&&n(t)===A&&(""===(s=Q(t,!1))&&(s=e.loadFile(t)||""),t=s),i=n(t),!u(i))throw new Error("addImage does not support files of type '"+i+"', please ensure that a plugin for '"+i+"' support is added.");if(t instanceof Uint8Array||(t=C(t)),!(r=this["process"+i.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return r.fileType=i,r}}(Wi.API),
|
|
115
|
+
*/var Mi={print:4,modify:8,copy:16,"annot-forms":32};function ji(e,t,A,r){this.v=1,this.r=2;var n=192;e.forEach(function(e){if(void 0!==Mi.perm)throw new Error("Invalid permission: "+e);n+=Mi[e]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(t+this.padding).substr(0,32),s=(A+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,s),this.P=-(1+(255^n)),this.encryptionKey=Hi(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Di(this.encryptionKey,this.padding)}function Ri(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",A=e.length,r=0;r<A;r++){var n=e.charCodeAt(r);t+=n<33||35===n||37===n||40===n||41===n||47===n||60===n||62===n||91===n||93===n||123===n||125===n||n>126?"#"+("0"+n.toString(16)).slice(-2):e[r]}return t}function Vi(e){if("object"!==pe(e))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,A,r){if(r=r||!1,"string"!=typeof e||"function"!=typeof A||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var n=Math.random().toString(35);return t[e][n]=[A,!!r],n},this.unsubscribe=function(e){for(var A in t)if(t[A][e])return delete t[A][e],0===Object.keys(t[A]).length&&delete t[A],!0;return!1},this.publish=function(A){if(t.hasOwnProperty(A)){var r=Array.prototype.slice.call(arguments,1),n=[];for(var i in t[A]){var s=t[A][i];try{s[0].apply(e,r)}catch(e){pi.console&&mi.error("jsPDF PubSub Error",e.message,e)}s[1]&&n.push(i)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Ki(e){if(!(this instanceof Ki))return new Ki(e);var t="opacity,stroke-opacity".split(",");for(var A in e)e.hasOwnProperty(A)&&t.indexOf(A)>=0&&(this[A]=e[A]);this.id="",this.objectNumber=-1}function zi(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Gi(e,t,A,r,n){if(!(this instanceof Gi))return new Gi(e,t,A,r,n);this.type="axial"===e?2:3,this.coords=t,this.colors=A,zi.call(this,r,n)}function qi(e,t,A,r,n){if(!(this instanceof qi))return new qi(e,t,A,r,n);this.boundingBox=e,this.xStep=t,this.yStep=A,this.stream="",this.cloneIndex=0,zi.call(this,r,n)}function Wi(e){var t,A="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],n=arguments[2],i=arguments[3],s=[],a=1,o=16,l="S",c=null;"object"===pe(e=e||{})&&(A=e.orientation,r=e.unit||r,n=e.format||n,i=e.compress||e.compressPdf||i,null!==(c=e.encryption||null)&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),a="number"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(t=e.precision),void 0!==e.floatPrecision&&(o=e.floatPrecision),l=e.defaultPathOperation||"S"),s=e.filters||(!0===i?["FlateEncode"]:s),r=r||"mm",A=(""+(A||"P")).toLowerCase();var u=e.putOnlyUsedFonts||!1,h={},d={internal:{},__private__:{}};d.__private__.PubSub=Vi;var f="1.3",p=d.__private__.getPdfVersion=function(){return f};d.__private__.setPdfVersion=function(e){f=e};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return g};var m=d.__private__.getPageFormat=function(e){return g[e]};n=n||"a4";var w="compat",B="advanced",b=w;function y(){this.saveGraphicsState(),J(new _e(he,0,0,-he,0,dA()*he).toString()+" cm"),this.setFontSize(this.getFontSize()/he),l="n",b=B}function v(){this.restoreGraphicsState(),l="S",b=w}var C=d.__private__.combineFontStyleAndFontWeight=function(e,t){if("bold"==e&&"normal"==t||"bold"==e&&400==t||"normal"==e&&"italic"==t||"bold"==e&&"italic"==t)throw new Error("Invalid Combination of fontweight and fontstyle");return t&&(e=400==t||"normal"===t?"italic"===e?"italic":"normal":700!=t&&"bold"!==t||"normal"!==e?(700==t?"bold":t)+""+e:"bold"),e};d.advancedAPI=function(e){var t=b===w;return t&&y.call(this),"function"!=typeof e||(e(this),t&&v.call(this)),this},d.compatAPI=function(e){var t=b===B;return t&&v.call(this),"function"!=typeof e||(e(this),t&&y.call(this)),this},d.isAdvancedAPI=function(){return b===B};var x,F=function(e){if(b!==B)throw new Error(e+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},Q=d.roundToPrecision=d.__private__.roundToPrecision=function(e,A){var r=t||A;if(isNaN(e)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return e.toFixed(r).replace(/0+$/,"")};x=d.hpf=d.__private__.hpf="number"==typeof o?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,o)}:"smart"===o?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return Q(e,16)};var U=d.f2=d.__private__.f2=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f2");return Q(e,2)},S=d.__private__.f3=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f3");return Q(e,3)},E=d.scale=d.__private__.scale=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.scale");return b===w?e*he:b===B?e:void 0},N=function(e){return E(function(e){return b===w?dA()-e:b===B?e:void 0}(e))};d.__private__.setPrecision=d.setPrecision=function(e){"number"==typeof parseInt(e,10)&&(t=parseInt(e,10))};var L,_="00000000000000000000000000000000",I=d.__private__.getFileId=function(){return _},k=d.__private__.setFileId=function(e){return _=void 0!==e&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():_.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==c&&(Bt=new ji(c.userPermissions,c.userPassword,c.ownerPassword,_)),_};d.setFileId=function(e){return k(e),this},d.getFileId=function(){return I()};var T=d.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),A=t<0?"+":"-",r=Math.floor(Math.abs(t/60)),n=Math.abs(t%60),i=[A,M(r),"'",M(n),"'"].join("");return["D:",e.getFullYear(),M(e.getMonth()+1),M(e.getDate()),M(e.getHours()),M(e.getMinutes()),M(e.getSeconds()),i].join("")},H=d.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),A=parseInt(e.substr(6,2),10)-1,r=parseInt(e.substr(8,2),10),n=parseInt(e.substr(10,2),10),i=parseInt(e.substr(12,2),10),s=parseInt(e.substr(14,2),10);return new Date(t,A,r,n,i,s,0)},O=d.__private__.setCreationDate=function(e){var t;if(void 0===e&&(e=new Date),e instanceof Date)t=T(e);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))throw new Error("Invalid argument passed to jsPDF.setCreationDate");t=e}return L=t},P=d.__private__.getCreationDate=function(e){var t=L;return"jsDate"===e&&(t=H(L)),t};d.setCreationDate=function(e){return O(e),this},d.getCreationDate=function(e){return P(e)};var D,M=d.__private__.padd2=function(e){return("0"+parseInt(e)).slice(-2)},j=d.__private__.padd2Hex=function(e){return("00"+(e=e.toString())).substr(e.length)},R=0,V=[],K=[],z=0,G=[],q=[],W=!1,X=K;d.__private__.setCustomOutputDestination=function(e){W=!0,X=e};var Y=function(e){W||(X=e)};d.__private__.resetCustomOutputDestination=function(){W=!1,X=K};var J=d.__private__.out=function(e){return e=e.toString(),z+=e.length+1,X.push(e),X},$=d.__private__.write=function(e){return J(1===arguments.length?e.toString():Array.prototype.join.call(arguments," "))},Z=d.__private__.getArrayBuffer=function(e){for(var t=e.length,A=new ArrayBuffer(t),r=new Uint8Array(A);t--;)r[t]=e.charCodeAt(t);return A},ee=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return ee};var te=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(e){return te=b===B?e/he:e,this};var Ae,re=d.__private__.getFontSize=d.getFontSize=function(){return b===w?te:te*he},ne=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(e){return ne=e,this},d.__private__.getR2L=d.getR2L=function(){return ne};var ie,se=d.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))Ae=e;else if(isNaN(e)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(e))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+e+'" is not recognized.');Ae=e}else Ae=parseInt(e,10)};d.__private__.getZoomMode=function(){return Ae};var ae,oe=d.__private__.setPageMode=function(e){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');ie=e};d.__private__.getPageMode=function(){return ie};var le=d.__private__.setLayoutMode=function(e){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(e))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+e+'" is not recognized.');ae=e};d.__private__.getLayoutMode=function(){return ae},d.__private__.setDisplayMode=d.setDisplayMode=function(e,t,A){return se(e),le(t),oe(A),this};var ce={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(e){if(-1===Object.keys(ce).indexOf(e))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ce[e]},d.__private__.getDocumentProperties=function(){return ce},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(e){for(var t in ce)ce.hasOwnProperty(t)&&e[t]&&(ce[t]=e[t]);return this},d.__private__.setDocumentProperty=function(e,t){if(-1===Object.keys(ce).indexOf(e))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ce[e]=t};var ue,he,de,fe,ge,me={},we={},Be=[],be={},ye={},ve={},Ce={},xe=null,Fe=0,Qe=[],Ue=new Vi(d),Se=e.hotfixes||[],Ee={},Ne={},Le=[],_e=function e(t,A,r,n,i,s){if(!(this instanceof e))return new e(t,A,r,n,i,s);isNaN(t)&&(t=1),isNaN(A)&&(A=0),isNaN(r)&&(r=0),isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(s)&&(s=0),this._matrix=[t,A,r,n,i,s]};Object.defineProperty(_e.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(_e.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(_e.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(_e.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(_e.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(_e.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(_e.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(_e.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(_e.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(_e.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(_e.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(_e.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(_e.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(_e.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(_e.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(_e.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),_e.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(x).join(e)},_e.prototype.multiply=function(e){var t=e.sx*this.sx+e.shy*this.shx,A=e.sx*this.shy+e.shy*this.sy,r=e.shx*this.sx+e.sy*this.shx,n=e.shx*this.shy+e.sy*this.sy,i=e.tx*this.sx+e.ty*this.shx+this.tx,s=e.tx*this.shy+e.ty*this.sy+this.ty;return new _e(t,A,r,n,i,s)},_e.prototype.decompose=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty,s=Math.sqrt(e*e+t*t),a=(e/=s)*A+(t/=s)*r;A-=e*a,r-=t*a;var o=Math.sqrt(A*A+r*r);return a/=o,e*(r/=o)<t*(A/=o)&&(e=-e,t=-t,a=-a,s=-s),{scale:new _e(s,0,0,o,0,0),translate:new _e(1,0,0,1,n,i),rotate:new _e(e,t,-t,e,0,0),skew:new _e(1,0,a,1,0,0)}},_e.prototype.toString=function(e){return this.join(" ")},_e.prototype.inversed=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty,s=1/(e*r-t*A),a=r*s,o=-t*s,l=-A*s,c=e*s;return new _e(a,o,l,c,-a*n-l*i,-o*n-c*i)},_e.prototype.applyToPoint=function(e){var t=e.x*this.sx+e.y*this.shx+this.tx,A=e.x*this.shy+e.y*this.sy+this.ty;return new AA(t,A)},_e.prototype.applyToRectangle=function(e){var t=this.applyToPoint(e),A=this.applyToPoint(new AA(e.x+e.w,e.y+e.h));return new rA(t.x,t.y,A.x-t.x,A.y-t.y)},_e.prototype.clone=function(){var e=this.sx,t=this.shy,A=this.shx,r=this.sy,n=this.tx,i=this.ty;return new _e(e,t,A,r,n,i)},d.Matrix=_e;var Ie=d.matrixMult=function(e,t){return t.multiply(e)},ke=new _e(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=ke;var Te=function(e,t){if(!ye[e]){var A=(t instanceof Gi?"Sh":"P")+(Object.keys(be).length+1).toString(10);t.id=A,ye[e]=A,be[A]=t,Ue.publish("addPattern",t)}};d.ShadingPattern=Gi,d.TilingPattern=qi,d.addShadingPattern=function(e,t){return F("addShadingPattern()"),Te(e,t),this},d.beginTilingPattern=function(e){F("beginTilingPattern()"),iA(e.boundingBox[0],e.boundingBox[1],e.boundingBox[2]-e.boundingBox[0],e.boundingBox[3]-e.boundingBox[1],e.matrix)},d.endTilingPattern=function(e,t){F("endTilingPattern()"),t.stream=q[D].join("\n"),Te(e,t),Ue.publish("endTilingPattern",t),Le.pop().restore()};var He,Oe=d.__private__.newObject=function(){var e=Pe();return De(e,!0),e},Pe=d.__private__.newObjectDeferred=function(){return R++,V[R]=function(){return z},R},De=function(e,t){return t="boolean"==typeof t&&t,V[e]=z,t&&J(e+" 0 obj"),e},Me=d.__private__.newAdditionalObject=function(){var e={objId:Pe(),content:""};return G.push(e),e},je=Pe(),Re=Pe(),Ve=d.__private__.decodeColorString=function(e){var t=e.split(" ");if(2!==t.length||"g"!==t[1]&&"G"!==t[1])5!==t.length||"k"!==t[4]&&"K"!==t[4]||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),"r"]);else{var A=parseFloat(t[0]);t=[A,A,A,"r"]}for(var r="#",n=0;n<3;n++)r+=("0"+Math.floor(255*parseFloat(t[n])).toString(16)).slice(-2);return r},Ke=d.__private__.encodeColorString=function(e){var t;"string"==typeof e&&(e={ch1:e});var A=e.ch1,r=e.ch2,n=e.ch3,i=e.ch4,s="draw"===e.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof A&&"#"!==A.charAt(0)){var a=new vi(A);if(a.ok)A=a.toHex();else if(!/^\d*\.?\d*$/.test(A))throw new Error('Invalid color "'+A+'" passed to jsPDF.encodeColorString.')}if("string"==typeof A&&/^#[0-9A-Fa-f]{3}$/.test(A)&&(A="#"+A[1]+A[1]+A[2]+A[2]+A[3]+A[3]),"string"==typeof A&&/^#[0-9A-Fa-f]{6}$/.test(A)){var o=parseInt(A.substr(1),16);A=o>>16&255,r=o>>8&255,n=255&o}if(void 0===r||void 0===i&&A===r&&r===n)t="string"==typeof A?A+" "+s[0]:2===e.precision?U(A/255)+" "+s[0]:S(A/255)+" "+s[0];else if(void 0===i||"object"===pe(i)){if(i&&!isNaN(i.a)&&0===i.a)return["1.","1.","1.",s[1]].join(" ");t="string"==typeof A?[A,r,n,s[1]].join(" "):2===e.precision?[U(A/255),U(r/255),U(n/255),s[1]].join(" "):[S(A/255),S(r/255),S(n/255),s[1]].join(" ")}else t="string"==typeof A?[A,r,n,i,s[2]].join(" "):2===e.precision?[U(A),U(r),U(n),U(i),s[2]].join(" "):[S(A),S(r),S(n),S(i),s[2]].join(" ");return t},ze=d.__private__.getFilters=function(){return s},Ge=d.__private__.putStream=function(e){var t=(e=e||{}).data||"",A=e.filters||ze(),r=e.alreadyAppliedFilters||[],n=e.addLength1||!1,i=t.length,s=e.objectId,a=function(e){return e};if(null!==c&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==c&&(a=Bt.encryptor(s,0));var o={};!0===A&&(A=["FlateEncode"]);var l=e.additionalKeyValues||[],u=(o=void 0!==Wi.API.processDataByFilters?Wi.API.processDataByFilters(t,A):{data:t,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==o.data.length&&(l.push({key:"Length",value:o.data.length}),!0===n&&l.push({key:"Length1",value:i})),0!=u.length)if(u.split("/").length-1==1)l.push({key:"Filter",value:u});else{l.push({key:"Filter",value:"["+u+"]"});for(var h=0;h<l.length;h+=1)if("DecodeParms"===l[h].key){for(var d=[],f=0;f<o.reverseChain.split("/").length-1;f+=1)d.push("null");d.push(l[h].value),l[h].value="["+d.join(" ")+"]"}}J("<<");for(var p=0;p<l.length;p++)J("/"+l[p].key+" "+l[p].value);J(">>"),0!==o.data.length&&(J("stream"),J(a(o.data)),J("endstream"))},qe=d.__private__.putPage=function(e){var t=e.number,A=e.data,r=e.objId,n=e.contentsObjId;De(r,!0),J("<</Type /Page"),J("/Parent "+e.rootDictionaryObjId+" 0 R"),J("/Resources "+e.resourceDictionaryObjId+" 0 R"),J("/MediaBox ["+parseFloat(x(e.mediaBox.bottomLeftX))+" "+parseFloat(x(e.mediaBox.bottomLeftY))+" "+x(e.mediaBox.topRightX)+" "+x(e.mediaBox.topRightY)+"]"),null!==e.cropBox&&J("/CropBox ["+x(e.cropBox.bottomLeftX)+" "+x(e.cropBox.bottomLeftY)+" "+x(e.cropBox.topRightX)+" "+x(e.cropBox.topRightY)+"]"),null!==e.bleedBox&&J("/BleedBox ["+x(e.bleedBox.bottomLeftX)+" "+x(e.bleedBox.bottomLeftY)+" "+x(e.bleedBox.topRightX)+" "+x(e.bleedBox.topRightY)+"]"),null!==e.trimBox&&J("/TrimBox ["+x(e.trimBox.bottomLeftX)+" "+x(e.trimBox.bottomLeftY)+" "+x(e.trimBox.topRightX)+" "+x(e.trimBox.topRightY)+"]"),null!==e.artBox&&J("/ArtBox ["+x(e.artBox.bottomLeftX)+" "+x(e.artBox.bottomLeftY)+" "+x(e.artBox.topRightX)+" "+x(e.artBox.topRightY)+"]"),"number"==typeof e.userUnit&&1!==e.userUnit&&J("/UserUnit "+e.userUnit),Ue.publish("putPage",{objId:r,pageContext:Qe[t],pageNumber:t,page:A}),J("/Contents "+n+" 0 R"),J(">>"),J("endobj");var i=A.join("\n");return b===B&&(i+="\nQ"),De(n,!0),Ge({data:i,filters:ze(),objectId:n}),J("endobj"),r},We=d.__private__.putPages=function(){var e,t,A=[];for(e=1;e<=Fe;e++)Qe[e].objId=Pe(),Qe[e].contentsObjId=Pe();for(e=1;e<=Fe;e++)A.push(qe({number:e,data:q[e],objId:Qe[e].objId,contentsObjId:Qe[e].contentsObjId,mediaBox:Qe[e].mediaBox,cropBox:Qe[e].cropBox,bleedBox:Qe[e].bleedBox,trimBox:Qe[e].trimBox,artBox:Qe[e].artBox,userUnit:Qe[e].userUnit,rootDictionaryObjId:je,resourceDictionaryObjId:Re}));De(je,!0),J("<</Type /Pages");var r="/Kids [";for(t=0;t<Fe;t++)r+=A[t]+" 0 R ";J(r+"]"),J("/Count "+Fe),J(">>"),J("endobj"),Ue.publish("postPutPages")},Xe=function(e){Ue.publish("putFont",{font:e,out:J,newObject:Oe,putStream:Ge}),!0!==e.isAlreadyPutted&&(e.objectNumber=Oe(),J("<<"),J("/Type /Font"),J("/BaseFont /"+Ri(e.postScriptName)),J("/Subtype /Type1"),"string"==typeof e.encoding&&J("/Encoding /"+e.encoding),J("/FirstChar 32"),J("/LastChar 255"),J(">>"),J("endobj"))},Ye=function(e){e.objectNumber=Oe();var t=[];t.push({key:"Type",value:"/XObject"}),t.push({key:"Subtype",value:"/Form"}),t.push({key:"BBox",value:"["+[x(e.x),x(e.y),x(e.x+e.width),x(e.y+e.height)].join(" ")+"]"}),t.push({key:"Matrix",value:"["+e.matrix.toString()+"]"});var A=e.pages[1].join("\n");Ge({data:A,additionalKeyValues:t,objectId:e.objectNumber}),J("endobj")},Je=function(e,t){t||(t=21);var A=Oe(),r=function(e,t){var A,r=[],n=1/(t-1);for(A=0;A<1;A+=n)r.push(A);if(r.push(1),0!=e[0].offset){var i={offset:0,color:e[0].color};e.unshift(i)}if(1!=e[e.length-1].offset){var s={offset:1,color:e[e.length-1].color};e.push(s)}for(var a="",o=0,l=0;l<r.length;l++){for(A=r[l];A>e[o+1].offset;)o++;var c=e[o].offset,u=(A-c)/(e[o+1].offset-c),h=e[o].color,d=e[o+1].color;a+=j(Math.round((1-u)*h[0]+u*d[0]).toString(16))+j(Math.round((1-u)*h[1]+u*d[1]).toString(16))+j(Math.round((1-u)*h[2]+u*d[2]).toString(16))}return a.trim()}(e.colors,t),n=[];n.push({key:"FunctionType",value:"0"}),n.push({key:"Domain",value:"[0.0 1.0]"}),n.push({key:"Size",value:"["+t+"]"}),n.push({key:"BitsPerSample",value:"8"}),n.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),n.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ge({data:r,additionalKeyValues:n,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:A}),J("endobj"),e.objectNumber=Oe(),J("<< /ShadingType "+e.type),J("/ColorSpace /DeviceRGB");var i="/Coords ["+x(parseFloat(e.coords[0]))+" "+x(parseFloat(e.coords[1]))+" ";2===e.type?i+=x(parseFloat(e.coords[2]))+" "+x(parseFloat(e.coords[3])):i+=x(parseFloat(e.coords[2]))+" "+x(parseFloat(e.coords[3]))+" "+x(parseFloat(e.coords[4]))+" "+x(parseFloat(e.coords[5])),J(i+="]"),e.matrix&&J("/Matrix ["+e.matrix.toString()+"]"),J("/Function "+A+" 0 R"),J("/Extend [true true]"),J(">>"),J("endobj")},$e=function(e,t){var A=Pe(),r=Oe();t.push({resourcesOid:A,objectOid:r}),e.objectNumber=r;var n=[];n.push({key:"Type",value:"/Pattern"}),n.push({key:"PatternType",value:"1"}),n.push({key:"PaintType",value:"1"}),n.push({key:"TilingType",value:"1"}),n.push({key:"BBox",value:"["+e.boundingBox.map(x).join(" ")+"]"}),n.push({key:"XStep",value:x(e.xStep)}),n.push({key:"YStep",value:x(e.yStep)}),n.push({key:"Resources",value:A+" 0 R"}),e.matrix&&n.push({key:"Matrix",value:"["+e.matrix.toString()+"]"}),Ge({data:e.stream,additionalKeyValues:n,objectId:e.objectNumber}),J("endobj")},Ze=function(e){for(var t in e.objectNumber=Oe(),J("<<"),e)switch(t){case"opacity":J("/ca "+U(e[t]));break;case"stroke-opacity":J("/CA "+U(e[t]))}J(">>"),J("endobj")},et=function(e){De(e.resourcesOid,!0),J("<<"),J("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var e in J("/Font <<"),me)me.hasOwnProperty(e)&&(!1===u||!0===u&&h.hasOwnProperty(e))&&J("/"+e+" "+me[e].objectNumber+" 0 R");J(">>")}(),function(){if(Object.keys(be).length>0){for(var e in J("/Shading <<"),be)be.hasOwnProperty(e)&&be[e]instanceof Gi&&be[e].objectNumber>=0&&J("/"+e+" "+be[e].objectNumber+" 0 R");Ue.publish("putShadingPatternDict"),J(">>")}}(),function(e){if(Object.keys(be).length>0){for(var t in J("/Pattern <<"),be)be.hasOwnProperty(t)&&be[t]instanceof d.TilingPattern&&be[t].objectNumber>=0&&be[t].objectNumber<e&&J("/"+t+" "+be[t].objectNumber+" 0 R");Ue.publish("putTilingPatternDict"),J(">>")}}(e.objectOid),function(){if(Object.keys(ve).length>0){var e;for(e in J("/ExtGState <<"),ve)ve.hasOwnProperty(e)&&ve[e].objectNumber>=0&&J("/"+e+" "+ve[e].objectNumber+" 0 R");Ue.publish("putGStateDict"),J(">>")}}(),function(){for(var e in J("/XObject <<"),Ee)Ee.hasOwnProperty(e)&&Ee[e].objectNumber>=0&&J("/"+e+" "+Ee[e].objectNumber+" 0 R");Ue.publish("putXobjectDict"),J(">>")}(),J(">>"),J("endobj")},tt=function(e){we[e.fontName]=we[e.fontName]||{},we[e.fontName][e.fontStyle]=e.id},At=function(e,t,A,r,n){var i={id:"F"+(Object.keys(me).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:A,encoding:r,isStandardFont:n||!1,metadata:{}};return Ue.publish("addFont",{font:i,instance:this}),me[i.id]=i,tt(i),i.id},rt=d.__private__.pdfEscape=d.pdfEscape=function(e,t){return function(e,t){var A,r,n,i,s,a,o,l,c;if(n=(t=t||{}).sourceEncoding||"Unicode",s=t.outputEncoding,(t.autoencode||s)&&me[ue].metadata&&me[ue].metadata[n]&&me[ue].metadata[n].encoding&&(i=me[ue].metadata[n].encoding,!s&&me[ue].encoding&&(s=me[ue].encoding),!s&&i.codePages&&(s=i.codePages[0]),"string"==typeof s&&(s=i[s]),s)){for(o=!1,a=[],A=0,r=e.length;A<r;A++)(l=s[e.charCodeAt(A)])?a.push(String.fromCharCode(l)):a.push(e[A]),a[A].charCodeAt(0)>>8&&(o=!0);e=a.join("")}for(A=e.length;void 0===o&&0!==A;)e.charCodeAt(A-1)>>8&&(o=!0),A--;if(!o)return e;for(a=t.noBOM?[]:[254,255],A=0,r=e.length;A<r;A++){if((c=(l=e.charCodeAt(A))>>8)>>8)throw new Error("Character at position "+A+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(l-(c<<8))}return String.fromCharCode.apply(void 0,a)}(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},nt=d.__private__.beginPage=function(e){q[++Fe]=[],Qe[Fe]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},at(Fe),Y(q[D])},it=function(e,t){var r,i,s;switch(A=t||A,"string"==typeof e&&(r=m(e.toLowerCase()),Array.isArray(r)&&(i=r[0],s=r[1])),Array.isArray(e)&&(i=e[0]*he,s=e[1]*he),isNaN(i)&&(i=n[0],s=n[1]),(i>14400||s>14400)&&(mi.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),i=Math.min(14400,i),s=Math.min(14400,s)),n=[i,s],A.substr(0,1)){case"l":s>i&&(n=[s,i]);break;case"p":i>s&&(n=[s,i])}nt(n),Dt(Ot),J(qt),0!==Zt&&J(Zt+" J"),0!==eA&&J(eA+" j"),Ue.publish("addPage",{pageNumber:Fe})},st=function(e){e>0&&e<=Fe&&(q.splice(e,1),Qe.splice(e,1),Fe--,D>Fe&&(D=Fe),this.setPage(D))},at=function(e){e>0&&e<=Fe&&(D=e)},ot=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return q.length-1},lt=function(e,t,A){var r,n=void 0;return A=A||{},e=void 0!==e?e:me[ue].fontName,t=void 0!==t?t:me[ue].fontStyle,r=e.toLowerCase(),void 0!==we[r]&&void 0!==we[r][t]?n=we[r][t]:void 0!==we[e]&&void 0!==we[e][t]?n=we[e][t]:!1===A.disableWarning&&mi.warn("Unable to look up font label for font '"+e+"', '"+t+"'. Refer to getFontList() for available fonts."),n||A.noFallback||null==(n=we.times[t])&&(n=we.times.normal),n},ct=d.__private__.putInfo=function(){var e=Oe(),t=function(e){return e};for(var A in null!==c&&(t=Bt.encryptor(e,0)),J("<<"),J("/Producer ("+rt(t("jsPDF "+Wi.version))+")"),ce)ce.hasOwnProperty(A)&&ce[A]&&J("/"+A.substr(0,1).toUpperCase()+A.substr(1)+" ("+rt(t(ce[A]))+")");J("/CreationDate ("+rt(t(L))+")"),J(">>"),J("endobj")},ut=d.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||je;switch(Oe(),J("<<"),J("/Type /Catalog"),J("/Pages "+t+" 0 R"),Ae||(Ae="fullwidth"),Ae){case"fullwidth":J("/OpenAction [3 0 R /FitH null]");break;case"fullheight":J("/OpenAction [3 0 R /FitV null]");break;case"fullpage":J("/OpenAction [3 0 R /Fit]");break;case"original":J("/OpenAction [3 0 R /XYZ null null 1]");break;default:var A=""+Ae;"%"===A.substr(A.length-1)&&(Ae=parseInt(Ae)/100),"number"==typeof Ae&&J("/OpenAction [3 0 R /XYZ null null "+U(Ae)+"]")}switch(ae||(ae="continuous"),ae){case"continuous":J("/PageLayout /OneColumn");break;case"single":J("/PageLayout /SinglePage");break;case"two":case"twoleft":J("/PageLayout /TwoColumnLeft");break;case"tworight":J("/PageLayout /TwoColumnRight")}ie&&J("/PageMode /"+ie),Ue.publish("putCatalog"),J(">>"),J("endobj")},ht=d.__private__.putTrailer=function(){J("trailer"),J("<<"),J("/Size "+(R+1)),J("/Root "+R+" 0 R"),J("/Info "+(R-1)+" 0 R"),null!==c&&J("/Encrypt "+Bt.oid+" 0 R"),J("/ID [ <"+_+"> <"+_+"> ]"),J(">>")},dt=d.__private__.putHeader=function(){J("%PDF-"+f),J("%ºß¬à")},ft=d.__private__.putXRef=function(){var e="0000000000";J("xref"),J("0 "+(R+1)),J("0000000000 65535 f ");for(var t=1;t<=R;t++)"function"==typeof V[t]?J((e+V[t]()).slice(-10)+" 00000 n "):void 0!==V[t]?J((e+V[t]).slice(-10)+" 00000 n "):J("0000000000 00000 n ")},pt=d.__private__.buildDocument=function(){var e;R=0,z=0,K=[],V=[],G=[],je=Pe(),Re=Pe(),Y(K),Ue.publish("buildDocument"),dt(),We(),function(){Ue.publish("putAdditionalObjects");for(var e=0;e<G.length;e++){var t=G[e];De(t.objId,!0),J(t.content),J("endobj")}Ue.publish("postPutAdditionalObjects")}(),e=[],function(){for(var e in me)me.hasOwnProperty(e)&&(!1===u||!0===u&&h.hasOwnProperty(e))&&Xe(me[e])}(),function(){var e;for(e in ve)ve.hasOwnProperty(e)&&Ze(ve[e])}(),function(){for(var e in Ee)Ee.hasOwnProperty(e)&&Ye(Ee[e])}(),function(e){var t;for(t in be)be.hasOwnProperty(t)&&(be[t]instanceof Gi?Je(be[t]):be[t]instanceof qi&&$e(be[t],e))}(e),Ue.publish("putResources"),e.forEach(et),et({resourcesOid:Re,objectOid:Number.MAX_SAFE_INTEGER}),Ue.publish("postPutResources"),null!==c&&(Bt.oid=Oe(),J("<<"),J("/Filter /Standard"),J("/V "+Bt.v),J("/R "+Bt.r),J("/U <"+Bt.toHexString(Bt.U)+">"),J("/O <"+Bt.toHexString(Bt.O)+">"),J("/P "+Bt.P),J(">>"),J("endobj")),ct(),ut();var t=z;return ft(),ht(),J("startxref"),J(""+t),J("%%EOF"),Y(q[D]),K.join("\n")},gt=d.__private__.getBlob=function(e){return new Blob([Z(e)],{type:"application/pdf"})},mt=d.output=d.__private__.output=(He=function(e,t){switch("string"==typeof(t=t||{})?t={filename:t}:t.filename=t.filename||"generated.pdf",e){case void 0:return pt();case"save":d.save(t.filename);break;case"arraybuffer":return Z(pt());case"blob":return gt(pt());case"bloburi":case"bloburl":if(void 0!==pi.URL&&"function"==typeof pi.URL.createObjectURL)return pi.URL&&pi.URL.createObjectURL(gt(pt()))||void 0;mi.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var A="",r=pt();try{A=xi(r)}catch(e){A=xi(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+t.filename+";base64,"+A;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(pi)){var n="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",i=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';t.pdfObjectUrl&&(n=t.pdfObjectUrl,i="");var s='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+n+'"'+i+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(t)+");<\/script></body></html>",a=pi.open();return null!==a&&a.document.write(s),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(pi)){var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(t.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+t.filename+'" width="500px" height="400px" /></body></html>',l=pi.open();if(null!==l){l.document.write(o);var c=this;l.document.documentElement.querySelector("#pdfViewer").onload=function(){l.document.title=t.filename,l.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(c.output("bloburl"))}}return l}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(pi))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",t)+'"></iframe></body></html>',h=pi.open();if(null!==h&&(h.document.write(u),h.document.title=t.filename),h||"undefined"==typeof safari)return h;break;case"datauri":case"dataurl":return pi.document.location.href=this.output("datauristring",t);default:return null}},He.foo=function(){try{return He.apply(this,arguments)}catch(A){var e=A.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var t="Error in function "+e.split("\n")[0].split("<")[0]+": "+A.message;if(!pi.console)throw new Error(t);pi.console.error(t,A),pi.alert&&alert(t)}},He.foo.bar=He,He.foo),wt=function(e){return!0===Array.isArray(Se)&&Se.indexOf(e)>-1};switch(r){case"pt":he=1;break;case"mm":he=72/25.4;break;case"cm":he=72/2.54;break;case"in":he=72;break;case"px":he=1==wt("px_scaling")?.75:96/72;break;case"pc":case"em":he=12;break;case"ex":he=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);he=r}var Bt=null;O(),k();var bt=d.__private__.getPageInfo=d.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Qe[e].objId,pageNumber:e,pageContext:Qe[e]}},yt=d.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var t in Qe)if(Qe[t].objId===e)break;return bt(t)},vt=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Qe[D].objId,pageNumber:D,pageContext:Qe[D]}};d.addPage=function(){return it.apply(this,arguments),this},d.setPage=function(){return at.apply(this,arguments),Y.call(this,q[D]),this},d.insertPage=function(e){return this.addPage(),this.movePage(D,e),this},d.movePage=function(e,t){var A,r;if(e>t){A=q[e],r=Qe[e];for(var n=e;n>t;n--)q[n]=q[n-1],Qe[n]=Qe[n-1];q[t]=A,Qe[t]=r,this.setPage(t)}else if(e<t){A=q[e],r=Qe[e];for(var i=e;i<t;i++)q[i]=q[i+1],Qe[i]=Qe[i+1];q[t]=A,Qe[t]=r,this.setPage(t)}return this},d.deletePage=function(){return st.apply(this,arguments),this},d.__private__.text=d.text=function(e,t,A,r,n){var i,s,a,o,l,c,u,d,f,p=(r=r||{}).scope||this;if("number"==typeof e&&"number"==typeof t&&("string"==typeof A||Array.isArray(A))){var g=A;A=t,t=e,e=g}if(arguments[3]instanceof _e==0?(a=arguments[4],o=arguments[5],"object"===pe(u=arguments[3])&&null!==u||("string"==typeof a&&(o=a,a=null),"string"==typeof u&&(o=u,u=null),"number"==typeof u&&(a=u,u=null),r={flags:u,angle:a,align:o})):(F("The transform parameter of text() with a Matrix value"),f=n),isNaN(t)||isNaN(A)||null==e)throw new Error("Invalid arguments passed to jsPDF.text");if(0===e.length)return p;var m,w="",y="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Ht,v=p.internal.scaleFactor;function C(e){return e=e.split("\t").join(Array(r.TabLen||9).join(" ")),rt(e,u)}function Q(e){for(var t,A=e.concat(),r=[],n=A.length;n--;)"string"==typeof(t=A.shift())?r.push(t):Array.isArray(e)&&(1===t.length||void 0===t[1]&&void 0===t[2])?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function U(e,t){var A;if("string"==typeof e)A=t(e)[0];else if(Array.isArray(e)){for(var r,n,i=e.concat(),s=[],a=i.length;a--;)"string"==typeof(r=i.shift())?s.push(t(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(n=t(r[0],r[1],r[2]),s.push([n[0],n[1],n[2]]));A=s}return A}var S=!1,N=!0;if("string"==typeof e)S=!0;else if(Array.isArray(e)){var L=e.concat();s=[];for(var _,I=L.length;I--;)("string"!=typeof(_=L.shift())||Array.isArray(_)&&"string"!=typeof _[0])&&(N=!1);S=N}if(!1===S)throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');"string"==typeof e&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var k=te/p.internal.scaleFactor,T=k*(y-1);switch(r.baseline){case"bottom":A-=T;break;case"top":A+=k-T;break;case"hanging":A+=k-2*T;break;case"middle":A+=k/2-T}if((c=r.maxWidth||0)>0&&("string"==typeof e?e=p.splitTextToSize(e,c):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(p.splitTextToSize(t,c))},[]))),i={text:e,x:t,y:A,options:r,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:me,activeFontSize:te}},Ue.publish("preProcessText",i),e=i.text,a=(r=i.options).angle,f instanceof _e==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),b===B&&(a=-a);var H=Math.cos(a),O=Math.sin(a);f=new _e(H,O,-O,H,0,0)}else a&&a instanceof _e&&(f=a);b!==B||f||(f=ke),void 0!==(l=r.charSpace||Jt)&&(w+=x(E(l))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(w+=x(100*d)+" Tz\n"),r.lang;var P=-1,D=void 0!==r.renderingMode?r.renderingMode:r.stroke,M=p.internal.getCurrentPageInfo().pageContext;switch(D){case 0:case!1:case"fill":P=0;break;case 1:case!0:case"stroke":P=1;break;case 2:case"fillThenStroke":P=2;break;case 3:case"invisible":P=3;break;case 4:case"fillAndAddForClipping":P=4;break;case 5:case"strokeAndAddPathForClipping":P=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":P=6;break;case 7:case"addToPathForClipping":P=7}var j=void 0!==M.usedRenderingMode?M.usedRenderingMode:-1;-1!==P?w+=P+" Tr\n":-1!==j&&(w+="0 Tr\n"),-1!==P&&(M.usedRenderingMode=P),o=r.align||"left";var R,V=te*y,K=p.internal.pageSize.getWidth(),z=me[ue];l=r.charSpace||Jt,c=r.maxWidth||0,u=Object.assign({autoencode:!0,noBOM:!0},r.flags);var G=[],q=function(e){return p.getStringUnitWidth(e,{font:z,charSpace:l,fontSize:te,doKerning:!1})*te/v};if("[object Array]"===Object.prototype.toString.call(e)){var W;s=Q(e),"left"!==o&&(R=s.map(q));var X,Y=0;if("right"===o){t-=R[0],e=[],I=s.length;for(var $=0;$<I;$++)0===$?(X=Vt(t),W=Kt(A)):(X=E(Y-R[$]),W=-V),e.push([s[$],X,W]),Y=R[$]}else if("center"===o){t-=R[0]/2,e=[],I=s.length;for(var Z=0;Z<I;Z++)0===Z?(X=Vt(t),W=Kt(A)):(X=E((Y-R[Z])/2),W=-V),e.push([s[Z],X,W]),Y=R[Z]}else if("left"===o){e=[],I=s.length;for(var ee=0;ee<I;ee++)e.push(s[ee])}else if("justify"===o&&"Identity-H"===z.encoding){e=[],I=s.length,c=0!==c?c:K;for(var Ae=0,re=0;re<I;re++)if(W=0===re?Kt(A):-V,X=0===re?Vt(t):Ae,re<I-1){var ie=E((c-R[re])/(s[re].split(" ").length-1)),se=s[re].split(" ");e.push([se[0]+" ",X,W]),Ae=0;for(var ae=1;ae<se.length;ae++){var oe=(q(se[ae-1]+" "+se[ae])-q(se[ae]))*v+ie;ae==se.length-1?e.push([se[ae],oe,0]):e.push([se[ae]+" ",oe,0]),Ae-=oe}}else e.push([s[re],X,W]);e.push(["",Ae,0])}else{if("justify"!==o)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(e=[],I=s.length,c=0!==c?c:K,re=0;re<I;re++){W=0===re?Kt(A):-V,X=0===re?Vt(t):0;var le=s[re].split(" ").length-1,ce=le>0?(c-R[re])/le:0;re<I-1?G.push(x(E(ce))):G.push(0),e.push([s[re],X,W])}}}!0===("boolean"==typeof r.R2L?r.R2L:ne)&&(e=U(e,function(e,t,A){return[e.split("").reverse().join(""),t,A]})),i={text:e,x:t,y:A,options:r,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:me,activeFontSize:te}},Ue.publish("postProcessText",i),e=i.text,m=i.mutex.isHex||!1;var he=me[ue].encoding;"WinAnsiEncoding"!==he&&"StandardEncoding"!==he||(e=U(e,function(e,t,A){return[C(e),t,A]})),s=Q(e),e=[];for(var de,fe,ge,we=Array.isArray(s[0])?1:0,Be="",be=function(e,t,A){var n="";return A instanceof _e?(A="number"==typeof r.angle?Ie(A,new _e(1,0,0,1,e,t)):Ie(new _e(1,0,0,1,e,t),A),b===B&&(A=Ie(new _e(1,0,0,-1,0,0),A)),n=A.join(" ")+" Tm\n"):n=x(e)+" "+x(t)+" Td\n",n},ye=0;ye<s.length;ye++){switch(Be="",we){case 1:ge=(m?"<":"(")+s[ye][0]+(m?">":")"),de=parseFloat(s[ye][1]),fe=parseFloat(s[ye][2]);break;case 0:ge=(m?"<":"(")+s[ye]+(m?">":")"),de=Vt(t),fe=Kt(A)}void 0!==G&&void 0!==G[ye]&&(Be=G[ye]+" Tw\n"),0===ye?e.push(Be+be(de,fe,f)+ge):0===we?e.push(Be+ge):1===we&&e.push(Be+be(de,fe,f)+ge)}e=0===we?e.join(" Tj\nT* "):e.join(" Tj\n"),e+=" Tj\n";var ve="BT\n/";return ve+=ue+" "+te+" Tf\n",ve+=x(te*y)+" TL\n",ve+=Xt+"\n",ve+=w,ve+=e,J(ve+="ET"),h[ue]=!0,p};var Ct=d.__private__.clip=d.clip=function(e){return J("evenodd"===e?"W*":"W"),this};d.clipEvenOdd=function(){return Ct("evenodd")},d.__private__.discardPath=d.discardPath=function(){return J("n"),this};var xt=d.__private__.isValidStyle=function(e){var t=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(e)&&(t=!0),t};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(e){return xt(e)&&(l=e),this};var Ft=d.__private__.getStyle=d.getStyle=function(e){var t=l;switch(e){case"D":case"S":t="S";break;case"F":t="f";break;case"FD":case"DF":t="B";break;case"f":case"f*":case"B":case"B*":t=e}return t},Qt=d.close=function(){return J("h"),this};d.stroke=function(){return J("S"),this},d.fill=function(e){return Ut("f",e),this},d.fillEvenOdd=function(e){return Ut("f*",e),this},d.fillStroke=function(e){return Ut("B",e),this},d.fillStrokeEvenOdd=function(e){return Ut("B*",e),this};var Ut=function(e,t){"object"===pe(t)?Nt(t,e):J(e)},St=function(e){null===e||b===B&&void 0===e||(e=Ft(e),J(e))};function Et(e,t,A,r,n){var i=new qi(t||this.boundingBox,A||this.xStep,r||this.yStep,this.gState,n||this.matrix);i.stream=this.stream;var s=e+"$$"+this.cloneIndex+++"$$";return Te(s,i),i}var Nt=function(e,t){var A=ye[e.key],r=be[A];if(r instanceof Gi)J("q"),J(Lt(t)),r.gState&&d.setGState(r.gState),J(e.matrix.toString()+" cm"),J("/"+A+" sh"),J("Q");else if(r instanceof qi){var n=new _e(1,0,0,-1,0,dA());e.matrix&&(n=n.multiply(e.matrix||ke),A=Et.call(r,e.key,e.boundingBox,e.xStep,e.yStep,n).id),J("q"),J("/Pattern cs"),J("/"+A+" scn"),r.gState&&d.setGState(r.gState),J(t),J("Q")}},Lt=function(e){switch(e){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},_t=d.moveTo=function(e,t){return J(x(E(e))+" "+x(N(t))+" m"),this},It=d.lineTo=function(e,t){return J(x(E(e))+" "+x(N(t))+" l"),this},kt=d.curveTo=function(e,t,A,r,n,i){return J([x(E(e)),x(N(t)),x(E(A)),x(N(r)),x(E(n)),x(N(i)),"c"].join(" ")),this};d.__private__.line=d.line=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.line");return b===w?this.lines([[A-e,r-t]],e,t,[1,1],n||"S"):this.lines([[A-e,r-t]],e,t,[1,1]).stroke()},d.__private__.lines=d.lines=function(e,t,A,r,n,i){var s,a,o,l,c,u,h,d,f,p,g,m;if("number"==typeof e&&(m=A,A=t,t=e,e=m),r=r||[1,1],i=i||!1,isNaN(t)||isNaN(A)||!Array.isArray(e)||!Array.isArray(r)||!xt(n)||"boolean"!=typeof i)throw new Error("Invalid arguments passed to jsPDF.lines");for(_t(t,A),s=r[0],a=r[1],l=e.length,p=t,g=A,o=0;o<l;o++)2===(c=e[o]).length?(p=c[0]*s+p,g=c[1]*a+g,It(p,g)):(u=c[0]*s+p,h=c[1]*a+g,d=c[2]*s+p,f=c[3]*a+g,p=c[4]*s+p,g=c[5]*a+g,kt(u,h,d,f,p,g));return i&&Qt(),St(n),this},d.path=function(e){for(var t=0;t<e.length;t++){var A=e[t],r=A.c;switch(A.op){case"m":_t(r[0],r[1]);break;case"l":It(r[0],r[1]);break;case"c":kt.apply(this,r);break;case"h":Qt()}}return this},d.__private__.rect=d.rect=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.rect");return b===w&&(r=-r),J([x(E(e)),x(N(t)),x(E(A)),x(E(r)),"re"].join(" ")),St(n),this},d.__private__.triangle=d.triangle=function(e,t,A,r,n,i,s){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[A-e,r-t],[n-A,i-r],[e-n,t-i]],e,t,[1,1],s,!0),this},d.__private__.roundedRect=d.roundedRect=function(e,t,A,r,n,i,s){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return n=Math.min(n,.5*A),i=Math.min(i,.5*r),this.lines([[A-2*n,0],[n*a,0,n,i-i*a,n,i],[0,r-2*i],[0,i*a,-n*a,i,-n,i],[2*n-A,0],[-n*a,0,-n,-i*a,-n,-i],[0,2*i-r],[0,-i*a,n*a,-i,n,-i]],e+n,t,[1,1],s,!0),this},d.__private__.ellipse=d.ellipse=function(e,t,A,r,n){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.ellipse");var i=4/3*(Math.SQRT2-1)*A,s=4/3*(Math.SQRT2-1)*r;return _t(e+A,t),kt(e+A,t-s,e+i,t-r,e,t-r),kt(e-i,t-r,e-A,t-s,e-A,t),kt(e-A,t+s,e-i,t+r,e,t+r),kt(e+i,t+r,e+A,t+s,e+A,t),St(n),this},d.__private__.circle=d.circle=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||!xt(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(e,t,A,A,r)},d.setFont=function(e,t,A){return A&&(t=C(t,A)),ue=lt(e,t,{disableWarning:!1}),this};var Tt=d.__private__.getFont=d.getFont=function(){return me[lt.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var e,t,A={};for(e in we)if(we.hasOwnProperty(e))for(t in A[e]=[],we[e])we[e].hasOwnProperty(t)&&A[e].push(t);return A},d.addFont=function(e,t,A,r,n){var i=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==i.indexOf(arguments[3])?n=arguments[3]:arguments[3]&&-1==i.indexOf(arguments[3])&&(A=C(A,r)),At.call(this,e,t,A,n=n||"Identity-H")};var Ht,Ot=e.lineWidth||.200025,Pt=d.__private__.getLineWidth=d.getLineWidth=function(){return Ot},Dt=d.__private__.setLineWidth=d.setLineWidth=function(e){return Ot=e,J(x(E(e))+" w"),this};d.__private__.setLineDash=Wi.API.setLineDash=Wi.API.setLineDashPattern=function(e,t){if(e=e||[],t=t||0,isNaN(t)||!Array.isArray(e))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return e=e.map(function(e){return x(E(e))}).join(" "),t=x(E(t)),J("["+e+"] "+t+" d"),this};var Mt=d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ht};d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ht};var jt=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(e){return"number"==typeof(e=e||1.15)&&(Ht=e),this},Rt=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Ht};jt(e.lineHeight);var Vt=d.__private__.getHorizontalCoordinate=function(e){return E(e)},Kt=d.__private__.getVerticalCoordinate=function(e){return b===B?e:Qe[D].mediaBox.topRightY-Qe[D].mediaBox.bottomLeftY-E(e)},zt=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(e){return x(Vt(e))},Gt=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(e){return x(Kt(e))},qt=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Ve(qt)},d.__private__.setStrokeColor=d.setDrawColor=function(e,t,A,r){return qt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"draw",precision:2}),J(qt),this};var Wt=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Ve(Wt)},d.__private__.setFillColor=d.setFillColor=function(e,t,A,r){return Wt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"fill",precision:2}),J(Wt),this};var Xt=e.textColor||"0 g",Yt=d.__private__.getTextColor=d.getTextColor=function(){return Ve(Xt)};d.__private__.setTextColor=d.setTextColor=function(e,t,A,r){return Xt=Ke({ch1:e,ch2:t,ch3:A,ch4:r,pdfColorType:"text",precision:3}),this};var Jt=e.charSpace,$t=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(Jt||0)};d.__private__.setCharSpace=d.setCharSpace=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Jt=e,this};var Zt=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Zt=t,J(t+" J"),this};var eA=0;d.__private__.setLineJoin=d.setLineJoin=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return eA=t,J(t+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(e){if(e=e||0,isNaN(e))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return J(x(E(e))+" M"),this},d.GState=Ki,d.setGState=function(e){(e="string"==typeof e?ve[Ce[e]]:tA(null,e)).equals(xe)||(J("/"+e.id+" gs"),xe=e)};var tA=function(e,t){if(!e||!Ce[e]){var A=!1;for(var r in ve)if(ve.hasOwnProperty(r)&&ve[r].equals(t)){A=!0;break}if(A)t=ve[r];else{var n="GS"+(Object.keys(ve).length+1).toString(10);ve[n]=t,t.id=n}return e&&(Ce[e]=t.id),Ue.publish("addGState",t),t}};d.addGState=function(e,t){return tA(e,t),this},d.saveGraphicsState=function(){return J("q"),Be.push({key:ue,size:te,color:Xt}),this},d.restoreGraphicsState=function(){J("Q");var e=Be.pop();return ue=e.key,te=e.size,Xt=e.color,xe=null,this},d.setCurrentTransformationMatrix=function(e){return J(e.toString()+" cm"),this},d.comment=function(e){return J("#"+e),this};var AA=function(e,t){var A=e||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return A},set:function(e){isNaN(e)||(A=parseFloat(e))}});var r=t||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(e){isNaN(e)||(r=parseFloat(e))}});var n="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return n},set:function(e){n=e.toString()}}),this},rA=function(e,t,A,r){AA.call(this,e,t),this.type="rect";var n=A||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return n},set:function(e){isNaN(e)||(n=parseFloat(e))}});var i=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return i},set:function(e){isNaN(e)||(i=parseFloat(e))}}),this},nA=function(){this.page=Fe,this.currentPage=D,this.pages=q.slice(0),this.pagesContext=Qe.slice(0),this.x=de,this.y=fe,this.matrix=ge,this.width=aA(D),this.height=lA(D),this.outputDestination=X,this.id="",this.objectNumber=-1};nA.prototype.restore=function(){Fe=this.page,D=this.currentPage,Qe=this.pagesContext,q=this.pages,de=this.x,fe=this.y,ge=this.matrix,oA(D,this.width),cA(D,this.height),X=this.outputDestination};var iA=function(e,t,A,r,n){Le.push(new nA),Fe=D=0,q=[],de=e,fe=t,ge=n,nt([A,r])};for(var sA in d.beginFormObject=function(e,t,A,r,n){return iA(e,t,A,r,n),this},d.endFormObject=function(e){return function(e){if(Ne[e])Le.pop().restore();else{var t=new nA,A="Xo"+(Object.keys(Ee).length+1).toString(10);t.id=A,Ne[e]=A,Ee[A]=t,Ue.publish("addFormObject",t),Le.pop().restore()}}(e),this},d.doFormObject=function(e,t){var A=Ee[Ne[e]];return J("q"),J(t.toString()+" cm"),J("/"+A.id+" Do"),J("Q"),this},d.getFormObject=function(e){var t=Ee[Ne[e]];return{x:t.x,y:t.y,width:t.width,height:t.height,matrix:t.matrix}},d.save=function(e,t){return e=e||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1===t.returnPromise?(yi(gt(pt()),e),"function"==typeof yi.unload&&pi.setTimeout&&setTimeout(yi.unload,911),this):new Promise(function(t,A){try{var r=yi(gt(pt()),e);"function"==typeof yi.unload&&pi.setTimeout&&setTimeout(yi.unload,911),t(r)}catch(e){A(e.message)}})},Wi.API)Wi.API.hasOwnProperty(sA)&&("events"===sA&&Wi.API.events.length?function(e,t){var A,r,n;for(n=t.length-1;-1!==n;n--)A=t[n][0],r=t[n][1],e.subscribe.apply(e,[A].concat("function"==typeof r?[r]:r))}(Ue,Wi.API.events):d[sA]=Wi.API[sA]);function aA(e){return Qe[e].mediaBox.topRightX-Qe[e].mediaBox.bottomLeftX}function oA(e,t){Qe[e].mediaBox.topRightX=t+Qe[e].mediaBox.bottomLeftX}function lA(e){return Qe[e].mediaBox.topRightY-Qe[e].mediaBox.bottomLeftY}function cA(e,t){Qe[e].mediaBox.topRightY=t+Qe[e].mediaBox.bottomLeftY}var uA=d.getPageWidth=function(e){return aA(e=e||D)/he},hA=d.setPageWidth=function(e,t){oA(e,t*he)},dA=d.getPageHeight=function(e){return lA(e=e||D)/he},fA=d.setPageHeight=function(e,t){cA(e,t*he)};return d.internal={pdfEscape:rt,getStyle:Ft,getFont:Tt,getFontSize:re,getCharSpace:$t,getTextColor:Yt,getLineHeight:Mt,getLineHeightFactor:Rt,getLineWidth:Pt,write:$,getHorizontalCoordinate:Vt,getVerticalCoordinate:Kt,getCoordinateString:zt,getVerticalCoordinateString:Gt,collections:{},newObject:Oe,newAdditionalObject:Me,newObjectDeferred:Pe,newObjectDeferredBegin:De,getFilters:ze,putStream:Ge,events:Ue,scaleFactor:he,pageSize:{getWidth:function(){return uA(D)},setWidth:function(e){hA(D,e)},getHeight:function(){return dA(D)},setHeight:function(e){fA(D,e)}},encryptionOptions:c,encryption:Bt,getEncryptor:function(e){return null!==c?Bt.encryptor(e,0):function(e){return e}},output:mt,getNumberOfPages:ot,get pages(){return q},out:J,f2:U,f3:S,getPageInfo:bt,getPageInfoByObjId:yt,getCurrentPageInfo:vt,getPDFVersion:p,Point:AA,Rectangle:rA,Matrix:_e,hasHotfix:wt},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return uA(D)},set:function(e){hA(D,e)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return dA(D)},set:function(e){fA(D,e)},enumerable:!0,configurable:!0}),function(e){for(var t=0,A=ee.length;t<A;t++){var r=At.call(this,e[t][0],e[t][1],e[t][2],ee[t][3],!0);!1===u&&(h[r]=!0);var n=e[t][0].split("-");tt({id:r,fontName:n[0],fontStyle:n[1]||""})}Ue.publish("addFonts",{fonts:me,dictionary:we})}.call(d,ee),ue="F1",it(n,A),Ue.publish("initialized"),d}ji.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},ji.prototype.toHexString=function(e){return e.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},ji.prototype.hexToBytes=function(e){for(var t=[],A=0;A<e.length;A+=2)t.push(String.fromCharCode(parseInt(e.substr(A,2),16)));return t.join("")},ji.prototype.processOwnerPassword=function(e,t){return Di(Hi(t).substr(0,5),e)},ji.prototype.encryptor=function(e,t){var A=Hi(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return Di(A,e)}},Ki.prototype.equals=function(e){var t,A="id,objectNumber,equals";if(!e||pe(e)!==pe(this))return!1;var r=0;for(t in this)if(!(A.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t))return!1;if(this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&A.indexOf(t)<0&&r--;return 0===r},Wi.API={events:[]},Wi.version="4.0.0";var Xi=Wi.API,Yi=1,Ji=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},$i=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Zi=function(e){return e.toFixed(2)},es=function(e){return e.toFixed(5)};Xi.__acroform__={};var ts=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},As=function(e){return e*Yi},rs=function(e){var t=new Bs,A=Is.internal.getHeight(e)||0,r=Is.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Zi(r)),Number(Zi(A))],t},ns=Xi.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},is=Xi.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},ss=Xi.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},as=Xi.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return ss(e,t-1)},os=Xi.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return ns(e,t-1)},ls=Xi.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return is(e,t-1)},cs=Xi.__acroform__.calculateCoordinates=function(e,t){var A=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,n=e[0],i=e[1],s=e[2],a=e[3],o={};return o.lowerLeft_X=A(n)||0,o.lowerLeft_Y=r(i+a)||0,o.upperRight_X=A(n+s)||0,o.upperRight_Y=r(i)||0,[Number(Zi(o.lowerLeft_X)),Number(Zi(o.lowerLeft_Y)),Number(Zi(o.upperRight_X)),Number(Zi(o.upperRight_Y))]},us=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],A=e._V||e.DV,r=hs(e,A),n=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+n+" "+Zi(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var i=rs(e);return i.scope=e.scope,i.stream=t.join("\n"),i}},hs=function(e,t){var A=0===e.fontSize?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},n=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" ");n=e.multiline?n.map(function(e){return e.split("\n")}):n.map(function(e){return[e]});var i=A,s=Is.internal.getHeight(e)||0;s=s<0?-s:s;var a=Is.internal.getWidth(e)||0;a=a<0?-a:a;var o=function(t,A,r){if(t+1<n.length){var i=A+" "+n[t+1][0];return ds(i,e,r).width<=a-4}return!1};i++;e:for(;i>0;){t="",i--;var l,c,u=ds("3",e,i).height,h=e.multiline?s-i:(s-u)/2,d=h+=2,f=0,p=0,g=0;if(i<=0){t="(...) Tj\n",t+="% Width of Text: "+ds(t,e,i=12).width+", FieldWidth:"+a+"\n";break}for(var m="",w=0,B=0;B<n.length;B++)if(n.hasOwnProperty(B)){var b=!1;if(1!==n[B].length&&g!==n[B].length-1){if((u+2)*(w+2)+2>s)continue e;m+=n[B][g],b=!0,p=B,B--}else{m=" "==(m+=n[B][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var y=parseInt(B),v=o(y,m,i),C=B>=n.length-1;if(v&&!C){m+=" ",g=0;continue}if(v||C){if(C)p=y;else if(e.multiline&&(u+2)*(w+2)+2>s)continue e}else{if(!e.multiline)continue e;if((u+2)*(w+2)+2>s)continue e;p=y}}for(var x="",F=f;F<=p;F++){var Q=n[F];if(e.multiline){if(F===p){x+=Q[g]+" ",g=(g+1)%Q.length;continue}if(F===f){x+=Q[Q.length-1]+" ";continue}}x+=Q[0]+" "}switch(x=" "==x.substr(x.length-1)?x.substr(0,x.length-1):x,c=ds(x,e,i).width,e.textAlign){case"right":l=a-c-2;break;case"center":l=(a-c)/2;break;default:l=2}t+=Zi(l)+" "+Zi(d)+" Td\n",t+="("+Ji(x)+") Tj\n",t+=-Zi(l)+" 0 Td\n",d=-(i+2),c=0,f=b?p:p+1,w++,m=""}break}return r.text=t,r.fontSize=i,r},ds=function(e,t,A){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),n=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(A),charSpace:0})*parseFloat(A);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(A),charSpace:0})*parseFloat(A)*1.5,width:n}},fs={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},ps=function(e,t){var A={type:"reference",object:e};void 0===t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===A.type&&e.object===A.object})&&t.internal.getPageInfo(e.page).pageContext.annotations.push(A)},gs=Xi.__acroform__.arrayToPdfArray=function(e,t,A){var r=function(e){return e};if(Array.isArray(e)){for(var n="[",i=0;i<e.length;i++)switch(0!==i&&(n+=" "),pe(e[i])){case"boolean":case"number":case"object":n+=e[i].toString();break;case"string":"/"!==e[i].substr(0,1)?(void 0!==t&&A&&(r=A.internal.getEncryptor(t)),n+="("+Ji(r(e[i].toString()))+")"):n+=e[i].toString()}return n+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},ms=function(e,t,A){var r=function(e){return e};return void 0!==t&&A&&(r=A.internal.getEncryptor(t)),(e=e||"").toString(),"("+Ji(r(e))+")"},ws=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};ws.prototype.toString=function(){return this.objId+" 0 R"},ws.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},ws.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return"content"!=e&&"appearanceStreamContent"!=e&&"scope"!=e&&"objId"!=e&&"_"!=e.substring(0,1)});for(var A in t)if(!1===Object.getOwnPropertyDescriptor(this,t[A]).configurable){var r=t[A],n=this[r];n&&(Array.isArray(n)?e.push({key:r,value:gs(n,this.objId,this.scope)}):n instanceof ws?(n.scope=this.scope,e.push({key:r,value:n.objId+" 0 R"})):"function"!=typeof n&&e.push({key:r,value:n}))}return e};var Bs=function(){ws.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};ts(Bs,ws);var bs=function(){ws.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Ji(t(e))+")"}},set:function(t){e=t}})};ts(bs,ws);var ys=function e(){ws.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(t,3))},set:function(e){!0===Boolean(e)?this.F=os(t,3):this.F=ls(t,3)}});var A=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return A},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute Ff supplied.');A=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(e){r=void 0!==e?e:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var n="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){switch(e){case"/Btn":case"/Tx":case"/Ch":case"/Sig":n=e;break;default:throw new Error('Invalid value "'+e+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof Es)return;i="FieldObject"+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Ji(t(i))+")"},set:function(e){i=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(e){i=e}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(e){a=e}});var o=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return o},set:function(e){o=e}});var l=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===l?50/Yi:l},set:function(e){l=e}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(e){c=e}});var u="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!u||this instanceof Es||this instanceof Ls))return ms(u,this.objId,this.scope)},set:function(e){e=e.toString(),u=e}});var h=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof Qs==0?ms(h,this.objId,this.scope):h},set:function(e){e=e.toString(),h=this instanceof Qs==0?"("===e.substr(0,1)?$i(e.substr(1,e.length-2)):$i(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Qs==1?$i(h.substr(1,h.length-1)):h},set:function(e){e=e.toString(),h=this instanceof Qs==1?"/"+e:e}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Qs==0?ms(d,this.objId,this.scope):d},set:function(e){e=e.toString(),d=this instanceof Qs==0?"("===e.substr(0,1)?$i(e.substr(1,e.length-2)):$i(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Qs==1?$i(d.substr(1,d.length-1)):d},set:function(e){e=e.toString(),d=this instanceof Qs==1?"/"+e:e}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var f,p=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return p},set:function(e){e=Boolean(e),p=e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(f)return f},set:function(e){f=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,1))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,1):this.Ff=ls(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,2))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,2):this.Ff=ls(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,3))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,3):this.Ff=ls(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(e){if(-1===[0,1,2].indexOf(e))throw new Error('Invalid value "'+e+'" for attribute Q supplied.');g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e="left";break;case 1:e="center";break;case 2:e="right"}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};ts(ys,ws);var vs=function(){ys.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return gs(t,this.objId,this.scope)},set:function(e){var A,r;r=[],"string"==typeof(A=e)&&(r=function(e,t,A){A||(A=1);for(var r,n=[];r=t.exec(e);)n.push(r[A]);return n}(A,/\((.*?)\)/g)),t=r}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||"").toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,A){for(A=A||!1,e=(e=e||"").toString();-1!==t.indexOf(e)&&(t.splice(t.indexOf(e),1),!1!==A););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,18))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,18):this.Ff=ls(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,19))},set:function(e){!0===this.combo&&(!0===Boolean(e)?this.Ff=os(this.Ff,19):this.Ff=ls(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,20))},set:function(e){!0===Boolean(e)?(this.Ff=os(this.Ff,20),t.sort()):this.Ff=ls(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,22))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,22):this.Ff=ls(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,23):this.Ff=ls(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,27))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,27):this.Ff=ls(this.Ff,27)}}),this.hasAppearanceStream=!1};ts(vs,ys);var Cs=function(){vs.call(this),this.fontName="helvetica",this.combo=!1};ts(Cs,vs);var xs=function(){Cs.call(this),this.combo=!0};ts(xs,Cs);var Fs=function(){xs.call(this),this.edit=!0};ts(Fs,xs);var Qs=function(){ys.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,15))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,15):this.Ff=ls(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,16))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,16):this.Ff=ls(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,17))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,17):this.Ff=ls(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,26):this.Ff=ls(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(t).length){var A,r=[];for(A in r.push("<<"),t)r.push("/"+A+" ("+Ji(e(t[A]))+")");return r.push(">>"),r.join("\n")}},set:function(e){"object"===pe(e)&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};ts(Qs,ys);var Us=function(){Qs.call(this),this.pushButton=!0};ts(Us,Qs);var Ss=function(){Qs.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};ts(Ss,Qs);var Es=function(){var e,t;ys.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var A,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,A=[];for(t in A.push("<<"),r)A.push("/"+t+" ("+Ji(e(r[t]))+")");return A.push(">>"),A.join("\n")},set:function(e){"object"===pe(e)&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(e){"string"==typeof e&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return A},set:function(e){A=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return A.substr(1,A.length-1)},set:function(e){A="/"+e}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Is.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ts(Es,ys),Ss.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var A=this.Kids[t];A.appearanceStreamContent=e.createAppearanceStream(A.optionName),A.caption=e.getCA()}},Ss.prototype.createOption=function(e){var t=new Es;return t.Parent=this,t.optionName=e,this.Kids.push(t),ks.call(this.scope,t),t};var Ns=function(){Qs.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Is.CheckBox.createAppearanceStream()};ts(Ns,Qs);var Ls=function(){ys.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,13))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,13):this.Ff=ls(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,21))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,21):this.Ff=ls(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,23):this.Ff=ls(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,24))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,24):this.Ff=ls(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,25))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,25):this.Ff=ls(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,26):this.Ff=ls(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ts(Ls,ys);var _s=function(){Ls.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(as(this.Ff,14))},set:function(e){!0===Boolean(e)?this.Ff=os(this.Ff,14):this.Ff=ls(this.Ff,14)}}),this.password=!0};ts(_s,Ls);var Is={CheckBox:{createAppearanceStream:function(){return{N:{On:Is.CheckBox.YesNormal},D:{On:Is.CheckBox.YesPushDown,Off:Is.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),i=hs(e,e.caption);return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),A.push("BMC"),A.push("q"),A.push("0 0 1 rg"),A.push("/"+r+" "+Zi(i.fontSize)+" Tf "+n),A.push("BT"),A.push(i.text),A.push("ET"),A.push("Q"),A.push("EMC"),t.stream=A.join("\n"),t},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),n=[],i=Is.internal.getHeight(e),s=Is.internal.getWidth(e),a=hs(e,e.caption);return n.push("1 g"),n.push("0 0 "+Zi(s)+" "+Zi(i)+" re"),n.push("f"),n.push("q"),n.push("0 0 1 rg"),n.push("0 0 "+Zi(s-1)+" "+Zi(i-1)+" re"),n.push("W"),n.push("n"),n.push("0 g"),n.push("BT"),n.push("/"+A+" "+Zi(a.fontSize)+" Tf "+r),n.push(a.text),n.push("ET"),n.push("Q"),t.stream=n.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[];return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),t.stream=A.join("\n"),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Is.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Is.RadioButton.Circle.YesNormal,t.D[e]=Is.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Is.internal.Bezier_C,i=Number((r*n).toFixed(5));return A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(r+" 0 m"),A.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),A.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),A.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),A.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Number((2*r).toFixed(5)),i=Number((n*Is.internal.Bezier_C).toFixed(5)),s=Number((r*Is.internal.Bezier_C).toFixed(5));return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),A.push("0 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(r+" 0 m"),A.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),A.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),A.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),A.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.getWidth(e)<=Is.internal.getHeight(e)?Is.internal.getWidth(e)/4:Is.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var n=Number((2*r).toFixed(5)),i=Number((n*Is.internal.Bezier_C).toFixed(5));return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+es(Is.internal.getWidth(e)/2)+" "+es(Is.internal.getHeight(e)/2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),t.stream=A.join("\n"),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Is.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Is.RadioButton.Cross.YesNormal,t.D[e]=Is.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=rs(e);t.scope=e.scope;var A=[],r=Is.internal.calculateCross(e);return A.push("q"),A.push("1 1 "+Zi(Is.internal.getWidth(e)-2)+" "+Zi(Is.internal.getHeight(e)-2)+" re"),A.push("W"),A.push("n"),A.push(Zi(r.x1.x)+" "+Zi(r.x1.y)+" m"),A.push(Zi(r.x2.x)+" "+Zi(r.x2.y)+" l"),A.push(Zi(r.x4.x)+" "+Zi(r.x4.y)+" m"),A.push(Zi(r.x3.x)+" "+Zi(r.x3.y)+" l"),A.push("s"),A.push("Q"),t.stream=A.join("\n"),t},YesPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=Is.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Zi(Is.internal.getWidth(e)-2)+" "+Zi(Is.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Zi(A.x1.x)+" "+Zi(A.x1.y)+" m"),r.push(Zi(A.x2.x)+" "+Zi(A.x2.y)+" l"),r.push(Zi(A.x4.x)+" "+Zi(A.x4.y)+" m"),r.push(Zi(A.x3.x)+" "+Zi(A.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join("\n"),t},OffPushDown:function(e){var t=rs(e);t.scope=e.scope;var A=[];return A.push("0.749023 g"),A.push("0 0 "+Zi(Is.internal.getWidth(e))+" "+Zi(Is.internal.getHeight(e))+" re"),A.push("f"),t.stream=A.join("\n"),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,A=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+A}};Is.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Is.internal.getWidth(e),A=Is.internal.getHeight(e),r=Math.min(t,A);return{x1:{x:(t-r)/2,y:(A-r)/2+r},x2:{x:(t-r)/2+r,y:(A-r)/2},x3:{x:(t-r)/2,y:(A-r)/2},x4:{x:(t-r)/2+r,y:(A-r)/2+r}}}},Is.internal.getWidth=function(e){var t=0;return"object"===pe(e)&&(t=As(e.Rect[2])),t},Is.internal.getHeight=function(e){var t=0;return"object"===pe(e)&&(t=As(e.Rect[3])),t};var ks=Xi.addField=function(e){if(function(e,t){if(t.scope=e,void 0!==e.internal&&(void 0===e.internal.acroformPlugin||!1===e.internal.acroformPlugin.isInitialized)){if(ys.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(fs)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Yi=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new bs,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){!function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0}(e)}),e.internal.events.subscribe("buildDocument",function(){!function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var A in t)if(t.hasOwnProperty(A)){var r=t[A];r.objId=void 0,r.hasAnnotation&&ps(r,e)}}(e)}),e.internal.events.subscribe("putCatalog",function(){!function(e){if(void 0===e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");e.internal.write("/AcroForm "+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(e)}),e.internal.events.subscribe("postPutPages",function(t){!function(e,t){var A=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var n=e[r],i=[],s=n.Rect;if(n.Rect&&(n.Rect=cs(n.Rect,t)),t.internal.newObjectDeferredBegin(n.objId,!0),n.DA=Is.createDefaultAppearanceStream(n),"object"===pe(n)&&"function"==typeof n.getKeyValueListForStream&&(i=n.getKeyValueListForStream()),n.Rect=s,n.hasAppearanceStream&&!n.appearanceStreamContent){var a=us(n);i.push({key:"AP",value:"<</N "+a+">>"}),t.internal.acroformPlugin.xForms.push(a)}if(n.appearanceStreamContent){var o="";for(var l in n.appearanceStreamContent)if(n.appearanceStreamContent.hasOwnProperty(l)){var c=n.appearanceStreamContent[l];if(o+="/"+l+" ",o+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var r in c)if(c.hasOwnProperty(r)){var u=c[r];"function"==typeof u&&(u=u.call(t,n)),o+="/"+r+" "+u+" ",t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=c)&&(u=u.call(t,n)),o+="/"+r+" "+u,t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u);o+=">>"}i.push({key:"AP",value:"<<\n"+o+">>"})}t.internal.putStream({additionalKeyValues:i,objectId:n.objId}),t.internal.out("endobj")}A&&function(e,t){for(var A in e)if(e.hasOwnProperty(A)){var r=A,n=e[A];t.internal.newObjectDeferredBegin(n.objId,!0),"object"===pe(n)&&"function"==typeof n.putStream&&n.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)}(t,e)}),e.internal.acroformPlugin.isInitialized=!0}}(this,e),!(e instanceof ys))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};function Ts(e){return e.reduce(function(e,t,A){return e[t]=A,e},{})}Xi.AcroFormChoiceField=vs,Xi.AcroFormListBox=Cs,Xi.AcroFormComboBox=xs,Xi.AcroFormEditBox=Fs,Xi.AcroFormButton=Qs,Xi.AcroFormPushButton=Us,Xi.AcroFormRadioButton=Ss,Xi.AcroFormCheckBox=Ns,Xi.AcroFormTextField=Ls,Xi.AcroFormPasswordField=_s,Xi.AcroFormAppearance=Is,Xi.AcroForm={ChoiceField:vs,ListBox:Cs,ComboBox:xs,EditBox:Fs,Button:Qs,PushButton:Us,RadioButton:Ss,CheckBox:Ns,TextField:Ls,PasswordField:_s,Appearance:Is},Wi.AcroForm={ChoiceField:vs,ListBox:Cs,ComboBox:xs,EditBox:Fs,Button:Qs,PushButton:Us,RadioButton:Ss,CheckBox:Ns,TextField:Ls,PasswordField:_s,Appearance:Is},function(e){var t="addImage_";e.__addimage__={};var A="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]]},n=e.__addimage__.getImageFileTypeByImageData=function(e,t){var n,i,s,a,o,l=A;if("RGBA"===(t=t||A)||void 0!==e.data&&e.data instanceof Uint8ClampedArray&&"height"in e&&"width"in e)return"RGBA";if(v(e))for(o in r)for(s=r[o],n=0;n<s.length;n+=1){for(a=!0,i=0;i<s[n].length;i+=1)if(void 0!==s[n][i]&&s[n][i]!==e[i]){a=!1;break}if(!0===a){l=o;break}}else for(o in r)for(s=r[o],n=0;n<s.length;n+=1){for(a=!0,i=0;i<s[n].length;i+=1)if(void 0!==s[n][i]&&s[n][i]!==e.charCodeAt(i)){a=!1;break}if(!0===a){l=o;break}}return l===A&&t!==A&&(l=t),l},i=function e(t){for(var A=this.internal.write,r=this.internal.putStream,n=(0,this.internal.getFilters)();-1!==n.indexOf("FlateEncode");)n.splice(n.indexOf("FlateEncode"),1);t.objectId=this.internal.newObject();var i=[];if(i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Image"}),i.push({key:"Width",value:t.width}),i.push({key:"Height",value:t.height}),t.colorSpace===m.INDEXED?i.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(i.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===m.DEVICE_CMYK&&i.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),i.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&i.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var s="",a=0,o=t.transparency.length;a<o;a++)s+=t.transparency[a]+" "+t.transparency[a]+" ";i.push({key:"Mask",value:"["+s+"]"})}void 0!==t.sMask&&i.push({key:"SMask",value:t.objectId+1+" 0 R"});var l=void 0!==t.filter?["/"+t.filter]:void 0;if(r({data:t.data,additionalKeyValues:i,alreadyAppliedFilters:l,objectId:t.objectId}),A("endobj"),"sMask"in t&&void 0!==t.sMask){var c,u=null!==(c=t.sMaskBitsPerComponent)&&void 0!==c?c:t.bitsPerComponent,h={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:u,data:t.sMask};"filter"in t&&(h.decodeParameters="/Predictor ".concat(t.predictor," /Colors 1 /BitsPerComponent ").concat(u," /Columns ").concat(t.width),h.filter=t.filter),e.call(this,h)}if(t.colorSpace===m.INDEXED){var d=this.internal.newObject();r({data:x(new Uint8Array(t.palette)),objectId:d}),A("endobj")}},s=function(){var e=this.internal.collections[t+"images"];for(var A in e)i.call(this,e[A])},a=function(){var e,A=this.internal.collections[t+"images"],r=this.internal.write;for(var n in A)r("/I"+(e=A[n]).index,e.objectId,"0","R")},o=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",a))},l=function(){var e=this.internal.collections[t+"images"];return o.call(this),e},c=function(){return Object.keys(this.internal.collections[t+"images"]).length},u=function(t){return"function"==typeof e["process"+t.toUpperCase()]},h=function(e){return"object"===pe(e)&&1===e.nodeType},d=function(t,A){if("IMG"===t.nodeName&&t.hasAttribute("src")){var r=""+t.getAttribute("src");if(0===r.indexOf("data:image/"))return Ci(unescape(r).split("base64,").pop());var n=e.loadFile(r,!0);if(void 0!==n)return n}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw new Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);var i;switch(A){case"PNG":i="image/png";break;case"WEBP":i="image/webp";break;default:i="image/jpeg"}return Ci(t.toDataURL(i,1).split("base64,").pop())}},f=function(e){var A=this.internal.collections[t+"images"];if(A)for(var r in A)if(e===A[r].alias)return A[r]},p=function(e,t,A){return e||t||(e=-96,t=-96),e<0&&(e=-1*A.width*72/e/this.internal.scaleFactor),t<0&&(t=-1*A.height*72/t/this.internal.scaleFactor),0===e&&(e=t*A.width/A.height),0===t&&(t=e*A.height/A.width),[e,t]},g=function(e,t,A,r,n,i){var s=p.call(this,A,r,n),a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,c=l.call(this);if(A=s[0],r=s[1],c[n.index]=n,i){i*=Math.PI/180;var u=Math.cos(i),h=Math.sin(i),d=function(e){return e.toFixed(4)},f=[d(u),d(h),d(-1*h),d(u),0,0,"cm"]}this.internal.write("q"),i?(this.internal.write([1,"0","0",1,a(e),o(t+r),"cm"].join(" ")),this.internal.write(f.join(" ")),this.internal.write([a(A),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(A),"0","0",a(r),a(e),o(t+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+n.index+" Do"),this.internal.write("Q")},m=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var w=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},B=e.__addimage__.sHashCode=function(e){var t,A,r=0;if("string"==typeof e)for(A=e.length,t=0;t<A;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;else if(v(e))for(A=e.byteLength/2,t=0;t<A;t++)r=(r<<5)-r+e[t],r|=0;return r},b=e.__addimage__.validateStringAsBase64=function(e){(e=e||"").toString().trim();var t=!0;return 0===e.length&&(t=!1),e.length%4!=0&&(t=!1),!1===/^[A-Za-z0-9+/]+$/.test(e.substr(0,e.length-2))&&(t=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2))&&(t=!1),t},y=e.__addimage__.extractImageFromDataUrl=function(e){if(null==e)return null;if(!(e=e.trim()).startsWith("data:"))return null;var t=e.indexOf(",");return t<0?null:e.substring(0,t).trim().endsWith("base64")?e.substring(t+1):null};e.__addimage__.isArrayBuffer=function(e){return e instanceof ArrayBuffer};var v=e.__addimage__.isArrayBufferView=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},C=e.__addimage__.binaryStringToUint8Array=function(e){for(var t=e.length,A=new Uint8Array(t),r=0;r<t;r++)A[r]=e.charCodeAt(r);return A},x=e.__addimage__.arrayBufferToBinaryString=function(e){for(var t="",A=v(e)?e:new Uint8Array(e),r=0;r<A.length;r+=8192)t+=String.fromCharCode.apply(null,A.subarray(r,r+8192));return t};e.addImage=function(){var e,t,r,n,i,s,a,l,c;if("number"==typeof arguments[1]?(t=A,r=arguments[1],n=arguments[2],i=arguments[3],s=arguments[4],a=arguments[5],l=arguments[6],c=arguments[7]):(t=arguments[1],r=arguments[2],n=arguments[3],i=arguments[4],s=arguments[5],a=arguments[6],l=arguments[7],c=arguments[8]),"object"===pe(e=arguments[0])&&!h(e)&&"imageData"in e){var u=e;e=u.imageData,t=u.format||t||A,r=u.x||r||0,n=u.y||n||0,i=u.w||u.width||i,s=u.h||u.height||s,a=u.alias||a,l=u.compression||l,c=u.rotation||u.angle||c}var d=this.internal.getFilters();if(void 0===l&&-1!==d.indexOf("FlateEncode")&&(l="SLOW"),isNaN(r)||isNaN(n))throw new Error("Invalid coordinates passed to jsPDF.addImage");o.call(this);var f=F.call(this,e,t,a,l);return g.call(this,r,n,i,s,f,c),this};var F=function(t,r,i,s){var a,o,l;if("string"==typeof t&&n(t)===A){t=unescape(t);var p=Q(t,!1);(""!==p||void 0!==(p=e.loadFile(t,!0)))&&(t=p)}if(h(t)&&(t=d(t,r)),r=n(t,r),!u(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if((null==(l=i)||0===l.length)&&(i=function(e){return"string"==typeof e||v(e)?B(e):v(e.data)?B(e.data):null}(t)),(a=f.call(this,i))||(t instanceof Uint8Array||"RGBA"===r||(o=t,t=C(t)),a=this["process"+r.toUpperCase()](t,c.call(this),i,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:w.NONE}(s),o)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},Q=e.__addimage__.convertBase64ToBinaryString=function(e,t){t="boolean"!=typeof t||t;var A,r="";if("string"==typeof e){var n;A=null!==(n=y(e))&&void 0!==n?n:e;try{r=Ci(A)}catch(e){if(t)throw b(A)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};e.getImageProperties=function(t){var r,i,s="";if(h(t)&&(t=d(t)),"string"==typeof t&&n(t)===A&&(""===(s=Q(t,!1))&&(s=e.loadFile(t)||""),t=s),i=n(t),!u(i))throw new Error("addImage does not support files of type '"+i+"', please ensure that a plugin for '"+i+"' support is added.");if(t instanceof Uint8Array||(t=C(t)),!(r=this["process"+i.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return r.fileType=i,r}}(Wi.API),
|
|
116
116
|
/**
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
@@ -135,7 +135,7 @@ function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[6515
|
|
|
135
135
|
*
|
|
136
136
|
* Licensed under the MIT License.
|
|
137
137
|
* http://opensource.org/licenses/mit-license
|
|
138
|
-
*/},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=t+1)}});var A=300;Object.defineProperty(this,"height",{get:function(){return A},set:function(e){A=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=A+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(e){r=e}});var n={};Object.defineProperty(this,"style",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var A;if("2d"!==(e=e||"2d"))return null;for(A in t)this.pdf.context2d.hasOwnProperty(A)&&(this.pdf.context2d[A]=t[A]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Wi.API),function(e){var t={left:0,top:0,bottom:0,right:0},A=!1,r=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),n.call(this))},n=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var A=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return A},set:function(e){A=e}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var n=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var i=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(e){s=e}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(e){return r.call(this),this.internal.__cell__.headerFunction="function"==typeof e?e:void 0,this},e.getTextDimensions=function(e,t){r.call(this);var A=(t=t||{}).fontSize||this.getFontSize(),n=t.font||this.getFont(),i=t.scaleFactor||this.internal.scaleFactor,s=0,a=0,o=0,l=this;if(!Array.isArray(e)&&"string"!=typeof e){if("number"!=typeof e)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");e=String(e)}var c=t.maxWidth;c>0?"string"==typeof e?e=this.splitTextToSize(e,c):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(l.splitTextToSize(t,c))},[])):e=Array.isArray(e)?e:[e];for(var u=0;u<e.length;u++)s<(o=this.getStringUnitWidth(e[u],{font:n})*A)&&(s=o);return 0!==s&&(a=e.length),{w:s/=i,h:Math.max((a*A*this.getLineHeightFactor()-A*(this.getLineHeightFactor()-1))/i,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var e=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new i(e.left,e.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var e;e=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var n=this.internal.__cell__.lastCell,s=this.internal.__cell__.padding,a=this.internal.__cell__.margins||t,o=this.internal.__cell__.tableHeaderRow,l=this.internal.__cell__.printHeaders;return void 0!==n.lineNumber&&(n.lineNumber===e.lineNumber?(e.x=(n.x||0)+(n.width||0),e.y=n.y||0):n.y+n.height+e.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),e.y=a.top,l&&o&&(this.printHeaderRow(e.lineNumber,!0),e.y+=o[0].height)):e.y=n.y+n.height||e.y),void 0!==e.text[0]&&(this.rect(e.x,e.y,e.width,e.height,!0===A?"FD":void 0),"right"===e.align?this.text(e.text,e.x+e.width-s,e.y+s,{align:"right",baseline:"top"}):"center"===e.align?this.text(e.text,e.x+e.width/2,e.y+s,{align:"center",baseline:"top",maxWidth:e.width-s-s}):this.text(e.text,e.x+s,e.y+s,{align:"left",baseline:"top",maxWidth:e.width-s-s})),this.internal.__cell__.lastCell=e,this};e.table=function(e,A,o,l,c){if(r.call(this),!o)throw new Error("No data for PDF table.");var u,h,d,f,p=[],g=[],m=[],w={},B={},b=[],y=[],v=(c=c||{}).autoSize||!1,C=!1!==c.printHeaders,x=c.css&&void 0!==c.css["font-size"]?16*c.css["font-size"]:c.fontSize||12,F=c.margins||Object.assign({width:this.getPageWidth()},t),Q="number"==typeof c.padding?c.padding:3,U=c.headerBackgroundColor||"#c8c8c8",S=c.headerTextColor||"#000";if(n.call(this),this.internal.__cell__.printHeaders=C,this.internal.__cell__.margins=F,this.internal.__cell__.table_font_size=x,this.internal.__cell__.padding=Q,this.internal.__cell__.headerBackgroundColor=U,this.internal.__cell__.headerTextColor=S,this.setFontSize(x),null==l)g=p=Object.keys(o[0]),m=p.map(function(){return"left"});else if(Array.isArray(l)&&"object"===pe(l[0]))for(p=l.map(function(e){return e.name}),g=l.map(function(e){return e.prompt||e.name||""}),m=l.map(function(e){return e.align||"left"}),u=0;u<l.length;u+=1)B[l[u].name]=.7499990551181103*l[u].width;else Array.isArray(l)&&"string"==typeof l[0]&&(g=p=l,m=p.map(function(){return"left"}));if(v||Array.isArray(l)&&"string"==typeof l[0])for(u=0;u<p.length;u+=1){for(w[f=p[u]]=o.map(function(e){return e[f]}),this.setFont(void 0,"bold"),b.push(this.getTextDimensions(g[u],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),h=w[f],this.setFont(void 0,"normal"),d=0;d<h.length;d+=1)b.push(this.getTextDimensions(h[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);B[f]=Math.max.apply(null,b)+Q+Q,b=[]}if(C){var E={};for(u=0;u<p.length;u+=1)E[p[u]]={},E[p[u]].text=g[u],E[p[u]].align=m[u];var N=a.call(this,E,B);y=p.map(function(t){return new i(e,A,B[t],N,E[t].text,void 0,E[t].align)}),this.setTableHeaderRow(y),this.printHeaderRow(1,!1)}var L=l.reduce(function(e,t){return e[t.name]=t.align,e},{});for(u=0;u<o.length;u+=1){"rowStart"in c&&c.rowStart instanceof Function&&c.rowStart({row:u,data:o[u]},this);var _=a.call(this,o[u],B);for(d=0;d<p.length;d+=1){var I=o[u][p[d]];"cellStart"in c&&c.cellStart instanceof Function&&c.cellStart({row:u,col:d,data:I},this),s.call(this,new i(e,A,B[p[d]],_,I,u+2,L[p[d]]))}}return this.internal.__cell__.table_x=e,this.internal.__cell__.table_y=A,this};var a=function(e,t){var A=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,n=this.internal.scaleFactor;return Object.keys(e).map(function(r){var n=e[r];return this.splitTextToSize(n.hasOwnProperty("text")?n.text:n,t[r]-A-A)},this).map(function(e){return this.getLineHeightFactor()*e.length*r/n+A+A},this).reduce(function(e,t){return Math.max(e,t)},0)};e.setTableHeaderRow=function(e){r.call(this),this.internal.__cell__.tableHeaderRow=e},e.printHeaderRow=function(e,t){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var n;if(A=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var o=[],l=0;l<this.internal.__cell__.tableHeaderRow.length;l+=1){n=this.internal.__cell__.tableHeaderRow[l].clone(),t&&(n.y=this.internal.__cell__.margins.top||0,o.push(n)),n.lineNumber=e;var c=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,n),this.setTextColor(c)}o.length>0&&this.setTableHeaderRow(o),this.setFont(void 0,"normal"),A=!1}}(Wi.API);var Hs={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Os=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Ps=Ts(Os),Ds=[100,200,300,400,500,600,700,800,900],Ms=Ts(Ds);function js(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),A=function(e){return Hs[e=e||"normal"]?e:"normal"}(e.style),r=function(e){return e?"number"==typeof e?e>=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):"bold"===e?700:400:400}(e.weight),n=function(e){return"number"==typeof Ps[e=e||"normal"]?e:"normal"}(e.stretch);return{family:t,style:A,weight:r,stretch:n,src:e.src||[],ref:e.ref||{name:t,style:[n,A,r].join(" ")}}}function Rs(e,t,A,r){var n;for(n=A;n>=0&&n<t.length;n+=r)if(e[t[n]])return e[t[n]];for(n=A;n>=0&&n<t.length;n-=r)if(e[t[n]])return e[t[n]]}var Vs={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Ks={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Gs(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function zs(e){return e.trimLeft()}function qs(e,t){for(var A=0;A<e.length;){if(e.charAt(A)===t)return[e.substring(0,A),e.substring(A+1)];A+=1}return null}function Ws(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===t?null:[t[0],e.substring(t[0].length)]}var Xs,Ys,Js,$s,Zs,ea,ta,Aa,ra=["times"];function na(e,t,A,r,n){var i=4,s=aa;switch(n){case Wi.API.image_compression.FAST:i=1,s=sa;break;case Wi.API.image_compression.MEDIUM:i=6,s=oa;break;case Wi.API.image_compression.SLOW:i=9,s=la}e=function(e,t,A,r){for(var n,i=e.length/t,s=new Uint8Array(e.length+i),a=[ia,sa,aa,oa,la],o=0;o<i;o+=1){var l=o*t,c=e.subarray(l,l+t);if(r)s.set(r(c,A,n),l+o);else{for(var u=a.length,h=[],d=0;d<u;d+=1)h[d]=a[d](c,A,n);var f=ua(h.concat());s.set(h[f],l+o)}n=c}return s}(e,t,Math.ceil(A*r/8),s);var a=Xe(e,{level:i});return Wi.API.__addimage__.arrayBufferToBinaryString(a)}function ia(e){var t=Array.apply([],e);return t.unshift(0),t}function sa(e,t){var A=e.length,r=[];r[0]=1;for(var n=0;n<A;n+=1){var i=e[n-t]||0;r[n+1]=e[n]-i+256&255}return r}function aa(e,t,A){var r=e.length,n=[];n[0]=2;for(var i=0;i<r;i+=1){var s=A&&A[i]||0;n[i+1]=e[i]-s+256&255}return n}function oa(e,t,A){var r=e.length,n=[];n[0]=3;for(var i=0;i<r;i+=1){var s=e[i-t]||0,a=A&&A[i]||0;n[i+1]=e[i]+256-(s+a>>>1)&255}return n}function la(e,t,A){var r=e.length,n=[];n[0]=4;for(var i=0;i<r;i+=1){var s=ca(e[i-t]||0,A&&A[i]||0,A&&A[i-t]||0);n[i+1]=e[i]-s+256&255}return n}function ca(e,t,A){if(e===t&&t===A)return e;var r=Math.abs(t-A),n=Math.abs(e-A),i=Math.abs(e+t-A-A);return r<=n&&r<=i?e:n<=i?t:A}function ua(e){var t=e.map(function(e){return e.reduce(function(e,t){return e+Math.abs(t)},0)});return t.indexOf(Math.min.apply(null,t))}function ha(e,t,A){var r=t*A,n=Math.floor(r/8),i=16-(r-8*n+A),s=(1<<A)-1;return fa(e,n)>>i&s}function da(e,t,A,r){var n=A*r,i=Math.floor(n/8),s=16-(n-8*i+r),a=(1<<r)-1,o=(t&a)<<s;!function(e,t,A){if(t+1<e.byteLength)e.setUint16(t,A,!1);else{var r=A>>8&255;e.setUint8(t,r)}}
|
|
138
|
+
*/},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=t+1)}});var A=300;Object.defineProperty(this,"height",{get:function(){return A},set:function(e){A=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=A+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(e){r=e}});var n={};Object.defineProperty(this,"style",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var A;if("2d"!==(e=e||"2d"))return null;for(A in t)this.pdf.context2d.hasOwnProperty(A)&&(this.pdf.context2d[A]=t[A]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Wi.API),function(e){var t={left:0,top:0,bottom:0,right:0},A=!1,r=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),n.call(this))},n=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var A=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return A},set:function(e){A=e}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var n=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var i=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(e){s=e}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(e){return r.call(this),this.internal.__cell__.headerFunction="function"==typeof e?e:void 0,this},e.getTextDimensions=function(e,t){r.call(this);var A=(t=t||{}).fontSize||this.getFontSize(),n=t.font||this.getFont(),i=t.scaleFactor||this.internal.scaleFactor,s=0,a=0,o=0,l=this;if(!Array.isArray(e)&&"string"!=typeof e){if("number"!=typeof e)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");e=String(e)}var c=t.maxWidth;c>0?"string"==typeof e?e=this.splitTextToSize(e,c):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(l.splitTextToSize(t,c))},[])):e=Array.isArray(e)?e:[e];for(var u=0;u<e.length;u++)s<(o=this.getStringUnitWidth(e[u],{font:n})*A)&&(s=o);return 0!==s&&(a=e.length),{w:s/=i,h:Math.max((a*A*this.getLineHeightFactor()-A*(this.getLineHeightFactor()-1))/i,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var e=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new i(e.left,e.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var e;e=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var n=this.internal.__cell__.lastCell,s=this.internal.__cell__.padding,a=this.internal.__cell__.margins||t,o=this.internal.__cell__.tableHeaderRow,l=this.internal.__cell__.printHeaders;return void 0!==n.lineNumber&&(n.lineNumber===e.lineNumber?(e.x=(n.x||0)+(n.width||0),e.y=n.y||0):n.y+n.height+e.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),e.y=a.top,l&&o&&(this.printHeaderRow(e.lineNumber,!0),e.y+=o[0].height)):e.y=n.y+n.height||e.y),void 0!==e.text[0]&&(this.rect(e.x,e.y,e.width,e.height,!0===A?"FD":void 0),"right"===e.align?this.text(e.text,e.x+e.width-s,e.y+s,{align:"right",baseline:"top"}):"center"===e.align?this.text(e.text,e.x+e.width/2,e.y+s,{align:"center",baseline:"top",maxWidth:e.width-s-s}):this.text(e.text,e.x+s,e.y+s,{align:"left",baseline:"top",maxWidth:e.width-s-s})),this.internal.__cell__.lastCell=e,this};e.table=function(e,A,o,l,c){if(r.call(this),!o)throw new Error("No data for PDF table.");var u,h,d,f,p=[],g=[],m=[],w={},B={},b=[],y=[],v=(c=c||{}).autoSize||!1,C=!1!==c.printHeaders,x=c.css&&void 0!==c.css["font-size"]?16*c.css["font-size"]:c.fontSize||12,F=c.margins||Object.assign({width:this.getPageWidth()},t),Q="number"==typeof c.padding?c.padding:3,U=c.headerBackgroundColor||"#c8c8c8",S=c.headerTextColor||"#000";if(n.call(this),this.internal.__cell__.printHeaders=C,this.internal.__cell__.margins=F,this.internal.__cell__.table_font_size=x,this.internal.__cell__.padding=Q,this.internal.__cell__.headerBackgroundColor=U,this.internal.__cell__.headerTextColor=S,this.setFontSize(x),null==l)g=p=Object.keys(o[0]),m=p.map(function(){return"left"});else if(Array.isArray(l)&&"object"===pe(l[0]))for(p=l.map(function(e){return e.name}),g=l.map(function(e){return e.prompt||e.name||""}),m=l.map(function(e){return e.align||"left"}),u=0;u<l.length;u+=1)B[l[u].name]=.7499990551181103*l[u].width;else Array.isArray(l)&&"string"==typeof l[0]&&(g=p=l,m=p.map(function(){return"left"}));if(v||Array.isArray(l)&&"string"==typeof l[0])for(u=0;u<p.length;u+=1){for(w[f=p[u]]=o.map(function(e){return e[f]}),this.setFont(void 0,"bold"),b.push(this.getTextDimensions(g[u],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),h=w[f],this.setFont(void 0,"normal"),d=0;d<h.length;d+=1)b.push(this.getTextDimensions(h[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);B[f]=Math.max.apply(null,b)+Q+Q,b=[]}if(C){var E={};for(u=0;u<p.length;u+=1)E[p[u]]={},E[p[u]].text=g[u],E[p[u]].align=m[u];var N=a.call(this,E,B);y=p.map(function(t){return new i(e,A,B[t],N,E[t].text,void 0,E[t].align)}),this.setTableHeaderRow(y),this.printHeaderRow(1,!1)}var L=l.reduce(function(e,t){return e[t.name]=t.align,e},{});for(u=0;u<o.length;u+=1){"rowStart"in c&&c.rowStart instanceof Function&&c.rowStart({row:u,data:o[u]},this);var _=a.call(this,o[u],B);for(d=0;d<p.length;d+=1){var I=o[u][p[d]];"cellStart"in c&&c.cellStart instanceof Function&&c.cellStart({row:u,col:d,data:I},this),s.call(this,new i(e,A,B[p[d]],_,I,u+2,L[p[d]]))}}return this.internal.__cell__.table_x=e,this.internal.__cell__.table_y=A,this};var a=function(e,t){var A=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,n=this.internal.scaleFactor;return Object.keys(e).map(function(r){var n=e[r];return this.splitTextToSize(n.hasOwnProperty("text")?n.text:n,t[r]-A-A)},this).map(function(e){return this.getLineHeightFactor()*e.length*r/n+A+A},this).reduce(function(e,t){return Math.max(e,t)},0)};e.setTableHeaderRow=function(e){r.call(this),this.internal.__cell__.tableHeaderRow=e},e.printHeaderRow=function(e,t){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var n;if(A=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var o=[],l=0;l<this.internal.__cell__.tableHeaderRow.length;l+=1){n=this.internal.__cell__.tableHeaderRow[l].clone(),t&&(n.y=this.internal.__cell__.margins.top||0,o.push(n)),n.lineNumber=e;var c=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,n),this.setTextColor(c)}o.length>0&&this.setTableHeaderRow(o),this.setFont(void 0,"normal"),A=!1}}(Wi.API);var Hs={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Os=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Ps=Ts(Os),Ds=[100,200,300,400,500,600,700,800,900],Ms=Ts(Ds);function js(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),A=function(e){return Hs[e=e||"normal"]?e:"normal"}(e.style),r=function(e){return e?"number"==typeof e?e>=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):"bold"===e?700:400:400}(e.weight),n=function(e){return"number"==typeof Ps[e=e||"normal"]?e:"normal"}(e.stretch);return{family:t,style:A,weight:r,stretch:n,src:e.src||[],ref:e.ref||{name:t,style:[n,A,r].join(" ")}}}function Rs(e,t,A,r){var n;for(n=A;n>=0&&n<t.length;n+=r)if(e[t[n]])return e[t[n]];for(n=A;n>=0&&n<t.length;n-=r)if(e[t[n]])return e[t[n]]}var Vs={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Ks={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function zs(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Gs(e){return e.trimLeft()}function qs(e,t){for(var A=0;A<e.length;){if(e.charAt(A)===t)return[e.substring(0,A),e.substring(A+1)];A+=1}return null}function Ws(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===t?null:[t[0],e.substring(t[0].length)]}var Xs,Ys,Js,$s,Zs,ea,ta,Aa,ra=["times"];function na(e,t,A,r,n){var i=4,s=aa;switch(n){case Wi.API.image_compression.FAST:i=1,s=sa;break;case Wi.API.image_compression.MEDIUM:i=6,s=oa;break;case Wi.API.image_compression.SLOW:i=9,s=la}e=function(e,t,A,r){for(var n,i=e.length/t,s=new Uint8Array(e.length+i),a=[ia,sa,aa,oa,la],o=0;o<i;o+=1){var l=o*t,c=e.subarray(l,l+t);if(r)s.set(r(c,A,n),l+o);else{for(var u=a.length,h=[],d=0;d<u;d+=1)h[d]=a[d](c,A,n);var f=ua(h.concat());s.set(h[f],l+o)}n=c}return s}(e,t,Math.ceil(A*r/8),s);var a=Xe(e,{level:i});return Wi.API.__addimage__.arrayBufferToBinaryString(a)}function ia(e){var t=Array.apply([],e);return t.unshift(0),t}function sa(e,t){var A=e.length,r=[];r[0]=1;for(var n=0;n<A;n+=1){var i=e[n-t]||0;r[n+1]=e[n]-i+256&255}return r}function aa(e,t,A){var r=e.length,n=[];n[0]=2;for(var i=0;i<r;i+=1){var s=A&&A[i]||0;n[i+1]=e[i]-s+256&255}return n}function oa(e,t,A){var r=e.length,n=[];n[0]=3;for(var i=0;i<r;i+=1){var s=e[i-t]||0,a=A&&A[i]||0;n[i+1]=e[i]+256-(s+a>>>1)&255}return n}function la(e,t,A){var r=e.length,n=[];n[0]=4;for(var i=0;i<r;i+=1){var s=ca(e[i-t]||0,A&&A[i]||0,A&&A[i-t]||0);n[i+1]=e[i]-s+256&255}return n}function ca(e,t,A){if(e===t&&t===A)return e;var r=Math.abs(t-A),n=Math.abs(e-A),i=Math.abs(e+t-A-A);return r<=n&&r<=i?e:n<=i?t:A}function ua(e){var t=e.map(function(e){return e.reduce(function(e,t){return e+Math.abs(t)},0)});return t.indexOf(Math.min.apply(null,t))}function ha(e,t,A){var r=t*A,n=Math.floor(r/8),i=16-(r-8*n+A),s=(1<<A)-1;return fa(e,n)>>i&s}function da(e,t,A,r){var n=A*r,i=Math.floor(n/8),s=16-(n-8*i+r),a=(1<<r)-1,o=(t&a)<<s;!function(e,t,A){if(t+1<e.byteLength)e.setUint16(t,A,!1);else{var r=A>>8&255;e.setUint8(t,r)}}
|
|
139
139
|
/**
|
|
140
140
|
* @license
|
|
141
141
|
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
@@ -195,14 +195,14 @@ function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[6515
|
|
|
195
195
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
196
196
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
197
197
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
198
|
-
*/function ma(e){var t,A,r,n,i,s=Math.floor,a=new Array(64),o=new Array(64),l=new Array(64),c=new Array(64),u=new Array(65535),h=new Array(65535),d=new Array(64),f=new Array(64),p=[],g=0,m=7,w=new Array(64),B=new Array(64),b=new Array(64),y=new Array(256),v=new Array(2048),C=[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],x=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],Q=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],U=[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],S=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],E=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],L=[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 _(e,t){for(var A=0,r=0,n=new Array,i=1;i<=16;i++){for(var s=1;s<=e[i];s++)n[t[r]]=[],n[t[r]][0]=A,n[t[r]][1]=i,r++,A++;A*=2}return n}function I(e){for(var t=e[0],A=e[1]-1;A>=0;)t&1<<A&&(g|=1<<m),A--,--m<0&&(255==g?(k(255),k(0)):k(g),m=7,g=0)}function k(e){p.push(e)}function T(e){k(e>>8&255),k(255&e)}function H(e,t,A,r,n){for(var i,s=n[0],a=n[240],o=function(e,t){var A,r,n,i,s,a,o,l,c,u,h=0;for(c=0;c<8;++c){A=e[h],r=e[h+1],n=e[h+2],i=e[h+3],s=e[h+4],a=e[h+5],o=e[h+6];var f=A+(l=e[h+7]),p=A-l,g=r+o,m=r-o,w=n+a,B=n-a,b=i+s,y=i-s,v=f+b,C=f-b,x=g+w,F=g-w;e[h]=v+x,e[h+4]=v-x;var Q=.707106781*(F+C);e[h+2]=C+Q,e[h+6]=C-Q;var U=.382683433*((v=y+B)-(F=m+p)),S=.5411961*v+U,E=1.306562965*F+U,N=.707106781*(x=B+m),L=p+N,_=p-N;e[h+5]=_+S,e[h+3]=_-S,e[h+1]=L+E,e[h+7]=L-E,h+=8}for(h=0,c=0;c<8;++c){A=e[h],r=e[h+8],n=e[h+16],i=e[h+24],s=e[h+32],a=e[h+40],o=e[h+48];var I=A+(l=e[h+56]),k=A-l,T=r+o,H=r-o,O=n+a,P=n-a,D=i+s,M=i-s,j=I+D,R=I-D,V=T+O,K=T-O;e[h]=j+V,e[h+32]=j-V;var
|
|
198
|
+
*/function ma(e){var t,A,r,n,i,s=Math.floor,a=new Array(64),o=new Array(64),l=new Array(64),c=new Array(64),u=new Array(65535),h=new Array(65535),d=new Array(64),f=new Array(64),p=[],g=0,m=7,w=new Array(64),B=new Array(64),b=new Array(64),y=new Array(256),v=new Array(2048),C=[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],x=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],Q=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],U=[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],S=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],E=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],L=[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 _(e,t){for(var A=0,r=0,n=new Array,i=1;i<=16;i++){for(var s=1;s<=e[i];s++)n[t[r]]=[],n[t[r]][0]=A,n[t[r]][1]=i,r++,A++;A*=2}return n}function I(e){for(var t=e[0],A=e[1]-1;A>=0;)t&1<<A&&(g|=1<<m),A--,--m<0&&(255==g?(k(255),k(0)):k(g),m=7,g=0)}function k(e){p.push(e)}function T(e){k(e>>8&255),k(255&e)}function H(e,t,A,r,n){for(var i,s=n[0],a=n[240],o=function(e,t){var A,r,n,i,s,a,o,l,c,u,h=0;for(c=0;c<8;++c){A=e[h],r=e[h+1],n=e[h+2],i=e[h+3],s=e[h+4],a=e[h+5],o=e[h+6];var f=A+(l=e[h+7]),p=A-l,g=r+o,m=r-o,w=n+a,B=n-a,b=i+s,y=i-s,v=f+b,C=f-b,x=g+w,F=g-w;e[h]=v+x,e[h+4]=v-x;var Q=.707106781*(F+C);e[h+2]=C+Q,e[h+6]=C-Q;var U=.382683433*((v=y+B)-(F=m+p)),S=.5411961*v+U,E=1.306562965*F+U,N=.707106781*(x=B+m),L=p+N,_=p-N;e[h+5]=_+S,e[h+3]=_-S,e[h+1]=L+E,e[h+7]=L-E,h+=8}for(h=0,c=0;c<8;++c){A=e[h],r=e[h+8],n=e[h+16],i=e[h+24],s=e[h+32],a=e[h+40],o=e[h+48];var I=A+(l=e[h+56]),k=A-l,T=r+o,H=r-o,O=n+a,P=n-a,D=i+s,M=i-s,j=I+D,R=I-D,V=T+O,K=T-O;e[h]=j+V,e[h+32]=j-V;var z=.707106781*(K+R);e[h+16]=R+z,e[h+48]=R-z;var G=.382683433*((j=M+P)-(K=H+k)),q=.5411961*j+G,W=1.306562965*K+G,X=.707106781*(V=P+H),Y=k+X,J=k-X;e[h+40]=J+q,e[h+24]=J-q,e[h+8]=Y+W,e[h+56]=Y-W,h++}for(c=0;c<64;++c)u=e[c]*t[c],d[c]=u>0?u+.5|0:u-.5|0;return d}(e,t),l=0;l<64;++l)f[C[l]]=o[l];var c=f[0]-A;A=f[0],0==c?I(r[0]):(I(r[h[i=32767+c]]),I(u[i]));for(var p=63;p>0&&0==f[p];)p--;if(0==p)return I(s),A;for(var g,m=1;m<=p;){for(var w=m;0==f[m]&&m<=p;)++m;var B=m-w;if(B>=16){g=B>>4;for(var b=1;b<=g;++b)I(a);B&=15}i=32767+f[m],I(n[(B<<4)+h[i]]),I(u[i]),m++}return 63!=p&&I(s),A}function O(e){e=Math.min(Math.max(e,1),100),i!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],A=0;A<64;A++){var r=s((t[A]*e+50)/100);r=Math.min(Math.max(r,1),255),a[C[A]]=r}for(var n=[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],i=0;i<64;i++){var u=s((n[i]*e+50)/100);u=Math.min(Math.max(u,1),255),o[C[i]]=u}for(var h=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,f=0;f<8;f++)for(var p=0;p<8;p++)l[d]=1/(a[C[d]]*h[f]*h[p]*8),c[d]=1/(o[C[d]]*h[f]*h[p]*8),d++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),i=e)}this.encode=function(e,i){i&&O(i),p=new Array,g=0,m=7,T(65496),T(65504),T(16),k(74),k(70),k(73),k(70),k(0),k(1),k(1),k(0),T(1),T(1),k(0),k(0),function(){T(65499),T(132),k(0);for(var e=0;e<64;e++)k(a[e]);k(1);for(var t=0;t<64;t++)k(o[t])}(),function(e,t){T(65472),T(17),k(8),T(t),T(e),k(3),k(1),k(17),k(0),k(2),k(17),k(1),k(3),k(17),k(1)}(e.width,e.height),function(){T(65476),T(418),k(0);for(var e=0;e<16;e++)k(x[e+1]);for(var t=0;t<=11;t++)k(F[t]);k(16);for(var A=0;A<16;A++)k(Q[A+1]);for(var r=0;r<=161;r++)k(U[r]);k(1);for(var n=0;n<16;n++)k(S[n+1]);for(var i=0;i<=11;i++)k(E[i]);k(17);for(var s=0;s<16;s++)k(N[s+1]);for(var a=0;a<=161;a++)k(L[a])}(),T(65498),T(12),k(3),k(1),k(0),k(2),k(17),k(3),k(17),k(0),k(63),k(0);var s=0,u=0,h=0;g=0,m=7,this.encode.displayName="_encode_";for(var d,f,y,C,_,P,D,M,j,R=e.data,V=e.width,K=e.height,z=4*V,G=0;G<K;){for(d=0;d<z;){for(_=z*G+d,D=-1,M=0,j=0;j<64;j++)P=_+(M=j>>3)*z+(D=4*(7&j)),G+M>=K&&(P-=z*(G+1+M-K)),d+D>=z&&(P-=d+D-z+4),f=R[P++],y=R[P++],C=R[P++],w[j]=(v[f]+v[y+256|0]+v[C+512|0]>>16)-128,B[j]=(v[f+768|0]+v[y+1024|0]+v[C+1280|0]>>16)-128,b[j]=(v[f+1280|0]+v[y+1536|0]+v[C+1792|0]>>16)-128;s=H(w,l,s,t,r),u=H(B,c,u,A,n),h=H(b,c,h,A,n),d+=32}G+=8}if(m>=0){var q=[];q[1]=m+1,q[0]=(1<<m+1)-1,I(q)}return T(65497),new Uint8Array(p)},e=e||50,function(){for(var e=String.fromCharCode,t=0;t<256;t++)y[t]=e(t)}(),t=_(x,F),A=_(S,E),r=_(Q,U),n=_(N,L),function(){for(var e=1,t=2,A=1;A<=15;A++){for(var r=e;r<t;r++)h[32767+r]=A,u[32767+r]=[],u[32767+r][1]=A,u[32767+r][0]=r;for(var n=-(t-1);n<=-e;n++)h[32767+n]=A,u[32767+n]=[],u[32767+n][1]=A,u[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)v[e]=19595*e,v[e+256|0]=38470*e,v[e+512|0]=7471*e+32768,v[e+768|0]=-11059*e,v[e+1024|0]=-21709*e,v[e+1280|0]=32768*e+8421375,v[e+1536|0]=-27439*e,v[e+1792|0]=-5329*e}(),O(e)}
|
|
199
199
|
/**
|
|
200
200
|
* @license
|
|
201
201
|
* Copyright (c) 2017 Aras Abbasi
|
|
202
202
|
*
|
|
203
203
|
* Licensed under the MIT License.
|
|
204
204
|
* http://opensource.org/licenses/mit-license
|
|
205
|
-
*/function wa(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Ba(e){function t(e){if(!e)throw Error("assert :P")}function A(e,t,A){for(var r=0;4>r;r++)if(e[t+r]!=A.charCodeAt(r))return!0;return!1}function r(e,t,A,r,n){for(var i=0;i<n;i++)e[t+i]=A[r+i]}function n(e,t,A,r){for(var n=0;n<r;n++)e[t+n]=A}function i(e){return new Int32Array(e)}function s(e,t){for(var A=[],r=0;r<e;r++)A.push(new t);return A}function a(e,t){var A=[];return function e(A,r,n){for(var i=n[r],s=0;s<i&&(A.push(n.length>r+1?[]:new t),!(n.length<r+1));s++)e(A[s],r+1,n)}(A,0,e),A}var o=function(){var e=this;function o(e,t){for(var A=1<<t-1>>>0;e&A;)A>>>=1;return A?(e&A-1)+A:e}function l(e,A,r,n,i){t(!(n%r));do{e[A+(n-=r)]=i}while(0<n)}function c(e,A,r,n,s){if(t(2328>=s),512>=s)var a=i(512);else if(null==(a=i(s)))return 0;return function(e,A,r,n,s,a){var c,h,d=A,f=1<<r,p=i(16),g=i(16);for(t(0!=s),t(null!=n),t(null!=e),t(0<r),h=0;h<s;++h){if(15<n[h])return 0;++p[n[h]]}if(p[0]==s)return 0;for(g[1]=0,c=1;15>c;++c){if(p[c]>1<<c)return 0;g[c+1]=g[c]+p[c]}for(h=0;h<s;++h)c=n[h],0<n[h]&&(a[g[c]++]=h);if(1==g[15])return(n=new u).g=0,n.value=a[0],l(e,d,1,f,n),f;var m,w=-1,B=f-1,b=0,y=1,v=1,C=1<<r;for(h=0,c=1,s=2;c<=r;++c,s<<=1){if(y+=v<<=1,0>(v-=p[c]))return 0;for(;0<p[c];--p[c])(n=new u).g=c,n.value=a[h++],l(e,d+b,s,C,n),b=o(b,c)}for(c=r+1,s=2;15>=c;++c,s<<=1){if(y+=v<<=1,0>(v-=p[c]))return 0;for(;0<p[c];--p[c]){if(n=new u,(b&B)!=w){for(d+=C,m=1<<(w=c)-r;15>w&&!(0>=(m-=p[w]));)++w,m<<=1;f+=C=1<<(m=w-r),e[A+(w=b&B)].g=m+r,e[A+w].value=d-A-w}n.g=c-r,n.value=a[h++],l(e,d+(b>>r),s,C,n),b=o(b,c)}}return y!=2*g[15]-1?0:f}(e,A,r,n,s,a)}function u(){this.value=this.g=0}function h(){this.value=this.g=0}function d(){this.G=s(5,u),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(OA,h)}function f(e,A,r,n){t(null!=e),t(null!=A),t(2147483648>n),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=A,e.pa=r,e.Jd=A,e.Yc=r+n,e.Zc=4<=n?r+n-4+1:r,Q(e)}function p(e,t){for(var A=0;0<t--;)A|=S(e,128)<<t;return A}function g(e,t){var A=p(e,t);return U(e)?-A:A}function m(e,A,r,n){var i,s=0;for(t(null!=e),t(null!=A),t(4294967288>n),e.Sb=n,e.Ra=0,e.u=0,e.h=0,4<n&&(n=4),i=0;i<n;++i)s+=A[r+i]<<8*i;e.Ra=s,e.bb=n,e.oa=A,e.pa=r}function w(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<MA-8>>>0,++e.bb,e.u-=8;C(e)&&(e.h=1,e.u=0)}function B(e,A){if(t(0<=A),!e.h&&A<=DA){var r=v(e)&PA[A];return e.u+=A,w(e),r}return e.h=1,e.u=0}function b(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function y(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function v(e){return e.Ra>>>(e.u&MA-1)>>>0}function C(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>MA}function x(e,t){e.u=t,e.h=C(e)}function F(e){e.u>=jA&&(t(e.u>=jA),w(e))}function Q(e){t(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(t(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function U(e){return p(e,1)}function S(e,t){var A=e.Ca;0>e.b&&Q(e);var r=e.b,n=A*t>>>8,i=(e.I>>>r>n)+0;for(i?(A-=n,e.I-=n+1<<r>>>0):A=n+1,r=A,n=0;256<=r;)n+=8,r>>=8;return r=7^n+RA[r],e.b-=r,e.Ca=(A<<r)-1,i}function E(e,t,A){e[t+0]=A>>24&255,e[t+1]=A>>16&255,e[t+2]=A>>8&255,e[t+3]=255&A}function N(e,t){return e[t+0]|e[t+1]<<8}function L(e,t){return N(e,t)|e[t+2]<<16}function _(e,t){return N(e,t)|N(e,t+2)<<16}function I(e,A){var r=1<<A;return t(null!=e),t(0<A),e.X=i(r),null==e.X?0:(e.Mb=32-A,e.Xa=A,1)}function k(e,A){t(null!=e),t(null!=A),t(e.Xa==A.Xa),r(A.X,0,e.X,0,1<<A.Xa)}function T(){this.X=[],this.Xa=this.Mb=0}function H(e,A,r,n){t(null!=r),t(null!=n);var i=r[0],s=n[0];return 0==i&&(i=(e*s+A/2)/A),0==s&&(s=(A*i+e/2)/e),0>=i||0>=s?0:(r[0]=i,n[0]=s,1)}function O(e,t){return e+(1<<t)-1>>>t}function P(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function D(t,A){e[A]=function(A,r,n,i,s,a,o){var l;for(l=0;l<s;++l){var c=e[t](a[o+l-1],n,i+l);a[o+l]=P(A[r+l],c)}}}function M(){this.ud=this.hd=this.jd=0}function j(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function R(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function V(e,t){return R(e+(e-t+.5>>1))}function K(e,t,A){return Math.abs(t-A)-Math.abs(e-A)}function G(e,t,A,r,n,i,s){for(r=i[s-1],A=0;A<n;++A)i[s+A]=r=P(e[t+A],r)}function z(e,t,A,r,n){var i;for(i=0;i<A;++i){var s=e[t+i],a=s>>8&255,o=16711935&(o=(o=16711935&s)+((a<<16)+a));r[n+i]=(4278255360&s)+o>>>0}}function q(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function W(e,t,A,r,n,i){var s;for(s=0;s<r;++s){var a=t[A+s],o=a>>>8,l=a,c=255&(c=(c=a>>>16)+((e.jd<<24>>24)*(o<<24>>24)>>>5));l=255&(l=(l+=(e.hd<<24>>24)*(o<<24>>24)>>>5)+((e.ud<<24>>24)*(c<<24>>24)>>>5)),n[i+s]=(4278255360&a)+(c<<16)+l}}function X(t,A,r,n,i){e[A]=function(e,t,A,r,s,a,o,l,c){for(r=o;r<l;++r)for(o=0;o<c;++o)s[a++]=i(A[n(e[t++])])},e[t]=function(t,A,s,a,o,l,c){var u=8>>t.b,h=t.Ea,d=t.K[0],f=t.w;if(8>u)for(t=(1<<t.b)-1,f=(1<<u)-1;A<s;++A){var p,g=0;for(p=0;p<h;++p)p&t||(g=n(a[o++])),l[c++]=i(d[g&f]),g>>=u}else e["VP8LMapColor"+r](a,o,d,f,l,c,A,s,h)}}function Y(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=i>>16&255,r[n++]=i>>8&255,r[n++]=255&i}}function J(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=i>>16&255,r[n++]=i>>8&255,r[n++]=255&i,r[n++]=i>>24&255}}function $(e,t,A,r,n){for(A=t+A;t<A;){var i=(s=e[t++])>>16&240|s>>12&15,s=240&s|s>>28&15;r[n++]=i,r[n++]=s}}function Z(e,t,A,r,n){for(A=t+A;t<A;){var i=(s=e[t++])>>16&248|s>>13&7,s=s>>5&224|s>>3&31;r[n++]=i,r[n++]=s}}function ee(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=255&i,r[n++]=i>>8&255,r[n++]=i>>16&255}}function te(e,t,A,n,i,s){if(0==s)for(A=t+A;t<A;)E(n,((s=e[t++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),i+=32;else r(n,i,e,t,A)}function Ae(t,A){e[A][0]=e[t+"0"],e[A][1]=e[t+"1"],e[A][2]=e[t+"2"],e[A][3]=e[t+"3"],e[A][4]=e[t+"4"],e[A][5]=e[t+"5"],e[A][6]=e[t+"6"],e[A][7]=e[t+"7"],e[A][8]=e[t+"8"],e[A][9]=e[t+"9"],e[A][10]=e[t+"10"],e[A][11]=e[t+"11"],e[A][12]=e[t+"12"],e[A][13]=e[t+"13"],e[A][14]=e[t+"0"],e[A][15]=e[t+"0"]}function re(e){return e==jr||e==Rr||e==Vr||e==Kr}function ne(){this.eb=[],this.size=this.A=this.fb=0}function ie(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function se(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ne,this.f.kb=new ie,this.sd=null}function ae(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function oe(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function le(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function ce(e,t){var A=e.T,n=t.ba.f.RGBA,i=n.eb,s=n.fb+e.ka*n.A,a=gn[t.ba.S],o=e.y,l=e.O,c=e.f,u=e.N,h=e.ea,d=e.W,f=t.cc,p=t.dc,g=t.Mc,m=t.Nc,w=e.ka,B=e.ka+e.T,b=e.U,y=b+1>>1;for(0==w?a(o,l,null,null,c,u,h,d,c,u,h,d,i,s,null,null,b):(a(t.ec,t.fc,o,l,f,p,g,m,c,u,h,d,i,s-n.A,i,s,b),++A);w+2<B;w+=2)f=c,p=u,g=h,m=d,u+=e.Rc,d+=e.Rc,s+=2*n.A,a(o,(l+=2*e.fa)-e.fa,o,l,f,p,g,m,c,u,h,d,i,s-n.A,i,s,b);return l+=e.fa,e.j+B<e.o?(r(t.ec,t.fc,o,l,b),r(t.cc,t.dc,c,u,y),r(t.Mc,t.Nc,h,d,y),A--):1&B||a(o,l,null,null,c,u,h,d,c,u,h,d,i,s+n.A,null,null,b),A}function ue(e,A,r){var n=e.F,i=[e.J];if(null!=n){var s=e.U,a=A.ba.S,o=a==Pr||a==Vr;A=A.ba.f.RGBA;var l=[0],c=e.ka;l[0]=e.T,e.Kb&&(0==c?--l[0]:(--c,i[0]-=e.width),e.j+e.ka+e.T==e.o&&(l[0]=e.o-e.j-c));var u=A.eb;c=A.fb+c*A.A,e=Cr(n,i[0],e.width,s,l,u,c+(o?0:3),A.A),t(r==l),e&&re(a)&&yr(u,c,o,s,l,A.A)}return 0}function he(e){var t=e.ma,A=t.ba.S,r=11>A,n=A==Tr||A==Or||A==Pr||A==Dr||12==A||re(A);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!kA(t.Oa,e,n?11:12))return 0;if(n&&re(A)&&mA(),e.da)alert("todo:use_scaling");else{if(r){if(t.Ib=le,e.Kb){if(A=e.U+1>>1,t.memory=i(e.U+2*A),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+A,t.Ib=ce,mA()}}else alert("todo:EmitYUV");n&&(t.Jb=ue,r&&pA())}if(r&&!Nn){for(e=0;256>e;++e)Ln[e]=89858*(e-128)+Fn>>xn,kn[e]=-22014*(e-128)+Fn,In[e]=-45773*(e-128),_n[e]=113618*(e-128)+Fn>>xn;for(e=Qn;e<Un;++e)t=76283*(e-16)+Fn>>xn,Tn[e-Qn]=Ge(t,255),Hn[e-Qn]=Ge(t+8>>4,15);Nn=1}return 1}function de(e){var A=e.ma,r=e.U,n=e.T;return t(!(1&e.ka)),0>=r||0>=n?0:(r=A.Ib(e,A),null!=A.Jb&&A.Jb(e,A,r),A.Dc+=r,1)}function fe(e){e.ma.memory=null}function pe(e,t,A,r){return 47!=B(e,8)?0:(t[0]=B(e,14)+1,A[0]=B(e,14)+1,r[0]=B(e,1),0!=B(e,3)?0:!e.h)}function ge(e,t){if(4>e)return e+1;var A=e-2>>1;return(2+(1&e)<<A)+B(t,A)+1}function me(e,t){return 120<t?t-120:1<=(A=((A=Yr[t-1])>>4)*e+(8-(15&A)))?A:1;var A}function we(e,t,A){var r=v(A),n=e[t+=255&r].g-8;return 0<n&&(x(A,A.u+8),r=v(A),t+=e[t].value,t+=r&(1<<n)-1),x(A,A.u+e[t].g),e[t].value}function Be(e,A,r){return r.g+=e.g,r.value+=e.value<<A>>>0,t(8>=r.g),e.g}function be(e,A,r){var n=e.xc;return t((A=0==n?0:e.vc[e.md*(r>>n)+(A>>n)])<e.Wb),e.Ya[A]}function ye(e,A,n,i){var s=e.ab,a=e.c*A,o=e.C;A=o+A;var l=n,c=i;for(i=e.Ta,n=e.Ua;0<s--;){var u=e.gc[s],h=o,d=A,f=l,p=c,g=(c=i,l=n,u.Ea);switch(t(h<d),t(d<=u.nc),u.hc){case 2:GA(f,p,(d-h)*g,c,l);break;case 0:var m=h,w=d,B=c,b=l,y=(Q=u).Ea;0==m&&(VA(f,p,null,null,1,B,b),G(f,p+1,0,0,y-1,B,b+1),p+=y,b+=y,++m);for(var v=1<<Q.b,C=v-1,x=O(y,Q.b),F=Q.K,Q=Q.w+(m>>Q.b)*x;m<w;){var U=F,S=Q,E=1;for(KA(f,p,B,b-y,1,B,b);E<y;){var N=(E&~C)+v;N>y&&(N=y),(0,YA[U[S++]>>8&15])(f,p+ +E,B,b+E-y,N-E,B,b+E),E=N}p+=y,b+=y,++m&C||(Q+=x)}d!=u.nc&&r(c,l-g,c,l+(d-h-1)*g,g);break;case 1:for(g=f,w=p,y=(f=u.Ea)-(b=f&~(B=(p=1<<u.b)-1)),m=O(f,u.b),v=u.K,u=u.w+(h>>u.b)*m;h<d;){for(C=v,x=u,F=new M,Q=w+b,U=w+f;w<Q;)q(C[x++],F),JA(F,g,w,p,c,l),w+=p,l+=p;w<U&&(q(C[x++],F),JA(F,g,w,y,c,l),w+=y,l+=y),++h&B||(u+=m)}break;case 3:if(f==c&&p==l&&0<u.b){for(w=c,f=g=l+(d-h)*g-(b=(d-h)*O(u.Ea,u.b)),p=c,B=l,m=[],b=(y=b)-1;0<=b;--b)m[b]=p[B+b];for(b=y-1;0<=b;--b)w[f+b]=m[b];zA(u,h,d,c,g,c,l)}else zA(u,h,d,f,p,c,l)}l=i,c=n}c!=n&&r(i,n,l,c,a)}function ve(e,A){var r=e.V,n=e.Ba+e.c*e.C,i=A-e.C;if(t(A<=e.l.o),t(16>=i),0<i){var s=e.l,a=e.Ta,o=e.Ua,l=s.width;if(ye(e,i,r,n),i=o=[o],t((r=e.C)<(n=A)),t(s.v<s.va),n>s.o&&(n=s.o),r<s.j){var c=s.j-r;r=s.j,i[0]+=c*l}if(r>=n?r=0:(i[0]+=4*s.v,s.ka=r-s.j,s.U=s.va-s.v,s.T=n-r,r=1),r){if(o=o[0],11>(r=e.ca).S){var u=r.f.RGBA,h=(n=r.S,i=s.U,s=s.T,c=u.eb,u.A),d=s;for(u=u.fb+e.Ma*u.A;0<d--;){var f=a,p=o,g=i,m=c,w=u;switch(n){case kr:$A(f,p,g,m,w);break;case Tr:ZA(f,p,g,m,w);break;case jr:ZA(f,p,g,m,w),yr(m,w,0,g,1,0);break;case Hr:Ar(f,p,g,m,w);break;case Or:te(f,p,g,m,w,1);break;case Rr:te(f,p,g,m,w,1),yr(m,w,0,g,1,0);break;case Pr:te(f,p,g,m,w,0);break;case Vr:te(f,p,g,m,w,0),yr(m,w,1,g,1,0);break;case Dr:er(f,p,g,m,w);break;case Kr:er(f,p,g,m,w),vr(m,w,g,1,0);break;case Mr:tr(f,p,g,m,w);break;default:t(0)}o+=l,u+=h}e.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");t(e.Ma<=r.height)}}e.C=A,t(e.C<=e.i)}function Ce(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var A=e.Ya[t].G,r=e.Ya[t].H;if(0<A[1][r[1]+0].g||0<A[2][r[2]+0].g||0<A[3][r[3]+0].g)return 0}return 1}function xe(e,A,r,n,i,s){if(0!=e.Z){var a=e.qd,o=e.rd;for(t(null!=pn[e.Z]);A<r;++A)pn[e.Z](a,o,n,i,n,i,s),a=n,o=i,i+=s;e.qd=a,e.rd=o}}function Fe(e,A){var r=e.l.ma,n=0==r.Z||1==r.Z?e.l.j:e.C;if(n=e.C<n?n:e.C,t(A<=e.l.o),A>n){var i=e.l.width,s=r.ca,a=r.tb+i*n,o=e.V,l=e.Ba+e.c*n,c=e.gc;t(1==e.ab),t(3==c[0].hc),WA(c[0],n,A,o,l,s,a),xe(r,n,A,s,a,i)}e.C=e.Ma=A}function Qe(e,A,r,n,i,s,a){var o=e.$/n,l=e.$%n,c=e.m,u=e.s,h=r+e.$,d=h;i=r+n*i;var f=r+n*s,p=280+u.ua,g=e.Pb?o:16777216,m=0<u.ua?u.Wa:null,w=u.wc,B=h<f?be(u,l,o):null;t(e.C<s),t(f<=i);var b=!1;e:for(;;){for(;b||h<f;){var y=0;if(o>=g){var Q=h-r;t((g=e).Pb),g.wd=g.m,g.xd=Q,0<g.s.ua&&k(g.s.Wa,g.s.vb),g=o+$r}if(l&w||(B=be(u,l,o)),t(null!=B),B.Qb&&(A[h]=B.qb,b=!0),!b)if(F(c),B.jc){y=c,Q=A;var U=h,S=B.pd[v(y)&OA-1];t(B.jc),256>S.g?(x(y,y.u+S.g),Q[U]=S.value,y=0):(x(y,y.u+S.g-256),t(256<=S.value),y=S.value),0==y&&(b=!0)}else y=we(B.G[0],B.H[0],c);if(c.h)break;if(b||256>y){if(!b)if(B.nd)A[h]=(B.qb|y<<8)>>>0;else{if(F(c),b=we(B.G[1],B.H[1],c),F(c),Q=we(B.G[2],B.H[2],c),U=we(B.G[3],B.H[3],c),c.h)break;A[h]=(U<<24|b<<16|y<<8|Q)>>>0}if(b=!1,++h,++l>=n&&(l=0,++o,null!=a&&o<=s&&!(o%16)&&a(e,o),null!=m))for(;d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y}else if(280>y){if(y=ge(y-256,c),Q=we(B.G[4],B.H[4],c),F(c),Q=me(n,Q=ge(Q,c)),c.h)break;if(h-r<Q||i-h<y)break e;for(U=0;U<y;++U)A[h+U]=A[h+U-Q];for(h+=y,l+=y;l>=n;)l-=n,++o,null!=a&&o<=s&&!(o%16)&&a(e,o);if(t(h<=i),l&w&&(B=be(u,l,o)),null!=m)for(;d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y}else{if(!(y<p))break e;for(b=y-280,t(null!=m);d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y;y=h,t(!(b>>>(Q=m).Xa)),A[y]=Q.X[b],b=!0}b||t(c.h==C(c))}if(e.Pb&&c.h&&h<i)t(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&k(e.s.vb,e.s.Wa);else{if(c.h)break e;null!=a&&a(e,o>s?s:o),e.a=0,e.$=h-r}return 1}return e.a=3,0}function Ue(e){t(null!=e),e.vc=null,e.yc=null,e.Ya=null;var A=e.Wa;null!=A&&(A.X=null),e.vb=null,t(null!=e)}function Se(){var t=new iA;return null==t?null:(t.a=0,t.xb=fn,Ae("Predictor","VP8LPredictors"),Ae("Predictor","VP8LPredictors_C"),Ae("PredictorAdd","VP8LPredictorsAdd"),Ae("PredictorAdd","VP8LPredictorsAdd_C"),GA=z,JA=W,$A=Y,ZA=J,er=$,tr=Z,Ar=ee,e.VP8LMapColor32b=qA,e.VP8LMapColor8b=XA,t)}function Ee(e,A,r,a,o){var l=1,h=[e],f=[A],p=a.m,g=a.s,m=null,w=0;e:for(;;){if(r)for(;l&&B(p,1);){var b=h,y=f,C=a,Q=1,U=C.m,S=C.gc[C.ab],E=B(U,2);if(C.Oc&1<<E)l=0;else{switch(C.Oc|=1<<E,S.hc=E,S.Ea=b[0],S.nc=y[0],S.K=[null],++C.ab,t(4>=C.ab),E){case 0:case 1:S.b=B(U,3)+2,Q=Ee(O(S.Ea,S.b),O(S.nc,S.b),0,C,S.K),S.K=S.K[0];break;case 3:var N,L=B(U,8)+1,_=16<L?0:4<L?1:2<L?2:3;if(b[0]=O(S.Ea,_),S.b=_,N=Q=Ee(L,1,0,C,S.K)){var k,T=L,H=S,D=1<<(8>>H.b),M=i(D);if(null==M)N=0;else{var j=H.K[0],R=H.w;for(M[0]=H.K[0][0],k=1;k<1*T;++k)M[k]=P(j[R+k],M[k-1]);for(;k<4*D;++k)M[k]=0;H.K[0]=null,H.K[0]=M,N=1}}Q=N;break;case 2:break;default:t(0)}l=Q}}if(h=h[0],f=f[0],l&&B(p,1)&&!(l=1<=(w=B(p,4))&&11>=w)){a.a=3;break e}var V;if(V=l)t:{var K,G,z,q=a,W=h,X=f,Y=w,J=r,$=q.m,Z=q.s,ee=[null],te=1,Ae=0,re=Jr[Y];A:for(;;){if(J&&B($,1)){var ne=B($,3)+2,ie=O(W,ne),se=O(X,ne),ae=ie*se;if(!Ee(ie,se,0,q,ee))break A;for(ee=ee[0],Z.xc=ne,K=0;K<ae;++K){var oe=ee[K]>>8&65535;ee[K]=oe,oe>=te&&(te=oe+1)}}if($.h)break A;for(G=0;5>G;++G){var le=qr[G];!G&&0<Y&&(le+=1<<Y),Ae<le&&(Ae=le)}var ce=s(te*re,u),ue=te,he=s(ue,d);if(null==he)var de=null;else t(65536>=ue),de=he;var fe=i(Ae);if(null==de||null==fe||null==ce){q.a=1;break A}var pe=ce;for(K=z=0;K<te;++K){var ge=de[K],me=ge.G,we=ge.H,be=0,ye=1,ve=0;for(G=0;5>G;++G){le=qr[G],me[G]=pe,we[G]=z,!G&&0<Y&&(le+=1<<Y);r:{var Ce,xe=le,Fe=q,Se=fe,Ne=pe,Le=z,_e=0,Ie=Fe.m,ke=B(Ie,1);if(n(Se,0,0,xe),ke){var Te=B(Ie,1)+1,He=B(Ie,1),Oe=B(Ie,0==He?1:8);Se[Oe]=1,2==Te&&(Se[Oe=B(Ie,8)]=1);var Pe=1}else{var De=i(19),Me=B(Ie,4)+4;if(19<Me){Fe.a=3;var je=0;break r}for(Ce=0;Ce<Me;++Ce)De[Xr[Ce]]=B(Ie,3);var Re=void 0,Ve=void 0,Ke=Fe,Ge=De,ze=xe,qe=Se,We=0,Xe=Ke.m,Ye=8,Je=s(128,u);n:for(;c(Je,0,7,Ge,19);){if(B(Xe,1)){var $e=2+2*B(Xe,3);if((Re=2+B(Xe,$e))>ze)break n}else Re=ze;for(Ve=0;Ve<ze&&Re--;){F(Xe);var Ze=Je[0+(127&v(Xe))];x(Xe,Xe.u+Ze.g);var et=Ze.value;if(16>et)qe[Ve++]=et,0!=et&&(Ye=et);else{var tt=16==et,At=et-16,rt=zr[At],nt=B(Xe,Gr[At])+rt;if(Ve+nt>ze)break n;for(var it=tt?Ye:0;0<nt--;)qe[Ve++]=it}}We=1;break n}We||(Ke.a=3),Pe=We}(Pe=Pe&&!Ie.h)&&(_e=c(Ne,Le,8,Se,xe)),Pe&&0!=_e?je=_e:(Fe.a=3,je=0)}if(0==je)break A;if(ye&&1==Wr[G]&&(ye=0==pe[z].g),be+=pe[z].g,z+=je,3>=G){var st,at=fe[0];for(st=1;st<le;++st)fe[st]>at&&(at=fe[st]);ve+=at}}if(ge.nd=ye,ge.Qb=0,ye&&(ge.qb=(me[3][we[3]+0].value<<24|me[1][we[1]+0].value<<16|me[2][we[2]+0].value)>>>0,0==be&&256>me[0][we[0]+0].value&&(ge.Qb=1,ge.qb+=me[0][we[0]+0].value<<8)),ge.jc=!ge.Qb&&6>ve,ge.jc){var ot,lt=ge;for(ot=0;ot<OA;++ot){var ct=ot,ut=lt.pd[ct],ht=lt.G[0][lt.H[0]+ct];256<=ht.value?(ut.g=ht.g+256,ut.value=ht.value):(ut.g=0,ut.value=0,ct>>=Be(ht,8,ut),ct>>=Be(lt.G[1][lt.H[1]+ct],16,ut),ct>>=Be(lt.G[2][lt.H[2]+ct],0,ut),Be(lt.G[3][lt.H[3]+ct],24,ut))}}}Z.vc=ee,Z.Wb=te,Z.Ya=de,Z.yc=ce,V=1;break t}V=0}if(!(l=V)){a.a=3;break e}if(0<w){if(g.ua=1<<w,!I(g.Wa,w)){a.a=1,l=0;break e}}else g.ua=0;var dt=a,ft=h,pt=f,gt=dt.s,mt=gt.xc;if(dt.c=ft,dt.i=pt,gt.md=O(ft,mt),gt.wc=0==mt?-1:(1<<mt)-1,r){a.xb=dn;break e}if(null==(m=i(h*f))){a.a=1,l=0;break e}l=(l=Qe(a,m,0,h,f,f,null))&&!p.h;break e}return l?(null!=o?o[0]=m:(t(null==m),t(r)),a.$=0,r||Ue(g)):Ue(g),l}function Ne(e,A){var r=e.c*e.i,n=r+A+16*A;return t(e.c<=A),e.V=i(n),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+r+A,1)}function Le(e,A){var r=e.C,n=A-r,i=e.V,s=e.Ba+e.c*r;for(t(A<=e.l.o);0<n;){var a=16<n?16:n,o=e.l.ma,l=e.l.width,c=l*a,u=o.ca,h=o.tb+l*r,d=e.Ta,f=e.Ua;ye(e,a,i,s),xr(d,f,u,h,c),xe(o,r,r+a,u,h,l),n-=a,i+=a*e.c,r+=a}t(r==A),e.C=e.Ma=A}function _e(){this.ub=this.yd=this.td=this.Rb=0}function Ie(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function ke(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function Te(){this.Yb=function(){var e=[];return function e(t,A,r){for(var n=r[A],i=0;i<n&&(t.push(r.length>A+1?[]:0),!(r.length<A+1));i++)e(t[i],A+1,r)}(e,0,[3,11]),e}()}function He(){this.jb=i(3),this.Wc=a([4,8],Te),this.Xc=a([4,17],Te)}function Oe(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function Pe(){this.ld=this.La=this.dd=this.tc=0}function De(){this.Na=this.la=0}function Me(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function je(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Re(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pe),this.Y=0,this.ya=Array(new je),this.aa=0,this.l=new ze}function Ve(){this.y=i(16),this.f=i(8),this.ea=i(8)}function Ke(){this.cb=this.a=0,this.sc="",this.m=new b,this.Od=new _e,this.Kc=new Ie,this.ed=new Oe,this.Qa=new ke,this.Ic=this.$c=this.Aa=0,this.D=new Re,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,b),this.ia=0,this.pb=s(4,Me),this.Pa=new He,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Ve),this.Hd=0,this.rb=Array(new De),this.sb=0,this.wa=Array(new Pe),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 je),this.L=this.aa=0,this.gd=a([4,2],Pe),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 Ge(e,t){return 0>e?0:e>t?t:e}function ze(){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 qe(){var e=new Ke;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,tn||(tn=Je)),e}function We(e,t,A){return 0==e.a&&(e.a=t,e.sc=A,e.cb=0),0}function Xe(e,t,A){return 3<=A&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function Ye(e,A){if(null==e)return 0;if(e.a=0,e.sc="OK",null==A)return We(e,2,"null VP8Io passed to VP8GetHeaders()");var r=A.data,i=A.w,s=A.ha;if(4>s)return We(e,7,"Truncated header.");var a=r[i+0]|r[i+1]<<8|r[i+2]<<16,o=e.Od;if(o.Rb=!(1&a),o.td=a>>1&7,o.yd=a>>4&1,o.ub=a>>5,3<o.td)return We(e,3,"Incorrect keyframe parameters.");if(!o.yd)return We(e,4,"Frame not displayable.");i+=3,s-=3;var l=e.Kc;if(o.Rb){if(7>s)return We(e,7,"cannot parse picture header");if(!Xe(r,i,s))return We(e,3,"Bad code word");l.c=16383&(r[i+4]<<8|r[i+3]),l.Td=r[i+4]>>6,l.i=16383&(r[i+6]<<8|r[i+5]),l.Ud=r[i+6]>>6,i+=7,s-=7,e.za=l.c+15>>4,e.Ub=l.i+15>>4,A.width=l.c,A.height=l.i,A.Da=0,A.j=0,A.v=0,A.va=A.width,A.o=A.height,A.da=0,A.ib=A.width,A.hb=A.height,A.U=A.width,A.T=A.height,n((a=e.Pa).jb,0,255,a.jb.length),t(null!=(a=e.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,n(a.Zb,0,0,a.Zb.length),n(a.Lb,0,0,a.Lb)}if(o.ub>s)return We(e,7,"bad partition length");f(a=e.m,r,i,o.ub),i+=o.ub,s-=o.ub,o.Rb&&(l.Ld=U(a),l.Kd=U(a)),l=e.Qa;var c,u=e.Pa;if(t(null!=a),t(null!=l),l.Cb=U(a),l.Cb){if(l.Bb=U(a),U(a)){for(l.Fb=U(a),c=0;4>c;++c)l.Zb[c]=U(a)?g(a,7):0;for(c=0;4>c;++c)l.Lb[c]=U(a)?g(a,6):0}if(l.Bb)for(c=0;3>c;++c)u.jb[c]=U(a)?p(a,8):255}else l.Bb=0;if(a.Ka)return We(e,3,"cannot parse segment header");if((l=e.ed).zd=U(a),l.Tb=p(a,6),l.wb=p(a,3),l.Pc=U(a),l.Pc&&U(a)){for(u=0;4>u;++u)U(a)&&(l.vd[u]=g(a,6));for(u=0;4>u;++u)U(a)&&(l.od[u]=g(a,6))}if(e.L=0==l.Tb?0:l.zd?1:2,a.Ka)return We(e,3,"cannot parse filter header");var h=s;if(s=c=i,i=c+h,l=h,e.Xb=(1<<p(e.m,2))-1,h<3*(u=e.Xb))r=7;else{for(c+=3*u,l-=3*u,h=0;h<u;++h){var d=r[s+0]|r[s+1]<<8|r[s+2]<<16;d>l&&(d=l),f(e.Jc[+h],r,c,d),c+=d,l-=d,s+=3}f(e.Jc[+u],r,c,l),r=c<i?0:5}if(0!=r)return We(e,r,"cannot parse partitions");for(r=p(c=e.m,7),s=U(c)?g(c,4):0,i=U(c)?g(c,4):0,l=U(c)?g(c,4):0,u=U(c)?g(c,4):0,c=U(c)?g(c,4):0,h=e.Qa,d=0;4>d;++d){if(h.Cb){var m=h.Zb[d];h.Fb||(m+=r)}else{if(0<d){e.pb[d]=e.pb[0];continue}m=r}var w=e.pb[d];w.Sc[0]=Zr[Ge(m+s,127)],w.Sc[1]=en[Ge(m+0,127)],w.Eb[0]=2*Zr[Ge(m+i,127)],w.Eb[1]=101581*en[Ge(m+l,127)]>>16,8>w.Eb[1]&&(w.Eb[1]=8),w.Qc[0]=Zr[Ge(m+u,117)],w.Qc[1]=en[Ge(m+c,127)],w.lc=m+c}if(!o.Rb)return We(e,4,"Not a key frame.");for(U(a),o=e.Pa,r=0;4>r;++r){for(s=0;8>s;++s)for(i=0;3>i;++i)for(l=0;11>l;++l)u=S(a,on[r][s][i][l])?p(a,8):sn[r][s][i][l],o.Wc[r][s].Yb[i][l]=u;for(s=0;17>s;++s)o.Xc[r][s]=o.Wc[r][ln[s]]}return e.kc=U(a),e.kc&&(e.Bd=p(a,8)),e.cb=1}function Je(e,t,A,r,n,i,s){var a=t[n].Yb[A];for(A=0;16>n;++n){if(!S(e,a[A+0]))return n;for(;!S(e,a[A+1]);)if(a=t[++n].Yb[0],A=0,16==n)return 16;var o=t[n+1].Yb;if(S(e,a[A+2])){var l=e,c=0;if(S(l,(h=a)[(u=A)+3]))if(S(l,h[u+6])){for(a=0,u=2*(c=S(l,h[u+8]))+(h=S(l,h[u+9+c])),c=0,h=An[u];h[a];++a)c+=c+S(l,h[a]);c+=3+(8<<u)}else S(l,h[u+7])?(c=7+2*S(l,165),c+=S(l,145)):c=5+S(l,159);else c=S(l,h[u+4])?3+S(l,h[u+5]):2;a=o[2]}else c=1,a=o[1];o=s+rn[n],0>(l=e).b&&Q(l);var u,h=l.b,d=(u=l.Ca>>1)-(l.I>>h)>>31;--l.b,l.Ca+=d,l.Ca|=1,l.I-=(u+1&d)<<h,i[o]=((c^d)-d)*r[(0<n)+0]}return 16}function $e(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,n(e.zc,0,0,e.zc.length),e.ja=0}function Ze(e,t,A,r,n){n=e[t+A+32*r]+(n>>3),e[t+A+32*r]=-256&n?0>n?0:255:n}function et(e,t,A,r,n,i){Ze(e,t,0,A,r+n),Ze(e,t,1,A,r+i),Ze(e,t,2,A,r-i),Ze(e,t,3,A,r-n)}function tt(e){return(20091*e>>16)+e}function At(e,t,A,r){var n,s=0,a=i(16);for(n=0;4>n;++n){var o=e[t+0]+e[t+8],l=e[t+0]-e[t+8],c=(35468*e[t+4]>>16)-tt(e[t+12]),u=tt(e[t+4])+(35468*e[t+12]>>16);a[s+0]=o+u,a[s+1]=l+c,a[s+2]=l-c,a[s+3]=o-u,s+=4,t++}for(n=s=0;4>n;++n)o=(e=a[s+0]+4)+a[s+8],l=e-a[s+8],c=(35468*a[s+4]>>16)-tt(a[s+12]),Ze(A,r,0,0,o+(u=tt(a[s+4])+(35468*a[s+12]>>16))),Ze(A,r,1,0,l+c),Ze(A,r,2,0,l-c),Ze(A,r,3,0,o-u),s++,r+=32}function rt(e,t,A,r){var n=e[t+0]+4,i=35468*e[t+4]>>16,s=tt(e[t+4]),a=35468*e[t+1]>>16;et(A,r,0,n+s,e=tt(e[t+1]),a),et(A,r,1,n+i,e,a),et(A,r,2,n-i,e,a),et(A,r,3,n-s,e,a)}function nt(e,t,A,r,n){At(e,t,A,r),n&&At(e,t+16,A,r+4)}function it(e,t,A,r){nr(e,t+0,A,r,1),nr(e,t+32,A,r+128,1)}function st(e,t,A,r){var n;for(e=e[t+0]+4,n=0;4>n;++n)for(t=0;4>t;++t)Ze(A,r,t,n,e)}function at(e,t,A,r){e[t+0]&&ar(e,t+0,A,r),e[t+16]&&ar(e,t+16,A,r+4),e[t+32]&&ar(e,t+32,A,r+128),e[t+48]&&ar(e,t+48,A,r+128+4)}function ot(e,t,A,r){var n,s=i(16);for(n=0;4>n;++n){var a=e[t+0+n]+e[t+12+n],o=e[t+4+n]+e[t+8+n],l=e[t+4+n]-e[t+8+n],c=e[t+0+n]-e[t+12+n];s[0+n]=a+o,s[8+n]=a-o,s[4+n]=c+l,s[12+n]=c-l}for(n=0;4>n;++n)a=(e=s[0+4*n]+3)+s[3+4*n],o=s[1+4*n]+s[2+4*n],l=s[1+4*n]-s[2+4*n],c=e-s[3+4*n],A[r+0]=a+o>>3,A[r+16]=c+l>>3,A[r+32]=a-o>>3,A[r+48]=c-l>>3,r+=64}function lt(e,t,A){var r,n=t-32,i=_r,s=255-e[n-1];for(r=0;r<A;++r){var a,o=i,l=s+e[t-1];for(a=0;a<A;++a)e[t+a]=o[l+e[n+a]];t+=32}}function ct(e,t){lt(e,t,4)}function ut(e,t){lt(e,t,8)}function ht(e,t){lt(e,t,16)}function dt(e,t){var A;for(A=0;16>A;++A)r(e,t+32*A,e,t-32,16)}function ft(e,t){var A;for(A=16;0<A;--A)n(e,t,e[t-1],16),t+=32}function pt(e,t,A){var r;for(r=0;16>r;++r)n(t,A+32*r,e,16)}function gt(e,t){var A,r=16;for(A=0;16>A;++A)r+=e[t-1+32*A]+e[t+A-32];pt(r>>5,e,t)}function mt(e,t){var A,r=8;for(A=0;16>A;++A)r+=e[t-1+32*A];pt(r>>4,e,t)}function wt(e,t){var A,r=8;for(A=0;16>A;++A)r+=e[t+A-32];pt(r>>4,e,t)}function Bt(e,t){pt(128,e,t)}function bt(e,t,A){return e+2*t+A+2>>2}function yt(e,t){var A,n=t-32;for(n=new Uint8Array([bt(e[n-1],e[n+0],e[n+1]),bt(e[n+0],e[n+1],e[n+2]),bt(e[n+1],e[n+2],e[n+3]),bt(e[n+2],e[n+3],e[n+4])]),A=0;4>A;++A)r(e,t+32*A,n,0,n.length)}function vt(e,t){var A=e[t-1],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96];E(e,t+0,16843009*bt(e[t-1-32],A,r)),E(e,t+32,16843009*bt(A,r,n)),E(e,t+64,16843009*bt(r,n,i)),E(e,t+96,16843009*bt(n,i,i))}function Ct(e,t){var A,r=4;for(A=0;4>A;++A)r+=e[t+A-32]+e[t-1+32*A];for(r>>=3,A=0;4>A;++A)n(e,t+32*A,r,4)}function xt(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1-32],s=e[t+0-32],a=e[t+1-32],o=e[t+2-32],l=e[t+3-32];e[t+0+96]=bt(r,n,e[t-1+96]),e[t+1+96]=e[t+0+64]=bt(A,r,n),e[t+2+96]=e[t+1+64]=e[t+0+32]=bt(i,A,r),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=bt(s,i,A),e[t+3+64]=e[t+2+32]=e[t+1+0]=bt(a,s,i),e[t+3+32]=e[t+2+0]=bt(o,a,s),e[t+3+0]=bt(l,o,a)}function Ft(e,t){var A=e[t+1-32],r=e[t+2-32],n=e[t+3-32],i=e[t+4-32],s=e[t+5-32],a=e[t+6-32],o=e[t+7-32];e[t+0+0]=bt(e[t+0-32],A,r),e[t+1+0]=e[t+0+32]=bt(A,r,n),e[t+2+0]=e[t+1+32]=e[t+0+64]=bt(r,n,i),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=bt(n,i,s),e[t+3+32]=e[t+2+64]=e[t+1+96]=bt(i,s,a),e[t+3+64]=e[t+2+96]=bt(s,a,o),e[t+3+96]=bt(a,o,o)}function Qt(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1-32],s=e[t+0-32],a=e[t+1-32],o=e[t+2-32],l=e[t+3-32];e[t+0+0]=e[t+1+64]=i+s+1>>1,e[t+1+0]=e[t+2+64]=s+a+1>>1,e[t+2+0]=e[t+3+64]=a+o+1>>1,e[t+3+0]=o+l+1>>1,e[t+0+96]=bt(n,r,A),e[t+0+64]=bt(r,A,i),e[t+0+32]=e[t+1+96]=bt(A,i,s),e[t+1+32]=e[t+2+96]=bt(i,s,a),e[t+2+32]=e[t+3+96]=bt(s,a,o),e[t+3+32]=bt(a,o,l)}function Ut(e,t){var A=e[t+0-32],r=e[t+1-32],n=e[t+2-32],i=e[t+3-32],s=e[t+4-32],a=e[t+5-32],o=e[t+6-32],l=e[t+7-32];e[t+0+0]=A+r+1>>1,e[t+1+0]=e[t+0+64]=r+n+1>>1,e[t+2+0]=e[t+1+64]=n+i+1>>1,e[t+3+0]=e[t+2+64]=i+s+1>>1,e[t+0+32]=bt(A,r,n),e[t+1+32]=e[t+0+96]=bt(r,n,i),e[t+2+32]=e[t+1+96]=bt(n,i,s),e[t+3+32]=e[t+2+96]=bt(i,s,a),e[t+3+64]=bt(s,a,o),e[t+3+96]=bt(a,o,l)}function St(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96];e[t+0+0]=A+r+1>>1,e[t+2+0]=e[t+0+32]=r+n+1>>1,e[t+2+32]=e[t+0+64]=n+i+1>>1,e[t+1+0]=bt(A,r,n),e[t+3+0]=e[t+1+32]=bt(r,n,i),e[t+3+32]=e[t+1+64]=bt(n,i,i),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=i}function Et(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96],s=e[t-1-32],a=e[t+0-32],o=e[t+1-32],l=e[t+2-32];e[t+0+0]=e[t+2+32]=A+s+1>>1,e[t+0+32]=e[t+2+64]=r+A+1>>1,e[t+0+64]=e[t+2+96]=n+r+1>>1,e[t+0+96]=i+n+1>>1,e[t+3+0]=bt(a,o,l),e[t+2+0]=bt(s,a,o),e[t+1+0]=e[t+3+32]=bt(A,s,a),e[t+1+32]=e[t+3+64]=bt(r,A,s),e[t+1+64]=e[t+3+96]=bt(n,r,A),e[t+1+96]=bt(i,n,r)}function Nt(e,t){var A;for(A=0;8>A;++A)r(e,t+32*A,e,t-32,8)}function Lt(e,t){var A;for(A=0;8>A;++A)n(e,t,e[t-1],8),t+=32}function _t(e,t,A){var r;for(r=0;8>r;++r)n(t,A+32*r,e,8)}function It(e,t){var A,r=8;for(A=0;8>A;++A)r+=e[t+A-32]+e[t-1+32*A];_t(r>>4,e,t)}function kt(e,t){var A,r=4;for(A=0;8>A;++A)r+=e[t+A-32];_t(r>>3,e,t)}function Tt(e,t){var A,r=4;for(A=0;8>A;++A)r+=e[t-1+32*A];_t(r>>3,e,t)}function Ht(e,t){_t(128,e,t)}function Ot(e,t,A){var r=e[t-A],n=e[t+0],i=3*(n-r)+Nr[1020+e[t-2*A]-e[t+A]],s=Lr[112+(i+4>>3)];e[t-A]=_r[255+r+Lr[112+(i+3>>3)]],e[t+0]=_r[255+n-s]}function Pt(e,t,A,r){var n=e[t+0],i=e[t+A];return Ir[255+e[t-2*A]-e[t-A]]>r||Ir[255+i-n]>r}function Dt(e,t,A,r){return 4*Ir[255+e[t-A]-e[t+0]]+Ir[255+e[t-2*A]-e[t+A]]<=r}function Mt(e,t,A,r,n){var i=e[t-3*A],s=e[t-2*A],a=e[t-A],o=e[t+0],l=e[t+A],c=e[t+2*A],u=e[t+3*A];return 4*Ir[255+a-o]+Ir[255+s-l]>r?0:Ir[255+e[t-4*A]-i]<=n&&Ir[255+i-s]<=n&&Ir[255+s-a]<=n&&Ir[255+u-c]<=n&&Ir[255+c-l]<=n&&Ir[255+l-o]<=n}function jt(e,t,A,r){var n=2*r+1;for(r=0;16>r;++r)Dt(e,t+r,A,n)&&Ot(e,t+r,A)}function Rt(e,t,A,r){var n=2*r+1;for(r=0;16>r;++r)Dt(e,t+r*A,1,n)&&Ot(e,t+r*A,1)}function Vt(e,t,A,r){var n;for(n=3;0<n;--n)jt(e,t+=4*A,A,r)}function Kt(e,t,A,r){var n;for(n=3;0<n;--n)Rt(e,t+=4,A,r)}function Gt(e,t,A,r,n,i,s,a){for(i=2*i+1;0<n--;){if(Mt(e,t,A,i,s))if(Pt(e,t,A,a))Ot(e,t,A);else{var o=e,l=t,c=A,u=o[l-2*c],h=o[l-c],d=o[l+0],f=o[l+c],p=o[l+2*c],g=27*(w=Nr[1020+3*(d-h)+Nr[1020+u-f]])+63>>7,m=18*w+63>>7,w=9*w+63>>7;o[l-3*c]=_r[255+o[l-3*c]+w],o[l-2*c]=_r[255+u+m],o[l-c]=_r[255+h+g],o[l+0]=_r[255+d-g],o[l+c]=_r[255+f-m],o[l+2*c]=_r[255+p-w]}t+=r}}function zt(e,t,A,r,n,i,s,a){for(i=2*i+1;0<n--;){if(Mt(e,t,A,i,s))if(Pt(e,t,A,a))Ot(e,t,A);else{var o=e,l=t,c=A,u=o[l-c],h=o[l+0],d=o[l+c],f=Lr[112+(4+(p=3*(h-u))>>3)],p=Lr[112+(p+3>>3)],g=f+1>>1;o[l-2*c]=_r[255+o[l-2*c]+g],o[l-c]=_r[255+u+p],o[l+0]=_r[255+h-f],o[l+c]=_r[255+d-g]}t+=r}}function qt(e,t,A,r,n,i){Gt(e,t,A,1,16,r,n,i)}function Wt(e,t,A,r,n,i){Gt(e,t,1,A,16,r,n,i)}function Xt(e,t,A,r,n,i){var s;for(s=3;0<s;--s)zt(e,t+=4*A,A,1,16,r,n,i)}function Yt(e,t,A,r,n,i){var s;for(s=3;0<s;--s)zt(e,t+=4,1,A,16,r,n,i)}function Jt(e,t,A,r,n,i,s,a){Gt(e,t,n,1,8,i,s,a),Gt(A,r,n,1,8,i,s,a)}function $t(e,t,A,r,n,i,s,a){Gt(e,t,1,n,8,i,s,a),Gt(A,r,1,n,8,i,s,a)}function Zt(e,t,A,r,n,i,s,a){zt(e,t+4*n,n,1,8,i,s,a),zt(A,r+4*n,n,1,8,i,s,a)}function eA(e,t,A,r,n,i,s,a){zt(e,t+4,1,n,8,i,s,a),zt(A,r+4,1,n,8,i,s,a)}function tA(){this.ba=new se,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new oe,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function AA(){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 rA(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function nA(){this.ua=0,this.Wa=new T,this.vb=new T,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new u}function iA(){this.xb=this.a=0,this.l=new ze,this.ca=new se,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new y,this.Pb=0,this.wd=new y,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new nA,this.ab=0,this.gc=s(4,rA),this.Oc=0}function sA(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new ze,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function aA(e,t,A,r,n,i,s){for(e=null==e?0:e[t+0],t=0;t<s;++t)n[i+t]=e+A[r+t]&255,e=n[i+t]}function oA(e,t,A,r,n,i,s){var a;if(null==e)aA(null,null,A,r,n,i,s);else for(a=0;a<s;++a)n[i+a]=e[t+a]+A[r+a]&255}function lA(e,t,A,r,n,i,s){if(null==e)aA(null,null,A,r,n,i,s);else{var a,o=e[t+0],l=o,c=o;for(a=0;a<s;++a)l=c+(o=e[t+a])-l,c=A[r+a]+(-256&l?0>l?0:255:l)&255,l=o,n[i+a]=c}}function cA(e,A,n,s){var a=A.width,o=A.o;if(t(null!=e&&null!=A),0>n||0>=s||n+s>o)return null;if(!e.Cc){if(null==e.ga){var l;if(e.ga=new sA,(l=null==e.ga)||(l=A.width*A.o,t(0==e.Gb.length),e.Gb=i(l),e.Uc=0,null==e.Gb?l=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,l=1),l=!l),!l){l=e.ga;var c=e.Fa,u=e.P,h=e.qc,d=e.mb,f=e.nb,p=u+1,g=h-1,w=l.l;if(t(null!=c&&null!=d&&null!=A),pn[0]=null,pn[1]=aA,pn[2]=oA,pn[3]=lA,l.ca=d,l.tb=f,l.c=A.width,l.i=A.height,t(0<l.c&&0<l.i),1>=h)A=0;else if(l.$a=3&c[u+0],l.Z=c[u+0]>>2&3,l.Lc=c[u+0]>>4&3,u=c[u+0]>>6&3,0>l.$a||1<l.$a||4<=l.Z||1<l.Lc||u)A=0;else if(w.put=de,w.ac=he,w.bc=fe,w.ma=l,w.width=A.width,w.height=A.height,w.Da=A.Da,w.v=A.v,w.va=A.va,w.j=A.j,w.o=A.o,l.$a)e:{t(1==l.$a),A=Se();t:for(;;){if(null==A){A=0;break e}if(t(null!=l),l.mc=A,A.c=l.c,A.i=l.i,A.l=l.l,A.l.ma=l,A.l.width=l.c,A.l.height=l.i,A.a=0,m(A.m,c,p,g),!Ee(l.c,l.i,1,A,null))break t;if(1==A.ab&&3==A.gc[0].hc&&Ce(A.s)?(l.ic=1,c=A.c*A.i,A.Ta=null,A.Ua=0,A.V=i(c),A.Ba=0,null==A.V?(A.a=1,A=0):A=1):(l.ic=0,A=Ne(A,l.c)),!A)break t;A=1;break e}l.mc=null,A=0}else A=g>=l.c*l.i;l=!A}if(l)return null;1!=e.ga.Lc?e.Ga=0:s=o-n}t(null!=e.ga),t(n+s<=o);e:{if(A=(c=e.ga).c,o=c.l.o,0==c.$a){if(p=e.rc,g=e.Vc,w=e.Fa,u=e.P+1+n*A,h=e.mb,d=e.nb+n*A,t(u<=e.P+e.qc),0!=c.Z)for(t(null!=pn[c.Z]),l=0;l<s;++l)pn[c.Z](p,g,w,u,h,d,A),p=h,g=d,d+=A,u+=A;else for(l=0;l<s;++l)r(h,d,w,u,A),p=h,g=d,d+=A,u+=A;e.rc=p,e.Vc=g}else{if(t(null!=c.mc),A=n+s,t(null!=(l=c.mc)),t(A<=l.i),l.C>=A)A=1;else if(c.ic||pA(),c.ic){c=l.V,p=l.Ba,g=l.c;var B=l.i,b=(w=1,u=l.$/g,h=l.$%g,d=l.m,f=l.s,l.$),y=g*B,v=g*A,x=f.wc,Q=b<v?be(f,h,u):null;t(b<=y),t(A<=B),t(Ce(f));t:for(;;){for(;!d.h&&b<v;){if(h&x||(Q=be(f,h,u)),t(null!=Q),F(d),256>(B=we(Q.G[0],Q.H[0],d)))c[p+b]=B,++b,++h>=g&&(h=0,++u<=A&&!(u%16)&&Fe(l,u));else{if(!(280>B)){w=0;break t}B=ge(B-256,d);var U,S=we(Q.G[4],Q.H[4],d);if(F(d),!(b>=(S=me(g,S=ge(S,d)))&&y-b>=B)){w=0;break t}for(U=0;U<B;++U)c[p+b+U]=c[p+b+U-S];for(b+=B,h+=B;h>=g;)h-=g,++u<=A&&!(u%16)&&Fe(l,u);b<v&&h&x&&(Q=be(f,h,u))}t(d.h==C(d))}Fe(l,u>A?A:u);break t}!w||d.h&&b<y?(w=0,l.a=d.h?5:3):l.$=b,A=w}else A=Qe(l,l.V,l.Ba,l.c,l.i,A,Le);if(!A){s=0;break e}}n+s>=o&&(e.Cc=1),s=1}if(!s)return null;if(e.Cc&&(null!=(s=e.ga)&&(s.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+n*a}function uA(e,t,A,r,n,i){for(;0<n--;){var s,a=e,o=t+(A?1:0),l=e,c=t+(A?0:3);for(s=0;s<r;++s){var u=l[c+4*s];255!=u&&(u*=32897,a[o+4*s+0]=a[o+4*s+0]*u>>23,a[o+4*s+1]=a[o+4*s+1]*u>>23,a[o+4*s+2]=a[o+4*s+2]*u>>23)}t+=i}}function hA(e,t,A,r,n){for(;0<r--;){var i;for(i=0;i<A;++i){var s=e[t+2*i+0],a=15&(l=e[t+2*i+1]),o=4369*a,l=(240&l|l>>4)*o>>16;e[t+2*i+0]=(240&s|s>>4)*o>>16&240|(15&s|s<<4)*o>>16>>4&15,e[t+2*i+1]=240&l|a}t+=n}}function dA(e,t,A,r,n,i,s,a){var o,l,c=255;for(l=0;l<n;++l){for(o=0;o<r;++o){var u=e[t+o];i[s+4*o]=u,c&=u}t+=A,s+=a}return 255!=c}function fA(e,t,A,r,n){var i;for(i=0;i<n;++i)A[r+i]=e[t+i]>>8}function pA(){yr=uA,vr=hA,Cr=dA,xr=fA}function gA(A,r,n){e[A]=function(e,A,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B){var b,y=B-1>>1,v=a[o+0]|l[c+0]<<16,C=u[h+0]|d[f+0]<<16;t(null!=e);var x=3*v+C+131074>>2;for(r(e[A+0],255&x,x>>16,p,g),null!=i&&(x=3*C+v+131074>>2,r(i[s+0],255&x,x>>16,m,w)),b=1;b<=y;++b){var F=a[o+b]|l[c+b]<<16,Q=u[h+b]|d[f+b]<<16,U=v+F+C+Q+524296,S=U+2*(F+C)>>3;x=S+v>>1,v=(U=U+2*(v+Q)>>3)+F>>1,r(e[A+2*b-1],255&x,x>>16,p,g+(2*b-1)*n),r(e[A+2*b-0],255&v,v>>16,p,g+(2*b-0)*n),null!=i&&(x=U+C>>1,v=S+Q>>1,r(i[s+2*b-1],255&x,x>>16,m,w+(2*b-1)*n),r(i[s+2*b+0],255&v,v>>16,m,w+(2*b+0)*n)),v=F,C=Q}1&B||(x=3*v+C+131074>>2,r(e[A+B-1],255&x,x>>16,p,g+(B-1)*n),null!=i&&(x=3*C+v+131074>>2,r(i[s+B-1],255&x,x>>16,m,w+(B-1)*n)))}}function mA(){gn[kr]=mn,gn[Tr]=Bn,gn[Hr]=wn,gn[Or]=bn,gn[Pr]=yn,gn[Dr]=vn,gn[Mr]=Cn,gn[jr]=Bn,gn[Rr]=bn,gn[Vr]=yn,gn[Kr]=vn}function wA(e){return e&~En?0>e?0:255:e>>Sn}function BA(e,t){return wA((19077*e>>8)+(26149*t>>8)-14234)}function bA(e,t,A){return wA((19077*e>>8)-(6419*t>>8)-(13320*A>>8)+8708)}function yA(e,t){return wA((19077*e>>8)+(33050*t>>8)-17685)}function vA(e,t,A,r,n){r[n+0]=BA(e,A),r[n+1]=bA(e,t,A),r[n+2]=yA(e,t)}function CA(e,t,A,r,n){r[n+0]=yA(e,t),r[n+1]=bA(e,t,A),r[n+2]=BA(e,A)}function xA(e,t,A,r,n){var i=bA(e,t,A);t=i<<3&224|yA(e,t)>>3,r[n+0]=248&BA(e,A)|i>>5,r[n+1]=t}function FA(e,t,A,r,n){var i=240&yA(e,t)|15;r[n+0]=240&BA(e,A)|bA(e,t,A)>>4,r[n+1]=i}function QA(e,t,A,r,n){r[n+0]=255,vA(e,t,A,r,n+1)}function UA(e,t,A,r,n){CA(e,t,A,r,n),r[n+3]=255}function SA(e,t,A,r,n){vA(e,t,A,r,n),r[n+3]=255}function EA(t,A,r){e[t]=function(e,t,n,i,s,a,o,l,c){for(var u=l+(-2&c)*r;l!=u;)A(e[t+0],n[i+0],s[a+0],o,l),A(e[t+1],n[i+0],s[a+0],o,l+r),t+=2,++i,++a,l+=2*r;1&c&&A(e[t+0],n[i+0],s[a+0],o,l)}}function NA(e,t,A){return 0==A?0==e?0==t?6:5:0==t?4:0:A}function LA(e,t,A,r,n){switch(e>>>30){case 3:nr(t,A,r,n,0);break;case 2:ir(t,A,r,n);break;case 1:ar(t,A,r,n)}}function _A(e,t){var A,i,s=t.M,a=t.Nb,o=e.oc,l=e.pc+40,c=e.oc,u=e.pc+584,h=e.oc,d=e.pc+600;for(A=0;16>A;++A)o[l+32*A-1]=129;for(A=0;8>A;++A)c[u+32*A-1]=129,h[d+32*A-1]=129;for(0<s?o[l-1-32]=c[u-1-32]=h[d-1-32]=129:(n(o,l-32-1,127,21),n(c,u-32-1,127,9),n(h,d-32-1,127,9)),i=0;i<e.za;++i){var f=t.ya[t.aa+i];if(0<i){for(A=-1;16>A;++A)r(o,l+32*A-4,o,l+32*A+12,4);for(A=-1;8>A;++A)r(c,u+32*A-4,c,u+32*A+4,4),r(h,d+32*A-4,h,d+32*A+4,4)}var p=e.Gd,g=e.Hd+i,m=f.ad,w=f.Hc;if(0<s&&(r(o,l-32,p[g].y,0,16),r(c,u-32,p[g].f,0,8),r(h,d-32,p[g].ea,0,8)),f.Za){var B=o,b=l-32+16;for(0<s&&(i>=e.za-1?n(B,b,p[g].y[15],4):r(B,b,p[g+1].y,0,4)),A=0;4>A;A++)B[b+128+A]=B[b+256+A]=B[b+384+A]=B[b+0+A];for(A=0;16>A;++A,w<<=2)B=o,b=l+On[A],un[f.Ob[A]](B,b),LA(w,m,16*+A,B,b)}else if(B=NA(i,s,f.Ob[0]),cn[B](o,l),0!=w)for(A=0;16>A;++A,w<<=2)LA(w,m,16*+A,o,l+On[A]);for(A=f.Gc,B=NA(i,s,f.Dd),hn[B](c,u),hn[B](h,d),w=m,B=c,b=u,255&(f=0|A)&&(170&f?sr(w,256,B,b):or(w,256,B,b)),f=h,w=d,255&(A>>=8)&&(170&A?sr(m,320,f,w):or(m,320,f,w)),s<e.Ub-1&&(r(p[g].y,0,o,l+480,16),r(p[g].f,0,c,u+224,8),r(p[g].ea,0,h,d+224,8)),A=8*a*e.B,p=e.sa,g=e.ta+16*i+16*a*e.R,m=e.qa,f=e.ra+8*i+A,w=e.Ha,B=e.Ia+8*i+A,A=0;16>A;++A)r(p,g+A*e.R,o,l+32*A,16);for(A=0;8>A;++A)r(m,f+A*e.B,c,u+32*A,8),r(w,B+A*e.B,h,d+32*A,8)}}function IA(e,r,n,i,s,a,o,l,c){var u=[0],h=[0],d=0,f=null!=c?c.kd:0,p=null!=c?c:new AA;if(null==e||12>n)return 7;p.data=e,p.w=r,p.ha=n,r=[r],n=[n],p.gb=[p.gb];e:{var g=r,w=n,B=p.gb;if(t(null!=e),t(null!=w),t(null!=B),B[0]=0,12<=w[0]&&!A(e,g[0],"RIFF")){if(A(e,g[0]+8,"WEBP")){B=3;break e}var b=_(e,g[0]+4);if(12>b||4294967286<b){B=3;break e}if(f&&b>w[0]-8){B=7;break e}B[0]=b,g[0]+=12,w[0]-=12}B=0}if(0!=B)return B;for(b=0<p.gb[0],n=n[0];;){e:{var v=e;w=r,B=n;var C=u,x=h,F=g=[0];if((S=d=[d])[0]=0,8>B[0])B=7;else{if(!A(v,w[0],"VP8X")){if(10!=_(v,w[0]+4)){B=3;break e}if(18>B[0]){B=7;break e}var Q=_(v,w[0]+8),U=1+L(v,w[0]+12);if(2147483648<=U*(v=1+L(v,w[0]+15))){B=3;break e}null!=F&&(F[0]=Q),null!=C&&(C[0]=U),null!=x&&(x[0]=v),w[0]+=18,B[0]-=18,S[0]=1}B=0}}if(d=d[0],g=g[0],0!=B)return B;if(w=!!(2&g),!b&&d)return 3;if(null!=a&&(a[0]=!!(16&g)),null!=o&&(o[0]=w),null!=l&&(l[0]=0),o=u[0],g=h[0],d&&w&&null==c){B=0;break}if(4>n){B=7;break}if(b&&d||!b&&!d&&!A(e,r[0],"ALPH")){n=[n],p.na=[p.na],p.P=[p.P],p.Sa=[p.Sa];e:{Q=e,B=r,b=n;var S=p.gb;C=p.na,x=p.P,F=p.Sa,U=22,t(null!=Q),t(null!=b),v=B[0];var E=b[0];for(t(null!=C),t(null!=F),C[0]=null,x[0]=null,F[0]=0;;){if(B[0]=v,b[0]=E,8>E){B=7;break e}var N=_(Q,v+4);if(4294967286<N){B=3;break e}var I=8+N+1&-2;if(U+=I,0<S&&U>S){B=3;break e}if(!A(Q,v,"VP8 ")||!A(Q,v,"VP8L")){B=0;break e}if(E[0]<I){B=7;break e}A(Q,v,"ALPH")||(C[0]=Q,x[0]=v+8,F[0]=N),v+=I,E-=I}}if(n=n[0],p.na=p.na[0],p.P=p.P[0],p.Sa=p.Sa[0],0!=B)break}n=[n],p.Ja=[p.Ja],p.xa=[p.xa];e:if(S=e,B=r,b=n,C=p.gb[0],x=p.Ja,F=p.xa,Q=B[0],v=!A(S,Q,"VP8 "),U=!A(S,Q,"VP8L"),t(null!=S),t(null!=b),t(null!=x),t(null!=F),8>b[0])B=7;else{if(v||U){if(S=_(S,Q+4),12<=C&&S>C-12){B=3;break e}if(f&&S>b[0]-8){B=7;break e}x[0]=S,B[0]+=8,b[0]-=8,F[0]=U}else F[0]=5<=b[0]&&47==S[Q+0]&&!(S[Q+4]>>5),x[0]=b[0];B=0}if(n=n[0],p.Ja=p.Ja[0],p.xa=p.xa[0],r=r[0],0!=B)break;if(4294967286<p.Ja)return 3;if(null==l||w||(l[0]=p.xa?2:1),o=[o],g=[g],p.xa){if(5>n){B=7;break}l=o,f=g,w=a,null==e||5>n?e=0:5<=n&&47==e[r+0]&&!(e[r+4]>>5)?(b=[0],S=[0],C=[0],m(x=new y,e,r,n),pe(x,b,S,C)?(null!=l&&(l[0]=b[0]),null!=f&&(f[0]=S[0]),null!=w&&(w[0]=C[0]),e=1):e=0):e=0}else{if(10>n){B=7;break}l=g,null==e||10>n||!Xe(e,r+3,n-3)?e=0:(f=e[r+0]|e[r+1]<<8|e[r+2]<<16,w=16383&(e[r+7]<<8|e[r+6]),e=16383&(e[r+9]<<8|e[r+8]),1&f||3<(f>>1&7)||!(f>>4&1)||f>>5>=p.Ja||!w||!e?e=0:(o&&(o[0]=w),l&&(l[0]=e),e=1))}if(!e)return 3;if(o=o[0],g=g[0],d&&(u[0]!=o||h[0]!=g))return 3;null!=c&&(c[0]=p,c.offset=r-c.w,t(4294967286>r-c.w),t(c.offset==c.ha-n));break}return 0==B||7==B&&d&&null==c?(null!=a&&(a[0]|=null!=p.na&&0<p.na.length),null!=i&&(i[0]=o),null!=s&&(s[0]=g),0):B}function kA(e,t,A){var r=t.width,n=t.height,i=0,s=0,a=r,o=n;if(t.Da=null!=e&&0<e.Da,t.Da&&(a=e.cd,o=e.bd,i=e.v,s=e.j,11>A||(i&=-2,s&=-2),0>i||0>s||0>=a||0>=o||i+a>r||s+o>n))return 0;if(t.v=i,t.j=s,t.va=i+a,t.o=s+o,t.U=a,t.T=o,t.da=null!=e&&0<e.da,t.da){if(!H(a,o,A=[e.ib],i=[e.hb]))return 0;t.ib=A[0],t.hb=i[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*r/4&&t.hb<3*n/4,t.Kb=0),1}function TA(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function HA(e,t,A,r){if(null==r||0>=e||0>=t)return 2;if(null!=A){if(A.Da){var n=A.cd,s=A.bd,a=-2&A.v,o=-2&A.j;if(0>a||0>o||0>=n||0>=s||a+n>e||o+s>t)return 2;e=n,t=s}if(A.da){if(!H(e,t,n=[A.ib],s=[A.hb]))return 2;e=n[0],t=s[0]}}r.width=e,r.height=t;e:{var l=r.width,c=r.height;if(e=r.S,0>=l||0>=c||!(e>=kr&&13>e))e=2;else{if(0>=r.Rd&&null==r.sd){a=s=n=t=0;var u=(o=l*Mn[e])*c;if(11>e||(s=(c+1)/2*(t=(l+1)/2),12==e&&(a=(n=l)*c)),null==(c=i(u+2*s+a))){e=1;break e}r.sd=c,11>e?((l=r.f.RGBA).eb=c,l.fb=0,l.A=o,l.size=u):((l=r.f.kb).y=c,l.O=0,l.fa=o,l.Fd=u,l.f=c,l.N=0+u,l.Ab=t,l.Cd=s,l.ea=c,l.W=0+u+s,l.Db=t,l.Ed=s,12==e&&(l.F=c,l.J=0+u+2*s),l.Tc=a,l.lb=n)}if(t=1,n=r.S,s=r.width,a=r.height,n>=kr&&13>n)if(11>n)e=r.f.RGBA,t&=(o=Math.abs(e.A))*(a-1)+s<=e.size,t&=o>=s*Mn[n],t&=null!=e.eb;else{e=r.f.kb,o=(s+1)/2,u=(a+1)/2,l=Math.abs(e.fa),c=Math.abs(e.Ab);var h=Math.abs(e.Db),d=Math.abs(e.lb),f=d*(a-1)+s;t&=l*(a-1)+s<=e.Fd,t&=c*(u-1)+o<=e.Cd,t=(t&=h*(u-1)+o<=e.Ed)&l>=s&c>=o&h>=o,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==n&&(t&=d>=s,t&=f<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=A&&A.fd&&(e=TA(r)),e}var OA=64,PA=[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],DA=24,MA=32,jA=8,RA=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,A){return t[A+0]},e.Predictor3=function(e,t,A){return t[A+1]},e.Predictor4=function(e,t,A){return t[A-1]},e.Predictor5=function(e,t,A){return j(j(e,t[A+1]),t[A+0])},e.Predictor6=function(e,t,A){return j(e,t[A-1])},e.Predictor7=function(e,t,A){return j(e,t[A+0])},e.Predictor8=function(e,t,A){return j(t[A-1],t[A+0])},e.Predictor9=function(e,t,A){return j(t[A+0],t[A+1])},e.Predictor10=function(e,t,A){return j(j(e,t[A-1]),j(t[A+0],t[A+1]))},e.Predictor11=function(e,t,A){var r=t[A+0];return 0>=K(r>>24&255,e>>24&255,(t=t[A-1])>>24&255)+K(r>>16&255,e>>16&255,t>>16&255)+K(r>>8&255,e>>8&255,t>>8&255)+K(255&r,255&e,255&t)?r:e},e.Predictor12=function(e,t,A){var r=t[A+0];return(R((e>>24&255)+(r>>24&255)-((t=t[A-1])>>24&255))<<24|R((e>>16&255)+(r>>16&255)-(t>>16&255))<<16|R((e>>8&255)+(r>>8&255)-(t>>8&255))<<8|R((255&e)+(255&r)-(255&t)))>>>0},e.Predictor13=function(e,t,A){var r=t[A-1];return(V((e=j(e,t[A+0]))>>24&255,r>>24&255)<<24|V(e>>16&255,r>>16&255)<<16|V(e>>8&255,r>>8&255)<<8|V(255&e,255&r))>>>0};var VA=e.PredictorAdd0;e.PredictorAdd1=G,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var KA=e.PredictorAdd2;X("ColorIndexInverseTransform","MapARGB","32b",function(e){return e>>8&255},function(e){return e}),X("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(e){return e},function(e){return e>>8&255});var GA,zA=e.ColorIndexInverseTransform,qA=e.MapARGB,WA=e.VP8LColorIndexInverseTransformAlpha,XA=e.MapAlpha,YA=e.VP8LPredictorsAdd=[];YA.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var JA,$A,ZA,er,tr,Ar,rr,nr,ir,sr,ar,or,lr,cr,ur,hr,dr,fr,pr,gr,mr,wr,Br,br,yr,vr,Cr,xr,Fr=i(511),Qr=i(2041),Ur=i(225),Sr=i(767),Er=0,Nr=Qr,Lr=Ur,_r=Sr,Ir=Fr,kr=0,Tr=1,Hr=2,Or=3,Pr=4,Dr=5,Mr=6,jr=7,Rr=8,Vr=9,Kr=10,Gr=[2,3,7],zr=[3,3,11],qr=[280,256,256,256,40],Wr=[0,1,1,1,0],Xr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Yr=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Jr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],$r=8,Zr=[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],en=[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],tn=null,An=[[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]],rn=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],nn=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],sn=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],an=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],on=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ln=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],cn=[],un=[],hn=[],dn=1,fn=2,pn=[],gn=[];gA("UpsampleRgbLinePair",vA,3),gA("UpsampleBgrLinePair",CA,3),gA("UpsampleRgbaLinePair",SA,4),gA("UpsampleBgraLinePair",UA,4),gA("UpsampleArgbLinePair",QA,4),gA("UpsampleRgba4444LinePair",FA,2),gA("UpsampleRgb565LinePair",xA,2);var mn=e.UpsampleRgbLinePair,wn=e.UpsampleBgrLinePair,Bn=e.UpsampleRgbaLinePair,bn=e.UpsampleBgraLinePair,yn=e.UpsampleArgbLinePair,vn=e.UpsampleRgba4444LinePair,Cn=e.UpsampleRgb565LinePair,xn=16,Fn=1<<xn-1,Qn=-227,Un=482,Sn=6,En=(256<<Sn)-1,Nn=0,Ln=i(256),_n=i(256),In=i(256),kn=i(256),Tn=i(Un-Qn),Hn=i(Un-Qn);EA("YuvToRgbRow",vA,3),EA("YuvToBgrRow",CA,3),EA("YuvToRgbaRow",SA,4),EA("YuvToBgraRow",UA,4),EA("YuvToArgbRow",QA,4),EA("YuvToRgba4444Row",FA,2),EA("YuvToRgb565Row",xA,2);var On=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Pn=[0,2,8],Dn=[8,7,6,4,4,2,2,2,1,1,1,1];this.WebPDecodeRGBA=function(e,A,a,o,l){var c=Tr,u=new tA,h=new se;u.ba=h,h.S=c,h.width=[h.width],h.height=[h.height];var d=h.width,f=h.height,p=new ae;if(null==p||null==e)var g=2;else t(null!=p),g=IA(e,A,a,p.width,p.height,p.Pd,p.Qd,p.format,null);if(0!=g?d=0:(null!=d&&(d[0]=p.width[0]),null!=f&&(f[0]=p.height[0]),d=1),d){h.width=h.width[0],h.height=h.height[0],null!=o&&(o[0]=h.width),null!=l&&(l[0]=h.height);e:{if(o=new ze,(l=new AA).data=e,l.w=A,l.ha=a,l.kd=1,A=[0],t(null!=l),(0==(e=IA(l.data,l.w,l.ha,null,null,null,A,null,l))||7==e)&&A[0]&&(e=4),0==(A=e)){if(t(null!=u),o.data=l.data,o.w=l.w+l.offset,o.ha=l.ha-l.offset,o.put=de,o.ac=he,o.bc=fe,o.ma=u,l.xa){if(null==(e=Se())){u=1;break e}if(function(e,A){var r=[0],n=[0],i=[0];t:for(;;){if(null==e)return 0;if(null==A)return e.a=2,0;if(e.l=A,e.a=0,m(e.m,A.data,A.w,A.ha),!pe(e.m,r,n,i)){e.a=3;break t}if(e.xb=fn,A.width=r[0],A.height=n[0],!Ee(r[0],n[0],1,e,null))break t;return 1}return t(0!=e.a),0}(e,o)){if(o=0==(A=HA(o.width,o.height,u.Oa,u.ba))){t:{o=e;A:for(;;){if(null==o){o=0;break t}if(t(null!=o.s.yc),t(null!=o.s.Ya),t(0<o.s.Wb),t(null!=(a=o.l)),t(null!=(l=a.ma)),0!=o.xb){if(o.ca=l.ba,o.tb=l.tb,t(null!=o.ca),!kA(l.Oa,a,Or)){o.a=2;break A}if(!Ne(o,a.width))break A;if(a.da)break A;if((a.da||re(o.ca.S))&&pA(),11>o.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=o.ca.f.kb.F&&pA()),o.Pb&&0<o.s.ua&&null==o.s.vb.X&&!I(o.s.vb,o.s.Wa.Xa)){o.a=1;break A}o.xb=0}if(!Qe(o,o.V,o.Ba,o.c,o.i,a.o,ve))break A;l.Dc=o.Ma,o=1;break t}t(0!=o.a),o=0}o=!o}o&&(A=e.a)}else A=e.a}else{if(null==(e=new qe)){u=1;break e}if(e.Fa=l.na,e.P=l.P,e.qc=l.Sa,Ye(e,o)){if(0==(A=HA(o.width,o.height,u.Oa,u.ba))){if(e.Aa=0,a=u.Oa,t(null!=(l=e)),null!=a){if(0<(d=0>(d=a.Md)?0:100<d?255:255*d/100)){for(f=p=0;4>f;++f)12>(g=l.pb[f]).lc&&(g.ia=d*Dn[0>g.lc?0:g.lc]>>3),p|=g.ia;p&&(alert("todo:VP8InitRandom"),l.ia=1)}l.Ga=a.Id,100<l.Ga?l.Ga=100:0>l.Ga&&(l.Ga=0)}(function(e,A){if(null==e)return 0;if(null==A)return We(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!Ye(e,A))return 0;if(t(e.cb),null==A.ac||A.ac(A)){A.ob&&(e.L=0);var a=Pn[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=A.v-a>>4,e.zb=A.j-a>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=A.o+15+a>>4,e.Hb=A.va+15+a>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var o=e.ed;for(a=0;4>a;++a){var l;if(e.Qa.Cb){var c=e.Qa.Lb[a];e.Qa.Fb||(c+=o.Tb)}else c=o.Tb;for(l=0;1>=l;++l){var u=e.gd[a][l],h=c;if(o.Pc&&(h+=o.vd[0],l&&(h+=o.od[0])),0<(h=0>h?0:63<h?63:h)){var d=h;0<o.wb&&(d=4<o.wb?d>>2:d>>1)>9-o.wb&&(d=9-o.wb),1>d&&(d=1),u.dd=d,u.tc=2*h+d,u.ld=40<=h?2:15<=h?1:0}else u.tc=0;u.La=l}}}a=0}else We(e,6,"Frame setup failed"),a=e.a;if(a=0==a){if(a){e.$c=0,0<e.Aa||(e.Ic=1);t:{a=e.Ic,o=4*(d=e.za);var f=32*d,p=d+1,g=0<e.L?d*(0<e.Aa?2:1):0,m=(2==e.Aa?2:1)*d;if((u=o+832+(l=3*(16*a+Pn[e.L])/2*f)+(c=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=u)a=0;else{if(u>e.Vb){if(e.Vb=0,e.Ec=i(u),e.Fc=0,null==e.Ec){a=We(e,1,"no memory during frame initialization.");break t}e.Vb=u}u=e.Ec,h=e.Fc,e.Ac=u,e.Bc=h,h+=o,e.Gd=s(f,Ve),e.Hd=0,e.rb=s(p+1,De),e.sb=1,e.wa=g?s(g,Pe):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=d),t(!0),e.oc=u,e.pc=h,h+=832,e.ya=s(m,je),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=d),e.R=16*d,e.B=8*d,d=(f=Pn[e.L])*e.R,f=f/2*e.B,e.sa=u,e.ta=h+d,e.qa=e.sa,e.ra=e.ta+16*a*e.R+f,e.Ha=e.qa,e.Ia=e.ra+8*a*e.B+f,e.$c=0,h+=l,e.mb=c?u:null,e.nb=c?h:null,t(h+c<=e.Fc+e.Vb),$e(e),n(e.Ac,e.Bc,0,o),a=1}}if(a){if(A.ka=0,A.y=e.sa,A.O=e.ta,A.f=e.qa,A.N=e.ra,A.ea=e.Ha,A.Vd=e.Ia,A.fa=e.R,A.Rc=e.B,A.F=null,A.J=0,!Er){for(a=-255;255>=a;++a)Fr[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Qr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Ur[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Sr[255+a]=0>a?0:255<a?255:a;Er=1}rr=ot,nr=nt,sr=it,ar=st,or=at,ir=rt,lr=qt,cr=Wt,ur=Jt,hr=$t,dr=Xt,fr=Yt,pr=Zt,gr=eA,mr=jt,wr=Rt,Br=Vt,br=Kt,un[0]=Ct,un[1]=ct,un[2]=yt,un[3]=vt,un[4]=xt,un[5]=Qt,un[6]=Ft,un[7]=Ut,un[8]=Et,un[9]=St,cn[0]=gt,cn[1]=ht,cn[2]=dt,cn[3]=ft,cn[4]=mt,cn[5]=wt,cn[6]=Bt,hn[0]=It,hn[1]=ut,hn[2]=Nt,hn[3]=Lt,hn[4]=Tt,hn[5]=kt,hn[6]=Ht,a=1}else a=0}a&&(a=function(e,A){for(e.M=0;e.M<e.Va;++e.M){var s,a=e.Jc[e.M&e.Xb],o=e.m,l=e;for(s=0;s<l.za;++s){var c=o,u=l,h=u.Ac,d=u.Bc+4*s,f=u.zc,p=u.ya[u.aa+s];if(u.Qa.Bb?p.$b=S(c,u.Pa.jb[0])?2+S(c,u.Pa.jb[2]):S(c,u.Pa.jb[1]):p.$b=0,u.kc&&(p.Ad=S(c,u.Bd)),p.Za=!S(c,145)+0,p.Za){var g=p.Ob,m=0;for(u=0;4>u;++u){var w,B=f[0+u];for(w=0;4>w;++w){B=an[h[d+w]][B];for(var b=nn[S(c,B[0])];0<b;)b=nn[2*b+S(c,B[b])];B=-b,h[d+w]=B}r(g,m,h,d,4),m+=4,f[0+u]=B}}else B=S(c,156)?S(c,128)?1:3:S(c,163)?2:0,p.Ob[0]=B,n(h,d,B,4),n(f,0,B,4);p.Dd=S(c,142)?S(c,114)?S(c,183)?1:3:2:0}if(l.m.Ka)return We(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(l=a,c=(o=e).rb[o.sb-1],h=o.rb[o.sb+o.ja],s=o.ya[o.aa+o.ja],d=o.kc?s.Ad:0)c.la=h.la=0,s.Za||(c.Na=h.Na=0),s.Hc=0,s.Gc=0,s.ia=0;else{var y,v;if(c=h,h=l,d=o.Pa.Xc,f=o.ya[o.aa+o.ja],p=o.pb[f.$b],u=f.ad,g=0,m=o.rb[o.sb-1],B=w=0,n(u,g,0,384),f.Za)var C=0,x=d[3];else{b=i(16);var F=c.Na+m.Na;if(F=tn(h,d[1],F,p.Eb,0,b,0),c.Na=m.Na=(0<F)+0,1<F)rr(b,0,u,g);else{var Q=b[0]+3>>3;for(b=0;256>b;b+=16)u[g+b]=Q}C=1,x=d[0]}var U=15&c.la,E=15&m.la;for(b=0;4>b;++b){var N=1&E;for(Q=v=0;4>Q;++Q)U=U>>1|(N=(F=tn(h,x,F=N+(1&U),p.Sc,C,u,g))>C)<<7,v=v<<2|(3<F?3:1<F?2:0!=u[g+0]),g+=16;U>>=4,E=E>>1|N<<7,w=(w<<8|v)>>>0}for(x=U,C=E>>4,y=0;4>y;y+=2){for(v=0,U=c.la>>4+y,E=m.la>>4+y,b=0;2>b;++b){for(N=1&E,Q=0;2>Q;++Q)F=N+(1&U),U=U>>1|(N=0<(F=tn(h,d[2],F,p.Qc,0,u,g)))<<3,v=v<<2|(3<F?3:1<F?2:0!=u[g+0]),g+=16;U>>=2,E=E>>1|N<<5}B|=v<<4*y,x|=U<<4<<y,C|=(240&E)<<y}c.la=x,m.la=C,f.Hc=w,f.Gc=B,f.ia=43690&B?0:p.ia,d=!(w|B)}if(0<o.L&&(o.wa[o.Y+o.ja]=o.gd[s.$b][s.Za],o.wa[o.Y+o.ja].La|=!d),l.Ka)return We(e,7,"Premature end-of-file encountered.")}if($e(e),o=A,l=1,s=(a=e).D,c=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(s.M=a.M,s.uc=c,_A(a,s),l=1,s=(v=a.D).Nb,c=(B=Pn[a.L])*a.R,h=B/2*a.B,b=16*s*a.R,Q=8*s*a.B,d=a.sa,f=a.ta-c+b,p=a.qa,u=a.ra-h+Q,g=a.Ha,m=a.Ia-h+Q,E=0==(U=v.M),w=U>=a.Va-1,2==a.Aa&&_A(a,v),v.uc)for(N=(F=a).D.M,t(F.D.uc),v=F.yb;v<F.Hb;++v){C=v,x=N;var L=(_=(j=F).D).Nb;y=j.R;var _=_.wa[_.Y+C],I=j.sa,k=j.ta+16*L*y+16*C,T=_.dd,H=_.tc;if(0!=H)if(t(3<=H),1==j.L)0<C&&wr(I,k,y,H+4),_.La&&br(I,k,y,H),0<x&&mr(I,k,y,H+4),_.La&&Br(I,k,y,H);else{var O=j.B,P=j.qa,D=j.ra+8*L*O+8*C,M=j.Ha,j=j.Ia+8*L*O+8*C;L=_.ld,0<C&&(cr(I,k,y,H+4,T,L),hr(P,D,M,j,O,H+4,T,L)),_.La&&(fr(I,k,y,H,T,L),gr(P,D,M,j,O,H,T,L)),0<x&&(lr(I,k,y,H+4,T,L),ur(P,D,M,j,O,H+4,T,L)),_.La&&(dr(I,k,y,H,T,L),pr(P,D,M,j,O,H,T,L))}}if(a.ia&&alert("todo:DitherRow"),null!=o.put){if(v=16*U,U=16*(U+1),E?(o.y=a.sa,o.O=a.ta+b,o.f=a.qa,o.N=a.ra+Q,o.ea=a.Ha,o.W=a.Ia+Q):(v-=B,o.y=d,o.O=f,o.f=p,o.N=u,o.ea=g,o.W=m),w||(U-=B),U>o.o&&(U=o.o),o.F=null,o.J=null,null!=a.Fa&&0<a.Fa.length&&v<U&&(o.J=cA(a,o,v,U-v),o.F=a.mb,null==o.F&&0==o.F.length)){l=We(a,3,"Could not decode alpha data.");break t}v<o.j&&(B=o.j-v,v=o.j,t(!(1&B)),o.O+=a.R*B,o.N+=a.B*(B>>1),o.W+=a.B*(B>>1),null!=o.F&&(o.J+=o.width*B)),v<U&&(o.O+=o.v,o.N+=o.v>>1,o.W+=o.v>>1,null!=o.F&&(o.J+=o.v),o.ka=v-o.j,o.U=o.va-o.v,o.T=U-v,l=o.put(o))}s+1!=a.Ic||w||(r(a.sa,a.ta-c,d,f+16*a.R,c),r(a.qa,a.ra-h,p,u+8*a.B,h),r(a.Ha,a.Ia-h,g,m+8*a.B,h))}if(!l)return We(e,6,"Output aborted.")}return 1}(e,A)),null!=A.bc&&A.bc(A),a&=1}return a?(e.cb=0,a):0})(e,o)||(A=e.a)}}else A=e.a}0==A&&null!=u.Oa&&u.Oa.fd&&(A=TA(u.ba))}u=A}c=0!=u?null:11>c?h.f.RGBA.eb:h.f.kb.y}else c=null;return c};var Mn=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(e,t){for(var A="",r=0;r<4;r++)A+=String.fromCharCode(e[t++]);return A}function c(e,t){return e[t+0]|e[t+1]<<8}function u(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function h(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new o;var d=[0],f=[0],p=[],g=new o,m=e,w=function(e,t){var A={},r=0,n=!1,i=0,s=0;if(A.frames=[],!
|
|
205
|
+
*/function wa(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Ba(e){function t(e){if(!e)throw Error("assert :P")}function A(e,t,A){for(var r=0;4>r;r++)if(e[t+r]!=A.charCodeAt(r))return!0;return!1}function r(e,t,A,r,n){for(var i=0;i<n;i++)e[t+i]=A[r+i]}function n(e,t,A,r){for(var n=0;n<r;n++)e[t+n]=A}function i(e){return new Int32Array(e)}function s(e,t){for(var A=[],r=0;r<e;r++)A.push(new t);return A}function a(e,t){var A=[];return function e(A,r,n){for(var i=n[r],s=0;s<i&&(A.push(n.length>r+1?[]:new t),!(n.length<r+1));s++)e(A[s],r+1,n)}(A,0,e),A}var o=function(){var e=this;function o(e,t){for(var A=1<<t-1>>>0;e&A;)A>>>=1;return A?(e&A-1)+A:e}function l(e,A,r,n,i){t(!(n%r));do{e[A+(n-=r)]=i}while(0<n)}function c(e,A,r,n,s){if(t(2328>=s),512>=s)var a=i(512);else if(null==(a=i(s)))return 0;return function(e,A,r,n,s,a){var c,h,d=A,f=1<<r,p=i(16),g=i(16);for(t(0!=s),t(null!=n),t(null!=e),t(0<r),h=0;h<s;++h){if(15<n[h])return 0;++p[n[h]]}if(p[0]==s)return 0;for(g[1]=0,c=1;15>c;++c){if(p[c]>1<<c)return 0;g[c+1]=g[c]+p[c]}for(h=0;h<s;++h)c=n[h],0<n[h]&&(a[g[c]++]=h);if(1==g[15])return(n=new u).g=0,n.value=a[0],l(e,d,1,f,n),f;var m,w=-1,B=f-1,b=0,y=1,v=1,C=1<<r;for(h=0,c=1,s=2;c<=r;++c,s<<=1){if(y+=v<<=1,0>(v-=p[c]))return 0;for(;0<p[c];--p[c])(n=new u).g=c,n.value=a[h++],l(e,d+b,s,C,n),b=o(b,c)}for(c=r+1,s=2;15>=c;++c,s<<=1){if(y+=v<<=1,0>(v-=p[c]))return 0;for(;0<p[c];--p[c]){if(n=new u,(b&B)!=w){for(d+=C,m=1<<(w=c)-r;15>w&&!(0>=(m-=p[w]));)++w,m<<=1;f+=C=1<<(m=w-r),e[A+(w=b&B)].g=m+r,e[A+w].value=d-A-w}n.g=c-r,n.value=a[h++],l(e,d+(b>>r),s,C,n),b=o(b,c)}}return y!=2*g[15]-1?0:f}(e,A,r,n,s,a)}function u(){this.value=this.g=0}function h(){this.value=this.g=0}function d(){this.G=s(5,u),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(OA,h)}function f(e,A,r,n){t(null!=e),t(null!=A),t(2147483648>n),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=A,e.pa=r,e.Jd=A,e.Yc=r+n,e.Zc=4<=n?r+n-4+1:r,Q(e)}function p(e,t){for(var A=0;0<t--;)A|=S(e,128)<<t;return A}function g(e,t){var A=p(e,t);return U(e)?-A:A}function m(e,A,r,n){var i,s=0;for(t(null!=e),t(null!=A),t(4294967288>n),e.Sb=n,e.Ra=0,e.u=0,e.h=0,4<n&&(n=4),i=0;i<n;++i)s+=A[r+i]<<8*i;e.Ra=s,e.bb=n,e.oa=A,e.pa=r}function w(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<MA-8>>>0,++e.bb,e.u-=8;C(e)&&(e.h=1,e.u=0)}function B(e,A){if(t(0<=A),!e.h&&A<=DA){var r=v(e)&PA[A];return e.u+=A,w(e),r}return e.h=1,e.u=0}function b(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function y(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function v(e){return e.Ra>>>(e.u&MA-1)>>>0}function C(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>MA}function x(e,t){e.u=t,e.h=C(e)}function F(e){e.u>=jA&&(t(e.u>=jA),w(e))}function Q(e){t(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(t(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function U(e){return p(e,1)}function S(e,t){var A=e.Ca;0>e.b&&Q(e);var r=e.b,n=A*t>>>8,i=(e.I>>>r>n)+0;for(i?(A-=n,e.I-=n+1<<r>>>0):A=n+1,r=A,n=0;256<=r;)n+=8,r>>=8;return r=7^n+RA[r],e.b-=r,e.Ca=(A<<r)-1,i}function E(e,t,A){e[t+0]=A>>24&255,e[t+1]=A>>16&255,e[t+2]=A>>8&255,e[t+3]=255&A}function N(e,t){return e[t+0]|e[t+1]<<8}function L(e,t){return N(e,t)|e[t+2]<<16}function _(e,t){return N(e,t)|N(e,t+2)<<16}function I(e,A){var r=1<<A;return t(null!=e),t(0<A),e.X=i(r),null==e.X?0:(e.Mb=32-A,e.Xa=A,1)}function k(e,A){t(null!=e),t(null!=A),t(e.Xa==A.Xa),r(A.X,0,e.X,0,1<<A.Xa)}function T(){this.X=[],this.Xa=this.Mb=0}function H(e,A,r,n){t(null!=r),t(null!=n);var i=r[0],s=n[0];return 0==i&&(i=(e*s+A/2)/A),0==s&&(s=(A*i+e/2)/e),0>=i||0>=s?0:(r[0]=i,n[0]=s,1)}function O(e,t){return e+(1<<t)-1>>>t}function P(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function D(t,A){e[A]=function(A,r,n,i,s,a,o){var l;for(l=0;l<s;++l){var c=e[t](a[o+l-1],n,i+l);a[o+l]=P(A[r+l],c)}}}function M(){this.ud=this.hd=this.jd=0}function j(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function R(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function V(e,t){return R(e+(e-t+.5>>1))}function K(e,t,A){return Math.abs(t-A)-Math.abs(e-A)}function z(e,t,A,r,n,i,s){for(r=i[s-1],A=0;A<n;++A)i[s+A]=r=P(e[t+A],r)}function G(e,t,A,r,n){var i;for(i=0;i<A;++i){var s=e[t+i],a=s>>8&255,o=16711935&(o=(o=16711935&s)+((a<<16)+a));r[n+i]=(4278255360&s)+o>>>0}}function q(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function W(e,t,A,r,n,i){var s;for(s=0;s<r;++s){var a=t[A+s],o=a>>>8,l=a,c=255&(c=(c=a>>>16)+((e.jd<<24>>24)*(o<<24>>24)>>>5));l=255&(l=(l+=(e.hd<<24>>24)*(o<<24>>24)>>>5)+((e.ud<<24>>24)*(c<<24>>24)>>>5)),n[i+s]=(4278255360&a)+(c<<16)+l}}function X(t,A,r,n,i){e[A]=function(e,t,A,r,s,a,o,l,c){for(r=o;r<l;++r)for(o=0;o<c;++o)s[a++]=i(A[n(e[t++])])},e[t]=function(t,A,s,a,o,l,c){var u=8>>t.b,h=t.Ea,d=t.K[0],f=t.w;if(8>u)for(t=(1<<t.b)-1,f=(1<<u)-1;A<s;++A){var p,g=0;for(p=0;p<h;++p)p&t||(g=n(a[o++])),l[c++]=i(d[g&f]),g>>=u}else e["VP8LMapColor"+r](a,o,d,f,l,c,A,s,h)}}function Y(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=i>>16&255,r[n++]=i>>8&255,r[n++]=255&i}}function J(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=i>>16&255,r[n++]=i>>8&255,r[n++]=255&i,r[n++]=i>>24&255}}function $(e,t,A,r,n){for(A=t+A;t<A;){var i=(s=e[t++])>>16&240|s>>12&15,s=240&s|s>>28&15;r[n++]=i,r[n++]=s}}function Z(e,t,A,r,n){for(A=t+A;t<A;){var i=(s=e[t++])>>16&248|s>>13&7,s=s>>5&224|s>>3&31;r[n++]=i,r[n++]=s}}function ee(e,t,A,r,n){for(A=t+A;t<A;){var i=e[t++];r[n++]=255&i,r[n++]=i>>8&255,r[n++]=i>>16&255}}function te(e,t,A,n,i,s){if(0==s)for(A=t+A;t<A;)E(n,((s=e[t++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),i+=32;else r(n,i,e,t,A)}function Ae(t,A){e[A][0]=e[t+"0"],e[A][1]=e[t+"1"],e[A][2]=e[t+"2"],e[A][3]=e[t+"3"],e[A][4]=e[t+"4"],e[A][5]=e[t+"5"],e[A][6]=e[t+"6"],e[A][7]=e[t+"7"],e[A][8]=e[t+"8"],e[A][9]=e[t+"9"],e[A][10]=e[t+"10"],e[A][11]=e[t+"11"],e[A][12]=e[t+"12"],e[A][13]=e[t+"13"],e[A][14]=e[t+"0"],e[A][15]=e[t+"0"]}function re(e){return e==jr||e==Rr||e==Vr||e==Kr}function ne(){this.eb=[],this.size=this.A=this.fb=0}function ie(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function se(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ne,this.f.kb=new ie,this.sd=null}function ae(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function oe(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function le(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function ce(e,t){var A=e.T,n=t.ba.f.RGBA,i=n.eb,s=n.fb+e.ka*n.A,a=gn[t.ba.S],o=e.y,l=e.O,c=e.f,u=e.N,h=e.ea,d=e.W,f=t.cc,p=t.dc,g=t.Mc,m=t.Nc,w=e.ka,B=e.ka+e.T,b=e.U,y=b+1>>1;for(0==w?a(o,l,null,null,c,u,h,d,c,u,h,d,i,s,null,null,b):(a(t.ec,t.fc,o,l,f,p,g,m,c,u,h,d,i,s-n.A,i,s,b),++A);w+2<B;w+=2)f=c,p=u,g=h,m=d,u+=e.Rc,d+=e.Rc,s+=2*n.A,a(o,(l+=2*e.fa)-e.fa,o,l,f,p,g,m,c,u,h,d,i,s-n.A,i,s,b);return l+=e.fa,e.j+B<e.o?(r(t.ec,t.fc,o,l,b),r(t.cc,t.dc,c,u,y),r(t.Mc,t.Nc,h,d,y),A--):1&B||a(o,l,null,null,c,u,h,d,c,u,h,d,i,s+n.A,null,null,b),A}function ue(e,A,r){var n=e.F,i=[e.J];if(null!=n){var s=e.U,a=A.ba.S,o=a==Pr||a==Vr;A=A.ba.f.RGBA;var l=[0],c=e.ka;l[0]=e.T,e.Kb&&(0==c?--l[0]:(--c,i[0]-=e.width),e.j+e.ka+e.T==e.o&&(l[0]=e.o-e.j-c));var u=A.eb;c=A.fb+c*A.A,e=Cr(n,i[0],e.width,s,l,u,c+(o?0:3),A.A),t(r==l),e&&re(a)&&yr(u,c,o,s,l,A.A)}return 0}function he(e){var t=e.ma,A=t.ba.S,r=11>A,n=A==Tr||A==Or||A==Pr||A==Dr||12==A||re(A);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!kA(t.Oa,e,n?11:12))return 0;if(n&&re(A)&&mA(),e.da)alert("todo:use_scaling");else{if(r){if(t.Ib=le,e.Kb){if(A=e.U+1>>1,t.memory=i(e.U+2*A),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+A,t.Ib=ce,mA()}}else alert("todo:EmitYUV");n&&(t.Jb=ue,r&&pA())}if(r&&!Nn){for(e=0;256>e;++e)Ln[e]=89858*(e-128)+Fn>>xn,kn[e]=-22014*(e-128)+Fn,In[e]=-45773*(e-128),_n[e]=113618*(e-128)+Fn>>xn;for(e=Qn;e<Un;++e)t=76283*(e-16)+Fn>>xn,Tn[e-Qn]=ze(t,255),Hn[e-Qn]=ze(t+8>>4,15);Nn=1}return 1}function de(e){var A=e.ma,r=e.U,n=e.T;return t(!(1&e.ka)),0>=r||0>=n?0:(r=A.Ib(e,A),null!=A.Jb&&A.Jb(e,A,r),A.Dc+=r,1)}function fe(e){e.ma.memory=null}function pe(e,t,A,r){return 47!=B(e,8)?0:(t[0]=B(e,14)+1,A[0]=B(e,14)+1,r[0]=B(e,1),0!=B(e,3)?0:!e.h)}function ge(e,t){if(4>e)return e+1;var A=e-2>>1;return(2+(1&e)<<A)+B(t,A)+1}function me(e,t){return 120<t?t-120:1<=(A=((A=Yr[t-1])>>4)*e+(8-(15&A)))?A:1;var A}function we(e,t,A){var r=v(A),n=e[t+=255&r].g-8;return 0<n&&(x(A,A.u+8),r=v(A),t+=e[t].value,t+=r&(1<<n)-1),x(A,A.u+e[t].g),e[t].value}function Be(e,A,r){return r.g+=e.g,r.value+=e.value<<A>>>0,t(8>=r.g),e.g}function be(e,A,r){var n=e.xc;return t((A=0==n?0:e.vc[e.md*(r>>n)+(A>>n)])<e.Wb),e.Ya[A]}function ye(e,A,n,i){var s=e.ab,a=e.c*A,o=e.C;A=o+A;var l=n,c=i;for(i=e.Ta,n=e.Ua;0<s--;){var u=e.gc[s],h=o,d=A,f=l,p=c,g=(c=i,l=n,u.Ea);switch(t(h<d),t(d<=u.nc),u.hc){case 2:zA(f,p,(d-h)*g,c,l);break;case 0:var m=h,w=d,B=c,b=l,y=(Q=u).Ea;0==m&&(VA(f,p,null,null,1,B,b),z(f,p+1,0,0,y-1,B,b+1),p+=y,b+=y,++m);for(var v=1<<Q.b,C=v-1,x=O(y,Q.b),F=Q.K,Q=Q.w+(m>>Q.b)*x;m<w;){var U=F,S=Q,E=1;for(KA(f,p,B,b-y,1,B,b);E<y;){var N=(E&~C)+v;N>y&&(N=y),(0,YA[U[S++]>>8&15])(f,p+ +E,B,b+E-y,N-E,B,b+E),E=N}p+=y,b+=y,++m&C||(Q+=x)}d!=u.nc&&r(c,l-g,c,l+(d-h-1)*g,g);break;case 1:for(g=f,w=p,y=(f=u.Ea)-(b=f&~(B=(p=1<<u.b)-1)),m=O(f,u.b),v=u.K,u=u.w+(h>>u.b)*m;h<d;){for(C=v,x=u,F=new M,Q=w+b,U=w+f;w<Q;)q(C[x++],F),JA(F,g,w,p,c,l),w+=p,l+=p;w<U&&(q(C[x++],F),JA(F,g,w,y,c,l),w+=y,l+=y),++h&B||(u+=m)}break;case 3:if(f==c&&p==l&&0<u.b){for(w=c,f=g=l+(d-h)*g-(b=(d-h)*O(u.Ea,u.b)),p=c,B=l,m=[],b=(y=b)-1;0<=b;--b)m[b]=p[B+b];for(b=y-1;0<=b;--b)w[f+b]=m[b];GA(u,h,d,c,g,c,l)}else GA(u,h,d,f,p,c,l)}l=i,c=n}c!=n&&r(i,n,l,c,a)}function ve(e,A){var r=e.V,n=e.Ba+e.c*e.C,i=A-e.C;if(t(A<=e.l.o),t(16>=i),0<i){var s=e.l,a=e.Ta,o=e.Ua,l=s.width;if(ye(e,i,r,n),i=o=[o],t((r=e.C)<(n=A)),t(s.v<s.va),n>s.o&&(n=s.o),r<s.j){var c=s.j-r;r=s.j,i[0]+=c*l}if(r>=n?r=0:(i[0]+=4*s.v,s.ka=r-s.j,s.U=s.va-s.v,s.T=n-r,r=1),r){if(o=o[0],11>(r=e.ca).S){var u=r.f.RGBA,h=(n=r.S,i=s.U,s=s.T,c=u.eb,u.A),d=s;for(u=u.fb+e.Ma*u.A;0<d--;){var f=a,p=o,g=i,m=c,w=u;switch(n){case kr:$A(f,p,g,m,w);break;case Tr:ZA(f,p,g,m,w);break;case jr:ZA(f,p,g,m,w),yr(m,w,0,g,1,0);break;case Hr:Ar(f,p,g,m,w);break;case Or:te(f,p,g,m,w,1);break;case Rr:te(f,p,g,m,w,1),yr(m,w,0,g,1,0);break;case Pr:te(f,p,g,m,w,0);break;case Vr:te(f,p,g,m,w,0),yr(m,w,1,g,1,0);break;case Dr:er(f,p,g,m,w);break;case Kr:er(f,p,g,m,w),vr(m,w,g,1,0);break;case Mr:tr(f,p,g,m,w);break;default:t(0)}o+=l,u+=h}e.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");t(e.Ma<=r.height)}}e.C=A,t(e.C<=e.i)}function Ce(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var A=e.Ya[t].G,r=e.Ya[t].H;if(0<A[1][r[1]+0].g||0<A[2][r[2]+0].g||0<A[3][r[3]+0].g)return 0}return 1}function xe(e,A,r,n,i,s){if(0!=e.Z){var a=e.qd,o=e.rd;for(t(null!=pn[e.Z]);A<r;++A)pn[e.Z](a,o,n,i,n,i,s),a=n,o=i,i+=s;e.qd=a,e.rd=o}}function Fe(e,A){var r=e.l.ma,n=0==r.Z||1==r.Z?e.l.j:e.C;if(n=e.C<n?n:e.C,t(A<=e.l.o),A>n){var i=e.l.width,s=r.ca,a=r.tb+i*n,o=e.V,l=e.Ba+e.c*n,c=e.gc;t(1==e.ab),t(3==c[0].hc),WA(c[0],n,A,o,l,s,a),xe(r,n,A,s,a,i)}e.C=e.Ma=A}function Qe(e,A,r,n,i,s,a){var o=e.$/n,l=e.$%n,c=e.m,u=e.s,h=r+e.$,d=h;i=r+n*i;var f=r+n*s,p=280+u.ua,g=e.Pb?o:16777216,m=0<u.ua?u.Wa:null,w=u.wc,B=h<f?be(u,l,o):null;t(e.C<s),t(f<=i);var b=!1;e:for(;;){for(;b||h<f;){var y=0;if(o>=g){var Q=h-r;t((g=e).Pb),g.wd=g.m,g.xd=Q,0<g.s.ua&&k(g.s.Wa,g.s.vb),g=o+$r}if(l&w||(B=be(u,l,o)),t(null!=B),B.Qb&&(A[h]=B.qb,b=!0),!b)if(F(c),B.jc){y=c,Q=A;var U=h,S=B.pd[v(y)&OA-1];t(B.jc),256>S.g?(x(y,y.u+S.g),Q[U]=S.value,y=0):(x(y,y.u+S.g-256),t(256<=S.value),y=S.value),0==y&&(b=!0)}else y=we(B.G[0],B.H[0],c);if(c.h)break;if(b||256>y){if(!b)if(B.nd)A[h]=(B.qb|y<<8)>>>0;else{if(F(c),b=we(B.G[1],B.H[1],c),F(c),Q=we(B.G[2],B.H[2],c),U=we(B.G[3],B.H[3],c),c.h)break;A[h]=(U<<24|b<<16|y<<8|Q)>>>0}if(b=!1,++h,++l>=n&&(l=0,++o,null!=a&&o<=s&&!(o%16)&&a(e,o),null!=m))for(;d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y}else if(280>y){if(y=ge(y-256,c),Q=we(B.G[4],B.H[4],c),F(c),Q=me(n,Q=ge(Q,c)),c.h)break;if(h-r<Q||i-h<y)break e;for(U=0;U<y;++U)A[h+U]=A[h+U-Q];for(h+=y,l+=y;l>=n;)l-=n,++o,null!=a&&o<=s&&!(o%16)&&a(e,o);if(t(h<=i),l&w&&(B=be(u,l,o)),null!=m)for(;d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y}else{if(!(y<p))break e;for(b=y-280,t(null!=m);d<h;)y=A[d++],m.X[(506832829*y&4294967295)>>>m.Mb]=y;y=h,t(!(b>>>(Q=m).Xa)),A[y]=Q.X[b],b=!0}b||t(c.h==C(c))}if(e.Pb&&c.h&&h<i)t(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&k(e.s.vb,e.s.Wa);else{if(c.h)break e;null!=a&&a(e,o>s?s:o),e.a=0,e.$=h-r}return 1}return e.a=3,0}function Ue(e){t(null!=e),e.vc=null,e.yc=null,e.Ya=null;var A=e.Wa;null!=A&&(A.X=null),e.vb=null,t(null!=e)}function Se(){var t=new iA;return null==t?null:(t.a=0,t.xb=fn,Ae("Predictor","VP8LPredictors"),Ae("Predictor","VP8LPredictors_C"),Ae("PredictorAdd","VP8LPredictorsAdd"),Ae("PredictorAdd","VP8LPredictorsAdd_C"),zA=G,JA=W,$A=Y,ZA=J,er=$,tr=Z,Ar=ee,e.VP8LMapColor32b=qA,e.VP8LMapColor8b=XA,t)}function Ee(e,A,r,a,o){var l=1,h=[e],f=[A],p=a.m,g=a.s,m=null,w=0;e:for(;;){if(r)for(;l&&B(p,1);){var b=h,y=f,C=a,Q=1,U=C.m,S=C.gc[C.ab],E=B(U,2);if(C.Oc&1<<E)l=0;else{switch(C.Oc|=1<<E,S.hc=E,S.Ea=b[0],S.nc=y[0],S.K=[null],++C.ab,t(4>=C.ab),E){case 0:case 1:S.b=B(U,3)+2,Q=Ee(O(S.Ea,S.b),O(S.nc,S.b),0,C,S.K),S.K=S.K[0];break;case 3:var N,L=B(U,8)+1,_=16<L?0:4<L?1:2<L?2:3;if(b[0]=O(S.Ea,_),S.b=_,N=Q=Ee(L,1,0,C,S.K)){var k,T=L,H=S,D=1<<(8>>H.b),M=i(D);if(null==M)N=0;else{var j=H.K[0],R=H.w;for(M[0]=H.K[0][0],k=1;k<1*T;++k)M[k]=P(j[R+k],M[k-1]);for(;k<4*D;++k)M[k]=0;H.K[0]=null,H.K[0]=M,N=1}}Q=N;break;case 2:break;default:t(0)}l=Q}}if(h=h[0],f=f[0],l&&B(p,1)&&!(l=1<=(w=B(p,4))&&11>=w)){a.a=3;break e}var V;if(V=l)t:{var K,z,G,q=a,W=h,X=f,Y=w,J=r,$=q.m,Z=q.s,ee=[null],te=1,Ae=0,re=Jr[Y];A:for(;;){if(J&&B($,1)){var ne=B($,3)+2,ie=O(W,ne),se=O(X,ne),ae=ie*se;if(!Ee(ie,se,0,q,ee))break A;for(ee=ee[0],Z.xc=ne,K=0;K<ae;++K){var oe=ee[K]>>8&65535;ee[K]=oe,oe>=te&&(te=oe+1)}}if($.h)break A;for(z=0;5>z;++z){var le=qr[z];!z&&0<Y&&(le+=1<<Y),Ae<le&&(Ae=le)}var ce=s(te*re,u),ue=te,he=s(ue,d);if(null==he)var de=null;else t(65536>=ue),de=he;var fe=i(Ae);if(null==de||null==fe||null==ce){q.a=1;break A}var pe=ce;for(K=G=0;K<te;++K){var ge=de[K],me=ge.G,we=ge.H,be=0,ye=1,ve=0;for(z=0;5>z;++z){le=qr[z],me[z]=pe,we[z]=G,!z&&0<Y&&(le+=1<<Y);r:{var Ce,xe=le,Fe=q,Se=fe,Ne=pe,Le=G,_e=0,Ie=Fe.m,ke=B(Ie,1);if(n(Se,0,0,xe),ke){var Te=B(Ie,1)+1,He=B(Ie,1),Oe=B(Ie,0==He?1:8);Se[Oe]=1,2==Te&&(Se[Oe=B(Ie,8)]=1);var Pe=1}else{var De=i(19),Me=B(Ie,4)+4;if(19<Me){Fe.a=3;var je=0;break r}for(Ce=0;Ce<Me;++Ce)De[Xr[Ce]]=B(Ie,3);var Re=void 0,Ve=void 0,Ke=Fe,ze=De,Ge=xe,qe=Se,We=0,Xe=Ke.m,Ye=8,Je=s(128,u);n:for(;c(Je,0,7,ze,19);){if(B(Xe,1)){var $e=2+2*B(Xe,3);if((Re=2+B(Xe,$e))>Ge)break n}else Re=Ge;for(Ve=0;Ve<Ge&&Re--;){F(Xe);var Ze=Je[0+(127&v(Xe))];x(Xe,Xe.u+Ze.g);var et=Ze.value;if(16>et)qe[Ve++]=et,0!=et&&(Ye=et);else{var tt=16==et,At=et-16,rt=Gr[At],nt=B(Xe,zr[At])+rt;if(Ve+nt>Ge)break n;for(var it=tt?Ye:0;0<nt--;)qe[Ve++]=it}}We=1;break n}We||(Ke.a=3),Pe=We}(Pe=Pe&&!Ie.h)&&(_e=c(Ne,Le,8,Se,xe)),Pe&&0!=_e?je=_e:(Fe.a=3,je=0)}if(0==je)break A;if(ye&&1==Wr[z]&&(ye=0==pe[G].g),be+=pe[G].g,G+=je,3>=z){var st,at=fe[0];for(st=1;st<le;++st)fe[st]>at&&(at=fe[st]);ve+=at}}if(ge.nd=ye,ge.Qb=0,ye&&(ge.qb=(me[3][we[3]+0].value<<24|me[1][we[1]+0].value<<16|me[2][we[2]+0].value)>>>0,0==be&&256>me[0][we[0]+0].value&&(ge.Qb=1,ge.qb+=me[0][we[0]+0].value<<8)),ge.jc=!ge.Qb&&6>ve,ge.jc){var ot,lt=ge;for(ot=0;ot<OA;++ot){var ct=ot,ut=lt.pd[ct],ht=lt.G[0][lt.H[0]+ct];256<=ht.value?(ut.g=ht.g+256,ut.value=ht.value):(ut.g=0,ut.value=0,ct>>=Be(ht,8,ut),ct>>=Be(lt.G[1][lt.H[1]+ct],16,ut),ct>>=Be(lt.G[2][lt.H[2]+ct],0,ut),Be(lt.G[3][lt.H[3]+ct],24,ut))}}}Z.vc=ee,Z.Wb=te,Z.Ya=de,Z.yc=ce,V=1;break t}V=0}if(!(l=V)){a.a=3;break e}if(0<w){if(g.ua=1<<w,!I(g.Wa,w)){a.a=1,l=0;break e}}else g.ua=0;var dt=a,ft=h,pt=f,gt=dt.s,mt=gt.xc;if(dt.c=ft,dt.i=pt,gt.md=O(ft,mt),gt.wc=0==mt?-1:(1<<mt)-1,r){a.xb=dn;break e}if(null==(m=i(h*f))){a.a=1,l=0;break e}l=(l=Qe(a,m,0,h,f,f,null))&&!p.h;break e}return l?(null!=o?o[0]=m:(t(null==m),t(r)),a.$=0,r||Ue(g)):Ue(g),l}function Ne(e,A){var r=e.c*e.i,n=r+A+16*A;return t(e.c<=A),e.V=i(n),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+r+A,1)}function Le(e,A){var r=e.C,n=A-r,i=e.V,s=e.Ba+e.c*r;for(t(A<=e.l.o);0<n;){var a=16<n?16:n,o=e.l.ma,l=e.l.width,c=l*a,u=o.ca,h=o.tb+l*r,d=e.Ta,f=e.Ua;ye(e,a,i,s),xr(d,f,u,h,c),xe(o,r,r+a,u,h,l),n-=a,i+=a*e.c,r+=a}t(r==A),e.C=e.Ma=A}function _e(){this.ub=this.yd=this.td=this.Rb=0}function Ie(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function ke(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function Te(){this.Yb=function(){var e=[];return function e(t,A,r){for(var n=r[A],i=0;i<n&&(t.push(r.length>A+1?[]:0),!(r.length<A+1));i++)e(t[i],A+1,r)}(e,0,[3,11]),e}()}function He(){this.jb=i(3),this.Wc=a([4,8],Te),this.Xc=a([4,17],Te)}function Oe(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function Pe(){this.ld=this.La=this.dd=this.tc=0}function De(){this.Na=this.la=0}function Me(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function je(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Re(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pe),this.Y=0,this.ya=Array(new je),this.aa=0,this.l=new Ge}function Ve(){this.y=i(16),this.f=i(8),this.ea=i(8)}function Ke(){this.cb=this.a=0,this.sc="",this.m=new b,this.Od=new _e,this.Kc=new Ie,this.ed=new Oe,this.Qa=new ke,this.Ic=this.$c=this.Aa=0,this.D=new Re,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,b),this.ia=0,this.pb=s(4,Me),this.Pa=new He,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Ve),this.Hd=0,this.rb=Array(new De),this.sb=0,this.wa=Array(new Pe),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 je),this.L=this.aa=0,this.gd=a([4,2],Pe),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function ze(e,t){return 0>e?0:e>t?t:e}function Ge(){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 qe(){var e=new Ke;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,tn||(tn=Je)),e}function We(e,t,A){return 0==e.a&&(e.a=t,e.sc=A,e.cb=0),0}function Xe(e,t,A){return 3<=A&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function Ye(e,A){if(null==e)return 0;if(e.a=0,e.sc="OK",null==A)return We(e,2,"null VP8Io passed to VP8GetHeaders()");var r=A.data,i=A.w,s=A.ha;if(4>s)return We(e,7,"Truncated header.");var a=r[i+0]|r[i+1]<<8|r[i+2]<<16,o=e.Od;if(o.Rb=!(1&a),o.td=a>>1&7,o.yd=a>>4&1,o.ub=a>>5,3<o.td)return We(e,3,"Incorrect keyframe parameters.");if(!o.yd)return We(e,4,"Frame not displayable.");i+=3,s-=3;var l=e.Kc;if(o.Rb){if(7>s)return We(e,7,"cannot parse picture header");if(!Xe(r,i,s))return We(e,3,"Bad code word");l.c=16383&(r[i+4]<<8|r[i+3]),l.Td=r[i+4]>>6,l.i=16383&(r[i+6]<<8|r[i+5]),l.Ud=r[i+6]>>6,i+=7,s-=7,e.za=l.c+15>>4,e.Ub=l.i+15>>4,A.width=l.c,A.height=l.i,A.Da=0,A.j=0,A.v=0,A.va=A.width,A.o=A.height,A.da=0,A.ib=A.width,A.hb=A.height,A.U=A.width,A.T=A.height,n((a=e.Pa).jb,0,255,a.jb.length),t(null!=(a=e.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,n(a.Zb,0,0,a.Zb.length),n(a.Lb,0,0,a.Lb)}if(o.ub>s)return We(e,7,"bad partition length");f(a=e.m,r,i,o.ub),i+=o.ub,s-=o.ub,o.Rb&&(l.Ld=U(a),l.Kd=U(a)),l=e.Qa;var c,u=e.Pa;if(t(null!=a),t(null!=l),l.Cb=U(a),l.Cb){if(l.Bb=U(a),U(a)){for(l.Fb=U(a),c=0;4>c;++c)l.Zb[c]=U(a)?g(a,7):0;for(c=0;4>c;++c)l.Lb[c]=U(a)?g(a,6):0}if(l.Bb)for(c=0;3>c;++c)u.jb[c]=U(a)?p(a,8):255}else l.Bb=0;if(a.Ka)return We(e,3,"cannot parse segment header");if((l=e.ed).zd=U(a),l.Tb=p(a,6),l.wb=p(a,3),l.Pc=U(a),l.Pc&&U(a)){for(u=0;4>u;++u)U(a)&&(l.vd[u]=g(a,6));for(u=0;4>u;++u)U(a)&&(l.od[u]=g(a,6))}if(e.L=0==l.Tb?0:l.zd?1:2,a.Ka)return We(e,3,"cannot parse filter header");var h=s;if(s=c=i,i=c+h,l=h,e.Xb=(1<<p(e.m,2))-1,h<3*(u=e.Xb))r=7;else{for(c+=3*u,l-=3*u,h=0;h<u;++h){var d=r[s+0]|r[s+1]<<8|r[s+2]<<16;d>l&&(d=l),f(e.Jc[+h],r,c,d),c+=d,l-=d,s+=3}f(e.Jc[+u],r,c,l),r=c<i?0:5}if(0!=r)return We(e,r,"cannot parse partitions");for(r=p(c=e.m,7),s=U(c)?g(c,4):0,i=U(c)?g(c,4):0,l=U(c)?g(c,4):0,u=U(c)?g(c,4):0,c=U(c)?g(c,4):0,h=e.Qa,d=0;4>d;++d){if(h.Cb){var m=h.Zb[d];h.Fb||(m+=r)}else{if(0<d){e.pb[d]=e.pb[0];continue}m=r}var w=e.pb[d];w.Sc[0]=Zr[ze(m+s,127)],w.Sc[1]=en[ze(m+0,127)],w.Eb[0]=2*Zr[ze(m+i,127)],w.Eb[1]=101581*en[ze(m+l,127)]>>16,8>w.Eb[1]&&(w.Eb[1]=8),w.Qc[0]=Zr[ze(m+u,117)],w.Qc[1]=en[ze(m+c,127)],w.lc=m+c}if(!o.Rb)return We(e,4,"Not a key frame.");for(U(a),o=e.Pa,r=0;4>r;++r){for(s=0;8>s;++s)for(i=0;3>i;++i)for(l=0;11>l;++l)u=S(a,on[r][s][i][l])?p(a,8):sn[r][s][i][l],o.Wc[r][s].Yb[i][l]=u;for(s=0;17>s;++s)o.Xc[r][s]=o.Wc[r][ln[s]]}return e.kc=U(a),e.kc&&(e.Bd=p(a,8)),e.cb=1}function Je(e,t,A,r,n,i,s){var a=t[n].Yb[A];for(A=0;16>n;++n){if(!S(e,a[A+0]))return n;for(;!S(e,a[A+1]);)if(a=t[++n].Yb[0],A=0,16==n)return 16;var o=t[n+1].Yb;if(S(e,a[A+2])){var l=e,c=0;if(S(l,(h=a)[(u=A)+3]))if(S(l,h[u+6])){for(a=0,u=2*(c=S(l,h[u+8]))+(h=S(l,h[u+9+c])),c=0,h=An[u];h[a];++a)c+=c+S(l,h[a]);c+=3+(8<<u)}else S(l,h[u+7])?(c=7+2*S(l,165),c+=S(l,145)):c=5+S(l,159);else c=S(l,h[u+4])?3+S(l,h[u+5]):2;a=o[2]}else c=1,a=o[1];o=s+rn[n],0>(l=e).b&&Q(l);var u,h=l.b,d=(u=l.Ca>>1)-(l.I>>h)>>31;--l.b,l.Ca+=d,l.Ca|=1,l.I-=(u+1&d)<<h,i[o]=((c^d)-d)*r[(0<n)+0]}return 16}function $e(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,n(e.zc,0,0,e.zc.length),e.ja=0}function Ze(e,t,A,r,n){n=e[t+A+32*r]+(n>>3),e[t+A+32*r]=-256&n?0>n?0:255:n}function et(e,t,A,r,n,i){Ze(e,t,0,A,r+n),Ze(e,t,1,A,r+i),Ze(e,t,2,A,r-i),Ze(e,t,3,A,r-n)}function tt(e){return(20091*e>>16)+e}function At(e,t,A,r){var n,s=0,a=i(16);for(n=0;4>n;++n){var o=e[t+0]+e[t+8],l=e[t+0]-e[t+8],c=(35468*e[t+4]>>16)-tt(e[t+12]),u=tt(e[t+4])+(35468*e[t+12]>>16);a[s+0]=o+u,a[s+1]=l+c,a[s+2]=l-c,a[s+3]=o-u,s+=4,t++}for(n=s=0;4>n;++n)o=(e=a[s+0]+4)+a[s+8],l=e-a[s+8],c=(35468*a[s+4]>>16)-tt(a[s+12]),Ze(A,r,0,0,o+(u=tt(a[s+4])+(35468*a[s+12]>>16))),Ze(A,r,1,0,l+c),Ze(A,r,2,0,l-c),Ze(A,r,3,0,o-u),s++,r+=32}function rt(e,t,A,r){var n=e[t+0]+4,i=35468*e[t+4]>>16,s=tt(e[t+4]),a=35468*e[t+1]>>16;et(A,r,0,n+s,e=tt(e[t+1]),a),et(A,r,1,n+i,e,a),et(A,r,2,n-i,e,a),et(A,r,3,n-s,e,a)}function nt(e,t,A,r,n){At(e,t,A,r),n&&At(e,t+16,A,r+4)}function it(e,t,A,r){nr(e,t+0,A,r,1),nr(e,t+32,A,r+128,1)}function st(e,t,A,r){var n;for(e=e[t+0]+4,n=0;4>n;++n)for(t=0;4>t;++t)Ze(A,r,t,n,e)}function at(e,t,A,r){e[t+0]&&ar(e,t+0,A,r),e[t+16]&&ar(e,t+16,A,r+4),e[t+32]&&ar(e,t+32,A,r+128),e[t+48]&&ar(e,t+48,A,r+128+4)}function ot(e,t,A,r){var n,s=i(16);for(n=0;4>n;++n){var a=e[t+0+n]+e[t+12+n],o=e[t+4+n]+e[t+8+n],l=e[t+4+n]-e[t+8+n],c=e[t+0+n]-e[t+12+n];s[0+n]=a+o,s[8+n]=a-o,s[4+n]=c+l,s[12+n]=c-l}for(n=0;4>n;++n)a=(e=s[0+4*n]+3)+s[3+4*n],o=s[1+4*n]+s[2+4*n],l=s[1+4*n]-s[2+4*n],c=e-s[3+4*n],A[r+0]=a+o>>3,A[r+16]=c+l>>3,A[r+32]=a-o>>3,A[r+48]=c-l>>3,r+=64}function lt(e,t,A){var r,n=t-32,i=_r,s=255-e[n-1];for(r=0;r<A;++r){var a,o=i,l=s+e[t-1];for(a=0;a<A;++a)e[t+a]=o[l+e[n+a]];t+=32}}function ct(e,t){lt(e,t,4)}function ut(e,t){lt(e,t,8)}function ht(e,t){lt(e,t,16)}function dt(e,t){var A;for(A=0;16>A;++A)r(e,t+32*A,e,t-32,16)}function ft(e,t){var A;for(A=16;0<A;--A)n(e,t,e[t-1],16),t+=32}function pt(e,t,A){var r;for(r=0;16>r;++r)n(t,A+32*r,e,16)}function gt(e,t){var A,r=16;for(A=0;16>A;++A)r+=e[t-1+32*A]+e[t+A-32];pt(r>>5,e,t)}function mt(e,t){var A,r=8;for(A=0;16>A;++A)r+=e[t-1+32*A];pt(r>>4,e,t)}function wt(e,t){var A,r=8;for(A=0;16>A;++A)r+=e[t+A-32];pt(r>>4,e,t)}function Bt(e,t){pt(128,e,t)}function bt(e,t,A){return e+2*t+A+2>>2}function yt(e,t){var A,n=t-32;for(n=new Uint8Array([bt(e[n-1],e[n+0],e[n+1]),bt(e[n+0],e[n+1],e[n+2]),bt(e[n+1],e[n+2],e[n+3]),bt(e[n+2],e[n+3],e[n+4])]),A=0;4>A;++A)r(e,t+32*A,n,0,n.length)}function vt(e,t){var A=e[t-1],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96];E(e,t+0,16843009*bt(e[t-1-32],A,r)),E(e,t+32,16843009*bt(A,r,n)),E(e,t+64,16843009*bt(r,n,i)),E(e,t+96,16843009*bt(n,i,i))}function Ct(e,t){var A,r=4;for(A=0;4>A;++A)r+=e[t+A-32]+e[t-1+32*A];for(r>>=3,A=0;4>A;++A)n(e,t+32*A,r,4)}function xt(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1-32],s=e[t+0-32],a=e[t+1-32],o=e[t+2-32],l=e[t+3-32];e[t+0+96]=bt(r,n,e[t-1+96]),e[t+1+96]=e[t+0+64]=bt(A,r,n),e[t+2+96]=e[t+1+64]=e[t+0+32]=bt(i,A,r),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=bt(s,i,A),e[t+3+64]=e[t+2+32]=e[t+1+0]=bt(a,s,i),e[t+3+32]=e[t+2+0]=bt(o,a,s),e[t+3+0]=bt(l,o,a)}function Ft(e,t){var A=e[t+1-32],r=e[t+2-32],n=e[t+3-32],i=e[t+4-32],s=e[t+5-32],a=e[t+6-32],o=e[t+7-32];e[t+0+0]=bt(e[t+0-32],A,r),e[t+1+0]=e[t+0+32]=bt(A,r,n),e[t+2+0]=e[t+1+32]=e[t+0+64]=bt(r,n,i),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=bt(n,i,s),e[t+3+32]=e[t+2+64]=e[t+1+96]=bt(i,s,a),e[t+3+64]=e[t+2+96]=bt(s,a,o),e[t+3+96]=bt(a,o,o)}function Qt(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1-32],s=e[t+0-32],a=e[t+1-32],o=e[t+2-32],l=e[t+3-32];e[t+0+0]=e[t+1+64]=i+s+1>>1,e[t+1+0]=e[t+2+64]=s+a+1>>1,e[t+2+0]=e[t+3+64]=a+o+1>>1,e[t+3+0]=o+l+1>>1,e[t+0+96]=bt(n,r,A),e[t+0+64]=bt(r,A,i),e[t+0+32]=e[t+1+96]=bt(A,i,s),e[t+1+32]=e[t+2+96]=bt(i,s,a),e[t+2+32]=e[t+3+96]=bt(s,a,o),e[t+3+32]=bt(a,o,l)}function Ut(e,t){var A=e[t+0-32],r=e[t+1-32],n=e[t+2-32],i=e[t+3-32],s=e[t+4-32],a=e[t+5-32],o=e[t+6-32],l=e[t+7-32];e[t+0+0]=A+r+1>>1,e[t+1+0]=e[t+0+64]=r+n+1>>1,e[t+2+0]=e[t+1+64]=n+i+1>>1,e[t+3+0]=e[t+2+64]=i+s+1>>1,e[t+0+32]=bt(A,r,n),e[t+1+32]=e[t+0+96]=bt(r,n,i),e[t+2+32]=e[t+1+96]=bt(n,i,s),e[t+3+32]=e[t+2+96]=bt(i,s,a),e[t+3+64]=bt(s,a,o),e[t+3+96]=bt(a,o,l)}function St(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96];e[t+0+0]=A+r+1>>1,e[t+2+0]=e[t+0+32]=r+n+1>>1,e[t+2+32]=e[t+0+64]=n+i+1>>1,e[t+1+0]=bt(A,r,n),e[t+3+0]=e[t+1+32]=bt(r,n,i),e[t+3+32]=e[t+1+64]=bt(n,i,i),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=i}function Et(e,t){var A=e[t-1+0],r=e[t-1+32],n=e[t-1+64],i=e[t-1+96],s=e[t-1-32],a=e[t+0-32],o=e[t+1-32],l=e[t+2-32];e[t+0+0]=e[t+2+32]=A+s+1>>1,e[t+0+32]=e[t+2+64]=r+A+1>>1,e[t+0+64]=e[t+2+96]=n+r+1>>1,e[t+0+96]=i+n+1>>1,e[t+3+0]=bt(a,o,l),e[t+2+0]=bt(s,a,o),e[t+1+0]=e[t+3+32]=bt(A,s,a),e[t+1+32]=e[t+3+64]=bt(r,A,s),e[t+1+64]=e[t+3+96]=bt(n,r,A),e[t+1+96]=bt(i,n,r)}function Nt(e,t){var A;for(A=0;8>A;++A)r(e,t+32*A,e,t-32,8)}function Lt(e,t){var A;for(A=0;8>A;++A)n(e,t,e[t-1],8),t+=32}function _t(e,t,A){var r;for(r=0;8>r;++r)n(t,A+32*r,e,8)}function It(e,t){var A,r=8;for(A=0;8>A;++A)r+=e[t+A-32]+e[t-1+32*A];_t(r>>4,e,t)}function kt(e,t){var A,r=4;for(A=0;8>A;++A)r+=e[t+A-32];_t(r>>3,e,t)}function Tt(e,t){var A,r=4;for(A=0;8>A;++A)r+=e[t-1+32*A];_t(r>>3,e,t)}function Ht(e,t){_t(128,e,t)}function Ot(e,t,A){var r=e[t-A],n=e[t+0],i=3*(n-r)+Nr[1020+e[t-2*A]-e[t+A]],s=Lr[112+(i+4>>3)];e[t-A]=_r[255+r+Lr[112+(i+3>>3)]],e[t+0]=_r[255+n-s]}function Pt(e,t,A,r){var n=e[t+0],i=e[t+A];return Ir[255+e[t-2*A]-e[t-A]]>r||Ir[255+i-n]>r}function Dt(e,t,A,r){return 4*Ir[255+e[t-A]-e[t+0]]+Ir[255+e[t-2*A]-e[t+A]]<=r}function Mt(e,t,A,r,n){var i=e[t-3*A],s=e[t-2*A],a=e[t-A],o=e[t+0],l=e[t+A],c=e[t+2*A],u=e[t+3*A];return 4*Ir[255+a-o]+Ir[255+s-l]>r?0:Ir[255+e[t-4*A]-i]<=n&&Ir[255+i-s]<=n&&Ir[255+s-a]<=n&&Ir[255+u-c]<=n&&Ir[255+c-l]<=n&&Ir[255+l-o]<=n}function jt(e,t,A,r){var n=2*r+1;for(r=0;16>r;++r)Dt(e,t+r,A,n)&&Ot(e,t+r,A)}function Rt(e,t,A,r){var n=2*r+1;for(r=0;16>r;++r)Dt(e,t+r*A,1,n)&&Ot(e,t+r*A,1)}function Vt(e,t,A,r){var n;for(n=3;0<n;--n)jt(e,t+=4*A,A,r)}function Kt(e,t,A,r){var n;for(n=3;0<n;--n)Rt(e,t+=4,A,r)}function zt(e,t,A,r,n,i,s,a){for(i=2*i+1;0<n--;){if(Mt(e,t,A,i,s))if(Pt(e,t,A,a))Ot(e,t,A);else{var o=e,l=t,c=A,u=o[l-2*c],h=o[l-c],d=o[l+0],f=o[l+c],p=o[l+2*c],g=27*(w=Nr[1020+3*(d-h)+Nr[1020+u-f]])+63>>7,m=18*w+63>>7,w=9*w+63>>7;o[l-3*c]=_r[255+o[l-3*c]+w],o[l-2*c]=_r[255+u+m],o[l-c]=_r[255+h+g],o[l+0]=_r[255+d-g],o[l+c]=_r[255+f-m],o[l+2*c]=_r[255+p-w]}t+=r}}function Gt(e,t,A,r,n,i,s,a){for(i=2*i+1;0<n--;){if(Mt(e,t,A,i,s))if(Pt(e,t,A,a))Ot(e,t,A);else{var o=e,l=t,c=A,u=o[l-c],h=o[l+0],d=o[l+c],f=Lr[112+(4+(p=3*(h-u))>>3)],p=Lr[112+(p+3>>3)],g=f+1>>1;o[l-2*c]=_r[255+o[l-2*c]+g],o[l-c]=_r[255+u+p],o[l+0]=_r[255+h-f],o[l+c]=_r[255+d-g]}t+=r}}function qt(e,t,A,r,n,i){zt(e,t,A,1,16,r,n,i)}function Wt(e,t,A,r,n,i){zt(e,t,1,A,16,r,n,i)}function Xt(e,t,A,r,n,i){var s;for(s=3;0<s;--s)Gt(e,t+=4*A,A,1,16,r,n,i)}function Yt(e,t,A,r,n,i){var s;for(s=3;0<s;--s)Gt(e,t+=4,1,A,16,r,n,i)}function Jt(e,t,A,r,n,i,s,a){zt(e,t,n,1,8,i,s,a),zt(A,r,n,1,8,i,s,a)}function $t(e,t,A,r,n,i,s,a){zt(e,t,1,n,8,i,s,a),zt(A,r,1,n,8,i,s,a)}function Zt(e,t,A,r,n,i,s,a){Gt(e,t+4*n,n,1,8,i,s,a),Gt(A,r+4*n,n,1,8,i,s,a)}function eA(e,t,A,r,n,i,s,a){Gt(e,t+4,1,n,8,i,s,a),Gt(A,r+4,1,n,8,i,s,a)}function tA(){this.ba=new se,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new oe,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function AA(){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 rA(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function nA(){this.ua=0,this.Wa=new T,this.vb=new T,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new u}function iA(){this.xb=this.a=0,this.l=new Ge,this.ca=new se,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new y,this.Pb=0,this.wd=new y,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new nA,this.ab=0,this.gc=s(4,rA),this.Oc=0}function sA(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ge,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function aA(e,t,A,r,n,i,s){for(e=null==e?0:e[t+0],t=0;t<s;++t)n[i+t]=e+A[r+t]&255,e=n[i+t]}function oA(e,t,A,r,n,i,s){var a;if(null==e)aA(null,null,A,r,n,i,s);else for(a=0;a<s;++a)n[i+a]=e[t+a]+A[r+a]&255}function lA(e,t,A,r,n,i,s){if(null==e)aA(null,null,A,r,n,i,s);else{var a,o=e[t+0],l=o,c=o;for(a=0;a<s;++a)l=c+(o=e[t+a])-l,c=A[r+a]+(-256&l?0>l?0:255:l)&255,l=o,n[i+a]=c}}function cA(e,A,n,s){var a=A.width,o=A.o;if(t(null!=e&&null!=A),0>n||0>=s||n+s>o)return null;if(!e.Cc){if(null==e.ga){var l;if(e.ga=new sA,(l=null==e.ga)||(l=A.width*A.o,t(0==e.Gb.length),e.Gb=i(l),e.Uc=0,null==e.Gb?l=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,l=1),l=!l),!l){l=e.ga;var c=e.Fa,u=e.P,h=e.qc,d=e.mb,f=e.nb,p=u+1,g=h-1,w=l.l;if(t(null!=c&&null!=d&&null!=A),pn[0]=null,pn[1]=aA,pn[2]=oA,pn[3]=lA,l.ca=d,l.tb=f,l.c=A.width,l.i=A.height,t(0<l.c&&0<l.i),1>=h)A=0;else if(l.$a=3&c[u+0],l.Z=c[u+0]>>2&3,l.Lc=c[u+0]>>4&3,u=c[u+0]>>6&3,0>l.$a||1<l.$a||4<=l.Z||1<l.Lc||u)A=0;else if(w.put=de,w.ac=he,w.bc=fe,w.ma=l,w.width=A.width,w.height=A.height,w.Da=A.Da,w.v=A.v,w.va=A.va,w.j=A.j,w.o=A.o,l.$a)e:{t(1==l.$a),A=Se();t:for(;;){if(null==A){A=0;break e}if(t(null!=l),l.mc=A,A.c=l.c,A.i=l.i,A.l=l.l,A.l.ma=l,A.l.width=l.c,A.l.height=l.i,A.a=0,m(A.m,c,p,g),!Ee(l.c,l.i,1,A,null))break t;if(1==A.ab&&3==A.gc[0].hc&&Ce(A.s)?(l.ic=1,c=A.c*A.i,A.Ta=null,A.Ua=0,A.V=i(c),A.Ba=0,null==A.V?(A.a=1,A=0):A=1):(l.ic=0,A=Ne(A,l.c)),!A)break t;A=1;break e}l.mc=null,A=0}else A=g>=l.c*l.i;l=!A}if(l)return null;1!=e.ga.Lc?e.Ga=0:s=o-n}t(null!=e.ga),t(n+s<=o);e:{if(A=(c=e.ga).c,o=c.l.o,0==c.$a){if(p=e.rc,g=e.Vc,w=e.Fa,u=e.P+1+n*A,h=e.mb,d=e.nb+n*A,t(u<=e.P+e.qc),0!=c.Z)for(t(null!=pn[c.Z]),l=0;l<s;++l)pn[c.Z](p,g,w,u,h,d,A),p=h,g=d,d+=A,u+=A;else for(l=0;l<s;++l)r(h,d,w,u,A),p=h,g=d,d+=A,u+=A;e.rc=p,e.Vc=g}else{if(t(null!=c.mc),A=n+s,t(null!=(l=c.mc)),t(A<=l.i),l.C>=A)A=1;else if(c.ic||pA(),c.ic){c=l.V,p=l.Ba,g=l.c;var B=l.i,b=(w=1,u=l.$/g,h=l.$%g,d=l.m,f=l.s,l.$),y=g*B,v=g*A,x=f.wc,Q=b<v?be(f,h,u):null;t(b<=y),t(A<=B),t(Ce(f));t:for(;;){for(;!d.h&&b<v;){if(h&x||(Q=be(f,h,u)),t(null!=Q),F(d),256>(B=we(Q.G[0],Q.H[0],d)))c[p+b]=B,++b,++h>=g&&(h=0,++u<=A&&!(u%16)&&Fe(l,u));else{if(!(280>B)){w=0;break t}B=ge(B-256,d);var U,S=we(Q.G[4],Q.H[4],d);if(F(d),!(b>=(S=me(g,S=ge(S,d)))&&y-b>=B)){w=0;break t}for(U=0;U<B;++U)c[p+b+U]=c[p+b+U-S];for(b+=B,h+=B;h>=g;)h-=g,++u<=A&&!(u%16)&&Fe(l,u);b<v&&h&x&&(Q=be(f,h,u))}t(d.h==C(d))}Fe(l,u>A?A:u);break t}!w||d.h&&b<y?(w=0,l.a=d.h?5:3):l.$=b,A=w}else A=Qe(l,l.V,l.Ba,l.c,l.i,A,Le);if(!A){s=0;break e}}n+s>=o&&(e.Cc=1),s=1}if(!s)return null;if(e.Cc&&(null!=(s=e.ga)&&(s.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+n*a}function uA(e,t,A,r,n,i){for(;0<n--;){var s,a=e,o=t+(A?1:0),l=e,c=t+(A?0:3);for(s=0;s<r;++s){var u=l[c+4*s];255!=u&&(u*=32897,a[o+4*s+0]=a[o+4*s+0]*u>>23,a[o+4*s+1]=a[o+4*s+1]*u>>23,a[o+4*s+2]=a[o+4*s+2]*u>>23)}t+=i}}function hA(e,t,A,r,n){for(;0<r--;){var i;for(i=0;i<A;++i){var s=e[t+2*i+0],a=15&(l=e[t+2*i+1]),o=4369*a,l=(240&l|l>>4)*o>>16;e[t+2*i+0]=(240&s|s>>4)*o>>16&240|(15&s|s<<4)*o>>16>>4&15,e[t+2*i+1]=240&l|a}t+=n}}function dA(e,t,A,r,n,i,s,a){var o,l,c=255;for(l=0;l<n;++l){for(o=0;o<r;++o){var u=e[t+o];i[s+4*o]=u,c&=u}t+=A,s+=a}return 255!=c}function fA(e,t,A,r,n){var i;for(i=0;i<n;++i)A[r+i]=e[t+i]>>8}function pA(){yr=uA,vr=hA,Cr=dA,xr=fA}function gA(A,r,n){e[A]=function(e,A,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B){var b,y=B-1>>1,v=a[o+0]|l[c+0]<<16,C=u[h+0]|d[f+0]<<16;t(null!=e);var x=3*v+C+131074>>2;for(r(e[A+0],255&x,x>>16,p,g),null!=i&&(x=3*C+v+131074>>2,r(i[s+0],255&x,x>>16,m,w)),b=1;b<=y;++b){var F=a[o+b]|l[c+b]<<16,Q=u[h+b]|d[f+b]<<16,U=v+F+C+Q+524296,S=U+2*(F+C)>>3;x=S+v>>1,v=(U=U+2*(v+Q)>>3)+F>>1,r(e[A+2*b-1],255&x,x>>16,p,g+(2*b-1)*n),r(e[A+2*b-0],255&v,v>>16,p,g+(2*b-0)*n),null!=i&&(x=U+C>>1,v=S+Q>>1,r(i[s+2*b-1],255&x,x>>16,m,w+(2*b-1)*n),r(i[s+2*b+0],255&v,v>>16,m,w+(2*b+0)*n)),v=F,C=Q}1&B||(x=3*v+C+131074>>2,r(e[A+B-1],255&x,x>>16,p,g+(B-1)*n),null!=i&&(x=3*C+v+131074>>2,r(i[s+B-1],255&x,x>>16,m,w+(B-1)*n)))}}function mA(){gn[kr]=mn,gn[Tr]=Bn,gn[Hr]=wn,gn[Or]=bn,gn[Pr]=yn,gn[Dr]=vn,gn[Mr]=Cn,gn[jr]=Bn,gn[Rr]=bn,gn[Vr]=yn,gn[Kr]=vn}function wA(e){return e&~En?0>e?0:255:e>>Sn}function BA(e,t){return wA((19077*e>>8)+(26149*t>>8)-14234)}function bA(e,t,A){return wA((19077*e>>8)-(6419*t>>8)-(13320*A>>8)+8708)}function yA(e,t){return wA((19077*e>>8)+(33050*t>>8)-17685)}function vA(e,t,A,r,n){r[n+0]=BA(e,A),r[n+1]=bA(e,t,A),r[n+2]=yA(e,t)}function CA(e,t,A,r,n){r[n+0]=yA(e,t),r[n+1]=bA(e,t,A),r[n+2]=BA(e,A)}function xA(e,t,A,r,n){var i=bA(e,t,A);t=i<<3&224|yA(e,t)>>3,r[n+0]=248&BA(e,A)|i>>5,r[n+1]=t}function FA(e,t,A,r,n){var i=240&yA(e,t)|15;r[n+0]=240&BA(e,A)|bA(e,t,A)>>4,r[n+1]=i}function QA(e,t,A,r,n){r[n+0]=255,vA(e,t,A,r,n+1)}function UA(e,t,A,r,n){CA(e,t,A,r,n),r[n+3]=255}function SA(e,t,A,r,n){vA(e,t,A,r,n),r[n+3]=255}function EA(t,A,r){e[t]=function(e,t,n,i,s,a,o,l,c){for(var u=l+(-2&c)*r;l!=u;)A(e[t+0],n[i+0],s[a+0],o,l),A(e[t+1],n[i+0],s[a+0],o,l+r),t+=2,++i,++a,l+=2*r;1&c&&A(e[t+0],n[i+0],s[a+0],o,l)}}function NA(e,t,A){return 0==A?0==e?0==t?6:5:0==t?4:0:A}function LA(e,t,A,r,n){switch(e>>>30){case 3:nr(t,A,r,n,0);break;case 2:ir(t,A,r,n);break;case 1:ar(t,A,r,n)}}function _A(e,t){var A,i,s=t.M,a=t.Nb,o=e.oc,l=e.pc+40,c=e.oc,u=e.pc+584,h=e.oc,d=e.pc+600;for(A=0;16>A;++A)o[l+32*A-1]=129;for(A=0;8>A;++A)c[u+32*A-1]=129,h[d+32*A-1]=129;for(0<s?o[l-1-32]=c[u-1-32]=h[d-1-32]=129:(n(o,l-32-1,127,21),n(c,u-32-1,127,9),n(h,d-32-1,127,9)),i=0;i<e.za;++i){var f=t.ya[t.aa+i];if(0<i){for(A=-1;16>A;++A)r(o,l+32*A-4,o,l+32*A+12,4);for(A=-1;8>A;++A)r(c,u+32*A-4,c,u+32*A+4,4),r(h,d+32*A-4,h,d+32*A+4,4)}var p=e.Gd,g=e.Hd+i,m=f.ad,w=f.Hc;if(0<s&&(r(o,l-32,p[g].y,0,16),r(c,u-32,p[g].f,0,8),r(h,d-32,p[g].ea,0,8)),f.Za){var B=o,b=l-32+16;for(0<s&&(i>=e.za-1?n(B,b,p[g].y[15],4):r(B,b,p[g+1].y,0,4)),A=0;4>A;A++)B[b+128+A]=B[b+256+A]=B[b+384+A]=B[b+0+A];for(A=0;16>A;++A,w<<=2)B=o,b=l+On[A],un[f.Ob[A]](B,b),LA(w,m,16*+A,B,b)}else if(B=NA(i,s,f.Ob[0]),cn[B](o,l),0!=w)for(A=0;16>A;++A,w<<=2)LA(w,m,16*+A,o,l+On[A]);for(A=f.Gc,B=NA(i,s,f.Dd),hn[B](c,u),hn[B](h,d),w=m,B=c,b=u,255&(f=0|A)&&(170&f?sr(w,256,B,b):or(w,256,B,b)),f=h,w=d,255&(A>>=8)&&(170&A?sr(m,320,f,w):or(m,320,f,w)),s<e.Ub-1&&(r(p[g].y,0,o,l+480,16),r(p[g].f,0,c,u+224,8),r(p[g].ea,0,h,d+224,8)),A=8*a*e.B,p=e.sa,g=e.ta+16*i+16*a*e.R,m=e.qa,f=e.ra+8*i+A,w=e.Ha,B=e.Ia+8*i+A,A=0;16>A;++A)r(p,g+A*e.R,o,l+32*A,16);for(A=0;8>A;++A)r(m,f+A*e.B,c,u+32*A,8),r(w,B+A*e.B,h,d+32*A,8)}}function IA(e,r,n,i,s,a,o,l,c){var u=[0],h=[0],d=0,f=null!=c?c.kd:0,p=null!=c?c:new AA;if(null==e||12>n)return 7;p.data=e,p.w=r,p.ha=n,r=[r],n=[n],p.gb=[p.gb];e:{var g=r,w=n,B=p.gb;if(t(null!=e),t(null!=w),t(null!=B),B[0]=0,12<=w[0]&&!A(e,g[0],"RIFF")){if(A(e,g[0]+8,"WEBP")){B=3;break e}var b=_(e,g[0]+4);if(12>b||4294967286<b){B=3;break e}if(f&&b>w[0]-8){B=7;break e}B[0]=b,g[0]+=12,w[0]-=12}B=0}if(0!=B)return B;for(b=0<p.gb[0],n=n[0];;){e:{var v=e;w=r,B=n;var C=u,x=h,F=g=[0];if((S=d=[d])[0]=0,8>B[0])B=7;else{if(!A(v,w[0],"VP8X")){if(10!=_(v,w[0]+4)){B=3;break e}if(18>B[0]){B=7;break e}var Q=_(v,w[0]+8),U=1+L(v,w[0]+12);if(2147483648<=U*(v=1+L(v,w[0]+15))){B=3;break e}null!=F&&(F[0]=Q),null!=C&&(C[0]=U),null!=x&&(x[0]=v),w[0]+=18,B[0]-=18,S[0]=1}B=0}}if(d=d[0],g=g[0],0!=B)return B;if(w=!!(2&g),!b&&d)return 3;if(null!=a&&(a[0]=!!(16&g)),null!=o&&(o[0]=w),null!=l&&(l[0]=0),o=u[0],g=h[0],d&&w&&null==c){B=0;break}if(4>n){B=7;break}if(b&&d||!b&&!d&&!A(e,r[0],"ALPH")){n=[n],p.na=[p.na],p.P=[p.P],p.Sa=[p.Sa];e:{Q=e,B=r,b=n;var S=p.gb;C=p.na,x=p.P,F=p.Sa,U=22,t(null!=Q),t(null!=b),v=B[0];var E=b[0];for(t(null!=C),t(null!=F),C[0]=null,x[0]=null,F[0]=0;;){if(B[0]=v,b[0]=E,8>E){B=7;break e}var N=_(Q,v+4);if(4294967286<N){B=3;break e}var I=8+N+1&-2;if(U+=I,0<S&&U>S){B=3;break e}if(!A(Q,v,"VP8 ")||!A(Q,v,"VP8L")){B=0;break e}if(E[0]<I){B=7;break e}A(Q,v,"ALPH")||(C[0]=Q,x[0]=v+8,F[0]=N),v+=I,E-=I}}if(n=n[0],p.na=p.na[0],p.P=p.P[0],p.Sa=p.Sa[0],0!=B)break}n=[n],p.Ja=[p.Ja],p.xa=[p.xa];e:if(S=e,B=r,b=n,C=p.gb[0],x=p.Ja,F=p.xa,Q=B[0],v=!A(S,Q,"VP8 "),U=!A(S,Q,"VP8L"),t(null!=S),t(null!=b),t(null!=x),t(null!=F),8>b[0])B=7;else{if(v||U){if(S=_(S,Q+4),12<=C&&S>C-12){B=3;break e}if(f&&S>b[0]-8){B=7;break e}x[0]=S,B[0]+=8,b[0]-=8,F[0]=U}else F[0]=5<=b[0]&&47==S[Q+0]&&!(S[Q+4]>>5),x[0]=b[0];B=0}if(n=n[0],p.Ja=p.Ja[0],p.xa=p.xa[0],r=r[0],0!=B)break;if(4294967286<p.Ja)return 3;if(null==l||w||(l[0]=p.xa?2:1),o=[o],g=[g],p.xa){if(5>n){B=7;break}l=o,f=g,w=a,null==e||5>n?e=0:5<=n&&47==e[r+0]&&!(e[r+4]>>5)?(b=[0],S=[0],C=[0],m(x=new y,e,r,n),pe(x,b,S,C)?(null!=l&&(l[0]=b[0]),null!=f&&(f[0]=S[0]),null!=w&&(w[0]=C[0]),e=1):e=0):e=0}else{if(10>n){B=7;break}l=g,null==e||10>n||!Xe(e,r+3,n-3)?e=0:(f=e[r+0]|e[r+1]<<8|e[r+2]<<16,w=16383&(e[r+7]<<8|e[r+6]),e=16383&(e[r+9]<<8|e[r+8]),1&f||3<(f>>1&7)||!(f>>4&1)||f>>5>=p.Ja||!w||!e?e=0:(o&&(o[0]=w),l&&(l[0]=e),e=1))}if(!e)return 3;if(o=o[0],g=g[0],d&&(u[0]!=o||h[0]!=g))return 3;null!=c&&(c[0]=p,c.offset=r-c.w,t(4294967286>r-c.w),t(c.offset==c.ha-n));break}return 0==B||7==B&&d&&null==c?(null!=a&&(a[0]|=null!=p.na&&0<p.na.length),null!=i&&(i[0]=o),null!=s&&(s[0]=g),0):B}function kA(e,t,A){var r=t.width,n=t.height,i=0,s=0,a=r,o=n;if(t.Da=null!=e&&0<e.Da,t.Da&&(a=e.cd,o=e.bd,i=e.v,s=e.j,11>A||(i&=-2,s&=-2),0>i||0>s||0>=a||0>=o||i+a>r||s+o>n))return 0;if(t.v=i,t.j=s,t.va=i+a,t.o=s+o,t.U=a,t.T=o,t.da=null!=e&&0<e.da,t.da){if(!H(a,o,A=[e.ib],i=[e.hb]))return 0;t.ib=A[0],t.hb=i[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*r/4&&t.hb<3*n/4,t.Kb=0),1}function TA(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function HA(e,t,A,r){if(null==r||0>=e||0>=t)return 2;if(null!=A){if(A.Da){var n=A.cd,s=A.bd,a=-2&A.v,o=-2&A.j;if(0>a||0>o||0>=n||0>=s||a+n>e||o+s>t)return 2;e=n,t=s}if(A.da){if(!H(e,t,n=[A.ib],s=[A.hb]))return 2;e=n[0],t=s[0]}}r.width=e,r.height=t;e:{var l=r.width,c=r.height;if(e=r.S,0>=l||0>=c||!(e>=kr&&13>e))e=2;else{if(0>=r.Rd&&null==r.sd){a=s=n=t=0;var u=(o=l*Mn[e])*c;if(11>e||(s=(c+1)/2*(t=(l+1)/2),12==e&&(a=(n=l)*c)),null==(c=i(u+2*s+a))){e=1;break e}r.sd=c,11>e?((l=r.f.RGBA).eb=c,l.fb=0,l.A=o,l.size=u):((l=r.f.kb).y=c,l.O=0,l.fa=o,l.Fd=u,l.f=c,l.N=0+u,l.Ab=t,l.Cd=s,l.ea=c,l.W=0+u+s,l.Db=t,l.Ed=s,12==e&&(l.F=c,l.J=0+u+2*s),l.Tc=a,l.lb=n)}if(t=1,n=r.S,s=r.width,a=r.height,n>=kr&&13>n)if(11>n)e=r.f.RGBA,t&=(o=Math.abs(e.A))*(a-1)+s<=e.size,t&=o>=s*Mn[n],t&=null!=e.eb;else{e=r.f.kb,o=(s+1)/2,u=(a+1)/2,l=Math.abs(e.fa),c=Math.abs(e.Ab);var h=Math.abs(e.Db),d=Math.abs(e.lb),f=d*(a-1)+s;t&=l*(a-1)+s<=e.Fd,t&=c*(u-1)+o<=e.Cd,t=(t&=h*(u-1)+o<=e.Ed)&l>=s&c>=o&h>=o,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==n&&(t&=d>=s,t&=f<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=A&&A.fd&&(e=TA(r)),e}var OA=64,PA=[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],DA=24,MA=32,jA=8,RA=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,A){return t[A+0]},e.Predictor3=function(e,t,A){return t[A+1]},e.Predictor4=function(e,t,A){return t[A-1]},e.Predictor5=function(e,t,A){return j(j(e,t[A+1]),t[A+0])},e.Predictor6=function(e,t,A){return j(e,t[A-1])},e.Predictor7=function(e,t,A){return j(e,t[A+0])},e.Predictor8=function(e,t,A){return j(t[A-1],t[A+0])},e.Predictor9=function(e,t,A){return j(t[A+0],t[A+1])},e.Predictor10=function(e,t,A){return j(j(e,t[A-1]),j(t[A+0],t[A+1]))},e.Predictor11=function(e,t,A){var r=t[A+0];return 0>=K(r>>24&255,e>>24&255,(t=t[A-1])>>24&255)+K(r>>16&255,e>>16&255,t>>16&255)+K(r>>8&255,e>>8&255,t>>8&255)+K(255&r,255&e,255&t)?r:e},e.Predictor12=function(e,t,A){var r=t[A+0];return(R((e>>24&255)+(r>>24&255)-((t=t[A-1])>>24&255))<<24|R((e>>16&255)+(r>>16&255)-(t>>16&255))<<16|R((e>>8&255)+(r>>8&255)-(t>>8&255))<<8|R((255&e)+(255&r)-(255&t)))>>>0},e.Predictor13=function(e,t,A){var r=t[A-1];return(V((e=j(e,t[A+0]))>>24&255,r>>24&255)<<24|V(e>>16&255,r>>16&255)<<16|V(e>>8&255,r>>8&255)<<8|V(255&e,255&r))>>>0};var VA=e.PredictorAdd0;e.PredictorAdd1=z,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var KA=e.PredictorAdd2;X("ColorIndexInverseTransform","MapARGB","32b",function(e){return e>>8&255},function(e){return e}),X("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(e){return e},function(e){return e>>8&255});var zA,GA=e.ColorIndexInverseTransform,qA=e.MapARGB,WA=e.VP8LColorIndexInverseTransformAlpha,XA=e.MapAlpha,YA=e.VP8LPredictorsAdd=[];YA.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var JA,$A,ZA,er,tr,Ar,rr,nr,ir,sr,ar,or,lr,cr,ur,hr,dr,fr,pr,gr,mr,wr,Br,br,yr,vr,Cr,xr,Fr=i(511),Qr=i(2041),Ur=i(225),Sr=i(767),Er=0,Nr=Qr,Lr=Ur,_r=Sr,Ir=Fr,kr=0,Tr=1,Hr=2,Or=3,Pr=4,Dr=5,Mr=6,jr=7,Rr=8,Vr=9,Kr=10,zr=[2,3,7],Gr=[3,3,11],qr=[280,256,256,256,40],Wr=[0,1,1,1,0],Xr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Yr=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Jr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],$r=8,Zr=[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],en=[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],tn=null,An=[[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]],rn=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],nn=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],sn=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],an=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],on=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ln=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],cn=[],un=[],hn=[],dn=1,fn=2,pn=[],gn=[];gA("UpsampleRgbLinePair",vA,3),gA("UpsampleBgrLinePair",CA,3),gA("UpsampleRgbaLinePair",SA,4),gA("UpsampleBgraLinePair",UA,4),gA("UpsampleArgbLinePair",QA,4),gA("UpsampleRgba4444LinePair",FA,2),gA("UpsampleRgb565LinePair",xA,2);var mn=e.UpsampleRgbLinePair,wn=e.UpsampleBgrLinePair,Bn=e.UpsampleRgbaLinePair,bn=e.UpsampleBgraLinePair,yn=e.UpsampleArgbLinePair,vn=e.UpsampleRgba4444LinePair,Cn=e.UpsampleRgb565LinePair,xn=16,Fn=1<<xn-1,Qn=-227,Un=482,Sn=6,En=(256<<Sn)-1,Nn=0,Ln=i(256),_n=i(256),In=i(256),kn=i(256),Tn=i(Un-Qn),Hn=i(Un-Qn);EA("YuvToRgbRow",vA,3),EA("YuvToBgrRow",CA,3),EA("YuvToRgbaRow",SA,4),EA("YuvToBgraRow",UA,4),EA("YuvToArgbRow",QA,4),EA("YuvToRgba4444Row",FA,2),EA("YuvToRgb565Row",xA,2);var On=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Pn=[0,2,8],Dn=[8,7,6,4,4,2,2,2,1,1,1,1];this.WebPDecodeRGBA=function(e,A,a,o,l){var c=Tr,u=new tA,h=new se;u.ba=h,h.S=c,h.width=[h.width],h.height=[h.height];var d=h.width,f=h.height,p=new ae;if(null==p||null==e)var g=2;else t(null!=p),g=IA(e,A,a,p.width,p.height,p.Pd,p.Qd,p.format,null);if(0!=g?d=0:(null!=d&&(d[0]=p.width[0]),null!=f&&(f[0]=p.height[0]),d=1),d){h.width=h.width[0],h.height=h.height[0],null!=o&&(o[0]=h.width),null!=l&&(l[0]=h.height);e:{if(o=new Ge,(l=new AA).data=e,l.w=A,l.ha=a,l.kd=1,A=[0],t(null!=l),(0==(e=IA(l.data,l.w,l.ha,null,null,null,A,null,l))||7==e)&&A[0]&&(e=4),0==(A=e)){if(t(null!=u),o.data=l.data,o.w=l.w+l.offset,o.ha=l.ha-l.offset,o.put=de,o.ac=he,o.bc=fe,o.ma=u,l.xa){if(null==(e=Se())){u=1;break e}if(function(e,A){var r=[0],n=[0],i=[0];t:for(;;){if(null==e)return 0;if(null==A)return e.a=2,0;if(e.l=A,e.a=0,m(e.m,A.data,A.w,A.ha),!pe(e.m,r,n,i)){e.a=3;break t}if(e.xb=fn,A.width=r[0],A.height=n[0],!Ee(r[0],n[0],1,e,null))break t;return 1}return t(0!=e.a),0}(e,o)){if(o=0==(A=HA(o.width,o.height,u.Oa,u.ba))){t:{o=e;A:for(;;){if(null==o){o=0;break t}if(t(null!=o.s.yc),t(null!=o.s.Ya),t(0<o.s.Wb),t(null!=(a=o.l)),t(null!=(l=a.ma)),0!=o.xb){if(o.ca=l.ba,o.tb=l.tb,t(null!=o.ca),!kA(l.Oa,a,Or)){o.a=2;break A}if(!Ne(o,a.width))break A;if(a.da)break A;if((a.da||re(o.ca.S))&&pA(),11>o.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=o.ca.f.kb.F&&pA()),o.Pb&&0<o.s.ua&&null==o.s.vb.X&&!I(o.s.vb,o.s.Wa.Xa)){o.a=1;break A}o.xb=0}if(!Qe(o,o.V,o.Ba,o.c,o.i,a.o,ve))break A;l.Dc=o.Ma,o=1;break t}t(0!=o.a),o=0}o=!o}o&&(A=e.a)}else A=e.a}else{if(null==(e=new qe)){u=1;break e}if(e.Fa=l.na,e.P=l.P,e.qc=l.Sa,Ye(e,o)){if(0==(A=HA(o.width,o.height,u.Oa,u.ba))){if(e.Aa=0,a=u.Oa,t(null!=(l=e)),null!=a){if(0<(d=0>(d=a.Md)?0:100<d?255:255*d/100)){for(f=p=0;4>f;++f)12>(g=l.pb[f]).lc&&(g.ia=d*Dn[0>g.lc?0:g.lc]>>3),p|=g.ia;p&&(alert("todo:VP8InitRandom"),l.ia=1)}l.Ga=a.Id,100<l.Ga?l.Ga=100:0>l.Ga&&(l.Ga=0)}(function(e,A){if(null==e)return 0;if(null==A)return We(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!Ye(e,A))return 0;if(t(e.cb),null==A.ac||A.ac(A)){A.ob&&(e.L=0);var a=Pn[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=A.v-a>>4,e.zb=A.j-a>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=A.o+15+a>>4,e.Hb=A.va+15+a>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var o=e.ed;for(a=0;4>a;++a){var l;if(e.Qa.Cb){var c=e.Qa.Lb[a];e.Qa.Fb||(c+=o.Tb)}else c=o.Tb;for(l=0;1>=l;++l){var u=e.gd[a][l],h=c;if(o.Pc&&(h+=o.vd[0],l&&(h+=o.od[0])),0<(h=0>h?0:63<h?63:h)){var d=h;0<o.wb&&(d=4<o.wb?d>>2:d>>1)>9-o.wb&&(d=9-o.wb),1>d&&(d=1),u.dd=d,u.tc=2*h+d,u.ld=40<=h?2:15<=h?1:0}else u.tc=0;u.La=l}}}a=0}else We(e,6,"Frame setup failed"),a=e.a;if(a=0==a){if(a){e.$c=0,0<e.Aa||(e.Ic=1);t:{a=e.Ic,o=4*(d=e.za);var f=32*d,p=d+1,g=0<e.L?d*(0<e.Aa?2:1):0,m=(2==e.Aa?2:1)*d;if((u=o+832+(l=3*(16*a+Pn[e.L])/2*f)+(c=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=u)a=0;else{if(u>e.Vb){if(e.Vb=0,e.Ec=i(u),e.Fc=0,null==e.Ec){a=We(e,1,"no memory during frame initialization.");break t}e.Vb=u}u=e.Ec,h=e.Fc,e.Ac=u,e.Bc=h,h+=o,e.Gd=s(f,Ve),e.Hd=0,e.rb=s(p+1,De),e.sb=1,e.wa=g?s(g,Pe):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=d),t(!0),e.oc=u,e.pc=h,h+=832,e.ya=s(m,je),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=d),e.R=16*d,e.B=8*d,d=(f=Pn[e.L])*e.R,f=f/2*e.B,e.sa=u,e.ta=h+d,e.qa=e.sa,e.ra=e.ta+16*a*e.R+f,e.Ha=e.qa,e.Ia=e.ra+8*a*e.B+f,e.$c=0,h+=l,e.mb=c?u:null,e.nb=c?h:null,t(h+c<=e.Fc+e.Vb),$e(e),n(e.Ac,e.Bc,0,o),a=1}}if(a){if(A.ka=0,A.y=e.sa,A.O=e.ta,A.f=e.qa,A.N=e.ra,A.ea=e.Ha,A.Vd=e.Ia,A.fa=e.R,A.Rc=e.B,A.F=null,A.J=0,!Er){for(a=-255;255>=a;++a)Fr[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Qr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Ur[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Sr[255+a]=0>a?0:255<a?255:a;Er=1}rr=ot,nr=nt,sr=it,ar=st,or=at,ir=rt,lr=qt,cr=Wt,ur=Jt,hr=$t,dr=Xt,fr=Yt,pr=Zt,gr=eA,mr=jt,wr=Rt,Br=Vt,br=Kt,un[0]=Ct,un[1]=ct,un[2]=yt,un[3]=vt,un[4]=xt,un[5]=Qt,un[6]=Ft,un[7]=Ut,un[8]=Et,un[9]=St,cn[0]=gt,cn[1]=ht,cn[2]=dt,cn[3]=ft,cn[4]=mt,cn[5]=wt,cn[6]=Bt,hn[0]=It,hn[1]=ut,hn[2]=Nt,hn[3]=Lt,hn[4]=Tt,hn[5]=kt,hn[6]=Ht,a=1}else a=0}a&&(a=function(e,A){for(e.M=0;e.M<e.Va;++e.M){var s,a=e.Jc[e.M&e.Xb],o=e.m,l=e;for(s=0;s<l.za;++s){var c=o,u=l,h=u.Ac,d=u.Bc+4*s,f=u.zc,p=u.ya[u.aa+s];if(u.Qa.Bb?p.$b=S(c,u.Pa.jb[0])?2+S(c,u.Pa.jb[2]):S(c,u.Pa.jb[1]):p.$b=0,u.kc&&(p.Ad=S(c,u.Bd)),p.Za=!S(c,145)+0,p.Za){var g=p.Ob,m=0;for(u=0;4>u;++u){var w,B=f[0+u];for(w=0;4>w;++w){B=an[h[d+w]][B];for(var b=nn[S(c,B[0])];0<b;)b=nn[2*b+S(c,B[b])];B=-b,h[d+w]=B}r(g,m,h,d,4),m+=4,f[0+u]=B}}else B=S(c,156)?S(c,128)?1:3:S(c,163)?2:0,p.Ob[0]=B,n(h,d,B,4),n(f,0,B,4);p.Dd=S(c,142)?S(c,114)?S(c,183)?1:3:2:0}if(l.m.Ka)return We(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(l=a,c=(o=e).rb[o.sb-1],h=o.rb[o.sb+o.ja],s=o.ya[o.aa+o.ja],d=o.kc?s.Ad:0)c.la=h.la=0,s.Za||(c.Na=h.Na=0),s.Hc=0,s.Gc=0,s.ia=0;else{var y,v;if(c=h,h=l,d=o.Pa.Xc,f=o.ya[o.aa+o.ja],p=o.pb[f.$b],u=f.ad,g=0,m=o.rb[o.sb-1],B=w=0,n(u,g,0,384),f.Za)var C=0,x=d[3];else{b=i(16);var F=c.Na+m.Na;if(F=tn(h,d[1],F,p.Eb,0,b,0),c.Na=m.Na=(0<F)+0,1<F)rr(b,0,u,g);else{var Q=b[0]+3>>3;for(b=0;256>b;b+=16)u[g+b]=Q}C=1,x=d[0]}var U=15&c.la,E=15&m.la;for(b=0;4>b;++b){var N=1&E;for(Q=v=0;4>Q;++Q)U=U>>1|(N=(F=tn(h,x,F=N+(1&U),p.Sc,C,u,g))>C)<<7,v=v<<2|(3<F?3:1<F?2:0!=u[g+0]),g+=16;U>>=4,E=E>>1|N<<7,w=(w<<8|v)>>>0}for(x=U,C=E>>4,y=0;4>y;y+=2){for(v=0,U=c.la>>4+y,E=m.la>>4+y,b=0;2>b;++b){for(N=1&E,Q=0;2>Q;++Q)F=N+(1&U),U=U>>1|(N=0<(F=tn(h,d[2],F,p.Qc,0,u,g)))<<3,v=v<<2|(3<F?3:1<F?2:0!=u[g+0]),g+=16;U>>=2,E=E>>1|N<<5}B|=v<<4*y,x|=U<<4<<y,C|=(240&E)<<y}c.la=x,m.la=C,f.Hc=w,f.Gc=B,f.ia=43690&B?0:p.ia,d=!(w|B)}if(0<o.L&&(o.wa[o.Y+o.ja]=o.gd[s.$b][s.Za],o.wa[o.Y+o.ja].La|=!d),l.Ka)return We(e,7,"Premature end-of-file encountered.")}if($e(e),o=A,l=1,s=(a=e).D,c=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(s.M=a.M,s.uc=c,_A(a,s),l=1,s=(v=a.D).Nb,c=(B=Pn[a.L])*a.R,h=B/2*a.B,b=16*s*a.R,Q=8*s*a.B,d=a.sa,f=a.ta-c+b,p=a.qa,u=a.ra-h+Q,g=a.Ha,m=a.Ia-h+Q,E=0==(U=v.M),w=U>=a.Va-1,2==a.Aa&&_A(a,v),v.uc)for(N=(F=a).D.M,t(F.D.uc),v=F.yb;v<F.Hb;++v){C=v,x=N;var L=(_=(j=F).D).Nb;y=j.R;var _=_.wa[_.Y+C],I=j.sa,k=j.ta+16*L*y+16*C,T=_.dd,H=_.tc;if(0!=H)if(t(3<=H),1==j.L)0<C&&wr(I,k,y,H+4),_.La&&br(I,k,y,H),0<x&&mr(I,k,y,H+4),_.La&&Br(I,k,y,H);else{var O=j.B,P=j.qa,D=j.ra+8*L*O+8*C,M=j.Ha,j=j.Ia+8*L*O+8*C;L=_.ld,0<C&&(cr(I,k,y,H+4,T,L),hr(P,D,M,j,O,H+4,T,L)),_.La&&(fr(I,k,y,H,T,L),gr(P,D,M,j,O,H,T,L)),0<x&&(lr(I,k,y,H+4,T,L),ur(P,D,M,j,O,H+4,T,L)),_.La&&(dr(I,k,y,H,T,L),pr(P,D,M,j,O,H,T,L))}}if(a.ia&&alert("todo:DitherRow"),null!=o.put){if(v=16*U,U=16*(U+1),E?(o.y=a.sa,o.O=a.ta+b,o.f=a.qa,o.N=a.ra+Q,o.ea=a.Ha,o.W=a.Ia+Q):(v-=B,o.y=d,o.O=f,o.f=p,o.N=u,o.ea=g,o.W=m),w||(U-=B),U>o.o&&(U=o.o),o.F=null,o.J=null,null!=a.Fa&&0<a.Fa.length&&v<U&&(o.J=cA(a,o,v,U-v),o.F=a.mb,null==o.F&&0==o.F.length)){l=We(a,3,"Could not decode alpha data.");break t}v<o.j&&(B=o.j-v,v=o.j,t(!(1&B)),o.O+=a.R*B,o.N+=a.B*(B>>1),o.W+=a.B*(B>>1),null!=o.F&&(o.J+=o.width*B)),v<U&&(o.O+=o.v,o.N+=o.v>>1,o.W+=o.v>>1,null!=o.F&&(o.J+=o.v),o.ka=v-o.j,o.U=o.va-o.v,o.T=U-v,l=o.put(o))}s+1!=a.Ic||w||(r(a.sa,a.ta-c,d,f+16*a.R,c),r(a.qa,a.ra-h,p,u+8*a.B,h),r(a.Ha,a.Ia-h,g,m+8*a.B,h))}if(!l)return We(e,6,"Output aborted.")}return 1}(e,A)),null!=A.bc&&A.bc(A),a&=1}return a?(e.cb=0,a):0})(e,o)||(A=e.a)}}else A=e.a}0==A&&null!=u.Oa&&u.Oa.fd&&(A=TA(u.ba))}u=A}c=0!=u?null:11>c?h.f.RGBA.eb:h.f.kb.y}else c=null;return c};var Mn=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(e,t){for(var A="",r=0;r<4;r++)A+=String.fromCharCode(e[t++]);return A}function c(e,t){return e[t+0]|e[t+1]<<8}function u(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function h(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new o;var d=[0],f=[0],p=[],g=new o,m=e,w=function(e,t){var A={},r=0,n=!1,i=0,s=0;if(A.frames=[],!
|
|
206
206
|
/** @license
|
|
207
207
|
* Copyright (c) 2017 Dominik Homberger
|
|
208
208
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
@@ -211,7 +211,7 @@ function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[6515
|
|
|
211
211
|
https://webpjs.appspot.com
|
|
212
212
|
WebPRiffParser dominikhlbg@gmail.com
|
|
213
213
|
*/
|
|
214
|
-
function(e,t){for(var A=0;A<4;A++)if(e[t+A]!="RIFF".charCodeAt(A))return!0;return!1}(e,t)){for(h(e,t+=4),t+=8;t<e.length;){var a=l(e,t),o=h(e,t+=4);t+=4;var d=o+(1&o);switch(a){case"VP8 ":case"VP8L":void 0===A.frames[r]&&(A.frames[r]={}),(g=A.frames[r]).src_off=n?s:t-8,g.src_size=i+o+8,r++,n&&(n=!1,i=0,s=0);break;case"VP8X":(g=A.header={}).feature_flags=e[t];var f=t+4;g.canvas_width=1+u(e,f),f+=3,g.canvas_height=1+u(e,f),f+=3;break;case"ALPH":n=!0,i=d+8,s=t-8;break;case"ANIM":(g=A.header).bgcolor=h(e,t),f=t+4,g.loop_count=c(e,f),f+=2;break;case"ANMF":var p,g;(g=A.frames[r]={}).offset_x=2*u(e,t),t+=3,g.offset_y=2*u(e,t),t+=3,g.width=1+u(e,t),t+=3,g.height=1+u(e,t),t+=3,g.duration=u(e,t),t+=3,p=e[t++],g.dispose=1&p,g.blend=p>>1&1}"ANMF"!=a&&(t+=d)}return A}}(m,0);w.response=m,w.rgbaoutput=!0,w.dataurl=!1;var B=w.header?w.header:null,b=w.frames?w.frames:null;if(B){B.loop_counter=B.loop_count,d=[B.canvas_height],f=[B.canvas_width];for(var y=0;y<b.length&&0!=b[y].blend;y++);}var v=b[0],C=g.WebPDecodeRGBA(m,v.src_off,v.src_size,f,d);v.rgba=C,v.imgwidth=f[0],v.imgheight=d[0];for(var x=0;x<f[0]*d[0]*4;x++)p[x]=C[x];return this.width=f,this.height=d,this.data=p,this}!function(e){var t,A,r,n,i,s,a,o,l,c=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||"#000000",this.fillStyle=e.fillStyle||"#000000",this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||"10px sans-serif",this.textBaseline=e.textBaseline||"alphabetic",this.textAlign=e.textAlign||"left",this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||"miter",this.lineCap=e.lineCap||"butt",this.path=e.path||[],this.transform=void 0!==e.transform?e.transform.clone():new o,this.globalCompositeOperation=e.globalCompositeOperation||"normal",this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new s,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new s,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof e.ignoreClearRect||e.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new u(this),t=this.internal.f2,A=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,n=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,o=this.internal.Matrix,l=new c}]);var u=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var A=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return A},set:function(e){A=Boolean(e)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(e){r=Boolean(e)}});var n=0;Object.defineProperty(this,"posX",{get:function(){return n},set:function(e){isNaN(e)||(n=e)}});var i=0;Object.defineProperty(this,"posY",{get:function(){return i},set:function(e){isNaN(e)||(i=e)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(e){var t;"number"==typeof e?t=[e,e,e,e]:((t=new Array(4))[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),l.margin=t}});var s=!1;Object.defineProperty(this,"autoPaging",{get:function(){return s},set:function(e){s=e}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(e){a=e}});var o=[];Object.defineProperty(this,"pageBreaks",{get:function(){return o},set:function(e){o=e}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(e){e instanceof c&&(l=e)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(e){l.path=e}});var u=[];Object.defineProperty(this,"ctxStack",{get:function(){return u},set:function(e){u=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t;t=h(e),this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=0===t.a,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=h(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=0===t.a,this.ctx.strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){-1!==["butt","round","square"].indexOf(e)&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){-1!==["bevel","round","miter"].indexOf(e)&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){-1!==["right","end","center","left","start"].indexOf(e)&&(this.ctx.textAlign=e)}});var d=null,f=null,p=null;Object.defineProperty(this,"fontFaces",{get:function(){return p},set:function(e){d=null,f=null,p=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,null!==(t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(e))){var A=t[1];t[2];var r=t[3],n=t[4];t[5];var i=t[6],s=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(n)[2];n="px"===s?Math.floor(parseFloat(n)*this.pdf.internal.scaleFactor):"em"===s?Math.floor(parseFloat(n)*this.pdf.getFontSize()):Math.floor(parseFloat(n)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(n);var a=function(e){var t,A,r=[],n=e.trim();if(""===n)return ra;if(n in Ks)return[Ks[n]];for(;""!==n;){switch(A=null,t=(n=zs(n)).charAt(0)){case'"':case"'":A=qs(n.substring(1),t);break;default:A=Ws(n)}if(null===A)return ra;if(r.push(A[0]),""!==(n=zs(A[1]))&&","!==n.charAt(0))return ra;n=n.replace(/^,/,"")}return r}(i);if(this.fontFaces){var o=function(e,t){var A=e.getFontList(),r=JSON.stringify(A);if(null===d||f!==r){var n=function(e){var t=[];return Object.keys(e).forEach(function(A){e[A].forEach(function(e){var r=null;switch(e){case"bold":r={family:A,weight:"bold"};break;case"italic":r={family:A,style:"italic"};break;case"bolditalic":r={family:A,weight:"bold",style:"italic"};break;case"":case"normal":r={family:A}}null!==r&&(r.ref={name:A,style:e},t.push(r))})}),t}(A);d=function(e){for(var t={},A=0;A<e.length;++A){var r=js(e[A]),n=r.family,i=r.stretch,s=r.style,a=r.weight;t[n]=t[n]||{},t[n][i]=t[n][i]||{},t[n][i][s]=t[n][i][s]||{},t[n][i][s][a]=r}return t}(n.concat(t)),f=r}return d}(this.pdf,this.fontFaces),l=a.map(function(e){return{family:e,stretch:"normal",weight:r,style:A}}),c=function(e,t,A){for(var r=(A=A||{}).defaultFontFamily||"times",n=Object.assign({},Vs,A.genericFontFamilies||{}),i=null,s=null,a=0;a<t.length;++a)if(n[(i=js(t[a])).family]&&(i.family=n[i.family]),e.hasOwnProperty(i.family)){s=e[i.family];break}if(!(s=s||e[r]))throw new Error("Could not find a font-family for the rule '"+Gs(i)+"' and default family '"+r+"'.");if(s=function(e,t){if(t[e])return t[e];var A=Ps[e],r=A<=Ps.normal?-1:1,n=Rs(t,Os,A,r);if(!n)throw new Error("Could not find a matching font-stretch value for "+e);return n}(i.stretch,s),s=function(e,t){if(t[e])return t[e];for(var A=Hs[e],r=0;r<A.length;++r)if(t[A[r]])return t[A[r]];throw new Error("Could not find a matching font-style for "+e)}(i.style,s),!(s=function(e,t){if(t[e])return t[e];if(400===e&&t[500])return t[500];if(500===e&&t[400])return t[400];var A=Ms[e],r=Rs(t,Ds,A,e<400?-1:1);if(!r)throw new Error("Could not find a matching font-weight for value "+e);return r}(i.weight,s)))throw new Error("Failed to resolve a font for the rule '"+Gs(i)+"'.");return s}(o,l);this.pdf.setFont(c.ref.name,c.ref.style)}else{var u="";("bold"===r||parseInt(r,10)>=700||"bold"===A)&&(u="bold"),"italic"===A&&(u+="italic"),0===u.length&&(u="normal");for(var h="",p={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},g=0;g<a.length;g++){if(void 0!==this.pdf.internal.getFont(a[g],u,{noFallback:!0,disableWarning:!0})){h=a[g];break}if("bolditalic"===u&&void 0!==this.pdf.internal.getFont(a[g],"bold",{noFallback:!0,disableWarning:!0}))h=a[g],u="bold";else if(void 0!==this.pdf.internal.getFont(a[g],"normal",{noFallback:!0,disableWarning:!0})){h=a[g],u="normal";break}}if(""===h)for(var m=0;m<a.length;m++)if(p[a[m]]){h=p[a[m]];break}h=""===h?"Times":h,this.pdf.setFont(h,u)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(e){this.ctx.globalCompositeOperation=e}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(e){this.ctx.globalAlpha=e}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(e){this.ctx.lineDashOffset=e,O.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(e){this.ctx.lineDash=e,O.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(e){this.ctx.ignoreClearRect=Boolean(e)}})};u.prototype.setLineDash=function(e){this.lineDash=e},u.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},u.prototype.fill=function(){b.call(this,"fill",!1)},u.prototype.stroke=function(){b.call(this,"stroke",!1)},u.prototype.beginPath=function(){this.path=[{type:"begin"}]},u.prototype.moveTo=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var A=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"mt",x:A.x,y:A.y}),this.ctx.lastPoint=new s(e,t)},u.prototype.closePath=function(){var e=new s(0,0),t=0;for(t=this.path.length-1;-1!==t;t--)if("begin"===this.path[t].type&&"object"===pe(this.path[t+1])&&"number"==typeof this.path[t+1].x){e=new s(this.path[t+1].x,this.path[t+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(e.x,e.y)},u.prototype.lineTo=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var A=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"lt",x:A.x,y:A.y}),this.ctx.lastPoint=new s(A.x,A.y)},u.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),b.call(this,null,!0)},u.prototype.quadraticCurveTo=function(e,t,A,r){if(isNaN(A)||isNaN(r)||isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var n=this.ctx.transform.applyToPoint(new s(A,r)),i=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"qct",x1:i.x,y1:i.y,x:n.x,y:n.y}),this.ctx.lastPoint=new s(n.x,n.y)},u.prototype.bezierCurveTo=function(e,t,A,r,n,i){if(isNaN(n)||isNaN(i)||isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new s(n,i)),o=this.ctx.transform.applyToPoint(new s(e,t)),l=this.ctx.transform.applyToPoint(new s(A,r));this.path.push({type:"bct",x1:o.x,y1:o.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new s(a.x,a.y)},u.prototype.arc=function(e,t,A,r,n,i){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n))throw mi.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(i=Boolean(i),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new s(e,t));e=a.x,t=a.y;var o=this.ctx.transform.applyToPoint(new s(0,A)),l=this.ctx.transform.applyToPoint(new s(0,0));A=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2))}Math.abs(n-r)>=2*Math.PI&&(r=0,n=2*Math.PI),this.path.push({type:"arc",x:e,y:t,radius:A,startAngle:r,endAngle:n,counterclockwise:i})},u.prototype.arcTo=function(e,t,A,r,n){throw new Error("arcTo not implemented.")},u.prototype.rect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(e,t),this.lineTo(e+A,t),this.lineTo(e+A,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.lineTo(e+A,t),this.lineTo(e,t)},u.prototype.fillRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var n={};"butt"!==this.lineCap&&(n.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(n.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(e,t,A,r),this.fill(),n.hasOwnProperty("lineCap")&&(this.lineCap=n.lineCap),n.hasOwnProperty("lineJoin")&&(this.lineJoin=n.lineJoin)}},u.prototype.strokeRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(e,t,A,r),this.stroke())},u.prototype.clearRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(e,t,A,r))},u.prototype.save=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,A=0;A<this.pdf.internal.getNumberOfPages();A++)this.pdf.setPage(A+1),this.pdf.internal.out("q");if(this.pdf.setPage(t),e){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},u.prototype.restore=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,A=0;A<this.pdf.internal.getNumberOfPages();A++)this.pdf.setPage(A+1),this.pdf.internal.out("Q");this.pdf.setPage(t),e&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},u.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(e){var t,A,r,n;if(!0===e.isCanvasGradient&&(e=e.getColor()),!e)return{r:0,g:0,b:0,a:0,style:e};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))t=0,A=0,r=0,n=0;else{var i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(null!==i)t=parseInt(i[1]),A=parseInt(i[2]),r=parseInt(i[3]),n=1;else if(null!==(i=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))t=parseInt(i[1]),A=parseInt(i[2]),r=parseInt(i[3]),n=parseFloat(i[4]);else{if(n=1,"string"==typeof e&&"#"!==e.charAt(0)){var s=new vi(e);e=s.ok?s.toHex():"#000000"}4===e.length?(t=e.substring(1,2),t+=t,A=e.substring(2,3),A+=A,r=e.substring(3,4),r+=r):(t=e.substring(1,3),A=e.substring(3,5),r=e.substring(5,7)),t=parseInt(t,16),A=parseInt(A,16),r=parseInt(r,16)}}return{r:t,g:A,b:r,a:n,style:e}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},f=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};u.prototype.fillText=function(e,t,A,r){if(isNaN(t)||isNaN(A)||"string"!=typeof e)throw mi.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!d.call(this)){var n=k(this.ctx.transform.rotation),i=this.ctx.transform.scaleX;S.call(this,{text:e,x:t,y:A,scale:i,angle:n,align:this.textAlign,maxWidth:r})}},u.prototype.strokeText=function(e,t,A,r){if(isNaN(t)||isNaN(A)||"string"!=typeof e)throw mi.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!f.call(this)){r=isNaN(r)?void 0:r;var n=k(this.ctx.transform.rotation),i=this.ctx.transform.scaleX;S.call(this,{text:e,x:t,y:A,scale:i,renderingMode:"stroke",angle:n,align:this.textAlign,maxWidth:r})}},u.prototype.measureText=function(e){if("string"!=typeof e)throw mi.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var t=this.pdf,A=this.pdf.internal.scaleFactor,r=t.internal.getFontSize(),n=t.getStringUnitWidth(e)*r/t.internal.scaleFactor;return new function(e){var t=(e=e||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return t}}),this}({width:n*=Math.round(96*A/72*1e4)/1e4})},u.prototype.scale=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var A=new o(e,0,0,t,0,0);this.ctx.transform=this.ctx.transform.multiply(A)},u.prototype.rotate=function(e){if(isNaN(e))throw mi.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var t=new o(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);this.ctx.transform=this.ctx.transform.multiply(t)},u.prototype.translate=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var A=new o(1,0,0,1,e,t);this.ctx.transform=this.ctx.transform.multiply(A)},u.prototype.transform=function(e,t,A,r,n,i){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i))throw mi.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var s=new o(e,t,A,r,n,i);this.ctx.transform=this.ctx.transform.multiply(s)},u.prototype.setTransform=function(e,t,A,r,n,i){e=isNaN(e)?1:e,t=isNaN(t)?0:t,A=isNaN(A)?0:A,r=isNaN(r)?1:r,n=isNaN(n)?0:n,i=isNaN(i)?0:i,this.ctx.transform=new o(e,t,A,r,n,i)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};u.prototype.drawImage=function(e,t,A,r,n,i,s,l,c){var u=this.pdf.getImageProperties(e),h=1,d=1,f=1,m=1;void 0!==r&&void 0!==l&&(f=l/r,m=c/n,h=u.width/r*l/r,d=u.height/n*c/n),void 0===i&&(i=t,s=A,t=0,A=0),void 0!==r&&void 0===l&&(l=r,c=n),void 0===r&&void 0===l&&(l=u.width,c=u.height);var b=this.ctx.transform.decompose(),v=k(b.rotate.shx),C=new o,x=(C=(C=(C=C.multiply(b.translate)).multiply(b.skew)).multiply(b.scale)).applyToRectangle(new a(i-t*f,s-A*m,r*h,n*d));if(this.autoPaging){for(var F,Q=g.call(this,x),U=[],S=0;S<Q.length;S+=1)-1===U.indexOf(Q[S])&&U.push(Q[S]);B(U);for(var E=U[0],N=U[U.length-1],L=E;L<N+1;L++){this.pdf.setPage(L);var _=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],I=1===L?this.posY+this.margin[0]:this.margin[0],T=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],H=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],O=1===L?0:T+(L-2)*H;if(0!==this.ctx.clip_path.length){var P=this.path;F=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(F,this.posX+this.margin[3],-O+I+this.ctx.prevPageLastElemOffset),y.call(this,"fill",!0),this.path=P}var D=JSON.parse(JSON.stringify(x));D=w([D],this.posX+this.margin[3],-O+I+this.ctx.prevPageLastElemOffset)[0];var M=(L>E||L<N)&&p.call(this);M&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],_,H,null).clip().discardPath()),this.pdf.addImage(e,"JPEG",D.x,D.y,D.w,D.h,null,null,v),M&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(e,"JPEG",x.x,x.y,x.w,x.h,null,null,v)};var g=function(e,t,A){var r=[];t=t||this.pdf.internal.pageSize.width,A=A||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var n=this.posY+this.ctx.prevPageLastElemOffset;switch(e.type){default:case"mt":case"lt":r.push(Math.floor((e.y+n)/A)+1);break;case"arc":r.push(Math.floor((e.y+n-e.radius)/A)+1),r.push(Math.floor((e.y+n+e.radius)/A)+1);break;case"qct":var i=T(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x,e.y);r.push(Math.floor((i.y+n)/A)+1),r.push(Math.floor((i.y+i.h+n)/A)+1);break;case"bct":var s=H(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x2,e.y2,e.x,e.y);r.push(Math.floor((s.y+n)/A)+1),r.push(Math.floor((s.y+s.h+n)/A)+1);break;case"rect":r.push(Math.floor((e.y+n)/A)+1),r.push(Math.floor((e.y+e.h+n)/A)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)m.call(this);return r},m=function(){var e=this.fillStyle,t=this.strokeStyle,A=this.font,r=this.lineCap,n=this.lineWidth,i=this.lineJoin;this.pdf.addPage(),this.fillStyle=e,this.strokeStyle=t,this.font=A,this.lineCap=r,this.lineWidth=n,this.lineJoin=i},w=function(e,t,A){for(var r=0;r<e.length;r++)switch(e[r].type){case"bct":e[r].x2+=t,e[r].y2+=A;case"qct":e[r].x1+=t,e[r].y1+=A;default:e[r].x+=t,e[r].y+=A}return e},B=function(e){return e.sort(function(e,t){return e-t})},b=function(e,t){var A=this.fillStyle,r=this.strokeStyle,n=this.lineCap,i=this.lineWidth,s=Math.abs(i*this.ctx.transform.scaleX),a=this.lineJoin;if(this.autoPaging){for(var o,l,c=JSON.parse(JSON.stringify(this.path)),u=JSON.parse(JSON.stringify(this.path)),h=[],d=0;d<u.length;d++)if(void 0!==u[d].x)for(var f=g.call(this,u[d]),b=0;b<f.length;b+=1)-1===h.indexOf(f[b])&&h.push(f[b]);for(var v=0;v<h.length;v++)for(;this.pdf.internal.getNumberOfPages()<h[v];)m.call(this);B(h);for(var C=h[0],x=h[h.length-1],F=C;F<x+1;F++){this.pdf.setPage(F),this.fillStyle=A,this.strokeStyle=r,this.lineCap=n,this.lineWidth=s,this.lineJoin=a;var Q=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],U=1===F?this.posY+this.margin[0]:this.margin[0],S=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],E=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],N=1===F?0:S+(F-2)*E;if(0!==this.ctx.clip_path.length){var L=this.path;o=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(o,this.posX+this.margin[3],-N+U+this.ctx.prevPageLastElemOffset),y.call(this,e,!0),this.path=L}if(l=JSON.parse(JSON.stringify(c)),this.path=w(l,this.posX+this.margin[3],-N+U+this.ctx.prevPageLastElemOffset),!1===t||0===F){var _=(F>C||F<x)&&p.call(this);_&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Q,E,null).clip().discardPath()),y.call(this,e,t),_&&this.pdf.restoreGraphicsState()}this.lineWidth=i}this.path=c}else this.lineWidth=s,y.call(this,e,t),this.lineWidth=i},y=function(e,t){if(("stroke"!==e||t||!f.call(this))&&("stroke"===e||t||!d.call(this))){for(var A,r,n=[],i=this.path,s=0;s<i.length;s++){var a=i[s];switch(a.type){case"begin":n.push({begin:!0});break;case"close":n.push({close:!0});break;case"mt":n.push({start:a,deltas:[],abs:[]});break;case"lt":var o=n.length;if(i[s-1]&&!isNaN(i[s-1].x)&&(A=[a.x-i[s-1].x,a.y-i[s-1].y],o>0))for(;o>=0;o--)if(!0!==n[o-1].close&&!0!==n[o-1].begin){n[o-1].deltas.push(A),n[o-1].abs.push(a);break}break;case"bct":A=[a.x1-i[s-1].x,a.y1-i[s-1].y,a.x2-i[s-1].x,a.y2-i[s-1].y,a.x-i[s-1].x,a.y-i[s-1].y],n[n.length-1].deltas.push(A);break;case"qct":var l=i[s-1].x+2/3*(a.x1-i[s-1].x),c=i[s-1].y+2/3*(a.y1-i[s-1].y),u=a.x+2/3*(a.x1-a.x),h=a.y+2/3*(a.y1-a.y),p=a.x,g=a.y;A=[l-i[s-1].x,c-i[s-1].y,u-i[s-1].x,h-i[s-1].y,p-i[s-1].x,g-i[s-1].y],n[n.length-1].deltas.push(A);break;case"arc":n.push({deltas:[],abs:[],arc:!0}),Array.isArray(n[n.length-1].abs)&&n[n.length-1].abs.push(a)}}r=t?null:"stroke"===e?"stroke":"fill";for(var m=!1,w=0;w<n.length;w++)if(n[w].arc)for(var B=n[w].abs,b=0;b<B.length;b++){var y=B[b];"arc"===y.type?x.call(this,y.x,y.y,y.radius,y.startAngle,y.endAngle,y.counterclockwise,void 0,t,!m):E.call(this,y.x,y.y),m=!0}else if(!0===n[w].close)this.pdf.internal.out("h"),m=!1;else if(!0!==n[w].begin){var v=n[w].start.x,C=n[w].start.y;N.call(this,n[w].deltas,v,C),m=!0}r&&F.call(this,r),t&&Q.call(this)}},v=function(e){var t=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,A=t*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return e-A;case"top":return e+t-A;case"hanging":return e+t-2*A;case"middle":return e+t/2-A;default:return e}},C=function(e){return e+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};u.prototype.createLinearGradient=function(){var e=function(){};return e.colorStops=[],e.addColorStop=function(e,t){this.colorStops.push([e,t])},e.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},e.isCanvasGradient=!0,e},u.prototype.createPattern=function(){return this.createLinearGradient()},u.prototype.createRadialGradient=function(){return this.createLinearGradient()};var x=function(e,t,A,r,n,i,s,a,o){for(var l=_.call(this,A,r,n,i),c=0;c<l.length;c++){var u=l[c];0===c&&(o?U.call(this,u.x1+e,u.y1+t):E.call(this,u.x1+e,u.y1+t)),L.call(this,e,t,u.x2,u.y2,u.x3,u.y3,u.x4,u.y4)}a?Q.call(this):F.call(this,s)},F=function(e){switch(e){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},Q=function(){this.pdf.clip(),this.pdf.discardPath()},U=function(e,t){this.pdf.internal.out(A(e)+" "+r(t)+" m")},S=function(e){var t;switch(e.align){case"right":case"end":t="right";break;case"center":t="center";break;default:t="left"}var A,r,n,i=this.pdf.getTextDimensions(e.text),l=v.call(this,e.y),c=C.call(this,l)-i.h,u=this.ctx.transform.applyToPoint(new s(e.x,l));if(this.autoPaging){var h=this.ctx.transform.decompose(),d=new o;d=(d=(d=d.multiply(h.translate)).multiply(h.skew)).multiply(h.scale);for(var f=this.ctx.transform.applyToRectangle(new a(e.x,l,i.w,i.h)),m=d.applyToRectangle(new a(e.x,c,i.w,i.h)),b=g.call(this,m),x=[],F=0;F<b.length;F+=1)-1===x.indexOf(b[F])&&x.push(b[F]);B(x);for(var Q=x[0],U=x[x.length-1],S=Q;S<U+1;S++){this.pdf.setPage(S);var E=1===S?this.posY+this.margin[0]:this.margin[0],N=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],L=this.pdf.internal.pageSize.height-this.margin[2],_=L-this.margin[0],I=this.pdf.internal.pageSize.width-this.margin[1],k=I-this.margin[3],T=1===S?0:N+(S-2)*_;if(0!==this.ctx.clip_path.length){var H=this.path;A=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(A,this.posX+this.margin[3],-1*T+E),y.call(this,"fill",!0),this.path=H}var O=w([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-T+E+this.ctx.prevPageLastElemOffset)[0];e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),n=this.lineWidth,this.lineWidth=n*e.scale);var P="text"!==this.autoPaging;if(P||O.y+O.h<=L){if(P||O.y>=E&&O.x<=I){var D=P?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||I-O.x)[0],M=w([JSON.parse(JSON.stringify(f))],this.posX+this.margin[3],-T+E+this.ctx.prevPageLastElemOffset)[0],j=P&&(S>Q||S<U)&&p.call(this);j&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],k,_,null).clip().discardPath()),this.pdf.text(D,M.x,M.y,{angle:e.angle,align:t,renderingMode:e.renderingMode}),j&&this.pdf.restoreGraphicsState()}}else O.y<L&&(this.ctx.prevPageLastElemOffset+=L-O.y);e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=n)}}else e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),n=this.lineWidth,this.lineWidth=n*e.scale),this.pdf.text(e.text,u.x+this.posX,u.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=n)},E=function(e,t,n,i){n=n||0,i=i||0,this.pdf.internal.out(A(e+n)+" "+r(t+i)+" l")},N=function(e,t,A){return this.pdf.lines(e,t,A,null,null)},L=function(e,A,r,s,a,o,l,c){this.pdf.internal.out([t(n(r+e)),t(i(s+A)),t(n(a+e)),t(i(o+A)),t(n(l+e)),t(i(c+A)),"c"].join(" "))},_=function(e,t,A,r){for(var n=2*Math.PI,i=Math.PI/2;t>A;)t-=n;var s=Math.abs(A-t);s<n&&r&&(s=n-s);for(var a=[],o=r?-1:1,l=t;s>1e-5;){var c=l+o*Math.min(s,i);a.push(I.call(this,e,l,c)),s-=Math.abs(c-l),l=c}return a},I=function(e,t,A){var r=(A-t)/2,n=e*Math.cos(r),i=e*Math.sin(r),s=n,a=-i,o=s*s+a*a,l=o+s*n+a*i,c=4/3*(Math.sqrt(2*o*l)-l)/(s*i-a*n),u=s-c*a,h=a+c*s,d=u,f=-h,p=r+t,g=Math.cos(p),m=Math.sin(p);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:u*g-h*m,y2:u*m+h*g,x3:d*g-f*m,y3:d*m+f*g,x4:e*Math.cos(A),y4:e*Math.sin(A)}},k=function(e){return 180*e/Math.PI},T=function(e,t,A,r,n,i){var s=e+.5*(A-e),o=t+.5*(r-t),l=n+.5*(A-n),c=i+.5*(r-i),u=Math.min(e,n,s,l),h=Math.max(e,n,s,l),d=Math.min(t,i,o,c),f=Math.max(t,i,o,c);return new a(u,d,h-u,f-d)},H=function(e,t,A,r,n,i,s,o){var l,c,u,h,d,f,p,g,m,w,B,b,y,v,C=A-e,x=r-t,F=n-A,Q=i-r,U=s-n,S=o-i;for(c=0;c<41;c++)m=(p=(u=e+(l=c/40)*C)+l*((d=A+l*F)-u))+l*(d+l*(n+l*U-d)-p),w=(g=(h=t+l*x)+l*((f=r+l*Q)-h))+l*(f+l*(i+l*S-f)-g),0==c?(B=m,b=w,y=m,v=w):(B=Math.min(B,m),b=Math.min(b,w),y=Math.max(y,m),v=Math.max(v,w));return new a(Math.round(B),Math.round(b),Math.round(y-B),Math.round(v-b))},O=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,A=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==A&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=A)}}}(Wi.API),
|
|
214
|
+
function(e,t){for(var A=0;A<4;A++)if(e[t+A]!="RIFF".charCodeAt(A))return!0;return!1}(e,t)){for(h(e,t+=4),t+=8;t<e.length;){var a=l(e,t),o=h(e,t+=4);t+=4;var d=o+(1&o);switch(a){case"VP8 ":case"VP8L":void 0===A.frames[r]&&(A.frames[r]={}),(g=A.frames[r]).src_off=n?s:t-8,g.src_size=i+o+8,r++,n&&(n=!1,i=0,s=0);break;case"VP8X":(g=A.header={}).feature_flags=e[t];var f=t+4;g.canvas_width=1+u(e,f),f+=3,g.canvas_height=1+u(e,f),f+=3;break;case"ALPH":n=!0,i=d+8,s=t-8;break;case"ANIM":(g=A.header).bgcolor=h(e,t),f=t+4,g.loop_count=c(e,f),f+=2;break;case"ANMF":var p,g;(g=A.frames[r]={}).offset_x=2*u(e,t),t+=3,g.offset_y=2*u(e,t),t+=3,g.width=1+u(e,t),t+=3,g.height=1+u(e,t),t+=3,g.duration=u(e,t),t+=3,p=e[t++],g.dispose=1&p,g.blend=p>>1&1}"ANMF"!=a&&(t+=d)}return A}}(m,0);w.response=m,w.rgbaoutput=!0,w.dataurl=!1;var B=w.header?w.header:null,b=w.frames?w.frames:null;if(B){B.loop_counter=B.loop_count,d=[B.canvas_height],f=[B.canvas_width];for(var y=0;y<b.length&&0!=b[y].blend;y++);}var v=b[0],C=g.WebPDecodeRGBA(m,v.src_off,v.src_size,f,d);v.rgba=C,v.imgwidth=f[0],v.imgheight=d[0];for(var x=0;x<f[0]*d[0]*4;x++)p[x]=C[x];return this.width=f,this.height=d,this.data=p,this}!function(e){var t,A,r,n,i,s,a,o,l,c=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||"#000000",this.fillStyle=e.fillStyle||"#000000",this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||"10px sans-serif",this.textBaseline=e.textBaseline||"alphabetic",this.textAlign=e.textAlign||"left",this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||"miter",this.lineCap=e.lineCap||"butt",this.path=e.path||[],this.transform=void 0!==e.transform?e.transform.clone():new o,this.globalCompositeOperation=e.globalCompositeOperation||"normal",this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new s,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new s,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof e.ignoreClearRect||e.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new u(this),t=this.internal.f2,A=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,n=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,o=this.internal.Matrix,l=new c}]);var u=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var A=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return A},set:function(e){A=Boolean(e)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(e){r=Boolean(e)}});var n=0;Object.defineProperty(this,"posX",{get:function(){return n},set:function(e){isNaN(e)||(n=e)}});var i=0;Object.defineProperty(this,"posY",{get:function(){return i},set:function(e){isNaN(e)||(i=e)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(e){var t;"number"==typeof e?t=[e,e,e,e]:((t=new Array(4))[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),l.margin=t}});var s=!1;Object.defineProperty(this,"autoPaging",{get:function(){return s},set:function(e){s=e}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(e){a=e}});var o=[];Object.defineProperty(this,"pageBreaks",{get:function(){return o},set:function(e){o=e}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(e){e instanceof c&&(l=e)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(e){l.path=e}});var u=[];Object.defineProperty(this,"ctxStack",{get:function(){return u},set:function(e){u=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t;t=h(e),this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=0===t.a,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=h(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=0===t.a,this.ctx.strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){-1!==["butt","round","square"].indexOf(e)&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){-1!==["bevel","round","miter"].indexOf(e)&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){-1!==["right","end","center","left","start"].indexOf(e)&&(this.ctx.textAlign=e)}});var d=null,f=null,p=null;Object.defineProperty(this,"fontFaces",{get:function(){return p},set:function(e){d=null,f=null,p=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,null!==(t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(e))){var A=t[1];t[2];var r=t[3],n=t[4];t[5];var i=t[6],s=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(n)[2];n="px"===s?Math.floor(parseFloat(n)*this.pdf.internal.scaleFactor):"em"===s?Math.floor(parseFloat(n)*this.pdf.getFontSize()):Math.floor(parseFloat(n)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(n);var a=function(e){var t,A,r=[],n=e.trim();if(""===n)return ra;if(n in Ks)return[Ks[n]];for(;""!==n;){switch(A=null,t=(n=Gs(n)).charAt(0)){case'"':case"'":A=qs(n.substring(1),t);break;default:A=Ws(n)}if(null===A)return ra;if(r.push(A[0]),""!==(n=Gs(A[1]))&&","!==n.charAt(0))return ra;n=n.replace(/^,/,"")}return r}(i);if(this.fontFaces){var o=function(e,t){var A=e.getFontList(),r=JSON.stringify(A);if(null===d||f!==r){var n=function(e){var t=[];return Object.keys(e).forEach(function(A){e[A].forEach(function(e){var r=null;switch(e){case"bold":r={family:A,weight:"bold"};break;case"italic":r={family:A,style:"italic"};break;case"bolditalic":r={family:A,weight:"bold",style:"italic"};break;case"":case"normal":r={family:A}}null!==r&&(r.ref={name:A,style:e},t.push(r))})}),t}(A);d=function(e){for(var t={},A=0;A<e.length;++A){var r=js(e[A]),n=r.family,i=r.stretch,s=r.style,a=r.weight;t[n]=t[n]||{},t[n][i]=t[n][i]||{},t[n][i][s]=t[n][i][s]||{},t[n][i][s][a]=r}return t}(n.concat(t)),f=r}return d}(this.pdf,this.fontFaces),l=a.map(function(e){return{family:e,stretch:"normal",weight:r,style:A}}),c=function(e,t,A){for(var r=(A=A||{}).defaultFontFamily||"times",n=Object.assign({},Vs,A.genericFontFamilies||{}),i=null,s=null,a=0;a<t.length;++a)if(n[(i=js(t[a])).family]&&(i.family=n[i.family]),e.hasOwnProperty(i.family)){s=e[i.family];break}if(!(s=s||e[r]))throw new Error("Could not find a font-family for the rule '"+zs(i)+"' and default family '"+r+"'.");if(s=function(e,t){if(t[e])return t[e];var A=Ps[e],r=A<=Ps.normal?-1:1,n=Rs(t,Os,A,r);if(!n)throw new Error("Could not find a matching font-stretch value for "+e);return n}(i.stretch,s),s=function(e,t){if(t[e])return t[e];for(var A=Hs[e],r=0;r<A.length;++r)if(t[A[r]])return t[A[r]];throw new Error("Could not find a matching font-style for "+e)}(i.style,s),!(s=function(e,t){if(t[e])return t[e];if(400===e&&t[500])return t[500];if(500===e&&t[400])return t[400];var A=Ms[e],r=Rs(t,Ds,A,e<400?-1:1);if(!r)throw new Error("Could not find a matching font-weight for value "+e);return r}(i.weight,s)))throw new Error("Failed to resolve a font for the rule '"+zs(i)+"'.");return s}(o,l);this.pdf.setFont(c.ref.name,c.ref.style)}else{var u="";("bold"===r||parseInt(r,10)>=700||"bold"===A)&&(u="bold"),"italic"===A&&(u+="italic"),0===u.length&&(u="normal");for(var h="",p={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},g=0;g<a.length;g++){if(void 0!==this.pdf.internal.getFont(a[g],u,{noFallback:!0,disableWarning:!0})){h=a[g];break}if("bolditalic"===u&&void 0!==this.pdf.internal.getFont(a[g],"bold",{noFallback:!0,disableWarning:!0}))h=a[g],u="bold";else if(void 0!==this.pdf.internal.getFont(a[g],"normal",{noFallback:!0,disableWarning:!0})){h=a[g],u="normal";break}}if(""===h)for(var m=0;m<a.length;m++)if(p[a[m]]){h=p[a[m]];break}h=""===h?"Times":h,this.pdf.setFont(h,u)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(e){this.ctx.globalCompositeOperation=e}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(e){this.ctx.globalAlpha=e}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(e){this.ctx.lineDashOffset=e,O.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(e){this.ctx.lineDash=e,O.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(e){this.ctx.ignoreClearRect=Boolean(e)}})};u.prototype.setLineDash=function(e){this.lineDash=e},u.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},u.prototype.fill=function(){b.call(this,"fill",!1)},u.prototype.stroke=function(){b.call(this,"stroke",!1)},u.prototype.beginPath=function(){this.path=[{type:"begin"}]},u.prototype.moveTo=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var A=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"mt",x:A.x,y:A.y}),this.ctx.lastPoint=new s(e,t)},u.prototype.closePath=function(){var e=new s(0,0),t=0;for(t=this.path.length-1;-1!==t;t--)if("begin"===this.path[t].type&&"object"===pe(this.path[t+1])&&"number"==typeof this.path[t+1].x){e=new s(this.path[t+1].x,this.path[t+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(e.x,e.y)},u.prototype.lineTo=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var A=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"lt",x:A.x,y:A.y}),this.ctx.lastPoint=new s(A.x,A.y)},u.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),b.call(this,null,!0)},u.prototype.quadraticCurveTo=function(e,t,A,r){if(isNaN(A)||isNaN(r)||isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var n=this.ctx.transform.applyToPoint(new s(A,r)),i=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"qct",x1:i.x,y1:i.y,x:n.x,y:n.y}),this.ctx.lastPoint=new s(n.x,n.y)},u.prototype.bezierCurveTo=function(e,t,A,r,n,i){if(isNaN(n)||isNaN(i)||isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new s(n,i)),o=this.ctx.transform.applyToPoint(new s(e,t)),l=this.ctx.transform.applyToPoint(new s(A,r));this.path.push({type:"bct",x1:o.x,y1:o.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new s(a.x,a.y)},u.prototype.arc=function(e,t,A,r,n,i){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n))throw mi.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(i=Boolean(i),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new s(e,t));e=a.x,t=a.y;var o=this.ctx.transform.applyToPoint(new s(0,A)),l=this.ctx.transform.applyToPoint(new s(0,0));A=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2))}Math.abs(n-r)>=2*Math.PI&&(r=0,n=2*Math.PI),this.path.push({type:"arc",x:e,y:t,radius:A,startAngle:r,endAngle:n,counterclockwise:i})},u.prototype.arcTo=function(e,t,A,r,n){throw new Error("arcTo not implemented.")},u.prototype.rect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(e,t),this.lineTo(e+A,t),this.lineTo(e+A,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.lineTo(e+A,t),this.lineTo(e,t)},u.prototype.fillRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var n={};"butt"!==this.lineCap&&(n.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(n.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(e,t,A,r),this.fill(),n.hasOwnProperty("lineCap")&&(this.lineCap=n.lineCap),n.hasOwnProperty("lineJoin")&&(this.lineJoin=n.lineJoin)}},u.prototype.strokeRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(e,t,A,r),this.stroke())},u.prototype.clearRect=function(e,t,A,r){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r))throw mi.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(e,t,A,r))},u.prototype.save=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,A=0;A<this.pdf.internal.getNumberOfPages();A++)this.pdf.setPage(A+1),this.pdf.internal.out("q");if(this.pdf.setPage(t),e){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},u.prototype.restore=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,A=0;A<this.pdf.internal.getNumberOfPages();A++)this.pdf.setPage(A+1),this.pdf.internal.out("Q");this.pdf.setPage(t),e&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},u.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(e){var t,A,r,n;if(!0===e.isCanvasGradient&&(e=e.getColor()),!e)return{r:0,g:0,b:0,a:0,style:e};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))t=0,A=0,r=0,n=0;else{var i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(null!==i)t=parseInt(i[1]),A=parseInt(i[2]),r=parseInt(i[3]),n=1;else if(null!==(i=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))t=parseInt(i[1]),A=parseInt(i[2]),r=parseInt(i[3]),n=parseFloat(i[4]);else{if(n=1,"string"==typeof e&&"#"!==e.charAt(0)){var s=new vi(e);e=s.ok?s.toHex():"#000000"}4===e.length?(t=e.substring(1,2),t+=t,A=e.substring(2,3),A+=A,r=e.substring(3,4),r+=r):(t=e.substring(1,3),A=e.substring(3,5),r=e.substring(5,7)),t=parseInt(t,16),A=parseInt(A,16),r=parseInt(r,16)}}return{r:t,g:A,b:r,a:n,style:e}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},f=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};u.prototype.fillText=function(e,t,A,r){if(isNaN(t)||isNaN(A)||"string"!=typeof e)throw mi.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!d.call(this)){var n=k(this.ctx.transform.rotation),i=this.ctx.transform.scaleX;S.call(this,{text:e,x:t,y:A,scale:i,angle:n,align:this.textAlign,maxWidth:r})}},u.prototype.strokeText=function(e,t,A,r){if(isNaN(t)||isNaN(A)||"string"!=typeof e)throw mi.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!f.call(this)){r=isNaN(r)?void 0:r;var n=k(this.ctx.transform.rotation),i=this.ctx.transform.scaleX;S.call(this,{text:e,x:t,y:A,scale:i,renderingMode:"stroke",angle:n,align:this.textAlign,maxWidth:r})}},u.prototype.measureText=function(e){if("string"!=typeof e)throw mi.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var t=this.pdf,A=this.pdf.internal.scaleFactor,r=t.internal.getFontSize(),n=t.getStringUnitWidth(e)*r/t.internal.scaleFactor;return new function(e){var t=(e=e||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return t}}),this}({width:n*=Math.round(96*A/72*1e4)/1e4})},u.prototype.scale=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var A=new o(e,0,0,t,0,0);this.ctx.transform=this.ctx.transform.multiply(A)},u.prototype.rotate=function(e){if(isNaN(e))throw mi.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var t=new o(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);this.ctx.transform=this.ctx.transform.multiply(t)},u.prototype.translate=function(e,t){if(isNaN(e)||isNaN(t))throw mi.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var A=new o(1,0,0,1,e,t);this.ctx.transform=this.ctx.transform.multiply(A)},u.prototype.transform=function(e,t,A,r,n,i){if(isNaN(e)||isNaN(t)||isNaN(A)||isNaN(r)||isNaN(n)||isNaN(i))throw mi.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var s=new o(e,t,A,r,n,i);this.ctx.transform=this.ctx.transform.multiply(s)},u.prototype.setTransform=function(e,t,A,r,n,i){e=isNaN(e)?1:e,t=isNaN(t)?0:t,A=isNaN(A)?0:A,r=isNaN(r)?1:r,n=isNaN(n)?0:n,i=isNaN(i)?0:i,this.ctx.transform=new o(e,t,A,r,n,i)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};u.prototype.drawImage=function(e,t,A,r,n,i,s,l,c){var u=this.pdf.getImageProperties(e),h=1,d=1,f=1,m=1;void 0!==r&&void 0!==l&&(f=l/r,m=c/n,h=u.width/r*l/r,d=u.height/n*c/n),void 0===i&&(i=t,s=A,t=0,A=0),void 0!==r&&void 0===l&&(l=r,c=n),void 0===r&&void 0===l&&(l=u.width,c=u.height);var b=this.ctx.transform.decompose(),v=k(b.rotate.shx),C=new o,x=(C=(C=(C=C.multiply(b.translate)).multiply(b.skew)).multiply(b.scale)).applyToRectangle(new a(i-t*f,s-A*m,r*h,n*d));if(this.autoPaging){for(var F,Q=g.call(this,x),U=[],S=0;S<Q.length;S+=1)-1===U.indexOf(Q[S])&&U.push(Q[S]);B(U);for(var E=U[0],N=U[U.length-1],L=E;L<N+1;L++){this.pdf.setPage(L);var _=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],I=1===L?this.posY+this.margin[0]:this.margin[0],T=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],H=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],O=1===L?0:T+(L-2)*H;if(0!==this.ctx.clip_path.length){var P=this.path;F=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(F,this.posX+this.margin[3],-O+I+this.ctx.prevPageLastElemOffset),y.call(this,"fill",!0),this.path=P}var D=JSON.parse(JSON.stringify(x));D=w([D],this.posX+this.margin[3],-O+I+this.ctx.prevPageLastElemOffset)[0];var M=(L>E||L<N)&&p.call(this);M&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],_,H,null).clip().discardPath()),this.pdf.addImage(e,"JPEG",D.x,D.y,D.w,D.h,null,null,v),M&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(e,"JPEG",x.x,x.y,x.w,x.h,null,null,v)};var g=function(e,t,A){var r=[];t=t||this.pdf.internal.pageSize.width,A=A||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var n=this.posY+this.ctx.prevPageLastElemOffset;switch(e.type){default:case"mt":case"lt":r.push(Math.floor((e.y+n)/A)+1);break;case"arc":r.push(Math.floor((e.y+n-e.radius)/A)+1),r.push(Math.floor((e.y+n+e.radius)/A)+1);break;case"qct":var i=T(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x,e.y);r.push(Math.floor((i.y+n)/A)+1),r.push(Math.floor((i.y+i.h+n)/A)+1);break;case"bct":var s=H(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x2,e.y2,e.x,e.y);r.push(Math.floor((s.y+n)/A)+1),r.push(Math.floor((s.y+s.h+n)/A)+1);break;case"rect":r.push(Math.floor((e.y+n)/A)+1),r.push(Math.floor((e.y+e.h+n)/A)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)m.call(this);return r},m=function(){var e=this.fillStyle,t=this.strokeStyle,A=this.font,r=this.lineCap,n=this.lineWidth,i=this.lineJoin;this.pdf.addPage(),this.fillStyle=e,this.strokeStyle=t,this.font=A,this.lineCap=r,this.lineWidth=n,this.lineJoin=i},w=function(e,t,A){for(var r=0;r<e.length;r++)switch(e[r].type){case"bct":e[r].x2+=t,e[r].y2+=A;case"qct":e[r].x1+=t,e[r].y1+=A;default:e[r].x+=t,e[r].y+=A}return e},B=function(e){return e.sort(function(e,t){return e-t})},b=function(e,t){var A=this.fillStyle,r=this.strokeStyle,n=this.lineCap,i=this.lineWidth,s=Math.abs(i*this.ctx.transform.scaleX),a=this.lineJoin;if(this.autoPaging){for(var o,l,c=JSON.parse(JSON.stringify(this.path)),u=JSON.parse(JSON.stringify(this.path)),h=[],d=0;d<u.length;d++)if(void 0!==u[d].x)for(var f=g.call(this,u[d]),b=0;b<f.length;b+=1)-1===h.indexOf(f[b])&&h.push(f[b]);for(var v=0;v<h.length;v++)for(;this.pdf.internal.getNumberOfPages()<h[v];)m.call(this);B(h);for(var C=h[0],x=h[h.length-1],F=C;F<x+1;F++){this.pdf.setPage(F),this.fillStyle=A,this.strokeStyle=r,this.lineCap=n,this.lineWidth=s,this.lineJoin=a;var Q=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],U=1===F?this.posY+this.margin[0]:this.margin[0],S=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],E=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],N=1===F?0:S+(F-2)*E;if(0!==this.ctx.clip_path.length){var L=this.path;o=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(o,this.posX+this.margin[3],-N+U+this.ctx.prevPageLastElemOffset),y.call(this,e,!0),this.path=L}if(l=JSON.parse(JSON.stringify(c)),this.path=w(l,this.posX+this.margin[3],-N+U+this.ctx.prevPageLastElemOffset),!1===t||0===F){var _=(F>C||F<x)&&p.call(this);_&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Q,E,null).clip().discardPath()),y.call(this,e,t),_&&this.pdf.restoreGraphicsState()}this.lineWidth=i}this.path=c}else this.lineWidth=s,y.call(this,e,t),this.lineWidth=i},y=function(e,t){if(("stroke"!==e||t||!f.call(this))&&("stroke"===e||t||!d.call(this))){for(var A,r,n=[],i=this.path,s=0;s<i.length;s++){var a=i[s];switch(a.type){case"begin":n.push({begin:!0});break;case"close":n.push({close:!0});break;case"mt":n.push({start:a,deltas:[],abs:[]});break;case"lt":var o=n.length;if(i[s-1]&&!isNaN(i[s-1].x)&&(A=[a.x-i[s-1].x,a.y-i[s-1].y],o>0))for(;o>=0;o--)if(!0!==n[o-1].close&&!0!==n[o-1].begin){n[o-1].deltas.push(A),n[o-1].abs.push(a);break}break;case"bct":A=[a.x1-i[s-1].x,a.y1-i[s-1].y,a.x2-i[s-1].x,a.y2-i[s-1].y,a.x-i[s-1].x,a.y-i[s-1].y],n[n.length-1].deltas.push(A);break;case"qct":var l=i[s-1].x+2/3*(a.x1-i[s-1].x),c=i[s-1].y+2/3*(a.y1-i[s-1].y),u=a.x+2/3*(a.x1-a.x),h=a.y+2/3*(a.y1-a.y),p=a.x,g=a.y;A=[l-i[s-1].x,c-i[s-1].y,u-i[s-1].x,h-i[s-1].y,p-i[s-1].x,g-i[s-1].y],n[n.length-1].deltas.push(A);break;case"arc":n.push({deltas:[],abs:[],arc:!0}),Array.isArray(n[n.length-1].abs)&&n[n.length-1].abs.push(a)}}r=t?null:"stroke"===e?"stroke":"fill";for(var m=!1,w=0;w<n.length;w++)if(n[w].arc)for(var B=n[w].abs,b=0;b<B.length;b++){var y=B[b];"arc"===y.type?x.call(this,y.x,y.y,y.radius,y.startAngle,y.endAngle,y.counterclockwise,void 0,t,!m):E.call(this,y.x,y.y),m=!0}else if(!0===n[w].close)this.pdf.internal.out("h"),m=!1;else if(!0!==n[w].begin){var v=n[w].start.x,C=n[w].start.y;N.call(this,n[w].deltas,v,C),m=!0}r&&F.call(this,r),t&&Q.call(this)}},v=function(e){var t=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,A=t*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return e-A;case"top":return e+t-A;case"hanging":return e+t-2*A;case"middle":return e+t/2-A;default:return e}},C=function(e){return e+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};u.prototype.createLinearGradient=function(){var e=function(){};return e.colorStops=[],e.addColorStop=function(e,t){this.colorStops.push([e,t])},e.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},e.isCanvasGradient=!0,e},u.prototype.createPattern=function(){return this.createLinearGradient()},u.prototype.createRadialGradient=function(){return this.createLinearGradient()};var x=function(e,t,A,r,n,i,s,a,o){for(var l=_.call(this,A,r,n,i),c=0;c<l.length;c++){var u=l[c];0===c&&(o?U.call(this,u.x1+e,u.y1+t):E.call(this,u.x1+e,u.y1+t)),L.call(this,e,t,u.x2,u.y2,u.x3,u.y3,u.x4,u.y4)}a?Q.call(this):F.call(this,s)},F=function(e){switch(e){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},Q=function(){this.pdf.clip(),this.pdf.discardPath()},U=function(e,t){this.pdf.internal.out(A(e)+" "+r(t)+" m")},S=function(e){var t;switch(e.align){case"right":case"end":t="right";break;case"center":t="center";break;default:t="left"}var A,r,n,i=this.pdf.getTextDimensions(e.text),l=v.call(this,e.y),c=C.call(this,l)-i.h,u=this.ctx.transform.applyToPoint(new s(e.x,l));if(this.autoPaging){var h=this.ctx.transform.decompose(),d=new o;d=(d=(d=d.multiply(h.translate)).multiply(h.skew)).multiply(h.scale);for(var f=this.ctx.transform.applyToRectangle(new a(e.x,l,i.w,i.h)),m=d.applyToRectangle(new a(e.x,c,i.w,i.h)),b=g.call(this,m),x=[],F=0;F<b.length;F+=1)-1===x.indexOf(b[F])&&x.push(b[F]);B(x);for(var Q=x[0],U=x[x.length-1],S=Q;S<U+1;S++){this.pdf.setPage(S);var E=1===S?this.posY+this.margin[0]:this.margin[0],N=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],L=this.pdf.internal.pageSize.height-this.margin[2],_=L-this.margin[0],I=this.pdf.internal.pageSize.width-this.margin[1],k=I-this.margin[3],T=1===S?0:N+(S-2)*_;if(0!==this.ctx.clip_path.length){var H=this.path;A=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(A,this.posX+this.margin[3],-1*T+E),y.call(this,"fill",!0),this.path=H}var O=w([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-T+E+this.ctx.prevPageLastElemOffset)[0];e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),n=this.lineWidth,this.lineWidth=n*e.scale);var P="text"!==this.autoPaging;if(P||O.y+O.h<=L){if(P||O.y>=E&&O.x<=I){var D=P?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||I-O.x)[0],M=w([JSON.parse(JSON.stringify(f))],this.posX+this.margin[3],-T+E+this.ctx.prevPageLastElemOffset)[0],j=P&&(S>Q||S<U)&&p.call(this);j&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],k,_,null).clip().discardPath()),this.pdf.text(D,M.x,M.y,{angle:e.angle,align:t,renderingMode:e.renderingMode}),j&&this.pdf.restoreGraphicsState()}}else O.y<L&&(this.ctx.prevPageLastElemOffset+=L-O.y);e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=n)}}else e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),n=this.lineWidth,this.lineWidth=n*e.scale),this.pdf.text(e.text,u.x+this.posX,u.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=n)},E=function(e,t,n,i){n=n||0,i=i||0,this.pdf.internal.out(A(e+n)+" "+r(t+i)+" l")},N=function(e,t,A){return this.pdf.lines(e,t,A,null,null)},L=function(e,A,r,s,a,o,l,c){this.pdf.internal.out([t(n(r+e)),t(i(s+A)),t(n(a+e)),t(i(o+A)),t(n(l+e)),t(i(c+A)),"c"].join(" "))},_=function(e,t,A,r){for(var n=2*Math.PI,i=Math.PI/2;t>A;)t-=n;var s=Math.abs(A-t);s<n&&r&&(s=n-s);for(var a=[],o=r?-1:1,l=t;s>1e-5;){var c=l+o*Math.min(s,i);a.push(I.call(this,e,l,c)),s-=Math.abs(c-l),l=c}return a},I=function(e,t,A){var r=(A-t)/2,n=e*Math.cos(r),i=e*Math.sin(r),s=n,a=-i,o=s*s+a*a,l=o+s*n+a*i,c=4/3*(Math.sqrt(2*o*l)-l)/(s*i-a*n),u=s-c*a,h=a+c*s,d=u,f=-h,p=r+t,g=Math.cos(p),m=Math.sin(p);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:u*g-h*m,y2:u*m+h*g,x3:d*g-f*m,y3:d*m+f*g,x4:e*Math.cos(A),y4:e*Math.sin(A)}},k=function(e){return 180*e/Math.PI},T=function(e,t,A,r,n,i){var s=e+.5*(A-e),o=t+.5*(r-t),l=n+.5*(A-n),c=i+.5*(r-i),u=Math.min(e,n,s,l),h=Math.max(e,n,s,l),d=Math.min(t,i,o,c),f=Math.max(t,i,o,c);return new a(u,d,h-u,f-d)},H=function(e,t,A,r,n,i,s,o){var l,c,u,h,d,f,p,g,m,w,B,b,y,v,C=A-e,x=r-t,F=n-A,Q=i-r,U=s-n,S=o-i;for(c=0;c<41;c++)m=(p=(u=e+(l=c/40)*C)+l*((d=A+l*F)-u))+l*(d+l*(n+l*U-d)-p),w=(g=(h=t+l*x)+l*((f=r+l*Q)-h))+l*(f+l*(i+l*S-f)-g),0==c?(B=m,b=w,y=m,v=w):(B=Math.min(B,m),b=Math.min(b,w),y=Math.max(y,m),v=Math.max(v,w));return new a(Math.round(B),Math.round(b),Math.round(y-B),Math.round(v-b))},O=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,A=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==A&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=A)}}}(Wi.API),
|
|
215
215
|
/**
|
|
216
216
|
* @license
|
|
217
217
|
* jsPDF filters PlugIn
|
|
@@ -304,9 +304,9 @@ function(e){var t=function(){return void 0===this.internal.vFS&&(this.internal.v
|
|
|
304
304
|
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
|
|
305
305
|
* MIT License
|
|
306
306
|
*/
|
|
307
|
-
function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var A,r,n,i,s,a,o,l=t,c=[[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]],u=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},f=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],p=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var w=function(e){var t=e.charCodeAt(),A=t>>8,r=d[A];return void 0!==r?l[256*r+(255&t)]:252===A||253===A?"AL":p.test(A)?"L":8===A?"R":"N"},B=function(e){for(var t,A=0;A<e.length;A++){if("L"===(t=w(e.charAt(A))))return!1;if("R"===t)return!0}return!1},b=function(e,t,s,a){var o,l,c,u,h=t[a];switch(h){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(h="AN");break;case"AL":g=!0,h="R";break;case"WS":case"BN":h="N";break;case"CS":a<1||a+1>=t.length||"EN"!==(o=s[a-1])&&"AN"!==o||"EN"!==(l=t[a+1])&&"AN"!==l?h="N":g&&(l="AN"),h=l===o?l:"N";break;case"ES":h="EN"===(o=a>0?s[a-1]:"B")&&a+1<t.length&&"EN"===t[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===s[a-1]){h="EN";break}if(g){h="N";break}for(c=a+1,u=t.length;c<u&&"ET"===t[c];)c++;h=c<u&&"EN"===t[c]?"EN":"N";break;case"NSM":if(n&&!i){for(u=t.length,c=a+1;c<u&&"NSM"===t[c];)c++;if(c<u){var d=e[a],f=d>=1425&&d<=2303||64286===d;if(o=t[c],f&&("R"===o||"AL"===o)){h="R";break}}}h=a<1||"B"===(o=t[a-1])?"N":s[a-1];break;case"B":g=!1,A=!0,h=m;break;case"S":r=!0,h="N"}return h},y=function(e,t,A){var r=e.split("");return A&&v(r,A,{hiLevel:m}),r.reverse(),t&&t.reverse(),r.join("")},v=function(e,t,n){var i,s,a,o,l,d=-1,f=e.length,p=0,B=[],y=m?u:c,v=[];for(g=!1,A=!1,r=!1,s=0;s<f;s++)v[s]=w(e[s]);for(a=0;a<f;a++){if(l=p,B[a]=b(e,v,B,a),i=240&(p=y[l][h[B[a]]]),p&=15,t[a]=o=y[p][5],i>0)if(16===i){for(s=d;s<a;s++)t[s]=1;d=-1}else d=-1;if(y[p][6])-1===d&&(d=a);else if(d>-1){for(s=d;s<a;s++)t[s]=o;d=-1}"B"===v[a]&&(t[a]=0),n.hiLevel|=o}r&&function(e,t,A){for(var r=0;r<A;r++)if("S"===e[r]){t[r]=m;for(var n=r-1;n>=0&&"WS"===e[n];n--)t[n]=m}}(v,t,f)},C=function(e,t,r,n,i){if(!(i.hiLevel<e)){if(1===e&&1===m&&!A)return t.reverse(),void(r&&r.reverse());for(var s,a,o,l,c=t.length,u=0;u<c;){if(n[u]>=e){for(o=u+1;o<c&&n[o]>=e;)o++;for(l=u,a=o-1;l<a;l++,a--)s=t[l],t[l]=t[a],t[a]=s,r&&(s=r[l],r[l]=r[a],r[a]=s);u=o}u++}}},x=function(e,t,A){var r=e.split(""),n={hiLevel:m};return A||(A=[]),v(r,A,n),function(e,t,A){if(0!==A.hiLevel&&o)for(var r,n=0;n<e.length;n++)1===t[n]&&(r=f.indexOf(e[n]))>=0&&(e[n]=f[r+1])}(r,A,n),C(2,r,t,A,n),C(1,r,t,A,n),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,A){if(function(e,t){if(t)for(var A=0;A<e.length;A++)t[A]=A;void 0===i&&(i=B(e)),void 0===a&&(a=B(e))}(e,t),n||!s||a)if(n&&s&&i^a)m=i?1:0,e=y(e,t,A);else if(!n&&s&&a)m=i?1:0,e=x(e,t,A),e=y(e,t);else if(!n||i||s||a){if(n&&!s&&i^a)e=y(e,t),i?(m=0,e=x(e,t,A)):(m=1,e=x(e,t,A),e=y(e,t));else if(n&&i&&!s&&a)m=1,e=x(e,t,A),e=y(e,t);else if(!n&&!s&&i^a){var r=o;i?(m=1,e=x(e,t,A),m=0,o=!1,e=x(e,t,A),o=r):(m=0,e=x(e,t,A),e=y(e,t),m=1,o=!1,e=x(e,t,A),o=r,e=y(e,t))}}else m=0,e=x(e,t,A);else m=i?1:0,e=x(e,t,A);return e},this.__bidiEngine__.setOptions=function(e){e&&(n=e.isInputVisual,s=e.isOutputVisual,i=e.isInputRtl,a=e.isOutputRtl,o=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],A=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text;e.x,e.y;var r=e.options||{};e.mutex,r.lang;var n=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,A.setOptions(r),"[object Array]"===Object.prototype.toString.call(t)){var i=0;for(n=[],i=0;i<t.length;i+=1)"[object Array]"===Object.prototype.toString.call(t[i])?n.push([A.doBidiReorder(t[i][0]),t[i][1],t[i][2]]):n.push([A.doBidiReorder(t[i])]);e.text=n}else e.text=A.doBidiReorder(t);A.setOptions({isInputVisual:!0})}])}(Wi),Wi.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new ya(e),this.contents.pos=4,"ttcf"===t.readString(4))throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Ma(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new va(this.contents),this.head=new Fa(this),this.name=new _a(this),this.cmap=new Ua(this),this.toUnicode={},this.hhea=new Sa(this),this.maxp=new Ia(this),this.hmtx=new ka(this),this.post=new Na(this),this.os2=new Ea(this),this.loca=new Da(this),this.glyf=new Ha(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,A,r,n;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,A,r,n;for(n=[],t=0,A=(r=this.bbox).length;t<A;t++)e=r[t],n.push(Math.round(e*this.scaleFactor));return n}.call(this),this.stemV=0,this.post.exists?(A=255&(r=this.post.italic_angle),32768&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+A)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(n=this.familyClass)||2===n||3===n||4===n||5===n||7===n,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,A){var r,n,i,s;for(i=0,n=0,s=(e=""+e).length;0<=s?n<s:n>s;n=0<=s?++n:--n)r=e.charCodeAt(n),i+=this.widthOfGlyph(this.characterToGlyph(r))+A*(1e3/t)||0;return i*(t/1e3)},e.prototype.lineHeight=function(e,t){var A;return null==t&&(t=!1),A=t?this.lineGap:0,(this.ascender+A-this.decender)/1e3*e},e}();var ba,ya=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,A;for(A=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)A[t]=String.fromCharCode(this.readByte());return A.join("")},e.prototype.writeString=function(e){var t,A,r;for(r=[],t=0,A=e.length;0<=A?t<A:t>A;t=0<=A?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,A,r,n,i,s,a;return e=this.readByte(),t=this.readByte(),A=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^A)+4294967296*(255^r)+16777216*(255^n)+65536*(255^i)+256*(255^s)+(255^a)+1):72057594037927940*e+281474976710656*t+1099511627776*A+4294967296*r+16777216*n+65536*i+256*s+a},e.prototype.writeLongLong=function(e){var t,A;return t=Math.floor(e/4294967296),A=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(A>>24&255),this.writeByte(A>>16&255),this.writeByte(A>>8&255),this.writeByte(255&A)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,A;for(t=[],A=0;0<=e?A<e:A>e;A=0<=e?++A:--A)t.push(this.readByte());return t},e.prototype.write=function(e){var t,A,r,n;for(n=[],A=0,r=e.length;A<r;A++)t=e[A],n.push(this.writeByte(t));return n},e}(),va=function(){var e;function t(e){var t,A,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},A=0,r=this.tableCount;0<=r?A<r:A>r;A=0<=r?++A:--A)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var A,r,n,i,s,a,o,l,c,u,h,d,f;for(f in h=Object.keys(t).length,a=Math.log(2),c=16*Math.floor(Math.log(h)/a),i=Math.floor(c/a),l=16*h-c,(r=new ya).writeInt(this.scalarType),r.writeShort(h),r.writeShort(c),r.writeShort(i),r.writeShort(l),n=16*h,o=r.pos+n,s=null,d=[],t)for(u=t[f],r.writeString(f),r.writeInt(e(u)),r.writeInt(o),r.writeInt(u.length),d=d.concat(u),"head"===f&&(s=o),o+=u.length;o%4;)d.push(0),o++;return r.write(d),A=2981146554-e(r.data),r.pos=s+8,r.writeUInt32(A),r.data},e=function(e){var t,A,r,n;for(e=Ta.call(e);e.length%4;)e.push(0);for(r=new ya(e),A=0,t=0,n=e.length;t<n;t=t+=4)A+=r.readUInt32();return 4294967295&A},t}(),Ca={}.hasOwnProperty,xa=function(e,t){for(var A in t)Ca.call(t,A)&&(e[A]=t[A]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};ba=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var Fa=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new ya).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),Qa=function(){function e(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),c=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(a=0;a<256;++a)this.codeMap[a]=e.readByte();break;case 4:for(h=e.readUInt16(),u=h/2,e.pos+=6,n=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),e.pos+=2,f=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),o=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),l=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),r=(this.length-e.pos+this.offset)/2,s=function(){var t,A;for(A=[],a=t=0;0<=r?t<r:t>r;a=0<=r?++t:--t)A.push(e.readUInt16());return A}(),a=g=0,w=n.length;g<w;a=++g)for(p=n[a],A=m=d=f[a];d<=p?m<=p:m>=p;A=d<=p?++m:--m)0===l[a]?i=A+o[a]:0!==(i=s[l[a]/2+(A-d)-(u-a)]||0)&&(i+=o[a]),this.codeMap[A]=65535&i}e.pos=c}return e.encode=function(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T,H,O,P,D,M,j,R,V,K,G,z,q;switch(E=new ya,i=Object.keys(e).sort(function(e,t){return e-t}),t){case"macroman":for(f=0,p=function(){var e=[];for(d=0;d<256;++d)e.push(0);return e}(),m={0:0},n={},N=0,k=i.length;N<k;N++)null==m[K=e[r=i[N]]]&&(m[K]=++f),n[r]={old:e[r],new:m[e[r]]},p[r]=m[e[r]];return E.writeUInt16(1),E.writeUInt16(0),E.writeUInt32(12),E.writeUInt16(0),E.writeUInt16(262),E.writeUInt16(0),E.write(p),{charMap:n,subtable:E.data,maxGlyphID:f+1};case"unicode":for(U=[],c=[],w=0,m={},A={},g=o=null,L=0,T=i.length;L<T;L++)null==m[b=e[r=i[L]]]&&(m[b]=++w),A[r]={old:b,new:m[b]},s=m[b]-r,null!=g&&s===o||(g&&c.push(g),U.push(r),o=s),g=r;for(g&&c.push(g),c.push(65535),U.push(65535),F=2*(x=U.length),C=2*Math.pow(Math.log(x)/Math.LN2,2),u=Math.log(C/2)/Math.LN2,v=2*x-C,a=[],y=[],h=[],d=_=0,H=U.length;_<H;d=++_){if(Q=U[d],l=c[d],65535===Q){a.push(0),y.push(0);break}if(Q-(S=A[Q].new)>=32768)for(a.push(0),y.push(2*(h.length+x-d)),r=I=Q;Q<=l?I<=l:I>=l;r=Q<=l?++I:--I)h.push(A[r].new);else a.push(S-Q),y.push(0)}for(E.writeUInt16(3),E.writeUInt16(1),E.writeUInt32(12),E.writeUInt16(4),E.writeUInt16(16+8*x+2*h.length),E.writeUInt16(0),E.writeUInt16(F),E.writeUInt16(C),E.writeUInt16(u),E.writeUInt16(v),R=0,O=c.length;R<O;R++)r=c[R],E.writeUInt16(r);for(E.writeUInt16(0),V=0,P=U.length;V<P;V++)r=U[V],E.writeUInt16(r);for(G=0,D=a.length;G<D;G++)s=a[G],E.writeUInt16(s);for(z=0,M=y.length;z<M;z++)B=y[z],E.writeUInt16(B);for(q=0,j=h.length;q<j;q++)f=h[q],E.writeUInt16(f);return{charMap:A,subtable:E.data,maxGlyphID:w+1}}},e}(),Ua=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,A,r;for(e.pos=this.offset,this.version=e.readUInt16(),r=e.readUInt16(),this.tables=[],this.unicode=null,A=0;0<=r?A<r:A>r;A=0<=r?++A:--A)t=new Qa(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var A,r;return null==t&&(t="macroman"),A=Qa.encode(e,t),(r=new ya).writeUInt16(0),r.writeUInt16(1),A.table=r.data.concat(A.subtable),A},e}(),Sa=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),Ea=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,A;for(A=[],t=0;t<10;++t)A.push(e.readByte());return A}(),this.charRange=function(){var t,A;for(A=[],t=0;t<4;++t)A.push(e.readInt());return A}(),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,A;for(A=[],t=0;t<2;t=++t)A.push(e.readInt());return A}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),Na=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="post",e.prototype.parse=function(e){var t,A,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var n;for(A=e.readUInt16(),this.glyphNameIndex=[],n=0;0<=A?n<A:n>A;n=0<=A?++n:--n)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.pos<this.offset+this.length;)t=e.readByte(),r.push(this.names.push(e.readString(t)));return r;case 151552:return A=e.readUInt16(),this.offsets=e.read(A);case 262144:return this.map=function(){var t,A,r;for(r=[],n=t=0,A=this.file.maxp.numGlyphs;0<=A?t<A:t>A;n=0<=A?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),La=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},_a=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="name",e.prototype.parse=function(e){var t,A,r,n,i,s,a,o,l,c,u;for(e.pos=this.offset,e.readShort(),t=e.readShort(),s=e.readShort(),A=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)A.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(a={},n=l=0,c=A.length;l<c;n=++l)r=A[n],e.pos=r.offset,o=e.readString(r.length),i=new La(o,r),null==a[u=r.nameID]&&(a[u]=[]),a[r.nameID].push(i);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},e}(),Ia=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),ka=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,A,r,n,i,s,a;for(e.pos=this.offset,this.metrics=[],t=0,s=this.file.hhea.numberOfMetrics;0<=s?t<s:t>s;t=0<=s?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var A,n;for(n=[],t=A=0;0<=r?A<r:A>r;t=0<=r?++A:--A)n.push(e.readInt16());return n}(),this.widths=function(){var e,t,A,r;for(r=[],e=0,t=(A=this.metrics).length;e<t;e++)n=A[e],r.push(n.advance);return r}.call(this),A=this.widths[this.widths.length-1],a=[],t=i=0;0<=r?i<r:i>r;t=0<=r?++i:--i)a.push(this.widths.push(A));return a},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),Ta=[].slice,Ha=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,A,r,n,i,s,a,o,l,c;return e in this.cache?this.cache[e]:(n=this.file.loca,t=this.file.contents,A=n.indexOf(e),0===(r=n.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+A,i=(s=new ya(t.read(r))).readShort(),o=s.readShort(),c=s.readShort(),a=s.readShort(),l=s.readShort(),this.cache[e]=-1===i?new Pa(s,o,c,a,l):new Oa(s,i,o,c,a,l),this.cache[e]))},e.prototype.encode=function(e,t,A){var r,n,i,s,a;for(i=[],n=[],s=0,a=t.length;s<a;s++)r=e[t[s]],n.push(i.length),r&&(i=i.concat(r.encode(A)));return n.push(i.length),{table:i,offsets:n}},e}(),Oa=function(){function e(e,t,A,r,n,i){this.raw=e,this.numberOfContours=t,this.xMin=A,this.yMin=r,this.xMax=n,this.yMax=i,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),Pa=function(){function e(e,t,A,r,n){var i,s;for(this.raw=e,this.xMin=t,this.yMin=A,this.xMax=r,this.yMax=n,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],i=this.raw;s=i.readShort(),this.glyphOffsets.push(i.pos),this.glyphIDs.push(i.readUInt16()),32&s;)i.pos+=1&s?4:2,128&s?i.pos+=8:64&s?i.pos+=4:8&s&&(i.pos+=2)}return e.prototype.encode=function(){var e,t,A;for(t=new ya(Ta.call(this.raw.data)),e=0,A=this.glyphIDs.length;e<A;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),Da=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="loca",e.prototype.parse=function(e){var t,A;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,r;for(r=[],A=0,t=this.length;A<t;A+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,r;for(r=[],A=0,t=this.length;A<t;A+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var A=new Uint32Array(this.offsets.length),r=0,n=0,i=0;i<A.length;++i)if(A[i]=r,n<t.length&&t[n]==i){++n,A[i]=r;var s=this.offsets[i],a=this.offsets[i+1]-s;a>0&&(r+=a)}for(var o=new Array(4*A.length),l=0;l<A.length;++l)o[4*l+3]=255&A[l],o[4*l+2]=(65280&A[l])>>8,o[4*l+1]=(16711680&A[l])>>16,o[4*l]=(4278190080&A[l])>>24;return o},e}(),Ma=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,A,r,n;for(t in r=this.font.cmap.tables[0].codeMap,e={},n=this.subset)A=n[t],e[t]=r[A];return e},e.prototype.glyphsFor=function(e){var t,A,r,n,i,s,a;for(r={},i=0,s=e.length;i<s;i++)r[n=e[i]]=this.font.glyf.glyphFor(n);for(n in t=[],r)(null!=(A=r[n])?A.compound:void 0)&&t.push.apply(t,A.glyphIDs);if(t.length>0)for(n in a=this.glyphsFor(t))A=a[n],r[n]=A;return r},e.prototype.encode=function(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g;for(r in A=Ua.encode(this.generateCmap(),"unicode"),i=this.glyphsFor(e),h={0:0},g=A.charMap)h[(a=g[r]).old]=a.new;for(d in u=A.maxGlyphID,i)d in h||(h[d]=u++);return l=function(e){var t,A;for(t in A={},e)A[e[t]]=t;return A}(h),c=Object.keys(l).sort(function(e,t){return e-t}),f=function(){var e,t,A;for(A=[],e=0,t=c.length;e<t;e++)s=c[e],A.push(l[s]);return A}(),n=this.font.glyf.encode(i,f,h),o=this.font.loca.encode(n.offsets,f),p={cmap:this.font.cmap.raw(),glyf:n.table,loca:o,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&&(p["OS/2"]=this.font.os2.raw()),this.font.directory.encode(p)},e}();Wi.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(A){var r,n,i,s;if(Array.isArray(A))return"["+function(){var e,n,i;for(i=[],e=0,n=A.length;e<n;e++)r=A[e],i.push(t.convert(r));return i}().join(" ")+"]";if("string"==typeof A)return"/"+A;if(null!=A?A.isString:void 0)return"("+A+")";if(A instanceof Date)return"(D:"+e(A.getUTCFullYear(),4)+e(A.getUTCMonth(),2)+e(A.getUTCDate(),2)+e(A.getUTCHours(),2)+e(A.getUTCMinutes(),2)+e(A.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(A)){for(n in i=["<<"],A)s=A[n],i.push("/"+n+" "+t.convert(s));return i.push(">>"),i.join("\n")}return""+A},t}();var ja;exports.ELabelAlignment=void 0,(ja=exports.ELabelAlignment||(exports.ELabelAlignment={})).Top="top",ja.Left="left";
|
|
307
|
+
function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var A,r,n,i,s,a,o,l=t,c=[[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]],u=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},f=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],p=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var w=function(e){var t=e.charCodeAt(),A=t>>8,r=d[A];return void 0!==r?l[256*r+(255&t)]:252===A||253===A?"AL":p.test(A)?"L":8===A?"R":"N"},B=function(e){for(var t,A=0;A<e.length;A++){if("L"===(t=w(e.charAt(A))))return!1;if("R"===t)return!0}return!1},b=function(e,t,s,a){var o,l,c,u,h=t[a];switch(h){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(h="AN");break;case"AL":g=!0,h="R";break;case"WS":case"BN":h="N";break;case"CS":a<1||a+1>=t.length||"EN"!==(o=s[a-1])&&"AN"!==o||"EN"!==(l=t[a+1])&&"AN"!==l?h="N":g&&(l="AN"),h=l===o?l:"N";break;case"ES":h="EN"===(o=a>0?s[a-1]:"B")&&a+1<t.length&&"EN"===t[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===s[a-1]){h="EN";break}if(g){h="N";break}for(c=a+1,u=t.length;c<u&&"ET"===t[c];)c++;h=c<u&&"EN"===t[c]?"EN":"N";break;case"NSM":if(n&&!i){for(u=t.length,c=a+1;c<u&&"NSM"===t[c];)c++;if(c<u){var d=e[a],f=d>=1425&&d<=2303||64286===d;if(o=t[c],f&&("R"===o||"AL"===o)){h="R";break}}}h=a<1||"B"===(o=t[a-1])?"N":s[a-1];break;case"B":g=!1,A=!0,h=m;break;case"S":r=!0,h="N"}return h},y=function(e,t,A){var r=e.split("");return A&&v(r,A,{hiLevel:m}),r.reverse(),t&&t.reverse(),r.join("")},v=function(e,t,n){var i,s,a,o,l,d=-1,f=e.length,p=0,B=[],y=m?u:c,v=[];for(g=!1,A=!1,r=!1,s=0;s<f;s++)v[s]=w(e[s]);for(a=0;a<f;a++){if(l=p,B[a]=b(e,v,B,a),i=240&(p=y[l][h[B[a]]]),p&=15,t[a]=o=y[p][5],i>0)if(16===i){for(s=d;s<a;s++)t[s]=1;d=-1}else d=-1;if(y[p][6])-1===d&&(d=a);else if(d>-1){for(s=d;s<a;s++)t[s]=o;d=-1}"B"===v[a]&&(t[a]=0),n.hiLevel|=o}r&&function(e,t,A){for(var r=0;r<A;r++)if("S"===e[r]){t[r]=m;for(var n=r-1;n>=0&&"WS"===e[n];n--)t[n]=m}}(v,t,f)},C=function(e,t,r,n,i){if(!(i.hiLevel<e)){if(1===e&&1===m&&!A)return t.reverse(),void(r&&r.reverse());for(var s,a,o,l,c=t.length,u=0;u<c;){if(n[u]>=e){for(o=u+1;o<c&&n[o]>=e;)o++;for(l=u,a=o-1;l<a;l++,a--)s=t[l],t[l]=t[a],t[a]=s,r&&(s=r[l],r[l]=r[a],r[a]=s);u=o}u++}}},x=function(e,t,A){var r=e.split(""),n={hiLevel:m};return A||(A=[]),v(r,A,n),function(e,t,A){if(0!==A.hiLevel&&o)for(var r,n=0;n<e.length;n++)1===t[n]&&(r=f.indexOf(e[n]))>=0&&(e[n]=f[r+1])}(r,A,n),C(2,r,t,A,n),C(1,r,t,A,n),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,A){if(function(e,t){if(t)for(var A=0;A<e.length;A++)t[A]=A;void 0===i&&(i=B(e)),void 0===a&&(a=B(e))}(e,t),n||!s||a)if(n&&s&&i^a)m=i?1:0,e=y(e,t,A);else if(!n&&s&&a)m=i?1:0,e=x(e,t,A),e=y(e,t);else if(!n||i||s||a){if(n&&!s&&i^a)e=y(e,t),i?(m=0,e=x(e,t,A)):(m=1,e=x(e,t,A),e=y(e,t));else if(n&&i&&!s&&a)m=1,e=x(e,t,A),e=y(e,t);else if(!n&&!s&&i^a){var r=o;i?(m=1,e=x(e,t,A),m=0,o=!1,e=x(e,t,A),o=r):(m=0,e=x(e,t,A),e=y(e,t),m=1,o=!1,e=x(e,t,A),o=r,e=y(e,t))}}else m=0,e=x(e,t,A);else m=i?1:0,e=x(e,t,A);return e},this.__bidiEngine__.setOptions=function(e){e&&(n=e.isInputVisual,s=e.isOutputVisual,i=e.isInputRtl,a=e.isOutputRtl,o=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],A=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text;e.x,e.y;var r=e.options||{};e.mutex,r.lang;var n=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,A.setOptions(r),"[object Array]"===Object.prototype.toString.call(t)){var i=0;for(n=[],i=0;i<t.length;i+=1)"[object Array]"===Object.prototype.toString.call(t[i])?n.push([A.doBidiReorder(t[i][0]),t[i][1],t[i][2]]):n.push([A.doBidiReorder(t[i])]);e.text=n}else e.text=A.doBidiReorder(t);A.setOptions({isInputVisual:!0})}])}(Wi),Wi.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new ya(e),this.contents.pos=4,"ttcf"===t.readString(4))throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Ma(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new va(this.contents),this.head=new Fa(this),this.name=new _a(this),this.cmap=new Ua(this),this.toUnicode={},this.hhea=new Sa(this),this.maxp=new Ia(this),this.hmtx=new ka(this),this.post=new Na(this),this.os2=new Ea(this),this.loca=new Da(this),this.glyf=new Ha(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,A,r,n;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,A,r,n;for(n=[],t=0,A=(r=this.bbox).length;t<A;t++)e=r[t],n.push(Math.round(e*this.scaleFactor));return n}.call(this),this.stemV=0,this.post.exists?(A=255&(r=this.post.italic_angle),32768&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+A)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(n=this.familyClass)||2===n||3===n||4===n||5===n||7===n,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,A){var r,n,i,s;for(i=0,n=0,s=(e=""+e).length;0<=s?n<s:n>s;n=0<=s?++n:--n)r=e.charCodeAt(n),i+=this.widthOfGlyph(this.characterToGlyph(r))+A*(1e3/t)||0;return i*(t/1e3)},e.prototype.lineHeight=function(e,t){var A;return null==t&&(t=!1),A=t?this.lineGap:0,(this.ascender+A-this.decender)/1e3*e},e}();var ba,ya=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,A;for(A=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)A[t]=String.fromCharCode(this.readByte());return A.join("")},e.prototype.writeString=function(e){var t,A,r;for(r=[],t=0,A=e.length;0<=A?t<A:t>A;t=0<=A?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,A,r,n,i,s,a;return e=this.readByte(),t=this.readByte(),A=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^A)+4294967296*(255^r)+16777216*(255^n)+65536*(255^i)+256*(255^s)+(255^a)+1):72057594037927940*e+281474976710656*t+1099511627776*A+4294967296*r+16777216*n+65536*i+256*s+a},e.prototype.writeLongLong=function(e){var t,A;return t=Math.floor(e/4294967296),A=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(A>>24&255),this.writeByte(A>>16&255),this.writeByte(A>>8&255),this.writeByte(255&A)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,A;for(t=[],A=0;0<=e?A<e:A>e;A=0<=e?++A:--A)t.push(this.readByte());return t},e.prototype.write=function(e){var t,A,r,n;for(n=[],A=0,r=e.length;A<r;A++)t=e[A],n.push(this.writeByte(t));return n},e}(),va=function(){var e;function t(e){var t,A,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},A=0,r=this.tableCount;0<=r?A<r:A>r;A=0<=r?++A:--A)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var A,r,n,i,s,a,o,l,c,u,h,d,f;for(f in h=Object.keys(t).length,a=Math.log(2),c=16*Math.floor(Math.log(h)/a),i=Math.floor(c/a),l=16*h-c,(r=new ya).writeInt(this.scalarType),r.writeShort(h),r.writeShort(c),r.writeShort(i),r.writeShort(l),n=16*h,o=r.pos+n,s=null,d=[],t)for(u=t[f],r.writeString(f),r.writeInt(e(u)),r.writeInt(o),r.writeInt(u.length),d=d.concat(u),"head"===f&&(s=o),o+=u.length;o%4;)d.push(0),o++;return r.write(d),A=2981146554-e(r.data),r.pos=s+8,r.writeUInt32(A),r.data},e=function(e){var t,A,r,n;for(e=Ta.call(e);e.length%4;)e.push(0);for(r=new ya(e),A=0,t=0,n=e.length;t<n;t=t+=4)A+=r.readUInt32();return 4294967295&A},t}(),Ca={}.hasOwnProperty,xa=function(e,t){for(var A in t)Ca.call(t,A)&&(e[A]=t[A]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};ba=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var Fa=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new ya).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),Qa=function(){function e(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),c=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(a=0;a<256;++a)this.codeMap[a]=e.readByte();break;case 4:for(h=e.readUInt16(),u=h/2,e.pos+=6,n=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),e.pos+=2,f=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),o=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),l=function(){var t,A;for(A=[],a=t=0;0<=u?t<u:t>u;a=0<=u?++t:--t)A.push(e.readUInt16());return A}(),r=(this.length-e.pos+this.offset)/2,s=function(){var t,A;for(A=[],a=t=0;0<=r?t<r:t>r;a=0<=r?++t:--t)A.push(e.readUInt16());return A}(),a=g=0,w=n.length;g<w;a=++g)for(p=n[a],A=m=d=f[a];d<=p?m<=p:m>=p;A=d<=p?++m:--m)0===l[a]?i=A+o[a]:0!==(i=s[l[a]/2+(A-d)-(u-a)]||0)&&(i+=o[a]),this.codeMap[A]=65535&i}e.pos=c}return e.encode=function(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g,m,w,B,b,y,v,C,x,F,Q,U,S,E,N,L,_,I,k,T,H,O,P,D,M,j,R,V,K,z,G,q;switch(E=new ya,i=Object.keys(e).sort(function(e,t){return e-t}),t){case"macroman":for(f=0,p=function(){var e=[];for(d=0;d<256;++d)e.push(0);return e}(),m={0:0},n={},N=0,k=i.length;N<k;N++)null==m[K=e[r=i[N]]]&&(m[K]=++f),n[r]={old:e[r],new:m[e[r]]},p[r]=m[e[r]];return E.writeUInt16(1),E.writeUInt16(0),E.writeUInt32(12),E.writeUInt16(0),E.writeUInt16(262),E.writeUInt16(0),E.write(p),{charMap:n,subtable:E.data,maxGlyphID:f+1};case"unicode":for(U=[],c=[],w=0,m={},A={},g=o=null,L=0,T=i.length;L<T;L++)null==m[b=e[r=i[L]]]&&(m[b]=++w),A[r]={old:b,new:m[b]},s=m[b]-r,null!=g&&s===o||(g&&c.push(g),U.push(r),o=s),g=r;for(g&&c.push(g),c.push(65535),U.push(65535),F=2*(x=U.length),C=2*Math.pow(Math.log(x)/Math.LN2,2),u=Math.log(C/2)/Math.LN2,v=2*x-C,a=[],y=[],h=[],d=_=0,H=U.length;_<H;d=++_){if(Q=U[d],l=c[d],65535===Q){a.push(0),y.push(0);break}if(Q-(S=A[Q].new)>=32768)for(a.push(0),y.push(2*(h.length+x-d)),r=I=Q;Q<=l?I<=l:I>=l;r=Q<=l?++I:--I)h.push(A[r].new);else a.push(S-Q),y.push(0)}for(E.writeUInt16(3),E.writeUInt16(1),E.writeUInt32(12),E.writeUInt16(4),E.writeUInt16(16+8*x+2*h.length),E.writeUInt16(0),E.writeUInt16(F),E.writeUInt16(C),E.writeUInt16(u),E.writeUInt16(v),R=0,O=c.length;R<O;R++)r=c[R],E.writeUInt16(r);for(E.writeUInt16(0),V=0,P=U.length;V<P;V++)r=U[V],E.writeUInt16(r);for(z=0,D=a.length;z<D;z++)s=a[z],E.writeUInt16(s);for(G=0,M=y.length;G<M;G++)B=y[G],E.writeUInt16(B);for(q=0,j=h.length;q<j;q++)f=h[q],E.writeUInt16(f);return{charMap:A,subtable:E.data,maxGlyphID:w+1}}},e}(),Ua=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,A,r;for(e.pos=this.offset,this.version=e.readUInt16(),r=e.readUInt16(),this.tables=[],this.unicode=null,A=0;0<=r?A<r:A>r;A=0<=r?++A:--A)t=new Qa(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var A,r;return null==t&&(t="macroman"),A=Qa.encode(e,t),(r=new ya).writeUInt16(0),r.writeUInt16(1),A.table=r.data.concat(A.subtable),A},e}(),Sa=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),Ea=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,A;for(A=[],t=0;t<10;++t)A.push(e.readByte());return A}(),this.charRange=function(){var t,A;for(A=[],t=0;t<4;++t)A.push(e.readInt());return A}(),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,A;for(A=[],t=0;t<2;t=++t)A.push(e.readInt());return A}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),Na=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="post",e.prototype.parse=function(e){var t,A,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var n;for(A=e.readUInt16(),this.glyphNameIndex=[],n=0;0<=A?n<A:n>A;n=0<=A?++n:--n)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.pos<this.offset+this.length;)t=e.readByte(),r.push(this.names.push(e.readString(t)));return r;case 151552:return A=e.readUInt16(),this.offsets=e.read(A);case 262144:return this.map=function(){var t,A,r;for(r=[],n=t=0,A=this.file.maxp.numGlyphs;0<=A?t<A:t>A;n=0<=A?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),La=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},_a=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="name",e.prototype.parse=function(e){var t,A,r,n,i,s,a,o,l,c,u;for(e.pos=this.offset,e.readShort(),t=e.readShort(),s=e.readShort(),A=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)A.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(a={},n=l=0,c=A.length;l<c;n=++l)r=A[n],e.pos=r.offset,o=e.readString(r.length),i=new La(o,r),null==a[u=r.nameID]&&(a[u]=[]),a[r.nameID].push(i);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},e}(),Ia=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),ka=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,A,r,n,i,s,a;for(e.pos=this.offset,this.metrics=[],t=0,s=this.file.hhea.numberOfMetrics;0<=s?t<s:t>s;t=0<=s?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var A,n;for(n=[],t=A=0;0<=r?A<r:A>r;t=0<=r?++A:--A)n.push(e.readInt16());return n}(),this.widths=function(){var e,t,A,r;for(r=[],e=0,t=(A=this.metrics).length;e<t;e++)n=A[e],r.push(n.advance);return r}.call(this),A=this.widths[this.widths.length-1],a=[],t=i=0;0<=r?i<r:i>r;t=0<=r?++i:--i)a.push(this.widths.push(A));return a},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),Ta=[].slice,Ha=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,A,r,n,i,s,a,o,l,c;return e in this.cache?this.cache[e]:(n=this.file.loca,t=this.file.contents,A=n.indexOf(e),0===(r=n.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+A,i=(s=new ya(t.read(r))).readShort(),o=s.readShort(),c=s.readShort(),a=s.readShort(),l=s.readShort(),this.cache[e]=-1===i?new Pa(s,o,c,a,l):new Oa(s,i,o,c,a,l),this.cache[e]))},e.prototype.encode=function(e,t,A){var r,n,i,s,a;for(i=[],n=[],s=0,a=t.length;s<a;s++)r=e[t[s]],n.push(i.length),r&&(i=i.concat(r.encode(A)));return n.push(i.length),{table:i,offsets:n}},e}(),Oa=function(){function e(e,t,A,r,n,i){this.raw=e,this.numberOfContours=t,this.xMin=A,this.yMin=r,this.xMax=n,this.yMax=i,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),Pa=function(){function e(e,t,A,r,n){var i,s;for(this.raw=e,this.xMin=t,this.yMin=A,this.xMax=r,this.yMax=n,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],i=this.raw;s=i.readShort(),this.glyphOffsets.push(i.pos),this.glyphIDs.push(i.readUInt16()),32&s;)i.pos+=1&s?4:2,128&s?i.pos+=8:64&s?i.pos+=4:8&s&&(i.pos+=2)}return e.prototype.encode=function(){var e,t,A;for(t=new ya(Ta.call(this.raw.data)),e=0,A=this.glyphIDs.length;e<A;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),Da=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return xa(e,ba),e.prototype.tag="loca",e.prototype.parse=function(e){var t,A;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,r;for(r=[],A=0,t=this.length;A<t;A+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,r;for(r=[],A=0,t=this.length;A<t;A+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var A=new Uint32Array(this.offsets.length),r=0,n=0,i=0;i<A.length;++i)if(A[i]=r,n<t.length&&t[n]==i){++n,A[i]=r;var s=this.offsets[i],a=this.offsets[i+1]-s;a>0&&(r+=a)}for(var o=new Array(4*A.length),l=0;l<A.length;++l)o[4*l+3]=255&A[l],o[4*l+2]=(65280&A[l])>>8,o[4*l+1]=(16711680&A[l])>>16,o[4*l]=(4278190080&A[l])>>24;return o},e}(),Ma=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,A,r,n;for(t in r=this.font.cmap.tables[0].codeMap,e={},n=this.subset)A=n[t],e[t]=r[A];return e},e.prototype.glyphsFor=function(e){var t,A,r,n,i,s,a;for(r={},i=0,s=e.length;i<s;i++)r[n=e[i]]=this.font.glyf.glyphFor(n);for(n in t=[],r)(null!=(A=r[n])?A.compound:void 0)&&t.push.apply(t,A.glyphIDs);if(t.length>0)for(n in a=this.glyphsFor(t))A=a[n],r[n]=A;return r},e.prototype.encode=function(e,t){var A,r,n,i,s,a,o,l,c,u,h,d,f,p,g;for(r in A=Ua.encode(this.generateCmap(),"unicode"),i=this.glyphsFor(e),h={0:0},g=A.charMap)h[(a=g[r]).old]=a.new;for(d in u=A.maxGlyphID,i)d in h||(h[d]=u++);return l=function(e){var t,A;for(t in A={},e)A[e[t]]=t;return A}(h),c=Object.keys(l).sort(function(e,t){return e-t}),f=function(){var e,t,A;for(A=[],e=0,t=c.length;e<t;e++)s=c[e],A.push(l[s]);return A}(),n=this.font.glyf.encode(i,f,h),o=this.font.loca.encode(n.offsets,f),p={cmap:this.font.cmap.raw(),glyf:n.table,loca:o,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&&(p["OS/2"]=this.font.os2.raw()),this.font.directory.encode(p)},e}();Wi.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(A){var r,n,i,s;if(Array.isArray(A))return"["+function(){var e,n,i;for(i=[],e=0,n=A.length;e<n;e++)r=A[e],i.push(t.convert(r));return i}().join(" ")+"]";if("string"==typeof A)return"/"+A;if(null!=A?A.isString:void 0)return"("+A+")";if(A instanceof Date)return"(D:"+e(A.getUTCFullYear(),4)+e(A.getUTCMonth(),2)+e(A.getUTCDate(),2)+e(A.getUTCHours(),2)+e(A.getUTCMinutes(),2)+e(A.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(A)){for(n in i=["<<"],A)s=A[n],i.push("/"+n+" "+t.convert(s));return i.push(">>"),i.join("\n")}return""+A},t}();var ja;exports.ELabelAlignment=void 0,(ja=exports.ELabelAlignment||(exports.ELabelAlignment={})).Top="top",ja.Left="left";
|
|
308
308
|
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
309
|
-
const{entries:Ra,setPrototypeOf:Va,isFrozen:Ka,getPrototypeOf:Ga,getOwnPropertyDescriptor:za}=Object;let{freeze:qa,seal:Wa,create:Xa}=Object,{apply:Ya,construct:Ja}="undefined"!=typeof Reflect&&Reflect;qa||(qa=function(e){return e}),Wa||(Wa=function(e){return e}),Ya||(Ya=function(e,t){for(var A=arguments.length,r=new Array(A>2?A-2:0),n=2;n<A;n++)r[n-2]=arguments[n];return e.apply(t,r)}),Ja||(Ja=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),r=1;r<t;r++)A[r-1]=arguments[r];return new e(...A)});const $a=fo(Array.prototype.forEach),Za=fo(Array.prototype.lastIndexOf),eo=fo(Array.prototype.pop),to=fo(Array.prototype.push),Ao=fo(Array.prototype.splice),ro=fo(String.prototype.toLowerCase),no=fo(String.prototype.toString),io=fo(String.prototype.match),so=fo(String.prototype.replace),ao=fo(String.prototype.indexOf),oo=fo(String.prototype.trim),lo=fo(Object.prototype.hasOwnProperty),co=fo(RegExp.prototype.test),uo=(ho=TypeError,function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];return Ja(ho,t)});var ho;function fo(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var A=arguments.length,r=new Array(A>1?A-1:0),n=1;n<A;n++)r[n-1]=arguments[n];return Ya(e,t,r)}}function po(e,t){let A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ro;Va&&Va(e,null);let r=t.length;for(;r--;){let n=t[r];if("string"==typeof n){const e=A(n);e!==n&&(Ka(t)||(t[r]=e),n=e)}e[n]=!0}return e}function go(e){for(let t=0;t<e.length;t++){lo(e,t)||(e[t]=null)}return e}function mo(e){const t=Xa(null);for(const[A,r]of Ra(e)){lo(e,A)&&(Array.isArray(r)?t[A]=go(r):r&&"object"==typeof r&&r.constructor===Object?t[A]=mo(r):t[A]=r)}return t}function wo(e,t){for(;null!==e;){const A=za(e,t);if(A){if(A.get)return fo(A.get);if("function"==typeof A.value)return fo(A.value)}e=Ga(e)}return function(){return null}}const Bo=qa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bo=qa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),yo=qa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vo=qa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Co=qa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xo=qa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fo=qa(["#text"]),Qo=qa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Uo=qa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=qa(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Eo=qa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),No=Wa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Lo=Wa(/<%[\w\W]*|[\w\W]*%>/gm),_o=Wa(/\$\{[\w\W]*/gm),Io=Wa(/^data-[\-\w.\u00B7-\uFFFF]+$/),ko=Wa(/^aria-[\-\w]+$/),To=Wa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ho=Wa(/^(?:\w+script|data):/i),Oo=Wa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Po=Wa(/^html$/i),Do=Wa(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mo=Object.freeze({__proto__:null,ARIA_ATTR:ko,ATTR_WHITESPACE:Oo,CUSTOM_ELEMENT:Do,DATA_ATTR:Io,DOCTYPE_NAME:Po,ERB_EXPR:Lo,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:Ho,MUSTACHE_EXPR:No,TMPLIT_EXPR:_o});const jo=1,Ro=3,Vo=7,Ko=8,Go=9,zo=function(){return"undefined"==typeof window?null:window};var qo=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zo();const A=t=>e(t);if(A.version="3.3.1",A.removed=[],!t||!t.document||t.document.nodeType!==Go||!t.Element)return A.isSupported=!1,A;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,p=l.prototype,g=wo(p,"cloneNode"),m=wo(p,"remove"),w=wo(p,"nextSibling"),B=wo(p,"childNodes"),b=wo(p,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let y,v="";const{implementation:C,createNodeIterator:x,createDocumentFragment:F,getElementsByTagName:Q}=r,{importNode:U}=n;let S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};A.isSupported="function"==typeof Ra&&"function"==typeof b&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:E,ERB_EXPR:N,TMPLIT_EXPR:L,DATA_ATTR:_,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:T,CUSTOM_ELEMENT:H}=Mo;let{IS_ALLOWED_URI:O}=Mo,P=null;const D=po({},[...Bo,...bo,...yo,...Co,...Fo]);let M=null;const j=po({},[...Qo,...Uo,...So,...Eo]);let R=Object.seal(Xa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,K=null;const G=Object.seal(Xa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let z=!0,q=!0,W=!1,X=!0,Y=!1,J=!0,$=!1,Z=!1,ee=!1,te=!1,Ae=!1,re=!1,ne=!0,ie=!1,se=!0,ae=!1,oe={},le=null;const ce=po({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const he=po({},["audio","video","img","source","image","track"]);let de=null;const fe=po({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let we=me,Be=!1,be=null;const ye=po({},[pe,ge,me],no);let ve=po({},["mi","mo","mn","ms","mtext"]),Ce=po({},["annotation-xml"]);const xe=po({},["title","style","font","a","script"]);let Fe=null;const Qe=["application/xhtml+xml","text/html"];let Ue=null,Se=null;const Ee=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Le=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=mo(e),Fe=-1===Qe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ue="application/xhtml+xml"===Fe?no:ro,P=lo(e,"ALLOWED_TAGS")?po({},e.ALLOWED_TAGS,Ue):D,M=lo(e,"ALLOWED_ATTR")?po({},e.ALLOWED_ATTR,Ue):j,be=lo(e,"ALLOWED_NAMESPACES")?po({},e.ALLOWED_NAMESPACES,no):ye,de=lo(e,"ADD_URI_SAFE_ATTR")?po(mo(fe),e.ADD_URI_SAFE_ATTR,Ue):fe,ue=lo(e,"ADD_DATA_URI_TAGS")?po(mo(he),e.ADD_DATA_URI_TAGS,Ue):he,le=lo(e,"FORBID_CONTENTS")?po({},e.FORBID_CONTENTS,Ue):ce,V=lo(e,"FORBID_TAGS")?po({},e.FORBID_TAGS,Ue):mo({}),K=lo(e,"FORBID_ATTR")?po({},e.FORBID_ATTR,Ue):mo({}),oe=!!lo(e,"USE_PROFILES")&&e.USE_PROFILES,z=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,J=!1!==e.SAFE_FOR_XML,$=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||To,we=e.NAMESPACE||me,ve=e.MATHML_TEXT_INTEGRATION_POINTS||ve,Ce=e.HTML_INTEGRATION_POINTS||Ce,R=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(R.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(q=!1),Ae&&(te=!0),oe&&(P=po({},Fo),M=[],!0===oe.html&&(po(P,Bo),po(M,Qo)),!0===oe.svg&&(po(P,bo),po(M,Uo),po(M,Eo)),!0===oe.svgFilters&&(po(P,yo),po(M,Uo),po(M,Eo)),!0===oe.mathMl&&(po(P,Co),po(M,So),po(M,Eo))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?G.tagCheck=e.ADD_TAGS:(P===D&&(P=mo(P)),po(P,e.ADD_TAGS,Ue))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?G.attributeCheck=e.ADD_ATTR:(M===j&&(M=mo(M)),po(M,e.ADD_ATTR,Ue))),e.ADD_URI_SAFE_ATTR&&po(de,e.ADD_URI_SAFE_ATTR,Ue),e.FORBID_CONTENTS&&(le===ce&&(le=mo(le)),po(le,e.FORBID_CONTENTS,Ue)),e.ADD_FORBID_CONTENTS&&(le===ce&&(le=mo(le)),po(le,e.ADD_FORBID_CONTENTS,Ue)),se&&(P["#text"]=!0),$&&po(P,["html","head","body"]),P.table&&(po(P,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw uo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw uo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,v=y.createHTML("")}else void 0===y&&(y=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let A=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(A=t.getAttribute(r));const n="dompurify"+(A?"#"+A:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}}(f,i)),null!==y&&"string"==typeof v&&(v=y.createHTML(""));qa&&qa(e),Se=e}},_e=po({},[...bo,...yo,...vo]),Ie=po({},[...Co,...xo]),ke=function(e){to(A.removed,{element:e});try{b(e).removeChild(e)}catch(t){m(e)}},Te=function(e,t){try{to(A.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){to(A.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||Ae)try{ke(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},He=function(e){let t=null,A=null;if(ee)e="<remove></remove>"+e;else{const t=io(e,/^[\r\n\t ]+/);A=t&&t[0]}"application/xhtml+xml"===Fe&&we===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const n=y?y.createHTML(e):e;if(we===me)try{t=(new d).parseFromString(n,Fe)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(we,"template",null);try{t.documentElement.innerHTML=Be?v:n}catch(e){}}const i=t.body||t.documentElement;return e&&A&&i.insertBefore(r.createTextNode(A),i.childNodes[0]||null),we===me?Q.call(t,$?"html":"body")[0]:$?t.documentElement:i},Oe=function(e){return x.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pe=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},De=function(e){return"function"==typeof o&&e instanceof o};function Me(e,t,r){$a(e,e=>{e.call(A,t,r,Se)})}const je=function(e){let t=null;if(Me(S.beforeSanitizeElements,e,null),Pe(e))return ke(e),!0;const r=Ue(e.nodeName);if(Me(S.uponSanitizeElement,e,{tagName:r,allowedTags:P}),J&&e.hasChildNodes()&&!De(e.firstElementChild)&&co(/<[/\w!]/g,e.innerHTML)&&co(/<[/\w!]/g,e.textContent))return ke(e),!0;if(e.nodeType===Vo)return ke(e),!0;if(J&&e.nodeType===Ko&&co(/<[/\w]/g,e.data))return ke(e),!0;if(!(G.tagCheck instanceof Function&&G.tagCheck(r))&&(!P[r]||V[r])){if(!V[r]&&Ve(r)){if(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,r))return!1;if(R.tagNameCheck instanceof Function&&R.tagNameCheck(r))return!1}if(se&&!le[r]){const t=b(e)||e.parentNode,A=B(e)||e.childNodes;if(A&&t){for(let r=A.length-1;r>=0;--r){const n=g(A[r],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,w(e))}}}return ke(e),!0}return e instanceof l&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:we,tagName:"template"});const A=ro(e.tagName),r=ro(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===A:t.namespaceURI===pe?"svg"===A&&("annotation-xml"===r||ve[r]):Boolean(_e[A]):e.namespaceURI===pe?t.namespaceURI===me?"math"===A:t.namespaceURI===ge?"math"===A&&Ce[r]:Boolean(Ie[A]):e.namespaceURI===me?!(t.namespaceURI===ge&&!Ce[r])&&!(t.namespaceURI===pe&&!ve[r])&&!Ie[A]&&(xe[A]||!_e[A]):!("application/xhtml+xml"!==Fe||!be[e.namespaceURI]))}(e)?(ke(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!co(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Ro&&(t=e.textContent,$a([E,N,L],e=>{t=so(t,e," ")}),e.textContent!==t&&(to(A.removed,{element:e.cloneNode()}),e.textContent=t)),Me(S.afterSanitizeElements,e,null),!1):(ke(e),!0)},Re=function(e,t,A){if(ne&&("id"===t||"name"===t)&&(A in r||A in Ee))return!1;if(q&&!K[t]&&co(_,t));else if(z&&co(I,t));else if(G.attributeCheck instanceof Function&&G.attributeCheck(t,e));else if(!M[t]||K[t]){if(!(Ve(e)&&(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,e)||R.tagNameCheck instanceof Function&&R.tagNameCheck(e))&&(R.attributeNameCheck instanceof RegExp&&co(R.attributeNameCheck,t)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(t,e))||"is"===t&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,A)||R.tagNameCheck instanceof Function&&R.tagNameCheck(A))))return!1}else if(de[t]);else if(co(O,so(A,T,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ao(A,"data:")||!ue[e]){if(W&&!co(k,so(A,T,"")));else if(A)return!1}else;return!0},Ve=function(e){return"annotation-xml"!==e&&io(e,H)},Ke=function(e){Me(S.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Pe(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let n=t.length;for(;n--;){const i=t[n],{name:s,namespaceURI:a,value:o}=i,l=Ue(s),c=o;let u="value"===s?c:oo(c);if(r.attrName=l,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Me(S.uponSanitizeAttribute,e,r),u=r.attrValue,!ie||"id"!==l&&"name"!==l||(Te(s,e),u="user-content-"+u),J&&co(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Te(s,e);continue}if("attributename"===l&&io(u,"href")){Te(s,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Te(s,e);continue}if(!X&&co(/\/>/i,u)){Te(s,e);continue}Y&&$a([E,N,L],e=>{u=so(u,e," ")});const h=Ue(e.nodeName);if(Re(h,l,u)){if(y&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(h,l)){case"TrustedHTML":u=y.createHTML(u);break;case"TrustedScriptURL":u=y.createScriptURL(u)}if(u!==c)try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),Pe(e)?ke(e):eo(A.removed)}catch(t){Te(s,e)}}else Te(s,e)}Me(S.afterSanitizeAttributes,e,null)},Ge=function e(t){let A=null;const r=Oe(t);for(Me(S.beforeSanitizeShadowDOM,t,null);A=r.nextNode();)Me(S.uponSanitizeShadowNode,A,null),je(A),Ke(A),A.content instanceof s&&e(A.content);Me(S.afterSanitizeShadowDOM,t,null)};return A.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Be=!e,Be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!De(e)){if("function"!=typeof e.toString)throw uo("toString is not a function");if("string"!=typeof(e=e.toString()))throw uo("dirty is not a string, aborting")}if(!A.isSupported)return e;if(Z||Le(t),A.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ue(e.nodeName);if(!P[t]||V[t])throw uo("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof o)r=He("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===jo&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!Y&&!$&&-1===e.indexOf("<"))return y&&re?y.createHTML(e):e;if(r=He(e),!r)return te?null:re?v:""}r&&ee&&ke(r.firstChild);const c=Oe(ae?e:r);for(;a=c.nextNode();)je(a),Ke(a),a.content instanceof s&&Ge(a.content);if(ae)return e;if(te){if(Ae)for(l=F.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(M.shadowroot||M.shadowrootmode)&&(l=U.call(n,l,!0)),l}let u=$?r.outerHTML:r.innerHTML;return $&&P["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&co(Po,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),Y&&$a([E,N,L],e=>{u=so(u,e," ")}),y&&re?y.createHTML(u):u},A.setConfig=function(){Le(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},A.clearConfig=function(){Se=null,Z=!1},A.isValidAttribute=function(e,t,A){Se||Le({});const r=Ue(e),n=Ue(t);return Re(r,n,A)},A.addHook=function(e,t){"function"==typeof t&&to(S[e],t)},A.removeHook=function(e,t){if(void 0!==t){const A=Za(S[e],t);return-1===A?void 0:Ao(S[e],A,1)[0]}return eo(S[e])},A.removeHooks=function(e){S[e]=[]},A.removeAllHooks=function(){S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},A}(),Wo=Object.freeze({__proto__:null,default:qo}),Xo=function(e){return e&&e.Math===Math&&e},Yo=Xo("object"==typeof globalThis&&globalThis)||Xo("object"==typeof window&&window)||Xo("object"==typeof self&&self)||Xo("object"==typeof o&&o)||Xo("object"==typeof o&&o)||function(){return this}()||Function("return this")(),Jo={},$o=function(e){try{return!!e()}catch(e){return!0}},Zo=!$o(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),el=!$o(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),tl=el,Al=Function.prototype.call,rl=tl?Al.bind(Al):function(){return Al.apply(Al,arguments)},nl={},il={}.propertyIsEnumerable,sl=Object.getOwnPropertyDescriptor,al=sl&&!il.call({1:2},1);nl.f=al?function(e){var t=sl(this,e);return!!t&&t.enumerable}:il;var ol,ll,cl=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ul=el,hl=Function.prototype,dl=hl.call,fl=ul&&hl.bind.bind(dl,dl),pl=ul?fl:function(e){return function(){return dl.apply(e,arguments)}},gl=pl,ml=gl({}.toString),wl=gl("".slice),Bl=function(e){return wl(ml(e),8,-1)},bl=$o,yl=Bl,vl=Object,Cl=pl("".split),xl=bl(function(){return!vl("z").propertyIsEnumerable(0)})?function(e){return"String"===yl(e)?Cl(e,""):vl(e)}:vl,Fl=function(e){return null==e},Ql=Fl,Ul=TypeError,Sl=function(e){if(Ql(e))throw new Ul("Can't call method on "+e);return e},El=xl,Nl=Sl,Ll=function(e){return El(Nl(e))},_l="object"==typeof document&&document.all,Il=void 0===_l&&void 0!==_l?function(e){return"function"==typeof e||e===_l}:function(e){return"function"==typeof e},kl=Il,Tl=function(e){return"object"==typeof e?null!==e:kl(e)},Hl=Yo,Ol=Il,Pl=function(e,t){return arguments.length<2?(A=Hl[e],Ol(A)?A:void 0):Hl[e]&&Hl[e][t];var A},Dl=pl({}.isPrototypeOf),Ml=Yo.navigator,jl=Ml&&Ml.userAgent,Rl=jl?String(jl):"",Vl=Yo,Kl=Rl,Gl=Vl.process,zl=Vl.Deno,ql=Gl&&Gl.versions||zl&&zl.version,Wl=ql&&ql.v8;Wl&&(ll=(ol=Wl.split("."))[0]>0&&ol[0]<4?1:+(ol[0]+ol[1])),!ll&&Kl&&(!(ol=Kl.match(/Edge\/(\d+)/))||ol[1]>=74)&&(ol=Kl.match(/Chrome\/(\d+)/))&&(ll=+ol[1]);var Xl=ll,Yl=Xl,Jl=$o,$l=Yo.String,Zl=!!Object.getOwnPropertySymbols&&!Jl(function(){var e=Symbol("symbol detection");return!$l(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Yl&&Yl<41}),ec=Zl&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tc=Pl,Ac=Il,rc=Dl,nc=Object,ic=ec?function(e){return"symbol"==typeof e}:function(e){var t=tc("Symbol");return Ac(t)&&rc(t.prototype,nc(e))},sc=String,ac=function(e){try{return sc(e)}catch(e){return"Object"}},oc=Il,lc=ac,cc=TypeError,uc=function(e){if(oc(e))return e;throw new cc(lc(e)+" is not a function")},hc=uc,dc=Fl,fc=function(e,t){var A=e[t];return dc(A)?void 0:hc(A)},pc=rl,gc=Il,mc=Tl,wc=TypeError,Bc={exports:{}},bc=Yo,yc=Object.defineProperty,vc=function(e,t){try{yc(bc,e,{value:t,configurable:!0,writable:!0})}catch(A){bc[e]=t}return t},Cc=Yo,xc=vc,Fc="__core-js_shared__",Qc=Bc.exports=Cc[Fc]||xc(Fc,{});(Qc.versions||(Qc.versions=[])).push({version:"3.48.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Uc=Bc.exports,Sc=Uc,Ec=function(e,t){return Sc[e]||(Sc[e]=t||{})},Nc=Sl,Lc=Object,_c=function(e){return Lc(Nc(e))},Ic=_c,kc=pl({}.hasOwnProperty),Tc=Object.hasOwn||function(e,t){return kc(Ic(e),t)},Hc=pl,Oc=0,Pc=Math.random(),Dc=Hc(1.1.toString),Mc=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Dc(++Oc+Pc,36)},jc=Ec,Rc=Tc,Vc=Mc,Kc=Zl,Gc=ec,zc=Yo.Symbol,qc=jc("wks"),Wc=Gc?zc.for||zc:zc&&zc.withoutSetter||Vc,Xc=function(e){return Rc(qc,e)||(qc[e]=Kc&&Rc(zc,e)?zc[e]:Wc("Symbol."+e)),qc[e]},Yc=rl,Jc=Tl,$c=ic,Zc=fc,eu=function(e,t){var A,r;if("string"===t&&gc(A=e.toString)&&!mc(r=pc(A,e)))return r;if(gc(A=e.valueOf)&&!mc(r=pc(A,e)))return r;if("string"!==t&&gc(A=e.toString)&&!mc(r=pc(A,e)))return r;throw new wc("Can't convert object to primitive value")},tu=TypeError,Au=Xc("toPrimitive"),ru=function(e,t){if(!Jc(e)||$c(e))return e;var A,r=Zc(e,Au);if(r){if(void 0===t&&(t="default"),A=Yc(r,e,t),!Jc(A)||$c(A))return A;throw new tu("Can't convert object to primitive value")}return void 0===t&&(t="number"),eu(e,t)},nu=ic,iu=function(e){var t=ru(e,"string");return nu(t)?t:t+""},su=Tl,au=Yo.document,ou=su(au)&&su(au.createElement),lu=function(e){return ou?au.createElement(e):{}},cu=lu,uu=!Zo&&!$o(function(){return 7!==Object.defineProperty(cu("div"),"a",{get:function(){return 7}}).a}),hu=Zo,du=rl,fu=nl,pu=cl,gu=Ll,mu=iu,wu=Tc,Bu=uu,bu=Object.getOwnPropertyDescriptor;Jo.f=hu?bu:function(e,t){if(e=gu(e),t=mu(t),Bu)try{return bu(e,t)}catch(e){}if(wu(e,t))return pu(!du(fu.f,e,t),e[t])};var yu={},vu=Zo&&$o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Cu=Tl,xu=String,Fu=TypeError,Qu=function(e){if(Cu(e))return e;throw new Fu(xu(e)+" is not an object")},Uu=Zo,Su=uu,Eu=vu,Nu=Qu,Lu=iu,_u=TypeError,Iu=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,Tu="enumerable",Hu="configurable",Ou="writable";yu.f=Uu?Eu?function(e,t,A){if(Nu(e),t=Lu(t),Nu(A),"function"==typeof e&&"prototype"===t&&"value"in A&&Ou in A&&!A[Ou]){var r=ku(e,t);r&&r[Ou]&&(e[t]=A.value,A={configurable:Hu in A?A[Hu]:r[Hu],enumerable:Tu in A?A[Tu]:r[Tu],writable:!1})}return Iu(e,t,A)}:Iu:function(e,t,A){if(Nu(e),t=Lu(t),Nu(A),Su)try{return Iu(e,t,A)}catch(e){}if("get"in A||"set"in A)throw new _u("Accessors not supported");return"value"in A&&(e[t]=A.value),e};var Pu=yu,Du=cl,Mu=Zo?function(e,t,A){return Pu.f(e,t,Du(1,A))}:function(e,t,A){return e[t]=A,e},ju={exports:{}},Ru=Zo,Vu=Tc,Ku=Function.prototype,Gu=Ru&&Object.getOwnPropertyDescriptor,zu=Vu(Ku,"name"),qu={EXISTS:zu,PROPER:zu&&"something"===function(){}.name,CONFIGURABLE:zu&&(!Ru||Ru&&Gu(Ku,"name").configurable)},Wu=Il,Xu=Uc,Yu=pl(Function.toString);Wu(Xu.inspectSource)||(Xu.inspectSource=function(e){return Yu(e)});var Ju,$u,Zu,eh=Xu.inspectSource,th=Il,Ah=Yo.WeakMap,rh=th(Ah)&&/native code/.test(String(Ah)),nh=Mc,ih=Ec("keys"),sh=function(e){return ih[e]||(ih[e]=nh(e))},ah={},oh=rh,lh=Yo,ch=Tl,uh=Mu,hh=Tc,dh=Uc,fh=sh,ph=ah,gh="Object already initialized",mh=lh.TypeError,wh=lh.WeakMap;if(oh||dh.state){var Bh=dh.state||(dh.state=new wh);Bh.get=Bh.get,Bh.has=Bh.has,Bh.set=Bh.set,Ju=function(e,t){if(Bh.has(e))throw new mh(gh);return t.facade=e,Bh.set(e,t),t},$u=function(e){return Bh.get(e)||{}},Zu=function(e){return Bh.has(e)}}else{var bh=fh("state");ph[bh]=!0,Ju=function(e,t){if(hh(e,bh))throw new mh(gh);return t.facade=e,uh(e,bh,t),t},$u=function(e){return hh(e,bh)?e[bh]:{}},Zu=function(e){return hh(e,bh)}}var yh={set:Ju,get:$u,has:Zu,enforce:function(e){return Zu(e)?$u(e):Ju(e,{})},getterFor:function(e){return function(t){var A;if(!ch(t)||(A=$u(t)).type!==e)throw new mh("Incompatible receiver, "+e+" required");return A}}},vh=pl,Ch=$o,xh=Il,Fh=Tc,Qh=Zo,Uh=qu.CONFIGURABLE,Sh=eh,Eh=yh.enforce,Nh=yh.get,Lh=String,_h=Object.defineProperty,Ih=vh("".slice),kh=vh("".replace),Th=vh([].join),Hh=Qh&&!Ch(function(){return 8!==_h(function(){},"length",{value:8}).length}),Oh=String(String).split("String"),Ph=ju.exports=function(e,t,A){"Symbol("===Ih(Lh(t),0,7)&&(t="["+kh(Lh(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),A&&A.getter&&(t="get "+t),A&&A.setter&&(t="set "+t),(!Fh(e,"name")||Uh&&e.name!==t)&&(Qh?_h(e,"name",{value:t,configurable:!0}):e.name=t),Hh&&A&&Fh(A,"arity")&&e.length!==A.arity&&_h(e,"length",{value:A.arity});try{A&&Fh(A,"constructor")&&A.constructor?Qh&&_h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=Eh(e);return Fh(r,"source")||(r.source=Th(Oh,"string"==typeof t?t:"")),e};Function.prototype.toString=Ph(function(){return xh(this)&&Nh(this).source||Sh(this)},"toString");var Dh=ju.exports,Mh=Il,jh=yu,Rh=Dh,Vh=vc,Kh=function(e,t,A,r){r||(r={});var n=r.enumerable,i=void 0!==r.name?r.name:t;if(Mh(A)&&Rh(A,i,r),r.global)n?e[t]=A:Vh(t,A);else{try{r.unsafe?e[t]&&(n=!0):delete e[t]}catch(e){}n?e[t]=A:jh.f(e,t,{value:A,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Gh={},zh=Math.ceil,qh=Math.floor,Wh=Math.trunc||function(e){var t=+e;return(t>0?qh:zh)(t)},Xh=Wh,Yh=function(e){var t=+e;return t!=t||0===t?0:Xh(t)},Jh=Yh,$h=Math.max,Zh=Math.min,ed=Yh,td=Math.min,Ad=function(e){var t=ed(e);return t>0?td(t,9007199254740991):0},rd=Ad,nd=function(e){return rd(e.length)},id=Ll,sd=function(e,t){var A=Jh(e);return A<0?$h(A+t,0):Zh(A,t)},ad=nd,od=function(e){return function(t,A,r){var n=id(t),i=ad(n);if(0===i)return!e&&-1;var s,a=sd(r,i);if(e&&A!=A){for(;i>a;)if((s=n[a++])!=s)return!0}else for(;i>a;a++)if((e||a in n)&&n[a]===A)return e||a||0;return!e&&-1}},ld={includes:od(!0),indexOf:od(!1)},cd=Tc,ud=Ll,hd=ld.indexOf,dd=ah,fd=pl([].push),pd=function(e,t){var A,r=ud(e),n=0,i=[];for(A in r)!cd(dd,A)&&cd(r,A)&&fd(i,A);for(;t.length>n;)cd(r,A=t[n++])&&(~hd(i,A)||fd(i,A));return i},gd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],md=pd,wd=gd.concat("length","prototype");Gh.f=Object.getOwnPropertyNames||function(e){return md(e,wd)};var Bd={};Bd.f=Object.getOwnPropertySymbols;var bd=Pl,yd=Gh,vd=Bd,Cd=Qu,xd=pl([].concat),Fd=bd("Reflect","ownKeys")||function(e){var t=yd.f(Cd(e)),A=vd.f;return A?xd(t,A(e)):t},Qd=Tc,Ud=Fd,Sd=Jo,Ed=yu,Nd=$o,Ld=Il,_d=/#|\.prototype\./,Id=function(e,t){var A=Td[kd(e)];return A===Od||A!==Hd&&(Ld(t)?Nd(t):!!t)},kd=Id.normalize=function(e){return String(e).replace(_d,".").toLowerCase()},Td=Id.data={},Hd=Id.NATIVE="N",Od=Id.POLYFILL="P",Pd=Id,Dd=Yo,Md=Jo.f,jd=Mu,Rd=Kh,Vd=vc,Kd=function(e,t,A){for(var r=Ud(t),n=Ed.f,i=Sd.f,s=0;s<r.length;s++){var a=r[s];Qd(e,a)||A&&Qd(A,a)||n(e,a,i(t,a))}},Gd=Pd,zd=function(e,t){var A,r,n,i,s,a=e.target,o=e.global,l=e.stat;if(A=o?Dd:l?Dd[a]||Vd(a,{}):Dd[a]&&Dd[a].prototype)for(r in t){if(i=t[r],n=e.dontCallGetSet?(s=Md(A,r))&&s.value:A[r],!Gd(o?r:a+(l?".":"#")+r,e.forced)&&void 0!==n){if(typeof i==typeof n)continue;Kd(i,n)}(e.sham||n&&n.sham)&&jd(i,"sham",!0),Rd(A,r,i,e)}},qd=Yo,Wd=Rl,Xd=Bl,Yd=function(e){return Wd.slice(0,e.length)===e},Jd=Yd("Bun/")?"BUN":Yd("Cloudflare-Workers")?"CLOUDFLARE":Yd("Deno/")?"DENO":Yd("Node.js/")?"NODE":qd.Bun&&"string"==typeof Bun.version?"BUN":qd.Deno&&"object"==typeof Deno.version?"DENO":"process"===Xd(qd.process)?"NODE":qd.window&&qd.document?"BROWSER":"REST",$d="NODE"===Jd,Zd=Yo,ef=pl,tf=uc,Af=Tl,rf=function(e){return Af(e)||null===e},nf=String,sf=TypeError,af=function(e,t,A){try{return ef(tf(Object.getOwnPropertyDescriptor(e,t)[A]))}catch(e){}},of=Tl,lf=Sl,cf=function(e){if(rf(e))return e;throw new sf("Can't set "+nf(e)+" as a prototype")},uf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,A={};try{(e=af(Object.prototype,"__proto__","set"))(A,[]),t=A instanceof Array}catch(e){}return function(A,r){return lf(A),cf(r),of(A)?(t?e(A,r):A.__proto__=r,A):A}}():void 0),hf=yu.f,df=Tc,ff=Xc("toStringTag"),pf=function(e,t,A){e&&!A&&(e=e.prototype),e&&!df(e,ff)&&hf(e,ff,{configurable:!0,value:t})},gf=Dh,mf=yu,wf=Pl,Bf=function(e,t,A){return A.get&&gf(A.get,t,{getter:!0}),A.set&&gf(A.set,t,{setter:!0}),mf.f(e,t,A)},bf=Zo,yf=Xc("species"),vf=Dl,Cf=TypeError,xf={};xf[Xc("toStringTag")]="z";var Ff="[object z]"===String(xf),Qf=Il,Uf=Bl,Sf=Xc("toStringTag"),Ef=Object,Nf="Arguments"===Uf(function(){return arguments}()),Lf=Ff?Uf:function(e){var t,A,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(A=function(e,t){try{return e[t]}catch(e){}}(t=Ef(e),Sf))?A:Nf?Uf(t):"Object"===(r=Uf(t))&&Qf(t.callee)?"Arguments":r},_f=pl,If=$o,kf=Il,Tf=Lf,Hf=eh,Of=function(){},Pf=Pl("Reflect","construct"),Df=/^\s*(?:class|function)\b/,Mf=_f(Df.exec),jf=!Df.test(Of),Rf=function(e){if(!kf(e))return!1;try{return Pf(Of,[],e),!0}catch(e){return!1}},Vf=function(e){if(!kf(e))return!1;switch(Tf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jf||!!Mf(Df,Hf(e))}catch(e){return!0}};Vf.sham=!0;var Kf,Gf,zf,qf,Wf=!Pf||If(function(){var e;return Rf(Rf.call)||!Rf(Object)||!Rf(function(){e=!0})||e})?Vf:Rf,Xf=Wf,Yf=ac,Jf=TypeError,$f=Qu,Zf=function(e){if(Xf(e))return e;throw new Jf(Yf(e)+" is not a constructor")},ep=Fl,tp=Xc("species"),Ap=function(e,t){var A,r=$f(e).constructor;return void 0===r||ep(A=$f(r)[tp])?t:Zf(A)},rp=el,np=Function.prototype,ip=np.apply,sp=np.call,ap="object"==typeof Reflect&&Reflect.apply||(rp?sp.bind(ip):function(){return sp.apply(ip,arguments)}),op=Bl,lp=pl,cp=function(e){if("Function"===op(e))return lp(e)},up=uc,hp=el,dp=cp(cp.bind),fp=function(e,t){return up(e),void 0===t?e:hp?dp(e,t):function(){return e.apply(t,arguments)}},pp=Pl("document","documentElement"),gp=pl([].slice),mp=TypeError,wp=/(?:ipad|iphone|ipod).*applewebkit/i.test(Rl),Bp=Yo,bp=ap,yp=fp,vp=Il,Cp=Tc,xp=$o,Fp=pp,Qp=gp,Up=lu,Sp=function(e,t){if(e<t)throw new mp("Not enough arguments");return e},Ep=wp,Np=$d,Lp=Bp.setImmediate,_p=Bp.clearImmediate,Ip=Bp.process,kp=Bp.Dispatch,Tp=Bp.Function,Hp=Bp.MessageChannel,Op=Bp.String,Pp=0,Dp={},Mp="onreadystatechange";xp(function(){Kf=Bp.location});var jp=function(e){if(Cp(Dp,e)){var t=Dp[e];delete Dp[e],t()}},Rp=function(e){return function(){jp(e)}},Vp=function(e){jp(e.data)},Kp=function(e){Bp.postMessage(Op(e),Kf.protocol+"//"+Kf.host)};Lp&&_p||(Lp=function(e){Sp(arguments.length,1);var t=vp(e)?e:Tp(e),A=Qp(arguments,1);return Dp[++Pp]=function(){bp(t,void 0,A)},Gf(Pp),Pp},_p=function(e){delete Dp[e]},Np?Gf=function(e){Ip.nextTick(Rp(e))}:kp&&kp.now?Gf=function(e){kp.now(Rp(e))}:Hp&&!Ep?(qf=(zf=new Hp).port2,zf.port1.onmessage=Vp,Gf=yp(qf.postMessage,qf)):Bp.addEventListener&&vp(Bp.postMessage)&&!Bp.importScripts&&Kf&&"file:"!==Kf.protocol&&!xp(Kp)?(Gf=Kp,Bp.addEventListener("message",Vp,!1)):Gf=Mp in Up("script")?function(e){Fp.appendChild(Up("script"))[Mp]=function(){Fp.removeChild(this),jp(e)}}:function(e){setTimeout(Rp(e),0)});var Gp={set:Lp,clear:_p},zp=Yo,qp=Zo,Wp=Object.getOwnPropertyDescriptor,Xp=function(){this.head=null,this.tail=null};Xp.prototype={add:function(e){var t={item:e,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Yp,Jp,$p,Zp,eg,tg=Xp,Ag=/ipad|iphone|ipod/i.test(Rl)&&"undefined"!=typeof Pebble,rg=/web0s(?!.*chrome)/i.test(Rl),ng=Yo,ig=function(e){if(!qp)return zp[e];var t=Wp(zp,e);return t&&t.value},sg=fp,ag=Gp.set,og=tg,lg=wp,cg=Ag,ug=rg,hg=$d,dg=ng.MutationObserver||ng.WebKitMutationObserver,fg=ng.document,pg=ng.process,gg=ng.Promise,mg=ig("queueMicrotask");if(!mg){var wg=new og,Bg=function(){var e,t;for(hg&&(e=pg.domain)&&e.exit();t=wg.get();)try{t()}catch(e){throw wg.head&&Yp(),e}e&&e.enter()};lg||hg||ug||!dg||!fg?!cg&&gg&&gg.resolve?((Zp=gg.resolve(void 0)).constructor=gg,eg=sg(Zp.then,Zp),Yp=function(){eg(Bg)}):hg?Yp=function(){pg.nextTick(Bg)}:(ag=sg(ag,ng),Yp=function(){ag(Bg)}):(Jp=!0,$p=fg.createTextNode(""),new dg(Bg).observe($p,{characterData:!0}),Yp=function(){$p.data=Jp=!Jp}),mg=function(e){wg.head||Yp(),wg.add(e)}}var bg=mg,yg=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},vg=Yo.Promise,Cg=Yo,xg=vg,Fg=Il,Qg=Pd,Ug=eh,Sg=Xc,Eg=Jd,Ng=Xl;xg&&xg.prototype;var Lg=Sg("species"),_g=!1,Ig=Fg(Cg.PromiseRejectionEvent),kg=Qg("Promise",function(){var e=Ug(xg),t=e!==String(xg);if(!t&&66===Ng)return!0;if(!Ng||Ng<51||!/native code/.test(e)){var A=new xg(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((A.constructor={})[Lg]=r,!(_g=A.then(function(){})instanceof r))return!0}return!(t||"BROWSER"!==Eg&&"DENO"!==Eg||Ig)}),Tg={CONSTRUCTOR:kg,REJECTION_EVENT:Ig,SUBCLASSING:_g},Hg={},Og=uc,Pg=TypeError,Dg=function(e){var t,A;this.promise=new e(function(e,r){if(void 0!==t||void 0!==A)throw new Pg("Bad Promise constructor");t=e,A=r}),this.resolve=Og(t),this.reject=Og(A)};Hg.f=function(e){return new Dg(e)};var Mg,jg,Rg,Vg,Kg=zd,Gg=$d,zg=Yo,qg=Zd,Wg=rl,Xg=Kh,Yg=uf,Jg=pf,$g=function(e){var t=wf(e);bf&&t&&!t[yf]&&Bf(t,yf,{configurable:!0,get:function(){return this}})},Zg=uc,em=Il,tm=Tl,Am=function(e,t){if(vf(t,e))return e;throw new Cf("Incorrect invocation")},rm=Ap,nm=Gp.set,im=bg,sm=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}},am=yg,om=tg,lm=yh,cm=vg,um=Hg,hm="Promise",dm=Tg.CONSTRUCTOR,fm=Tg.REJECTION_EVENT,pm=Tg.SUBCLASSING,gm=lm.getterFor(hm),mm=lm.set,wm=cm&&cm.prototype,Bm=cm,bm=wm,ym=zg.TypeError,vm=zg.document,Cm=zg.process,xm=um.f,Fm=xm,Qm=!!(vm&&vm.createEvent&&zg.dispatchEvent),Um="unhandledrejection",Sm=function(e){var t;return!(!tm(e)||!em(t=e.then))&&t},Em=function(e,t){var A,r,n,i=t.value,s=1===t.state,a=s?e.ok:e.fail,o=e.resolve,l=e.reject,c=e.domain;try{a?(s||(2===t.rejection&&km(t),t.rejection=1),!0===a?A=i:(c&&c.enter(),A=a(i),c&&(c.exit(),n=!0)),A===e.promise?l(new ym("Promise-chain cycle")):(r=Sm(A))?Wg(r,A,o,l):o(A)):l(i)}catch(e){c&&!n&&c.exit(),l(e)}},Nm=function(e,t){e.notified||(e.notified=!0,im(function(){for(var A,r=e.reactions;A=r.get();)Em(A,e);e.notified=!1,t&&!e.rejection&&_m(e)}))},Lm=function(e,t,A){var r,n;Qm?((r=vm.createEvent("Event")).promise=t,r.reason=A,r.initEvent(e,!1,!0),zg.dispatchEvent(r)):r={promise:t,reason:A},!fm&&(n=zg["on"+e])?n(r):e===Um&&sm("Unhandled promise rejection",A)},_m=function(e){Wg(nm,zg,function(){var t,A=e.facade,r=e.value;if(Im(e)&&(t=am(function(){Gg?Cm.emit("unhandledRejection",r,A):Lm(Um,A,r)}),e.rejection=Gg||Im(e)?2:1,t.error))throw t.value})},Im=function(e){return 1!==e.rejection&&!e.parent},km=function(e){Wg(nm,zg,function(){var t=e.facade;Gg?Cm.emit("rejectionHandled",t):Lm("rejectionhandled",t,e.value)})},Tm=function(e,t,A){return function(r){e(t,r,A)}},Hm=function(e,t,A){e.done||(e.done=!0,A&&(e=A),e.value=t,e.state=2,Nm(e,!0))},Om=function(e,t,A){if(!e.done){e.done=!0,A&&(e=A);try{if(e.facade===t)throw new ym("Promise can't be resolved itself");var r=Sm(t);r?im(function(){var A={done:!1};try{Wg(r,t,Tm(Om,A,e),Tm(Hm,A,e))}catch(t){Hm(A,t,e)}}):(e.value=t,e.state=1,Nm(e,!1))}catch(t){Hm({done:!1},t,e)}}};if(dm&&(bm=(Bm=function(e){Am(this,bm),Zg(e),Wg(Mg,this);var t=gm(this);try{e(Tm(Om,t),Tm(Hm,t))}catch(e){Hm(t,e)}}).prototype,(Mg=function(e){mm(this,{type:hm,done:!1,notified:!1,parent:!1,reactions:new om,rejection:!1,state:0,value:null})}).prototype=Xg(bm,"then",function(e,t){var A=gm(this),r=xm(rm(this,Bm));return A.parent=!0,r.ok=!em(e)||e,r.fail=em(t)&&t,r.domain=Gg?Cm.domain:void 0,0===A.state?A.reactions.add(r):im(function(){Em(r,A)}),r.promise}),jg=function(){var e=new Mg,t=gm(e);this.promise=e,this.resolve=Tm(Om,t),this.reject=Tm(Hm,t)},um.f=xm=function(e){return e===Bm||e===Rg?new jg(e):Fm(e)},em(cm)&&wm!==Object.prototype)){Vg=wm.then,pm||Xg(wm,"then",function(e,t){var A=this;return new Bm(function(e,t){Wg(Vg,A,e,t)}).then(e,t)},{unsafe:!0});try{delete wm.constructor}catch(e){}Yg&&Yg(wm,bm)}Kg({global:!0,constructor:!0,wrap:!0,forced:dm},{Promise:Bm}),Rg=qg.Promise,Jg(Bm,hm,!1),$g(hm);var Pm={},Dm=Pm,Mm=Xc("iterator"),jm=Array.prototype,Rm=Lf,Vm=fc,Km=Fl,Gm=Pm,zm=Xc("iterator"),qm=function(e){if(!Km(e))return Vm(e,zm)||Vm(e,"@@iterator")||Gm[Rm(e)]},Wm=rl,Xm=uc,Ym=Qu,Jm=ac,$m=qm,Zm=TypeError,ew=rl,tw=Qu,Aw=fc,rw=fp,nw=rl,iw=Qu,sw=ac,aw=function(e){return void 0!==e&&(Dm.Array===e||jm[Mm]===e)},ow=nd,lw=Dl,cw=function(e,t){var A=arguments.length<2?$m(e):t;if(Xm(A))return Ym(Wm(A,e));throw new Zm(Jm(e)+" is not iterable")},uw=qm,hw=function(e,t,A){var r,n;tw(e);try{if(!(r=Aw(e,"return"))){if("throw"===t)throw A;return A}r=ew(r,e)}catch(e){n=!0,r=e}if("throw"===t)throw A;if(n)throw r;return tw(r),A},dw=TypeError,fw=function(e,t){this.stopped=e,this.result=t},pw=fw.prototype,gw=function(e,t,A){var r,n,i,s,a,o,l,c=A&&A.that,u=!(!A||!A.AS_ENTRIES),h=!(!A||!A.IS_RECORD),d=!(!A||!A.IS_ITERATOR),f=!(!A||!A.INTERRUPTED),p=rw(t,c),g=function(e){return r&&hw(r,"normal"),new fw(!0,e)},m=function(e){return u?(iw(e),f?p(e[0],e[1],g):p(e[0],e[1])):f?p(e,g):p(e)};if(h)r=e.iterator;else if(d)r=e;else{if(!(n=uw(e)))throw new dw(sw(e)+" is not iterable");if(aw(n)){for(i=0,s=ow(e);s>i;i++)if((a=m(e[i]))&&lw(pw,a))return a;return new fw(!1)}r=cw(e,n)}for(o=h?e.next:r.next;!(l=nw(o,r)).done;){try{a=m(l.value)}catch(e){hw(r,"throw",e)}if("object"==typeof a&&a&&lw(pw,a))return a}return new fw(!1)},mw=Xc("iterator"),ww=!1;try{var Bw=0,bw={next:function(){return{done:!!Bw++}},return:function(){ww=!0}};bw[mw]=function(){return this},Array.from(bw,function(){throw 2})}catch(e){}var yw=vg,vw=function(e,t){try{if(!t&&!ww)return!1}catch(e){return!1}var A=!1;try{var r={};r[mw]=function(){return{next:function(){return{done:A=!0}}}},e(r)}catch(e){}return A},Cw=Tg.CONSTRUCTOR||!vw(function(e){yw.all(e).then(void 0,function(){})}),xw=rl,Fw=uc,Qw=Hg,Uw=yg,Sw=gw;zd({target:"Promise",stat:!0,forced:Cw},{all:function(e){var t=this,A=Qw.f(t),r=A.resolve,n=A.reject,i=Uw(function(){var A=Fw(t.resolve),i=[],s=0,a=1;Sw(e,function(e){var o=s++,l=!1;a++,xw(A,t,e).then(function(e){l||(l=!0,i[o]=e,--a||r(i))},n)}),--a||r(i)});return i.error&&n(i.value),A.promise}});var Ew=zd,Nw=Tg.CONSTRUCTOR,Lw=vg,_w=Pl,Iw=Il,kw=Kh,Tw=Lw&&Lw.prototype;if(Ew({target:"Promise",proto:!0,forced:Nw,real:!0},{catch:function(e){return this.then(void 0,e)}}),Iw(Lw)){var Hw=_w("Promise").prototype.catch;Tw.catch!==Hw&&kw(Tw,"catch",Hw,{unsafe:!0})}var Ow=rl,Pw=uc,Dw=Hg,Mw=yg,jw=gw;zd({target:"Promise",stat:!0,forced:Cw},{race:function(e){var t=this,A=Dw.f(t),r=A.reject,n=Mw(function(){var n=Pw(t.resolve);jw(e,function(e){Ow(n,t,e).then(A.resolve,r)})});return n.error&&r(n.value),A.promise}});var Rw=Hg;zd({target:"Promise",stat:!0,forced:Tg.CONSTRUCTOR},{reject:function(e){var t=Rw.f(this);return(0,t.reject)(e),t.promise}});var Vw=Qu,Kw=Tl,Gw=Hg,zw=zd,qw=Tg.CONSTRUCTOR,Ww=function(e,t){if(Vw(e),Kw(t)&&t.constructor===e)return t;var A=Gw.f(e);return(0,A.resolve)(t),A.promise};function Xw(e,t,A,r,n,i,s){try{var a=e[i](s),o=a.value}catch(e){return void A(e)}a.done?t(o):Promise.resolve(o).then(r,n)}function Yw(e){return function(){var t=this,A=arguments;return new Promise(function(r,n){var i=e.apply(t,A);function s(e){Xw(i,r,n,s,a,"next",e)}function a(e){Xw(i,r,n,s,a,"throw",e)}s(void 0)})}}Pl("Promise"),zw({target:"Promise",stat:!0,forced:qw},{resolve:function(e){return Ww(this,e)}});var Jw=Lf,$w=String,Zw=function(e){if("Symbol"===Jw(e))throw new TypeError("Cannot convert a Symbol value to a string");return $w(e)},eB=Qu,tB=function(){var e=eB(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},AB=$o,rB=Yo.RegExp,nB=AB(function(){var e=rB("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),iB=nB||AB(function(){return!rB("a","y").sticky}),sB=nB||AB(function(){var e=rB("^r","gy");return e.lastIndex=2,null!==e.exec("str")}),aB={BROKEN_CARET:sB,MISSED_STICKY:iB,UNSUPPORTED_Y:nB},oB={},lB=pd,cB=gd,uB=Object.keys||function(e){return lB(e,cB)},hB=Zo,dB=vu,fB=yu,pB=Qu,gB=Ll,mB=uB;oB.f=hB&&!dB?Object.defineProperties:function(e,t){pB(e);for(var A,r=gB(t),n=mB(t),i=n.length,s=0;i>s;)fB.f(e,A=n[s++],r[A]);return e};var wB,BB=Qu,bB=oB,yB=gd,vB=ah,CB=pp,xB=lu,FB="prototype",QB="script",UB=sh("IE_PROTO"),SB=function(){},EB=function(e){return"<"+QB+">"+e+"</"+QB+">"},NB=function(e){e.write(EB("")),e.close();var t=e.parentWindow.Object;return e=null,t},LB=function(){try{wB=new ActiveXObject("htmlfile")}catch(e){}var e,t,A;LB="undefined"!=typeof document?document.domain&&wB?NB(wB):(t=xB("iframe"),A="java"+QB+":",t.style.display="none",CB.appendChild(t),t.src=String(A),(e=t.contentWindow.document).open(),e.write(EB("document.F=Object")),e.close(),e.F):NB(wB);for(var r=yB.length;r--;)delete LB[FB][yB[r]];return LB()};vB[UB]=!0;var _B,IB,kB=Object.create||function(e,t){var A;return null!==e?(SB[FB]=BB(e),A=new SB,SB[FB]=null,A[UB]=e):A=LB(),void 0===t?A:bB.f(A,t)},TB=$o,HB=Yo.RegExp,OB=TB(function(){var e=HB(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}),PB=$o,DB=Yo.RegExp,MB=PB(function(){var e=DB("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}),jB=rl,RB=pl,VB=Zw,KB=tB,GB=aB,zB=kB,qB=yh.get,WB=OB,XB=MB,YB=Ec("native-string-replace",String.prototype.replace),JB=RegExp.prototype.exec,$B=JB,ZB=RB("".charAt),eb=RB("".indexOf),tb=RB("".replace),Ab=RB("".slice),rb=(IB=/b*/g,jB(JB,_B=/a/,"a"),jB(JB,IB,"a"),0!==_B.lastIndex||0!==IB.lastIndex),nb=GB.BROKEN_CARET,ib=void 0!==/()??/.exec("")[1];(rb||ib||nb||WB||XB)&&($B=function(e){var t,A,r,n,i,s,a,o=this,l=qB(o),c=VB(e),u=l.raw;if(u)return u.lastIndex=o.lastIndex,t=jB($B,u,c),o.lastIndex=u.lastIndex,t;var h=l.groups,d=nb&&o.sticky,f=jB(KB,o),p=o.source,g=0,m=c;if(d&&(f=tb(f,"y",""),-1===eb(f,"g")&&(f+="g"),m=Ab(c,o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==ZB(c,o.lastIndex-1))&&(p="(?: "+p+")",m=" "+m,g++),A=new RegExp("^(?:"+p+")",f)),ib&&(A=new RegExp("^"+p+"$(?!\\s)",f)),rb&&(r=o.lastIndex),n=jB(JB,d?A:o,m),d?n?(n.input=Ab(n.input,g),n[0]=Ab(n[0],g),n.index=o.lastIndex,o.lastIndex+=n[0].length):o.lastIndex=0:rb&&n&&(o.lastIndex=o.global?n.index+n[0].length:r),ib&&n&&n.length>1&&jB(YB,n[0],A,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)}),n&&h)for(n.groups=s=zB(null),i=0;i<h.length;i++)s[(a=h[i])[0]]=n[a[1]];return n});var sb=$B;zd({target:"RegExp",proto:!0,forced:/./.exec!==sb},{exec:sb});var ab=rl,ob=Kh,lb=sb,cb=$o,ub=Xc,hb=Mu,db=ub("species"),fb=RegExp.prototype,pb=function(e,t,A,r){var n=ub(e),i=!cb(function(){var t={};return t[n]=function(){return 7},7!==""[e](t)}),s=i&&!cb(function(){var t=!1,A=/a/;if("split"===e){var r={};r[db]=function(){return A},(A={constructor:r,flags:""})[n]=/./[n]}return A.exec=function(){return t=!0,null},A[n](""),!t});if(!i||!s||A){var a=/./[n],o=t(n,""[e],function(e,t,A,r,n){var s=t.exec;return s===lb||s===fb.exec?i&&!n?{done:!0,value:ab(a,t,A,r)}:{done:!0,value:ab(e,A,t,r)}:{done:!1}});ob(String.prototype,e,o[0]),ob(fb,n,o[1])}r&&hb(fb[n],"sham",!0)},gb=pl,mb=Yh,wb=Zw,Bb=Sl,bb=gb("".charAt),yb=gb("".charCodeAt),vb=gb("".slice),Cb=function(e){return function(t,A){var r,n,i=wb(Bb(t)),s=mb(A),a=i.length;return s<0||s>=a?e?"":void 0:(r=yb(i,s))<55296||r>56319||s+1===a||(n=yb(i,s+1))<56320||n>57343?e?bb(i,s):r:e?vb(i,s,s+2):n-56320+(r-55296<<10)+65536}},xb={codeAt:Cb(!1),charAt:Cb(!0)}.charAt,Fb=function(e,t,A){return t+(A?xb(e,t).length:1)},Qb=$o,Ub=Yo.RegExp,Sb=!Qb(function(){var e=!0;try{Ub(".","d")}catch(t){e=!1}var t={},A="",r=e?"dgimsy":"gimsy",n=function(e,r){Object.defineProperty(t,e,{get:function(){return A+=r,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(i.hasIndices="d"),i)n(s,i[s]);return Object.getOwnPropertyDescriptor(Ub.prototype,"flags").get.call(t)!==r||A!==r}),Eb=rl,Nb=Tc,Lb=Dl,_b={correct:Sb},Ib=tB,kb=RegExp.prototype,Tb=_b.correct?function(e){return e.flags}:function(e){return _b.correct||!Lb(kb,e)||Nb(e,"flags")?e.flags:Eb(Ib,e)},Hb=rl,Ob=Qu,Pb=Il,Db=Bl,Mb=sb,jb=TypeError,Rb=function(e,t){var A=e.exec;if(Pb(A)){var r=Hb(A,e,t);return null!==r&&Ob(r),r}if("RegExp"===Db(e))return Hb(Mb,e,t);throw new jb("RegExp#exec called on incompatible receiver")},Vb=rl,Kb=pb,Gb=Qu,zb=Tl,qb=Ad,Wb=Zw,Xb=Sl,Yb=fc,Jb=Fb,$b=Tb,Zb=Rb,ey=pl("".indexOf);Kb("match",function(e,t,A){return[function(t){var A=Xb(this),r=zb(t)?Yb(t,e):void 0;return r?Vb(r,t,A):new RegExp(t)[e](Wb(A))},function(e){var r=Gb(this),n=Wb(e),i=A(t,r,n);if(i.done)return i.value;var s=Wb($b(r));if(-1===ey(s,"g"))return Zb(r,n);var a=-1!==ey(s,"u");r.lastIndex=0;for(var o,l=[],c=0;null!==(o=Zb(r,n));){var u=Wb(o[0]);l[c]=u,""===u&&(r.lastIndex=Jb(n,qb(r.lastIndex),a)),c++}return 0===c?null:l}]});var ty=pl,Ay=_c,ry=Math.floor,ny=ty("".charAt),iy=ty("".replace),sy=ty("".slice),ay=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,oy=/\$([$&'`]|\d{1,2})/g,ly=ap,cy=rl,uy=pl,hy=pb,dy=$o,fy=Qu,py=Il,gy=Tl,my=Yh,wy=Ad,By=Zw,by=Sl,yy=Fb,vy=fc,Cy=function(e,t,A,r,n,i){var s=A+e.length,a=r.length,o=oy;return void 0!==n&&(n=Ay(n),o=ay),iy(i,o,function(i,o){var l;switch(ny(o,0)){case"$":return"$";case"&":return e;case"`":return sy(t,0,A);case"'":return sy(t,s);case"<":l=n[sy(o,1,-1)];break;default:var c=+o;if(0===c)return i;if(c>a){var u=ry(c/10);return 0===u?i:u<=a?void 0===r[u-1]?ny(o,1):r[u-1]+ny(o,1):i}l=r[c-1]}return void 0===l?"":l})},xy=Tb,Fy=Rb,Qy=Xc("replace"),Uy=Math.max,Sy=Math.min,Ey=uy([].concat),Ny=uy([].push),Ly=uy("".indexOf),_y=uy("".slice),Iy=function(e){return void 0===e?e:String(e)},ky="$0"==="a".replace(/./,"$0"),Ty=!!/./[Qy]&&""===/./[Qy]("a","$0"),Hy=!dy(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")});hy("replace",function(e,t,A){var r=Ty?"$":"$0";return[function(e,A){var r=by(this),n=gy(e)?vy(e,Qy):void 0;return n?cy(n,e,r,A):cy(t,By(r),e,A)},function(e,n){var i=fy(this),s=By(e);if("string"==typeof n&&-1===Ly(n,r)&&-1===Ly(n,"$<")){var a=A(t,i,s,n);if(a.done)return a.value}var o=py(n);o||(n=By(n));var l,c=By(xy(i)),u=-1!==Ly(c,"g");u&&(l=-1!==Ly(c,"u"),i.lastIndex=0);for(var h,d=[];null!==(h=Fy(i,s))&&(Ny(d,h),u);){""===By(h[0])&&(i.lastIndex=yy(s,wy(i.lastIndex),l))}for(var f="",p=0,g=0;g<d.length;g++){for(var m,w=By((h=d[g])[0]),B=Uy(Sy(my(h.index),s.length),0),b=[],y=1;y<h.length;y++)Ny(b,Iy(h[y]));var v=h.groups;if(o){var C=Ey([w],b,B,s);void 0!==v&&Ny(C,v),m=By(ly(n,void 0,C))}else m=Cy(w,s,B,b,v,n);B>=p&&(f+=_y(s,p,B)+m,p=B+w.length)}return f+_y(s,p)}]},!Hy||!ky||Ty);var Oy,Py=Tl,Dy=Bl,My=Xc("match"),jy=function(e){var t;return Py(e)&&(void 0!==(t=e[My])?!!t:"RegExp"===Dy(e))},Ry=TypeError,Vy=function(e){if(jy(e))throw new Ry("The method doesn't accept regular expressions");return e},Ky=Xc("match"),Gy=function(e){var t=/./;try{"/./"[e](t)}catch(A){try{return t[Ky]=!1,"/./"[e](t)}catch(e){}}return!1},zy=zd,qy=cp,Wy=Jo.f,Xy=Ad,Yy=Zw,Jy=Vy,$y=Sl,Zy=Gy,ev=qy("".slice),tv=Math.min,Av=Zy("startsWith");zy({target:"String",proto:!0,forced:!!(Av||(Oy=Wy(String.prototype,"startsWith"),!Oy||Oy.writable))&&!Av},{startsWith:function(e){var t=Yy($y(this));Jy(e);var A=Xy(tv(arguments.length>1?arguments[1]:void 0,t.length)),r=Yy(e);return ev(t,A,A+r.length)===r}});var rv=Xc,nv=kB,iv=yu.f,sv=rv("unscopables"),av=Array.prototype;void 0===av[sv]&&iv(av,sv,{configurable:!0,value:nv(null)});var ov,lv,cv,uv=!$o(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),hv=Tc,dv=Il,fv=_c,pv=uv,gv=sh("IE_PROTO"),mv=Object,wv=mv.prototype,Bv=pv?mv.getPrototypeOf:function(e){var t=fv(e);if(hv(t,gv))return t[gv];var A=t.constructor;return dv(A)&&t instanceof A?A.prototype:t instanceof mv?wv:null},bv=$o,yv=Il,vv=Tl,Cv=Bv,xv=Kh,Fv=Xc("iterator"),Qv=!1;[].keys&&("next"in(cv=[].keys())?(lv=Cv(Cv(cv)))!==Object.prototype&&(ov=lv):Qv=!0);var Uv=!vv(ov)||bv(function(){var e={};return ov[Fv].call(e)!==e});Uv&&(ov={}),yv(ov[Fv])||xv(ov,Fv,function(){return this});var Sv={IteratorPrototype:ov,BUGGY_SAFARI_ITERATORS:Qv},Ev=Sv.IteratorPrototype,Nv=kB,Lv=cl,_v=pf,Iv=Pm,kv=function(){return this},Tv=zd,Hv=rl,Ov=Il,Pv=function(e,t,A,r){var n=t+" Iterator";return e.prototype=Nv(Ev,{next:Lv(+!r,A)}),_v(e,n,!1),Iv[n]=kv,e},Dv=Bv,Mv=uf,jv=pf,Rv=Mu,Vv=Kh,Kv=Pm,Gv=qu.PROPER,zv=qu.CONFIGURABLE,qv=Sv.IteratorPrototype,Wv=Sv.BUGGY_SAFARI_ITERATORS,Xv=Xc("iterator"),Yv="keys",Jv="values",$v="entries",Zv=function(){return this},eC=Ll,tC=function(e){av[sv][e]=!0},AC=Pm,rC=yh,nC=yu.f,iC=function(e,t,A,r,n,i,s){Pv(A,t,r);var a,o,l,c=function(e){if(e===n&&p)return p;if(!Wv&&e&&e in d)return d[e];switch(e){case Yv:case Jv:case $v:return function(){return new A(this,e)}}return function(){return new A(this)}},u=t+" Iterator",h=!1,d=e.prototype,f=d[Xv]||d["@@iterator"]||n&&d[n],p=!Wv&&f||c(n),g="Array"===t&&d.entries||f;if(g&&(a=Dv(g.call(new e)))!==Object.prototype&&a.next&&(Dv(a)!==qv&&(Mv?Mv(a,qv):Ov(a[Xv])||Vv(a,Xv,Zv)),jv(a,u,!0)),Gv&&n===Jv&&f&&f.name!==Jv&&(zv?Rv(d,"name",Jv):(h=!0,p=function(){return Hv(f,this)})),n)if(o={values:c(Jv),keys:i?p:c(Yv),entries:c($v)},s)for(l in o)(Wv||h||!(l in d))&&Vv(d,l,o[l]);else Tv({target:t,proto:!0,forced:Wv||h},o);return d[Xv]!==p&&Vv(d,Xv,p,{name:n}),Kv[t]=p,o},sC=function(e,t){return{value:e,done:t}},aC=Zo,oC="Array Iterator",lC=rC.set,cC=rC.getterFor(oC),uC=iC(Array,"Array",function(e,t){lC(this,{type:oC,target:eC(e),index:0,kind:t})},function(){var e=cC(this),t=e.target,A=e.index++;if(!t||A>=t.length)return e.target=null,sC(void 0,!0);switch(e.kind){case"keys":return sC(A,!1);case"values":return sC(t[A],!1)}return sC([A,t[A]],!1)},"values"),hC=AC.Arguments=AC.Array;if(tC("keys"),tC("values"),tC("entries"),aC&&"values"!==hC.name)try{nC(hC,"name",{value:"values"})}catch(e){}var dC=lu("span").classList,fC=dC&&dC.constructor&&dC.constructor.prototype,pC=fC===Object.prototype?void 0:fC,gC=Yo,mC={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},wC=pC,BC=uC,bC=Mu,yC=pf,vC=Xc("iterator"),CC=BC.values,xC=function(e,t){if(e){if(e[vC]!==CC)try{bC(e,vC,CC)}catch(t){e[vC]=CC}if(yC(e,t,!0),mC[t])for(var A in BC)if(e[A]!==BC[A])try{bC(e,A,BC[A])}catch(t){e[A]=BC[A]}}};for(var FC in mC)xC(gC[FC]&&gC[FC].prototype,FC);function QC(e){var t=function(e,t){if("object"!=pe(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var r=A.call(e,t||"default");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pe(t)?t:t+""}function UC(e,t,A){return(t=QC(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}xC(wC,"DOMTokenList");var SC=uc,EC=_c,NC=xl,LC=nd,_C=TypeError,IC="Reduce of empty array with no initial value",kC=function(e){return function(t,A,r,n){var i=EC(t),s=NC(i),a=LC(i);if(SC(A),0===a&&r<2)throw new _C(IC);var o=e?a-1:0,l=e?-1:1;if(r<2)for(;;){if(o in s){n=s[o],o+=l;break}if(o+=l,e?o<0:a<=o)throw new _C(IC)}for(;e?o>=0:a>o;o+=l)o in s&&(n=A(n,s[o],o,i));return n}},TC={left:kC(!1),right:kC(!0)},HC=$o,OC=function(e,t){var A=[][e];return!!A&&HC(function(){A.call(null,t||function(){return 1},1)})},PC=TC.left;zd({target:"Array",proto:!0,forced:!$d&&Xl>79&&Xl<83||!OC("reduce")},{reduce:function(e){var t=arguments.length;return PC(this,e,t,t>1?arguments[1]:void 0)}});var DC=zd,MC=cp,jC=Jo.f,RC=Ad,VC=Zw,KC=Vy,GC=Sl,zC=Gy,qC=MC("".slice),WC=Math.min,XC=zC("endsWith"),YC=!XC&&!!function(){var e=jC(String.prototype,"endsWith");return e&&!e.writable}();DC({target:"String",proto:!0,forced:!YC&&!XC},{endsWith:function(e){var t=VC(GC(this));KC(e);var A=arguments.length>1?arguments[1]:void 0,r=t.length,n=void 0===A?r:WC(RC(A),r),i=VC(e);return qC(t,n-i.length,n)===i}});var JC=rl,$C=pl,ZC=pb,ex=Qu,tx=Tl,Ax=Sl,rx=Ap,nx=Fb,ix=Ad,sx=Zw,ax=fc,ox=Rb,lx=$o,cx=aB.UNSUPPORTED_Y,ux=Math.min,hx=$C([].push),dx=$C("".slice),fx=!lx(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var A="ab".split(e);return 2!==A.length||"a"!==A[0]||"b"!==A[1]}),px="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;ZC("split",function(e,t,A){var r="0".split(void 0,0).length?function(e,A){return void 0===e&&0===A?[]:JC(t,this,e,A)}:t;return[function(t,A){var n=Ax(this),i=tx(t)?ax(t,e):void 0;return i?JC(i,t,n,A):JC(r,sx(n),t,A)},function(e,n){var i=ex(this),s=sx(e);if(!px){var a=A(r,i,s,n,r!==t);if(a.done)return a.value}var o=rx(i,RegExp),l=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(cx?"g":"y"),u=new o(cx?"^(?:"+i.source+")":i,c),h=void 0===n?4294967295:n>>>0;if(0===h)return[];if(0===s.length)return null===ox(u,s)?[s]:[];for(var d=0,f=0,p=[];f<s.length;){u.lastIndex=cx?0:f;var g,m=ox(u,cx?dx(s,f):s);if(null===m||(g=ux(ix(u.lastIndex+(cx?f:0)),s.length))===d)f=nx(s,f,l);else{if(hx(p,dx(s,d,f)),p.length===h)return p;for(var w=1;w<=m.length-1;w++)if(hx(p,m[w]),p.length===h)return p;f=d=g}}return hx(p,dx(s,d)),p}]},px||!fx,cx);var gx={exports:{}},mx={exports:{}};(function(){var e,t,A,r,n,i;"undefined"!=typeof performance&&null!==performance&&performance.now?mx.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(mx.exports=function(){return(e()-n)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),i=1e9*process.uptime(),n=r-i):Date.now?(mx.exports=function(){return Date.now()-A},A=Date.now()):(mx.exports=function(){return(new Date).getTime()-A},A=(new Date).getTime())}).call(o);for(var wx=mx.exports,Bx="undefined"==typeof window?o:window,bx=["moz","webkit"],yx="AnimationFrame",vx=Bx["request"+yx],Cx=Bx["cancel"+yx]||Bx["cancelRequest"+yx],xx=0;!vx&&xx<bx.length;xx++)vx=Bx[bx[xx]+"Request"+yx],Cx=Bx[bx[xx]+"Cancel"+yx]||Bx[bx[xx]+"CancelRequest"+yx];if(!vx||!Cx){var Fx=0,Qx=0,Ux=[],Sx=1e3/60;vx=function(e){if(0===Ux.length){var t=wx(),A=Math.max(0,Sx-(t-Fx));Fx=A+t,setTimeout(function(){var e=Ux.slice(0);Ux.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(Fx)}catch(e){setTimeout(function(){throw e},0)}},Math.round(A))}return Ux.push({handle:++Qx,callback:e,cancelled:!1}),Qx},Cx=function(e){for(var t=0;t<Ux.length;t++)Ux[t].handle===e&&(Ux[t].cancelled=!0)}}gx.exports=function(e){return vx.call(Bx,e)},gx.exports.cancel=function(){Cx.apply(Bx,arguments)},gx.exports.polyfill=function(e){e||(e=Bx),e.requestAnimationFrame=vx,e.cancelAnimationFrame=Cx};var Ex=l(gx.exports),Nx="\t\n\v\f\r \u2028\u2029\ufeff",Lx=Sl,_x=Zw,Ix=Nx,kx=pl("".replace),Tx=RegExp("^["+Ix+"]+"),Hx=RegExp("(^|[^"+Ix+"])["+Ix+"]+$"),Ox=function(e){return function(t){var A=_x(Lx(t));return 1&e&&(A=kx(A,Tx,"")),2&e&&(A=kx(A,Hx,"$1")),A}},Px={start:Ox(1),end:Ox(2),trim:Ox(3)},Dx=qu.PROPER,Mx=$o,jx=Nx,Rx=Px.trim;zd({target:"String",proto:!0,forced:function(e){return Mx(function(){return!!jx[e]()||"
"!=="
"[e]()||Dx&&jx[e].name!==e})}("trim")},{trim:function(){return Rx(this)}});var Vx=function(e){this.ok=!1,this.alpha=1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=t[e]||e;for(var A=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<A.length;r++){var n=A[r].re,i=A[r].process,s=n.exec(e);if(s){var a=i(s);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[3]),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.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),A=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==A.length&&(A="0"+A),"#"+e+t+A},this.getHelpXML=function(){for(var e=new Array,r=0;r<A.length;r++)for(var n=A[r].example,i=0;i<n.length;i++)e[e.length]=n[i];for(var s in t)e[e.length]=s;var a=document.createElement("ul");a.setAttribute("id","rgbcolor-examples");for(r=0;r<e.length;r++)try{var o=document.createElement("li"),l=new RGBColor(e[r]),c=document.createElement("div");c.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex(),c.appendChild(document.createTextNode("test"));var u=document.createTextNode(" "+e[r]+" -> "+l.toRGB()+" -> "+l.toHex());o.appendChild(c),o.appendChild(u),a.appendChild(o)}catch(e){}return a}},Kx=l(Vx),Gx=zd,zx=ld.indexOf,qx=OC,Wx=cp([].indexOf),Xx=!!Wx&&1/Wx([1],1,-0)<0;Gx({target:"Array",proto:!0,forced:Xx||!qx("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Xx?Wx(this,e,t)||0:zx(this,e,t)}});var Yx=zd,Jx=Vy,$x=Sl,Zx=Zw,eF=Gy,tF=pl("".indexOf);Yx({target:"String",proto:!0,forced:!eF("includes")},{includes:function(e){return!!~tF(Zx($x(this)),Zx(Jx(e)),arguments.length>1?arguments[1]:void 0)}});var AF=Bl,rF=zd,nF=Array.isArray||function(e){return"Array"===AF(e)},iF=pl([].reverse),sF=[1,2];rF({target:"Array",proto:!0,forced:String(sF)===String(sF.reverse())},{reverse:function(){return nF(this)&&(this.length=this.length),iF(this)}});
|
|
309
|
+
const{entries:Ra,setPrototypeOf:Va,isFrozen:Ka,getPrototypeOf:za,getOwnPropertyDescriptor:Ga}=Object;let{freeze:qa,seal:Wa,create:Xa}=Object,{apply:Ya,construct:Ja}="undefined"!=typeof Reflect&&Reflect;qa||(qa=function(e){return e}),Wa||(Wa=function(e){return e}),Ya||(Ya=function(e,t){for(var A=arguments.length,r=new Array(A>2?A-2:0),n=2;n<A;n++)r[n-2]=arguments[n];return e.apply(t,r)}),Ja||(Ja=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),r=1;r<t;r++)A[r-1]=arguments[r];return new e(...A)});const $a=fo(Array.prototype.forEach),Za=fo(Array.prototype.lastIndexOf),eo=fo(Array.prototype.pop),to=fo(Array.prototype.push),Ao=fo(Array.prototype.splice),ro=fo(String.prototype.toLowerCase),no=fo(String.prototype.toString),io=fo(String.prototype.match),so=fo(String.prototype.replace),ao=fo(String.prototype.indexOf),oo=fo(String.prototype.trim),lo=fo(Object.prototype.hasOwnProperty),co=fo(RegExp.prototype.test),uo=(ho=TypeError,function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];return Ja(ho,t)});var ho;function fo(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var A=arguments.length,r=new Array(A>1?A-1:0),n=1;n<A;n++)r[n-1]=arguments[n];return Ya(e,t,r)}}function po(e,t){let A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ro;Va&&Va(e,null);let r=t.length;for(;r--;){let n=t[r];if("string"==typeof n){const e=A(n);e!==n&&(Ka(t)||(t[r]=e),n=e)}e[n]=!0}return e}function go(e){for(let t=0;t<e.length;t++){lo(e,t)||(e[t]=null)}return e}function mo(e){const t=Xa(null);for(const[A,r]of Ra(e)){lo(e,A)&&(Array.isArray(r)?t[A]=go(r):r&&"object"==typeof r&&r.constructor===Object?t[A]=mo(r):t[A]=r)}return t}function wo(e,t){for(;null!==e;){const A=Ga(e,t);if(A){if(A.get)return fo(A.get);if("function"==typeof A.value)return fo(A.value)}e=za(e)}return function(){return null}}const Bo=qa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bo=qa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),yo=qa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vo=qa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Co=qa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xo=qa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fo=qa(["#text"]),Qo=qa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Uo=qa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=qa(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Eo=qa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),No=Wa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Lo=Wa(/<%[\w\W]*|[\w\W]*%>/gm),_o=Wa(/\$\{[\w\W]*/gm),Io=Wa(/^data-[\-\w.\u00B7-\uFFFF]+$/),ko=Wa(/^aria-[\-\w]+$/),To=Wa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ho=Wa(/^(?:\w+script|data):/i),Oo=Wa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Po=Wa(/^html$/i),Do=Wa(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mo=Object.freeze({__proto__:null,ARIA_ATTR:ko,ATTR_WHITESPACE:Oo,CUSTOM_ELEMENT:Do,DATA_ATTR:Io,DOCTYPE_NAME:Po,ERB_EXPR:Lo,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:Ho,MUSTACHE_EXPR:No,TMPLIT_EXPR:_o});const jo=1,Ro=3,Vo=7,Ko=8,zo=9,Go=function(){return"undefined"==typeof window?null:window};var qo=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Go();const A=t=>e(t);if(A.version="3.3.1",A.removed=[],!t||!t.document||t.document.nodeType!==zo||!t.Element)return A.isSupported=!1,A;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,p=l.prototype,g=wo(p,"cloneNode"),m=wo(p,"remove"),w=wo(p,"nextSibling"),B=wo(p,"childNodes"),b=wo(p,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let y,v="";const{implementation:C,createNodeIterator:x,createDocumentFragment:F,getElementsByTagName:Q}=r,{importNode:U}=n;let S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};A.isSupported="function"==typeof Ra&&"function"==typeof b&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:E,ERB_EXPR:N,TMPLIT_EXPR:L,DATA_ATTR:_,ARIA_ATTR:I,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:T,CUSTOM_ELEMENT:H}=Mo;let{IS_ALLOWED_URI:O}=Mo,P=null;const D=po({},[...Bo,...bo,...yo,...Co,...Fo]);let M=null;const j=po({},[...Qo,...Uo,...So,...Eo]);let R=Object.seal(Xa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,K=null;const z=Object.seal(Xa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let G=!0,q=!0,W=!1,X=!0,Y=!1,J=!0,$=!1,Z=!1,ee=!1,te=!1,Ae=!1,re=!1,ne=!0,ie=!1,se=!0,ae=!1,oe={},le=null;const ce=po({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const he=po({},["audio","video","img","source","image","track"]);let de=null;const fe=po({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let we=me,Be=!1,be=null;const ye=po({},[pe,ge,me],no);let ve=po({},["mi","mo","mn","ms","mtext"]),Ce=po({},["annotation-xml"]);const xe=po({},["title","style","font","a","script"]);let Fe=null;const Qe=["application/xhtml+xml","text/html"];let Ue=null,Se=null;const Ee=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Le=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if(e&&"object"==typeof e||(e={}),e=mo(e),Fe=-1===Qe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ue="application/xhtml+xml"===Fe?no:ro,P=lo(e,"ALLOWED_TAGS")?po({},e.ALLOWED_TAGS,Ue):D,M=lo(e,"ALLOWED_ATTR")?po({},e.ALLOWED_ATTR,Ue):j,be=lo(e,"ALLOWED_NAMESPACES")?po({},e.ALLOWED_NAMESPACES,no):ye,de=lo(e,"ADD_URI_SAFE_ATTR")?po(mo(fe),e.ADD_URI_SAFE_ATTR,Ue):fe,ue=lo(e,"ADD_DATA_URI_TAGS")?po(mo(he),e.ADD_DATA_URI_TAGS,Ue):he,le=lo(e,"FORBID_CONTENTS")?po({},e.FORBID_CONTENTS,Ue):ce,V=lo(e,"FORBID_TAGS")?po({},e.FORBID_TAGS,Ue):mo({}),K=lo(e,"FORBID_ATTR")?po({},e.FORBID_ATTR,Ue):mo({}),oe=!!lo(e,"USE_PROFILES")&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,J=!1!==e.SAFE_FOR_XML,$=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||To,we=e.NAMESPACE||me,ve=e.MATHML_TEXT_INTEGRATION_POINTS||ve,Ce=e.HTML_INTEGRATION_POINTS||Ce,R=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(R.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(q=!1),Ae&&(te=!0),oe&&(P=po({},Fo),M=[],!0===oe.html&&(po(P,Bo),po(M,Qo)),!0===oe.svg&&(po(P,bo),po(M,Uo),po(M,Eo)),!0===oe.svgFilters&&(po(P,yo),po(M,Uo),po(M,Eo)),!0===oe.mathMl&&(po(P,Co),po(M,So),po(M,Eo))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?z.tagCheck=e.ADD_TAGS:(P===D&&(P=mo(P)),po(P,e.ADD_TAGS,Ue))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?z.attributeCheck=e.ADD_ATTR:(M===j&&(M=mo(M)),po(M,e.ADD_ATTR,Ue))),e.ADD_URI_SAFE_ATTR&&po(de,e.ADD_URI_SAFE_ATTR,Ue),e.FORBID_CONTENTS&&(le===ce&&(le=mo(le)),po(le,e.FORBID_CONTENTS,Ue)),e.ADD_FORBID_CONTENTS&&(le===ce&&(le=mo(le)),po(le,e.ADD_FORBID_CONTENTS,Ue)),se&&(P["#text"]=!0),$&&po(P,["html","head","body"]),P.table&&(po(P,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw uo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw uo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,v=y.createHTML("")}else void 0===y&&(y=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let A=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(A=t.getAttribute(r));const n="dompurify"+(A?"#"+A:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}}(f,i)),null!==y&&"string"==typeof v&&(v=y.createHTML(""));qa&&qa(e),Se=e}},_e=po({},[...bo,...yo,...vo]),Ie=po({},[...Co,...xo]),ke=function(e){to(A.removed,{element:e});try{b(e).removeChild(e)}catch(t){m(e)}},Te=function(e,t){try{to(A.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){to(A.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||Ae)try{ke(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},He=function(e){let t=null,A=null;if(ee)e="<remove></remove>"+e;else{const t=io(e,/^[\r\n\t ]+/);A=t&&t[0]}"application/xhtml+xml"===Fe&&we===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const n=y?y.createHTML(e):e;if(we===me)try{t=(new d).parseFromString(n,Fe)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(we,"template",null);try{t.documentElement.innerHTML=Be?v:n}catch(e){}}const i=t.body||t.documentElement;return e&&A&&i.insertBefore(r.createTextNode(A),i.childNodes[0]||null),we===me?Q.call(t,$?"html":"body")[0]:$?t.documentElement:i},Oe=function(e){return x.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pe=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},De=function(e){return"function"==typeof o&&e instanceof o};function Me(e,t,r){$a(e,e=>{e.call(A,t,r,Se)})}const je=function(e){let t=null;if(Me(S.beforeSanitizeElements,e,null),Pe(e))return ke(e),!0;const r=Ue(e.nodeName);if(Me(S.uponSanitizeElement,e,{tagName:r,allowedTags:P}),J&&e.hasChildNodes()&&!De(e.firstElementChild)&&co(/<[/\w!]/g,e.innerHTML)&&co(/<[/\w!]/g,e.textContent))return ke(e),!0;if(e.nodeType===Vo)return ke(e),!0;if(J&&e.nodeType===Ko&&co(/<[/\w]/g,e.data))return ke(e),!0;if(!(z.tagCheck instanceof Function&&z.tagCheck(r))&&(!P[r]||V[r])){if(!V[r]&&Ve(r)){if(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,r))return!1;if(R.tagNameCheck instanceof Function&&R.tagNameCheck(r))return!1}if(se&&!le[r]){const t=b(e)||e.parentNode,A=B(e)||e.childNodes;if(A&&t){for(let r=A.length-1;r>=0;--r){const n=g(A[r],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,w(e))}}}return ke(e),!0}return e instanceof l&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:we,tagName:"template"});const A=ro(e.tagName),r=ro(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===A:t.namespaceURI===pe?"svg"===A&&("annotation-xml"===r||ve[r]):Boolean(_e[A]):e.namespaceURI===pe?t.namespaceURI===me?"math"===A:t.namespaceURI===ge?"math"===A&&Ce[r]:Boolean(Ie[A]):e.namespaceURI===me?!(t.namespaceURI===ge&&!Ce[r])&&!(t.namespaceURI===pe&&!ve[r])&&!Ie[A]&&(xe[A]||!_e[A]):!("application/xhtml+xml"!==Fe||!be[e.namespaceURI]))}(e)?(ke(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!co(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Ro&&(t=e.textContent,$a([E,N,L],e=>{t=so(t,e," ")}),e.textContent!==t&&(to(A.removed,{element:e.cloneNode()}),e.textContent=t)),Me(S.afterSanitizeElements,e,null),!1):(ke(e),!0)},Re=function(e,t,A){if(ne&&("id"===t||"name"===t)&&(A in r||A in Ee))return!1;if(q&&!K[t]&&co(_,t));else if(G&&co(I,t));else if(z.attributeCheck instanceof Function&&z.attributeCheck(t,e));else if(!M[t]||K[t]){if(!(Ve(e)&&(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,e)||R.tagNameCheck instanceof Function&&R.tagNameCheck(e))&&(R.attributeNameCheck instanceof RegExp&&co(R.attributeNameCheck,t)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(t,e))||"is"===t&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&co(R.tagNameCheck,A)||R.tagNameCheck instanceof Function&&R.tagNameCheck(A))))return!1}else if(de[t]);else if(co(O,so(A,T,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ao(A,"data:")||!ue[e]){if(W&&!co(k,so(A,T,"")));else if(A)return!1}else;return!0},Ve=function(e){return"annotation-xml"!==e&&io(e,H)},Ke=function(e){Me(S.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Pe(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let n=t.length;for(;n--;){const i=t[n],{name:s,namespaceURI:a,value:o}=i,l=Ue(s),c=o;let u="value"===s?c:oo(c);if(r.attrName=l,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Me(S.uponSanitizeAttribute,e,r),u=r.attrValue,!ie||"id"!==l&&"name"!==l||(Te(s,e),u="user-content-"+u),J&&co(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Te(s,e);continue}if("attributename"===l&&io(u,"href")){Te(s,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Te(s,e);continue}if(!X&&co(/\/>/i,u)){Te(s,e);continue}Y&&$a([E,N,L],e=>{u=so(u,e," ")});const h=Ue(e.nodeName);if(Re(h,l,u)){if(y&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(h,l)){case"TrustedHTML":u=y.createHTML(u);break;case"TrustedScriptURL":u=y.createScriptURL(u)}if(u!==c)try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),Pe(e)?ke(e):eo(A.removed)}catch(t){Te(s,e)}}else Te(s,e)}Me(S.afterSanitizeAttributes,e,null)},ze=function e(t){let A=null;const r=Oe(t);for(Me(S.beforeSanitizeShadowDOM,t,null);A=r.nextNode();)Me(S.uponSanitizeShadowNode,A,null),je(A),Ke(A),A.content instanceof s&&e(A.content);Me(S.afterSanitizeShadowDOM,t,null)};return A.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Be=!e,Be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!De(e)){if("function"!=typeof e.toString)throw uo("toString is not a function");if("string"!=typeof(e=e.toString()))throw uo("dirty is not a string, aborting")}if(!A.isSupported)return e;if(Z||Le(t),A.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ue(e.nodeName);if(!P[t]||V[t])throw uo("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof o)r=He("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===jo&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!Y&&!$&&-1===e.indexOf("<"))return y&&re?y.createHTML(e):e;if(r=He(e),!r)return te?null:re?v:""}r&&ee&&ke(r.firstChild);const c=Oe(ae?e:r);for(;a=c.nextNode();)je(a),Ke(a),a.content instanceof s&&ze(a.content);if(ae)return e;if(te){if(Ae)for(l=F.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(M.shadowroot||M.shadowrootmode)&&(l=U.call(n,l,!0)),l}let u=$?r.outerHTML:r.innerHTML;return $&&P["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&co(Po,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),Y&&$a([E,N,L],e=>{u=so(u,e," ")}),y&&re?y.createHTML(u):u},A.setConfig=function(){Le(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},A.clearConfig=function(){Se=null,Z=!1},A.isValidAttribute=function(e,t,A){Se||Le({});const r=Ue(e),n=Ue(t);return Re(r,n,A)},A.addHook=function(e,t){"function"==typeof t&&to(S[e],t)},A.removeHook=function(e,t){if(void 0!==t){const A=Za(S[e],t);return-1===A?void 0:Ao(S[e],A,1)[0]}return eo(S[e])},A.removeHooks=function(e){S[e]=[]},A.removeAllHooks=function(){S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},A}(),Wo=Object.freeze({__proto__:null,default:qo}),Xo=function(e){return e&&e.Math===Math&&e},Yo=Xo("object"==typeof globalThis&&globalThis)||Xo("object"==typeof window&&window)||Xo("object"==typeof self&&self)||Xo("object"==typeof o&&o)||Xo("object"==typeof o&&o)||function(){return this}()||Function("return this")(),Jo={},$o=function(e){try{return!!e()}catch(e){return!0}},Zo=!$o(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),el=!$o(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),tl=el,Al=Function.prototype.call,rl=tl?Al.bind(Al):function(){return Al.apply(Al,arguments)},nl={},il={}.propertyIsEnumerable,sl=Object.getOwnPropertyDescriptor,al=sl&&!il.call({1:2},1);nl.f=al?function(e){var t=sl(this,e);return!!t&&t.enumerable}:il;var ol,ll,cl=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ul=el,hl=Function.prototype,dl=hl.call,fl=ul&&hl.bind.bind(dl,dl),pl=ul?fl:function(e){return function(){return dl.apply(e,arguments)}},gl=pl,ml=gl({}.toString),wl=gl("".slice),Bl=function(e){return wl(ml(e),8,-1)},bl=$o,yl=Bl,vl=Object,Cl=pl("".split),xl=bl(function(){return!vl("z").propertyIsEnumerable(0)})?function(e){return"String"===yl(e)?Cl(e,""):vl(e)}:vl,Fl=function(e){return null==e},Ql=Fl,Ul=TypeError,Sl=function(e){if(Ql(e))throw new Ul("Can't call method on "+e);return e},El=xl,Nl=Sl,Ll=function(e){return El(Nl(e))},_l="object"==typeof document&&document.all,Il=void 0===_l&&void 0!==_l?function(e){return"function"==typeof e||e===_l}:function(e){return"function"==typeof e},kl=Il,Tl=function(e){return"object"==typeof e?null!==e:kl(e)},Hl=Yo,Ol=Il,Pl=function(e,t){return arguments.length<2?(A=Hl[e],Ol(A)?A:void 0):Hl[e]&&Hl[e][t];var A},Dl=pl({}.isPrototypeOf),Ml=Yo.navigator,jl=Ml&&Ml.userAgent,Rl=jl?String(jl):"",Vl=Yo,Kl=Rl,zl=Vl.process,Gl=Vl.Deno,ql=zl&&zl.versions||Gl&&Gl.version,Wl=ql&&ql.v8;Wl&&(ll=(ol=Wl.split("."))[0]>0&&ol[0]<4?1:+(ol[0]+ol[1])),!ll&&Kl&&(!(ol=Kl.match(/Edge\/(\d+)/))||ol[1]>=74)&&(ol=Kl.match(/Chrome\/(\d+)/))&&(ll=+ol[1]);var Xl=ll,Yl=Xl,Jl=$o,$l=Yo.String,Zl=!!Object.getOwnPropertySymbols&&!Jl(function(){var e=Symbol("symbol detection");return!$l(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Yl&&Yl<41}),ec=Zl&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tc=Pl,Ac=Il,rc=Dl,nc=Object,ic=ec?function(e){return"symbol"==typeof e}:function(e){var t=tc("Symbol");return Ac(t)&&rc(t.prototype,nc(e))},sc=String,ac=function(e){try{return sc(e)}catch(e){return"Object"}},oc=Il,lc=ac,cc=TypeError,uc=function(e){if(oc(e))return e;throw new cc(lc(e)+" is not a function")},hc=uc,dc=Fl,fc=function(e,t){var A=e[t];return dc(A)?void 0:hc(A)},pc=rl,gc=Il,mc=Tl,wc=TypeError,Bc={exports:{}},bc=Yo,yc=Object.defineProperty,vc=function(e,t){try{yc(bc,e,{value:t,configurable:!0,writable:!0})}catch(A){bc[e]=t}return t},Cc=Yo,xc=vc,Fc="__core-js_shared__",Qc=Bc.exports=Cc[Fc]||xc(Fc,{});(Qc.versions||(Qc.versions=[])).push({version:"3.48.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Uc=Bc.exports,Sc=Uc,Ec=function(e,t){return Sc[e]||(Sc[e]=t||{})},Nc=Sl,Lc=Object,_c=function(e){return Lc(Nc(e))},Ic=_c,kc=pl({}.hasOwnProperty),Tc=Object.hasOwn||function(e,t){return kc(Ic(e),t)},Hc=pl,Oc=0,Pc=Math.random(),Dc=Hc(1.1.toString),Mc=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Dc(++Oc+Pc,36)},jc=Ec,Rc=Tc,Vc=Mc,Kc=Zl,zc=ec,Gc=Yo.Symbol,qc=jc("wks"),Wc=zc?Gc.for||Gc:Gc&&Gc.withoutSetter||Vc,Xc=function(e){return Rc(qc,e)||(qc[e]=Kc&&Rc(Gc,e)?Gc[e]:Wc("Symbol."+e)),qc[e]},Yc=rl,Jc=Tl,$c=ic,Zc=fc,eu=function(e,t){var A,r;if("string"===t&&gc(A=e.toString)&&!mc(r=pc(A,e)))return r;if(gc(A=e.valueOf)&&!mc(r=pc(A,e)))return r;if("string"!==t&&gc(A=e.toString)&&!mc(r=pc(A,e)))return r;throw new wc("Can't convert object to primitive value")},tu=TypeError,Au=Xc("toPrimitive"),ru=function(e,t){if(!Jc(e)||$c(e))return e;var A,r=Zc(e,Au);if(r){if(void 0===t&&(t="default"),A=Yc(r,e,t),!Jc(A)||$c(A))return A;throw new tu("Can't convert object to primitive value")}return void 0===t&&(t="number"),eu(e,t)},nu=ic,iu=function(e){var t=ru(e,"string");return nu(t)?t:t+""},su=Tl,au=Yo.document,ou=su(au)&&su(au.createElement),lu=function(e){return ou?au.createElement(e):{}},cu=lu,uu=!Zo&&!$o(function(){return 7!==Object.defineProperty(cu("div"),"a",{get:function(){return 7}}).a}),hu=Zo,du=rl,fu=nl,pu=cl,gu=Ll,mu=iu,wu=Tc,Bu=uu,bu=Object.getOwnPropertyDescriptor;Jo.f=hu?bu:function(e,t){if(e=gu(e),t=mu(t),Bu)try{return bu(e,t)}catch(e){}if(wu(e,t))return pu(!du(fu.f,e,t),e[t])};var yu={},vu=Zo&&$o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Cu=Tl,xu=String,Fu=TypeError,Qu=function(e){if(Cu(e))return e;throw new Fu(xu(e)+" is not an object")},Uu=Zo,Su=uu,Eu=vu,Nu=Qu,Lu=iu,_u=TypeError,Iu=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,Tu="enumerable",Hu="configurable",Ou="writable";yu.f=Uu?Eu?function(e,t,A){if(Nu(e),t=Lu(t),Nu(A),"function"==typeof e&&"prototype"===t&&"value"in A&&Ou in A&&!A[Ou]){var r=ku(e,t);r&&r[Ou]&&(e[t]=A.value,A={configurable:Hu in A?A[Hu]:r[Hu],enumerable:Tu in A?A[Tu]:r[Tu],writable:!1})}return Iu(e,t,A)}:Iu:function(e,t,A){if(Nu(e),t=Lu(t),Nu(A),Su)try{return Iu(e,t,A)}catch(e){}if("get"in A||"set"in A)throw new _u("Accessors not supported");return"value"in A&&(e[t]=A.value),e};var Pu=yu,Du=cl,Mu=Zo?function(e,t,A){return Pu.f(e,t,Du(1,A))}:function(e,t,A){return e[t]=A,e},ju={exports:{}},Ru=Zo,Vu=Tc,Ku=Function.prototype,zu=Ru&&Object.getOwnPropertyDescriptor,Gu=Vu(Ku,"name"),qu={EXISTS:Gu,PROPER:Gu&&"something"===function(){}.name,CONFIGURABLE:Gu&&(!Ru||Ru&&zu(Ku,"name").configurable)},Wu=Il,Xu=Uc,Yu=pl(Function.toString);Wu(Xu.inspectSource)||(Xu.inspectSource=function(e){return Yu(e)});var Ju,$u,Zu,eh=Xu.inspectSource,th=Il,Ah=Yo.WeakMap,rh=th(Ah)&&/native code/.test(String(Ah)),nh=Mc,ih=Ec("keys"),sh=function(e){return ih[e]||(ih[e]=nh(e))},ah={},oh=rh,lh=Yo,ch=Tl,uh=Mu,hh=Tc,dh=Uc,fh=sh,ph=ah,gh="Object already initialized",mh=lh.TypeError,wh=lh.WeakMap;if(oh||dh.state){var Bh=dh.state||(dh.state=new wh);Bh.get=Bh.get,Bh.has=Bh.has,Bh.set=Bh.set,Ju=function(e,t){if(Bh.has(e))throw new mh(gh);return t.facade=e,Bh.set(e,t),t},$u=function(e){return Bh.get(e)||{}},Zu=function(e){return Bh.has(e)}}else{var bh=fh("state");ph[bh]=!0,Ju=function(e,t){if(hh(e,bh))throw new mh(gh);return t.facade=e,uh(e,bh,t),t},$u=function(e){return hh(e,bh)?e[bh]:{}},Zu=function(e){return hh(e,bh)}}var yh={set:Ju,get:$u,has:Zu,enforce:function(e){return Zu(e)?$u(e):Ju(e,{})},getterFor:function(e){return function(t){var A;if(!ch(t)||(A=$u(t)).type!==e)throw new mh("Incompatible receiver, "+e+" required");return A}}},vh=pl,Ch=$o,xh=Il,Fh=Tc,Qh=Zo,Uh=qu.CONFIGURABLE,Sh=eh,Eh=yh.enforce,Nh=yh.get,Lh=String,_h=Object.defineProperty,Ih=vh("".slice),kh=vh("".replace),Th=vh([].join),Hh=Qh&&!Ch(function(){return 8!==_h(function(){},"length",{value:8}).length}),Oh=String(String).split("String"),Ph=ju.exports=function(e,t,A){"Symbol("===Ih(Lh(t),0,7)&&(t="["+kh(Lh(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),A&&A.getter&&(t="get "+t),A&&A.setter&&(t="set "+t),(!Fh(e,"name")||Uh&&e.name!==t)&&(Qh?_h(e,"name",{value:t,configurable:!0}):e.name=t),Hh&&A&&Fh(A,"arity")&&e.length!==A.arity&&_h(e,"length",{value:A.arity});try{A&&Fh(A,"constructor")&&A.constructor?Qh&&_h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=Eh(e);return Fh(r,"source")||(r.source=Th(Oh,"string"==typeof t?t:"")),e};Function.prototype.toString=Ph(function(){return xh(this)&&Nh(this).source||Sh(this)},"toString");var Dh=ju.exports,Mh=Il,jh=yu,Rh=Dh,Vh=vc,Kh=function(e,t,A,r){r||(r={});var n=r.enumerable,i=void 0!==r.name?r.name:t;if(Mh(A)&&Rh(A,i,r),r.global)n?e[t]=A:Vh(t,A);else{try{r.unsafe?e[t]&&(n=!0):delete e[t]}catch(e){}n?e[t]=A:jh.f(e,t,{value:A,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},zh={},Gh=Math.ceil,qh=Math.floor,Wh=Math.trunc||function(e){var t=+e;return(t>0?qh:Gh)(t)},Xh=Wh,Yh=function(e){var t=+e;return t!=t||0===t?0:Xh(t)},Jh=Yh,$h=Math.max,Zh=Math.min,ed=Yh,td=Math.min,Ad=function(e){var t=ed(e);return t>0?td(t,9007199254740991):0},rd=Ad,nd=function(e){return rd(e.length)},id=Ll,sd=function(e,t){var A=Jh(e);return A<0?$h(A+t,0):Zh(A,t)},ad=nd,od=function(e){return function(t,A,r){var n=id(t),i=ad(n);if(0===i)return!e&&-1;var s,a=sd(r,i);if(e&&A!=A){for(;i>a;)if((s=n[a++])!=s)return!0}else for(;i>a;a++)if((e||a in n)&&n[a]===A)return e||a||0;return!e&&-1}},ld={includes:od(!0),indexOf:od(!1)},cd=Tc,ud=Ll,hd=ld.indexOf,dd=ah,fd=pl([].push),pd=function(e,t){var A,r=ud(e),n=0,i=[];for(A in r)!cd(dd,A)&&cd(r,A)&&fd(i,A);for(;t.length>n;)cd(r,A=t[n++])&&(~hd(i,A)||fd(i,A));return i},gd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],md=pd,wd=gd.concat("length","prototype");zh.f=Object.getOwnPropertyNames||function(e){return md(e,wd)};var Bd={};Bd.f=Object.getOwnPropertySymbols;var bd=Pl,yd=zh,vd=Bd,Cd=Qu,xd=pl([].concat),Fd=bd("Reflect","ownKeys")||function(e){var t=yd.f(Cd(e)),A=vd.f;return A?xd(t,A(e)):t},Qd=Tc,Ud=Fd,Sd=Jo,Ed=yu,Nd=$o,Ld=Il,_d=/#|\.prototype\./,Id=function(e,t){var A=Td[kd(e)];return A===Od||A!==Hd&&(Ld(t)?Nd(t):!!t)},kd=Id.normalize=function(e){return String(e).replace(_d,".").toLowerCase()},Td=Id.data={},Hd=Id.NATIVE="N",Od=Id.POLYFILL="P",Pd=Id,Dd=Yo,Md=Jo.f,jd=Mu,Rd=Kh,Vd=vc,Kd=function(e,t,A){for(var r=Ud(t),n=Ed.f,i=Sd.f,s=0;s<r.length;s++){var a=r[s];Qd(e,a)||A&&Qd(A,a)||n(e,a,i(t,a))}},zd=Pd,Gd=function(e,t){var A,r,n,i,s,a=e.target,o=e.global,l=e.stat;if(A=o?Dd:l?Dd[a]||Vd(a,{}):Dd[a]&&Dd[a].prototype)for(r in t){if(i=t[r],n=e.dontCallGetSet?(s=Md(A,r))&&s.value:A[r],!zd(o?r:a+(l?".":"#")+r,e.forced)&&void 0!==n){if(typeof i==typeof n)continue;Kd(i,n)}(e.sham||n&&n.sham)&&jd(i,"sham",!0),Rd(A,r,i,e)}},qd=Yo,Wd=Rl,Xd=Bl,Yd=function(e){return Wd.slice(0,e.length)===e},Jd=Yd("Bun/")?"BUN":Yd("Cloudflare-Workers")?"CLOUDFLARE":Yd("Deno/")?"DENO":Yd("Node.js/")?"NODE":qd.Bun&&"string"==typeof Bun.version?"BUN":qd.Deno&&"object"==typeof Deno.version?"DENO":"process"===Xd(qd.process)?"NODE":qd.window&&qd.document?"BROWSER":"REST",$d="NODE"===Jd,Zd=Yo,ef=pl,tf=uc,Af=Tl,rf=function(e){return Af(e)||null===e},nf=String,sf=TypeError,af=function(e,t,A){try{return ef(tf(Object.getOwnPropertyDescriptor(e,t)[A]))}catch(e){}},of=Tl,lf=Sl,cf=function(e){if(rf(e))return e;throw new sf("Can't set "+nf(e)+" as a prototype")},uf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,A={};try{(e=af(Object.prototype,"__proto__","set"))(A,[]),t=A instanceof Array}catch(e){}return function(A,r){return lf(A),cf(r),of(A)?(t?e(A,r):A.__proto__=r,A):A}}():void 0),hf=yu.f,df=Tc,ff=Xc("toStringTag"),pf=function(e,t,A){e&&!A&&(e=e.prototype),e&&!df(e,ff)&&hf(e,ff,{configurable:!0,value:t})},gf=Dh,mf=yu,wf=Pl,Bf=function(e,t,A){return A.get&&gf(A.get,t,{getter:!0}),A.set&&gf(A.set,t,{setter:!0}),mf.f(e,t,A)},bf=Zo,yf=Xc("species"),vf=Dl,Cf=TypeError,xf={};xf[Xc("toStringTag")]="z";var Ff="[object z]"===String(xf),Qf=Il,Uf=Bl,Sf=Xc("toStringTag"),Ef=Object,Nf="Arguments"===Uf(function(){return arguments}()),Lf=Ff?Uf:function(e){var t,A,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(A=function(e,t){try{return e[t]}catch(e){}}(t=Ef(e),Sf))?A:Nf?Uf(t):"Object"===(r=Uf(t))&&Qf(t.callee)?"Arguments":r},_f=pl,If=$o,kf=Il,Tf=Lf,Hf=eh,Of=function(){},Pf=Pl("Reflect","construct"),Df=/^\s*(?:class|function)\b/,Mf=_f(Df.exec),jf=!Df.test(Of),Rf=function(e){if(!kf(e))return!1;try{return Pf(Of,[],e),!0}catch(e){return!1}},Vf=function(e){if(!kf(e))return!1;switch(Tf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jf||!!Mf(Df,Hf(e))}catch(e){return!0}};Vf.sham=!0;var Kf,zf,Gf,qf,Wf=!Pf||If(function(){var e;return Rf(Rf.call)||!Rf(Object)||!Rf(function(){e=!0})||e})?Vf:Rf,Xf=Wf,Yf=ac,Jf=TypeError,$f=Qu,Zf=function(e){if(Xf(e))return e;throw new Jf(Yf(e)+" is not a constructor")},ep=Fl,tp=Xc("species"),Ap=function(e,t){var A,r=$f(e).constructor;return void 0===r||ep(A=$f(r)[tp])?t:Zf(A)},rp=el,np=Function.prototype,ip=np.apply,sp=np.call,ap="object"==typeof Reflect&&Reflect.apply||(rp?sp.bind(ip):function(){return sp.apply(ip,arguments)}),op=Bl,lp=pl,cp=function(e){if("Function"===op(e))return lp(e)},up=uc,hp=el,dp=cp(cp.bind),fp=function(e,t){return up(e),void 0===t?e:hp?dp(e,t):function(){return e.apply(t,arguments)}},pp=Pl("document","documentElement"),gp=pl([].slice),mp=TypeError,wp=/(?:ipad|iphone|ipod).*applewebkit/i.test(Rl),Bp=Yo,bp=ap,yp=fp,vp=Il,Cp=Tc,xp=$o,Fp=pp,Qp=gp,Up=lu,Sp=function(e,t){if(e<t)throw new mp("Not enough arguments");return e},Ep=wp,Np=$d,Lp=Bp.setImmediate,_p=Bp.clearImmediate,Ip=Bp.process,kp=Bp.Dispatch,Tp=Bp.Function,Hp=Bp.MessageChannel,Op=Bp.String,Pp=0,Dp={},Mp="onreadystatechange";xp(function(){Kf=Bp.location});var jp=function(e){if(Cp(Dp,e)){var t=Dp[e];delete Dp[e],t()}},Rp=function(e){return function(){jp(e)}},Vp=function(e){jp(e.data)},Kp=function(e){Bp.postMessage(Op(e),Kf.protocol+"//"+Kf.host)};Lp&&_p||(Lp=function(e){Sp(arguments.length,1);var t=vp(e)?e:Tp(e),A=Qp(arguments,1);return Dp[++Pp]=function(){bp(t,void 0,A)},zf(Pp),Pp},_p=function(e){delete Dp[e]},Np?zf=function(e){Ip.nextTick(Rp(e))}:kp&&kp.now?zf=function(e){kp.now(Rp(e))}:Hp&&!Ep?(qf=(Gf=new Hp).port2,Gf.port1.onmessage=Vp,zf=yp(qf.postMessage,qf)):Bp.addEventListener&&vp(Bp.postMessage)&&!Bp.importScripts&&Kf&&"file:"!==Kf.protocol&&!xp(Kp)?(zf=Kp,Bp.addEventListener("message",Vp,!1)):zf=Mp in Up("script")?function(e){Fp.appendChild(Up("script"))[Mp]=function(){Fp.removeChild(this),jp(e)}}:function(e){setTimeout(Rp(e),0)});var zp={set:Lp,clear:_p},Gp=Yo,qp=Zo,Wp=Object.getOwnPropertyDescriptor,Xp=function(){this.head=null,this.tail=null};Xp.prototype={add:function(e){var t={item:e,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Yp,Jp,$p,Zp,eg,tg=Xp,Ag=/ipad|iphone|ipod/i.test(Rl)&&"undefined"!=typeof Pebble,rg=/web0s(?!.*chrome)/i.test(Rl),ng=Yo,ig=function(e){if(!qp)return Gp[e];var t=Wp(Gp,e);return t&&t.value},sg=fp,ag=zp.set,og=tg,lg=wp,cg=Ag,ug=rg,hg=$d,dg=ng.MutationObserver||ng.WebKitMutationObserver,fg=ng.document,pg=ng.process,gg=ng.Promise,mg=ig("queueMicrotask");if(!mg){var wg=new og,Bg=function(){var e,t;for(hg&&(e=pg.domain)&&e.exit();t=wg.get();)try{t()}catch(e){throw wg.head&&Yp(),e}e&&e.enter()};lg||hg||ug||!dg||!fg?!cg&&gg&&gg.resolve?((Zp=gg.resolve(void 0)).constructor=gg,eg=sg(Zp.then,Zp),Yp=function(){eg(Bg)}):hg?Yp=function(){pg.nextTick(Bg)}:(ag=sg(ag,ng),Yp=function(){ag(Bg)}):(Jp=!0,$p=fg.createTextNode(""),new dg(Bg).observe($p,{characterData:!0}),Yp=function(){$p.data=Jp=!Jp}),mg=function(e){wg.head||Yp(),wg.add(e)}}var bg=mg,yg=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},vg=Yo.Promise,Cg=Yo,xg=vg,Fg=Il,Qg=Pd,Ug=eh,Sg=Xc,Eg=Jd,Ng=Xl;xg&&xg.prototype;var Lg=Sg("species"),_g=!1,Ig=Fg(Cg.PromiseRejectionEvent),kg=Qg("Promise",function(){var e=Ug(xg),t=e!==String(xg);if(!t&&66===Ng)return!0;if(!Ng||Ng<51||!/native code/.test(e)){var A=new xg(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((A.constructor={})[Lg]=r,!(_g=A.then(function(){})instanceof r))return!0}return!(t||"BROWSER"!==Eg&&"DENO"!==Eg||Ig)}),Tg={CONSTRUCTOR:kg,REJECTION_EVENT:Ig,SUBCLASSING:_g},Hg={},Og=uc,Pg=TypeError,Dg=function(e){var t,A;this.promise=new e(function(e,r){if(void 0!==t||void 0!==A)throw new Pg("Bad Promise constructor");t=e,A=r}),this.resolve=Og(t),this.reject=Og(A)};Hg.f=function(e){return new Dg(e)};var Mg,jg,Rg,Vg,Kg=Gd,zg=$d,Gg=Yo,qg=Zd,Wg=rl,Xg=Kh,Yg=uf,Jg=pf,$g=function(e){var t=wf(e);bf&&t&&!t[yf]&&Bf(t,yf,{configurable:!0,get:function(){return this}})},Zg=uc,em=Il,tm=Tl,Am=function(e,t){if(vf(t,e))return e;throw new Cf("Incorrect invocation")},rm=Ap,nm=zp.set,im=bg,sm=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}},am=yg,om=tg,lm=yh,cm=vg,um=Hg,hm="Promise",dm=Tg.CONSTRUCTOR,fm=Tg.REJECTION_EVENT,pm=Tg.SUBCLASSING,gm=lm.getterFor(hm),mm=lm.set,wm=cm&&cm.prototype,Bm=cm,bm=wm,ym=Gg.TypeError,vm=Gg.document,Cm=Gg.process,xm=um.f,Fm=xm,Qm=!!(vm&&vm.createEvent&&Gg.dispatchEvent),Um="unhandledrejection",Sm=function(e){var t;return!(!tm(e)||!em(t=e.then))&&t},Em=function(e,t){var A,r,n,i=t.value,s=1===t.state,a=s?e.ok:e.fail,o=e.resolve,l=e.reject,c=e.domain;try{a?(s||(2===t.rejection&&km(t),t.rejection=1),!0===a?A=i:(c&&c.enter(),A=a(i),c&&(c.exit(),n=!0)),A===e.promise?l(new ym("Promise-chain cycle")):(r=Sm(A))?Wg(r,A,o,l):o(A)):l(i)}catch(e){c&&!n&&c.exit(),l(e)}},Nm=function(e,t){e.notified||(e.notified=!0,im(function(){for(var A,r=e.reactions;A=r.get();)Em(A,e);e.notified=!1,t&&!e.rejection&&_m(e)}))},Lm=function(e,t,A){var r,n;Qm?((r=vm.createEvent("Event")).promise=t,r.reason=A,r.initEvent(e,!1,!0),Gg.dispatchEvent(r)):r={promise:t,reason:A},!fm&&(n=Gg["on"+e])?n(r):e===Um&&sm("Unhandled promise rejection",A)},_m=function(e){Wg(nm,Gg,function(){var t,A=e.facade,r=e.value;if(Im(e)&&(t=am(function(){zg?Cm.emit("unhandledRejection",r,A):Lm(Um,A,r)}),e.rejection=zg||Im(e)?2:1,t.error))throw t.value})},Im=function(e){return 1!==e.rejection&&!e.parent},km=function(e){Wg(nm,Gg,function(){var t=e.facade;zg?Cm.emit("rejectionHandled",t):Lm("rejectionhandled",t,e.value)})},Tm=function(e,t,A){return function(r){e(t,r,A)}},Hm=function(e,t,A){e.done||(e.done=!0,A&&(e=A),e.value=t,e.state=2,Nm(e,!0))},Om=function(e,t,A){if(!e.done){e.done=!0,A&&(e=A);try{if(e.facade===t)throw new ym("Promise can't be resolved itself");var r=Sm(t);r?im(function(){var A={done:!1};try{Wg(r,t,Tm(Om,A,e),Tm(Hm,A,e))}catch(t){Hm(A,t,e)}}):(e.value=t,e.state=1,Nm(e,!1))}catch(t){Hm({done:!1},t,e)}}};if(dm&&(bm=(Bm=function(e){Am(this,bm),Zg(e),Wg(Mg,this);var t=gm(this);try{e(Tm(Om,t),Tm(Hm,t))}catch(e){Hm(t,e)}}).prototype,(Mg=function(e){mm(this,{type:hm,done:!1,notified:!1,parent:!1,reactions:new om,rejection:!1,state:0,value:null})}).prototype=Xg(bm,"then",function(e,t){var A=gm(this),r=xm(rm(this,Bm));return A.parent=!0,r.ok=!em(e)||e,r.fail=em(t)&&t,r.domain=zg?Cm.domain:void 0,0===A.state?A.reactions.add(r):im(function(){Em(r,A)}),r.promise}),jg=function(){var e=new Mg,t=gm(e);this.promise=e,this.resolve=Tm(Om,t),this.reject=Tm(Hm,t)},um.f=xm=function(e){return e===Bm||e===Rg?new jg(e):Fm(e)},em(cm)&&wm!==Object.prototype)){Vg=wm.then,pm||Xg(wm,"then",function(e,t){var A=this;return new Bm(function(e,t){Wg(Vg,A,e,t)}).then(e,t)},{unsafe:!0});try{delete wm.constructor}catch(e){}Yg&&Yg(wm,bm)}Kg({global:!0,constructor:!0,wrap:!0,forced:dm},{Promise:Bm}),Rg=qg.Promise,Jg(Bm,hm,!1),$g(hm);var Pm={},Dm=Pm,Mm=Xc("iterator"),jm=Array.prototype,Rm=Lf,Vm=fc,Km=Fl,zm=Pm,Gm=Xc("iterator"),qm=function(e){if(!Km(e))return Vm(e,Gm)||Vm(e,"@@iterator")||zm[Rm(e)]},Wm=rl,Xm=uc,Ym=Qu,Jm=ac,$m=qm,Zm=TypeError,ew=rl,tw=Qu,Aw=fc,rw=fp,nw=rl,iw=Qu,sw=ac,aw=function(e){return void 0!==e&&(Dm.Array===e||jm[Mm]===e)},ow=nd,lw=Dl,cw=function(e,t){var A=arguments.length<2?$m(e):t;if(Xm(A))return Ym(Wm(A,e));throw new Zm(Jm(e)+" is not iterable")},uw=qm,hw=function(e,t,A){var r,n;tw(e);try{if(!(r=Aw(e,"return"))){if("throw"===t)throw A;return A}r=ew(r,e)}catch(e){n=!0,r=e}if("throw"===t)throw A;if(n)throw r;return tw(r),A},dw=TypeError,fw=function(e,t){this.stopped=e,this.result=t},pw=fw.prototype,gw=function(e,t,A){var r,n,i,s,a,o,l,c=A&&A.that,u=!(!A||!A.AS_ENTRIES),h=!(!A||!A.IS_RECORD),d=!(!A||!A.IS_ITERATOR),f=!(!A||!A.INTERRUPTED),p=rw(t,c),g=function(e){return r&&hw(r,"normal"),new fw(!0,e)},m=function(e){return u?(iw(e),f?p(e[0],e[1],g):p(e[0],e[1])):f?p(e,g):p(e)};if(h)r=e.iterator;else if(d)r=e;else{if(!(n=uw(e)))throw new dw(sw(e)+" is not iterable");if(aw(n)){for(i=0,s=ow(e);s>i;i++)if((a=m(e[i]))&&lw(pw,a))return a;return new fw(!1)}r=cw(e,n)}for(o=h?e.next:r.next;!(l=nw(o,r)).done;){try{a=m(l.value)}catch(e){hw(r,"throw",e)}if("object"==typeof a&&a&&lw(pw,a))return a}return new fw(!1)},mw=Xc("iterator"),ww=!1;try{var Bw=0,bw={next:function(){return{done:!!Bw++}},return:function(){ww=!0}};bw[mw]=function(){return this},Array.from(bw,function(){throw 2})}catch(e){}var yw=vg,vw=function(e,t){try{if(!t&&!ww)return!1}catch(e){return!1}var A=!1;try{var r={};r[mw]=function(){return{next:function(){return{done:A=!0}}}},e(r)}catch(e){}return A},Cw=Tg.CONSTRUCTOR||!vw(function(e){yw.all(e).then(void 0,function(){})}),xw=rl,Fw=uc,Qw=Hg,Uw=yg,Sw=gw;Gd({target:"Promise",stat:!0,forced:Cw},{all:function(e){var t=this,A=Qw.f(t),r=A.resolve,n=A.reject,i=Uw(function(){var A=Fw(t.resolve),i=[],s=0,a=1;Sw(e,function(e){var o=s++,l=!1;a++,xw(A,t,e).then(function(e){l||(l=!0,i[o]=e,--a||r(i))},n)}),--a||r(i)});return i.error&&n(i.value),A.promise}});var Ew=Gd,Nw=Tg.CONSTRUCTOR,Lw=vg,_w=Pl,Iw=Il,kw=Kh,Tw=Lw&&Lw.prototype;if(Ew({target:"Promise",proto:!0,forced:Nw,real:!0},{catch:function(e){return this.then(void 0,e)}}),Iw(Lw)){var Hw=_w("Promise").prototype.catch;Tw.catch!==Hw&&kw(Tw,"catch",Hw,{unsafe:!0})}var Ow=rl,Pw=uc,Dw=Hg,Mw=yg,jw=gw;Gd({target:"Promise",stat:!0,forced:Cw},{race:function(e){var t=this,A=Dw.f(t),r=A.reject,n=Mw(function(){var n=Pw(t.resolve);jw(e,function(e){Ow(n,t,e).then(A.resolve,r)})});return n.error&&r(n.value),A.promise}});var Rw=Hg;Gd({target:"Promise",stat:!0,forced:Tg.CONSTRUCTOR},{reject:function(e){var t=Rw.f(this);return(0,t.reject)(e),t.promise}});var Vw=Qu,Kw=Tl,zw=Hg,Gw=Gd,qw=Tg.CONSTRUCTOR,Ww=function(e,t){if(Vw(e),Kw(t)&&t.constructor===e)return t;var A=zw.f(e);return(0,A.resolve)(t),A.promise};function Xw(e,t,A,r,n,i,s){try{var a=e[i](s),o=a.value}catch(e){return void A(e)}a.done?t(o):Promise.resolve(o).then(r,n)}function Yw(e){return function(){var t=this,A=arguments;return new Promise(function(r,n){var i=e.apply(t,A);function s(e){Xw(i,r,n,s,a,"next",e)}function a(e){Xw(i,r,n,s,a,"throw",e)}s(void 0)})}}Pl("Promise"),Gw({target:"Promise",stat:!0,forced:qw},{resolve:function(e){return Ww(this,e)}});var Jw=Lf,$w=String,Zw=function(e){if("Symbol"===Jw(e))throw new TypeError("Cannot convert a Symbol value to a string");return $w(e)},eB=Qu,tB=function(){var e=eB(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},AB=$o,rB=Yo.RegExp,nB=AB(function(){var e=rB("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),iB=nB||AB(function(){return!rB("a","y").sticky}),sB=nB||AB(function(){var e=rB("^r","gy");return e.lastIndex=2,null!==e.exec("str")}),aB={BROKEN_CARET:sB,MISSED_STICKY:iB,UNSUPPORTED_Y:nB},oB={},lB=pd,cB=gd,uB=Object.keys||function(e){return lB(e,cB)},hB=Zo,dB=vu,fB=yu,pB=Qu,gB=Ll,mB=uB;oB.f=hB&&!dB?Object.defineProperties:function(e,t){pB(e);for(var A,r=gB(t),n=mB(t),i=n.length,s=0;i>s;)fB.f(e,A=n[s++],r[A]);return e};var wB,BB=Qu,bB=oB,yB=gd,vB=ah,CB=pp,xB=lu,FB="prototype",QB="script",UB=sh("IE_PROTO"),SB=function(){},EB=function(e){return"<"+QB+">"+e+"</"+QB+">"},NB=function(e){e.write(EB("")),e.close();var t=e.parentWindow.Object;return e=null,t},LB=function(){try{wB=new ActiveXObject("htmlfile")}catch(e){}var e,t,A;LB="undefined"!=typeof document?document.domain&&wB?NB(wB):(t=xB("iframe"),A="java"+QB+":",t.style.display="none",CB.appendChild(t),t.src=String(A),(e=t.contentWindow.document).open(),e.write(EB("document.F=Object")),e.close(),e.F):NB(wB);for(var r=yB.length;r--;)delete LB[FB][yB[r]];return LB()};vB[UB]=!0;var _B,IB,kB=Object.create||function(e,t){var A;return null!==e?(SB[FB]=BB(e),A=new SB,SB[FB]=null,A[UB]=e):A=LB(),void 0===t?A:bB.f(A,t)},TB=$o,HB=Yo.RegExp,OB=TB(function(){var e=HB(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}),PB=$o,DB=Yo.RegExp,MB=PB(function(){var e=DB("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}),jB=rl,RB=pl,VB=Zw,KB=tB,zB=aB,GB=kB,qB=yh.get,WB=OB,XB=MB,YB=Ec("native-string-replace",String.prototype.replace),JB=RegExp.prototype.exec,$B=JB,ZB=RB("".charAt),eb=RB("".indexOf),tb=RB("".replace),Ab=RB("".slice),rb=(IB=/b*/g,jB(JB,_B=/a/,"a"),jB(JB,IB,"a"),0!==_B.lastIndex||0!==IB.lastIndex),nb=zB.BROKEN_CARET,ib=void 0!==/()??/.exec("")[1];(rb||ib||nb||WB||XB)&&($B=function(e){var t,A,r,n,i,s,a,o=this,l=qB(o),c=VB(e),u=l.raw;if(u)return u.lastIndex=o.lastIndex,t=jB($B,u,c),o.lastIndex=u.lastIndex,t;var h=l.groups,d=nb&&o.sticky,f=jB(KB,o),p=o.source,g=0,m=c;if(d&&(f=tb(f,"y",""),-1===eb(f,"g")&&(f+="g"),m=Ab(c,o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==ZB(c,o.lastIndex-1))&&(p="(?: "+p+")",m=" "+m,g++),A=new RegExp("^(?:"+p+")",f)),ib&&(A=new RegExp("^"+p+"$(?!\\s)",f)),rb&&(r=o.lastIndex),n=jB(JB,d?A:o,m),d?n?(n.input=Ab(n.input,g),n[0]=Ab(n[0],g),n.index=o.lastIndex,o.lastIndex+=n[0].length):o.lastIndex=0:rb&&n&&(o.lastIndex=o.global?n.index+n[0].length:r),ib&&n&&n.length>1&&jB(YB,n[0],A,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)}),n&&h)for(n.groups=s=GB(null),i=0;i<h.length;i++)s[(a=h[i])[0]]=n[a[1]];return n});var sb=$B;Gd({target:"RegExp",proto:!0,forced:/./.exec!==sb},{exec:sb});var ab=rl,ob=Kh,lb=sb,cb=$o,ub=Xc,hb=Mu,db=ub("species"),fb=RegExp.prototype,pb=function(e,t,A,r){var n=ub(e),i=!cb(function(){var t={};return t[n]=function(){return 7},7!==""[e](t)}),s=i&&!cb(function(){var t=!1,A=/a/;if("split"===e){var r={};r[db]=function(){return A},(A={constructor:r,flags:""})[n]=/./[n]}return A.exec=function(){return t=!0,null},A[n](""),!t});if(!i||!s||A){var a=/./[n],o=t(n,""[e],function(e,t,A,r,n){var s=t.exec;return s===lb||s===fb.exec?i&&!n?{done:!0,value:ab(a,t,A,r)}:{done:!0,value:ab(e,A,t,r)}:{done:!1}});ob(String.prototype,e,o[0]),ob(fb,n,o[1])}r&&hb(fb[n],"sham",!0)},gb=pl,mb=Yh,wb=Zw,Bb=Sl,bb=gb("".charAt),yb=gb("".charCodeAt),vb=gb("".slice),Cb=function(e){return function(t,A){var r,n,i=wb(Bb(t)),s=mb(A),a=i.length;return s<0||s>=a?e?"":void 0:(r=yb(i,s))<55296||r>56319||s+1===a||(n=yb(i,s+1))<56320||n>57343?e?bb(i,s):r:e?vb(i,s,s+2):n-56320+(r-55296<<10)+65536}},xb={codeAt:Cb(!1),charAt:Cb(!0)}.charAt,Fb=function(e,t,A){return t+(A?xb(e,t).length:1)},Qb=$o,Ub=Yo.RegExp,Sb=!Qb(function(){var e=!0;try{Ub(".","d")}catch(t){e=!1}var t={},A="",r=e?"dgimsy":"gimsy",n=function(e,r){Object.defineProperty(t,e,{get:function(){return A+=r,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(i.hasIndices="d"),i)n(s,i[s]);return Object.getOwnPropertyDescriptor(Ub.prototype,"flags").get.call(t)!==r||A!==r}),Eb=rl,Nb=Tc,Lb=Dl,_b={correct:Sb},Ib=tB,kb=RegExp.prototype,Tb=_b.correct?function(e){return e.flags}:function(e){return _b.correct||!Lb(kb,e)||Nb(e,"flags")?e.flags:Eb(Ib,e)},Hb=rl,Ob=Qu,Pb=Il,Db=Bl,Mb=sb,jb=TypeError,Rb=function(e,t){var A=e.exec;if(Pb(A)){var r=Hb(A,e,t);return null!==r&&Ob(r),r}if("RegExp"===Db(e))return Hb(Mb,e,t);throw new jb("RegExp#exec called on incompatible receiver")},Vb=rl,Kb=pb,zb=Qu,Gb=Tl,qb=Ad,Wb=Zw,Xb=Sl,Yb=fc,Jb=Fb,$b=Tb,Zb=Rb,ey=pl("".indexOf);Kb("match",function(e,t,A){return[function(t){var A=Xb(this),r=Gb(t)?Yb(t,e):void 0;return r?Vb(r,t,A):new RegExp(t)[e](Wb(A))},function(e){var r=zb(this),n=Wb(e),i=A(t,r,n);if(i.done)return i.value;var s=Wb($b(r));if(-1===ey(s,"g"))return Zb(r,n);var a=-1!==ey(s,"u");r.lastIndex=0;for(var o,l=[],c=0;null!==(o=Zb(r,n));){var u=Wb(o[0]);l[c]=u,""===u&&(r.lastIndex=Jb(n,qb(r.lastIndex),a)),c++}return 0===c?null:l}]});var ty=pl,Ay=_c,ry=Math.floor,ny=ty("".charAt),iy=ty("".replace),sy=ty("".slice),ay=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,oy=/\$([$&'`]|\d{1,2})/g,ly=ap,cy=rl,uy=pl,hy=pb,dy=$o,fy=Qu,py=Il,gy=Tl,my=Yh,wy=Ad,By=Zw,by=Sl,yy=Fb,vy=fc,Cy=function(e,t,A,r,n,i){var s=A+e.length,a=r.length,o=oy;return void 0!==n&&(n=Ay(n),o=ay),iy(i,o,function(i,o){var l;switch(ny(o,0)){case"$":return"$";case"&":return e;case"`":return sy(t,0,A);case"'":return sy(t,s);case"<":l=n[sy(o,1,-1)];break;default:var c=+o;if(0===c)return i;if(c>a){var u=ry(c/10);return 0===u?i:u<=a?void 0===r[u-1]?ny(o,1):r[u-1]+ny(o,1):i}l=r[c-1]}return void 0===l?"":l})},xy=Tb,Fy=Rb,Qy=Xc("replace"),Uy=Math.max,Sy=Math.min,Ey=uy([].concat),Ny=uy([].push),Ly=uy("".indexOf),_y=uy("".slice),Iy=function(e){return void 0===e?e:String(e)},ky="$0"==="a".replace(/./,"$0"),Ty=!!/./[Qy]&&""===/./[Qy]("a","$0"),Hy=!dy(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")});hy("replace",function(e,t,A){var r=Ty?"$":"$0";return[function(e,A){var r=by(this),n=gy(e)?vy(e,Qy):void 0;return n?cy(n,e,r,A):cy(t,By(r),e,A)},function(e,n){var i=fy(this),s=By(e);if("string"==typeof n&&-1===Ly(n,r)&&-1===Ly(n,"$<")){var a=A(t,i,s,n);if(a.done)return a.value}var o=py(n);o||(n=By(n));var l,c=By(xy(i)),u=-1!==Ly(c,"g");u&&(l=-1!==Ly(c,"u"),i.lastIndex=0);for(var h,d=[];null!==(h=Fy(i,s))&&(Ny(d,h),u);){""===By(h[0])&&(i.lastIndex=yy(s,wy(i.lastIndex),l))}for(var f="",p=0,g=0;g<d.length;g++){for(var m,w=By((h=d[g])[0]),B=Uy(Sy(my(h.index),s.length),0),b=[],y=1;y<h.length;y++)Ny(b,Iy(h[y]));var v=h.groups;if(o){var C=Ey([w],b,B,s);void 0!==v&&Ny(C,v),m=By(ly(n,void 0,C))}else m=Cy(w,s,B,b,v,n);B>=p&&(f+=_y(s,p,B)+m,p=B+w.length)}return f+_y(s,p)}]},!Hy||!ky||Ty);var Oy,Py=Tl,Dy=Bl,My=Xc("match"),jy=function(e){var t;return Py(e)&&(void 0!==(t=e[My])?!!t:"RegExp"===Dy(e))},Ry=TypeError,Vy=function(e){if(jy(e))throw new Ry("The method doesn't accept regular expressions");return e},Ky=Xc("match"),zy=function(e){var t=/./;try{"/./"[e](t)}catch(A){try{return t[Ky]=!1,"/./"[e](t)}catch(e){}}return!1},Gy=Gd,qy=cp,Wy=Jo.f,Xy=Ad,Yy=Zw,Jy=Vy,$y=Sl,Zy=zy,ev=qy("".slice),tv=Math.min,Av=Zy("startsWith");Gy({target:"String",proto:!0,forced:!!(Av||(Oy=Wy(String.prototype,"startsWith"),!Oy||Oy.writable))&&!Av},{startsWith:function(e){var t=Yy($y(this));Jy(e);var A=Xy(tv(arguments.length>1?arguments[1]:void 0,t.length)),r=Yy(e);return ev(t,A,A+r.length)===r}});var rv=Xc,nv=kB,iv=yu.f,sv=rv("unscopables"),av=Array.prototype;void 0===av[sv]&&iv(av,sv,{configurable:!0,value:nv(null)});var ov,lv,cv,uv=!$o(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),hv=Tc,dv=Il,fv=_c,pv=uv,gv=sh("IE_PROTO"),mv=Object,wv=mv.prototype,Bv=pv?mv.getPrototypeOf:function(e){var t=fv(e);if(hv(t,gv))return t[gv];var A=t.constructor;return dv(A)&&t instanceof A?A.prototype:t instanceof mv?wv:null},bv=$o,yv=Il,vv=Tl,Cv=Bv,xv=Kh,Fv=Xc("iterator"),Qv=!1;[].keys&&("next"in(cv=[].keys())?(lv=Cv(Cv(cv)))!==Object.prototype&&(ov=lv):Qv=!0);var Uv=!vv(ov)||bv(function(){var e={};return ov[Fv].call(e)!==e});Uv&&(ov={}),yv(ov[Fv])||xv(ov,Fv,function(){return this});var Sv={IteratorPrototype:ov,BUGGY_SAFARI_ITERATORS:Qv},Ev=Sv.IteratorPrototype,Nv=kB,Lv=cl,_v=pf,Iv=Pm,kv=function(){return this},Tv=Gd,Hv=rl,Ov=Il,Pv=function(e,t,A,r){var n=t+" Iterator";return e.prototype=Nv(Ev,{next:Lv(+!r,A)}),_v(e,n,!1),Iv[n]=kv,e},Dv=Bv,Mv=uf,jv=pf,Rv=Mu,Vv=Kh,Kv=Pm,zv=qu.PROPER,Gv=qu.CONFIGURABLE,qv=Sv.IteratorPrototype,Wv=Sv.BUGGY_SAFARI_ITERATORS,Xv=Xc("iterator"),Yv="keys",Jv="values",$v="entries",Zv=function(){return this},eC=Ll,tC=function(e){av[sv][e]=!0},AC=Pm,rC=yh,nC=yu.f,iC=function(e,t,A,r,n,i,s){Pv(A,t,r);var a,o,l,c=function(e){if(e===n&&p)return p;if(!Wv&&e&&e in d)return d[e];switch(e){case Yv:case Jv:case $v:return function(){return new A(this,e)}}return function(){return new A(this)}},u=t+" Iterator",h=!1,d=e.prototype,f=d[Xv]||d["@@iterator"]||n&&d[n],p=!Wv&&f||c(n),g="Array"===t&&d.entries||f;if(g&&(a=Dv(g.call(new e)))!==Object.prototype&&a.next&&(Dv(a)!==qv&&(Mv?Mv(a,qv):Ov(a[Xv])||Vv(a,Xv,Zv)),jv(a,u,!0)),zv&&n===Jv&&f&&f.name!==Jv&&(Gv?Rv(d,"name",Jv):(h=!0,p=function(){return Hv(f,this)})),n)if(o={values:c(Jv),keys:i?p:c(Yv),entries:c($v)},s)for(l in o)(Wv||h||!(l in d))&&Vv(d,l,o[l]);else Tv({target:t,proto:!0,forced:Wv||h},o);return d[Xv]!==p&&Vv(d,Xv,p,{name:n}),Kv[t]=p,o},sC=function(e,t){return{value:e,done:t}},aC=Zo,oC="Array Iterator",lC=rC.set,cC=rC.getterFor(oC),uC=iC(Array,"Array",function(e,t){lC(this,{type:oC,target:eC(e),index:0,kind:t})},function(){var e=cC(this),t=e.target,A=e.index++;if(!t||A>=t.length)return e.target=null,sC(void 0,!0);switch(e.kind){case"keys":return sC(A,!1);case"values":return sC(t[A],!1)}return sC([A,t[A]],!1)},"values"),hC=AC.Arguments=AC.Array;if(tC("keys"),tC("values"),tC("entries"),aC&&"values"!==hC.name)try{nC(hC,"name",{value:"values"})}catch(e){}var dC=lu("span").classList,fC=dC&&dC.constructor&&dC.constructor.prototype,pC=fC===Object.prototype?void 0:fC,gC=Yo,mC={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},wC=pC,BC=uC,bC=Mu,yC=pf,vC=Xc("iterator"),CC=BC.values,xC=function(e,t){if(e){if(e[vC]!==CC)try{bC(e,vC,CC)}catch(t){e[vC]=CC}if(yC(e,t,!0),mC[t])for(var A in BC)if(e[A]!==BC[A])try{bC(e,A,BC[A])}catch(t){e[A]=BC[A]}}};for(var FC in mC)xC(gC[FC]&&gC[FC].prototype,FC);function QC(e){var t=function(e,t){if("object"!=pe(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var r=A.call(e,t||"default");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pe(t)?t:t+""}function UC(e,t,A){return(t=QC(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}xC(wC,"DOMTokenList");var SC=uc,EC=_c,NC=xl,LC=nd,_C=TypeError,IC="Reduce of empty array with no initial value",kC=function(e){return function(t,A,r,n){var i=EC(t),s=NC(i),a=LC(i);if(SC(A),0===a&&r<2)throw new _C(IC);var o=e?a-1:0,l=e?-1:1;if(r<2)for(;;){if(o in s){n=s[o],o+=l;break}if(o+=l,e?o<0:a<=o)throw new _C(IC)}for(;e?o>=0:a>o;o+=l)o in s&&(n=A(n,s[o],o,i));return n}},TC={left:kC(!1),right:kC(!0)},HC=$o,OC=function(e,t){var A=[][e];return!!A&&HC(function(){A.call(null,t||function(){return 1},1)})},PC=TC.left;Gd({target:"Array",proto:!0,forced:!$d&&Xl>79&&Xl<83||!OC("reduce")},{reduce:function(e){var t=arguments.length;return PC(this,e,t,t>1?arguments[1]:void 0)}});var DC=Gd,MC=cp,jC=Jo.f,RC=Ad,VC=Zw,KC=Vy,zC=Sl,GC=zy,qC=MC("".slice),WC=Math.min,XC=GC("endsWith"),YC=!XC&&!!function(){var e=jC(String.prototype,"endsWith");return e&&!e.writable}();DC({target:"String",proto:!0,forced:!YC&&!XC},{endsWith:function(e){var t=VC(zC(this));KC(e);var A=arguments.length>1?arguments[1]:void 0,r=t.length,n=void 0===A?r:WC(RC(A),r),i=VC(e);return qC(t,n-i.length,n)===i}});var JC=rl,$C=pl,ZC=pb,ex=Qu,tx=Tl,Ax=Sl,rx=Ap,nx=Fb,ix=Ad,sx=Zw,ax=fc,ox=Rb,lx=$o,cx=aB.UNSUPPORTED_Y,ux=Math.min,hx=$C([].push),dx=$C("".slice),fx=!lx(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var A="ab".split(e);return 2!==A.length||"a"!==A[0]||"b"!==A[1]}),px="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;ZC("split",function(e,t,A){var r="0".split(void 0,0).length?function(e,A){return void 0===e&&0===A?[]:JC(t,this,e,A)}:t;return[function(t,A){var n=Ax(this),i=tx(t)?ax(t,e):void 0;return i?JC(i,t,n,A):JC(r,sx(n),t,A)},function(e,n){var i=ex(this),s=sx(e);if(!px){var a=A(r,i,s,n,r!==t);if(a.done)return a.value}var o=rx(i,RegExp),l=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(cx?"g":"y"),u=new o(cx?"^(?:"+i.source+")":i,c),h=void 0===n?4294967295:n>>>0;if(0===h)return[];if(0===s.length)return null===ox(u,s)?[s]:[];for(var d=0,f=0,p=[];f<s.length;){u.lastIndex=cx?0:f;var g,m=ox(u,cx?dx(s,f):s);if(null===m||(g=ux(ix(u.lastIndex+(cx?f:0)),s.length))===d)f=nx(s,f,l);else{if(hx(p,dx(s,d,f)),p.length===h)return p;for(var w=1;w<=m.length-1;w++)if(hx(p,m[w]),p.length===h)return p;f=d=g}}return hx(p,dx(s,d)),p}]},px||!fx,cx);var gx={exports:{}},mx={exports:{}};(function(){var e,t,A,r,n,i;"undefined"!=typeof performance&&null!==performance&&performance.now?mx.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(mx.exports=function(){return(e()-n)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),i=1e9*process.uptime(),n=r-i):Date.now?(mx.exports=function(){return Date.now()-A},A=Date.now()):(mx.exports=function(){return(new Date).getTime()-A},A=(new Date).getTime())}).call(o);for(var wx=mx.exports,Bx="undefined"==typeof window?o:window,bx=["moz","webkit"],yx="AnimationFrame",vx=Bx["request"+yx],Cx=Bx["cancel"+yx]||Bx["cancelRequest"+yx],xx=0;!vx&&xx<bx.length;xx++)vx=Bx[bx[xx]+"Request"+yx],Cx=Bx[bx[xx]+"Cancel"+yx]||Bx[bx[xx]+"CancelRequest"+yx];if(!vx||!Cx){var Fx=0,Qx=0,Ux=[],Sx=1e3/60;vx=function(e){if(0===Ux.length){var t=wx(),A=Math.max(0,Sx-(t-Fx));Fx=A+t,setTimeout(function(){var e=Ux.slice(0);Ux.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(Fx)}catch(e){setTimeout(function(){throw e},0)}},Math.round(A))}return Ux.push({handle:++Qx,callback:e,cancelled:!1}),Qx},Cx=function(e){for(var t=0;t<Ux.length;t++)Ux[t].handle===e&&(Ux[t].cancelled=!0)}}gx.exports=function(e){return vx.call(Bx,e)},gx.exports.cancel=function(){Cx.apply(Bx,arguments)},gx.exports.polyfill=function(e){e||(e=Bx),e.requestAnimationFrame=vx,e.cancelAnimationFrame=Cx};var Ex=l(gx.exports),Nx="\t\n\v\f\r \u2028\u2029\ufeff",Lx=Sl,_x=Zw,Ix=Nx,kx=pl("".replace),Tx=RegExp("^["+Ix+"]+"),Hx=RegExp("(^|[^"+Ix+"])["+Ix+"]+$"),Ox=function(e){return function(t){var A=_x(Lx(t));return 1&e&&(A=kx(A,Tx,"")),2&e&&(A=kx(A,Hx,"$1")),A}},Px={start:Ox(1),end:Ox(2),trim:Ox(3)},Dx=qu.PROPER,Mx=$o,jx=Nx,Rx=Px.trim;Gd({target:"String",proto:!0,forced:function(e){return Mx(function(){return!!jx[e]()||"
"!=="
"[e]()||Dx&&jx[e].name!==e})}("trim")},{trim:function(){return Rx(this)}});var Vx=function(e){this.ok=!1,this.alpha=1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=t[e]||e;for(var A=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<A.length;r++){var n=A[r].re,i=A[r].process,s=n.exec(e);if(s){var a=i(s);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[3]),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.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),A=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==A.length&&(A="0"+A),"#"+e+t+A},this.getHelpXML=function(){for(var e=new Array,r=0;r<A.length;r++)for(var n=A[r].example,i=0;i<n.length;i++)e[e.length]=n[i];for(var s in t)e[e.length]=s;var a=document.createElement("ul");a.setAttribute("id","rgbcolor-examples");for(r=0;r<e.length;r++)try{var o=document.createElement("li"),l=new RGBColor(e[r]),c=document.createElement("div");c.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex(),c.appendChild(document.createTextNode("test"));var u=document.createTextNode(" "+e[r]+" -> "+l.toRGB()+" -> "+l.toHex());o.appendChild(c),o.appendChild(u),a.appendChild(o)}catch(e){}return a}},Kx=l(Vx),zx=Gd,Gx=ld.indexOf,qx=OC,Wx=cp([].indexOf),Xx=!!Wx&&1/Wx([1],1,-0)<0;zx({target:"Array",proto:!0,forced:Xx||!qx("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Xx?Wx(this,e,t)||0:Gx(this,e,t)}});var Yx=Gd,Jx=Vy,$x=Sl,Zx=Zw,eF=zy,tF=pl("".indexOf);Yx({target:"String",proto:!0,forced:!eF("includes")},{includes:function(e){return!!~tF(Zx($x(this)),Zx(Jx(e)),arguments.length>1?arguments[1]:void 0)}});var AF=Bl,rF=Gd,nF=Array.isArray||function(e){return"Array"===AF(e)},iF=pl([].reverse),sF=[1,2];rF({target:"Array",proto:!0,forced:String(sF)===String(sF.reverse())},{reverse:function(){return nF(this)&&(this.length=this.length),iF(this)}});
|
|
310
310
|
/*! *****************************************************************************
|
|
311
311
|
Copyright (c) Microsoft Corporation.
|
|
312
312
|
|
|
@@ -361,5 +361,5 @@ var aF=function(e,t){return(aF=Object.setPrototypeOf||{__proto__:[]}instanceof A
|
|
|
361
361
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
362
362
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
363
363
|
*/
|
|
364
|
-
var DF=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],MF=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function jF(e,t,A,r,n,i){if(!(isNaN(i)||i<1)){i|=0;var s=function(e,t,A,r,n){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==PF(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var i=e.getContext("2d");try{return i.getImageData(t,A,r,n)}catch(e){throw new Error("unable to access image data: "+e)}}(e,t,A,r,n);s=function(e,t,A,r,n,i){for(var s,a=e.data,o=2*i+1,l=r-1,c=n-1,u=i+1,h=u*(u+1)/2,d=new RF,f=d,p=1;p<o;p++)f=f.next=new RF,p===u&&(s=f);f.next=d;for(var g=null,m=null,w=0,B=0,b=DF[i],y=MF[i],v=0;v<n;v++){f=d;for(var C=a[B],x=a[B+1],F=a[B+2],Q=a[B+3],U=0;U<u;U++)f.r=C,f.g=x,f.b=F,f.a=Q,f=f.next;for(var S=0,E=0,N=0,L=0,_=u*C,I=u*x,k=u*F,T=u*Q,H=h*C,O=h*x,P=h*F,D=h*Q,M=1;M<u;M++){var j=B+((l<M?l:M)<<2),R=a[j],V=a[j+1],K=a[j+2],G=a[j+3],z=u-M;H+=(f.r=R)*z,O+=(f.g=V)*z,P+=(f.b=K)*z,D+=(f.a=G)*z,S+=R,E+=V,N+=K,L+=G,f=f.next}g=d,m=s;for(var q=0;q<r;q++){var W=D*b>>>y;if(a[B+3]=W,0!==W){var X=255/W;a[B]=(H*b>>>y)*X,a[B+1]=(O*b>>>y)*X,a[B+2]=(P*b>>>y)*X}else a[B]=a[B+1]=a[B+2]=0;H-=_,O-=I,P-=k,D-=T,_-=g.r,I-=g.g,k-=g.b,T-=g.a;var Y=q+i+1;Y=w+(Y<l?Y:l)<<2,H+=S+=g.r=a[Y],O+=E+=g.g=a[Y+1],P+=N+=g.b=a[Y+2],D+=L+=g.a=a[Y+3],g=g.next;var J=m,$=J.r,Z=J.g,ee=J.b,te=J.a;_+=$,I+=Z,k+=ee,T+=te,S-=$,E-=Z,N-=ee,L-=te,m=m.next,B+=4}w+=r}for(var Ae=0;Ae<r;Ae++){var re=a[B=Ae<<2],ne=a[B+1],ie=a[B+2],se=a[B+3],ae=u*re,oe=u*ne,le=u*ie,ce=u*se,ue=h*re,he=h*ne,de=h*ie,fe=h*se;f=d;for(var pe=0;pe<u;pe++)f.r=re,f.g=ne,f.b=ie,f.a=se,f=f.next;for(var ge=r,me=0,we=0,Be=0,be=0,ye=1;ye<=i;ye++){B=ge+Ae<<2;var ve=u-ye;ue+=(f.r=re=a[B])*ve,he+=(f.g=ne=a[B+1])*ve,de+=(f.b=ie=a[B+2])*ve,fe+=(f.a=se=a[B+3])*ve,be+=re,me+=ne,we+=ie,Be+=se,f=f.next,ye<c&&(ge+=r)}B=Ae,g=d,m=s;for(var Ce=0;Ce<n;Ce++){var xe=B<<2;a[xe+3]=se=fe*b>>>y,se>0?(se=255/se,a[xe]=(ue*b>>>y)*se,a[xe+1]=(he*b>>>y)*se,a[xe+2]=(de*b>>>y)*se):a[xe]=a[xe+1]=a[xe+2]=0,ue-=ae,he-=oe,de-=le,fe-=ce,ae-=g.r,oe-=g.g,le-=g.b,ce-=g.a,xe=Ae+((xe=Ce+u)<c?xe:c)*r<<2,ue+=be+=g.r=a[xe],he+=me+=g.g=a[xe+1],de+=we+=g.b=a[xe+2],fe+=Be+=g.a=a[xe+3],g=g.next,ae+=re=m.r,oe+=ne=m.g,le+=ie=m.b,ce+=se=m.a,be-=re,me-=ne,we-=ie,Be-=se,m=m.next,B+=r}}return e}(s,0,0,r,n,i),e.getContext("2d").putImageData(s,t,A)}}var RF=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var VF=Object.freeze({__proto__:null,offscreen:function(){var{DOMParser:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas:(e,t)=>new OffscreenCanvas(e,t),createImage:e=>Yw(function*(){var t=yield fetch(e),A=yield t.blob();return yield createImageBitmap(A)})()};return"undefined"==typeof DOMParser&&void 0!==e||Reflect.deleteProperty(t,"DOMParser"),t},node:function(e){var{DOMParser:t,canvas:A,fetch:r}=e;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:A.createCanvas,createImage:A.loadImage}}});function KF(e){return e.replace(/(?!\u3000)\s+/gm," ")}function GF(e){return e.replace(/^[\n \t]+/,"")}function zF(e){return e.replace(/[\n \t]+$/,"")}function qF(e){return((e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var WF=/^[A-Z-]+$/;function XF(e){return WF.test(e)?e.toLowerCase():e}function YF(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function JF(e){if(!e.startsWith("rgb"))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,(e,A)=>t--&&A?String(Math.round(parseFloat(e))):e)}var $F=/(\[[^\]]+\])/g,ZF=/(#[^\s+>~.[:]+)/g,eQ=/(\.[^\s+>~.[:]+)/g,tQ=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,AQ=/(:[\w-]+\([^)]*\))/gi,rQ=/(:[^\s+>~.[:]+)/g,nQ=/([^\s+>~.[:]+)/g;function iQ(e,t){var A=t.exec(e);return A?[e.replace(t," "),A.length]:[e,0]}function sQ(e){var t=[0,0,0],A=e.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[A,r]=iQ(A,$F),t[1]+=r,[A,r]=iQ(A,ZF),t[0]+=r,[A,r]=iQ(A,eQ),t[1]+=r,[A,r]=iQ(A,tQ),t[2]+=r,[A,r]=iQ(A,AQ),t[1]+=r,[A,r]=iQ(A,rQ),t[1]+=r,A=A.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[A,r]=iQ(A,nQ),t[2]+=r,t.join("")}var aQ=1e-8;function oQ(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function lQ(e,t){return(e[0]*t[0]+e[1]*t[1])/(oQ(e)*oQ(t))}function cQ(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(lQ(e,t))}function uQ(e){return e*e*e}function hQ(e){return 3*e*e*(1-e)}function dQ(e){return 3*e*(1-e)*(1-e)}function fQ(e){return(1-e)*(1-e)*(1-e)}function pQ(e){return e*e}function gQ(e){return 2*e*(1-e)}function mQ(e){return(1-e)*(1-e)}class wQ{constructor(e,t,A){this.document=e,this.name=t,this.value=A,this.isNormalizedColor=!1}static empty(e){return new wQ(e,"EMPTY","")}split(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:t,name:A}=this;return KF(this.getString()).trim().split(e).map(e=>new wQ(t,A,e))}hasValue(e){var{value:t}=this;return null!==t&&""!==t&&(e||0!==t)&&void 0!==t}isString(e){var{value:t}=this,A="string"==typeof t;return A&&e?e.test(t):A}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return void 0===e||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return void 0===e?0:parseFloat(e);var{value:t}=this,A=parseFloat(t);return this.isString(/%$/)&&(A/=100),A}getString(e){return void 0===e||this.hasValue()?void 0===this.value?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=JF(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[A,r]="boolean"==typeof e?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&r:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(A);default:var i=this.getNumber();return t&&i<1?i*n.computeSize(A):i}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var A=this.getDefinition();if(!A)return null;if("function"==typeof A.createGradient)return A.createGradient(this.document.ctx,e,t);if("function"==typeof A.createPattern){if(A.getHrefAttribute().hasValue()){var r=A.getAttribute("patternTransform");A=A.getHrefAttribute().getDefinition(),r.hasValue()&&A.getAttribute("patternTransform",!0).setValue(r.value)}return A.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?wQ.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),A=t.length,r=0,n=0;n<A&&(","===t[n]&&r++,3!==r);n++);if(e.hasValue()&&this.isString()&&3!==r){var i=new Kx(t);i.ok&&(i.alpha=e.getNumber(),t=i.toRGBA())}return new wQ(this.document,this.name,t)}}wQ.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class BQ{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return"number"==typeof e?e:"x"===e?this.width:"y"===e?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class bQ{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[A=t,r=t]=qF(e);return new bQ(A,r)}static parseScale(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[A=t,r=A]=qF(e);return new bQ(A,r)}static parsePath(e){for(var t=qF(e),A=t.length,r=[],n=0;n<A;n+=2)r.push(new bQ(t[n],t[n+1]));return r}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:A}=this,r=t*e[0]+A*e[2]+e[4],n=t*e[1]+A*e[3]+e[5];this.x=r,this.y=n}}class yQ{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:A}=this,r=e.ctx.canvas;r.onclick=t,r.onmousemove=A,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:A}=this,{style:r}=e.ctx.canvas;r&&(r.cursor=""),t.forEach((e,t)=>{for(var{run:r}=e,n=A[t];n;)r(n),n=n.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(this.working&&t){var{events:A,eventElements:r}=this;A.forEach((A,n)=>{var{x:i,y:s}=A;!r[n]&&t.isPointInPath&&t.isPointInPath(i,s)&&(r[n]=e)})}}checkBoundingBox(e,t){if(this.working&&t){var{events:A,eventElements:r}=this;A.forEach((A,n)=>{var{x:i,y:s}=A;!r[n]&&t.isPointInBox(i,s)&&(r[n]=e)})}}mapXY(e,t){for(var{window:A,ctx:r}=this.screen,n=new bQ(e,t),i=r.canvas;i;)n.x-=i.offsetLeft,n.y-=i.offsetTop,i=i.offsetParent;return A.scrollX&&(n.x+=A.scrollX),A.scrollY&&(n.y+=A.scrollY),n}onClick(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:A,run(e){e.onClick&&e.onClick()}})}onMouseMove(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:A,run(e){e.onMouseMove&&e.onMouseMove()}})}}var vQ="undefined"!=typeof window?window:null,CQ="undefined"!=typeof fetch?fetch.bind(void 0):null;class xQ{constructor(e){var{fetch:t=CQ,window:A=vQ}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new BQ,this.mouse=new yQ(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=A,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(e=>e());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:A,aspectRatio:r,width:n,desiredWidth:i,height:s,desiredHeight:a,minX:o=0,minY:l=0,refX:c,refY:u,clip:h=!1,clipX:d=0,clipY:f=0}=e,p=KF(r).replace(/^defer\s/,""),[g,m]=p.split(" "),w=g||"xMidYMid",B=m||"meet",b=n/i,y=s/a,v=Math.min(b,y),C=Math.max(b,y),x=i,F=a;"meet"===B&&(x*=v,F*=v),"slice"===B&&(x*=C,F*=C);var Q=new wQ(t,"refX",c),U=new wQ(t,"refY",u),S=Q.hasValue()&&U.hasValue();if(S&&A.translate(-v*Q.getPixels("x"),-v*U.getPixels("y")),h){var E=v*d,N=v*f;A.beginPath(),A.moveTo(E,N),A.lineTo(n,N),A.lineTo(n,s),A.lineTo(E,s),A.closePath(),A.clip()}if(!S){var L="meet"===B&&v===y,_="slice"===B&&C===y,I="meet"===B&&v===b,k="slice"===B&&C===b;w.startsWith("xMid")&&(L||_)&&A.translate(n/2-x/2,0),w.endsWith("YMid")&&(I||k)&&A.translate(0,s/2-F/2),w.startsWith("xMax")&&(L||_)&&A.translate(n-x,0),w.endsWith("YMax")&&(I||k)&&A.translate(0,s-F)}switch(!0){case"none"===w:A.scale(b,y);break;case"meet"===B:A.scale(v,v);break;case"slice"===B:A.scale(C,C)}A.translate(-o,-l)}start(e){var{enableRedraw:t=!1,ignoreMouse:A=!1,ignoreAnimation:r=!1,ignoreDimensions:n=!1,ignoreClear:i=!1,forceRedraw:s,scaleWidth:a,scaleHeight:o,offsetX:l,offsetY:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:u,mouse:h}=this,d=1e3/u;if(this.frameDuration=d,this.readyPromise=new Promise(e=>{this.resolveReady=e}),this.isReady()&&this.render(e,n,i,a,o,l,c),t){var f=Date.now(),p=f,g=0,m=()=>{f=Date.now(),(g=f-p)>=d&&(p=f-g%d,this.shouldUpdate(r,s)&&(this.render(e,n,i,a,o,l,c),h.runEvents())),this.intervalId=Ex(m)};A||h.start(),this.intervalId=Ex(m)}}stop(){this.intervalId&&(Ex.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:A}=this;if(this.animations.reduce((e,t)=>t.update(A)||e,!1))return!0}return!("function"!=typeof t||!t())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(e,t,A,r,n,i,s){var{CLIENT_WIDTH:a,CLIENT_HEIGHT:o,viewPort:l,ctx:c,isFirstRender:u}=this,h=c.canvas;l.clear(),h.width&&h.height?l.setCurrent(h.width,h.height):l.setCurrent(a,o);var d=e.getStyle("width"),f=e.getStyle("height");!t&&(u||"number"!=typeof r&&"number"!=typeof n)&&(d.hasValue()&&(h.width=d.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),f.hasValue()&&(h.height=f.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var p=h.clientWidth||h.width,g=h.clientHeight||h.height;if(t&&d.hasValue()&&f.hasValue()&&(p=d.getPixels("x"),g=f.getPixels("y")),l.setCurrent(p,g),"number"==typeof i&&e.getAttribute("x",!0).setValue(i),"number"==typeof s&&e.getAttribute("y",!0).setValue(s),"number"==typeof r||"number"==typeof n){var m=qF(e.getAttribute("viewBox").getString()),w=0,B=0;if("number"==typeof r){var b=e.getStyle("width");b.hasValue()?w=b.getPixels("x")/r:isNaN(m[2])||(w=m[2]/r)}if("number"==typeof n){var y=e.getStyle("height");y.hasValue()?B=y.getPixels("y")/n:isNaN(m[3])||(B=m[3]/n)}w||(w=B),B||(B=w),e.getAttribute("width",!0).setValue(r),e.getAttribute("height",!0).setValue(n);var v=e.getStyle("transform",!0,!0);v.setValue("".concat(v.getString()," scale(").concat(1/w,", ").concat(1/B,")"))}A||c.clearRect(0,0,p,g),e.render(c),u&&(this.isFirstRender=!1)}}xQ.defaultWindow=vQ,xQ.defaultFetch=CQ;var{defaultFetch:FQ}=xQ,QQ="undefined"!=typeof DOMParser?DOMParser:null;class UQ{constructor(){var{fetch:e=FQ,DOMParser:t=QQ}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return Yw(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch(A){return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return Yw(function*(){var A=yield t.fetch(e),r=yield A.text();return t.parseFromString(r)})()}}class SQ{constructor(e,t){this.type="translate",this.point=null,this.point=bQ.parse(t)}apply(e){var{x:t,y:A}=this.point;e.translate(t||0,A||0)}unapply(e){var{x:t,y:A}=this.point;e.translate(-1*t||0,-1*A||0)}applyToPoint(e){var{x:t,y:A}=this.point;e.applyTransform([1,0,0,1,t||0,A||0])}}class EQ{constructor(e,t,A){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var r=qF(t);this.angle=new wQ(e,"angle",r[0]),this.originX=A[0],this.originY=A[1],this.cx=r[1]||0,this.cy=r[2]||0}apply(e){var{cx:t,cy:A,originX:r,originY:n,angle:i}=this,s=t+r.getPixels("x"),a=A+n.getPixels("y");e.translate(s,a),e.rotate(i.getRadians()),e.translate(-s,-a)}unapply(e){var{cx:t,cy:A,originX:r,originY:n,angle:i}=this,s=t+r.getPixels("x"),a=A+n.getPixels("y");e.translate(s,a),e.rotate(-1*i.getRadians()),e.translate(-s,-a)}applyToPoint(e){var{cx:t,cy:A,angle:r}=this,n=r.getRadians();e.applyTransform([1,0,0,1,t||0,A||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-t||0,-A||0])}}class NQ{constructor(e,t,A){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var r=bQ.parseScale(t);0!==r.x&&0!==r.y||(r.x=aQ,r.y=aQ),this.scale=r,this.originX=A[0],this.originY=A[1]}apply(e){var{scale:{x:t,y:A},originX:r,originY:n}=this,i=r.getPixels("x"),s=n.getPixels("y");e.translate(i,s),e.scale(t,A||t),e.translate(-i,-s)}unapply(e){var{scale:{x:t,y:A},originX:r,originY:n}=this,i=r.getPixels("x"),s=n.getPixels("y");e.translate(i,s),e.scale(1/t,1/A||t),e.translate(-i,-s)}applyToPoint(e){var{x:t,y:A}=this.scale;e.applyTransform([t||0,0,0,A||0,0,0])}}class LQ{constructor(e,t,A){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=qF(t),this.originX=A[0],this.originY=A[1]}apply(e){var{originX:t,originY:A,matrix:r}=this,n=t.getPixels("x"),i=A.getPixels("y");e.translate(n,i),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.translate(-n,-i)}unapply(e){var{originX:t,originY:A,matrix:r}=this,n=r[0],i=r[2],s=r[4],a=r[1],o=r[3],l=r[5],c=1/(n*(1*o-0*l)-i*(1*a-0*l)+s*(0*a-0*o)),u=t.getPixels("x"),h=A.getPixels("y");e.translate(u,h),e.transform(c*(1*o-0*l),c*(0*l-1*a),c*(0*s-1*i),c*(1*n-0*s),c*(i*l-s*o),c*(s*a-n*l)),e.translate(-u,-h)}applyToPoint(e){e.applyTransform(this.matrix)}}class _Q extends LQ{constructor(e,t,A){super(e,t,A),this.type="skew",this.angle=null,this.angle=new wQ(e,"angle",t)}}class IQ extends _Q{constructor(e,t,A){super(e,t,A),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class kQ extends _Q{constructor(e,t,A){super(e,t,A),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}class TQ{constructor(e,t,A){this.document=e,this.transforms=[];var r=function(e){return KF(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(t);r.forEach(e=>{if("none"!==e){var[t,r]=function(e){var[t,A]=e.split("(");return[t.trim(),A.trim().replace(")","")]}(e),n=TQ.transformTypes[t];void 0!==n&&this.transforms.push(new n(this.document,r,A))}})}static fromElement(e,t){var A=t.getStyle("transform",!1,!0),[r,n=r]=t.getStyle("transform-origin",!1,!0).split(),i=[r,n];return A.hasValue()?new TQ(e,A.getString(),i):null}apply(e){for(var{transforms:t}=this,A=t.length,r=0;r<A;r++)t[r].apply(e)}unapply(e){for(var{transforms:t}=this,A=t.length-1;A>=0;A--)t[A].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,A=t.length,r=0;r<A;r++)t[r].applyToPoint(e)}}TQ.transformTypes={translate:SQ,rotate:EQ,scale:NQ,matrix:LQ,skewX:IQ,skewY:kQ};class HQ{constructor(e,t){var A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=e,this.node=t,this.captureTextNodes=A,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],t&&1===t.nodeType){if(Array.from(t.attributes).forEach(t=>{var A=XF(t.nodeName);this.attributes[A]=new wQ(e,A,t.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var r=this.getAttribute("style").getString().split(";").map(e=>e.trim());r.forEach(t=>{if(t){var[A,r]=t.split(":").map(e=>e.trim());this.styles[A]=new wQ(e,A,r)}})}var{definitions:n}=e,i=this.getAttribute("id");i.hasValue()&&(n[i.getString()]||(n[i.getString()]=this)),Array.from(t.childNodes).forEach(t=>{if(1===t.nodeType)this.addChild(t);else if(A&&(3===t.nodeType||4===t.nodeType)){var r=e.createTextNode(t);r.getText().length>0&&this.addChild(r)}})}}getAttribute(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=this.attributes[e];if(!A&&t){var r=new wQ(this.document,e,"");return this.attributes[e]=r,r}return A||wQ.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if("href"===e||e.endsWith(":href"))return this.attributes[e];return wQ.empty(this.document)}getStyle(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[e];if(r)return r;var n=this.getAttribute(e);if(null!=n&&n.hasValue())return this.styles[e]=n,n;if(!A){var{parent:i}=this;if(i){var s=i.getStyle(e);if(null!=s&&s.hasValue())return s}}if(t){var a=new wQ(this.document,e,"");return this.styles[e]=a,a}return r||wQ.empty(this.document)}render(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var A=this.getStyle("filter").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=TQ.fromElement(this.document,this);t&&t.apply(e);var A=this.getStyle("clip-path",!1,!0);if(A.hasValue()){var r=A.getDefinition();r&&r.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof HQ?e:this.document.createElement(e);t.parent=this,HQ.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:A}=this;if("function"==typeof A.matches)return A.matches(e);var r=null===(t=A.getAttribute)||void 0===t?void 0:t.call(A,"class");return!(!r||""===r)&&r.split(" ").some(t=>".".concat(t)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var A in e)if(!A.startsWith("@")&&this.matchesSelector(A)){var r=e[A],n=t[A];if(r)for(var i in r){var s=this.stylesSpecificity[i];void 0===s&&(s="000"),n>=s&&(this.styles[i]=r[i],this.stylesSpecificity[i]=n)}}}removeStyles(e,t){return t.reduce((t,A)=>{var r=e.getStyle(A);if(!r.hasValue())return t;var n=r.getString();return r.setValue(""),[...t,[A,n]]},[])}restoreStyles(e,t){t.forEach(t=>{var[A,r]=t;e.getStyle(A,!0).setValue(r)})}isFirstChild(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}HQ.ignoreChildTypes=["title"];class OQ extends HQ{constructor(e,t,A){super(e,t,A)}}function PQ(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function DQ(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function MQ(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}class jQ{constructor(e,t,A,r,n,i){var s=i?"string"==typeof i?jQ.parse(i):i:{};this.fontFamily=n||s.fontFamily,this.fontSize=r||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=A||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>1?arguments[1]:void 0,t="",A="",r="",n="",i="",s=KF(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(" "),a={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return s.forEach(e=>{switch(!0){case!a.fontStyle&&jQ.styles.includes(e):"inherit"!==e&&(t=e),a.fontStyle=!0;break;case!a.fontVariant&&jQ.variants.includes(e):"inherit"!==e&&(A=e),a.fontStyle=!0,a.fontVariant=!0;break;case!a.fontWeight&&jQ.weights.includes(e):"inherit"!==e&&(r=e),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0;break;case!a.fontSize:"inherit"!==e&&([n]=e.split("/")),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0,a.fontSize=!0;break;default:"inherit"!==e&&(i+=e)}}),new jQ(t,A,r,n,i,e)}toString(){return[DQ(this.fontStyle),this.fontVariant,MQ(this.fontWeight),this.fontSize,(e=this.fontFamily,"undefined"==typeof process?e:e.trim().split(",").map(PQ).join(","))].join(" ").trim();var e}}jQ.styles="normal|italic|oblique|inherit",jQ.variants="normal|small-caps|inherit",jQ.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class RQ{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=A,this.y2=r,this.addPoint(e,t),this.addPoint(A,r)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){void 0!==e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),void 0!==t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:A,x2:r,y2:n}=e;this.addPoint(t,A),this.addPoint(r,n)}}sumCubic(e,t,A,r,n){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*A+3*(1-e)*Math.pow(e,2)*r+Math.pow(e,3)*n}bezierCurveAdd(e,t,A,r,n){var i=6*t-12*A+6*r,s=-3*t+9*A-9*r+3*n,a=3*A-3*t;if(0!==s){var o=Math.pow(i,2)-4*a*s;if(!(o<0)){var l=(-i+Math.sqrt(o))/(2*s);0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,A,r,n)):this.addY(this.sumCubic(l,t,A,r,n)));var c=(-i-Math.sqrt(o))/(2*s);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,A,r,n)):this.addY(this.sumCubic(c,t,A,r,n)))}}else{if(0===i)return;var u=-a/i;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,A,r,n)):this.addY(this.sumCubic(u,t,A,r,n)))}}addBezierCurve(e,t,A,r,n,i,s,a){this.addPoint(e,t),this.addPoint(s,a),this.bezierCurveAdd(!0,e,A,n,s),this.bezierCurveAdd(!1,t,r,i,a)}addQuadraticCurve(e,t,A,r,n,i){var s=e+2/3*(A-e),a=t+2/3*(r-t),o=s+1/3*(n-e),l=a+1/3*(i-t);this.addBezierCurve(e,t,s,o,a,l,n,i)}isPointInBox(e,t){var{x1:A,y1:r,x2:n,y2:i}=this;return A<=e&&e<=n&&r<=t&&t<=i}}class VQ extends FF{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new bQ(0,0),this.control=new bQ(0,0),this.current=new bQ(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",A=new bQ(this.command[e],this.command[t]);return this.makeAbsolute(A)}getAsControlPoint(e,t){var A=this.getPoint(e,t);return this.control=A,A}getAsCurrentPoint(e,t){var A=this.getPoint(e,t);return this.current=A,A}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==FF.CURVE_TO&&e!==FF.SMOOTH_CURVE_TO&&e!==FF.QUAD_TO&&e!==FF.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:A},control:{x:r,y:n}}=this;return new bQ(2*t-r,2*A-n)}makeAbsolute(e){if(this.command.relative){var{x:t,y:A}=this.current;e.x+=t,e.y+=A}return e}addMarker(e,t,A){var{points:r,angles:n}=this;A&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=r[r.length-1].angleTo(A)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,A=0;A<t;A++)if(!e[A])for(var r=A+1;r<t;r++)if(e[r]){e[A]=e[r];break}return e}}class KQ extends HQ{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var A=t.getStyle("opacity",!1,!0);A.hasValue(!0)&&(e*=A.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var A=this.getStyle("fill"),r=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),i=this.getStyle("stroke-opacity");if(A.isUrlDefinition()){var s=A.getFillStyleDefinition(this,r);s&&(e.fillStyle=s)}else if(A.hasValue()){"currentColor"===A.getString()&&A.setValue(this.getStyle("color").getColor());var a=A.getColor();"inherit"!==a&&(e.fillStyle="none"===a?"rgba(0,0,0,0)":a)}if(r.hasValue()){var o=new wQ(this.document,"fill",e.fillStyle).addOpacity(r).getColor();e.fillStyle=o}if(n.isUrlDefinition()){var l=n.getFillStyleDefinition(this,i);l&&(e.strokeStyle=l)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var c=n.getString();"inherit"!==c&&(e.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(i.hasValue()){var u=new wQ(this.document,"stroke",e.strokeStyle).addOpacity(i).getString();e.strokeStyle=u}var h=this.getStyle("stroke-width");if(h.hasValue()){var d=h.getPixels();e.lineWidth=d||aQ}var f=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),w=this.getStyle("stroke-dashoffset");if(f.hasValue()&&(e.lineCap=f.getString()),p.hasValue()&&(e.lineJoin=p.getString()),g.hasValue()&&(e.miterLimit=g.getNumber()),m.hasValue()&&"none"!==m.getString()){var B=qF(m.getString());void 0!==e.setLineDash?e.setLineDash(B):void 0!==e.webkitLineDash?e.webkitLineDash=B:void 0===e.mozDash||1===B.length&&0===B[0]||(e.mozDash=B);var b=w.getPixels();void 0!==e.lineDashOffset?e.lineDashOffset=b:void 0!==e.webkitLineDashOffset?e.webkitLineDashOffset=b:void 0!==e.mozDashOffset&&(e.mozDashOffset=b)}}if(this.modifiedEmSizeStack=!1,void 0!==e.font){var y=this.getStyle("font"),v=this.getStyle("font-style"),C=this.getStyle("font-variant"),x=this.getStyle("font-weight"),F=this.getStyle("font-size"),Q=this.getStyle("font-family"),U=new jQ(v.getString(),C.getString(),x.getString(),F.hasValue()?"".concat(F.getPixels(!0),"px"):"",Q.getString(),jQ.parse(y.getString(),e.font));v.setValue(U.fontStyle),C.setValue(U.fontVariant),x.setValue(U.fontWeight),F.setValue(U.fontSize),Q.setValue(U.fontFamily),e.font=U.toString(),F.isPixels()&&(this.document.emSize=F.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class GQ extends KQ{constructor(e,t,A){super(e,t,A),this.type="path",this.pathParser=null,this.pathParser=new VQ(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,A=new RQ;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case VQ.MOVE_TO:this.pathM(e,A);break;case VQ.LINE_TO:this.pathL(e,A);break;case VQ.HORIZ_LINE_TO:this.pathH(e,A);break;case VQ.VERT_LINE_TO:this.pathV(e,A);break;case VQ.CURVE_TO:this.pathC(e,A);break;case VQ.SMOOTH_CURVE_TO:this.pathS(e,A);break;case VQ.QUAD_TO:this.pathQ(e,A);break;case VQ.SMOOTH_QUAD_TO:this.pathT(e,A);break;case VQ.ARC:this.pathA(e,A);break;case VQ.CLOSE_PATH:this.pathZ(e,A)}return A}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),A=e.getMarkerAngles(),r=t.map((e,t)=>[e,A[t]]);return r}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");""!==e.fillStyle&&("inherit"!==t.getString("inherit")?e.fill(t.getString()):e.fill()),""!==e.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var A=this.getMarkers();if(A){var r=A.length-1,n=this.getStyle("marker-start"),i=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var a=n.getDefinition(),[o,l]=A[0];a.render(e,o,l)}if(i.isUrlDefinition())for(var c=i.getDefinition(),u=1;u<r;u++){var[h,d]=A[u];c.render(e,h,d)}if(s.isUrlDefinition()){var f=s.getDefinition(),[p,g]=A[r];f.render(e,p,g)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:A}=this,{point:r}=GQ.pathM(A),{x:n,y:i}=r;A.addMarker(r),t.addPoint(n,i),e&&e.moveTo(n,i)}static pathL(e){var{current:t}=e;return{current:t,point:e.getAsCurrentPoint()}}pathL(e,t){var{pathParser:A}=this,{current:r,point:n}=GQ.pathL(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathH(e){var{current:t,command:A}=e,r=new bQ((A.relative?t.x:0)+A.x,t.y);return e.current=r,{current:t,point:r}}pathH(e,t){var{pathParser:A}=this,{current:r,point:n}=GQ.pathH(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathV(e){var{current:t,command:A}=e,r=new bQ(t.x,(A.relative?t.y:0)+A.y);return e.current=r,{current:t,point:r}}pathV(e,t){var{pathParser:A}=this,{current:r,point:n}=GQ.pathV(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathC(e){var{current:t}=e;return{current:t,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathC(e,t){var{pathParser:A}=this,{current:r,point:n,controlPoint:i,currentPoint:s}=GQ.pathC(A);A.addMarker(s,i,n),t.addBezierCurve(r.x,r.y,n.x,n.y,i.x,i.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y)}static pathS(e){var{current:t}=e;return{current:t,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathS(e,t){var{pathParser:A}=this,{current:r,point:n,controlPoint:i,currentPoint:s}=GQ.pathS(A);A.addMarker(s,i,n),t.addBezierCurve(r.x,r.y,n.x,n.y,i.x,i.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y)}static pathQ(e){var{current:t}=e;return{current:t,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}pathQ(e,t){var{pathParser:A}=this,{current:r,controlPoint:n,currentPoint:i}=GQ.pathQ(A);A.addMarker(i,n,n),t.addQuadraticCurve(r.x,r.y,n.x,n.y,i.x,i.y),e&&e.quadraticCurveTo(n.x,n.y,i.x,i.y)}static pathT(e){var{current:t}=e,A=e.getReflectedControlPoint();return e.control=A,{current:t,controlPoint:A,currentPoint:e.getAsCurrentPoint()}}pathT(e,t){var{pathParser:A}=this,{current:r,controlPoint:n,currentPoint:i}=GQ.pathT(A);A.addMarker(i,n,n),t.addQuadraticCurve(r.x,r.y,n.x,n.y,i.x,i.y),e&&e.quadraticCurveTo(n.x,n.y,i.x,i.y)}static pathA(e){var{current:t,command:A}=e,{rX:r,rY:n,xRot:i,lArcFlag:s,sweepFlag:a}=A,o=i*(Math.PI/180),l=e.getAsCurrentPoint(),c=new bQ(Math.cos(o)*(t.x-l.x)/2+Math.sin(o)*(t.y-l.y)/2,-Math.sin(o)*(t.x-l.x)/2+Math.cos(o)*(t.y-l.y)/2),u=Math.pow(c.x,2)/Math.pow(r,2)+Math.pow(c.y,2)/Math.pow(n,2);u>1&&(r*=Math.sqrt(u),n*=Math.sqrt(u));var h=(s===a?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(n,2)-Math.pow(r,2)*Math.pow(c.y,2)-Math.pow(n,2)*Math.pow(c.x,2))/(Math.pow(r,2)*Math.pow(c.y,2)+Math.pow(n,2)*Math.pow(c.x,2)));isNaN(h)&&(h=0);var d=new bQ(h*r*c.y/n,h*-n*c.x/r),f=new bQ((t.x+l.x)/2+Math.cos(o)*d.x-Math.sin(o)*d.y,(t.y+l.y)/2+Math.sin(o)*d.x+Math.cos(o)*d.y),p=cQ([1,0],[(c.x-d.x)/r,(c.y-d.y)/n]),g=[(c.x-d.x)/r,(c.y-d.y)/n],m=[(-c.x-d.x)/r,(-c.y-d.y)/n],w=cQ(g,m);return lQ(g,m)<=-1&&(w=Math.PI),lQ(g,m)>=1&&(w=0),{currentPoint:l,rX:r,rY:n,sweepFlag:a,xAxisRotation:o,centp:f,a1:p,ad:w}}pathA(e,t){var{pathParser:A}=this,{currentPoint:r,rX:n,rY:i,sweepFlag:s,xAxisRotation:a,centp:o,a1:l,ad:c}=GQ.pathA(A),u=1-s?1:-1,h=l+u*(c/2),d=new bQ(o.x+n*Math.cos(h),o.y+i*Math.sin(h));if(A.addMarkerAngle(d,h-u*Math.PI/2),A.addMarkerAngle(r,h-u*Math.PI),t.addPoint(r.x,r.y),e&&!isNaN(l)&&!isNaN(c)){var f=n>i?n:i,p=n>i?1:n/i,g=n>i?i/n:1;e.translate(o.x,o.y),e.rotate(a),e.scale(p,g),e.arc(0,0,f,l,l+c,Boolean(1-s)),e.scale(1/p,1/g),e.rotate(-a),e.translate(-o.x,-o.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){GQ.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class zQ extends GQ{constructor(e,t,A){super(e,t,A),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class qQ extends KQ{constructor(e,t,A){super(e,t,new.target===qQ||A),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(e,t);var A=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();A&&(e.textBaseline=A)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((A,r)=>{var n=this.getChildBoundingBox(e,this,this,r);t?t.addBoundingBox(n):t=n}),t}getFontSize(){var{document:e,parent:t}=this,A=jQ.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(A)}getTElementBoundingBox(e){var t=this.getFontSize();return new RQ(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,A){var r=t[A],n=null;if(e.isArabic){var i=t.length,s=t[A-1],a=t[A+1],o="isolated";if((0===A||" "===s)&&A<i-1&&" "!==a&&(o="terminal"),A>0&&" "!==s&&A<i-1&&" "!==a&&(o="medial"),A>0&&" "!==s&&(A===i-1||" "===a)&&(o="initial"),void 0!==e.glyphs[r]){var l=e.glyphs[r];n=l instanceof zQ?l:l[o]}}else n=e.glyphs[r];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var t=e||this.node,A=Array.from(t.parentNode.childNodes),r=A.indexOf(t),n=A.length-1,i=KF(t.textContent||"");return 0===r&&(i=GF(i)),r===n&&(i=zF(i)),i}renderChildren(e){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((t,A)=>{this.renderChild(e,this,this,A)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}renderTElementChildren(e){var{document:t,parent:A}=this,r=this.getText(),n=A.getStyle("font-family").getDefinition();if(n)for(var{unitsPerEm:i}=n.fontFace,s=jQ.parse(t.ctx.font),a=A.getStyle("font-size").getNumber(s.fontSize),o=A.getStyle("font-style").getString(s.fontStyle),l=a/i,c=n.isRTL?r.split("").reverse().join(""):r,u=qF(A.getAttribute("dx").getString()),h=c.length,d=0;d<h;d++){var f=this.getGlyph(n,c,d);e.translate(this.x,this.y),e.scale(l,-l);var p=e.lineWidth;e.lineWidth=e.lineWidth*i/a,"italic"===o&&e.transform(1,0,.4,1,0,0),f.render(e),"italic"===o&&e.transform(1,0,-.4,1,0,0),e.lineWidth=p,e.scale(1/l,-1/l),e.translate(-this.x,-this.y),this.x+=a*(f.horizAdvX||n.horizAdvX)/i,void 0===u[d]||isNaN(u[d])||(this.x+=u[d])}else{var{x:g,y:m}=this;e.fillStyle&&e.fillText(r,g,m),e.strokeStyle&&e.strokeText(r,g,m)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),A=0;A="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=A;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,A)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,A)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,A,r){var n=A.children[r];n.children.length>0?n.children.forEach((A,r)=>{t.adjustChildCoordinatesRecursiveCore(e,t,n,r)}):this.adjustChildCoordinates(e,t,A,r)}adjustChildCoordinates(e,t,A,r){var n=A.children[r];if("function"!=typeof n.measureText)return n;e.save(),n.setContext(e,!0);var i=n.getAttribute("x"),s=n.getAttribute("y"),a=n.getAttribute("dx"),o=n.getAttribute("dy"),l=n.getStyle("font-family").getDefinition(),c=Boolean(l)&&l.isRTL;0===r&&(i.hasValue()||i.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),a.hasValue()||a.setValue(n.getInheritedAttribute("dx")),o.hasValue()||o.setValue(n.getInheritedAttribute("dy")));var u=n.measureText(e);return c&&(t.x-=u),i.hasValue()?(t.applyAnchoring(),n.x=i.getPixels("x"),a.hasValue()&&(n.x+=a.getPixels("x"))):(a.hasValue()&&(t.x+=a.getPixels("x")),n.x=t.x),t.x=n.x,c||(t.x+=u),s.hasValue()?(n.y=s.getPixels("y"),o.hasValue()&&(n.y+=o.getPixels("y"))):(o.hasValue()&&(t.y+=o.getPixels("y")),n.y=t.y),t.y=n.y,t.leafTexts.push(n),t.minX=Math.min(t.minX,n.x,n.x+u),t.maxX=Math.max(t.maxX,n.x,n.x+u),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,t,A,r){var n=A.children[r];if("function"!=typeof n.getBoundingBox)return null;var i=n.getBoundingBox(e);return i?(n.children.forEach((A,r)=>{var s=t.getChildBoundingBox(e,t,n,r);i.addBoundingBox(s)}),i):null}renderChild(e,t,A,r){var n=A.children[r];n.render(e),n.children.forEach((A,r)=>{t.renderChild(e,t,n,r)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var A=this.getText(),r=this.measureTargetText(e,A);return this.measureCache=r,r}measureTargetText(e,t){if(!t.length)return 0;var{parent:A}=this,r=A.getStyle("font-family").getDefinition();if(r){for(var n=this.getFontSize(),i=r.isRTL?t.split("").reverse().join(""):t,s=qF(A.getAttribute("dx").getString()),a=i.length,o=0,l=0;l<a;l++){o+=(this.getGlyph(r,i,l).horizAdvX||r.horizAdvX)*n/r.fontFace.unitsPerEm,void 0===s[l]||isNaN(s[l])||(o+=s[l])}return o}if(!e.measureText)return 10*t.length;e.save(),this.setContext(e,!0);var{width:c}=e.measureText(t);return this.clearContext(e),e.restore(),c}getInheritedAttribute(e){for(var t=this;t instanceof qQ&&t.isFirstChild();){var A=t.parent.getAttribute(e);if(A.hasValue(!0))return A.getValue("0");t=t.parent}return null}}class WQ extends qQ{constructor(e,t,A){super(e,t,new.target===WQ||A),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class XQ extends WQ{constructor(){super(...arguments),this.type="textNode"}}class YQ extends KQ{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:A}=this,{screen:r,window:n}=A,i=e.canvas;if(r.setDefaults(e),i.style&&void 0!==e.font&&n&&void 0!==n.getComputedStyle){e.font=n.getComputedStyle(i).getPropertyValue("font");var s=new wQ(A,"fontSize",jQ.parse(e.font).fontSize);s.hasValue()&&(A.rootEmSize=s.getPixels("y"),A.emSize=A.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:a,height:o}=r.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),c=this.getAttribute("refY"),u=this.getAttribute("viewBox"),h=u.hasValue()?qF(u.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),f=0,p=0,g=0,m=0;h&&(f=h[0],p=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),"marker"===this.type&&(g=f,m=p,f=0,p=0)),r.viewPort.setCurrent(a,o),!this.node||this.parent&&"foreignObject"!==(null===(t=this.node.parentNode)||void 0===t?void 0:t.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),h&&(a=h[2],o=h[3]),A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:r.viewPort.width,desiredWidth:a,height:r.viewPort.height,desiredHeight:o,minX:f,minY:p,refX:l.getValue(),refY:c.getValue(),clip:d,clipX:g,clipY:m}),h&&(r.viewPort.removeCurrent(),r.viewPort.setCurrent(a,o))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),n=this.getAttribute("height",!0),i=this.getAttribute("viewBox"),s=this.getAttribute("style"),a=r.getNumber(0),o=n.getNumber(0);if(A)if("string"==typeof A)this.getAttribute("preserveAspectRatio",!0).setValue(A);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(e),n.setValue(t),i.hasValue()||i.setValue("0 0 ".concat(a||e," ").concat(o||t)),s.hasValue()){var c=this.getStyle("width"),u=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),u.hasValue()&&u.setValue("".concat(t,"px"))}}}class JQ extends GQ{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),i=this.getAttribute("rx"),s=this.getAttribute("ry"),a=i.getPixels("x"),o=s.getPixels("y");if(i.hasValue()&&!s.hasValue()&&(o=a),s.hasValue()&&!i.hasValue()&&(a=o),a=Math.min(a,r/2),o=Math.min(o,n/2),e){var l=(Math.sqrt(2)-1)/3*4;e.beginPath(),n>0&&r>0&&(e.moveTo(t+a,A),e.lineTo(t+r-a,A),e.bezierCurveTo(t+r-a+l*a,A,t+r,A+o-l*o,t+r,A+o),e.lineTo(t+r,A+n-o),e.bezierCurveTo(t+r,A+n-o+l*o,t+r-a+l*a,A+n,t+r-a,A+n),e.lineTo(t+a,A+n),e.bezierCurveTo(t+a-l*a,A+n,t,A+n-o+l*o,t,A+n-o),e.lineTo(t,A+o),e.bezierCurveTo(t,A+o-l*o,t+a-l*a,A,t+a,A),e.closePath())}return new RQ(t,A,t+r,A+n)}getMarkers(){return null}}class $Q extends GQ{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),A=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return e&&r>0&&(e.beginPath(),e.arc(t,A,r,0,2*Math.PI,!1),e.closePath()),new RQ(t-r,A-r,t+r,A+r)}getMarkers(){return null}}class ZQ extends GQ{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=(Math.sqrt(2)-1)/3*4,A=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y");return e&&A>0&&r>0&&(e.beginPath(),e.moveTo(n+A,i),e.bezierCurveTo(n+A,i+t*r,n+t*A,i+r,n,i+r),e.bezierCurveTo(n-t*A,i+r,n-A,i+t*r,n-A,i),e.bezierCurveTo(n-A,i-t*r,n-t*A,i-r,n,i-r),e.bezierCurveTo(n+t*A,i-r,n+A,i-t*r,n+A,i),e.closePath()),new RQ(n-A,i-r,n+A,i+r)}getMarkers(){return null}}class eU extends GQ{constructor(){super(...arguments),this.type="line"}getPoints(){return[new bQ(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new bQ(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:A},{x:r,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,A),e.lineTo(r,n)),new RQ(t,A,r,n)}getMarkers(){var[e,t]=this.getPoints(),A=e.angleTo(t);return[[e,A],[t,A]]}}class tU extends GQ{constructor(e,t,A){super(e,t,A),this.type="polyline",this.points=[],this.points=bQ.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:A,y:r}]=t,n=new RQ(A,r);return e&&(e.beginPath(),e.moveTo(A,r)),t.forEach(t=>{var{x:A,y:r}=t;n.addPoint(A,r),e&&e.lineTo(A,r)}),n}getMarkers(){var{points:e}=this,t=e.length-1,A=[];return e.forEach((r,n)=>{n!==t&&A.push([r,r.angleTo(e[n+1])])}),A.length>0&&A.push([e[e.length-1],A[A.length-1][1]]),A}}class AU extends tU{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:A,y:r}]=this.points;return e&&(e.lineTo(A,r),e.closePath()),t}}class rU extends HQ{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,A){var r=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),i=new YQ(this.document,null);i.attributes.viewBox=new wQ(this.document,"viewBox",this.getAttribute("viewBox").getValue()),i.attributes.width=new wQ(this.document,"width","".concat(r,"px")),i.attributes.height=new wQ(this.document,"height","".concat(n,"px")),i.attributes.transform=new wQ(this.document,"transform",this.getAttribute("patternTransform").getValue()),i.children=this.children;var s=this.document.createCanvas(r,n),a=s.getContext("2d"),o=this.getAttribute("x"),l=this.getAttribute("y");o.hasValue()&&l.hasValue()&&a.translate(o.getPixels("x",!0),l.getPixels("y",!0)),A.hasValue()?this.styles["fill-opacity"]=A:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var u=-1;u<=1;u++)a.save(),i.attributes.x=new wQ(this.document,"x",c*s.width),i.attributes.y=new wQ(this.document,"y",u*s.height),i.render(a),a.restore();return e.createPattern(s,"repeat")}}class nU extends HQ{constructor(){super(...arguments),this.type="marker"}render(e,t,A){if(t){var{x:r,y:n}=t,i=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(r,n),"auto"===i&&e.rotate(A),"strokeWidth"===s&&e.scale(e.lineWidth,e.lineWidth),e.save();var a=new YQ(this.document,null);a.type=this.type,a.attributes.viewBox=new wQ(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.refX=new wQ(this.document,"refX",this.getAttribute("refX").getValue()),a.attributes.refY=new wQ(this.document,"refY",this.getAttribute("refY").getValue()),a.attributes.width=new wQ(this.document,"width",this.getAttribute("markerWidth").getValue()),a.attributes.height=new wQ(this.document,"height",this.getAttribute("markerHeight").getValue()),a.attributes.overflow=new wQ(this.document,"overflow",this.getAttribute("overflow").getValue()),a.attributes.fill=new wQ(this.document,"fill",this.getAttribute("fill").getColor("black")),a.attributes.stroke=new wQ(this.document,"stroke",this.getAttribute("stroke").getValue("none")),a.children=this.children,a.render(e),e.restore(),"strokeWidth"===s&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===i&&e.rotate(-A),e.translate(-r,-n)}}}class iU extends HQ{constructor(){super(...arguments),this.type="defs"}render(){}}class sU extends KQ{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new RQ;return this.children.forEach(A=>{t.addBoundingBox(A.getBoundingBox(e))}),t}}class aU extends HQ{constructor(e,t,A){super(e,t,A),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:r,children:n}=this;n.forEach(e=>{"stop"===e.type&&r.push(e)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,A){var r=this;this.getHrefAttribute().hasValue()&&(r=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(r));var{stops:n}=r,i=this.getGradient(e,t);if(!i)return this.addParentOpacity(A,n[n.length-1].color);if(n.forEach(e=>{i.addColorStop(e.offset,this.addParentOpacity(A,e.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:a,viewPort:o}=s.screen,[l]=o.viewPorts,c=new JQ(s,null);c.attributes.x=new wQ(s,"x",-a/3),c.attributes.y=new wQ(s,"y",-a/3),c.attributes.width=new wQ(s,"width",a),c.attributes.height=new wQ(s,"height",a);var u=new sU(s,null);u.attributes.transform=new wQ(s,"transform",this.getAttribute("gradientTransform").getValue()),u.children=[c];var h=new YQ(s,null);h.attributes.x=new wQ(s,"x",0),h.attributes.y=new wQ(s,"y",0),h.attributes.width=new wQ(s,"width",l.width),h.attributes.height=new wQ(s,"height",l.height),h.children=[u];var d=s.createCanvas(l.width,l.height),f=d.getContext("2d");return f.fillStyle=i,h.render(f),f.createPattern(d,"no-repeat")}return i}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new wQ(this.document,"color",t).addOpacity(e).getColor():t}}class oU extends aU{constructor(e,t,A){super(e,t,A),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var A="objectBoundingBox"===this.getGradientUnits(),r=A?t.getBoundingBox(e):null;if(A&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=A?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),i=A?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=A?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),a=A?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&i===a?null:e.createLinearGradient(n,i,s,a)}}class lU extends aU{constructor(e,t,A){super(e,t,A),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var A="objectBoundingBox"===this.getGradientUnits(),r=t.getBoundingBox(e);if(A&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=A?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),i=A?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,a=i;this.getAttribute("fx").hasValue()&&(s=A?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(a=A?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var o=A?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,a,l,n,i,o)}}class cU extends HQ{constructor(e,t,A){super(e,t,A),this.type="stop";var r=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),i=this.getStyle("stop-color",!0);""===i.getString()&&i.setValue("#000"),n.hasValue()&&(i=i.addOpacity(n)),this.offset=r,this.color=i.getColor()}}class uU extends HQ{constructor(e,t,A){super(e,t,A),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new wQ(e,"values",null);var r=this.getAttribute("values");r.hasValue()&&this.values.setValue(r.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:A,to:r}=this.getProgress(),n=A.getNumber()+(r.getNumber()-A.getNumber())*t;return"%"===e&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:t}=this,A=this.getProperty();if(this.initialValue||(this.initialValue=A.getString(),this.initialUnits=A.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,A.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=A.getString();return!1}this.duration+=e;var n=!1;if(this.begin<this.duration){var i=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var a=s.getString();i="".concat(a,"(").concat(i,")")}A.setValue(i),n=!0}return n}getProgress(){var{document:e,values:t}=this,A={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var r=A.progress*(t.getValue().length-1),n=Math.floor(r),i=Math.ceil(r);A.from=new wQ(e,"from",parseFloat(t.getValue()[n])),A.to=new wQ(e,"to",parseFloat(t.getValue()[i])),A.progress=(r-n)/(i-n)}else A.from=this.from,A.to=this.to;return A}}class hU extends uU{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),r=new Kx(t.getColor()),n=new Kx(A.getColor());if(r.ok&&n.ok){var i=r.r+(n.r-r.r)*e,s=r.g+(n.g-r.g)*e,a=r.b+(n.b-r.b)*e;return"rgb(".concat(Math.floor(i),", ").concat(Math.floor(s),", ").concat(Math.floor(a),")")}return this.getAttribute("from").getColor()}}class dU extends uU{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),r=qF(t.getString()),n=qF(A.getString()),i=r.map((t,A)=>t+(n[A]-t)*e).join(" ");return i}}class fU extends HQ{constructor(e,t,A){super(e,t,A),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:r}=e,{children:n}=this;for(var i of n)switch(i.type){case"font-face":this.fontFace=i;var s=i.getStyle("font-family");s.hasValue()&&(r[s.getString()]=this);break;case"missing-glyph":this.missingGlyph=i;break;case"glyph":var a=i;a.arabicForm?(this.isRTL=!0,this.isArabic=!0,void 0===this.glyphs[a.unicode]&&(this.glyphs[a.unicode]=Object.create(null)),this.glyphs[a.unicode][a.arabicForm]=a):this.glyphs[a.unicode]=a}}render(){}}class pU extends HQ{constructor(e,t,A){super(e,t,A),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class gU extends GQ{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class mU extends qQ{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class wU extends qQ{constructor(e,t,A){super(e,t,A),this.type="a";var{childNodes:r}=t,n=r[0],i=r.length>0&&Array.from(r).every(e=>3===e.nodeType);this.hasText=i,this.text=i?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:A,y:r}=this,{mouse:n}=t.screen,i=new wQ(t,"fontSize",jQ.parse(t.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new RQ(A,r-i.getPixels("y"),A+this.measureText(e),r))}else if(this.children.length>0){var s=new sU(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}}function BU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function bU(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?BU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):BU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}class yU extends qQ{constructor(e,t,A){super(e,t,A),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var r=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(r)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(t=>{var{type:A,points:r}=t;switch(A){case VQ.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case VQ.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case VQ.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case VQ.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case VQ.ARC:var[n,i,s,a,o,l,c,u]=r,h=s>a?s:a,d=s>a?1:s/a,f=s>a?a/s:1;e&&(e.translate(n,i),e.rotate(c),e.scale(d,f),e.arc(0,0,h,o,o+l,Boolean(1-u)),e.scale(1/d,1/f),e.rotate(-c),e.translate(-n,-i));break;case VQ.CLOSE_PATH:e&&e.closePath()}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),A=this.getFontSize(),{glyphInfo:r}=this,n=e.fillStyle;"underline"===t&&e.beginPath(),r.forEach((r,n)=>{var{p0:i,p1:s,rotation:a,text:o}=r;e.save(),e.translate(i.x,i.y),e.rotate(a),e.fillStyle&&e.fillText(o,0,0),e.strokeStyle&&e.strokeText(o,0,0),e.restore(),"underline"===t&&(0===n&&e.moveTo(i.x,i.y+A/8),e.lineTo(s.x,s.y+A/5))}),"underline"===t&&(e.lineWidth=A/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,A,r,n,i,s,a,o){var l=i,c=this.measureText(e,a);" "===a&&"justify"===t&&A<r&&(c+=(r-A)/n),o>-1&&(l+=this.getLetterSpacingAt(o));var u=this.textHeight/20,h=this.getEquidistantPointOnPath(l,u,0),d=this.getEquidistantPointOnPath(l+c,u,0),f={p0:h,p1:d},p=h&&d?Math.atan2(d.y-h.y,d.x-h.x):0;if(s){var g=Math.cos(Math.PI/2+p)*s,m=Math.cos(-p)*s;f.p0=bU(bU({},h),{},{x:h.x+g,y:h.y+m}),f.p1=bU(bU({},d),{},{x:d.x+g,y:d.y+m})}return{offset:l+=c,segment:f,rotation:p}}measureText(e,t){var{measuresCache:A}=this,r=t||this.getText();if(A.has(r))return A.get(r);var n=this.measureTargetText(e,r);return A.set(r,n),n}setTextData(e){if(!this.glyphInfo){var t=this.getText(),A=t.split(""),r=t.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(e=>e.getPixels("x")),i=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),a=this.getStyle("letter-spacing"),o=this.parent.getStyle("letter-spacing"),l=0;a.hasValue()&&"inherit"!==a.getValue()?a.hasValue()&&"initial"!==a.getValue()&&"unset"!==a.getValue()&&(l=a.getPixels()):l=o.getPixels();var c=[],u=t.length;this.letterSpacingCache=c;for(var h=0;h<u;h++)c.push(void 0!==n[h]?n[h]:l);var d=c.reduce((e,t,A)=>0===A?0:e+t||0,0),f=this.measureText(e),p=Math.max(f+d,0);this.textWidth=f,this.textHeight=this.getFontSize(),this.glyphInfo=[];var g=this.getPathLength(),m=this.getStyle("startOffset").getNumber(0)*g,w=0;"middle"!==s&&"center"!==s||(w=-p/2),"end"!==s&&"right"!==s||(w=-p),w+=m,A.forEach((t,n)=>{var{offset:a,segment:o,rotation:l}=this.findSegmentToFitChar(e,s,p,g,r,w,i,t,n);w=a,o.p0&&o.p1&&this.glyphInfo.push({text:A[n],p0:o.p0,p1:o.p1,rotation:l})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:A}=e;for(A.reset();!A.isEnd();){var{current:r}=A,n=r?r.x:0,i=r?r.y:0,s=A.next(),a=s.type,o=[];switch(s.type){case VQ.MOVE_TO:this.pathM(A,o);break;case VQ.LINE_TO:a=this.pathL(A,o);break;case VQ.HORIZ_LINE_TO:a=this.pathH(A,o);break;case VQ.VERT_LINE_TO:a=this.pathV(A,o);break;case VQ.CURVE_TO:this.pathC(A,o);break;case VQ.SMOOTH_CURVE_TO:a=this.pathS(A,o);break;case VQ.QUAD_TO:this.pathQ(A,o);break;case VQ.SMOOTH_QUAD_TO:a=this.pathT(A,o);break;case VQ.ARC:o=this.pathA(A);break;case VQ.CLOSE_PATH:GQ.pathZ(A)}s.type!==VQ.CLOSE_PATH?t.push({type:a,points:o,start:{x:n,y:i},pathLength:this.calcLength(n,i,a,o)}):t.push({type:VQ.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:A,y:r}=GQ.pathM(e).point;t.push(A,r)}pathL(e,t){var{x:A,y:r}=GQ.pathL(e).point;return t.push(A,r),VQ.LINE_TO}pathH(e,t){var{x:A,y:r}=GQ.pathH(e).point;return t.push(A,r),VQ.LINE_TO}pathV(e,t){var{x:A,y:r}=GQ.pathV(e).point;return t.push(A,r),VQ.LINE_TO}pathC(e,t){var{point:A,controlPoint:r,currentPoint:n}=GQ.pathC(e);t.push(A.x,A.y,r.x,r.y,n.x,n.y)}pathS(e,t){var{point:A,controlPoint:r,currentPoint:n}=GQ.pathS(e);return t.push(A.x,A.y,r.x,r.y,n.x,n.y),VQ.CURVE_TO}pathQ(e,t){var{controlPoint:A,currentPoint:r}=GQ.pathQ(e);t.push(A.x,A.y,r.x,r.y)}pathT(e,t){var{controlPoint:A,currentPoint:r}=GQ.pathT(e);return t.push(A.x,A.y,r.x,r.y),VQ.QUAD_TO}pathA(e){var{rX:t,rY:A,sweepFlag:r,xAxisRotation:n,centp:i,a1:s,ad:a}=GQ.pathA(e);return 0===r&&a>0&&(a-=2*Math.PI),1===r&&a<0&&(a+=2*Math.PI),[i.x,i.y,t,A,s,a,n,r]}calcLength(e,t,A,r){var n=0,i=null,s=null,a=0;switch(A){case VQ.LINE_TO:return this.getLineLength(e,t,r[0],r[1]);case VQ.CURVE_TO:for(n=0,i=this.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),a=.01;a<=1;a+=.01)s=this.getPointOnCubicBezier(a,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return n;case VQ.QUAD_TO:for(n=0,i=this.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),a=.01;a<=1;a+=.01)s=this.getPointOnQuadraticBezier(a,e,t,r[0],r[1],r[2],r[3]),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return n;case VQ.ARC:n=0;var o=r[4],l=r[5],c=r[4]+l,u=Math.PI/180;if(Math.abs(o-c)<u&&(u=Math.abs(o-c)),i=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),l<0)for(a=o-u;a>c;a-=u)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;else for(a=o+u;a<c;a+=u)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],c,0),n+=this.getLineLength(i.x,i.y,s.x,s.y)}return 0}getPointOnLine(e,t,A,r,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:A,a=(n-A)/(r-t+aQ),o=Math.sqrt(e*e/(1+a*a));r<t&&(o*=-1);var l=a*o,c=null;if(r===t)c={x:i,y:s+l};else if((s-A)/(i-t+aQ)===a)c={x:i+o,y:s+l};else{var u,h,d=this.getLineLength(t,A,r,n);if(d<aQ)return null;var f=(i-t)*(r-t)+(s-A)*(n-A);u=t+(f/=d*d)*(r-t),h=A+f*(n-A);var p=this.getLineLength(i,s,u,h),g=Math.sqrt(e*e-p*p);o=Math.sqrt(g*g/(1+a*a)),r<t&&(o*=-1),c={x:u+o,y:h+(l=a*o)}}return c}getPointOnPath(e){var t=this.getPathLength(),A=0,r=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:n}=this;for(var i of n){if(!i||!(i.pathLength<5e-5||A+i.pathLength+5e-5<e)){var s=e-A,a=0;switch(i.type){case VQ.LINE_TO:r=this.getPointOnLine(s,i.start.x,i.start.y,i.points[0],i.points[1],i.start.x,i.start.y);break;case VQ.ARC:var o=i.points[4],l=i.points[5],c=i.points[4]+l;if(a=o+s/i.pathLength*l,l<0&&a<c||l>=0&&a>c)break;r=this.getPointOnEllipticalArc(i.points[0],i.points[1],i.points[2],i.points[3],a,i.points[6]);break;case VQ.CURVE_TO:(a=s/i.pathLength)>1&&(a=1),r=this.getPointOnCubicBezier(a,i.start.x,i.start.y,i.points[0],i.points[1],i.points[2],i.points[3],i.points[4],i.points[5]);break;case VQ.QUAD_TO:(a=s/i.pathLength)>1&&(a=1),r=this.getPointOnQuadraticBezier(a,i.start.x,i.start.y,i.points[0],i.points[1],i.points[2],i.points[3])}if(r)return r;break}A+=i.pathLength}return null}getLineLength(e,t,A,r){return Math.sqrt((A-e)*(A-e)+(r-t)*(r-t))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,A,r,n,i,s,a,o){return{x:a*uQ(e)+i*hQ(e)+r*dQ(e)+t*fQ(e),y:o*uQ(e)+s*hQ(e)+n*dQ(e)+A*fQ(e)}}getPointOnQuadraticBezier(e,t,A,r,n,i,s){return{x:i*pQ(e)+r*gQ(e)+t*mQ(e),y:s*pQ(e)+n*gQ(e)+A*mQ(e)}}getPointOnEllipticalArc(e,t,A,r,n,i){var s=Math.cos(i),a=Math.sin(i),o=A*Math.cos(n),l=r*Math.sin(n);return{x:e+(o*s-l*a),y:t+(o*a+l*s)}}buildEquidistantCache(e,t){var A=this.getPathLength(),r=t||.25,n=e||A/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==r){this.equidistantCache={step:n,precision:r,points:[]};for(var i=0,s=0;s<=A;s+=r){var a=this.getPointOnPath(s),o=this.getPointOnPath(s+r);a&&o&&((i+=this.getLineLength(a.x,a.y,o.x,o.y))>=n&&(this.equidistantCache.points.push({x:a.x,y:a.y,distance:s}),i-=n))}}}getEquidistantPointOnPath(e,t,A){if(this.buildEquidistantCache(t,A),e<0||e-this.getPathLength()>5e-5)return null;var r=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}var vU=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class CU extends KQ{constructor(e,t,A){super(e,t,A),this.type="image",this.loaded=!1;var r=this.getHrefAttribute().getString();if(r){var n=r.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(r);e.images.push(this),n?this.loadSvg(r):this.loadImage(r),this.isSvg=n}}loadImage(e){var t=this;return Yw(function*(){try{var A=yield t.document.createImage(e);t.image=A}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0})()}loadSvg(e){var t=this;return Yw(function*(){var A=vU.exec(e);if(A){var r=A[5];"base64"===A[4]?t.image=atob(r):t.image=decodeURIComponent(r)}else try{var n=yield t.document.fetch(e),i=yield n.text();t.image=i}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0})()}renderChildren(e){var{document:t,image:A,loaded:r}=this,n=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(r&&A&&s&&a){if(e.save(),e.translate(n,i),this.isSvg){var o=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:a});o.document.documentElement.parent=this,o.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:a,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&e.drawImage(l,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),A=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new RQ(e,t,e+A,t+r)}}class xU extends KQ{constructor(){super(...arguments),this.type="symbol"}render(e){}}class FU{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var A=this;return Yw(function*(){try{var{document:r}=A,n=(yield r.canvg.parser.load(t)).getElementsByTagName("font");Array.from(n).forEach(t=>{var A=r.createElement(t);r.definitions[e]=A})}catch(e){console.error('Error while loading font "'.concat(t,'":'),e)}A.loaded=!0})()}}class QU extends HQ{constructor(e,t,A){super(e,t,A),this.type="style";var r=KF(Array.from(t.childNodes).map(e=>e.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));r.split("}").forEach(t=>{var A=t.trim();if(A){var r=A.split("{"),n=r[0].split(","),i=r[1].split(";");n.forEach(t=>{var A=t.trim();if(A){var r=e.styles[A]||{};if(i.forEach(t=>{var A=t.indexOf(":"),n=t.substr(0,A).trim(),i=t.substr(A+1,t.length-A).trim();n&&i&&(r[n]=new wQ(e,n,i))}),e.styles[A]=r,e.stylesSpecificity[A]=sQ(A),"@font-face"===A){var n=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach(t=>{if(t.indexOf('format("svg")')>0){var A=YF(t);A&&new FU(e).load(n,A)}})}}})}})}}QU.parseExternalUrl=YF;class UU extends KQ{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),A=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),A.hasValue()&&e.translate(0,A.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:A}=this;if(A){var r=A;if("symbol"===A.type&&((r=new YQ(t,null)).attributes.viewBox=new wQ(t,"viewBox",A.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new wQ(t,"preserveAspectRatio",A.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new wQ(t,"overflow",A.getAttribute("overflow").getString()),r.children=A.children,A.styles.opacity=new wQ(t,"opacity",this.calculateOpacity())),"svg"===r.type){var n=this.getStyle("width",!1,!0),i=this.getStyle("height",!1,!0);n.hasValue()&&(r.attributes.width=new wQ(t,"width",n.getString())),i.hasValue()&&(r.attributes.height=new wQ(t,"height",i.getString()))}var s=r.parent;r.parent=this,r.render(e),r.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return TQ.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function SU(e,t,A,r,n,i){return e[A*r*4+4*t+i]}function EU(e,t,A,r,n,i,s){e[A*r*4+4*t+i]=s}function NU(e,t,A){return e[t]*A}function LU(e,t,A,r){return t+Math.cos(e)*A+Math.sin(e)*r}class _U extends HQ{constructor(e,t,A){super(e,t,A),this.type="feColorMatrix";var r=qF(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var n=r[0];r=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var i=r[0]*Math.PI/180;r=[LU(i,.213,.787,-.213),LU(i,.715,-.715,-.715),LU(i,.072,-.072,.928),0,0,LU(i,.213,-.213,.143),LU(i,.715,.285,.14),LU(i,.072,-.072,-.283),0,0,LU(i,.213,-.213,-.787),LU(i,.715,-.715,.715),LU(i,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.matrix=r,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,A,r,n){for(var{includeOpacity:i,matrix:s}=this,a=e.getImageData(0,0,r,n),o=0;o<n;o++)for(var l=0;l<r;l++){var c=SU(a.data,l,o,r,0,0),u=SU(a.data,l,o,r,0,1),h=SU(a.data,l,o,r,0,2),d=SU(a.data,l,o,r,0,3),f=NU(s,0,c)+NU(s,1,u)+NU(s,2,h)+NU(s,3,d)+NU(s,4,1),p=NU(s,5,c)+NU(s,6,u)+NU(s,7,h)+NU(s,8,d)+NU(s,9,1),g=NU(s,10,c)+NU(s,11,u)+NU(s,12,h)+NU(s,13,d)+NU(s,14,1),m=NU(s,15,c)+NU(s,16,u)+NU(s,17,h)+NU(s,18,d)+NU(s,19,1);i&&(f=0,p=0,g=0,m*=d/255),EU(a.data,l,o,r,0,0,f),EU(a.data,l,o,r,0,1,p),EU(a.data,l,o,r,0,2,g),EU(a.data,l,o,r,0,3,m)}e.clearRect(0,0,r,n),e.putImageData(a,0,0)}}class IU extends HQ{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:A}=this,r=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),i=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!i&&!s){var a=new RQ;this.children.forEach(t=>{a.addBoundingBox(t.getBoundingBox(e))}),r=Math.floor(a.x1),n=Math.floor(a.y1),i=Math.floor(a.width),s=Math.floor(a.height)}var o=this.removeStyles(t,IU.ignoreStyles),l=A.createCanvas(r+i,n+s),c=l.getContext("2d");A.screen.setDefaults(c),this.renderChildren(c),new _U(A,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,r+i,n+s);var u=A.createCanvas(r+i,n+s),h=u.getContext("2d");A.screen.setDefaults(h),t.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=c.createPattern(l,"no-repeat"),h.fillRect(0,0,r+i,n+s),e.fillStyle=h.createPattern(u,"no-repeat"),e.fillRect(0,0,r+i,n+s),this.restoreStyles(t,o)}render(e){}}IU.ignoreStyles=["mask","transform","clip-path"];var kU=()=>{};class TU extends HQ{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,A=Reflect.getPrototypeOf(e),{beginPath:r,closePath:n}=e;A&&(A.beginPath=kU,A.closePath=kU),Reflect.apply(r,e,[]),this.children.forEach(r=>{if(void 0!==r.path){var i=void 0!==r.elementTransform?r.elementTransform():null;i||(i=TQ.fromElement(t,r)),i&&i.apply(e),r.path(e),A&&(A.closePath=n),i&&i.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),A&&(A.beginPath=r,A.closePath=n)}render(e){}}class HU extends HQ{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:A,children:r}=this,n=t.getBoundingBox(e);if(n){var i=0,s=0;r.forEach(e=>{var t=e.extraFilterDistance||0;i=Math.max(i,t),s=Math.max(s,t)});var a=Math.floor(n.width),o=Math.floor(n.height),l=a+2*i,c=o+2*s;if(!(l<1||c<1)){var u=Math.floor(n.x),h=Math.floor(n.y),d=this.removeStyles(t,HU.ignoreStyles),f=A.createCanvas(l,c),p=f.getContext("2d");A.screen.setDefaults(p),p.translate(-u+i,-h+s),t.render(p),r.forEach(e=>{"function"==typeof e.apply&&e.apply(p,0,0,l,c)}),e.drawImage(f,0,0,l,c,u-i,h-s,l,c),this.restoreStyles(t,d)}}}render(e){}}HU.ignoreStyles=["filter","transform","clip-path"];class OU extends HQ{constructor(e,t,A){super(e,t,A),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,A,r,n){}}class PU extends HQ{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,A,r,n){}}class DU extends HQ{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,A,r,n){}}class MU extends HQ{constructor(e,t,A){super(e,t,A),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,A,r,n){var{document:i,blurRadius:s}=this,a=i.window?i.window.document.body:null,o=e.canvas;o.id=i.getUniqueId(),a&&(o.style.display="none",a.appendChild(o)),jF(o,t,A,r,n,s),a&&a.removeChild(o)}}class jU extends HQ{constructor(){super(...arguments),this.type="title"}}class RU extends HQ{constructor(){super(...arguments),this.type="desc"}}var VU={svg:YQ,rect:JQ,circle:$Q,ellipse:ZQ,line:eU,polyline:tU,polygon:AU,path:GQ,pattern:rU,marker:nU,defs:iU,linearGradient:oU,radialGradient:lU,stop:cU,animate:uU,animateColor:hU,animateTransform:dU,font:fU,"font-face":pU,"missing-glyph":gU,glyph:zQ,text:qQ,tspan:WQ,tref:mU,a:wU,textPath:yU,image:CU,g:sU,symbol:xU,style:QU,use:UU,mask:IU,clipPath:TU,filter:HU,feDropShadow:OU,feMorphology:PU,feComposite:DU,feColorMatrix:_U,feGaussianBlur:MU,title:jU,desc:RU};function KU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function GU(){return GU=Yw(function*(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=document.createElement("img");return t&&(A.crossOrigin="Anonymous"),new Promise((t,r)=>{A.onload=()=>{t(A)},A.onerror=(e,t,A,n,i)=>{r(i)},A.src=e})}),GU.apply(this,arguments)}class zU{constructor(e){var{rootEmSize:t=12,emSize:A=12,createCanvas:r=zU.createCanvas,createImage:n=zU.createImage,anonymousCrossOrigin:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=A,this.createCanvas=r,this.createImage=this.bindCreateImage(n,i),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return"boolean"==typeof t?(A,r)=>e(A,"boolean"==typeof r?r:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),A=zU.elementTypes[t];return void 0!==A?new A(this,e):new OQ(this,e)}createTextNode(e){return new XQ(this,e)}setViewBox(e){this.screen.setViewBox(function(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?KU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):KU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}({document:this},e))}}function qU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function WU(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?qU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):qU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}zU.createCanvas=function(e,t){var A=document.createElement("canvas");return A.width=e,A.height=t,A},zU.createImage=function(e){return GU.apply(this,arguments)},zU.elementTypes=VU;class XU{constructor(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new UQ(A),this.screen=new xQ(e,A),this.options=A;var r=new zU(this,A),n=r.createDocumentElement(t);this.document=r,this.documentElement=n}static from(e,t){var A=arguments;return Yw(function*(){var r=A.length>2&&void 0!==A[2]?A[2]:{},n=new UQ(r),i=yield n.parse(t);return new XU(e,i,r)})()}static fromString(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new UQ(A).parseFromString(t);return new XU(e,r,A)}fork(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return XU.from(e,t,WU(WU({},this.options),A))}forkString(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return XU.fromString(e,t,WU(WU({},this.options),A))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return Yw(function*(){var A=e.length>0&&void 0!==e[0]?e[0]:{};t.start(WU({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},A)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:t,screen:A,options:r}=this;A.start(t,WU(WU({enableRedraw:!0},r),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,A)}}var YU=Object.freeze({__proto__:null,AElement:wU,AnimateColorElement:hU,AnimateElement:uU,AnimateTransformElement:dU,BoundingBox:RQ,CB1:uQ,CB2:hQ,CB3:dQ,CB4:fQ,Canvg:XU,CircleElement:$Q,ClipPathElement:TU,DefsElement:iU,DescElement:RU,Document:zU,Element:HQ,EllipseElement:ZQ,FeColorMatrixElement:_U,FeCompositeElement:DU,FeDropShadowElement:OU,FeGaussianBlurElement:MU,FeMorphologyElement:PU,FilterElement:HU,Font:jQ,FontElement:fU,FontFaceElement:pU,GElement:sU,GlyphElement:zQ,GradientElement:aU,ImageElement:CU,LineElement:eU,LinearGradientElement:oU,MarkerElement:nU,MaskElement:IU,Matrix:LQ,MissingGlyphElement:gU,Mouse:yQ,PSEUDO_ZERO:aQ,Parser:UQ,PathElement:GQ,PathParser:VQ,PatternElement:rU,Point:bQ,PolygonElement:AU,PolylineElement:tU,Property:wQ,QB1:pQ,QB2:gQ,QB3:mQ,RadialGradientElement:lU,RectElement:JQ,RenderedElement:KQ,Rotate:EQ,SVGElement:YQ,SVGFontLoader:FU,Scale:NQ,Screen:xQ,Skew:_Q,SkewX:IQ,SkewY:kQ,StopElement:cU,StyleElement:QU,SymbolElement:xU,TRefElement:mU,TSpanElement:WQ,TextElement:qQ,TextPathElement:yU,TitleElement:jU,Transform:TQ,Translate:SQ,UnknownElement:OQ,UseElement:UU,ViewPort:BQ,compressSpaces:KF,default:XU,getSelectorSpecificity:sQ,normalizeAttributeName:XF,normalizeColor:JF,parseExternalUrl:YF,presets:VF,toNumbers:qF,trimLeft:GF,trimRight:zF,vectorMagnitude:oQ,vectorsAngle:cQ,vectorsRatio:lQ});exports.ComponentActionFeatures=O,exports.ComponentSubmissionActions=D,exports.DfFormCheckbox=U,exports.DfFormComments=({comment:t="",onSave:A,placeholder:r="Enter your reason...",className:n="",disabled:i=!1})=>{const[s,a]=e.useState(!0),[o,l]=e.useState(t),[c,u]=e.useState(!1);e.useEffect(()=>{l(t),u(!1)},[t]);const h=e.useCallback(e=>{const A=e.target.value;l(A),u(A!==t)},[t]),d=e.useCallback(()=>{c&&A&&!i&&(A(o),u(!1))},[c,A,o,i]),f=e.useCallback(()=>{},[]),g=e.useCallback(()=>{i||a(!s)},[s,i]);return p.jsxs("div",{className:`df-form-comments ${n}`,children:[p.jsxs("div",{className:"df-form-comments__header",children:[p.jsx("h3",{className:"df-form-comments__title",children:"Comments"}),p.jsx("button",{className:"df-form-comments__toggle",type:"button",onClick:g,"aria-expanded":s,"aria-label":"Toggle comments section",disabled:i,children:s?p.jsx("span",{className:"df-form-comments__toggle-icon",children:"▼"}):p.jsx("span",{className:"df-form-comments__toggle-icon",children:"▶"})})]}),p.jsx("div",{className:"df-form-comments__content "+(s?"df-form-comments__content--expanded":""),children:p.jsx("div",{className:"df-form-comments__input-container",children:p.jsx("div",{className:"df-form-comments__input-line",children:p.jsx("input",{type:"text",id:"comment-input",className:"df-form-comments__input",value:o,onChange:h,onBlur:d,onFocus:f,placeholder:r,disabled:i})})})})]})},exports.DfFormDataGrid=V,exports.DfFormDateTime=N,exports.DfFormErrorMsg=B,exports.DfFormFileUpload=_,exports.DfFormHeading=k,exports.DfFormInput=x,exports.DfFormInstruction=T,exports.DfFormLocation=I,exports.DfFormPreview=({formComponents:t=[],currentDevice:A="desktop",isPreviewMode:r=!1,initialFormData:n=[],onSubmit:i,onFormDataChange:s,formTitle:a,formDescription:o,formTemplateId:l,onComponentSelect:c,onComponentDelete:u,onComponentEdit:h,onComponentUpdate:d,selectedComponent:f,workOrderNumber:g,assetNumber:B,isStandalone:b,user:y,onCreateIssue:v,onUpdateIssue:C})=>{const[H,P]=e.useState({}),[M,j]=e.useState({}),[R,K]=e.useState(!1),[q,W]=e.useState({}),[X,Y]=e.useState({}),[J,$]=e.useState(new Set),[Z,ee]=e.useState(new Map),[te,Ae]=e.useState({isValid:!0}),[re,ne]=e.useState({}),[ie,se]=e.useState({});e.useEffect(()=>{oe()},[t,n]);const ae=(e,t)=>{e.forEach(e=>{if(e.id&&(void 0!==t[e.id]||(e.basic&&"value"in e.basic&&void 0!==e.basic.value&&""!==e.basic.value&&null!==e.basic.value?t[e.id]=e.basic.value:e.basic&&"defaultValue"in e.basic&&void 0!==e.basic.defaultValue&&""!==e.basic.defaultValue&&null!==e.basic.defaultValue?t[e.id]=e.basic.defaultValue:"checkbox"===e.name||"select"===e.name?t[e.id]=[]:t[e.id]="")),e.cells&&Array.isArray(e.cells)&&e.cells.forEach((e,A)=>{Array.isArray(e)&&e.forEach((e,A)=>{e&&e.components&&Array.isArray(e.components)&&ae(e.components,t)})}),e.entries&&Array.isArray(e.entries)&&e.entries.forEach((e,A)=>{e&&e.components&&Array.isArray(e.components)&&ae(e.components,t)}),"file"===e.name&&e.basic){const A=e.basic.files||e.basic.attachments||e.basic.value;A&&(t[e.id]=A)}if(e.id&&e.basic&&e.basic.notes,"instructions"===e.name&&e.basic){e.basic.instructions||(e.basic.instructions=[]);const A=e.basic.value||e.basic.instructions;A&&(t[e.id]=A)}e.children&&Array.isArray(e.children)&&ae(e.children,t)})},oe=e.useCallback(()=>{const e={},A={},r={},i=new Set,a=e=>{e.forEach(e=>{e.id&&((e.basic?.notes||e.basic?.comments)&&(A[e.id]=e.basic?.notes||e.basic?.comments),e.basic?.attachments&&(r[e.id]=e.basic.attachments)),e.children&&a(e.children),e.cells&&e.cells.forEach(e=>e.forEach(e=>{e.components&&a(e.components)})),e.entries&&e.entries.forEach(e=>{e.components&&a(e.components)})})},o=e=>e.map((e,t)=>{let A={...e};if(A.id&&"string"==typeof A.id&&""!==A.id.trim())i.has(A.id)&&(console.error(`[DfFormPreview] Duplicate component ID detected: ${A.id}`),A.id=`${A.id}-duplicate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,console.warn(`[DfFormPreview] Generated new unique ID: ${A.id}`));else{const e=A.name||"component",r=(A.basic?.label||"").replace(/[^a-zA-Z0-9]/g,"").toLowerCase().substring(0,10);A.id=`${e}-${r||"gen"}-${Date.now()}-${Math.random().toString(36).substr(2,6)}-${t}`,console.warn(`[DfFormPreview] Assigned missing ID: ${A.id}`)}return i.add(A.id),A.children&&Array.isArray(A.children)&&(A.children=o(A.children)),A.cells&&Array.isArray(A.cells)&&(A.cells=A.cells.map(e=>Array.isArray(e)?e.map(e=>e&&e.components&&Array.isArray(e.components)?{...e,components:o(e.components)}:e):e)),A.entries&&Array.isArray(A.entries)&&(A.entries=A.entries.map(e=>e&&e.components&&Array.isArray(e.components)?{...e,components:o(e.components)}:e)),A});let l=t;t&&t.length>0&&(l=o(t),JSON.stringify(l)!==JSON.stringify(t)&&s?.(l));let c=n;n&&n.length>0&&(c=o(n)),c&&c.length>0&&ae(c,e),l&&l.length>0&&(ae(l,e),a(l)),P(t=>({...e,...t})),ne(e=>({...A,...e})),se(e=>({...r,...e})),ce()},[n,t]);e.useEffect(()=>{ce()},[H,t,ce]);const le=(e,t,A,r)=>{e.forEach(e=>{if(e.id)if("table"===e.name||"datagrid"===e.name)t[e.id]=!0;else if(e.conditional){const n=m.evaluateConditionalLogic(e.conditional,r,A);t[e.id]=n.shouldShow,e._id&&(t[e._id]=n.shouldShow),e.basic?.label&&(t[e.basic.label]=n.shouldShow)}else t[e.id]=!0,e._id&&(t[e._id]=!0),e.basic?.label&&(t[e.basic.label]=!0);e.cells&&Array.isArray(e.cells)&&e.cells.forEach(e=>{e.forEach(e=>{e.components&&Array.isArray(e.components)&&le(e.components,t,A,r)})}),e.entries&&Array.isArray(e.entries)&&e.entries.forEach(e=>{e.components&&Array.isArray(e.components)&&le(e.components,t,A,r)}),e.children&&Array.isArray(e.children)&&le(e.children,t,A,r)})},ce=e.useCallback((e,A)=>{const r={},n=A||t,i=e||H;n&&n.length>0&&le(n,r,i,n),Y(e=>JSON.stringify(e)===JSON.stringify(r)?e:r)},[t,H]),ue=e.useCallback(e=>{const A=m.findComponent(t,e);if(A&&("table"===A.name||"datagrid"===A.name))return!0;return!(!1===X[e]||A?._id&&!1===X[A._id]||A?.id&&!1===X[A.id])},[X,t]),he=e.useCallback(e=>{if(!e.id||"string"!=typeof e.id||""===e.id.trim())return void console.error("[DfFormPreview] Invalid component ID in onFormValueChange:",e);const A=t.filter(t=>t.id===e.id);if(A.length>1)return void console.error(`[DfFormPreview] ID COLLISION DETECTED! Multiple components share ID "${e.id}":`,A.map(e=>({id:e.id,name:e.name,label:e.basic?.label})));const n=H[e.id];void 0!==n&&e.value;const i=m.findComponent(t,e.id),a={...H};a[e.id]=e.value,i&&(i.id&&(a[i.id]=e.value),i._id&&(a[i._id]=e.value),i.basic?.label&&(a[i.basic.label]=e.value)),P(a),setTimeout(()=>{ce(a,t)},0);const o=t.find(t=>t.id===e.id);if(o){const e=o?.threshold;e&&e.conditions&&e.conditions.length>0&&$(t=>{const A=new Set(t);return e.conditions.forEach(e=>{A.delete(e.id)}),A})}const l=t=>t.map(t=>t.id===e.id&&"defaultValue"in t.basic?{...t,basic:{...t.basic,value:e.value??t.basic.defaultValue,defaultValue:e.value}}:"section"===t.name&&t.children?{...t,children:l(t.children)}:"table"===t.name&&t.cells?{...t,cells:t.cells.map(e=>e.map(e=>{const t={...e};return t.components&&(t.components=l(t.components)),t}))}:"datagrid"===t.name&&t.entries?{...t,entries:t.entries.map(e=>{const t={...e};return t.components&&(t.components=l(t.components)),t})}:t),c=l(t);if(s?.(c),M[e.id]&&j(t=>({...t,[e.id]:""})),!r){if(e.isValid)return void j(t=>{const A=t[e.id];return A&&""!==A.trim()?{...t,[e.id]:""}:t});setTimeout(()=>{fe(e.id)},150)}ce(a,c)},[t,H,M,s,ce]),de=e.useCallback((e,t)=>{for(const A of e){if(A.id===t)return A;if("section"===A.name&&A.children){const e=de(A.children,t);if(e)return e}if("table"===A.name&&A.cells)for(const e of A.cells)for(const A of e)if(A.components){const e=de(A.components,t);if(e)return e}if("datagrid"===A.name&&A.entries)for(const e of A.entries)if(e.components){const A=de(e.components,t);if(A)return A}}return null},[]),fe=e.useCallback(e=>{if(r)return;const A=de(t,e);if(!A)return;const n=H[e]||"";if("number-input"===A.name&&(!n||""===n)){if(A.validation.required){const t=A.validation.customValidationMessage,r=A.basic.label||"This field",n=t||`${r} is required`;j(t=>({...t,[e]:n}))}else j(t=>({...t,[e]:""}));return}let i=!1;i=Array.isArray(n)?n.length>0:"string"==typeof n?""!==n.trim():null!=n;let s="";if(A.validation.required&&!i){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} is required`}else if("email-input"===A.name&&i&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(n)){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be a valid email`}else if(A.validation.minLength&&i&&n.length<A.validation.minLength){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be at least ${A.validation.minLength} characters`}else if(A.validation.maxLength&&i&&n.length>A.validation.maxLength){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be no more than ${A.validation.maxLength} characters`}else if("number-input"===A.name&&i){const e=String(n).trim(),t=parseFloat(e);if(!isNaN(t)){const e=A.validation;e&&"lowerLimit"in e&&void 0!==e.lowerLimit&&null!==e.lowerLimit&&0!==e.lowerLimit&&t<e.lowerLimit?s="Number is below the lower limit":e&&"upperLimit"in e&&void 0!==e.upperLimit&&null!==e.upperLimit&&0!==e.upperLimit&&t>e.upperLimit&&(s="Number is above the upper limit")}}j(t=>({...t,[e]:s}))},[t,r,H,de]),pe=e.useCallback(e=>{W(t=>({...t,[e]:!0})),r||setTimeout(()=>{fe(e)},0)},[r,fe]),ge=e.useCallback(e=>{M[e]&&j(t=>({...t,[e]:""}))},[M]),me=e.useCallback(()=>!Object.values(M).some(e=>e&&"string"==typeof e&&""!==e.trim())&&t.every(e=>{const t=H[e.id]||"";let A=!1;if(A=Array.isArray(t)?t.length>0:"string"==typeof t?""!==t.trim():null!=t,e.validation.required&&!A)return!1;if("number-input"===e.name&&A){const A=String(t).trim(),r=parseFloat(A);if(!isNaN(r)){const t=e.validation;if(t&&"lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&r<t.lowerLimit)return!1;if(t&&"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&r>t.upperLimit)return!1}}return!0}),[t,H,M]),we=e.useCallback((e,t)=>{if(Array.isArray(t))return t.some(t=>we(e,t));if(null==t||""===t)return!1;const A="string"==typeof t?parseFloat(t):t,r="string"==typeof e.value?parseFloat(e.value):e.value;if(!isNaN(A)&&!isNaN(r))switch(e.operator){case"greaterThan":return A>r;case"lessThan":return A<r;case"greaterThanOrEqual":return A>=r;case"lessThanOrEqual":return A<=r;case"equals":return A===r;case"notEquals":return A!==r;default:return!1}const n=String(t).toLowerCase(),i=String(e.value).toLowerCase();switch(e.operator){case"equals":return n===i||String(t)===String(e.value);case"notEquals":return n!==i&&String(t)!==String(e.value);default:return!1}},[]),Be=e.useCallback(()=>{if(r)return[];const e=[];return t.forEach(t=>{const A=t?.condition;if(!A||!A.conditions||0===A.conditions.length)return;const r=H[t.id];null!=r&&""!==r&&!(Array.isArray(r)&&0===r.length)&&A.conditions.forEach(A=>{we(A,r)&&e.push({componentId:t.id,condition:A,componentLabel:t.basic?.label||"Field"})})}),e},[t,H,r,we]),be=e.useCallback(()=>{if(r)return{isValid:!0};const e=Be();if(0===e.length)return{isValid:!0};for(const{condition:t,componentLabel:A}of e){const e=Z.get(t.id)||{notesCompleted:!1,attachmentsCompleted:!1,emailSent:!1},r=[];if(!0!==t.enableRaiseIssue||J.has(t.id)||r.push("raise an issue"),!0!==t.enableNotes||e.notesCompleted||r.push("add notes"),!0!==t.enableAttachment||e.attachmentsCompleted||r.push("add attachments"),!0!==t.enableSendEmail||e.emailSent||r.push("send email"),r.length>0){return{isValid:!1,errorMessage:`Please ${1===r.length?r[0]:r.slice(0,-1).join(", ")+" and "+r[r.length-1]} for the threshold condition met in "${A}". You cannot submit the form until all required actions are completed.`}}}return{isValid:!0}},[r,Be,J,Z]),ye=e.useCallback(e=>{e&&$(t=>{const A=new Set(t);return A.add(e),A})},[]),ve=e.useCallback((e,t,A)=>{e&&ee(r=>{const n=new Map(r),i=n.get(e)||{notesCompleted:!1,attachmentsCompleted:!1,emailSent:!1};return"notes"===t?n.set(e,{...i,notesCompleted:A}):"attachments"===t?n.set(e,{...i,attachmentsCompleted:A}):"email"===t&&n.set(e,{...i,emailSent:A}),n})},[]);e.useEffect(()=>{if(!r){const e=be();Ae(e)}},[H,J,Z,r,be]);const Ce=e.useCallback(()=>{if(r)return!0;let e=!0;K(!0);const A={};return t.forEach(t=>{const r=H[t.id]||"";let n=!1;if(n=Array.isArray(r)?r.length>0:"string"==typeof r?""!==r.trim():null!=r,t.validation.required&&!n){const r=t.validation.customValidationMessage,n=t.basic.label||"This field",i=r||`${n} is required`;A[t.id]=i,e=!1}else if("number-input"===t.name&&n){const n=String(r).trim(),i=parseFloat(n);if(isNaN(i))A[t.id]="";else{const r=t.validation;r&&"lowerLimit"in r&&void 0!==r.lowerLimit&&null!==r.lowerLimit&&0!==r.lowerLimit&&i<r.lowerLimit?(A[t.id]="Number is below the lower limit",e=!1):r&&"upperLimit"in r&&void 0!==r.upperLimit&&null!==r.upperLimit&&0!==r.upperLimit&&i>r.upperLimit?(A[t.id]="Number is above the upper limit",e=!1):A[t.id]=""}}else A[t.id]="";W(e=>({...e,[t.id]:!0}))}),j(A),e},[t,r,H]),xe=e.useCallback((e="Submitted")=>{if(K(!0),!Ce()){const e=t.find(e=>{const t=H[e.id]||"";let A=!1;return A=Array.isArray(t)?t.length>0:"string"==typeof t?""!==t.trim():null!=t,e.validation.required&&!A});if(e){const t=document.getElementById(e.id);t&&t.focus()}return}const A=be();if(!A.isValid){A.errorMessage&&w.showError(A.errorMessage);const e=Be().find(({condition:e})=>!J.has(e.id));if(e){const t=document.getElementById(e.componentId);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}return}const r=e=>e.map(e=>{let t=H[e.id];"text-input"===e.name&&e.basic,void 0===t&&(t="value"in e.basic&&void 0!==e.basic.value?e.basic.value:"defaultValue"in e.basic&&void 0!==e.basic.defaultValue?e.basic.defaultValue:""),"text-input"===e.name&&e.basic;const A={...e,basic:{...e.basic,value:t,defaultValue:t,notes:void 0!==re[e.id]?re[e.id]:e.basic?.notes,comments:void 0!==re[e.id]?re[e.id]:e.basic?.comments||e.basic?.notes,attachments:void 0!==ie[e.id]?ie[e.id]:e.basic?.attachments}};return"section"===A.name&&A.children&&(A.children=r(A.children)),"table"===A.name&&A.cells&&(A.cells=A.cells.map(e=>e.map(e=>{const t={...e};return t.components&&(t.components=r(t.components)),t}))),"datagrid"===A.name&&A.entries&&(A.entries=A.entries.map(e=>{const t={...e};return t.components&&(t.components=r(t.components)),t})),A}),n=r(t),s={...H,status:e};i?.(n,s)},[t,H,Ce,i,re,ie]),Fe=e.useCallback(()=>({[`device-${A}`]:!0,readonly:r}),[A,r]),Qe=e.useCallback((e,t)=>{ne(A=>({...A,[e]:t}))},[]),Ue=e.useCallback((e,t)=>{se(A=>({...A,[e]:t||[]}))},[]),Se=e.useRef(new Map),Ee=e.useRef(0),Ne=A=>{let r;if(A.id&&"string"==typeof A.id&&""!==A.id.trim())r=A.id;else{const e=A.basic?.label||"",t=A.name||"unknown",n=`${t}-${e}`;let i=Se.current.get(n);i||(Ee.current+=1,i=`generated-${t}-${Ee.current}-${Math.random().toString(36).substr(2,9)}`,Se.current.set(n,i),console.warn("[DfFormPreview] Generated and cached ID for component:",i,"key:",n)),r=i,A={...A,id:r}}const n=r,i=H[n];if(void 0!==i){const e=t.filter(e=>e.id!==n&&H[e.id]===i);e.length>0&&console.warn(`[DfFormPreview] Component ${n} shares form value with other components:`,e.map(e=>e.id))}const a={id:n,validationErrors:M,formValue:i,touchedFields:q,formSubmitted:R,mode:"test",readonly:!1,onValueChange:he,onBlur:()=>pe(n),onFocus:()=>ge(n)};switch(A.name){case"text-input":case"number-input":case"email-input":return p.jsx(x,{...a,properties:A,inputType:"text-input"===A.name?"text":"number-input"===A.name?"number":"email",formTemplateId:l,onThresholdIssueRaised:ye,raisedThresholdIssues:J,workOrderNumber:g,assetNumber:B,user:y});case"textarea":return p.jsx(F,{...a,properties:A});case"select":const r={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(Q,{...a,properties:r});case"checkbox":const n={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(U,{...a,properties:n});case"radio":const o={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(S,{...a,properties:o});case"segment":const m={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(E,{...a,properties:m});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...a,properties:A});case"signature":return p.jsx(L,{...a,properties:A});case"heading":return p.jsx(k,{...a,properties:A});case"instructions":const w=i||A.basic?.value||null;return p.jsx(T,{...a,properties:A,formValue:w});case"location":return p.jsx(I,{...a,properties:A});case"section":return p.jsx(G,{...a,properties:A,formData:H,formTemplateId:l,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,onNotesChange:Qe,onAttachmentChange:Ue,workOrderNumber:g,assetNumber:B,user:y,onCreateIssue:v,onUpdateIssue:C,renderFormComponent:e=>Ne(e)});case"table":return p.jsx(e.Suspense,{fallback:p.jsx("div",{children:"Loading table..."}),children:p.jsx(z,{...a,properties:A,formData:H,formTemplateId:l,mode:a.mode,validationErrors:M,touchedFields:q,formSubmitted:R,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,workOrderNumber:g,assetNumber:B,onCreateIssue:v,onUpdateIssue:C,onNotesChange:(e,r)=>{const n=t.map(t=>{if(t.id===A.id&&t.cells){const A=t.cells.map(t=>t.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,notes:r}}:t);return{...t,components:A}}return t}));return{...t,cells:A}}return t});s?.(n)},onAttachmentChange:(e,r)=>{const n=t.map(t=>{if(t.id===A.id&&t.cells){const A=t.cells.map(t=>t.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,attachments:r||[]}}:t);return{...t,components:A}}return t}));return{...t,cells:A}}return t});s?.(n)},renderFormComponent:e=>Ne(e)})});case"datagrid":return p.jsx(V,{...a,properties:A,formData:H,formTemplateId:l,mode:a.mode,validationErrors:M,touchedFields:q,formSubmitted:R,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,workOrderNumber:g,assetNumber:B,user:y,onComponentSelect:c,onComponentDelete:u,onComponentEdit:h,onCreateIssue:v,onUpdateIssue:C,onComponentUpdate:d,selectedComponent:f,onNotesChange:(e,r)=>{Qe(e,r);const n=t.map(t=>{if(t.id===A.id&&t.entries){const A=t.entries.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,notes:r||""}}:t);return{...t,components:A}}return t});return{...t,entries:A}}return t});s?.(n)},onAttachmentChange:(e,r)=>{Ue(e,r);const n=t.map(t=>{if(t.id===A.id&&t.entries){const A=t.entries.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,attachments:r||[]}}:t);return{...t,components:A}}return t});return{...t,entries:A}}return t});s?.(n)},onValueChange:e=>{if(e.id===A.id&&e.value&&"object"==typeof e.value&&"entries"in e.value){const r=t.map(t=>t.id===A.id?{...t,...e.value}:t);s?.(r),e.value.entries&&Array.isArray(e.value.entries)&&e.value.entries.forEach(e=>{e.components&&Array.isArray(e.components)&&e.components.forEach(e=>{if(void 0!==H[e.id]);else{const t=e.basic?.defaultValue;void 0!==t&&P(A=>({...A,[e.id]:t}))}})})}else he(e)},onEntryAdd:()=>{const e=t.find(e=>e.id===A.id);if(e&&e.entries){const e=t.map(e=>e.id===A.id?{...e,entries:e.entries||[]}:e);s?.(e)}else setTimeout(()=>{const e=H[A.id];if(e&&"object"==typeof e&&"entries"in e){const r=t.map(t=>t.id===A.id?{...t,entries:e.entries}:t);s?.(r)}},100)},onEntryRemove:e=>{const r=t.map(t=>{if(t.id===A.id&&t.entries){const A=(t.entries||[]).filter((t,A)=>A!==e).map((e,A)=>({...e,index:A,id:`entry-${t.id}-${A}`,components:e.components?.map((e,t)=>{const r=(e.templateComponents||[])[t];return{...e,id:r?`${r.id}-entry-${A}-${t}`:e.id}})||[]}));return{...t,entries:A}}return t});s?.(r)},renderFormComponent:e=>Ne(e)});case"file":const b=i||A.basic?.value||A.basic?.files||A.basic?.attachments||null;return p.jsx(_,{...a,properties:A,formValue:b});default:return p.jsx("div",{className:"form-group",children:p.jsxs("div",{className:"form-group-label",children:["Unsupported Component: ",A.name]})})}};return p.jsx("div",{className:"form-preview-container",children:p.jsx("div",{className:"form-preview-wrapper",children:p.jsxs("div",{className:`form-preview ${Object.entries(Fe()).map(([e,t])=>t?e:"").join(" ")}`,children:[p.jsx("div",{className:"form-canvas-header"}),0===t.length?p.jsx("div",{className:"empty-state",children:p.jsx("div",{className:"empty-state-card",children:p.jsx("div",{className:"empty-state-preview-area",children:p.jsx("span",{className:"empty-state-placeholder",children:"Add components to see the form preview"})})})}):p.jsxs("form",{className:"form-preview-form",onSubmit:e=>{e.preventDefault(),xe()},children:[(a||o)&&p.jsxs("div",{className:"form-header",children:[a&&p.jsx("h1",{className:"form-title",children:a}),o&&p.jsx("p",{className:"form-description",children:o})]}),t.map(e=>{const A=e.basic,n=H[e.id],i=["select","radio","checkbox","segment"].includes(e.name||""),a=e.options||A?.options||[],o=(()=>{const t=e?.styles?.column;return"section"===e.name||"table"===e.name||"datagrid"===e.name?"col-12":3===t?"col-3":6===t?"col-6":9===t?"col-9":"col-12"})();let c=!1;if(!r)if(i&&null!=n&&""!==n)if("checkbox"===e.name){c=(Array.isArray(n)?n:[n]).some(e=>{const t=a.find(t=>t.value===e);return t&&(t.enableNotes||t.enableAttachment||t.enableRaiseIssue||t.enableSendEmail)})}else{const e=a.find(e=>e.value===n);c=e&&(e.enableNotes||e.enableAttachment||e.enableRaiseIssue||e.enableSendEmail)}else c=A?.enableNotes||A?.enableAttachment||A?.enableRaiseIssue||A?.enableSendEmail;const u=r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0);return p.jsxs("div",{className:`form-group ${o} ${c||u?"has-action-features":""}`,style:{display:ue(e.id)?"block":"none"},children:[Ne(e),!r&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:r?"preview":"test",formTemplateId:l,formValue:n,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,onNotesChange:A=>{ne(t=>({...t,[e.id]:A}));const r=t.map(t=>t.id===e.id?{...t,basic:{...t.basic,notes:A||""}}:t);s?.(r)},onAttachmentChange:A=>{se(t=>({...t,[e.id]:A||[]}));const r=t.map(t=>t.id===e.id?{...t,basic:{...t.basic,attachments:A||[]}}:t);s?.(r)},notes:void 0!==re[e.id]?re[e.id]:e.basic?.notes||"",attachments:void 0!==ie[e.id]?ie[e.id]:e.basic?.attachments||null,workOrderNumber:g,assetNumber:B,isStandalone:b,user:y,onCreateIssue:v,onUpdateIssue:C}),r&&u&&p.jsx(D,{component:e})]},e.id)}),!r&&p.jsxs("div",{className:"form-actions",children:[!R&&p.jsx("button",{type:"button",onClick:()=>xe("Saved"),className:"form-save-button",disabled:R&&!me(),children:"Save"}),p.jsx("button",{type:"button",disabled:!me()||!te.isValid,className:"form-submit-button",title:te.isValid?"":te.errorMessage,onClick:()=>xe("Submitted"),children:"Submit"})]})]})]})})})},exports.DfFormRadio=S,exports.DfFormSection=G,exports.DfFormSegment=E,exports.DfFormSelect=Q,exports.DfFormSignature=L,exports.DfFormTable=J,exports.DfFormTextarea=F,exports.FormSubmissionPdf=ae,exports.RaiseIssueModal=v,exports.ThresholdAlert=C,exports.conditionalLogicService=m,exports.generateFormPdf=async e=>new Promise(async(t,A)=>{let r=null,n=null;try{r=document.createElement("div"),r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="794px",r.style.backgroundColor="#ffffff",r.style.zIndex="-1000",document.body.appendChild(r),n=oe(r),n.render(p.jsx(ae,{formTitle:e.formTitle,formDescription:e.formDescription,userName:e.userName,components:e.components})),await new Promise(e=>setTimeout(e,1e3));const A=await de(r,{scale:2,useCORS:!0,logging:!1,backgroundColor:"#ffffff",windowWidth:794}),i=A.toDataURL("image/jpeg",.95),s=new Wi({orientation:"portrait",unit:"mm",format:"a4"}),a=210,o=297,l=A.height*a/A.width;let c=l,u=0;for(s.addImage(i,"JPEG",0,u,a,l),c-=o;c>0;)u-=o,s.addPage(),s.addImage(i,"JPEG",0,u,a,l),c-=o;t(s.output("blob"))}catch(e){console.error("Error generating PDF:",e),A(e)}finally{n&&setTimeout(()=>{n.unmount(),r&&r.parentNode&&r.parentNode.removeChild(r)},100)}}),exports.toastService=w;
|
|
364
|
+
var DF=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],MF=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function jF(e,t,A,r,n,i){if(!(isNaN(i)||i<1)){i|=0;var s=function(e,t,A,r,n){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==PF(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var i=e.getContext("2d");try{return i.getImageData(t,A,r,n)}catch(e){throw new Error("unable to access image data: "+e)}}(e,t,A,r,n);s=function(e,t,A,r,n,i){for(var s,a=e.data,o=2*i+1,l=r-1,c=n-1,u=i+1,h=u*(u+1)/2,d=new RF,f=d,p=1;p<o;p++)f=f.next=new RF,p===u&&(s=f);f.next=d;for(var g=null,m=null,w=0,B=0,b=DF[i],y=MF[i],v=0;v<n;v++){f=d;for(var C=a[B],x=a[B+1],F=a[B+2],Q=a[B+3],U=0;U<u;U++)f.r=C,f.g=x,f.b=F,f.a=Q,f=f.next;for(var S=0,E=0,N=0,L=0,_=u*C,I=u*x,k=u*F,T=u*Q,H=h*C,O=h*x,P=h*F,D=h*Q,M=1;M<u;M++){var j=B+((l<M?l:M)<<2),R=a[j],V=a[j+1],K=a[j+2],z=a[j+3],G=u-M;H+=(f.r=R)*G,O+=(f.g=V)*G,P+=(f.b=K)*G,D+=(f.a=z)*G,S+=R,E+=V,N+=K,L+=z,f=f.next}g=d,m=s;for(var q=0;q<r;q++){var W=D*b>>>y;if(a[B+3]=W,0!==W){var X=255/W;a[B]=(H*b>>>y)*X,a[B+1]=(O*b>>>y)*X,a[B+2]=(P*b>>>y)*X}else a[B]=a[B+1]=a[B+2]=0;H-=_,O-=I,P-=k,D-=T,_-=g.r,I-=g.g,k-=g.b,T-=g.a;var Y=q+i+1;Y=w+(Y<l?Y:l)<<2,H+=S+=g.r=a[Y],O+=E+=g.g=a[Y+1],P+=N+=g.b=a[Y+2],D+=L+=g.a=a[Y+3],g=g.next;var J=m,$=J.r,Z=J.g,ee=J.b,te=J.a;_+=$,I+=Z,k+=ee,T+=te,S-=$,E-=Z,N-=ee,L-=te,m=m.next,B+=4}w+=r}for(var Ae=0;Ae<r;Ae++){var re=a[B=Ae<<2],ne=a[B+1],ie=a[B+2],se=a[B+3],ae=u*re,oe=u*ne,le=u*ie,ce=u*se,ue=h*re,he=h*ne,de=h*ie,fe=h*se;f=d;for(var pe=0;pe<u;pe++)f.r=re,f.g=ne,f.b=ie,f.a=se,f=f.next;for(var ge=r,me=0,we=0,Be=0,be=0,ye=1;ye<=i;ye++){B=ge+Ae<<2;var ve=u-ye;ue+=(f.r=re=a[B])*ve,he+=(f.g=ne=a[B+1])*ve,de+=(f.b=ie=a[B+2])*ve,fe+=(f.a=se=a[B+3])*ve,be+=re,me+=ne,we+=ie,Be+=se,f=f.next,ye<c&&(ge+=r)}B=Ae,g=d,m=s;for(var Ce=0;Ce<n;Ce++){var xe=B<<2;a[xe+3]=se=fe*b>>>y,se>0?(se=255/se,a[xe]=(ue*b>>>y)*se,a[xe+1]=(he*b>>>y)*se,a[xe+2]=(de*b>>>y)*se):a[xe]=a[xe+1]=a[xe+2]=0,ue-=ae,he-=oe,de-=le,fe-=ce,ae-=g.r,oe-=g.g,le-=g.b,ce-=g.a,xe=Ae+((xe=Ce+u)<c?xe:c)*r<<2,ue+=be+=g.r=a[xe],he+=me+=g.g=a[xe+1],de+=we+=g.b=a[xe+2],fe+=Be+=g.a=a[xe+3],g=g.next,ae+=re=m.r,oe+=ne=m.g,le+=ie=m.b,ce+=se=m.a,be-=re,me-=ne,we-=ie,Be-=se,m=m.next,B+=r}}return e}(s,0,0,r,n,i),e.getContext("2d").putImageData(s,t,A)}}var RF=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var VF=Object.freeze({__proto__:null,offscreen:function(){var{DOMParser:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas:(e,t)=>new OffscreenCanvas(e,t),createImage:e=>Yw(function*(){var t=yield fetch(e),A=yield t.blob();return yield createImageBitmap(A)})()};return"undefined"==typeof DOMParser&&void 0!==e||Reflect.deleteProperty(t,"DOMParser"),t},node:function(e){var{DOMParser:t,canvas:A,fetch:r}=e;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:A.createCanvas,createImage:A.loadImage}}});function KF(e){return e.replace(/(?!\u3000)\s+/gm," ")}function zF(e){return e.replace(/^[\n \t]+/,"")}function GF(e){return e.replace(/[\n \t]+$/,"")}function qF(e){return((e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var WF=/^[A-Z-]+$/;function XF(e){return WF.test(e)?e.toLowerCase():e}function YF(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function JF(e){if(!e.startsWith("rgb"))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,(e,A)=>t--&&A?String(Math.round(parseFloat(e))):e)}var $F=/(\[[^\]]+\])/g,ZF=/(#[^\s+>~.[:]+)/g,eQ=/(\.[^\s+>~.[:]+)/g,tQ=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,AQ=/(:[\w-]+\([^)]*\))/gi,rQ=/(:[^\s+>~.[:]+)/g,nQ=/([^\s+>~.[:]+)/g;function iQ(e,t){var A=t.exec(e);return A?[e.replace(t," "),A.length]:[e,0]}function sQ(e){var t=[0,0,0],A=e.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[A,r]=iQ(A,$F),t[1]+=r,[A,r]=iQ(A,ZF),t[0]+=r,[A,r]=iQ(A,eQ),t[1]+=r,[A,r]=iQ(A,tQ),t[2]+=r,[A,r]=iQ(A,AQ),t[1]+=r,[A,r]=iQ(A,rQ),t[1]+=r,A=A.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[A,r]=iQ(A,nQ),t[2]+=r,t.join("")}var aQ=1e-8;function oQ(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function lQ(e,t){return(e[0]*t[0]+e[1]*t[1])/(oQ(e)*oQ(t))}function cQ(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(lQ(e,t))}function uQ(e){return e*e*e}function hQ(e){return 3*e*e*(1-e)}function dQ(e){return 3*e*(1-e)*(1-e)}function fQ(e){return(1-e)*(1-e)*(1-e)}function pQ(e){return e*e}function gQ(e){return 2*e*(1-e)}function mQ(e){return(1-e)*(1-e)}class wQ{constructor(e,t,A){this.document=e,this.name=t,this.value=A,this.isNormalizedColor=!1}static empty(e){return new wQ(e,"EMPTY","")}split(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:t,name:A}=this;return KF(this.getString()).trim().split(e).map(e=>new wQ(t,A,e))}hasValue(e){var{value:t}=this;return null!==t&&""!==t&&(e||0!==t)&&void 0!==t}isString(e){var{value:t}=this,A="string"==typeof t;return A&&e?e.test(t):A}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return void 0===e||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return void 0===e?0:parseFloat(e);var{value:t}=this,A=parseFloat(t);return this.isString(/%$/)&&(A/=100),A}getString(e){return void 0===e||this.hasValue()?void 0===this.value?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=JF(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[A,r]="boolean"==typeof e?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&r:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(A);default:var i=this.getNumber();return t&&i<1?i*n.computeSize(A):i}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var A=this.getDefinition();if(!A)return null;if("function"==typeof A.createGradient)return A.createGradient(this.document.ctx,e,t);if("function"==typeof A.createPattern){if(A.getHrefAttribute().hasValue()){var r=A.getAttribute("patternTransform");A=A.getHrefAttribute().getDefinition(),r.hasValue()&&A.getAttribute("patternTransform",!0).setValue(r.value)}return A.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?wQ.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),A=t.length,r=0,n=0;n<A&&(","===t[n]&&r++,3!==r);n++);if(e.hasValue()&&this.isString()&&3!==r){var i=new Kx(t);i.ok&&(i.alpha=e.getNumber(),t=i.toRGBA())}return new wQ(this.document,this.name,t)}}wQ.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class BQ{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return"number"==typeof e?e:"x"===e?this.width:"y"===e?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class bQ{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[A=t,r=t]=qF(e);return new bQ(A,r)}static parseScale(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[A=t,r=A]=qF(e);return new bQ(A,r)}static parsePath(e){for(var t=qF(e),A=t.length,r=[],n=0;n<A;n+=2)r.push(new bQ(t[n],t[n+1]));return r}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:A}=this,r=t*e[0]+A*e[2]+e[4],n=t*e[1]+A*e[3]+e[5];this.x=r,this.y=n}}class yQ{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:A}=this,r=e.ctx.canvas;r.onclick=t,r.onmousemove=A,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:A}=this,{style:r}=e.ctx.canvas;r&&(r.cursor=""),t.forEach((e,t)=>{for(var{run:r}=e,n=A[t];n;)r(n),n=n.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(this.working&&t){var{events:A,eventElements:r}=this;A.forEach((A,n)=>{var{x:i,y:s}=A;!r[n]&&t.isPointInPath&&t.isPointInPath(i,s)&&(r[n]=e)})}}checkBoundingBox(e,t){if(this.working&&t){var{events:A,eventElements:r}=this;A.forEach((A,n)=>{var{x:i,y:s}=A;!r[n]&&t.isPointInBox(i,s)&&(r[n]=e)})}}mapXY(e,t){for(var{window:A,ctx:r}=this.screen,n=new bQ(e,t),i=r.canvas;i;)n.x-=i.offsetLeft,n.y-=i.offsetTop,i=i.offsetParent;return A.scrollX&&(n.x+=A.scrollX),A.scrollY&&(n.y+=A.scrollY),n}onClick(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:A,run(e){e.onClick&&e.onClick()}})}onMouseMove(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:A,run(e){e.onMouseMove&&e.onMouseMove()}})}}var vQ="undefined"!=typeof window?window:null,CQ="undefined"!=typeof fetch?fetch.bind(void 0):null;class xQ{constructor(e){var{fetch:t=CQ,window:A=vQ}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new BQ,this.mouse=new yQ(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=A,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(e=>e());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:A,aspectRatio:r,width:n,desiredWidth:i,height:s,desiredHeight:a,minX:o=0,minY:l=0,refX:c,refY:u,clip:h=!1,clipX:d=0,clipY:f=0}=e,p=KF(r).replace(/^defer\s/,""),[g,m]=p.split(" "),w=g||"xMidYMid",B=m||"meet",b=n/i,y=s/a,v=Math.min(b,y),C=Math.max(b,y),x=i,F=a;"meet"===B&&(x*=v,F*=v),"slice"===B&&(x*=C,F*=C);var Q=new wQ(t,"refX",c),U=new wQ(t,"refY",u),S=Q.hasValue()&&U.hasValue();if(S&&A.translate(-v*Q.getPixels("x"),-v*U.getPixels("y")),h){var E=v*d,N=v*f;A.beginPath(),A.moveTo(E,N),A.lineTo(n,N),A.lineTo(n,s),A.lineTo(E,s),A.closePath(),A.clip()}if(!S){var L="meet"===B&&v===y,_="slice"===B&&C===y,I="meet"===B&&v===b,k="slice"===B&&C===b;w.startsWith("xMid")&&(L||_)&&A.translate(n/2-x/2,0),w.endsWith("YMid")&&(I||k)&&A.translate(0,s/2-F/2),w.startsWith("xMax")&&(L||_)&&A.translate(n-x,0),w.endsWith("YMax")&&(I||k)&&A.translate(0,s-F)}switch(!0){case"none"===w:A.scale(b,y);break;case"meet"===B:A.scale(v,v);break;case"slice"===B:A.scale(C,C)}A.translate(-o,-l)}start(e){var{enableRedraw:t=!1,ignoreMouse:A=!1,ignoreAnimation:r=!1,ignoreDimensions:n=!1,ignoreClear:i=!1,forceRedraw:s,scaleWidth:a,scaleHeight:o,offsetX:l,offsetY:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:u,mouse:h}=this,d=1e3/u;if(this.frameDuration=d,this.readyPromise=new Promise(e=>{this.resolveReady=e}),this.isReady()&&this.render(e,n,i,a,o,l,c),t){var f=Date.now(),p=f,g=0,m=()=>{f=Date.now(),(g=f-p)>=d&&(p=f-g%d,this.shouldUpdate(r,s)&&(this.render(e,n,i,a,o,l,c),h.runEvents())),this.intervalId=Ex(m)};A||h.start(),this.intervalId=Ex(m)}}stop(){this.intervalId&&(Ex.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:A}=this;if(this.animations.reduce((e,t)=>t.update(A)||e,!1))return!0}return!("function"!=typeof t||!t())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(e,t,A,r,n,i,s){var{CLIENT_WIDTH:a,CLIENT_HEIGHT:o,viewPort:l,ctx:c,isFirstRender:u}=this,h=c.canvas;l.clear(),h.width&&h.height?l.setCurrent(h.width,h.height):l.setCurrent(a,o);var d=e.getStyle("width"),f=e.getStyle("height");!t&&(u||"number"!=typeof r&&"number"!=typeof n)&&(d.hasValue()&&(h.width=d.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),f.hasValue()&&(h.height=f.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var p=h.clientWidth||h.width,g=h.clientHeight||h.height;if(t&&d.hasValue()&&f.hasValue()&&(p=d.getPixels("x"),g=f.getPixels("y")),l.setCurrent(p,g),"number"==typeof i&&e.getAttribute("x",!0).setValue(i),"number"==typeof s&&e.getAttribute("y",!0).setValue(s),"number"==typeof r||"number"==typeof n){var m=qF(e.getAttribute("viewBox").getString()),w=0,B=0;if("number"==typeof r){var b=e.getStyle("width");b.hasValue()?w=b.getPixels("x")/r:isNaN(m[2])||(w=m[2]/r)}if("number"==typeof n){var y=e.getStyle("height");y.hasValue()?B=y.getPixels("y")/n:isNaN(m[3])||(B=m[3]/n)}w||(w=B),B||(B=w),e.getAttribute("width",!0).setValue(r),e.getAttribute("height",!0).setValue(n);var v=e.getStyle("transform",!0,!0);v.setValue("".concat(v.getString()," scale(").concat(1/w,", ").concat(1/B,")"))}A||c.clearRect(0,0,p,g),e.render(c),u&&(this.isFirstRender=!1)}}xQ.defaultWindow=vQ,xQ.defaultFetch=CQ;var{defaultFetch:FQ}=xQ,QQ="undefined"!=typeof DOMParser?DOMParser:null;class UQ{constructor(){var{fetch:e=FQ,DOMParser:t=QQ}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return Yw(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch(A){return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return Yw(function*(){var A=yield t.fetch(e),r=yield A.text();return t.parseFromString(r)})()}}class SQ{constructor(e,t){this.type="translate",this.point=null,this.point=bQ.parse(t)}apply(e){var{x:t,y:A}=this.point;e.translate(t||0,A||0)}unapply(e){var{x:t,y:A}=this.point;e.translate(-1*t||0,-1*A||0)}applyToPoint(e){var{x:t,y:A}=this.point;e.applyTransform([1,0,0,1,t||0,A||0])}}class EQ{constructor(e,t,A){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var r=qF(t);this.angle=new wQ(e,"angle",r[0]),this.originX=A[0],this.originY=A[1],this.cx=r[1]||0,this.cy=r[2]||0}apply(e){var{cx:t,cy:A,originX:r,originY:n,angle:i}=this,s=t+r.getPixels("x"),a=A+n.getPixels("y");e.translate(s,a),e.rotate(i.getRadians()),e.translate(-s,-a)}unapply(e){var{cx:t,cy:A,originX:r,originY:n,angle:i}=this,s=t+r.getPixels("x"),a=A+n.getPixels("y");e.translate(s,a),e.rotate(-1*i.getRadians()),e.translate(-s,-a)}applyToPoint(e){var{cx:t,cy:A,angle:r}=this,n=r.getRadians();e.applyTransform([1,0,0,1,t||0,A||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-t||0,-A||0])}}class NQ{constructor(e,t,A){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var r=bQ.parseScale(t);0!==r.x&&0!==r.y||(r.x=aQ,r.y=aQ),this.scale=r,this.originX=A[0],this.originY=A[1]}apply(e){var{scale:{x:t,y:A},originX:r,originY:n}=this,i=r.getPixels("x"),s=n.getPixels("y");e.translate(i,s),e.scale(t,A||t),e.translate(-i,-s)}unapply(e){var{scale:{x:t,y:A},originX:r,originY:n}=this,i=r.getPixels("x"),s=n.getPixels("y");e.translate(i,s),e.scale(1/t,1/A||t),e.translate(-i,-s)}applyToPoint(e){var{x:t,y:A}=this.scale;e.applyTransform([t||0,0,0,A||0,0,0])}}class LQ{constructor(e,t,A){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=qF(t),this.originX=A[0],this.originY=A[1]}apply(e){var{originX:t,originY:A,matrix:r}=this,n=t.getPixels("x"),i=A.getPixels("y");e.translate(n,i),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.translate(-n,-i)}unapply(e){var{originX:t,originY:A,matrix:r}=this,n=r[0],i=r[2],s=r[4],a=r[1],o=r[3],l=r[5],c=1/(n*(1*o-0*l)-i*(1*a-0*l)+s*(0*a-0*o)),u=t.getPixels("x"),h=A.getPixels("y");e.translate(u,h),e.transform(c*(1*o-0*l),c*(0*l-1*a),c*(0*s-1*i),c*(1*n-0*s),c*(i*l-s*o),c*(s*a-n*l)),e.translate(-u,-h)}applyToPoint(e){e.applyTransform(this.matrix)}}class _Q extends LQ{constructor(e,t,A){super(e,t,A),this.type="skew",this.angle=null,this.angle=new wQ(e,"angle",t)}}class IQ extends _Q{constructor(e,t,A){super(e,t,A),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class kQ extends _Q{constructor(e,t,A){super(e,t,A),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}class TQ{constructor(e,t,A){this.document=e,this.transforms=[];var r=function(e){return KF(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(t);r.forEach(e=>{if("none"!==e){var[t,r]=function(e){var[t,A]=e.split("(");return[t.trim(),A.trim().replace(")","")]}(e),n=TQ.transformTypes[t];void 0!==n&&this.transforms.push(new n(this.document,r,A))}})}static fromElement(e,t){var A=t.getStyle("transform",!1,!0),[r,n=r]=t.getStyle("transform-origin",!1,!0).split(),i=[r,n];return A.hasValue()?new TQ(e,A.getString(),i):null}apply(e){for(var{transforms:t}=this,A=t.length,r=0;r<A;r++)t[r].apply(e)}unapply(e){for(var{transforms:t}=this,A=t.length-1;A>=0;A--)t[A].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,A=t.length,r=0;r<A;r++)t[r].applyToPoint(e)}}TQ.transformTypes={translate:SQ,rotate:EQ,scale:NQ,matrix:LQ,skewX:IQ,skewY:kQ};class HQ{constructor(e,t){var A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=e,this.node=t,this.captureTextNodes=A,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],t&&1===t.nodeType){if(Array.from(t.attributes).forEach(t=>{var A=XF(t.nodeName);this.attributes[A]=new wQ(e,A,t.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var r=this.getAttribute("style").getString().split(";").map(e=>e.trim());r.forEach(t=>{if(t){var[A,r]=t.split(":").map(e=>e.trim());this.styles[A]=new wQ(e,A,r)}})}var{definitions:n}=e,i=this.getAttribute("id");i.hasValue()&&(n[i.getString()]||(n[i.getString()]=this)),Array.from(t.childNodes).forEach(t=>{if(1===t.nodeType)this.addChild(t);else if(A&&(3===t.nodeType||4===t.nodeType)){var r=e.createTextNode(t);r.getText().length>0&&this.addChild(r)}})}}getAttribute(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=this.attributes[e];if(!A&&t){var r=new wQ(this.document,e,"");return this.attributes[e]=r,r}return A||wQ.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if("href"===e||e.endsWith(":href"))return this.attributes[e];return wQ.empty(this.document)}getStyle(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[e];if(r)return r;var n=this.getAttribute(e);if(null!=n&&n.hasValue())return this.styles[e]=n,n;if(!A){var{parent:i}=this;if(i){var s=i.getStyle(e);if(null!=s&&s.hasValue())return s}}if(t){var a=new wQ(this.document,e,"");return this.styles[e]=a,a}return r||wQ.empty(this.document)}render(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var A=this.getStyle("filter").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=TQ.fromElement(this.document,this);t&&t.apply(e);var A=this.getStyle("clip-path",!1,!0);if(A.hasValue()){var r=A.getDefinition();r&&r.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof HQ?e:this.document.createElement(e);t.parent=this,HQ.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:A}=this;if("function"==typeof A.matches)return A.matches(e);var r=null===(t=A.getAttribute)||void 0===t?void 0:t.call(A,"class");return!(!r||""===r)&&r.split(" ").some(t=>".".concat(t)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var A in e)if(!A.startsWith("@")&&this.matchesSelector(A)){var r=e[A],n=t[A];if(r)for(var i in r){var s=this.stylesSpecificity[i];void 0===s&&(s="000"),n>=s&&(this.styles[i]=r[i],this.stylesSpecificity[i]=n)}}}removeStyles(e,t){return t.reduce((t,A)=>{var r=e.getStyle(A);if(!r.hasValue())return t;var n=r.getString();return r.setValue(""),[...t,[A,n]]},[])}restoreStyles(e,t){t.forEach(t=>{var[A,r]=t;e.getStyle(A,!0).setValue(r)})}isFirstChild(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}HQ.ignoreChildTypes=["title"];class OQ extends HQ{constructor(e,t,A){super(e,t,A)}}function PQ(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function DQ(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function MQ(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}class jQ{constructor(e,t,A,r,n,i){var s=i?"string"==typeof i?jQ.parse(i):i:{};this.fontFamily=n||s.fontFamily,this.fontSize=r||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=A||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>1?arguments[1]:void 0,t="",A="",r="",n="",i="",s=KF(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(" "),a={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return s.forEach(e=>{switch(!0){case!a.fontStyle&&jQ.styles.includes(e):"inherit"!==e&&(t=e),a.fontStyle=!0;break;case!a.fontVariant&&jQ.variants.includes(e):"inherit"!==e&&(A=e),a.fontStyle=!0,a.fontVariant=!0;break;case!a.fontWeight&&jQ.weights.includes(e):"inherit"!==e&&(r=e),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0;break;case!a.fontSize:"inherit"!==e&&([n]=e.split("/")),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0,a.fontSize=!0;break;default:"inherit"!==e&&(i+=e)}}),new jQ(t,A,r,n,i,e)}toString(){return[DQ(this.fontStyle),this.fontVariant,MQ(this.fontWeight),this.fontSize,(e=this.fontFamily,"undefined"==typeof process?e:e.trim().split(",").map(PQ).join(","))].join(" ").trim();var e}}jQ.styles="normal|italic|oblique|inherit",jQ.variants="normal|small-caps|inherit",jQ.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class RQ{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=A,this.y2=r,this.addPoint(e,t),this.addPoint(A,r)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){void 0!==e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),void 0!==t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:A,x2:r,y2:n}=e;this.addPoint(t,A),this.addPoint(r,n)}}sumCubic(e,t,A,r,n){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*A+3*(1-e)*Math.pow(e,2)*r+Math.pow(e,3)*n}bezierCurveAdd(e,t,A,r,n){var i=6*t-12*A+6*r,s=-3*t+9*A-9*r+3*n,a=3*A-3*t;if(0!==s){var o=Math.pow(i,2)-4*a*s;if(!(o<0)){var l=(-i+Math.sqrt(o))/(2*s);0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,A,r,n)):this.addY(this.sumCubic(l,t,A,r,n)));var c=(-i-Math.sqrt(o))/(2*s);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,A,r,n)):this.addY(this.sumCubic(c,t,A,r,n)))}}else{if(0===i)return;var u=-a/i;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,A,r,n)):this.addY(this.sumCubic(u,t,A,r,n)))}}addBezierCurve(e,t,A,r,n,i,s,a){this.addPoint(e,t),this.addPoint(s,a),this.bezierCurveAdd(!0,e,A,n,s),this.bezierCurveAdd(!1,t,r,i,a)}addQuadraticCurve(e,t,A,r,n,i){var s=e+2/3*(A-e),a=t+2/3*(r-t),o=s+1/3*(n-e),l=a+1/3*(i-t);this.addBezierCurve(e,t,s,o,a,l,n,i)}isPointInBox(e,t){var{x1:A,y1:r,x2:n,y2:i}=this;return A<=e&&e<=n&&r<=t&&t<=i}}class VQ extends FF{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new bQ(0,0),this.control=new bQ(0,0),this.current=new bQ(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",A=new bQ(this.command[e],this.command[t]);return this.makeAbsolute(A)}getAsControlPoint(e,t){var A=this.getPoint(e,t);return this.control=A,A}getAsCurrentPoint(e,t){var A=this.getPoint(e,t);return this.current=A,A}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==FF.CURVE_TO&&e!==FF.SMOOTH_CURVE_TO&&e!==FF.QUAD_TO&&e!==FF.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:A},control:{x:r,y:n}}=this;return new bQ(2*t-r,2*A-n)}makeAbsolute(e){if(this.command.relative){var{x:t,y:A}=this.current;e.x+=t,e.y+=A}return e}addMarker(e,t,A){var{points:r,angles:n}=this;A&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=r[r.length-1].angleTo(A)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,A=0;A<t;A++)if(!e[A])for(var r=A+1;r<t;r++)if(e[r]){e[A]=e[r];break}return e}}class KQ extends HQ{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var A=t.getStyle("opacity",!1,!0);A.hasValue(!0)&&(e*=A.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var A=this.getStyle("fill"),r=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),i=this.getStyle("stroke-opacity");if(A.isUrlDefinition()){var s=A.getFillStyleDefinition(this,r);s&&(e.fillStyle=s)}else if(A.hasValue()){"currentColor"===A.getString()&&A.setValue(this.getStyle("color").getColor());var a=A.getColor();"inherit"!==a&&(e.fillStyle="none"===a?"rgba(0,0,0,0)":a)}if(r.hasValue()){var o=new wQ(this.document,"fill",e.fillStyle).addOpacity(r).getColor();e.fillStyle=o}if(n.isUrlDefinition()){var l=n.getFillStyleDefinition(this,i);l&&(e.strokeStyle=l)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var c=n.getString();"inherit"!==c&&(e.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(i.hasValue()){var u=new wQ(this.document,"stroke",e.strokeStyle).addOpacity(i).getString();e.strokeStyle=u}var h=this.getStyle("stroke-width");if(h.hasValue()){var d=h.getPixels();e.lineWidth=d||aQ}var f=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),w=this.getStyle("stroke-dashoffset");if(f.hasValue()&&(e.lineCap=f.getString()),p.hasValue()&&(e.lineJoin=p.getString()),g.hasValue()&&(e.miterLimit=g.getNumber()),m.hasValue()&&"none"!==m.getString()){var B=qF(m.getString());void 0!==e.setLineDash?e.setLineDash(B):void 0!==e.webkitLineDash?e.webkitLineDash=B:void 0===e.mozDash||1===B.length&&0===B[0]||(e.mozDash=B);var b=w.getPixels();void 0!==e.lineDashOffset?e.lineDashOffset=b:void 0!==e.webkitLineDashOffset?e.webkitLineDashOffset=b:void 0!==e.mozDashOffset&&(e.mozDashOffset=b)}}if(this.modifiedEmSizeStack=!1,void 0!==e.font){var y=this.getStyle("font"),v=this.getStyle("font-style"),C=this.getStyle("font-variant"),x=this.getStyle("font-weight"),F=this.getStyle("font-size"),Q=this.getStyle("font-family"),U=new jQ(v.getString(),C.getString(),x.getString(),F.hasValue()?"".concat(F.getPixels(!0),"px"):"",Q.getString(),jQ.parse(y.getString(),e.font));v.setValue(U.fontStyle),C.setValue(U.fontVariant),x.setValue(U.fontWeight),F.setValue(U.fontSize),Q.setValue(U.fontFamily),e.font=U.toString(),F.isPixels()&&(this.document.emSize=F.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class zQ extends KQ{constructor(e,t,A){super(e,t,A),this.type="path",this.pathParser=null,this.pathParser=new VQ(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,A=new RQ;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case VQ.MOVE_TO:this.pathM(e,A);break;case VQ.LINE_TO:this.pathL(e,A);break;case VQ.HORIZ_LINE_TO:this.pathH(e,A);break;case VQ.VERT_LINE_TO:this.pathV(e,A);break;case VQ.CURVE_TO:this.pathC(e,A);break;case VQ.SMOOTH_CURVE_TO:this.pathS(e,A);break;case VQ.QUAD_TO:this.pathQ(e,A);break;case VQ.SMOOTH_QUAD_TO:this.pathT(e,A);break;case VQ.ARC:this.pathA(e,A);break;case VQ.CLOSE_PATH:this.pathZ(e,A)}return A}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),A=e.getMarkerAngles(),r=t.map((e,t)=>[e,A[t]]);return r}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");""!==e.fillStyle&&("inherit"!==t.getString("inherit")?e.fill(t.getString()):e.fill()),""!==e.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var A=this.getMarkers();if(A){var r=A.length-1,n=this.getStyle("marker-start"),i=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var a=n.getDefinition(),[o,l]=A[0];a.render(e,o,l)}if(i.isUrlDefinition())for(var c=i.getDefinition(),u=1;u<r;u++){var[h,d]=A[u];c.render(e,h,d)}if(s.isUrlDefinition()){var f=s.getDefinition(),[p,g]=A[r];f.render(e,p,g)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:A}=this,{point:r}=zQ.pathM(A),{x:n,y:i}=r;A.addMarker(r),t.addPoint(n,i),e&&e.moveTo(n,i)}static pathL(e){var{current:t}=e;return{current:t,point:e.getAsCurrentPoint()}}pathL(e,t){var{pathParser:A}=this,{current:r,point:n}=zQ.pathL(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathH(e){var{current:t,command:A}=e,r=new bQ((A.relative?t.x:0)+A.x,t.y);return e.current=r,{current:t,point:r}}pathH(e,t){var{pathParser:A}=this,{current:r,point:n}=zQ.pathH(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathV(e){var{current:t,command:A}=e,r=new bQ(t.x,(A.relative?t.y:0)+A.y);return e.current=r,{current:t,point:r}}pathV(e,t){var{pathParser:A}=this,{current:r,point:n}=zQ.pathV(A),{x:i,y:s}=n;A.addMarker(n,r),t.addPoint(i,s),e&&e.lineTo(i,s)}static pathC(e){var{current:t}=e;return{current:t,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathC(e,t){var{pathParser:A}=this,{current:r,point:n,controlPoint:i,currentPoint:s}=zQ.pathC(A);A.addMarker(s,i,n),t.addBezierCurve(r.x,r.y,n.x,n.y,i.x,i.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y)}static pathS(e){var{current:t}=e;return{current:t,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathS(e,t){var{pathParser:A}=this,{current:r,point:n,controlPoint:i,currentPoint:s}=zQ.pathS(A);A.addMarker(s,i,n),t.addBezierCurve(r.x,r.y,n.x,n.y,i.x,i.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y)}static pathQ(e){var{current:t}=e;return{current:t,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}pathQ(e,t){var{pathParser:A}=this,{current:r,controlPoint:n,currentPoint:i}=zQ.pathQ(A);A.addMarker(i,n,n),t.addQuadraticCurve(r.x,r.y,n.x,n.y,i.x,i.y),e&&e.quadraticCurveTo(n.x,n.y,i.x,i.y)}static pathT(e){var{current:t}=e,A=e.getReflectedControlPoint();return e.control=A,{current:t,controlPoint:A,currentPoint:e.getAsCurrentPoint()}}pathT(e,t){var{pathParser:A}=this,{current:r,controlPoint:n,currentPoint:i}=zQ.pathT(A);A.addMarker(i,n,n),t.addQuadraticCurve(r.x,r.y,n.x,n.y,i.x,i.y),e&&e.quadraticCurveTo(n.x,n.y,i.x,i.y)}static pathA(e){var{current:t,command:A}=e,{rX:r,rY:n,xRot:i,lArcFlag:s,sweepFlag:a}=A,o=i*(Math.PI/180),l=e.getAsCurrentPoint(),c=new bQ(Math.cos(o)*(t.x-l.x)/2+Math.sin(o)*(t.y-l.y)/2,-Math.sin(o)*(t.x-l.x)/2+Math.cos(o)*(t.y-l.y)/2),u=Math.pow(c.x,2)/Math.pow(r,2)+Math.pow(c.y,2)/Math.pow(n,2);u>1&&(r*=Math.sqrt(u),n*=Math.sqrt(u));var h=(s===a?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(n,2)-Math.pow(r,2)*Math.pow(c.y,2)-Math.pow(n,2)*Math.pow(c.x,2))/(Math.pow(r,2)*Math.pow(c.y,2)+Math.pow(n,2)*Math.pow(c.x,2)));isNaN(h)&&(h=0);var d=new bQ(h*r*c.y/n,h*-n*c.x/r),f=new bQ((t.x+l.x)/2+Math.cos(o)*d.x-Math.sin(o)*d.y,(t.y+l.y)/2+Math.sin(o)*d.x+Math.cos(o)*d.y),p=cQ([1,0],[(c.x-d.x)/r,(c.y-d.y)/n]),g=[(c.x-d.x)/r,(c.y-d.y)/n],m=[(-c.x-d.x)/r,(-c.y-d.y)/n],w=cQ(g,m);return lQ(g,m)<=-1&&(w=Math.PI),lQ(g,m)>=1&&(w=0),{currentPoint:l,rX:r,rY:n,sweepFlag:a,xAxisRotation:o,centp:f,a1:p,ad:w}}pathA(e,t){var{pathParser:A}=this,{currentPoint:r,rX:n,rY:i,sweepFlag:s,xAxisRotation:a,centp:o,a1:l,ad:c}=zQ.pathA(A),u=1-s?1:-1,h=l+u*(c/2),d=new bQ(o.x+n*Math.cos(h),o.y+i*Math.sin(h));if(A.addMarkerAngle(d,h-u*Math.PI/2),A.addMarkerAngle(r,h-u*Math.PI),t.addPoint(r.x,r.y),e&&!isNaN(l)&&!isNaN(c)){var f=n>i?n:i,p=n>i?1:n/i,g=n>i?i/n:1;e.translate(o.x,o.y),e.rotate(a),e.scale(p,g),e.arc(0,0,f,l,l+c,Boolean(1-s)),e.scale(1/p,1/g),e.rotate(-a),e.translate(-o.x,-o.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){zQ.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class GQ extends zQ{constructor(e,t,A){super(e,t,A),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class qQ extends KQ{constructor(e,t,A){super(e,t,new.target===qQ||A),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(e,t);var A=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();A&&(e.textBaseline=A)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((A,r)=>{var n=this.getChildBoundingBox(e,this,this,r);t?t.addBoundingBox(n):t=n}),t}getFontSize(){var{document:e,parent:t}=this,A=jQ.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(A)}getTElementBoundingBox(e){var t=this.getFontSize();return new RQ(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,A){var r=t[A],n=null;if(e.isArabic){var i=t.length,s=t[A-1],a=t[A+1],o="isolated";if((0===A||" "===s)&&A<i-1&&" "!==a&&(o="terminal"),A>0&&" "!==s&&A<i-1&&" "!==a&&(o="medial"),A>0&&" "!==s&&(A===i-1||" "===a)&&(o="initial"),void 0!==e.glyphs[r]){var l=e.glyphs[r];n=l instanceof GQ?l:l[o]}}else n=e.glyphs[r];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var t=e||this.node,A=Array.from(t.parentNode.childNodes),r=A.indexOf(t),n=A.length-1,i=KF(t.textContent||"");return 0===r&&(i=zF(i)),r===n&&(i=GF(i)),i}renderChildren(e){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((t,A)=>{this.renderChild(e,this,this,A)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}renderTElementChildren(e){var{document:t,parent:A}=this,r=this.getText(),n=A.getStyle("font-family").getDefinition();if(n)for(var{unitsPerEm:i}=n.fontFace,s=jQ.parse(t.ctx.font),a=A.getStyle("font-size").getNumber(s.fontSize),o=A.getStyle("font-style").getString(s.fontStyle),l=a/i,c=n.isRTL?r.split("").reverse().join(""):r,u=qF(A.getAttribute("dx").getString()),h=c.length,d=0;d<h;d++){var f=this.getGlyph(n,c,d);e.translate(this.x,this.y),e.scale(l,-l);var p=e.lineWidth;e.lineWidth=e.lineWidth*i/a,"italic"===o&&e.transform(1,0,.4,1,0,0),f.render(e),"italic"===o&&e.transform(1,0,-.4,1,0,0),e.lineWidth=p,e.scale(1/l,-1/l),e.translate(-this.x,-this.y),this.x+=a*(f.horizAdvX||n.horizAdvX)/i,void 0===u[d]||isNaN(u[d])||(this.x+=u[d])}else{var{x:g,y:m}=this;e.fillStyle&&e.fillText(r,g,m),e.strokeStyle&&e.strokeText(r,g,m)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),A=0;A="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=A;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,A)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,A)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,A,r){var n=A.children[r];n.children.length>0?n.children.forEach((A,r)=>{t.adjustChildCoordinatesRecursiveCore(e,t,n,r)}):this.adjustChildCoordinates(e,t,A,r)}adjustChildCoordinates(e,t,A,r){var n=A.children[r];if("function"!=typeof n.measureText)return n;e.save(),n.setContext(e,!0);var i=n.getAttribute("x"),s=n.getAttribute("y"),a=n.getAttribute("dx"),o=n.getAttribute("dy"),l=n.getStyle("font-family").getDefinition(),c=Boolean(l)&&l.isRTL;0===r&&(i.hasValue()||i.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),a.hasValue()||a.setValue(n.getInheritedAttribute("dx")),o.hasValue()||o.setValue(n.getInheritedAttribute("dy")));var u=n.measureText(e);return c&&(t.x-=u),i.hasValue()?(t.applyAnchoring(),n.x=i.getPixels("x"),a.hasValue()&&(n.x+=a.getPixels("x"))):(a.hasValue()&&(t.x+=a.getPixels("x")),n.x=t.x),t.x=n.x,c||(t.x+=u),s.hasValue()?(n.y=s.getPixels("y"),o.hasValue()&&(n.y+=o.getPixels("y"))):(o.hasValue()&&(t.y+=o.getPixels("y")),n.y=t.y),t.y=n.y,t.leafTexts.push(n),t.minX=Math.min(t.minX,n.x,n.x+u),t.maxX=Math.max(t.maxX,n.x,n.x+u),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,t,A,r){var n=A.children[r];if("function"!=typeof n.getBoundingBox)return null;var i=n.getBoundingBox(e);return i?(n.children.forEach((A,r)=>{var s=t.getChildBoundingBox(e,t,n,r);i.addBoundingBox(s)}),i):null}renderChild(e,t,A,r){var n=A.children[r];n.render(e),n.children.forEach((A,r)=>{t.renderChild(e,t,n,r)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var A=this.getText(),r=this.measureTargetText(e,A);return this.measureCache=r,r}measureTargetText(e,t){if(!t.length)return 0;var{parent:A}=this,r=A.getStyle("font-family").getDefinition();if(r){for(var n=this.getFontSize(),i=r.isRTL?t.split("").reverse().join(""):t,s=qF(A.getAttribute("dx").getString()),a=i.length,o=0,l=0;l<a;l++){o+=(this.getGlyph(r,i,l).horizAdvX||r.horizAdvX)*n/r.fontFace.unitsPerEm,void 0===s[l]||isNaN(s[l])||(o+=s[l])}return o}if(!e.measureText)return 10*t.length;e.save(),this.setContext(e,!0);var{width:c}=e.measureText(t);return this.clearContext(e),e.restore(),c}getInheritedAttribute(e){for(var t=this;t instanceof qQ&&t.isFirstChild();){var A=t.parent.getAttribute(e);if(A.hasValue(!0))return A.getValue("0");t=t.parent}return null}}class WQ extends qQ{constructor(e,t,A){super(e,t,new.target===WQ||A),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class XQ extends WQ{constructor(){super(...arguments),this.type="textNode"}}class YQ extends KQ{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:A}=this,{screen:r,window:n}=A,i=e.canvas;if(r.setDefaults(e),i.style&&void 0!==e.font&&n&&void 0!==n.getComputedStyle){e.font=n.getComputedStyle(i).getPropertyValue("font");var s=new wQ(A,"fontSize",jQ.parse(e.font).fontSize);s.hasValue()&&(A.rootEmSize=s.getPixels("y"),A.emSize=A.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:a,height:o}=r.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),c=this.getAttribute("refY"),u=this.getAttribute("viewBox"),h=u.hasValue()?qF(u.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),f=0,p=0,g=0,m=0;h&&(f=h[0],p=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),"marker"===this.type&&(g=f,m=p,f=0,p=0)),r.viewPort.setCurrent(a,o),!this.node||this.parent&&"foreignObject"!==(null===(t=this.node.parentNode)||void 0===t?void 0:t.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),h&&(a=h[2],o=h[3]),A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:r.viewPort.width,desiredWidth:a,height:r.viewPort.height,desiredHeight:o,minX:f,minY:p,refX:l.getValue(),refY:c.getValue(),clip:d,clipX:g,clipY:m}),h&&(r.viewPort.removeCurrent(),r.viewPort.setCurrent(a,o))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),n=this.getAttribute("height",!0),i=this.getAttribute("viewBox"),s=this.getAttribute("style"),a=r.getNumber(0),o=n.getNumber(0);if(A)if("string"==typeof A)this.getAttribute("preserveAspectRatio",!0).setValue(A);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(e),n.setValue(t),i.hasValue()||i.setValue("0 0 ".concat(a||e," ").concat(o||t)),s.hasValue()){var c=this.getStyle("width"),u=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),u.hasValue()&&u.setValue("".concat(t,"px"))}}}class JQ extends zQ{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),i=this.getAttribute("rx"),s=this.getAttribute("ry"),a=i.getPixels("x"),o=s.getPixels("y");if(i.hasValue()&&!s.hasValue()&&(o=a),s.hasValue()&&!i.hasValue()&&(a=o),a=Math.min(a,r/2),o=Math.min(o,n/2),e){var l=(Math.sqrt(2)-1)/3*4;e.beginPath(),n>0&&r>0&&(e.moveTo(t+a,A),e.lineTo(t+r-a,A),e.bezierCurveTo(t+r-a+l*a,A,t+r,A+o-l*o,t+r,A+o),e.lineTo(t+r,A+n-o),e.bezierCurveTo(t+r,A+n-o+l*o,t+r-a+l*a,A+n,t+r-a,A+n),e.lineTo(t+a,A+n),e.bezierCurveTo(t+a-l*a,A+n,t,A+n-o+l*o,t,A+n-o),e.lineTo(t,A+o),e.bezierCurveTo(t,A+o-l*o,t+a-l*a,A,t+a,A),e.closePath())}return new RQ(t,A,t+r,A+n)}getMarkers(){return null}}class $Q extends zQ{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),A=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return e&&r>0&&(e.beginPath(),e.arc(t,A,r,0,2*Math.PI,!1),e.closePath()),new RQ(t-r,A-r,t+r,A+r)}getMarkers(){return null}}class ZQ extends zQ{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=(Math.sqrt(2)-1)/3*4,A=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y");return e&&A>0&&r>0&&(e.beginPath(),e.moveTo(n+A,i),e.bezierCurveTo(n+A,i+t*r,n+t*A,i+r,n,i+r),e.bezierCurveTo(n-t*A,i+r,n-A,i+t*r,n-A,i),e.bezierCurveTo(n-A,i-t*r,n-t*A,i-r,n,i-r),e.bezierCurveTo(n+t*A,i-r,n+A,i-t*r,n+A,i),e.closePath()),new RQ(n-A,i-r,n+A,i+r)}getMarkers(){return null}}class eU extends zQ{constructor(){super(...arguments),this.type="line"}getPoints(){return[new bQ(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new bQ(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:A},{x:r,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,A),e.lineTo(r,n)),new RQ(t,A,r,n)}getMarkers(){var[e,t]=this.getPoints(),A=e.angleTo(t);return[[e,A],[t,A]]}}class tU extends zQ{constructor(e,t,A){super(e,t,A),this.type="polyline",this.points=[],this.points=bQ.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:A,y:r}]=t,n=new RQ(A,r);return e&&(e.beginPath(),e.moveTo(A,r)),t.forEach(t=>{var{x:A,y:r}=t;n.addPoint(A,r),e&&e.lineTo(A,r)}),n}getMarkers(){var{points:e}=this,t=e.length-1,A=[];return e.forEach((r,n)=>{n!==t&&A.push([r,r.angleTo(e[n+1])])}),A.length>0&&A.push([e[e.length-1],A[A.length-1][1]]),A}}class AU extends tU{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:A,y:r}]=this.points;return e&&(e.lineTo(A,r),e.closePath()),t}}class rU extends HQ{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,A){var r=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),i=new YQ(this.document,null);i.attributes.viewBox=new wQ(this.document,"viewBox",this.getAttribute("viewBox").getValue()),i.attributes.width=new wQ(this.document,"width","".concat(r,"px")),i.attributes.height=new wQ(this.document,"height","".concat(n,"px")),i.attributes.transform=new wQ(this.document,"transform",this.getAttribute("patternTransform").getValue()),i.children=this.children;var s=this.document.createCanvas(r,n),a=s.getContext("2d"),o=this.getAttribute("x"),l=this.getAttribute("y");o.hasValue()&&l.hasValue()&&a.translate(o.getPixels("x",!0),l.getPixels("y",!0)),A.hasValue()?this.styles["fill-opacity"]=A:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var u=-1;u<=1;u++)a.save(),i.attributes.x=new wQ(this.document,"x",c*s.width),i.attributes.y=new wQ(this.document,"y",u*s.height),i.render(a),a.restore();return e.createPattern(s,"repeat")}}class nU extends HQ{constructor(){super(...arguments),this.type="marker"}render(e,t,A){if(t){var{x:r,y:n}=t,i=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(r,n),"auto"===i&&e.rotate(A),"strokeWidth"===s&&e.scale(e.lineWidth,e.lineWidth),e.save();var a=new YQ(this.document,null);a.type=this.type,a.attributes.viewBox=new wQ(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.refX=new wQ(this.document,"refX",this.getAttribute("refX").getValue()),a.attributes.refY=new wQ(this.document,"refY",this.getAttribute("refY").getValue()),a.attributes.width=new wQ(this.document,"width",this.getAttribute("markerWidth").getValue()),a.attributes.height=new wQ(this.document,"height",this.getAttribute("markerHeight").getValue()),a.attributes.overflow=new wQ(this.document,"overflow",this.getAttribute("overflow").getValue()),a.attributes.fill=new wQ(this.document,"fill",this.getAttribute("fill").getColor("black")),a.attributes.stroke=new wQ(this.document,"stroke",this.getAttribute("stroke").getValue("none")),a.children=this.children,a.render(e),e.restore(),"strokeWidth"===s&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===i&&e.rotate(-A),e.translate(-r,-n)}}}class iU extends HQ{constructor(){super(...arguments),this.type="defs"}render(){}}class sU extends KQ{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new RQ;return this.children.forEach(A=>{t.addBoundingBox(A.getBoundingBox(e))}),t}}class aU extends HQ{constructor(e,t,A){super(e,t,A),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:r,children:n}=this;n.forEach(e=>{"stop"===e.type&&r.push(e)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,A){var r=this;this.getHrefAttribute().hasValue()&&(r=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(r));var{stops:n}=r,i=this.getGradient(e,t);if(!i)return this.addParentOpacity(A,n[n.length-1].color);if(n.forEach(e=>{i.addColorStop(e.offset,this.addParentOpacity(A,e.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:a,viewPort:o}=s.screen,[l]=o.viewPorts,c=new JQ(s,null);c.attributes.x=new wQ(s,"x",-a/3),c.attributes.y=new wQ(s,"y",-a/3),c.attributes.width=new wQ(s,"width",a),c.attributes.height=new wQ(s,"height",a);var u=new sU(s,null);u.attributes.transform=new wQ(s,"transform",this.getAttribute("gradientTransform").getValue()),u.children=[c];var h=new YQ(s,null);h.attributes.x=new wQ(s,"x",0),h.attributes.y=new wQ(s,"y",0),h.attributes.width=new wQ(s,"width",l.width),h.attributes.height=new wQ(s,"height",l.height),h.children=[u];var d=s.createCanvas(l.width,l.height),f=d.getContext("2d");return f.fillStyle=i,h.render(f),f.createPattern(d,"no-repeat")}return i}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new wQ(this.document,"color",t).addOpacity(e).getColor():t}}class oU extends aU{constructor(e,t,A){super(e,t,A),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var A="objectBoundingBox"===this.getGradientUnits(),r=A?t.getBoundingBox(e):null;if(A&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=A?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),i=A?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=A?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),a=A?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&i===a?null:e.createLinearGradient(n,i,s,a)}}class lU extends aU{constructor(e,t,A){super(e,t,A),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var A="objectBoundingBox"===this.getGradientUnits(),r=t.getBoundingBox(e);if(A&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=A?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),i=A?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,a=i;this.getAttribute("fx").hasValue()&&(s=A?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(a=A?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var o=A?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,a,l,n,i,o)}}class cU extends HQ{constructor(e,t,A){super(e,t,A),this.type="stop";var r=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),i=this.getStyle("stop-color",!0);""===i.getString()&&i.setValue("#000"),n.hasValue()&&(i=i.addOpacity(n)),this.offset=r,this.color=i.getColor()}}class uU extends HQ{constructor(e,t,A){super(e,t,A),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new wQ(e,"values",null);var r=this.getAttribute("values");r.hasValue()&&this.values.setValue(r.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:A,to:r}=this.getProgress(),n=A.getNumber()+(r.getNumber()-A.getNumber())*t;return"%"===e&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:t}=this,A=this.getProperty();if(this.initialValue||(this.initialValue=A.getString(),this.initialUnits=A.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,A.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=A.getString();return!1}this.duration+=e;var n=!1;if(this.begin<this.duration){var i=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var a=s.getString();i="".concat(a,"(").concat(i,")")}A.setValue(i),n=!0}return n}getProgress(){var{document:e,values:t}=this,A={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var r=A.progress*(t.getValue().length-1),n=Math.floor(r),i=Math.ceil(r);A.from=new wQ(e,"from",parseFloat(t.getValue()[n])),A.to=new wQ(e,"to",parseFloat(t.getValue()[i])),A.progress=(r-n)/(i-n)}else A.from=this.from,A.to=this.to;return A}}class hU extends uU{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),r=new Kx(t.getColor()),n=new Kx(A.getColor());if(r.ok&&n.ok){var i=r.r+(n.r-r.r)*e,s=r.g+(n.g-r.g)*e,a=r.b+(n.b-r.b)*e;return"rgb(".concat(Math.floor(i),", ").concat(Math.floor(s),", ").concat(Math.floor(a),")")}return this.getAttribute("from").getColor()}}class dU extends uU{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),r=qF(t.getString()),n=qF(A.getString()),i=r.map((t,A)=>t+(n[A]-t)*e).join(" ");return i}}class fU extends HQ{constructor(e,t,A){super(e,t,A),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:r}=e,{children:n}=this;for(var i of n)switch(i.type){case"font-face":this.fontFace=i;var s=i.getStyle("font-family");s.hasValue()&&(r[s.getString()]=this);break;case"missing-glyph":this.missingGlyph=i;break;case"glyph":var a=i;a.arabicForm?(this.isRTL=!0,this.isArabic=!0,void 0===this.glyphs[a.unicode]&&(this.glyphs[a.unicode]=Object.create(null)),this.glyphs[a.unicode][a.arabicForm]=a):this.glyphs[a.unicode]=a}}render(){}}class pU extends HQ{constructor(e,t,A){super(e,t,A),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class gU extends zQ{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class mU extends qQ{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class wU extends qQ{constructor(e,t,A){super(e,t,A),this.type="a";var{childNodes:r}=t,n=r[0],i=r.length>0&&Array.from(r).every(e=>3===e.nodeType);this.hasText=i,this.text=i?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:A,y:r}=this,{mouse:n}=t.screen,i=new wQ(t,"fontSize",jQ.parse(t.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new RQ(A,r-i.getPixels("y"),A+this.measureText(e),r))}else if(this.children.length>0){var s=new sU(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}}function BU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function bU(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?BU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):BU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}class yU extends qQ{constructor(e,t,A){super(e,t,A),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var r=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(r)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(t=>{var{type:A,points:r}=t;switch(A){case VQ.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case VQ.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case VQ.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case VQ.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case VQ.ARC:var[n,i,s,a,o,l,c,u]=r,h=s>a?s:a,d=s>a?1:s/a,f=s>a?a/s:1;e&&(e.translate(n,i),e.rotate(c),e.scale(d,f),e.arc(0,0,h,o,o+l,Boolean(1-u)),e.scale(1/d,1/f),e.rotate(-c),e.translate(-n,-i));break;case VQ.CLOSE_PATH:e&&e.closePath()}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),A=this.getFontSize(),{glyphInfo:r}=this,n=e.fillStyle;"underline"===t&&e.beginPath(),r.forEach((r,n)=>{var{p0:i,p1:s,rotation:a,text:o}=r;e.save(),e.translate(i.x,i.y),e.rotate(a),e.fillStyle&&e.fillText(o,0,0),e.strokeStyle&&e.strokeText(o,0,0),e.restore(),"underline"===t&&(0===n&&e.moveTo(i.x,i.y+A/8),e.lineTo(s.x,s.y+A/5))}),"underline"===t&&(e.lineWidth=A/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,A,r,n,i,s,a,o){var l=i,c=this.measureText(e,a);" "===a&&"justify"===t&&A<r&&(c+=(r-A)/n),o>-1&&(l+=this.getLetterSpacingAt(o));var u=this.textHeight/20,h=this.getEquidistantPointOnPath(l,u,0),d=this.getEquidistantPointOnPath(l+c,u,0),f={p0:h,p1:d},p=h&&d?Math.atan2(d.y-h.y,d.x-h.x):0;if(s){var g=Math.cos(Math.PI/2+p)*s,m=Math.cos(-p)*s;f.p0=bU(bU({},h),{},{x:h.x+g,y:h.y+m}),f.p1=bU(bU({},d),{},{x:d.x+g,y:d.y+m})}return{offset:l+=c,segment:f,rotation:p}}measureText(e,t){var{measuresCache:A}=this,r=t||this.getText();if(A.has(r))return A.get(r);var n=this.measureTargetText(e,r);return A.set(r,n),n}setTextData(e){if(!this.glyphInfo){var t=this.getText(),A=t.split(""),r=t.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(e=>e.getPixels("x")),i=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),a=this.getStyle("letter-spacing"),o=this.parent.getStyle("letter-spacing"),l=0;a.hasValue()&&"inherit"!==a.getValue()?a.hasValue()&&"initial"!==a.getValue()&&"unset"!==a.getValue()&&(l=a.getPixels()):l=o.getPixels();var c=[],u=t.length;this.letterSpacingCache=c;for(var h=0;h<u;h++)c.push(void 0!==n[h]?n[h]:l);var d=c.reduce((e,t,A)=>0===A?0:e+t||0,0),f=this.measureText(e),p=Math.max(f+d,0);this.textWidth=f,this.textHeight=this.getFontSize(),this.glyphInfo=[];var g=this.getPathLength(),m=this.getStyle("startOffset").getNumber(0)*g,w=0;"middle"!==s&&"center"!==s||(w=-p/2),"end"!==s&&"right"!==s||(w=-p),w+=m,A.forEach((t,n)=>{var{offset:a,segment:o,rotation:l}=this.findSegmentToFitChar(e,s,p,g,r,w,i,t,n);w=a,o.p0&&o.p1&&this.glyphInfo.push({text:A[n],p0:o.p0,p1:o.p1,rotation:l})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:A}=e;for(A.reset();!A.isEnd();){var{current:r}=A,n=r?r.x:0,i=r?r.y:0,s=A.next(),a=s.type,o=[];switch(s.type){case VQ.MOVE_TO:this.pathM(A,o);break;case VQ.LINE_TO:a=this.pathL(A,o);break;case VQ.HORIZ_LINE_TO:a=this.pathH(A,o);break;case VQ.VERT_LINE_TO:a=this.pathV(A,o);break;case VQ.CURVE_TO:this.pathC(A,o);break;case VQ.SMOOTH_CURVE_TO:a=this.pathS(A,o);break;case VQ.QUAD_TO:this.pathQ(A,o);break;case VQ.SMOOTH_QUAD_TO:a=this.pathT(A,o);break;case VQ.ARC:o=this.pathA(A);break;case VQ.CLOSE_PATH:zQ.pathZ(A)}s.type!==VQ.CLOSE_PATH?t.push({type:a,points:o,start:{x:n,y:i},pathLength:this.calcLength(n,i,a,o)}):t.push({type:VQ.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:A,y:r}=zQ.pathM(e).point;t.push(A,r)}pathL(e,t){var{x:A,y:r}=zQ.pathL(e).point;return t.push(A,r),VQ.LINE_TO}pathH(e,t){var{x:A,y:r}=zQ.pathH(e).point;return t.push(A,r),VQ.LINE_TO}pathV(e,t){var{x:A,y:r}=zQ.pathV(e).point;return t.push(A,r),VQ.LINE_TO}pathC(e,t){var{point:A,controlPoint:r,currentPoint:n}=zQ.pathC(e);t.push(A.x,A.y,r.x,r.y,n.x,n.y)}pathS(e,t){var{point:A,controlPoint:r,currentPoint:n}=zQ.pathS(e);return t.push(A.x,A.y,r.x,r.y,n.x,n.y),VQ.CURVE_TO}pathQ(e,t){var{controlPoint:A,currentPoint:r}=zQ.pathQ(e);t.push(A.x,A.y,r.x,r.y)}pathT(e,t){var{controlPoint:A,currentPoint:r}=zQ.pathT(e);return t.push(A.x,A.y,r.x,r.y),VQ.QUAD_TO}pathA(e){var{rX:t,rY:A,sweepFlag:r,xAxisRotation:n,centp:i,a1:s,ad:a}=zQ.pathA(e);return 0===r&&a>0&&(a-=2*Math.PI),1===r&&a<0&&(a+=2*Math.PI),[i.x,i.y,t,A,s,a,n,r]}calcLength(e,t,A,r){var n=0,i=null,s=null,a=0;switch(A){case VQ.LINE_TO:return this.getLineLength(e,t,r[0],r[1]);case VQ.CURVE_TO:for(n=0,i=this.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),a=.01;a<=1;a+=.01)s=this.getPointOnCubicBezier(a,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return n;case VQ.QUAD_TO:for(n=0,i=this.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),a=.01;a<=1;a+=.01)s=this.getPointOnQuadraticBezier(a,e,t,r[0],r[1],r[2],r[3]),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return n;case VQ.ARC:n=0;var o=r[4],l=r[5],c=r[4]+l,u=Math.PI/180;if(Math.abs(o-c)<u&&(u=Math.abs(o-c)),i=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),l<0)for(a=o-u;a>c;a-=u)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;else for(a=o+u;a<c;a+=u)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),n+=this.getLineLength(i.x,i.y,s.x,s.y),i=s;return s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],c,0),n+=this.getLineLength(i.x,i.y,s.x,s.y)}return 0}getPointOnLine(e,t,A,r,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:A,a=(n-A)/(r-t+aQ),o=Math.sqrt(e*e/(1+a*a));r<t&&(o*=-1);var l=a*o,c=null;if(r===t)c={x:i,y:s+l};else if((s-A)/(i-t+aQ)===a)c={x:i+o,y:s+l};else{var u,h,d=this.getLineLength(t,A,r,n);if(d<aQ)return null;var f=(i-t)*(r-t)+(s-A)*(n-A);u=t+(f/=d*d)*(r-t),h=A+f*(n-A);var p=this.getLineLength(i,s,u,h),g=Math.sqrt(e*e-p*p);o=Math.sqrt(g*g/(1+a*a)),r<t&&(o*=-1),c={x:u+o,y:h+(l=a*o)}}return c}getPointOnPath(e){var t=this.getPathLength(),A=0,r=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:n}=this;for(var i of n){if(!i||!(i.pathLength<5e-5||A+i.pathLength+5e-5<e)){var s=e-A,a=0;switch(i.type){case VQ.LINE_TO:r=this.getPointOnLine(s,i.start.x,i.start.y,i.points[0],i.points[1],i.start.x,i.start.y);break;case VQ.ARC:var o=i.points[4],l=i.points[5],c=i.points[4]+l;if(a=o+s/i.pathLength*l,l<0&&a<c||l>=0&&a>c)break;r=this.getPointOnEllipticalArc(i.points[0],i.points[1],i.points[2],i.points[3],a,i.points[6]);break;case VQ.CURVE_TO:(a=s/i.pathLength)>1&&(a=1),r=this.getPointOnCubicBezier(a,i.start.x,i.start.y,i.points[0],i.points[1],i.points[2],i.points[3],i.points[4],i.points[5]);break;case VQ.QUAD_TO:(a=s/i.pathLength)>1&&(a=1),r=this.getPointOnQuadraticBezier(a,i.start.x,i.start.y,i.points[0],i.points[1],i.points[2],i.points[3])}if(r)return r;break}A+=i.pathLength}return null}getLineLength(e,t,A,r){return Math.sqrt((A-e)*(A-e)+(r-t)*(r-t))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,A,r,n,i,s,a,o){return{x:a*uQ(e)+i*hQ(e)+r*dQ(e)+t*fQ(e),y:o*uQ(e)+s*hQ(e)+n*dQ(e)+A*fQ(e)}}getPointOnQuadraticBezier(e,t,A,r,n,i,s){return{x:i*pQ(e)+r*gQ(e)+t*mQ(e),y:s*pQ(e)+n*gQ(e)+A*mQ(e)}}getPointOnEllipticalArc(e,t,A,r,n,i){var s=Math.cos(i),a=Math.sin(i),o=A*Math.cos(n),l=r*Math.sin(n);return{x:e+(o*s-l*a),y:t+(o*a+l*s)}}buildEquidistantCache(e,t){var A=this.getPathLength(),r=t||.25,n=e||A/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==r){this.equidistantCache={step:n,precision:r,points:[]};for(var i=0,s=0;s<=A;s+=r){var a=this.getPointOnPath(s),o=this.getPointOnPath(s+r);a&&o&&((i+=this.getLineLength(a.x,a.y,o.x,o.y))>=n&&(this.equidistantCache.points.push({x:a.x,y:a.y,distance:s}),i-=n))}}}getEquidistantPointOnPath(e,t,A){if(this.buildEquidistantCache(t,A),e<0||e-this.getPathLength()>5e-5)return null;var r=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}var vU=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class CU extends KQ{constructor(e,t,A){super(e,t,A),this.type="image",this.loaded=!1;var r=this.getHrefAttribute().getString();if(r){var n=r.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(r);e.images.push(this),n?this.loadSvg(r):this.loadImage(r),this.isSvg=n}}loadImage(e){var t=this;return Yw(function*(){try{var A=yield t.document.createImage(e);t.image=A}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0})()}loadSvg(e){var t=this;return Yw(function*(){var A=vU.exec(e);if(A){var r=A[5];"base64"===A[4]?t.image=atob(r):t.image=decodeURIComponent(r)}else try{var n=yield t.document.fetch(e),i=yield n.text();t.image=i}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0})()}renderChildren(e){var{document:t,image:A,loaded:r}=this,n=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(r&&A&&s&&a){if(e.save(),e.translate(n,i),this.isSvg){var o=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:a});o.document.documentElement.parent=this,o.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:a,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&e.drawImage(l,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),A=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new RQ(e,t,e+A,t+r)}}class xU extends KQ{constructor(){super(...arguments),this.type="symbol"}render(e){}}class FU{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var A=this;return Yw(function*(){try{var{document:r}=A,n=(yield r.canvg.parser.load(t)).getElementsByTagName("font");Array.from(n).forEach(t=>{var A=r.createElement(t);r.definitions[e]=A})}catch(e){console.error('Error while loading font "'.concat(t,'":'),e)}A.loaded=!0})()}}class QU extends HQ{constructor(e,t,A){super(e,t,A),this.type="style";var r=KF(Array.from(t.childNodes).map(e=>e.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));r.split("}").forEach(t=>{var A=t.trim();if(A){var r=A.split("{"),n=r[0].split(","),i=r[1].split(";");n.forEach(t=>{var A=t.trim();if(A){var r=e.styles[A]||{};if(i.forEach(t=>{var A=t.indexOf(":"),n=t.substr(0,A).trim(),i=t.substr(A+1,t.length-A).trim();n&&i&&(r[n]=new wQ(e,n,i))}),e.styles[A]=r,e.stylesSpecificity[A]=sQ(A),"@font-face"===A){var n=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach(t=>{if(t.indexOf('format("svg")')>0){var A=YF(t);A&&new FU(e).load(n,A)}})}}})}})}}QU.parseExternalUrl=YF;class UU extends KQ{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),A=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),A.hasValue()&&e.translate(0,A.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:A}=this;if(A){var r=A;if("symbol"===A.type&&((r=new YQ(t,null)).attributes.viewBox=new wQ(t,"viewBox",A.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new wQ(t,"preserveAspectRatio",A.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new wQ(t,"overflow",A.getAttribute("overflow").getString()),r.children=A.children,A.styles.opacity=new wQ(t,"opacity",this.calculateOpacity())),"svg"===r.type){var n=this.getStyle("width",!1,!0),i=this.getStyle("height",!1,!0);n.hasValue()&&(r.attributes.width=new wQ(t,"width",n.getString())),i.hasValue()&&(r.attributes.height=new wQ(t,"height",i.getString()))}var s=r.parent;r.parent=this,r.render(e),r.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return TQ.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function SU(e,t,A,r,n,i){return e[A*r*4+4*t+i]}function EU(e,t,A,r,n,i,s){e[A*r*4+4*t+i]=s}function NU(e,t,A){return e[t]*A}function LU(e,t,A,r){return t+Math.cos(e)*A+Math.sin(e)*r}class _U extends HQ{constructor(e,t,A){super(e,t,A),this.type="feColorMatrix";var r=qF(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var n=r[0];r=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var i=r[0]*Math.PI/180;r=[LU(i,.213,.787,-.213),LU(i,.715,-.715,-.715),LU(i,.072,-.072,.928),0,0,LU(i,.213,-.213,.143),LU(i,.715,.285,.14),LU(i,.072,-.072,-.283),0,0,LU(i,.213,-.213,-.787),LU(i,.715,-.715,.715),LU(i,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.matrix=r,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,A,r,n){for(var{includeOpacity:i,matrix:s}=this,a=e.getImageData(0,0,r,n),o=0;o<n;o++)for(var l=0;l<r;l++){var c=SU(a.data,l,o,r,0,0),u=SU(a.data,l,o,r,0,1),h=SU(a.data,l,o,r,0,2),d=SU(a.data,l,o,r,0,3),f=NU(s,0,c)+NU(s,1,u)+NU(s,2,h)+NU(s,3,d)+NU(s,4,1),p=NU(s,5,c)+NU(s,6,u)+NU(s,7,h)+NU(s,8,d)+NU(s,9,1),g=NU(s,10,c)+NU(s,11,u)+NU(s,12,h)+NU(s,13,d)+NU(s,14,1),m=NU(s,15,c)+NU(s,16,u)+NU(s,17,h)+NU(s,18,d)+NU(s,19,1);i&&(f=0,p=0,g=0,m*=d/255),EU(a.data,l,o,r,0,0,f),EU(a.data,l,o,r,0,1,p),EU(a.data,l,o,r,0,2,g),EU(a.data,l,o,r,0,3,m)}e.clearRect(0,0,r,n),e.putImageData(a,0,0)}}class IU extends HQ{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:A}=this,r=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),i=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!i&&!s){var a=new RQ;this.children.forEach(t=>{a.addBoundingBox(t.getBoundingBox(e))}),r=Math.floor(a.x1),n=Math.floor(a.y1),i=Math.floor(a.width),s=Math.floor(a.height)}var o=this.removeStyles(t,IU.ignoreStyles),l=A.createCanvas(r+i,n+s),c=l.getContext("2d");A.screen.setDefaults(c),this.renderChildren(c),new _U(A,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,r+i,n+s);var u=A.createCanvas(r+i,n+s),h=u.getContext("2d");A.screen.setDefaults(h),t.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=c.createPattern(l,"no-repeat"),h.fillRect(0,0,r+i,n+s),e.fillStyle=h.createPattern(u,"no-repeat"),e.fillRect(0,0,r+i,n+s),this.restoreStyles(t,o)}render(e){}}IU.ignoreStyles=["mask","transform","clip-path"];var kU=()=>{};class TU extends HQ{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,A=Reflect.getPrototypeOf(e),{beginPath:r,closePath:n}=e;A&&(A.beginPath=kU,A.closePath=kU),Reflect.apply(r,e,[]),this.children.forEach(r=>{if(void 0!==r.path){var i=void 0!==r.elementTransform?r.elementTransform():null;i||(i=TQ.fromElement(t,r)),i&&i.apply(e),r.path(e),A&&(A.closePath=n),i&&i.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),A&&(A.beginPath=r,A.closePath=n)}render(e){}}class HU extends HQ{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:A,children:r}=this,n=t.getBoundingBox(e);if(n){var i=0,s=0;r.forEach(e=>{var t=e.extraFilterDistance||0;i=Math.max(i,t),s=Math.max(s,t)});var a=Math.floor(n.width),o=Math.floor(n.height),l=a+2*i,c=o+2*s;if(!(l<1||c<1)){var u=Math.floor(n.x),h=Math.floor(n.y),d=this.removeStyles(t,HU.ignoreStyles),f=A.createCanvas(l,c),p=f.getContext("2d");A.screen.setDefaults(p),p.translate(-u+i,-h+s),t.render(p),r.forEach(e=>{"function"==typeof e.apply&&e.apply(p,0,0,l,c)}),e.drawImage(f,0,0,l,c,u-i,h-s,l,c),this.restoreStyles(t,d)}}}render(e){}}HU.ignoreStyles=["filter","transform","clip-path"];class OU extends HQ{constructor(e,t,A){super(e,t,A),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,A,r,n){}}class PU extends HQ{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,A,r,n){}}class DU extends HQ{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,A,r,n){}}class MU extends HQ{constructor(e,t,A){super(e,t,A),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,A,r,n){var{document:i,blurRadius:s}=this,a=i.window?i.window.document.body:null,o=e.canvas;o.id=i.getUniqueId(),a&&(o.style.display="none",a.appendChild(o)),jF(o,t,A,r,n,s),a&&a.removeChild(o)}}class jU extends HQ{constructor(){super(...arguments),this.type="title"}}class RU extends HQ{constructor(){super(...arguments),this.type="desc"}}var VU={svg:YQ,rect:JQ,circle:$Q,ellipse:ZQ,line:eU,polyline:tU,polygon:AU,path:zQ,pattern:rU,marker:nU,defs:iU,linearGradient:oU,radialGradient:lU,stop:cU,animate:uU,animateColor:hU,animateTransform:dU,font:fU,"font-face":pU,"missing-glyph":gU,glyph:GQ,text:qQ,tspan:WQ,tref:mU,a:wU,textPath:yU,image:CU,g:sU,symbol:xU,style:QU,use:UU,mask:IU,clipPath:TU,filter:HU,feDropShadow:OU,feMorphology:PU,feComposite:DU,feColorMatrix:_U,feGaussianBlur:MU,title:jU,desc:RU};function KU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function zU(){return zU=Yw(function*(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=document.createElement("img");return t&&(A.crossOrigin="Anonymous"),new Promise((t,r)=>{A.onload=()=>{t(A)},A.onerror=(e,t,A,n,i)=>{r(i)},A.src=e})}),zU.apply(this,arguments)}class GU{constructor(e){var{rootEmSize:t=12,emSize:A=12,createCanvas:r=GU.createCanvas,createImage:n=GU.createImage,anonymousCrossOrigin:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=A,this.createCanvas=r,this.createImage=this.bindCreateImage(n,i),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return"boolean"==typeof t?(A,r)=>e(A,"boolean"==typeof r?r:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),A=GU.elementTypes[t];return void 0!==A?new A(this,e):new OQ(this,e)}createTextNode(e){return new XQ(this,e)}setViewBox(e){this.screen.setViewBox(function(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?KU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):KU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}({document:this},e))}}function qU(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,r)}return A}function WU(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?qU(Object(A),!0).forEach(function(t){UC(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):qU(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}GU.createCanvas=function(e,t){var A=document.createElement("canvas");return A.width=e,A.height=t,A},GU.createImage=function(e){return zU.apply(this,arguments)},GU.elementTypes=VU;class XU{constructor(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new UQ(A),this.screen=new xQ(e,A),this.options=A;var r=new GU(this,A),n=r.createDocumentElement(t);this.document=r,this.documentElement=n}static from(e,t){var A=arguments;return Yw(function*(){var r=A.length>2&&void 0!==A[2]?A[2]:{},n=new UQ(r),i=yield n.parse(t);return new XU(e,i,r)})()}static fromString(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new UQ(A).parseFromString(t);return new XU(e,r,A)}fork(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return XU.from(e,t,WU(WU({},this.options),A))}forkString(e,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return XU.fromString(e,t,WU(WU({},this.options),A))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return Yw(function*(){var A=e.length>0&&void 0!==e[0]?e[0]:{};t.start(WU({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},A)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:t,screen:A,options:r}=this;A.start(t,WU(WU({enableRedraw:!0},r),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,A)}}var YU=Object.freeze({__proto__:null,AElement:wU,AnimateColorElement:hU,AnimateElement:uU,AnimateTransformElement:dU,BoundingBox:RQ,CB1:uQ,CB2:hQ,CB3:dQ,CB4:fQ,Canvg:XU,CircleElement:$Q,ClipPathElement:TU,DefsElement:iU,DescElement:RU,Document:GU,Element:HQ,EllipseElement:ZQ,FeColorMatrixElement:_U,FeCompositeElement:DU,FeDropShadowElement:OU,FeGaussianBlurElement:MU,FeMorphologyElement:PU,FilterElement:HU,Font:jQ,FontElement:fU,FontFaceElement:pU,GElement:sU,GlyphElement:GQ,GradientElement:aU,ImageElement:CU,LineElement:eU,LinearGradientElement:oU,MarkerElement:nU,MaskElement:IU,Matrix:LQ,MissingGlyphElement:gU,Mouse:yQ,PSEUDO_ZERO:aQ,Parser:UQ,PathElement:zQ,PathParser:VQ,PatternElement:rU,Point:bQ,PolygonElement:AU,PolylineElement:tU,Property:wQ,QB1:pQ,QB2:gQ,QB3:mQ,RadialGradientElement:lU,RectElement:JQ,RenderedElement:KQ,Rotate:EQ,SVGElement:YQ,SVGFontLoader:FU,Scale:NQ,Screen:xQ,Skew:_Q,SkewX:IQ,SkewY:kQ,StopElement:cU,StyleElement:QU,SymbolElement:xU,TRefElement:mU,TSpanElement:WQ,TextElement:qQ,TextPathElement:yU,TitleElement:jU,Transform:TQ,Translate:SQ,UnknownElement:OQ,UseElement:UU,ViewPort:BQ,compressSpaces:KF,default:XU,getSelectorSpecificity:sQ,normalizeAttributeName:XF,normalizeColor:JF,parseExternalUrl:YF,presets:VF,toNumbers:qF,trimLeft:zF,trimRight:GF,vectorMagnitude:oQ,vectorsAngle:cQ,vectorsRatio:lQ});exports.ComponentActionFeatures=O,exports.ComponentSubmissionActions=D,exports.DfFormCheckbox=U,exports.DfFormComments=({comment:t="",onSave:A,placeholder:r="Enter your reason...",className:n="",disabled:i=!1})=>{const[s,a]=e.useState(!0),[o,l]=e.useState(t),[c,u]=e.useState(!1);e.useEffect(()=>{l(t),u(!1)},[t]);const h=e.useCallback(e=>{const A=e.target.value;l(A),u(A!==t)},[t]),d=e.useCallback(()=>{c&&A&&!i&&(A(o),u(!1))},[c,A,o,i]),f=e.useCallback(()=>{},[]),g=e.useCallback(()=>{i||a(!s)},[s,i]);return p.jsxs("div",{className:`df-form-comments ${n}`,children:[p.jsxs("div",{className:"df-form-comments__header",children:[p.jsx("h3",{className:"df-form-comments__title",children:"Comments"}),p.jsx("button",{className:"df-form-comments__toggle",type:"button",onClick:g,"aria-expanded":s,"aria-label":"Toggle comments section",disabled:i,children:s?p.jsx("span",{className:"df-form-comments__toggle-icon",children:"▼"}):p.jsx("span",{className:"df-form-comments__toggle-icon",children:"▶"})})]}),p.jsx("div",{className:"df-form-comments__content "+(s?"df-form-comments__content--expanded":""),children:p.jsx("div",{className:"df-form-comments__input-container",children:p.jsx("div",{className:"df-form-comments__input-line",children:p.jsx("input",{type:"text",id:"comment-input",className:"df-form-comments__input",value:o,onChange:h,onBlur:d,onFocus:f,placeholder:r,disabled:i})})})})]})},exports.DfFormDataGrid=V,exports.DfFormDateTime=N,exports.DfFormErrorMsg=B,exports.DfFormFileUpload=_,exports.DfFormHeading=k,exports.DfFormInput=x,exports.DfFormInstruction=T,exports.DfFormLocation=I,exports.DfFormPreview=({formComponents:t=[],currentDevice:A="desktop",isPreviewMode:r=!1,initialFormData:n=[],onSubmit:i,onFormDataChange:s,formTitle:a,formDescription:o,formTemplateId:l,onComponentSelect:c,onComponentDelete:u,onComponentEdit:h,onComponentUpdate:d,selectedComponent:f,workOrderNumber:g,assetNumber:B,isStandalone:b,user:y,onCreateIssue:v,onUpdateIssue:C})=>{const[H,P]=e.useState({}),[M,j]=e.useState({}),[R,K]=e.useState(!1),[q,W]=e.useState({}),[X,Y]=e.useState({}),[J,$]=e.useState(new Set),[Z,ee]=e.useState(new Map),[te,Ae]=e.useState({isValid:!0}),[re,ne]=e.useState({}),[ie,se]=e.useState({});e.useEffect(()=>{oe()},[t,n]);const ae=(e,t)=>{e.forEach(e=>{if(e.id&&(void 0!==t[e.id]||(e.basic&&"value"in e.basic&&void 0!==e.basic.value&&""!==e.basic.value&&null!==e.basic.value?t[e.id]=e.basic.value:e.basic&&"defaultValue"in e.basic&&void 0!==e.basic.defaultValue&&""!==e.basic.defaultValue&&null!==e.basic.defaultValue?t[e.id]=e.basic.defaultValue:"checkbox"===e.name||"select"===e.name?t[e.id]=[]:t[e.id]="")),e.cells&&Array.isArray(e.cells)&&e.cells.forEach((e,A)=>{Array.isArray(e)&&e.forEach((e,A)=>{e&&e.components&&Array.isArray(e.components)&&ae(e.components,t)})}),e.entries&&Array.isArray(e.entries)&&e.entries.forEach((e,A)=>{e&&e.components&&Array.isArray(e.components)&&ae(e.components,t)}),"file"===e.name&&e.basic){const A=e.basic.files||e.basic.attachments||e.basic.value;A&&(t[e.id]=A)}if(e.id&&e.basic&&e.basic.notes,"instructions"===e.name&&e.basic){e.basic.instructions||(e.basic.instructions=[]);const A=e.basic.value||e.basic.instructions;A&&(t[e.id]=A)}e.children&&Array.isArray(e.children)&&ae(e.children,t)})},oe=e.useCallback(()=>{const e={},A={},r={},i=new Set,a=e=>{e.forEach(e=>{e.id&&((e.basic?.notes||e.basic?.comments)&&(A[e.id]=e.basic?.notes||e.basic?.comments),e.basic?.attachments&&(r[e.id]=e.basic.attachments)),e.children&&a(e.children),e.cells&&e.cells.forEach(e=>e.forEach(e=>{e.components&&a(e.components)})),e.entries&&e.entries.forEach(e=>{e.components&&a(e.components)})})},o=e=>e.map((e,t)=>{let A={...e};if(A.id&&"string"==typeof A.id&&""!==A.id.trim())i.has(A.id)&&(console.error(`[DfFormPreview] Duplicate component ID detected: ${A.id}`),A.id=`${A.id}-duplicate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,console.warn(`[DfFormPreview] Generated new unique ID: ${A.id}`));else{const e=A.name||"component",r=(A.basic?.label||"").replace(/[^a-zA-Z0-9]/g,"").toLowerCase().substring(0,10);A.id=`${e}-${r||"gen"}-${Date.now()}-${Math.random().toString(36).substr(2,6)}-${t}`,console.warn(`[DfFormPreview] Assigned missing ID: ${A.id}`)}return i.add(A.id),A.children&&Array.isArray(A.children)&&(A.children=o(A.children)),A.cells&&Array.isArray(A.cells)&&(A.cells=A.cells.map(e=>Array.isArray(e)?e.map(e=>e&&e.components&&Array.isArray(e.components)?{...e,components:o(e.components)}:e):e)),A.entries&&Array.isArray(A.entries)&&(A.entries=A.entries.map(e=>e&&e.components&&Array.isArray(e.components)?{...e,components:o(e.components)}:e)),A});let l=t;t&&t.length>0&&(l=o(t),JSON.stringify(l)!==JSON.stringify(t)&&s?.(l));let c=n;n&&n.length>0&&(c=o(n)),c&&c.length>0&&ae(c,e),l&&l.length>0&&(ae(l,e),a(l)),P(t=>({...e,...t})),ne(e=>({...A,...e})),se(e=>({...r,...e})),ce()},[n,t]);e.useEffect(()=>{ce()},[H,t,ce]);const le=(e,t,A,r)=>{e.forEach(e=>{if(e.id)if("table"===e.name||"datagrid"===e.name)t[e.id]=!0;else if(e.conditional){const n=m.evaluateConditionalLogic(e.conditional,r,A);t[e.id]=n.shouldShow,e._id&&(t[e._id]=n.shouldShow),e.basic?.label&&(t[e.basic.label]=n.shouldShow)}else t[e.id]=!0,e._id&&(t[e._id]=!0),e.basic?.label&&(t[e.basic.label]=!0);e.cells&&Array.isArray(e.cells)&&e.cells.forEach(e=>{e.forEach(e=>{e.components&&Array.isArray(e.components)&&le(e.components,t,A,r)})}),e.entries&&Array.isArray(e.entries)&&e.entries.forEach(e=>{e.components&&Array.isArray(e.components)&&le(e.components,t,A,r)}),e.children&&Array.isArray(e.children)&&le(e.children,t,A,r)})},ce=e.useCallback((e,A)=>{const r={},n=A||t,i=e||H;n&&n.length>0&&le(n,r,i,n),Y(e=>JSON.stringify(e)===JSON.stringify(r)?e:r)},[t,H]),ue=e.useCallback(e=>{const A=m.findComponent(t,e);if(A&&("table"===A.name||"datagrid"===A.name))return!0;return!(!1===X[e]||A?._id&&!1===X[A._id]||A?.id&&!1===X[A.id])},[X,t]),he=e.useCallback(e=>{if(!e.id||"string"!=typeof e.id||""===e.id.trim())return void console.error("[DfFormPreview] Invalid component ID in onFormValueChange:",e);const A=t.filter(t=>t.id===e.id);if(A.length>1)return void console.error(`[DfFormPreview] ID COLLISION DETECTED! Multiple components share ID "${e.id}":`,A.map(e=>({id:e.id,name:e.name,label:e.basic?.label})));const n=H[e.id];void 0!==n&&e.value;const i=m.findComponent(t,e.id),a={...H};a[e.id]=e.value,i&&(i.id&&(a[i.id]=e.value),i._id&&(a[i._id]=e.value),i.basic?.label&&(a[i.basic.label]=e.value)),P(a),setTimeout(()=>{ce(a,t)},0);const o=t.find(t=>t.id===e.id);if(o){const e=o?.threshold;e&&e.conditions&&e.conditions.length>0&&$(t=>{const A=new Set(t);return e.conditions.forEach(e=>{A.delete(e.id)}),A})}const l=t=>t.map(t=>t.id===e.id&&"defaultValue"in t.basic?{...t,basic:{...t.basic,value:e.value??t.basic.defaultValue,defaultValue:e.value}}:"section"===t.name&&t.children?{...t,children:l(t.children)}:"table"===t.name&&t.cells?{...t,cells:t.cells.map(e=>e.map(e=>{const t={...e};return t.components&&(t.components=l(t.components)),t}))}:"datagrid"===t.name&&t.entries?{...t,entries:t.entries.map(e=>{const t={...e};return t.components&&(t.components=l(t.components)),t})}:t),c=l(t);if(s?.(c),M[e.id]&&j(t=>({...t,[e.id]:""})),!r){if(e.isValid)return void j(t=>{const A=t[e.id];return A&&""!==A.trim()?{...t,[e.id]:""}:t});setTimeout(()=>{fe(e.id)},150)}ce(a,c)},[t,H,M,s,ce]),de=e.useCallback((e,t)=>{for(const A of e){if(A.id===t)return A;if("section"===A.name&&A.children){const e=de(A.children,t);if(e)return e}if("table"===A.name&&A.cells)for(const e of A.cells)for(const A of e)if(A.components){const e=de(A.components,t);if(e)return e}if("datagrid"===A.name&&A.entries)for(const e of A.entries)if(e.components){const A=de(e.components,t);if(A)return A}}return null},[]),fe=e.useCallback(e=>{if(r)return;const A=de(t,e);if(!A)return;const n=H[e]||"";if("number-input"===A.name&&(!n||""===n)){if(A.validation.required){const t=A.validation.customValidationMessage,r=A.basic.label||"This field",n=t||`${r} is required`;j(t=>({...t,[e]:n}))}else j(t=>({...t,[e]:""}));return}let i=!1;i=Array.isArray(n)?n.length>0:"string"==typeof n?""!==n.trim():null!=n;let s="";if(A.validation.required&&!i){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} is required`}else if("email-input"===A.name&&i&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(n)){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be a valid email`}else if(A.validation.minLength&&i&&n.length<A.validation.minLength){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be at least ${A.validation.minLength} characters`}else if(A.validation.maxLength&&i&&n.length>A.validation.maxLength){const e=A.validation.customValidationMessage,t=A.basic.label||"This field";s=e||`${t} must be no more than ${A.validation.maxLength} characters`}else if("number-input"===A.name&&i){const e=String(n).trim(),t=parseFloat(e);if(!isNaN(t)){const e=A.validation;e&&"lowerLimit"in e&&void 0!==e.lowerLimit&&null!==e.lowerLimit&&0!==e.lowerLimit&&t<e.lowerLimit?s="Number is below the lower limit":e&&"upperLimit"in e&&void 0!==e.upperLimit&&null!==e.upperLimit&&0!==e.upperLimit&&t>e.upperLimit&&(s="Number is above the upper limit")}}j(t=>({...t,[e]:s}))},[t,r,H,de]),pe=e.useCallback(e=>{W(t=>({...t,[e]:!0})),r||setTimeout(()=>{fe(e)},0)},[r,fe]),ge=e.useCallback(e=>{M[e]&&j(t=>({...t,[e]:""}))},[M]),me=e.useCallback(()=>!Object.values(M).some(e=>e&&"string"==typeof e&&""!==e.trim())&&t.every(e=>{const t=H[e.id]||"";let A=!1;if(A=Array.isArray(t)?t.length>0:"string"==typeof t?""!==t.trim():null!=t,e.validation.required&&!A)return!1;if("number-input"===e.name&&A){const A=String(t).trim(),r=parseFloat(A);if(!isNaN(r)){const t=e.validation;if(t&&"lowerLimit"in t&&void 0!==t.lowerLimit&&null!==t.lowerLimit&&0!==t.lowerLimit&&r<t.lowerLimit)return!1;if(t&&"upperLimit"in t&&void 0!==t.upperLimit&&null!==t.upperLimit&&0!==t.upperLimit&&r>t.upperLimit)return!1}}return!0}),[t,H,M]),we=e.useCallback((e,t)=>{if(Array.isArray(t))return t.some(t=>we(e,t));if(null==t||""===t)return!1;const A="string"==typeof t?parseFloat(t):t,r="string"==typeof e.value?parseFloat(e.value):e.value;if(!isNaN(A)&&!isNaN(r))switch(e.operator){case"greaterThan":return A>r;case"lessThan":return A<r;case"greaterThanOrEqual":return A>=r;case"lessThanOrEqual":return A<=r;case"equals":return A===r;case"notEquals":return A!==r;default:return!1}const n=String(t).toLowerCase(),i=String(e.value).toLowerCase();switch(e.operator){case"equals":return n===i||String(t)===String(e.value);case"notEquals":return n!==i&&String(t)!==String(e.value);default:return!1}},[]),Be=e.useCallback(()=>{if(r)return[];const e=[];return t.forEach(t=>{const A=t?.condition;if(!A||!A.conditions||0===A.conditions.length)return;const r=H[t.id];null!=r&&""!==r&&!(Array.isArray(r)&&0===r.length)&&A.conditions.forEach(A=>{we(A,r)&&e.push({componentId:t.id,condition:A,componentLabel:t.basic?.label||"Field"})})}),e},[t,H,r,we]),be=e.useCallback(()=>{if(r)return{isValid:!0};const e=Be();if(0===e.length)return{isValid:!0};for(const{condition:t,componentLabel:A}of e){const e=Z.get(t.id)||{notesCompleted:!1,attachmentsCompleted:!1,emailSent:!1},r=[];if(!0!==t.enableRaiseIssue||J.has(t.id)||r.push("raise an issue"),!0!==t.enableNotes||e.notesCompleted||r.push("add notes"),!0!==t.enableAttachment||e.attachmentsCompleted||r.push("add attachments"),!0!==t.enableSendEmail||e.emailSent||r.push("send email"),r.length>0){return{isValid:!1,errorMessage:`Please ${1===r.length?r[0]:r.slice(0,-1).join(", ")+" and "+r[r.length-1]} for the threshold condition met in "${A}". You cannot submit the form until all required actions are completed.`}}}return{isValid:!0}},[r,Be,J,Z]),ye=e.useCallback(e=>{e&&$(t=>{const A=new Set(t);return A.add(e),A})},[]),ve=e.useCallback((e,t,A)=>{e&&ee(r=>{const n=new Map(r),i=n.get(e)||{notesCompleted:!1,attachmentsCompleted:!1,emailSent:!1};return"notes"===t?n.set(e,{...i,notesCompleted:A}):"attachments"===t?n.set(e,{...i,attachmentsCompleted:A}):"email"===t&&n.set(e,{...i,emailSent:A}),n})},[]);e.useEffect(()=>{if(!r){const e=be();Ae(e)}},[H,J,Z,r,be]);const Ce=e.useCallback(()=>{if(r)return!0;let e=!0;K(!0);const A={};return t.forEach(t=>{const r=H[t.id]||"";let n=!1;if(n=Array.isArray(r)?r.length>0:"string"==typeof r?""!==r.trim():null!=r,t.validation.required&&!n){const r=t.validation.customValidationMessage,n=t.basic.label||"This field",i=r||`${n} is required`;A[t.id]=i,e=!1}else if("number-input"===t.name&&n){const n=String(r).trim(),i=parseFloat(n);if(isNaN(i))A[t.id]="";else{const r=t.validation;r&&"lowerLimit"in r&&void 0!==r.lowerLimit&&null!==r.lowerLimit&&0!==r.lowerLimit&&i<r.lowerLimit?(A[t.id]="Number is below the lower limit",e=!1):r&&"upperLimit"in r&&void 0!==r.upperLimit&&null!==r.upperLimit&&0!==r.upperLimit&&i>r.upperLimit?(A[t.id]="Number is above the upper limit",e=!1):A[t.id]=""}}else A[t.id]="";W(e=>({...e,[t.id]:!0}))}),j(A),e},[t,r,H]),xe=e.useCallback((e="Submitted")=>{if(K(!0),!Ce()){const e=t.find(e=>{const t=H[e.id]||"";let A=!1;return A=Array.isArray(t)?t.length>0:"string"==typeof t?""!==t.trim():null!=t,e.validation.required&&!A});if(e){const t=document.getElementById(e.id);t&&t.focus()}return}const A=be();if(!A.isValid){A.errorMessage&&w.showError(A.errorMessage);const e=Be().find(({condition:e})=>!J.has(e.id));if(e){const t=document.getElementById(e.componentId);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}return}const r=e=>e.map(e=>{let t=H[e.id];"text-input"===e.name&&e.basic,void 0===t&&(t="value"in e.basic&&void 0!==e.basic.value?e.basic.value:"defaultValue"in e.basic&&void 0!==e.basic.defaultValue?e.basic.defaultValue:""),"text-input"===e.name&&e.basic;const A={...e,basic:{...e.basic,value:t,defaultValue:t,notes:void 0!==re[e.id]?re[e.id]:e.basic?.notes,comments:void 0!==re[e.id]?re[e.id]:e.basic?.comments||e.basic?.notes,attachments:void 0!==ie[e.id]?ie[e.id]:e.basic?.attachments}};return"section"===A.name&&A.children&&(A.children=r(A.children)),"table"===A.name&&A.cells&&(A.cells=A.cells.map(e=>e.map(e=>{const t={...e};return t.components&&(t.components=r(t.components)),t}))),"datagrid"===A.name&&A.entries&&(A.entries=A.entries.map(e=>{const t={...e};return t.components&&(t.components=r(t.components)),t})),A}),n=r(t),s={...H,status:e};i?.(n,s)},[t,H,Ce,i,re,ie]),Fe=e.useCallback(()=>({[`device-${A}`]:!0,readonly:r}),[A,r]),Qe=e.useCallback((e,t)=>{ne(A=>({...A,[e]:t}))},[]),Ue=e.useCallback((e,t)=>{se(A=>({...A,[e]:t||[]}))},[]),Se=e.useRef(new Map),Ee=e.useRef(0),Ne=A=>{let r;if(A.id&&"string"==typeof A.id&&""!==A.id.trim())r=A.id;else{const e=A.basic?.label||"",t=A.name||"unknown",n=`${t}-${e}`;let i=Se.current.get(n);i||(Ee.current+=1,i=`generated-${t}-${Ee.current}-${Math.random().toString(36).substr(2,9)}`,Se.current.set(n,i),console.warn("[DfFormPreview] Generated and cached ID for component:",i,"key:",n)),r=i,A={...A,id:r}}const n=r,i=H[n];if(void 0!==i){const e=t.filter(e=>e.id!==n&&H[e.id]===i);e.length>0&&console.warn(`[DfFormPreview] Component ${n} shares form value with other components:`,e.map(e=>e.id))}const a={id:n,validationErrors:M,formValue:i,touchedFields:q,formSubmitted:R,mode:"test",readonly:!1,onValueChange:he,onBlur:()=>pe(n),onFocus:()=>ge(n)};switch(A.name){case"text-input":case"number-input":case"email-input":return p.jsx(x,{...a,properties:A,inputType:"text-input"===A.name?"text":"number-input"===A.name?"number":"email",formTemplateId:l,onThresholdIssueRaised:ye,raisedThresholdIssues:J,workOrderNumber:g,assetNumber:B,user:y});case"textarea":return p.jsx(F,{...a,properties:A});case"select":const r={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(Q,{...a,properties:r});case"checkbox":const n={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(U,{...a,properties:n});case"radio":const o={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(S,{...a,properties:o});case"segment":const m={...A,options:A.basic?.options||[],basic:{...A.basic,comments:A.basic?.comments||""}};return p.jsx(E,{...a,properties:m});case"date":case"date-picker":case"datetime-picker":return p.jsx(N,{...a,properties:A});case"signature":return p.jsx(L,{...a,properties:A});case"heading":return p.jsx(k,{...a,properties:A});case"instructions":const w=i||A.basic?.value||null;return p.jsx(T,{...a,properties:A,formValue:w});case"location":return p.jsx(I,{...a,properties:A});case"section":return p.jsx(z,{...a,properties:A,formData:H,formTemplateId:l,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,onNotesChange:Qe,onAttachmentChange:Ue,workOrderNumber:g,assetNumber:B,user:y,onCreateIssue:v,onUpdateIssue:C,renderFormComponent:e=>Ne(e)});case"table":return p.jsx(e.Suspense,{fallback:p.jsx("div",{children:"Loading table..."}),children:p.jsx(G,{...a,properties:A,formData:H,formTemplateId:l,mode:a.mode,validationErrors:M,touchedFields:q,formSubmitted:R,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,workOrderNumber:g,assetNumber:B,onCreateIssue:v,onUpdateIssue:C,onNotesChange:(e,r)=>{const n=t.map(t=>{if(t.id===A.id&&t.cells){const A=t.cells.map(t=>t.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,notes:r}}:t);return{...t,components:A}}return t}));return{...t,cells:A}}return t});s?.(n)},onAttachmentChange:(e,r)=>{const n=t.map(t=>{if(t.id===A.id&&t.cells){const A=t.cells.map(t=>t.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,attachments:r||[]}}:t);return{...t,components:A}}return t}));return{...t,cells:A}}return t});s?.(n)},renderFormComponent:e=>Ne(e)})});case"datagrid":return p.jsx(V,{...a,properties:A,formData:H,formTemplateId:l,mode:a.mode,validationErrors:M,touchedFields:q,formSubmitted:R,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,workOrderNumber:g,assetNumber:B,user:y,onComponentSelect:c,onComponentDelete:u,onComponentEdit:h,onCreateIssue:v,onUpdateIssue:C,onComponentUpdate:d,selectedComponent:f,onNotesChange:(e,r)=>{Qe(e,r);const n=t.map(t=>{if(t.id===A.id&&t.entries){const A=t.entries.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,notes:r||""}}:t);return{...t,components:A}}return t});return{...t,entries:A}}return t});s?.(n)},onAttachmentChange:(e,r)=>{Ue(e,r);const n=t.map(t=>{if(t.id===A.id&&t.entries){const A=t.entries.map(t=>{if(t.components){const A=t.components.map(t=>t.id===e?{...t,basic:{...t.basic,attachments:r||[]}}:t);return{...t,components:A}}return t});return{...t,entries:A}}return t});s?.(n)},onValueChange:e=>{if(e.id===A.id&&e.value&&"object"==typeof e.value&&"entries"in e.value){const r=t.map(t=>t.id===A.id?{...t,...e.value}:t);s?.(r),e.value.entries&&Array.isArray(e.value.entries)&&e.value.entries.forEach(e=>{e.components&&Array.isArray(e.components)&&e.components.forEach(e=>{if(void 0!==H[e.id]);else{const t=e.basic?.defaultValue;void 0!==t&&P(A=>({...A,[e.id]:t}))}})})}else he(e)},onEntryAdd:()=>{const e=t.find(e=>e.id===A.id);if(e&&e.entries){const e=t.map(e=>e.id===A.id?{...e,entries:e.entries||[]}:e);s?.(e)}else setTimeout(()=>{const e=H[A.id];if(e&&"object"==typeof e&&"entries"in e){const r=t.map(t=>t.id===A.id?{...t,entries:e.entries}:t);s?.(r)}},100)},onEntryRemove:e=>{const r=t.map(t=>{if(t.id===A.id&&t.entries){const A=(t.entries||[]).filter((t,A)=>A!==e).map((e,A)=>({...e,index:A,id:`entry-${t.id}-${A}`,components:e.components?.map((e,t)=>{const r=(e.templateComponents||[])[t];return{...e,id:r?`${r.id}-entry-${A}-${t}`:e.id}})||[]}));return{...t,entries:A}}return t});s?.(r)},renderFormComponent:e=>Ne(e)});case"file":const b=i||A.basic?.value||A.basic?.files||A.basic?.attachments||null;return p.jsx(_,{...a,properties:A,formValue:b});default:return p.jsx("div",{className:"form-group",children:p.jsxs("div",{className:"form-group-label",children:["Unsupported Component: ",A.name]})})}};return p.jsx("div",{className:"form-preview-container",children:p.jsx("div",{className:"form-preview-wrapper",children:p.jsxs("div",{className:`form-preview ${Object.entries(Fe()).map(([e,t])=>t?e:"").join(" ")}`,children:[p.jsx("div",{className:"form-canvas-header"}),0===t.length?p.jsx("div",{className:"empty-state",children:p.jsx("div",{className:"empty-state-card",children:p.jsx("div",{className:"empty-state-preview-area",children:p.jsx("span",{className:"empty-state-placeholder",children:"Add components to see the form preview"})})})}):p.jsxs("form",{className:"form-preview-form",onSubmit:e=>{e.preventDefault(),xe()},children:[(a||o)&&p.jsxs("div",{className:"form-header",children:[a&&p.jsx("h1",{className:"form-title",children:a}),o&&p.jsx("p",{className:"form-description",children:o})]}),t.map(e=>{const A=e.basic,n=H[e.id],i=["select","radio","checkbox","segment"].includes(e.name||""),a=e.options||A?.options||[],o=(()=>{const t=e?.styles?.column;return"section"===e.name||"table"===e.name||"datagrid"===e.name?"col-12":3===t?"col-3":6===t?"col-6":9===t?"col-9":"col-12"})();let c=!1;if(!r)if(i&&null!=n&&""!==n)if("checkbox"===e.name){c=(Array.isArray(n)?n:[n]).some(e=>{const t=a.find(t=>t.value===e);return t&&(t.enableNotes||t.enableAttachment||t.enableRaiseIssue||t.enableSendEmail)})}else{const e=a.find(e=>e.value===n);c=e&&(e.enableNotes||e.enableAttachment||e.enableRaiseIssue||e.enableSendEmail)}else c=A?.enableNotes||A?.enableAttachment||A?.enableRaiseIssue||A?.enableSendEmail;const u=r&&(e.basic?.notes&&e.basic.notes.trim().length>0||e.basic?.attachments&&Array.isArray(e.basic.attachments)&&e.basic.attachments.length>0);return p.jsxs("div",{className:`form-group ${o} ${c||u?"has-action-features":""}`,style:{display:ue(e.id)?"block":"none"},children:[Ne(e),!r&&!["section","table","heading","file","instructions","signature","location","datagrid"].includes(e.name)&&p.jsx(O,{component:e,mode:r?"preview":"test",formTemplateId:l,formValue:n,onThresholdActionCompletion:ve,onThresholdIssueRaised:ye,onNotesChange:A=>{ne(t=>({...t,[e.id]:A}));const r=t.map(t=>t.id===e.id?{...t,basic:{...t.basic,notes:A||""}}:t);s?.(r)},onAttachmentChange:A=>{se(t=>({...t,[e.id]:A||[]}));const r=t.map(t=>t.id===e.id?{...t,basic:{...t.basic,attachments:A||[]}}:t);s?.(r)},notes:void 0!==re[e.id]?re[e.id]:e.basic?.notes||"",attachments:void 0!==ie[e.id]?ie[e.id]:e.basic?.attachments||null,workOrderNumber:g,assetNumber:B,isStandalone:b,user:y,onCreateIssue:v,onUpdateIssue:C}),r&&u&&p.jsx(D,{component:e})]},e.id)}),!r&&p.jsxs("div",{className:"form-actions",children:[!R&&p.jsx("button",{type:"button",onClick:()=>xe("Saved"),className:"form-save-button",disabled:R&&!me(),children:"Save"}),p.jsx("button",{type:"button",disabled:!me()||!te.isValid,className:"form-submit-button",title:te.isValid?"":te.errorMessage,onClick:()=>xe("Submitted"),children:"Submit"})]})]})]})})})},exports.DfFormRadio=S,exports.DfFormSection=z,exports.DfFormSegment=E,exports.DfFormSelect=Q,exports.DfFormSignature=L,exports.DfFormTable=J,exports.DfFormTextarea=F,exports.FormSubmissionPdf=ae,exports.RaiseIssueModal=v,exports.ThresholdAlert=C,exports.conditionalLogicService=m,exports.generateFormPdf=async e=>new Promise(async(t,A)=>{let r=null,n=null;try{r=document.createElement("div"),r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="794px",r.style.backgroundColor="#ffffff",r.style.zIndex="-1000",document.body.appendChild(r),n=oe(r),n.render(p.jsx(ae,{formTitle:e.formTitle,formDescription:e.formDescription,userName:e.userName,components:e.components})),await new Promise(e=>setTimeout(e,1e3));const A=await de(r,{scale:2,useCORS:!0,logging:!1,backgroundColor:"#ffffff",windowWidth:794}),i=A.toDataURL("image/jpeg",.95),s=new Wi({orientation:"portrait",unit:"mm",format:"a4"}),a=210,o=297,l=A.height*a/A.width;let c=l,u=0;for(s.addImage(i,"JPEG",0,u,a,l),c-=o;c>0;)u-=o,s.addPage(),s.addImage(i,"JPEG",0,u,a,l),c-=o;t(s.output("blob"))}catch(e){console.error("Error generating PDF:",e),A(e)}finally{n&&setTimeout(()=>{n.unmount(),r&&r.parentNode&&r.parentNode.removeChild(r)},100)}}),exports.toastService=w;
|
|
365
365
|
//# sourceMappingURL=index.js.map
|