From ea5a3096eae6ec6a972ac682c5982272536215cd Mon Sep 17 00:00:00 2001 From: Jackolix <107665250+Jackolix@users.noreply.github.com> Date: Thu, 19 Nov 2026 20:17:55 +0100 Subject: [PATCH] Fix paginated EPUB resources opening on their first page instead of the initial location --- CHANGELOG.md | 1 + .../Navigator/EPUB/Assets/Static/scripts/readium-fixed.js | 2 +- .../EPUB/Assets/Static/scripts/readium-reflowable.js | 2 +- Sources/Navigator/EPUB/Scripts/src/utils.js | 7 ++++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2926232a58..de055862e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. Take a look #### Navigator * The `AudioNavigator` now resumes by itself after the network stalls, instead of stopping until the app returns to the foreground when it is in the background. +* The EPUB navigator no longer opens a paginated reflowable resource on its first page instead of the requested location, when the web view is slow to render its first frames. ## [4.0.0-alpha.3] - 2026-11-16 diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 8a5b21dce1..cf1b1f557f 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js @@ -1,2 +1,2 @@ -(()=>{var t={3618(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,u=e[r]|s,l=u|a,c=(u&i)+i^i|u,f=a|~(c|i),p=i&c,d=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(l|(f|=n(o)-s)),a=f&l,t.P[r]=i,t.M[r]=a,d}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var u=new Uint32Array(a+1),l=new Map,c=[],f=0;f<256;f++)c.push(u);for(var p=0;p=e.length||e.charCodeAt(m)===d&&(h[y]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]0?r:0,!0)},o?o(t.exports,"apply",{value:a}):t.exports.apply=a},5298(t,e,r){"use strict";var n=r(703),o=r(5312),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},7517(t,e,r){"use strict";var n=r(9173),o=r(7388),i=r(7379),a=r(3492);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!a&&a(t,e);if(n)n(t,e,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8189(t,e,r){"use strict";var n=r(1748),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(7517),u=r(708)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&arguments[1]||"Cannot call method on "+t);return t}},9253(t){"use strict";t.exports=Object},4938(t){"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},3148(t,e,r){"use strict";var n=r(703)("%Object.defineProperty%",!0),o=r(6618)(),i=r(9939),a=r(7379),s=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==r&&"boolean"!=typeof r||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!r&&i(t,s)||(n?n(t,s,{configurable:!o,enumerable:!1,value:e,writable:!1}):t[s]=e)}},2632(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(2719),i=r(5833),a=r(1718),s=r(7379),u=r(5465),l=r(7377);t.exports=function(t){if(u(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=l(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(u(c))return c;throw new s("unable to convert exotic object to primitive")}return"default"===r&&(i(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new s("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new s('hint must be "string" or "number"');var r,n,i,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(i=0;i1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return W(t,V,function(t,e,r,o){n[n.length]=r?W(o,H,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=G("%"+n+"%",e),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],L(r,D([0,1],u)));for(var f=1,p=!0;f=r.length){var g=x(a,d);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[d]}else p=B(a,d),a=a[d];p&&!s&&(I[i]=a)}}return a}},8819(t,e,r){"use strict";var n=r(9253);t.exports=n.getPrototypeOf||null},2517(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1611(t,e,r){"use strict";var n=r(2517),o=r(8819),i=r(1449);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:i?function(t){return i(t)}:null},4656(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},3492(t,e,r){"use strict";var n=r(4656);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},708(t,e,r){"use strict";var n=r(9173),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},6052(t){"use strict";var e={__proto__:null,foo:{}},r={__proto__:e}.foo===e.foo&&!(e instanceof Object);t.exports=function(){return r}},7657(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(8123);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},8123(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6618(t,e,r){"use strict";var n=r(8123);t.exports=function(){return n()&&!!Symbol.toStringTag}},9939(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3583);t.exports=i.call(n,o)},6561(t,e,r){"use strict";var n=r(9939),o=r(6746)(),i=r(7379),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},2719(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((c||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},5833(t,e,r){"use strict";var n=r(5298),o=n("Date.prototype.getDay"),i=n("Object.prototype.toString"),a=r(6618)();t.exports=function(t){return"object"==typeof t&&null!==t&&(a?function(t){try{return o(t),!0}catch(t){return!1}}(t):"[object Date]"===i(t))}},4587(t,e,r){"use strict";var n,o=r(5298),i=r(6618)(),a=r(9939),s=r(3492);if(i){var u=o("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(t){if(!t||"object"!=typeof t)return!1;var e=s(t,"lastIndex");if(!e||!a(e,"value"))return!1;try{u(t,f)}catch(t){return t===l}}}else{var p=o("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===p(t)}}t.exports=n},1718(t,e,r){"use strict";var n=r(5298),o=n("Object.prototype.toString"),i=r(7657)(),a=r(5537);if(i){var s=n("Symbol.prototype.toString"),u=a(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==o(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u(s(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},9895(t){"use strict";t.exports=Math.abs},6241(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991},2153(t){"use strict";t.exports=Math.floor},1084(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1029(t,e,r){"use strict";var n=r(9895),o=r(2153),i=r(5518),a=r(1084);t.exports=function(t){if("number"!=typeof t||i(t)||!a(t))return!1;var e=n(t);return o(e)===e}},5518(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},457(t){"use strict";t.exports=Math.max},1179(t){"use strict";t.exports=Math.min},5985(t){"use strict";t.exports=Math.pow},8639(t){"use strict";t.exports=Math.round},5738(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},4922(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var $=r(2179),F=$.custom,_=H(F)?F:null,B={__proto__:null,double:'"',single:"'"},D={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function L(t,e,r){var n=r.quoteStyle||e,o=B[n];return o+t+o}function W(t){return v.call(String(t),/"/g,""")}function U(t){return!N||!("object"==typeof t&&(N in t||void 0!==t[N]))}function z(t){return"[object Array]"===X(t)&&U(t)}function V(t){return"[object RegExp]"===X(t)&&U(t)}function H(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&!q(B,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Y(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return y?k(e,w):w}if("bigint"==typeof e){var S=String(e)+"n";return y?k(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var P,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(K(o,e)>=0)return"[Circular]";function D(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!V(e)){var G=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),J=rt(e,D);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+A.call(J,", ")+" }":"")}if(H(e)){var nt=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?nt:Z(nt)}if((P=e)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ot="<"+x.call(String(e.nodeName)),it=e.attributes||[],at=0;at"}if(z(e)){if(0===e.length)return"[]";var st=rt(e,D);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+et(st,F)+"]":"[ "+A.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&U(t)}(e)){var ut=rt(e,D);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+D(e.cause),ut),", ")+" }"}if("object"==typeof e&&u){if(_&&"function"==typeof e[_]&&$)return $(e,{depth:j-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var lt=[];return a&&a.call(e,function(t,r){lt.push(D(r,e,!0)+" => "+D(t,e))}),tt("Map",i.call(e),lt,F)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(D(t,e))}),tt("Set",l.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return"[object Number]"===X(t)&&U(t)}(e))return Z(D(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return Z(D(R.call(e)));if(function(t){return"[object Boolean]"===X(t)&&U(t)}(e))return Z(h.call(e));if(function(t){return"[object String]"===X(t)&&U(t)}(e))return Z(D(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof globalThis&&e===globalThis)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&U(t)}(e)&&!V(e)){var ft=rt(e,D),pt=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,dt=e instanceof Object?"":"null prototype",ht=!pt&&N&&Object(e)===e&&N in e?b.call(X(e),8,-1):dt?"Object":"",yt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ht||dt?"["+A.call(E.call([],ht||[],dt||[]),": ")+"] ":"");return 0===ft.length?yt+"{}":F?yt+"{"+et(ft,F)+"}":yt+"{ "+A.call(ft,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Y(b.call(t,0,e.maxStringLength),e)+n}var o=D[e.quoteStyle||"single"];return o.lastIndex=0,L(v.call(v.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=z(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var y=0;y0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},3743(t,e,r){"use strict";var n=r(7843),o=r(7379),i=Object;t.exports=n(function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1721(t,e,r){"use strict";var n=r(8189),o=r(7965),i=r(3743),a=r(4510),s=r(3980),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},4510(t,e,r){"use strict";var n=r(3743),o=r(8189).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),t.get.call(r),"dy"===e)return t.get}}return n}},3980(t,e,r){"use strict";var n=r(8189).supportsDescriptors,o=r(4510),i=r(3492),a=Object.defineProperty,s=r(9183),u=r(1611),l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(l),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},5537(t,e,r){"use strict";var n=r(5298),o=r(4587),i=n("RegExp.prototype.exec"),a=r(7379);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2644(t,e,r){"use strict";var n=r(703),o=r(7517),i=r(708)(),a=r(3492),s=r(7379),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in t&&a){var c=a(t,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},7843(t,e,r){"use strict";var n=r(7517),o=r(708)(),i=r(3749).functionsHaveConfigurableNames(),a=r(7379);t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},7797(t,e,r){"use strict";var n=r(4922),o=r(7379),i=function(t,e,r){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,r||(n.next=t.next,t.next=n),n};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var r=function(t,e){if(t)return i(t,e,!0)}(t,e);return r&&t&&!t.next&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var r=i(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!i(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var n=i(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},1085(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(7379),s=n("%Map%",!0),u=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);t.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+i(t))},delete:function(e){if(t){var r=f(t,e);return 0===p(t)&&(t=void 0),r}return!1},get:function(e){if(t)return u(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,r){t||(t=new s),l(t,e,r)}};return e}},2468(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(1085),s=r(7379),u=n("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);t.exports=u?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(r){if(u&&r&&("object"==typeof r||"function"==typeof r)){if(t)return p(t,r)}else if(a&&e)return e.delete(r);return!1},get:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?f(t,r):!!e&&e.has(r)},set:function(r,n){u&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new u),c(t,r,n)):a&&(e||(e=a()),e.set(r,n))}};return r}:a},6746(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(7797),a=r(1085),s=r(2468)||a||i;t.exports=function(){var t,e={assert:function(t){if(!e.has(t)){var r=t&&Object(t)===t?"the given object key":o(t);throw new n("Side channel does not contain "+r)}},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=s()),t.set(e,r)}};return e}},4290(t,e,r){"use strict";var n=r(6520),o=r(7630),i=r(4111),a=r(333),s=r(1076),u=r(5363),l=r(5298),c=r(7657)(),f=r(1721),p=r(703),d=r(7379),h=p("%RegExp%"),y=l("String.prototype.indexOf"),g=r(2570),m=function(t){var e=g();if(c&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===h.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),y(s(r),"g")<0)throw new d("matchAll requires a global regular expression")}var i=m(t);if(void 0!==i)return n(i,t,[e])}var l=s(e),c=new h(t,"g");return n(m(c),c,[l])}},6410(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(4290),a=r(4683),s=r(3197),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2570(t,e,r){"use strict";var n=r(7657)(),o=r(1930);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},4683(t,e,r){"use strict";var n=r(4290);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},1930(t,e,r){"use strict";var n=r(3990),o=r(7630),i=r(5234),a=r(518),s=r(6117),u=r(1076),l=r(192),c=r(1721),f=r(7843),p=r(5298),d=r(703),h=r(7379),y=p("String.prototype.indexOf"),g=d("%RegExp%"),m="flags"in g.prototype,b=f(function(t){var e=this;if("Object"!==l(e))throw new h('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(c(e));return{flags:r,matcher:new t(m&&"string"==typeof r?e:t===g?e.source:e,r)}}(a(e,g),e),p=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var v=y(p,"g")>-1,w=y(p,"u")>-1;return n(d,r,v,w)},"[Symbol.matchAll]",!0);t.exports=b},3197(t,e,r){"use strict";var n=r(8189),o=r(7657)(),i=r(3492),a=r(4683),s=r(2570),u=Object.defineProperty;t.exports=function(){var t=a();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&i){var r=i(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var l=s(),c={};c[e]=l;var f={};f[e]=function(){return RegExp.prototype[e]!==l},n(RegExp.prototype,c,f)}return t}},3952(t,e,r){"use strict";var n=r(5363),o=r(2501),i=r(5298),a=r(5537),s=i("String.prototype.replace"),u=i("String.prototype.charAt"),l=i("String.prototype.slice"),c=/^\s$/.test("᠎"),f=c?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,p=a(c?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);t.exports=function(){for(var t=s(o(n(this)),f,""),e=t.length;e>0&&p(u(t,e-1));)e-=1;return l(t,0,e)}},7724(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(5363),a=r(3952),s=r(8821),u=r(5795),l=n(s()),c=function(t){return i(t),l(t)};o(c,{getPolyfill:s,implementation:a,shim:u}),t.exports=c},8821(t,e,r){"use strict";var n=r(3952);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},5795(t,e,r){"use strict";var n=r(708)(),o=r(7517),i=r(8821);t.exports=function(){var t=i();return String.prototype.trim!==t&&(n?o(String.prototype,"trim",t,!0):o(String.prototype,"trim",t)),t}},2179(){},6917(t,e,r){"use strict";var n=r(6562),o=r(7379),i=r(1029),a=r(6241);t.exports=function(t,e,r){if("string"!=typeof t)throw new o("Assertion failed: `S` must be a String");if(!i(e)||e<0||e>a)throw new o("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("boolean"!=typeof r)throw new o("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+n(t,e)["[[CodeUnitCount]]"]:e+1}},6520(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(7379),a=r(3443),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6562(t,e,r){"use strict";var n=r(7379),o=r(5298),i=r(3283),a=r(8537),s=r(1300),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("string"!=typeof t)throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),c=u(t,e),f=i(o),p=a(o);if(!f&&!p)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(p||e+1===r)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":s(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},44(t,e,r){"use strict";var n=r(7379);t.exports=function(t,e){if("boolean"!=typeof e)throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},3990(t,e,r){"use strict";var n=r(703),o=r(7657)(),i=r(7379),a=r(4938),s=n("%IteratorPrototype%",!0),u=r(6917),l=r(44),c=r(355),f=r(7630),p=r(2021),d=r(3936),h=r(5234),y=r(6117),g=r(1076),m=r(6561),b=r(3148),v=function(t,e,r,n){if("string"!=typeof e)throw new i("`S` must be a string");if("boolean"!=typeof r)throw new i("`global` must be a boolean");if("boolean"!=typeof n)throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};s&&(v.prototype=p(s)),c(v.prototype,"next",function(){var t=this;if(!a(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return l(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return m.set(t,"[[Done]]",!0),l(void 0,!0);if(n){if(""===g(f(s,"0"))){var c=y(f(e,"lastIndex")),p=u(r,c,o);h(e,"lastIndex",p,!0)}return l(s,!1)}return m.set(t,"[[Done]]",!0),l(s,!1)},!1),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,function(){return this},!1),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},355(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(9271),a=r(1181),s=r(5855);t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `homeObject` is not an Object");if(!s(e))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if("function"!=typeof r)throw new n("Assertion failed: `closure` is not a function");if("boolean"!=typeof u)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(t))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(t,e,{"[[Value]]":r,"[[Writable]]":!0,"[[Enumerable]]":u,"[[Configurable]]":!0})}},9271(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(6843),a=r(9999),s=r(5848),u=r(7817),l=r(5855),c=r(925),f=r(6309);t.exports=function(t,e,r){if(!o(t))throw new n("Assertion failed: Type(O) is not Object");if(!l(e))throw new n("Assertion failed: P is not a Property Key");var p=i(r)?r:f(r);if(!i(p))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return a(u,c,s,t,e,p)}},5848(t,e,r){"use strict";var n=r(7379),o=r(6843),i=r(3003);t.exports=function(t){if(void 0!==t&&!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(t)}},7630(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855),a=r(4938);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},4111(t,e,r){"use strict";var n=r(7379),o=r(7818),i=r(1816),a=r(5855),s=r(4922);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},7818(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},3443(t,e,r){"use strict";t.exports=r(8622)},1816(t,e,r){"use strict";t.exports=r(2719)},3478(t,e,r){"use strict";var n=r(4334)("%Reflect.construct%",!0),o=r(9271);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},7817(t,e,r){"use strict";var n=r(7379),o=r(9939),i=r(6843);t.exports=function(t){if(void 0===t)return!1;if(!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!o(t,"[[Value]]")&&!o(t,"[[Writable]]"))}},1181(t,e,r){"use strict";var n=r(703),o=n("%Object.preventExtensions%",!0),i=n("%Object.isExtensible%",!0),a=r(9258);t.exports=o?function(t){return!a(t)&&i(t)}:function(t){return!a(t)}},333(t,e,r){"use strict";var n=r(703)("%Symbol.match%",!0),o=r(4587),i=r(4938),a=r(4801);t.exports=function(t){if(!i(t))return!1;if(n){var e=t[n];if(void 0!==e)return a(e)}return o(t)}},2021(t,e,r){"use strict";var n=r(703)("%Object.create%",!0),o=r(7379),i=r(7388),a=r(4938),s=r(3443),u=r(5713),l=r(6561),c=r(6052)();t.exports=function(t){if(null!==t&&!a(t))throw new o("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(c)e={__proto__:t};else if(n)e=n(t);else{if(null===t)throw new i("native Object.create support is required to create null objects");var f=function(){};f.prototype=t,e=new f}return r.length>0&&u(r,function(t){l.set(e,t,void 0)}),e}},3936(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5298)("RegExp.prototype.exec"),a=r(6520),s=r(7630),u=r(1816);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: `R` must be an Object");if("string"!=typeof e)throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(u(r)){var l=a(r,t,[e]);if(null===l||o(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},925(t,e,r){"use strict";var n=r(5518);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},5234(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5855),a=r(925),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof u)throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!a(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||a(t[e],r)}catch(t){return!1}}},518(t,e,r){"use strict";var n=r(703)("%Symbol.species%",!0),o=r(7379),i=r(4938),a=r(3478);t.exports=function(t,e){if(!i(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if(!i(r))throw new o("O.constructor is not an Object");var s=n?r[n]:void 0;if(null==s)return e;if(a(s))return s;throw new o("no constructor found")}},9893(t,e,r){"use strict";var n=r(703),o=n("%RegExp%"),i=r(7379),a=n("%parseInt%"),s=r(5298),u=r(5537),l=s("String.prototype.slice"),c=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),h=r(7724);t.exports=function t(e){if("string"!=typeof e)throw new i("Assertion failed: `argument` is not a String");if(c(e))return+a(l(e,2),2);if(f(e))return+a(l(e,2),8);if(d(e)||p(e))return NaN;var r=h(e);return r!==e?t(r):+e}},4801(t){"use strict";t.exports=function(t){return!!t}},7210(t,e,r){"use strict";var n=r(3312),o=r(6354),i=r(5518),a=r(1084);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},6117(t,e,r){"use strict";var n=r(6241),o=r(7210);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},3312(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%Number%"),a=r(9258),s=r(3760),u=r(9893);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):+e}},3760(t,e,r){"use strict";var n=r(2632);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},6309(t,e,r){"use strict";var n=r(9939),o=r(7379),i=r(4938),a=r(1816),s=r(4801);t.exports=function(t){if(!i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!a(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},1076(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},192(t,e,r){"use strict";var n=r(3225);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1300(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%String.fromCharCode%"),a=r(3283),s=r(8537);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},7060(t,e,r){"use strict";var n=r(2153);t.exports=function(t){return"bigint"==typeof t?t:n(t)}},6354(t,e,r){"use strict";var n=r(7060),o=r(7379);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new o("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2501(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},3225(t,e,r){"use strict";var n=r(4938);t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":n(t)?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},4334(t,e,r){"use strict";t.exports=r(703)},9999(t,e,r){"use strict";var n=r(708),o=r(9173),i=n.hasArrayLengthDefineBug(),a=i&&r(8622),s=r(5298)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,u,l){if(!o){if(!t(l))return!1;if(!l["[[Configurable]]"]||!l["[[Writable]]"])return!1;if(u in n&&s(n,u)!==!!l["[[Enumerable]]"])return!1;var c=l["[[Value]]"];return n[u]=c,e(n[u],c)}return i&&"length"===u&&"[[Value]]"in l&&a(n)&&n.length!==l["[[Value]]"]?(n.length=l["[[Value]]"],n.length===l["[[Value]]"]):(o(n,u,r(l)),!0)}},8622(t,e,r){"use strict";var n=r(703)("%Array%"),o=!n.isArray&&r(5298)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},5713(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},9258(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},5855(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},8537(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},6843(t,e,r){"use strict";var n=r(7379),o=r(9939),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(o(t,e)&&!i[e])return!1;var r=o(t,"[[Value]]")||o(t,"[[Writable]]"),a=o(t,"[[Get]]")||o(t,"[[Set]]");if(r&&a)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(3618);function e(e,r,n){let o=0;const i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.A)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){const e=document.createElement("div");return e.appendChild(t.cloneContents()),function(t){var e;for(const e of Array.from(t.querySelectorAll("br")))e.replaceWith(document.createTextNode(" "));return null!==(e=t.textContent)&&void 0!==e?e:""}(e)}function i(t,e){let r=0;for(const n of t){if(!(n{if(i=e===a.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===a.Forwards?0:t.length;u=s(t,r,e)}};for(;i&&-1===u&&i!==o;)l();if(i&&u>=0)return{node:i,offset:u};throw new RangeError("No text nodes with non-whitespace text found in range")}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1?e-1:0),n=1;no?(a.push({node:s,offset:o-l}),o=r.shift()):(u=i.nextNode(),l+=s.data.length);for(;void 0!==o&&s&&l===o;)a.push({node:s,offset:s.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}let d=function(t){return t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS",t}({});class h{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=f(e),e=e.parentElement;return new h(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return p(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return h.fromPoint(t,e);case Node.ELEMENT_NODE:return new h(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=f(t)+e;return new h(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const t=u(e,a.Forwards),r=t.node,n=t.offset;r&&n>=0&&e.setStart(r,n)}if(!n){const t=u(e,a.Backwards),r=t.node,n=t.offset;r&&n>0&&e.setEnd(r,n)}return e}(y.fromRange(t).toRange())}}class g{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=y.fromRange(e).relativeTo(t);return new g(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new g(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return y.fromOffsets(this.root,this.start,this.end).toRange()}}class m{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){var r;const n=null!==(r=t.textContent)&&void 0!==r?r:"",i=y.fromRange(e).relativeTo(t),a=i.start.offset,s=i.end.offset,u=o(e),l=o(y.fromOffsets(t,Math.max(0,a-32),a).toRange()),c=o(y.fromOffsets(t,s,Math.min(n.length,s+32)).toRange());return new m(t,u,{prefix:l,suffix:c})}static fromSelector(t,e){const r=e.prefix,n=e.suffix;return new m(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t){let e="";const r=[],n=t=>{var o;if(t.nodeType!==Node.TEXT_NODE){if(t.nodeType===Node.ELEMENT_NODE){if("BR"===t.tagName)return r.push(e.length),void(e+=" ");for(const e of Array.from(t.childNodes))n(e)}}else e+=null!==(o=t.textContent)&&void 0!==o?o:""};return n(t),{text:e,brPositionsInText:r}}(this.root),o=r.text,a=r.brPositionsInText,s=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const s=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,s=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let u=1;return"number"==typeof o.hint&&(u=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*s+2*u)/92},u=a.map(t=>({start:t.start,end:t.end,score:s(t)}));return u.sort((t,e)=>e.score-t.score),u[0]}(o,this.exact,{...this.context,hint:t.hint});if(!s)throw new Error("Quote not found");return new g(this.root,i(a,s.start),i(a,s.end))}}var b,v=r(6410);function w(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;x(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return x(">>> createOrderedRange RANGE REVERSE OK."),o;x(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void x("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=y.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let s=n.slice(Math.max(0,i-200),i),u=s.search(/\P{L}\p{L}/gu);-1!==u&&(s=s.slice(u+1));let l=n.slice(a,Math.min(n.length,a+200)),c=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==c&&c.index>1&&(l=l.slice(0,c.index+1)),{highlight:e,before:s,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return L(t.getRangeAt(0).getBoundingClientRect())}catch(t){return D(t),null}}()}:null}function x(){_.apply(null,arguments)}r.n(v)().shim(),window.addEventListener("error",function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})},!1),window.addEventListener("load",function(){var t;new ResizeObserver(()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(function(){O=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(R()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!R()){var t=I(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),j()})}).observe(document.body)},!1);var S,E,A=!1,O=0;function j(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(R()&&!P()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;b={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;C()&&(e=Math.abs(e)),b={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(A||window.requestAnimationFrame(function(){var t;t=b,webkit.messageHandlers.progressionChanged.postMessage(t),A=!1}),A=!0)}function R(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function P(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function C(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function T(t,e){return R()?M({top:t.top+window.scrollY,animated:e}):M({left:I(t.left+window.scrollX),animated:e}),!0}function N(t,e){var r=window.scrollX,n=window.innerWidth,o=Math.abs(r-t)/n>.01;return o&&M({left:t,animated:e}),o}function M(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.left,r=t.top,n=t.animated;document.scrollingElement.scrollTo({left:e,top:r,behavior:n?"smooth":"instant"})}function I(t){const e=t+(C()?-1:1);return e-e%O}function k(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new m(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments){let e;try{e=decodeURIComponent(t)}catch(t){continue}if(r=document.getElementById(e))break}if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){D(t)}return null}function $(t,e){null===e?F(t):document.documentElement.style.setProperty(t,e,"important")}function F(t){document.documentElement.style.removeProperty(t)}function _(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function B(t){D(new Error(t))}function D(t){webkit.messageHandlers.logError.postMessage({message:t.message})}function L(t){let e=W({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function W(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function U(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=q(function(t){const e=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const n of t)if(r!==n&&e.has(n)&&H(n,r,1)){J(),e.delete(r);break}}else J(),e.delete(r);return Array.from(e)}(z(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){J();break}J(),o.splice(t,1)}}return J((n.length,o.length)),o}function z(t,e,r){for(let n=0;nt!==i&&t!==a),o=V(i,a);return n.push(o),z(n,e,r)}}return t}function V(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function H(t,e,r){return G(t,e.left,e.top,r)&&G(t,e.right,e.top,r)&&G(t,e.left,e.bottom,r)&&G(t,e.right,e.bottom,r)}function G(t,e,r,n){return(t.lefte||Y(t.right,e,n))&&(t.topr||Y(t.bottom,r,n))}function q(t){for(let e=0;et!==e);return Array.prototype.push.apply(a,r),q(a)}}else J()}return t}function X(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function K(t,e,r){return(t.left=0&&Y(t.left,e.right,r))&&(e.left=0&&Y(e.left,t.right,r))&&(t.top=0&&Y(t.top,e.bottom,r))&&(e.top=0&&Y(e.top,t.bottom,r))}function Y(t,e,r){return Math.abs(t-e)<=r}function J(){}window.addEventListener("scroll",j),document.addEventListener("selectionchange",(S=function(){webkit.messageHandlers.selectionChanged.postMessage(w())},function(){var t=this,e=arguments;clearTimeout(E),E=setTimeout(function(){S.apply(t,e),E=null},50)}));var Z,Q=[],tt=function(){return Q.some(function(t){return t.activeTargets.length>0})},et="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Z||(Z={}));var rt,nt=function(t){return Object.freeze(t)},ot=function(t,e){this.inlineSize=t,this.blockSize=e,nt(this)},it=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,nt(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),at=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(at(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},ut=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},lt="undefined"!=typeof window?window:{},ct=new WeakMap,ft=/auto|scroll/,pt=/^tb|vertical/,dt=/msie|trident/i.test(lt.navigator&<.navigator.userAgent),ht=function(t){return parseFloat(t||"0")},yt=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new ot((r?e:t)||0,(r?t:e)||0)},gt=nt({devicePixelContentBoxSize:yt(),borderBoxSize:yt(),contentBoxSize:yt(),contentRect:new it(0,0,0,0)}),mt=function(t,e){if(void 0===e&&(e=!1),ct.has(t)&&!e)return ct.get(t);if(st(t))return ct.set(t,gt),gt;var r=getComputedStyle(t),n=at(t)&&t.ownerSVGElement&&t.getBBox(),o=!dt&&"border-box"===r.boxSizing,i=pt.test(r.writingMode||""),a=!n&&ft.test(r.overflowY||""),s=!n&&ft.test(r.overflowX||""),u=n?0:ht(r.paddingTop),l=n?0:ht(r.paddingRight),c=n?0:ht(r.paddingBottom),f=n?0:ht(r.paddingLeft),p=n?0:ht(r.borderTopWidth),d=n?0:ht(r.borderRightWidth),h=n?0:ht(r.borderBottomWidth),y=f+l,g=u+c,m=(n?0:ht(r.borderLeftWidth))+d,b=p+h,v=s?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?y+m:0,S=o?g+b:0,E=n?n.width:ht(r.width)-x-w,A=n?n.height:ht(r.height)-S-v,O=E+y+w+m,j=A+g+v+b,R=nt({devicePixelContentBoxSize:yt(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:yt(O,j,i),contentBoxSize:yt(E,A,i),contentRect:new it(f,u,E,A)});return ct.set(t,R),R},bt=function(t,e,r){var n=mt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case Z.DEVICE_PIXEL_CONTENT_BOX:return a;case Z.BORDER_BOX:return o;default:return i}},vt=function(t){var e=mt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=nt([e.borderBoxSize]),this.contentBoxSize=nt([e.contentBoxSize]),this.devicePixelContentBoxSize=nt([e.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},xt=function(){var t=1/0,e=[];Q.forEach(function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach(function(e){var r=new vt(e.target),o=wt(e.target);n.push(r),e.lastReportedSize=bt(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))})})},Et=[],At=0,Ot={attributes:!0,characterData:!0,childList:!0,subtree:!0},jt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,Ct=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var r,n=Rt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(St(e);tt();)e=xt(),St(e);return Q.some(function(t){return t.skippedTargets.length>0})&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:et}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=et),window.dispatchEvent(t)),e>0}()}finally{if(Pt=!1,t=n-Rt(),!At)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!rt){var e=0,r=document.createTextNode("");new MutationObserver(function(){return Et.splice(0).forEach(function(t){return t()})}).observe(r,{characterData:!0}),rt=function(){r.textContent="".concat(e?e--:e++)}}Et.push(t),rt()}(function(){requestAnimationFrame(r)})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Ot)};document.body?e():lt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jt.forEach(function(e){return lt.addEventListener(e,t.listener,!0)}))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),jt.forEach(function(e){return lt.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},t}(),Tt=new Ct,Nt=function(t){!At&&t>0&&Tt.start(),!(At+=t)&&Tt.stop()},Mt=function(){function t(t,e){this.target=t,this.observedBox=e||Z.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=bt(this.target,this.observedBox,!0);return t=this.target,at(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),It=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},kt=new WeakMap,$t=function(t,e){for(var r=0;r=0&&(o&&Q.splice(Q.indexOf(r),1),r.observationTargets.splice(n,1),Nt(-1))},t.disconnect=function(t){var e=this,r=kt.get(t);r.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),_t=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ft.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.unobserve(this,t)},t.prototype.disconnect=function(){Ft.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(t,e):void 0}}(t,e)||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 Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Ut.forEach(function(t){t.requestLayout()}))}).observe(t)},!1);const Gt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function qt(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}const Xt={selectors:[Gt.id,Gt.class,Gt.tag,Gt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1,ignoreGeneratedClassNames:!1};function Kt(t){return!!t}function Yt(t){return t instanceof RegExp}function Jt(t){return["string","function"].includes(typeof t)||Yt(t)}function Zt(t){return Array.isArray(t)?t.filter(Jt):[]}function Qt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return null!=t&&"object"==typeof t&&"nodeType"in t&&"number"==typeof t.nodeType}(t)&&e.includes(t.nodeType)}function te(t,e){if(Qt(t))return t.contains(e)||qt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const r=e.getRootNode({composed:!1});return Qt(r)?(r!==document&&qt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):se(e)}function ee(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function re(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce((t,e)=>t.filter(t=>e.includes(t)),e)}function ne(t){const e=t.map(t=>{if(Yt(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(qt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return qt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(e=>e(t))}function oe(t,e,r){const n=Array.from(te(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every(t=>n.includes(t))}function ie(t,e){e=null!=e?e:se(t);const r=[];let n=t;for(;n&&n!==e;)Ht(n)&&r.push(n),n=n.parentNode;return r}function ae(t,e){return re(t.map(t=>ie(t,e)))}function se(t){return t.ownerDocument.querySelector(":root")}const ue=new RegExp(["^$","\\s"].join("|")),le=new RegExp(["^$"].join("|")),ce=[Gt.nthoftype,Gt.tag,Gt.id,Gt.class,Gt.attribute,Gt.nthchild],fe=ne(["class","id","ng-*"]);function pe({name:t}){return`[${t}]`}function de({name:t,value:e}){return`[${t}='${e}']`}function he({nodeName:t,nodeValue:e}){return{name:Ce(t),value:Ce(null!=e?e:void 0)}}function ye(t,e){const r=Array.from(t.attributes).filter(e=>function({nodeName:t,nodeValue:e},r){const n=r.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||fe(t))}(e,t)).map(he);return[...r.map(pe),...r.map(de)]}const ge=/^[a-z_-]{3,}$/i,me=/[bcdfghjklmnpqrstvwxyz]{4,}/i;function be(t,e){var r;const n=(null!==(r=t.getAttribute("class"))&&void 0!==r?r:"").trim().split(/\s+/).filter(t=>!le.test(t));let o=n;if(null==e?void 0:e.ignoreGeneratedClassNames){const t=ne(e.whitelist);o=n.filter(e=>{const r=`.${Ce(e)}`;return!!t(r)||function(t){if(!ge.test(t))return!1;if(t.includes("_")&&!t.includes("__"))return!1;if(/^(css|sc|jsx|emotion|makeStyles|MuiButton|MuiBox)-/i.test(t))return!1;const e=t.split(/--|__|[-]|(?<=[a-z])(?=[A-Z])/).filter(t=>t.length>0);if(0===e.length)return!1;if(1===e.length&&e[0].length<4)return!1;for(const t of e){if(t.length<=2)return!1;if(me.test(t))return!1}return!0}(e)})}return o.map(t=>`.${Ce(t)}`)}function ve(t,e){var r;const n=null!==(r=t.getAttribute("id"))&&void 0!==r?r:"",o=`#${Ce(n)}`,i=t.getRootNode({composed:!1});return!ue.test(n)&&oe([t],o,i)?[o]:[]}function we(t,e){const r=t.parentNode,n=r&&"children"in r?r.children:null;if(n)for(let e=0;exe(t)),[].concat(...n)))];var n;return 0===r.length||r.length>1?[]:[r[0]]}function Ee(t,e){const r=Se([t])[0],n=t.parentNode,o=n&&"children"in n?n:null;if(o){const e=Array.from(o.children).filter(t=>t.tagName.toLowerCase()===r),n=e.indexOf(t);if(n>-1)return[`${r}:nth-of-type(${String(n+1)})`]}return[]}function*Ae(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=je(1);for(;n.length<=t.length&&rt[e]);yield e,n=Oe(n,t.length-1)}}function Oe(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return je(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?je(r+1):n}function je(t=1){return Array.from(Array(t).keys())}const Re=":".charCodeAt(0).toString(16).toUpperCase(),Pe=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Ce(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map(t=>":"===t?`\\${Re} `:Pe.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\")).join("")}(t)}const Te={tag:Se,id:function(t,e){return 0===t.length||t.length>1?[]:ve(t[0])},class:function(t,e){return re(t.map(t=>be(t,e)))},attribute:function(t,e){return re(t.map(t=>ye(t)))},nthchild:function(t,e){return re(t.map(t=>we(t)))},nthoftype:function(t,e){return re(t.map(t=>Ee(t)))}},Ne={tag:xe,id:ve,class:be,attribute:ye,nthchild:we,nthoftype:Ee};function Me(t){return t.includes(Gt.tag)||t.includes(Gt.nthoftype)?[...t]:[...t,Gt.tag]}function*Ie(t,e){const r={};for(const n of t){const t=e[n];t&&t.length>0&&(r[n]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const r=[{index:e.length-1,partial:{}}];for(;r.length>0;){const t=r.pop();if(!t)break;const{index:n,partial:o}=t;if(n<0){yield o;continue}const[i,a]=e[n];for(let t=a.length-1;t>=0;t--)r.push({index:n-1,partial:Object.assign(Object.assign({},o),{[i]:a[t]})})}}(r))yield ke(t)}function ke(t={}){const e=[...ce];return t[Gt.tag]&&t[Gt.nthoftype]&&e.splice(e.indexOf(Gt.tag),1),e.map(e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n}).join("")}function $e(t,e){return[...t.map(t=>e+" "+t),...t.map(t=>e+" > "+t)]}function*Fe(t,e,r="",n){const o=function*(t,e){const r=new Set,n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=ne(r),s=ne(n);return function(t){const{selectors:e,includeTag:r}=t,n=[...e];return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce((r,n)=>{const u=function(t,e,r){return(0,Te[e])(t,r)}(t,n,e),l=function(t=[],e,r){return t.filter(t=>r(t)||!e(t))}(u,a,s),c=function(t=[],e){return t.sort((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0})}(l,s);return r[n]=o?Array.from(Ae(c,{maxResults:i})):c.map(t=>[t]),r},{})}(t,e);for(const t of function*(t,e){for(const r of function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Ae(t,{maxResults:e}))}(e,{maxResults:o}):e.map(t=>[t]);return n?i.map(Me):i}(e))yield*Ie(r,t)}(n,e))r.has(t)||(r.add(t),yield t)}(t,n);for(const n of function*(t,e){if(""===e)yield*t;else for(const r of t)yield*$e([r],e)}(o,r))oe(t,n,e)&&(yield n)}function*_e(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...ae(t,e).map(t=>[t])];for(const t of o)for(const o of Fe(t,e,r,n))yield{foundElements:t,selector:o}}function Be(t){return{value:t,include:!1}}function De({selectors:t,operator:e}){let r=[...ce];t[Gt.tag]&&t[Gt.nthoftype]&&(r=r.filter(t=>t!==Gt.tag));let n="";return r.forEach(e=>{var r;(null!==(r=t[e])&&void 0!==r?r:[]).forEach(({value:t,include:e})=>{e&&(n+=t)})}),e+n}function Le(t,e){return t.map(t=>function(t,e){const r=ie(t,e).reverse(),n=e instanceof ShadowRoot,o=r.map((t,e)=>{var r;const o=function(t,e,r=""){const n={};return e.forEach(e=>{Reflect.set(n,e,function(t,e){return Ne[e](t,void 0)}(t,e).map(Be))}),{element:t,operator:r,selectors:n}}(t,[Gt.nthchild],n&&0===e?"":" > ");return(null!==(r=o.selectors.nthchild)&&void 0!==r?r:[]).forEach(t=>{t.include=!0}),o});return[n?"":e?":scope":":root",...o.map(De)].join("")}(t,e)).join(", ")}function We(t,e={}){const r=function*(t,e={}){var r;const n=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Ht);return[...new Set(e)]}(t),o=function(t,e={}){const r=Object.assign(Object.assign({},Xt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter(t=>{return e=Gt,r=t,Object.values(e).includes(r);var e,r}):[]),whitelist:Zt(r.whitelist),blacklist:Zt(r.blacklist),root:te(r.root,t),combineWithinSelector:Kt(r.combineWithinSelector),combineBetweenSelectors:Kt(r.combineBetweenSelectors),includeTag:Kt(r.includeTag),maxCombinations:ee(r.maxCombinations),maxCandidates:ee(r.maxCandidates),useScope:Kt(r.useScope),maxResults:ee(r.maxResults),ignoreGeneratedClassNames:Kt(r.ignoreGeneratedClassNames)};var n}(n[0],e),i=null!==(r=o.root)&&void 0!==r?r:se(n[0]);let a=0;for(const t of function*({elements:t,root:e,rootSelector:r="",options:n}){let o=e,i=r,a=!0;for(;a;){let r=!1;for(const a of _e(t,o,i,n)){const{foundElements:n,selector:s}=a;if(r=!0,!oe(t,s,e)){o=n[0],i=s;break}yield s}r||(a=!1)}}({elements:n,options:o,root:i,rootSelector:""}))if(yield t,a++,a>=o.maxResults)return;if(n.length>1){const{maxResults:t}=e,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);oWe(t,r)).join(", "),a++,a>=o.maxResults)return}const s=void 0!==e.root;yield Le(n,o.useScope||s?i:void 0)}(t,Object.assign(Object.assign({},e),{maxResults:1}));return r.next().value}function Ue(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Ue(t.parentElement):null}function ze(t){for(var e=0;e0&&e.top0&&e.left{var n;if(t.nodeType===Node.TEXT_NODE)e.push(null!==(n=t.nodeValue)&&void 0!==n?n:"");else if(t.nodeType===Node.ELEMENT_NODE){const n=t;var o;"img"===n.tagName.toLowerCase()?e.push(null!==(o=n.getAttribute("alt"))&&void 0!==o?o:""):n.childNodes.forEach(r)}};return t.childNodes.forEach(r),e.join(" ").replace(/\s+/g," ").trim()||null}function Ye(t,e){const r=t.getAttribute(e);return r&&r.split(/\s+/).filter(t=>t.length>0).map(e=>t.ownerDocument.getElementById(e)).filter(t=>null!=t).map(t=>{var e,r;return(null===(e=t.getAttribute("aria-label"))||void 0===e?void 0:e.trim())||(null===(r=t.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||""}).filter(t=>t.length>0).join(" ")||null}function Je(t,e){var r;const n=t.querySelector(`:scope > ${e}`);return(null==n||null===(r=n.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||null}function Ze(t){var e,r,n,o,i;const a=null===(e=t.closest("figure"))||void 0===e?void 0:e.querySelector(":scope > figcaption");if(!a||a.contains(t))return null;const s=((null!==(r=t.getAttribute("aria-details"))&&void 0!==r?r:"")+" "+(null!==(n=t.getAttribute("aria-describedby"))&&void 0!==n?n:"")).split(/\s+/).filter(t=>t.length>0);if(s.includes(null!==(o=a.getAttribute("id"))&&void 0!==o?o:""))return null;const u=t=>{var e;return"details"===t.tagName.toLowerCase()||s.includes(null!==(e=t.getAttribute("id"))&&void 0!==e?e:"")},l=a.cloneNode(!0),c=l.querySelectorAll("*");for(let t=0;tt.hasAttribute(e))}let nr=!1;function or(t){if(!getSelection().isCollapsed)return;let e=W({x:t.clientX,y:t.clientY}),r={defaultPrevented:t.defaultPrevented,x:e.x,y:e.y,targetElement:t.target.outerHTML,interactiveElement:Ue(t.target)};(function(t,e){let r=Vt(t);return!!r&&(webkit.messageHandlers.decorationActivated.postMessage({id:r.item.decoration.id,group:r.group,rect:L(r.item.range.getBoundingClientRect()),click:e}),!0)})(t,r)||webkit.messageHandlers.tap.postMessage(r)}function ir(t){lr("down",t)}function ar(t){lr("up",t)}function sr(t){lr("move",t)}function ur(t){lr("cancel",t)}function lr(t,e){var r,n;nr&&(t="cancel"),"move"!=t&&(r=Ue(e.target),n=function(t){if(!t)return t;let e=t.frame,r=W({x:e.x,y:e.y});return{...t,frame:{...e,x:r.x,y:r.y}}}(function(t){var e,r;if(!t||!t.getBoundingClientRect)return null;const n=function(t){const e=["img","svg"];let r=t;for(;r&&r!==document.documentElement;){if(e.includes(r.tagName.toLowerCase()))return r;r=r.parentElement}return null}(t);if(!n)return null;let o=n.getAttribute("src")||n.getAttribute("href"),i=o?null:function(t){if("svg"!==t.tagName.toLowerCase())return null;if(rr(t))return null;let e=null;for(const r of Array.from(t.children)){const t=r.tagName.toLowerCase();if(!tr.includes(t)){if("image"!==t||e)return null;e=r}}return e?rr(e)?null:e:null}(n);const a=i&&((s=i).getAttribute("href")||s.getAttributeNS(Qe,"href")||s.getAttribute("xlink:href"))||null;var s;a?o=a:i=null;let u=(null!=i?i:n).getBoundingClientRect();(u.width<=0||u.height<=0)&&(u=n.getBoundingClientRect());const l=o?new URL(o,document.baseURI).href:null,c=function(t){var e,r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ownerDocument.baseURI;const i=t.tagName.toLowerCase(),a=(null===(e=t.getAttribute("title"))||void 0===e?void 0:e.trim())||null,s=null===(r=t.getAttribute("role"))||void 0===r?void 0:r.toLowerCase().split(/\s+/).find(t=>t.length>0),u=t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby")||t.hasAttribute("aria-description")||t.hasAttribute("aria-details");if("true"===(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||("presentation"===s||"none"===s)&&!u)return{name:null,description:null,extendedDescriptions:[]};let l=null,c=!1;var f;l=Ye(t,"aria-labelledby"),l||(l=(null===(f=t.getAttribute("aria-label"))||void 0===f?void 0:f.trim())||null),l||("img"===i?t.hasAttribute("alt")&&(l=t.getAttribute("alt").trim()||null,l||(c=!0)):"svg"===i&&(l=Je(t,"title")));let p=!1;l||c||!a||(l=a,p=!0),l||"img"!==i||t.hasAttribute("alt")||t.hasAttribute("title")||(l=function(t){const e=t.closest("figure"),r=null==e?void 0:e.querySelector(":scope > figcaption");if(!e||!r)return null;const n=t=>{var e;return null!==(e=null==t?void 0:t.replace(/\s+/g," ").trim())&&void 0!==e?e:""};if(n(e.textContent)!==n(r.textContent))return null;const o=e.querySelectorAll("img, svg, audio, video, object, iframe, embed");for(let e=0;e desc")?d=Je(t,"desc"):p||(d=a),{name:l,description:d,extendedDescriptions:Ge(t,o)}}(n);return{tag:n.tagName.toLowerCase(),html:l?null:n.outerHTML,src:l,resourceHref:null!==(e=null===(r=window.readium)||void 0===r||null===(r=r.link)||void 0===r?void 0:r.href)&&void 0!==e?e:null,frame:{x:u.left,y:u.top,width:u.width,height:u.height},accessibleName:c.name,accessibleDescription:c.description,extendedDescriptions:c.extendedDescriptions,caption:Ze(n),cssSelector:We(n)}}(e.target)));let o=W({x:e.clientX,y:e.clientY}),i={phase:t,defaultPrevented:e.defaultPrevented,pointerId:e.pointerId,pointerType:e.pointerType,x:o.x,y:o.y,buttons:e.buttons,interactiveElement:r,targetElement:n,option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey};null==Vt(e)&&webkit.messageHandlers.pointerEventReceived.postMessage(i)}function cr(t){return t.defaultPrevented||null!=Ue(document.activeElement)}function fr(t){t.stopPropagation(),t.preventDefault()}function pr(t,e){e.repeat||webkit.messageHandlers.keyEventReceived.postMessage({phase:t,code:e.code,key:String.fromCharCode(e.keyCode),option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey})}window.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",or,!1),document.addEventListener("pointerdown",ir,!1),document.addEventListener("pointerup",ar,!1),document.addEventListener("pointermove",sr,!1),document.addEventListener("pointercancel",ur,!1),document.addEventListener("selectionchange",function(){nr=!window.getSelection().isCollapsed})}),window.addEventListener("keydown",t=>{cr(t)||(fr(t),pr("down",t))}),window.addEventListener("keyup",t=>{cr(t)||(fr(t),pr("up",t))}),globalThis.readium={scrollToId:function(t,e){let r=document.getElementById(t);return!!r&&(T(r.getBoundingClientRect(),e),!0)},scrollToPosition:function(t,e,r){t<0||t>1?console.error(`Expected a valid progression in scrollToPosition, got ${t}`):R()?P()?M({left:-document.scrollingElement.scrollWidth*t,animated:r}):M({top:document.scrollingElement.scrollHeight*t,animated:r}):M({left:I(document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1)),animated:r})},scrollToLocator:function(t,e){let r=k(t);return!!r&&function(t,e){return T(t.getBoundingClientRect(),e)}(r,e)},scrollLeft:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX-o,a=r?-(n-o):0;return N(Math.max(i,a),e)},scrollRight:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX+o,a=r?0:n-o;return N(Math.min(i,a),e)},setCSSProperties:function(t){for(const e in t)$(e,t[e])},setProperty:$,removeProperty:F,registerDecorationTemplates:function(t){var e="";for(const n of Object.entries(t)){var r=Bt(n,2);const t=r[0],o=r[1];Wt.set(t,o),o.stylesheet&&(e+=o.stylesheet+"\n")}if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Ut.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=k(e.locator);if(!i)return void _("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),u(a)}function s(t){let e=r.findIndex(e=>e.decoration.id===t);if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function u(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame(function(){null!=o&&document.body.append(o)})),o),i=Wt.get(r.decoration.style);if(!i)return void B(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const s=getComputedStyle(document.body).writingMode,u="vertical-rl"===s||"vertical-lr"===s,l=document.scrollingElement,c=l.scrollLeft,f=l.scrollTop,p=u?window.innerHeight:window.innerWidth,d=u?window.innerWidth:window.innerHeight,h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,y=(u?d:p)/h;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-c+"px":t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-c+l.clientWidth}px`:t.style.left=`${r.left+c}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+c}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void B(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!s.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=U(r.range,t).sort((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left);for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,s),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=s,g(t,b,b,s),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function l(){o&&(o.remove(),o=null)}return{add:a,remove:s,update:function(t){s(t.id),a(t)},clear:function(){l(),r.length=0},items:r,requestLayout:function(){l(),r.forEach(t=>u(t))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+zt++,t),Ut.set(t,e)),e},findFirstVisibleLocator:function(){const t=ze(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:We(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var t={3618(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,u=e[r]|s,l=u|a,c=(u&i)+i^i|u,f=a|~(c|i),p=i&c,d=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(l|(f|=n(o)-s)),a=f&l,t.P[r]=i,t.M[r]=a,d}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var u=new Uint32Array(a+1),l=new Map,c=[],f=0;f<256;f++)c.push(u);for(var p=0;p=e.length||e.charCodeAt(m)===d&&(h[y]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]0?r:0,!0)},o?o(t.exports,"apply",{value:a}):t.exports.apply=a},5298(t,e,r){"use strict";var n=r(703),o=r(5312),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},7517(t,e,r){"use strict";var n=r(9173),o=r(7388),i=r(7379),a=r(3492);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!a&&a(t,e);if(n)n(t,e,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8189(t,e,r){"use strict";var n=r(1748),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(7517),u=r(708)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&arguments[1]||"Cannot call method on "+t);return t}},9253(t){"use strict";t.exports=Object},4938(t){"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},3148(t,e,r){"use strict";var n=r(703)("%Object.defineProperty%",!0),o=r(6618)(),i=r(9939),a=r(7379),s=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==r&&"boolean"!=typeof r||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!r&&i(t,s)||(n?n(t,s,{configurable:!o,enumerable:!1,value:e,writable:!1}):t[s]=e)}},2632(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(2719),i=r(5833),a=r(1718),s=r(7379),u=r(5465),l=r(7377);t.exports=function(t){if(u(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=l(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(u(c))return c;throw new s("unable to convert exotic object to primitive")}return"default"===r&&(i(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new s("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new s('hint must be "string" or "number"');var r,n,i,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(i=0;i1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return W(t,V,function(t,e,r,o){n[n.length]=r?W(o,H,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=G("%"+n+"%",e),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],L(r,D([0,1],u)));for(var f=1,p=!0;f=r.length){var g=x(a,d);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[d]}else p=B(a,d),a=a[d];p&&!s&&(I[i]=a)}}return a}},8819(t,e,r){"use strict";var n=r(9253);t.exports=n.getPrototypeOf||null},2517(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1611(t,e,r){"use strict";var n=r(2517),o=r(8819),i=r(1449);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:i?function(t){return i(t)}:null},4656(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},3492(t,e,r){"use strict";var n=r(4656);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},708(t,e,r){"use strict";var n=r(9173),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},6052(t){"use strict";var e={__proto__:null,foo:{}},r={__proto__:e}.foo===e.foo&&!(e instanceof Object);t.exports=function(){return r}},7657(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(8123);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},8123(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6618(t,e,r){"use strict";var n=r(8123);t.exports=function(){return n()&&!!Symbol.toStringTag}},9939(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3583);t.exports=i.call(n,o)},6561(t,e,r){"use strict";var n=r(9939),o=r(6746)(),i=r(7379),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},2719(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((c||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},5833(t,e,r){"use strict";var n=r(5298),o=n("Date.prototype.getDay"),i=n("Object.prototype.toString"),a=r(6618)();t.exports=function(t){return"object"==typeof t&&null!==t&&(a?function(t){try{return o(t),!0}catch(t){return!1}}(t):"[object Date]"===i(t))}},4587(t,e,r){"use strict";var n,o=r(5298),i=r(6618)(),a=r(9939),s=r(3492);if(i){var u=o("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(t){if(!t||"object"!=typeof t)return!1;var e=s(t,"lastIndex");if(!e||!a(e,"value"))return!1;try{u(t,f)}catch(t){return t===l}}}else{var p=o("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===p(t)}}t.exports=n},1718(t,e,r){"use strict";var n=r(5298),o=n("Object.prototype.toString"),i=r(7657)(),a=r(5537);if(i){var s=n("Symbol.prototype.toString"),u=a(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==o(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u(s(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},9895(t){"use strict";t.exports=Math.abs},6241(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991},2153(t){"use strict";t.exports=Math.floor},1084(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1029(t,e,r){"use strict";var n=r(9895),o=r(2153),i=r(5518),a=r(1084);t.exports=function(t){if("number"!=typeof t||i(t)||!a(t))return!1;var e=n(t);return o(e)===e}},5518(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},457(t){"use strict";t.exports=Math.max},1179(t){"use strict";t.exports=Math.min},5985(t){"use strict";t.exports=Math.pow},8639(t){"use strict";t.exports=Math.round},5738(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},4922(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var $=r(2179),F=$.custom,_=H(F)?F:null,B={__proto__:null,double:'"',single:"'"},D={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function L(t,e,r){var n=r.quoteStyle||e,o=B[n];return o+t+o}function W(t){return v.call(String(t),/"/g,""")}function U(t){return!N||!("object"==typeof t&&(N in t||void 0!==t[N]))}function z(t){return"[object Array]"===X(t)&&U(t)}function V(t){return"[object RegExp]"===X(t)&&U(t)}function H(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&!q(B,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Y(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return y?k(e,w):w}if("bigint"==typeof e){var S=String(e)+"n";return y?k(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var P,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(K(o,e)>=0)return"[Circular]";function D(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!V(e)){var G=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),J=rt(e,D);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+A.call(J,", ")+" }":"")}if(H(e)){var nt=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?nt:Z(nt)}if((P=e)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ot="<"+x.call(String(e.nodeName)),it=e.attributes||[],at=0;at"}if(z(e)){if(0===e.length)return"[]";var st=rt(e,D);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+et(st,F)+"]":"[ "+A.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&U(t)}(e)){var ut=rt(e,D);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+D(e.cause),ut),", ")+" }"}if("object"==typeof e&&u){if(_&&"function"==typeof e[_]&&$)return $(e,{depth:j-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var lt=[];return a&&a.call(e,function(t,r){lt.push(D(r,e,!0)+" => "+D(t,e))}),tt("Map",i.call(e),lt,F)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(D(t,e))}),tt("Set",l.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return"[object Number]"===X(t)&&U(t)}(e))return Z(D(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return Z(D(R.call(e)));if(function(t){return"[object Boolean]"===X(t)&&U(t)}(e))return Z(h.call(e));if(function(t){return"[object String]"===X(t)&&U(t)}(e))return Z(D(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof globalThis&&e===globalThis)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&U(t)}(e)&&!V(e)){var ft=rt(e,D),pt=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,dt=e instanceof Object?"":"null prototype",ht=!pt&&N&&Object(e)===e&&N in e?b.call(X(e),8,-1):dt?"Object":"",yt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ht||dt?"["+A.call(E.call([],ht||[],dt||[]),": ")+"] ":"");return 0===ft.length?yt+"{}":F?yt+"{"+et(ft,F)+"}":yt+"{ "+A.call(ft,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Y(b.call(t,0,e.maxStringLength),e)+n}var o=D[e.quoteStyle||"single"];return o.lastIndex=0,L(v.call(v.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=z(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var y=0;y0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},3743(t,e,r){"use strict";var n=r(7843),o=r(7379),i=Object;t.exports=n(function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1721(t,e,r){"use strict";var n=r(8189),o=r(7965),i=r(3743),a=r(4510),s=r(3980),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},4510(t,e,r){"use strict";var n=r(3743),o=r(8189).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),t.get.call(r),"dy"===e)return t.get}}return n}},3980(t,e,r){"use strict";var n=r(8189).supportsDescriptors,o=r(4510),i=r(3492),a=Object.defineProperty,s=r(9183),u=r(1611),l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(l),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},5537(t,e,r){"use strict";var n=r(5298),o=r(4587),i=n("RegExp.prototype.exec"),a=r(7379);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2644(t,e,r){"use strict";var n=r(703),o=r(7517),i=r(708)(),a=r(3492),s=r(7379),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in t&&a){var c=a(t,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},7843(t,e,r){"use strict";var n=r(7517),o=r(708)(),i=r(3749).functionsHaveConfigurableNames(),a=r(7379);t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},7797(t,e,r){"use strict";var n=r(4922),o=r(7379),i=function(t,e,r){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,r||(n.next=t.next,t.next=n),n};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var r=function(t,e){if(t)return i(t,e,!0)}(t,e);return r&&t&&!t.next&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var r=i(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!i(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var n=i(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},1085(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(7379),s=n("%Map%",!0),u=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);t.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+i(t))},delete:function(e){if(t){var r=f(t,e);return 0===p(t)&&(t=void 0),r}return!1},get:function(e){if(t)return u(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,r){t||(t=new s),l(t,e,r)}};return e}},2468(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(1085),s=r(7379),u=n("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);t.exports=u?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(r){if(u&&r&&("object"==typeof r||"function"==typeof r)){if(t)return p(t,r)}else if(a&&e)return e.delete(r);return!1},get:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?f(t,r):!!e&&e.has(r)},set:function(r,n){u&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new u),c(t,r,n)):a&&(e||(e=a()),e.set(r,n))}};return r}:a},6746(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(7797),a=r(1085),s=r(2468)||a||i;t.exports=function(){var t,e={assert:function(t){if(!e.has(t)){var r=t&&Object(t)===t?"the given object key":o(t);throw new n("Side channel does not contain "+r)}},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=s()),t.set(e,r)}};return e}},4290(t,e,r){"use strict";var n=r(6520),o=r(7630),i=r(4111),a=r(333),s=r(1076),u=r(5363),l=r(5298),c=r(7657)(),f=r(1721),p=r(703),d=r(7379),h=p("%RegExp%"),y=l("String.prototype.indexOf"),g=r(2570),m=function(t){var e=g();if(c&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===h.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),y(s(r),"g")<0)throw new d("matchAll requires a global regular expression")}var i=m(t);if(void 0!==i)return n(i,t,[e])}var l=s(e),c=new h(t,"g");return n(m(c),c,[l])}},6410(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(4290),a=r(4683),s=r(3197),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2570(t,e,r){"use strict";var n=r(7657)(),o=r(1930);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},4683(t,e,r){"use strict";var n=r(4290);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},1930(t,e,r){"use strict";var n=r(3990),o=r(7630),i=r(5234),a=r(518),s=r(6117),u=r(1076),l=r(192),c=r(1721),f=r(7843),p=r(5298),d=r(703),h=r(7379),y=p("String.prototype.indexOf"),g=d("%RegExp%"),m="flags"in g.prototype,b=f(function(t){var e=this;if("Object"!==l(e))throw new h('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(c(e));return{flags:r,matcher:new t(m&&"string"==typeof r?e:t===g?e.source:e,r)}}(a(e,g),e),p=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var v=y(p,"g")>-1,w=y(p,"u")>-1;return n(d,r,v,w)},"[Symbol.matchAll]",!0);t.exports=b},3197(t,e,r){"use strict";var n=r(8189),o=r(7657)(),i=r(3492),a=r(4683),s=r(2570),u=Object.defineProperty;t.exports=function(){var t=a();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&i){var r=i(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var l=s(),c={};c[e]=l;var f={};f[e]=function(){return RegExp.prototype[e]!==l},n(RegExp.prototype,c,f)}return t}},3952(t,e,r){"use strict";var n=r(5363),o=r(2501),i=r(5298),a=r(5537),s=i("String.prototype.replace"),u=i("String.prototype.charAt"),l=i("String.prototype.slice"),c=/^\s$/.test("᠎"),f=c?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,p=a(c?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);t.exports=function(){for(var t=s(o(n(this)),f,""),e=t.length;e>0&&p(u(t,e-1));)e-=1;return l(t,0,e)}},7724(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(5363),a=r(3952),s=r(8821),u=r(5795),l=n(s()),c=function(t){return i(t),l(t)};o(c,{getPolyfill:s,implementation:a,shim:u}),t.exports=c},8821(t,e,r){"use strict";var n=r(3952);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},5795(t,e,r){"use strict";var n=r(708)(),o=r(7517),i=r(8821);t.exports=function(){var t=i();return String.prototype.trim!==t&&(n?o(String.prototype,"trim",t,!0):o(String.prototype,"trim",t)),t}},2179(){},6917(t,e,r){"use strict";var n=r(6562),o=r(7379),i=r(1029),a=r(6241);t.exports=function(t,e,r){if("string"!=typeof t)throw new o("Assertion failed: `S` must be a String");if(!i(e)||e<0||e>a)throw new o("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("boolean"!=typeof r)throw new o("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+n(t,e)["[[CodeUnitCount]]"]:e+1}},6520(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(7379),a=r(3443),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6562(t,e,r){"use strict";var n=r(7379),o=r(5298),i=r(3283),a=r(8537),s=r(1300),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("string"!=typeof t)throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),c=u(t,e),f=i(o),p=a(o);if(!f&&!p)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(p||e+1===r)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":s(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},44(t,e,r){"use strict";var n=r(7379);t.exports=function(t,e){if("boolean"!=typeof e)throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},3990(t,e,r){"use strict";var n=r(703),o=r(7657)(),i=r(7379),a=r(4938),s=n("%IteratorPrototype%",!0),u=r(6917),l=r(44),c=r(355),f=r(7630),p=r(2021),d=r(3936),h=r(5234),y=r(6117),g=r(1076),m=r(6561),b=r(3148),v=function(t,e,r,n){if("string"!=typeof e)throw new i("`S` must be a string");if("boolean"!=typeof r)throw new i("`global` must be a boolean");if("boolean"!=typeof n)throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};s&&(v.prototype=p(s)),c(v.prototype,"next",function(){var t=this;if(!a(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return l(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return m.set(t,"[[Done]]",!0),l(void 0,!0);if(n){if(""===g(f(s,"0"))){var c=y(f(e,"lastIndex")),p=u(r,c,o);h(e,"lastIndex",p,!0)}return l(s,!1)}return m.set(t,"[[Done]]",!0),l(s,!1)},!1),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,function(){return this},!1),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},355(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(9271),a=r(1181),s=r(5855);t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `homeObject` is not an Object");if(!s(e))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if("function"!=typeof r)throw new n("Assertion failed: `closure` is not a function");if("boolean"!=typeof u)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(t))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(t,e,{"[[Value]]":r,"[[Writable]]":!0,"[[Enumerable]]":u,"[[Configurable]]":!0})}},9271(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(6843),a=r(9999),s=r(5848),u=r(7817),l=r(5855),c=r(925),f=r(6309);t.exports=function(t,e,r){if(!o(t))throw new n("Assertion failed: Type(O) is not Object");if(!l(e))throw new n("Assertion failed: P is not a Property Key");var p=i(r)?r:f(r);if(!i(p))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return a(u,c,s,t,e,p)}},5848(t,e,r){"use strict";var n=r(7379),o=r(6843),i=r(3003);t.exports=function(t){if(void 0!==t&&!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(t)}},7630(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855),a=r(4938);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},4111(t,e,r){"use strict";var n=r(7379),o=r(7818),i=r(1816),a=r(5855),s=r(4922);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},7818(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},3443(t,e,r){"use strict";t.exports=r(8622)},1816(t,e,r){"use strict";t.exports=r(2719)},3478(t,e,r){"use strict";var n=r(4334)("%Reflect.construct%",!0),o=r(9271);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},7817(t,e,r){"use strict";var n=r(7379),o=r(9939),i=r(6843);t.exports=function(t){if(void 0===t)return!1;if(!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!o(t,"[[Value]]")&&!o(t,"[[Writable]]"))}},1181(t,e,r){"use strict";var n=r(703),o=n("%Object.preventExtensions%",!0),i=n("%Object.isExtensible%",!0),a=r(9258);t.exports=o?function(t){return!a(t)&&i(t)}:function(t){return!a(t)}},333(t,e,r){"use strict";var n=r(703)("%Symbol.match%",!0),o=r(4587),i=r(4938),a=r(4801);t.exports=function(t){if(!i(t))return!1;if(n){var e=t[n];if(void 0!==e)return a(e)}return o(t)}},2021(t,e,r){"use strict";var n=r(703)("%Object.create%",!0),o=r(7379),i=r(7388),a=r(4938),s=r(3443),u=r(5713),l=r(6561),c=r(6052)();t.exports=function(t){if(null!==t&&!a(t))throw new o("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(c)e={__proto__:t};else if(n)e=n(t);else{if(null===t)throw new i("native Object.create support is required to create null objects");var f=function(){};f.prototype=t,e=new f}return r.length>0&&u(r,function(t){l.set(e,t,void 0)}),e}},3936(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5298)("RegExp.prototype.exec"),a=r(6520),s=r(7630),u=r(1816);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: `R` must be an Object");if("string"!=typeof e)throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(u(r)){var l=a(r,t,[e]);if(null===l||o(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},925(t,e,r){"use strict";var n=r(5518);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},5234(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5855),a=r(925),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof u)throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!a(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||a(t[e],r)}catch(t){return!1}}},518(t,e,r){"use strict";var n=r(703)("%Symbol.species%",!0),o=r(7379),i=r(4938),a=r(3478);t.exports=function(t,e){if(!i(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if(!i(r))throw new o("O.constructor is not an Object");var s=n?r[n]:void 0;if(null==s)return e;if(a(s))return s;throw new o("no constructor found")}},9893(t,e,r){"use strict";var n=r(703),o=n("%RegExp%"),i=r(7379),a=n("%parseInt%"),s=r(5298),u=r(5537),l=s("String.prototype.slice"),c=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),h=r(7724);t.exports=function t(e){if("string"!=typeof e)throw new i("Assertion failed: `argument` is not a String");if(c(e))return+a(l(e,2),2);if(f(e))return+a(l(e,2),8);if(d(e)||p(e))return NaN;var r=h(e);return r!==e?t(r):+e}},4801(t){"use strict";t.exports=function(t){return!!t}},7210(t,e,r){"use strict";var n=r(3312),o=r(6354),i=r(5518),a=r(1084);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},6117(t,e,r){"use strict";var n=r(6241),o=r(7210);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},3312(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%Number%"),a=r(9258),s=r(3760),u=r(9893);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):+e}},3760(t,e,r){"use strict";var n=r(2632);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},6309(t,e,r){"use strict";var n=r(9939),o=r(7379),i=r(4938),a=r(1816),s=r(4801);t.exports=function(t){if(!i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!a(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},1076(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},192(t,e,r){"use strict";var n=r(3225);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1300(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%String.fromCharCode%"),a=r(3283),s=r(8537);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},7060(t,e,r){"use strict";var n=r(2153);t.exports=function(t){return"bigint"==typeof t?t:n(t)}},6354(t,e,r){"use strict";var n=r(7060),o=r(7379);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new o("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2501(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},3225(t,e,r){"use strict";var n=r(4938);t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":n(t)?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},4334(t,e,r){"use strict";t.exports=r(703)},9999(t,e,r){"use strict";var n=r(708),o=r(9173),i=n.hasArrayLengthDefineBug(),a=i&&r(8622),s=r(5298)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,u,l){if(!o){if(!t(l))return!1;if(!l["[[Configurable]]"]||!l["[[Writable]]"])return!1;if(u in n&&s(n,u)!==!!l["[[Enumerable]]"])return!1;var c=l["[[Value]]"];return n[u]=c,e(n[u],c)}return i&&"length"===u&&"[[Value]]"in l&&a(n)&&n.length!==l["[[Value]]"]?(n.length=l["[[Value]]"],n.length===l["[[Value]]"]):(o(n,u,r(l)),!0)}},8622(t,e,r){"use strict";var n=r(703)("%Array%"),o=!n.isArray&&r(5298)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},5713(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},9258(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},5855(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},8537(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},6843(t,e,r){"use strict";var n=r(7379),o=r(9939),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(o(t,e)&&!i[e])return!1;var r=o(t,"[[Value]]")||o(t,"[[Writable]]"),a=o(t,"[[Get]]")||o(t,"[[Set]]");if(r&&a)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(3618);function e(e,r,n){let o=0;const i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.A)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){const e=document.createElement("div");return e.appendChild(t.cloneContents()),function(t){var e;for(const e of Array.from(t.querySelectorAll("br")))e.replaceWith(document.createTextNode(" "));return null!==(e=t.textContent)&&void 0!==e?e:""}(e)}function i(t,e){let r=0;for(const n of t){if(!(n{if(i=e===a.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===a.Forwards?0:t.length;u=s(t,r,e)}};for(;i&&-1===u&&i!==o;)l();if(i&&u>=0)return{node:i,offset:u};throw new RangeError("No text nodes with non-whitespace text found in range")}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1?e-1:0),n=1;no?(a.push({node:s,offset:o-l}),o=r.shift()):(u=i.nextNode(),l+=s.data.length);for(;void 0!==o&&s&&l===o;)a.push({node:s,offset:s.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}let d=function(t){return t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS",t}({});class h{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=f(e),e=e.parentElement;return new h(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return p(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return h.fromPoint(t,e);case Node.ELEMENT_NODE:return new h(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=f(t)+e;return new h(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const t=u(e,a.Forwards),r=t.node,n=t.offset;r&&n>=0&&e.setStart(r,n)}if(!n){const t=u(e,a.Backwards),r=t.node,n=t.offset;r&&n>0&&e.setEnd(r,n)}return e}(y.fromRange(t).toRange())}}class g{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=y.fromRange(e).relativeTo(t);return new g(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new g(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return y.fromOffsets(this.root,this.start,this.end).toRange()}}class m{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){var r;const n=null!==(r=t.textContent)&&void 0!==r?r:"",i=y.fromRange(e).relativeTo(t),a=i.start.offset,s=i.end.offset,u=o(e),l=o(y.fromOffsets(t,Math.max(0,a-32),a).toRange()),c=o(y.fromOffsets(t,s,Math.min(n.length,s+32)).toRange());return new m(t,u,{prefix:l,suffix:c})}static fromSelector(t,e){const r=e.prefix,n=e.suffix;return new m(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t){let e="";const r=[],n=t=>{var o;if(t.nodeType!==Node.TEXT_NODE){if(t.nodeType===Node.ELEMENT_NODE){if("BR"===t.tagName)return r.push(e.length),void(e+=" ");for(const e of Array.from(t.childNodes))n(e)}}else e+=null!==(o=t.textContent)&&void 0!==o?o:""};return n(t),{text:e,brPositionsInText:r}}(this.root),o=r.text,a=r.brPositionsInText,s=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const s=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,s=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let u=1;return"number"==typeof o.hint&&(u=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*s+2*u)/92},u=a.map(t=>({start:t.start,end:t.end,score:s(t)}));return u.sort((t,e)=>e.score-t.score),u[0]}(o,this.exact,{...this.context,hint:t.hint});if(!s)throw new Error("Quote not found");return new g(this.root,i(a,s.start),i(a,s.end))}}var b,v=r(6410);function w(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;x(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return x(">>> createOrderedRange RANGE REVERSE OK."),o;x(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void x("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=y.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let s=n.slice(Math.max(0,i-200),i),u=s.search(/\P{L}\p{L}/gu);-1!==u&&(s=s.slice(u+1));let l=n.slice(a,Math.min(n.length,a+200)),c=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==c&&c.index>1&&(l=l.slice(0,c.index+1)),{highlight:e,before:s,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return L(t.getRangeAt(0).getBoundingClientRect())}catch(t){return D(t),null}}()}:null}function x(){_.apply(null,arguments)}r.n(v)().shim(),window.addEventListener("error",function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})},!1),window.addEventListener("load",function(){var t;new ResizeObserver(()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(function(){O=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(R()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!R()){var t=I(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),j()})}).observe(document.body)},!1);var S,E,A=!1,O=0;function j(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(R()&&!P()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;b={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;C()&&(e=Math.abs(e)),b={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(A||window.requestAnimationFrame(function(){var t;t=b,webkit.messageHandlers.progressionChanged.postMessage(t),A=!1}),A=!0)}function R(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function P(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function C(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function T(t,e){return R()?M({top:t.top+window.scrollY,animated:e}):M({left:I(t.left+window.scrollX),animated:e}),!0}function N(t,e){var r=window.scrollX,n=window.innerWidth,o=Math.abs(r-t)/n>.01;return o&&M({left:t,animated:e}),o}function M(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.left,r=t.top,n=t.animated;document.scrollingElement.scrollTo({left:e,top:r,behavior:n?"smooth":"instant"})}function I(t){const e=t+(C()?-1:1);return e-e%(O||window.innerWidth)}function k(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new m(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments){let e;try{e=decodeURIComponent(t)}catch(t){continue}if(r=document.getElementById(e))break}if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){D(t)}return null}function $(t,e){null===e?F(t):document.documentElement.style.setProperty(t,e,"important")}function F(t){document.documentElement.style.removeProperty(t)}function _(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function B(t){D(new Error(t))}function D(t){webkit.messageHandlers.logError.postMessage({message:t.message})}function L(t){let e=W({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function W(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function U(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=q(function(t){const e=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const n of t)if(r!==n&&e.has(n)&&H(n,r,1)){J(),e.delete(r);break}}else J(),e.delete(r);return Array.from(e)}(z(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){J();break}J(),o.splice(t,1)}}return J((n.length,o.length)),o}function z(t,e,r){for(let n=0;nt!==i&&t!==a),o=V(i,a);return n.push(o),z(n,e,r)}}return t}function V(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function H(t,e,r){return G(t,e.left,e.top,r)&&G(t,e.right,e.top,r)&&G(t,e.left,e.bottom,r)&&G(t,e.right,e.bottom,r)}function G(t,e,r,n){return(t.lefte||Y(t.right,e,n))&&(t.topr||Y(t.bottom,r,n))}function q(t){for(let e=0;et!==e);return Array.prototype.push.apply(a,r),q(a)}}else J()}return t}function X(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function K(t,e,r){return(t.left=0&&Y(t.left,e.right,r))&&(e.left=0&&Y(e.left,t.right,r))&&(t.top=0&&Y(t.top,e.bottom,r))&&(e.top=0&&Y(e.top,t.bottom,r))}function Y(t,e,r){return Math.abs(t-e)<=r}function J(){}window.addEventListener("scroll",j),document.addEventListener("selectionchange",(S=function(){webkit.messageHandlers.selectionChanged.postMessage(w())},function(){var t=this,e=arguments;clearTimeout(E),E=setTimeout(function(){S.apply(t,e),E=null},50)}));var Z,Q=[],tt=function(){return Q.some(function(t){return t.activeTargets.length>0})},et="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Z||(Z={}));var rt,nt=function(t){return Object.freeze(t)},ot=function(t,e){this.inlineSize=t,this.blockSize=e,nt(this)},it=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,nt(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),at=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(at(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},ut=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},lt="undefined"!=typeof window?window:{},ct=new WeakMap,ft=/auto|scroll/,pt=/^tb|vertical/,dt=/msie|trident/i.test(lt.navigator&<.navigator.userAgent),ht=function(t){return parseFloat(t||"0")},yt=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new ot((r?e:t)||0,(r?t:e)||0)},gt=nt({devicePixelContentBoxSize:yt(),borderBoxSize:yt(),contentBoxSize:yt(),contentRect:new it(0,0,0,0)}),mt=function(t,e){if(void 0===e&&(e=!1),ct.has(t)&&!e)return ct.get(t);if(st(t))return ct.set(t,gt),gt;var r=getComputedStyle(t),n=at(t)&&t.ownerSVGElement&&t.getBBox(),o=!dt&&"border-box"===r.boxSizing,i=pt.test(r.writingMode||""),a=!n&&ft.test(r.overflowY||""),s=!n&&ft.test(r.overflowX||""),u=n?0:ht(r.paddingTop),l=n?0:ht(r.paddingRight),c=n?0:ht(r.paddingBottom),f=n?0:ht(r.paddingLeft),p=n?0:ht(r.borderTopWidth),d=n?0:ht(r.borderRightWidth),h=n?0:ht(r.borderBottomWidth),y=f+l,g=u+c,m=(n?0:ht(r.borderLeftWidth))+d,b=p+h,v=s?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?y+m:0,S=o?g+b:0,E=n?n.width:ht(r.width)-x-w,A=n?n.height:ht(r.height)-S-v,O=E+y+w+m,j=A+g+v+b,R=nt({devicePixelContentBoxSize:yt(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:yt(O,j,i),contentBoxSize:yt(E,A,i),contentRect:new it(f,u,E,A)});return ct.set(t,R),R},bt=function(t,e,r){var n=mt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case Z.DEVICE_PIXEL_CONTENT_BOX:return a;case Z.BORDER_BOX:return o;default:return i}},vt=function(t){var e=mt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=nt([e.borderBoxSize]),this.contentBoxSize=nt([e.contentBoxSize]),this.devicePixelContentBoxSize=nt([e.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},xt=function(){var t=1/0,e=[];Q.forEach(function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach(function(e){var r=new vt(e.target),o=wt(e.target);n.push(r),e.lastReportedSize=bt(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))})})},Et=[],At=0,Ot={attributes:!0,characterData:!0,childList:!0,subtree:!0},jt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,Ct=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var r,n=Rt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(St(e);tt();)e=xt(),St(e);return Q.some(function(t){return t.skippedTargets.length>0})&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:et}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=et),window.dispatchEvent(t)),e>0}()}finally{if(Pt=!1,t=n-Rt(),!At)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!rt){var e=0,r=document.createTextNode("");new MutationObserver(function(){return Et.splice(0).forEach(function(t){return t()})}).observe(r,{characterData:!0}),rt=function(){r.textContent="".concat(e?e--:e++)}}Et.push(t),rt()}(function(){requestAnimationFrame(r)})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Ot)};document.body?e():lt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jt.forEach(function(e){return lt.addEventListener(e,t.listener,!0)}))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),jt.forEach(function(e){return lt.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},t}(),Tt=new Ct,Nt=function(t){!At&&t>0&&Tt.start(),!(At+=t)&&Tt.stop()},Mt=function(){function t(t,e){this.target=t,this.observedBox=e||Z.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=bt(this.target,this.observedBox,!0);return t=this.target,at(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),It=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},kt=new WeakMap,$t=function(t,e){for(var r=0;r=0&&(o&&Q.splice(Q.indexOf(r),1),r.observationTargets.splice(n,1),Nt(-1))},t.disconnect=function(t){var e=this,r=kt.get(t);r.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),_t=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ft.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.unobserve(this,t)},t.prototype.disconnect=function(){Ft.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(t,e):void 0}}(t,e)||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 Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Ut.forEach(function(t){t.requestLayout()}))}).observe(t)},!1);const Gt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function qt(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}const Xt={selectors:[Gt.id,Gt.class,Gt.tag,Gt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1,ignoreGeneratedClassNames:!1};function Kt(t){return!!t}function Yt(t){return t instanceof RegExp}function Jt(t){return["string","function"].includes(typeof t)||Yt(t)}function Zt(t){return Array.isArray(t)?t.filter(Jt):[]}function Qt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return null!=t&&"object"==typeof t&&"nodeType"in t&&"number"==typeof t.nodeType}(t)&&e.includes(t.nodeType)}function te(t,e){if(Qt(t))return t.contains(e)||qt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const r=e.getRootNode({composed:!1});return Qt(r)?(r!==document&&qt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):se(e)}function ee(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function re(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce((t,e)=>t.filter(t=>e.includes(t)),e)}function ne(t){const e=t.map(t=>{if(Yt(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(qt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return qt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(e=>e(t))}function oe(t,e,r){const n=Array.from(te(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every(t=>n.includes(t))}function ie(t,e){e=null!=e?e:se(t);const r=[];let n=t;for(;n&&n!==e;)Ht(n)&&r.push(n),n=n.parentNode;return r}function ae(t,e){return re(t.map(t=>ie(t,e)))}function se(t){return t.ownerDocument.querySelector(":root")}const ue=new RegExp(["^$","\\s"].join("|")),le=new RegExp(["^$"].join("|")),ce=[Gt.nthoftype,Gt.tag,Gt.id,Gt.class,Gt.attribute,Gt.nthchild],fe=ne(["class","id","ng-*"]);function pe({name:t}){return`[${t}]`}function de({name:t,value:e}){return`[${t}='${e}']`}function he({nodeName:t,nodeValue:e}){return{name:Ce(t),value:Ce(null!=e?e:void 0)}}function ye(t,e){const r=Array.from(t.attributes).filter(e=>function({nodeName:t,nodeValue:e},r){const n=r.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||fe(t))}(e,t)).map(he);return[...r.map(pe),...r.map(de)]}const ge=/^[a-z_-]{3,}$/i,me=/[bcdfghjklmnpqrstvwxyz]{4,}/i;function be(t,e){var r;const n=(null!==(r=t.getAttribute("class"))&&void 0!==r?r:"").trim().split(/\s+/).filter(t=>!le.test(t));let o=n;if(null==e?void 0:e.ignoreGeneratedClassNames){const t=ne(e.whitelist);o=n.filter(e=>{const r=`.${Ce(e)}`;return!!t(r)||function(t){if(!ge.test(t))return!1;if(t.includes("_")&&!t.includes("__"))return!1;if(/^(css|sc|jsx|emotion|makeStyles|MuiButton|MuiBox)-/i.test(t))return!1;const e=t.split(/--|__|[-]|(?<=[a-z])(?=[A-Z])/).filter(t=>t.length>0);if(0===e.length)return!1;if(1===e.length&&e[0].length<4)return!1;for(const t of e){if(t.length<=2)return!1;if(me.test(t))return!1}return!0}(e)})}return o.map(t=>`.${Ce(t)}`)}function ve(t,e){var r;const n=null!==(r=t.getAttribute("id"))&&void 0!==r?r:"",o=`#${Ce(n)}`,i=t.getRootNode({composed:!1});return!ue.test(n)&&oe([t],o,i)?[o]:[]}function we(t,e){const r=t.parentNode,n=r&&"children"in r?r.children:null;if(n)for(let e=0;exe(t)),[].concat(...n)))];var n;return 0===r.length||r.length>1?[]:[r[0]]}function Ee(t,e){const r=Se([t])[0],n=t.parentNode,o=n&&"children"in n?n:null;if(o){const e=Array.from(o.children).filter(t=>t.tagName.toLowerCase()===r),n=e.indexOf(t);if(n>-1)return[`${r}:nth-of-type(${String(n+1)})`]}return[]}function*Ae(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=je(1);for(;n.length<=t.length&&rt[e]);yield e,n=Oe(n,t.length-1)}}function Oe(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return je(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?je(r+1):n}function je(t=1){return Array.from(Array(t).keys())}const Re=":".charCodeAt(0).toString(16).toUpperCase(),Pe=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Ce(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map(t=>":"===t?`\\${Re} `:Pe.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\")).join("")}(t)}const Te={tag:Se,id:function(t,e){return 0===t.length||t.length>1?[]:ve(t[0])},class:function(t,e){return re(t.map(t=>be(t,e)))},attribute:function(t,e){return re(t.map(t=>ye(t)))},nthchild:function(t,e){return re(t.map(t=>we(t)))},nthoftype:function(t,e){return re(t.map(t=>Ee(t)))}},Ne={tag:xe,id:ve,class:be,attribute:ye,nthchild:we,nthoftype:Ee};function Me(t){return t.includes(Gt.tag)||t.includes(Gt.nthoftype)?[...t]:[...t,Gt.tag]}function*Ie(t,e){const r={};for(const n of t){const t=e[n];t&&t.length>0&&(r[n]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const r=[{index:e.length-1,partial:{}}];for(;r.length>0;){const t=r.pop();if(!t)break;const{index:n,partial:o}=t;if(n<0){yield o;continue}const[i,a]=e[n];for(let t=a.length-1;t>=0;t--)r.push({index:n-1,partial:Object.assign(Object.assign({},o),{[i]:a[t]})})}}(r))yield ke(t)}function ke(t={}){const e=[...ce];return t[Gt.tag]&&t[Gt.nthoftype]&&e.splice(e.indexOf(Gt.tag),1),e.map(e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n}).join("")}function $e(t,e){return[...t.map(t=>e+" "+t),...t.map(t=>e+" > "+t)]}function*Fe(t,e,r="",n){const o=function*(t,e){const r=new Set,n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=ne(r),s=ne(n);return function(t){const{selectors:e,includeTag:r}=t,n=[...e];return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce((r,n)=>{const u=function(t,e,r){return(0,Te[e])(t,r)}(t,n,e),l=function(t=[],e,r){return t.filter(t=>r(t)||!e(t))}(u,a,s),c=function(t=[],e){return t.sort((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0})}(l,s);return r[n]=o?Array.from(Ae(c,{maxResults:i})):c.map(t=>[t]),r},{})}(t,e);for(const t of function*(t,e){for(const r of function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Ae(t,{maxResults:e}))}(e,{maxResults:o}):e.map(t=>[t]);return n?i.map(Me):i}(e))yield*Ie(r,t)}(n,e))r.has(t)||(r.add(t),yield t)}(t,n);for(const n of function*(t,e){if(""===e)yield*t;else for(const r of t)yield*$e([r],e)}(o,r))oe(t,n,e)&&(yield n)}function*_e(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...ae(t,e).map(t=>[t])];for(const t of o)for(const o of Fe(t,e,r,n))yield{foundElements:t,selector:o}}function Be(t){return{value:t,include:!1}}function De({selectors:t,operator:e}){let r=[...ce];t[Gt.tag]&&t[Gt.nthoftype]&&(r=r.filter(t=>t!==Gt.tag));let n="";return r.forEach(e=>{var r;(null!==(r=t[e])&&void 0!==r?r:[]).forEach(({value:t,include:e})=>{e&&(n+=t)})}),e+n}function Le(t,e){return t.map(t=>function(t,e){const r=ie(t,e).reverse(),n=e instanceof ShadowRoot,o=r.map((t,e)=>{var r;const o=function(t,e,r=""){const n={};return e.forEach(e=>{Reflect.set(n,e,function(t,e){return Ne[e](t,void 0)}(t,e).map(Be))}),{element:t,operator:r,selectors:n}}(t,[Gt.nthchild],n&&0===e?"":" > ");return(null!==(r=o.selectors.nthchild)&&void 0!==r?r:[]).forEach(t=>{t.include=!0}),o});return[n?"":e?":scope":":root",...o.map(De)].join("")}(t,e)).join(", ")}function We(t,e={}){const r=function*(t,e={}){var r;const n=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Ht);return[...new Set(e)]}(t),o=function(t,e={}){const r=Object.assign(Object.assign({},Xt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter(t=>{return e=Gt,r=t,Object.values(e).includes(r);var e,r}):[]),whitelist:Zt(r.whitelist),blacklist:Zt(r.blacklist),root:te(r.root,t),combineWithinSelector:Kt(r.combineWithinSelector),combineBetweenSelectors:Kt(r.combineBetweenSelectors),includeTag:Kt(r.includeTag),maxCombinations:ee(r.maxCombinations),maxCandidates:ee(r.maxCandidates),useScope:Kt(r.useScope),maxResults:ee(r.maxResults),ignoreGeneratedClassNames:Kt(r.ignoreGeneratedClassNames)};var n}(n[0],e),i=null!==(r=o.root)&&void 0!==r?r:se(n[0]);let a=0;for(const t of function*({elements:t,root:e,rootSelector:r="",options:n}){let o=e,i=r,a=!0;for(;a;){let r=!1;for(const a of _e(t,o,i,n)){const{foundElements:n,selector:s}=a;if(r=!0,!oe(t,s,e)){o=n[0],i=s;break}yield s}r||(a=!1)}}({elements:n,options:o,root:i,rootSelector:""}))if(yield t,a++,a>=o.maxResults)return;if(n.length>1){const{maxResults:t}=e,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);oWe(t,r)).join(", "),a++,a>=o.maxResults)return}const s=void 0!==e.root;yield Le(n,o.useScope||s?i:void 0)}(t,Object.assign(Object.assign({},e),{maxResults:1}));return r.next().value}function Ue(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Ue(t.parentElement):null}function ze(t){for(var e=0;e0&&e.top0&&e.left{var n;if(t.nodeType===Node.TEXT_NODE)e.push(null!==(n=t.nodeValue)&&void 0!==n?n:"");else if(t.nodeType===Node.ELEMENT_NODE){const n=t;var o;"img"===n.tagName.toLowerCase()?e.push(null!==(o=n.getAttribute("alt"))&&void 0!==o?o:""):n.childNodes.forEach(r)}};return t.childNodes.forEach(r),e.join(" ").replace(/\s+/g," ").trim()||null}function Ye(t,e){const r=t.getAttribute(e);return r&&r.split(/\s+/).filter(t=>t.length>0).map(e=>t.ownerDocument.getElementById(e)).filter(t=>null!=t).map(t=>{var e,r;return(null===(e=t.getAttribute("aria-label"))||void 0===e?void 0:e.trim())||(null===(r=t.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||""}).filter(t=>t.length>0).join(" ")||null}function Je(t,e){var r;const n=t.querySelector(`:scope > ${e}`);return(null==n||null===(r=n.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||null}function Ze(t){var e,r,n,o,i;const a=null===(e=t.closest("figure"))||void 0===e?void 0:e.querySelector(":scope > figcaption");if(!a||a.contains(t))return null;const s=((null!==(r=t.getAttribute("aria-details"))&&void 0!==r?r:"")+" "+(null!==(n=t.getAttribute("aria-describedby"))&&void 0!==n?n:"")).split(/\s+/).filter(t=>t.length>0);if(s.includes(null!==(o=a.getAttribute("id"))&&void 0!==o?o:""))return null;const u=t=>{var e;return"details"===t.tagName.toLowerCase()||s.includes(null!==(e=t.getAttribute("id"))&&void 0!==e?e:"")},l=a.cloneNode(!0),c=l.querySelectorAll("*");for(let t=0;tt.hasAttribute(e))}let nr=!1;function or(t){if(!getSelection().isCollapsed)return;let e=W({x:t.clientX,y:t.clientY}),r={defaultPrevented:t.defaultPrevented,x:e.x,y:e.y,targetElement:t.target.outerHTML,interactiveElement:Ue(t.target)};(function(t,e){let r=Vt(t);return!!r&&(webkit.messageHandlers.decorationActivated.postMessage({id:r.item.decoration.id,group:r.group,rect:L(r.item.range.getBoundingClientRect()),click:e}),!0)})(t,r)||webkit.messageHandlers.tap.postMessage(r)}function ir(t){lr("down",t)}function ar(t){lr("up",t)}function sr(t){lr("move",t)}function ur(t){lr("cancel",t)}function lr(t,e){var r,n;nr&&(t="cancel"),"move"!=t&&(r=Ue(e.target),n=function(t){if(!t)return t;let e=t.frame,r=W({x:e.x,y:e.y});return{...t,frame:{...e,x:r.x,y:r.y}}}(function(t){var e,r;if(!t||!t.getBoundingClientRect)return null;const n=function(t){const e=["img","svg"];let r=t;for(;r&&r!==document.documentElement;){if(e.includes(r.tagName.toLowerCase()))return r;r=r.parentElement}return null}(t);if(!n)return null;let o=n.getAttribute("src")||n.getAttribute("href"),i=o?null:function(t){if("svg"!==t.tagName.toLowerCase())return null;if(rr(t))return null;let e=null;for(const r of Array.from(t.children)){const t=r.tagName.toLowerCase();if(!tr.includes(t)){if("image"!==t||e)return null;e=r}}return e?rr(e)?null:e:null}(n);const a=i&&((s=i).getAttribute("href")||s.getAttributeNS(Qe,"href")||s.getAttribute("xlink:href"))||null;var s;a?o=a:i=null;let u=(null!=i?i:n).getBoundingClientRect();(u.width<=0||u.height<=0)&&(u=n.getBoundingClientRect());const l=o?new URL(o,document.baseURI).href:null,c=function(t){var e,r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ownerDocument.baseURI;const i=t.tagName.toLowerCase(),a=(null===(e=t.getAttribute("title"))||void 0===e?void 0:e.trim())||null,s=null===(r=t.getAttribute("role"))||void 0===r?void 0:r.toLowerCase().split(/\s+/).find(t=>t.length>0),u=t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby")||t.hasAttribute("aria-description")||t.hasAttribute("aria-details");if("true"===(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||("presentation"===s||"none"===s)&&!u)return{name:null,description:null,extendedDescriptions:[]};let l=null,c=!1;var f;l=Ye(t,"aria-labelledby"),l||(l=(null===(f=t.getAttribute("aria-label"))||void 0===f?void 0:f.trim())||null),l||("img"===i?t.hasAttribute("alt")&&(l=t.getAttribute("alt").trim()||null,l||(c=!0)):"svg"===i&&(l=Je(t,"title")));let p=!1;l||c||!a||(l=a,p=!0),l||"img"!==i||t.hasAttribute("alt")||t.hasAttribute("title")||(l=function(t){const e=t.closest("figure"),r=null==e?void 0:e.querySelector(":scope > figcaption");if(!e||!r)return null;const n=t=>{var e;return null!==(e=null==t?void 0:t.replace(/\s+/g," ").trim())&&void 0!==e?e:""};if(n(e.textContent)!==n(r.textContent))return null;const o=e.querySelectorAll("img, svg, audio, video, object, iframe, embed");for(let e=0;e desc")?d=Je(t,"desc"):p||(d=a),{name:l,description:d,extendedDescriptions:Ge(t,o)}}(n);return{tag:n.tagName.toLowerCase(),html:l?null:n.outerHTML,src:l,resourceHref:null!==(e=null===(r=window.readium)||void 0===r||null===(r=r.link)||void 0===r?void 0:r.href)&&void 0!==e?e:null,frame:{x:u.left,y:u.top,width:u.width,height:u.height},accessibleName:c.name,accessibleDescription:c.description,extendedDescriptions:c.extendedDescriptions,caption:Ze(n),cssSelector:We(n)}}(e.target)));let o=W({x:e.clientX,y:e.clientY}),i={phase:t,defaultPrevented:e.defaultPrevented,pointerId:e.pointerId,pointerType:e.pointerType,x:o.x,y:o.y,buttons:e.buttons,interactiveElement:r,targetElement:n,option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey};null==Vt(e)&&webkit.messageHandlers.pointerEventReceived.postMessage(i)}function cr(t){return t.defaultPrevented||null!=Ue(document.activeElement)}function fr(t){t.stopPropagation(),t.preventDefault()}function pr(t,e){e.repeat||webkit.messageHandlers.keyEventReceived.postMessage({phase:t,code:e.code,key:String.fromCharCode(e.keyCode),option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey})}window.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",or,!1),document.addEventListener("pointerdown",ir,!1),document.addEventListener("pointerup",ar,!1),document.addEventListener("pointermove",sr,!1),document.addEventListener("pointercancel",ur,!1),document.addEventListener("selectionchange",function(){nr=!window.getSelection().isCollapsed})}),window.addEventListener("keydown",t=>{cr(t)||(fr(t),pr("down",t))}),window.addEventListener("keyup",t=>{cr(t)||(fr(t),pr("up",t))}),globalThis.readium={scrollToId:function(t,e){let r=document.getElementById(t);return!!r&&(T(r.getBoundingClientRect(),e),!0)},scrollToPosition:function(t,e,r){t<0||t>1?console.error(`Expected a valid progression in scrollToPosition, got ${t}`):R()?P()?M({left:-document.scrollingElement.scrollWidth*t,animated:r}):M({top:document.scrollingElement.scrollHeight*t,animated:r}):M({left:I(document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1)),animated:r})},scrollToLocator:function(t,e){let r=k(t);return!!r&&function(t,e){return T(t.getBoundingClientRect(),e)}(r,e)},scrollLeft:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX-o,a=r?-(n-o):0;return N(Math.max(i,a),e)},scrollRight:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX+o,a=r?0:n-o;return N(Math.min(i,a),e)},setCSSProperties:function(t){for(const e in t)$(e,t[e])},setProperty:$,removeProperty:F,registerDecorationTemplates:function(t){var e="";for(const n of Object.entries(t)){var r=Bt(n,2);const t=r[0],o=r[1];Wt.set(t,o),o.stylesheet&&(e+=o.stylesheet+"\n")}if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Ut.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=k(e.locator);if(!i)return void _("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),u(a)}function s(t){let e=r.findIndex(e=>e.decoration.id===t);if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function u(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame(function(){null!=o&&document.body.append(o)})),o),i=Wt.get(r.decoration.style);if(!i)return void B(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const s=getComputedStyle(document.body).writingMode,u="vertical-rl"===s||"vertical-lr"===s,l=document.scrollingElement,c=l.scrollLeft,f=l.scrollTop,p=u?window.innerHeight:window.innerWidth,d=u?window.innerWidth:window.innerHeight,h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,y=(u?d:p)/h;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-c+"px":t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-c+l.clientWidth}px`:t.style.left=`${r.left+c}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+c}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void B(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!s.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=U(r.range,t).sort((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left);for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,s),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=s,g(t,b,b,s),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function l(){o&&(o.remove(),o=null)}return{add:a,remove:s,update:function(t){s(t.id),a(t)},clear:function(){l(),r.length=0},items:r,requestLayout:function(){l(),r.forEach(t=>u(t))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+zt++,t),Ut.set(t,e)),e},findFirstVisibleLocator:function(){const t=ze(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:We(t)},text:{highlight:t.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); //# sourceMappingURL=readium-fixed.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js index eb9d1e7eb1..1e0d42eb80 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-reflowable.js @@ -1,2 +1,2 @@ -(()=>{var t={3618(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,u=e[r]|s,l=u|a,c=(u&i)+i^i|u,f=a|~(c|i),p=i&c,d=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(l|(f|=n(o)-s)),a=f&l,t.P[r]=i,t.M[r]=a,d}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var u=new Uint32Array(a+1),l=new Map,c=[],f=0;f<256;f++)c.push(u);for(var p=0;p=e.length||e.charCodeAt(m)===d&&(h[y]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]0?r:0,!0)},o?o(t.exports,"apply",{value:a}):t.exports.apply=a},5298(t,e,r){"use strict";var n=r(703),o=r(5312),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},7517(t,e,r){"use strict";var n=r(9173),o=r(7388),i=r(7379),a=r(3492);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!a&&a(t,e);if(n)n(t,e,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8189(t,e,r){"use strict";var n=r(1748),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(7517),u=r(708)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&arguments[1]||"Cannot call method on "+t);return t}},9253(t){"use strict";t.exports=Object},4938(t){"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},3148(t,e,r){"use strict";var n=r(703)("%Object.defineProperty%",!0),o=r(6618)(),i=r(9939),a=r(7379),s=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==r&&"boolean"!=typeof r||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!r&&i(t,s)||(n?n(t,s,{configurable:!o,enumerable:!1,value:e,writable:!1}):t[s]=e)}},2632(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(2719),i=r(5833),a=r(1718),s=r(7379),u=r(5465),l=r(7377);t.exports=function(t){if(u(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=l(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(u(c))return c;throw new s("unable to convert exotic object to primitive")}return"default"===r&&(i(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new s("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new s('hint must be "string" or "number"');var r,n,i,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(i=0;i1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return W(t,V,function(t,e,r,o){n[n.length]=r?W(o,H,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=G("%"+n+"%",e),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],D(r,L([0,1],u)));for(var f=1,p=!0;f=r.length){var g=x(a,d);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[d]}else p=B(a,d),a=a[d];p&&!s&&(I[i]=a)}}return a}},8819(t,e,r){"use strict";var n=r(9253);t.exports=n.getPrototypeOf||null},2517(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1611(t,e,r){"use strict";var n=r(2517),o=r(8819),i=r(1449);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:i?function(t){return i(t)}:null},4656(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},3492(t,e,r){"use strict";var n=r(4656);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},708(t,e,r){"use strict";var n=r(9173),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},6052(t){"use strict";var e={__proto__:null,foo:{}},r={__proto__:e}.foo===e.foo&&!(e instanceof Object);t.exports=function(){return r}},7657(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(8123);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},8123(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6618(t,e,r){"use strict";var n=r(8123);t.exports=function(){return n()&&!!Symbol.toStringTag}},9939(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3583);t.exports=i.call(n,o)},6561(t,e,r){"use strict";var n=r(9939),o=r(6746)(),i=r(7379),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},2719(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((c||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},5833(t,e,r){"use strict";var n=r(5298),o=n("Date.prototype.getDay"),i=n("Object.prototype.toString"),a=r(6618)();t.exports=function(t){return"object"==typeof t&&null!==t&&(a?function(t){try{return o(t),!0}catch(t){return!1}}(t):"[object Date]"===i(t))}},4587(t,e,r){"use strict";var n,o=r(5298),i=r(6618)(),a=r(9939),s=r(3492);if(i){var u=o("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(t){if(!t||"object"!=typeof t)return!1;var e=s(t,"lastIndex");if(!e||!a(e,"value"))return!1;try{u(t,f)}catch(t){return t===l}}}else{var p=o("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===p(t)}}t.exports=n},1718(t,e,r){"use strict";var n=r(5298),o=n("Object.prototype.toString"),i=r(7657)(),a=r(5537);if(i){var s=n("Symbol.prototype.toString"),u=a(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==o(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u(s(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},9895(t){"use strict";t.exports=Math.abs},6241(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991},2153(t){"use strict";t.exports=Math.floor},1084(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1029(t,e,r){"use strict";var n=r(9895),o=r(2153),i=r(5518),a=r(1084);t.exports=function(t){if("number"!=typeof t||i(t)||!a(t))return!1;var e=n(t);return o(e)===e}},5518(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},457(t){"use strict";t.exports=Math.max},1179(t){"use strict";t.exports=Math.min},5985(t){"use strict";t.exports=Math.pow},8639(t){"use strict";t.exports=Math.round},5738(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},4922(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var $=r(2179),F=$.custom,_=H(F)?F:null,B={__proto__:null,double:'"',single:"'"},L={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function D(t,e,r){var n=r.quoteStyle||e,o=B[n];return o+t+o}function W(t){return v.call(String(t),/"/g,""")}function U(t){return!N||!("object"==typeof t&&(N in t||void 0!==t[N]))}function z(t){return"[object Array]"===X(t)&&U(t)}function V(t){return"[object RegExp]"===X(t)&&U(t)}function H(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&!q(B,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Y(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return y?k(e,w):w}if("bigint"==typeof e){var S=String(e)+"n";return y?k(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var P,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(K(o,e)>=0)return"[Circular]";function L(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!V(e)){var G=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),J=rt(e,L);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+A.call(J,", ")+" }":"")}if(H(e)){var nt=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?nt:Z(nt)}if((P=e)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ot="<"+x.call(String(e.nodeName)),it=e.attributes||[],at=0;at"}if(z(e)){if(0===e.length)return"[]";var st=rt(e,L);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+et(st,F)+"]":"[ "+A.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&U(t)}(e)){var ut=rt(e,L);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+L(e.cause),ut),", ")+" }"}if("object"==typeof e&&u){if(_&&"function"==typeof e[_]&&$)return $(e,{depth:j-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var lt=[];return a&&a.call(e,function(t,r){lt.push(L(r,e,!0)+" => "+L(t,e))}),tt("Map",i.call(e),lt,F)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(L(t,e))}),tt("Set",l.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return"[object Number]"===X(t)&&U(t)}(e))return Z(L(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return Z(L(R.call(e)));if(function(t){return"[object Boolean]"===X(t)&&U(t)}(e))return Z(h.call(e));if(function(t){return"[object String]"===X(t)&&U(t)}(e))return Z(L(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof globalThis&&e===globalThis)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&U(t)}(e)&&!V(e)){var ft=rt(e,L),pt=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,dt=e instanceof Object?"":"null prototype",ht=!pt&&N&&Object(e)===e&&N in e?b.call(X(e),8,-1):dt?"Object":"",yt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ht||dt?"["+A.call(E.call([],ht||[],dt||[]),": ")+"] ":"");return 0===ft.length?yt+"{}":F?yt+"{"+et(ft,F)+"}":yt+"{ "+A.call(ft,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Y(b.call(t,0,e.maxStringLength),e)+n}var o=L[e.quoteStyle||"single"];return o.lastIndex=0,D(v.call(v.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=z(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var y=0;y0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},3743(t,e,r){"use strict";var n=r(7843),o=r(7379),i=Object;t.exports=n(function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1721(t,e,r){"use strict";var n=r(8189),o=r(7965),i=r(3743),a=r(4510),s=r(3980),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},4510(t,e,r){"use strict";var n=r(3743),o=r(8189).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),t.get.call(r),"dy"===e)return t.get}}return n}},3980(t,e,r){"use strict";var n=r(8189).supportsDescriptors,o=r(4510),i=r(3492),a=Object.defineProperty,s=r(9183),u=r(1611),l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(l),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},5537(t,e,r){"use strict";var n=r(5298),o=r(4587),i=n("RegExp.prototype.exec"),a=r(7379);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2644(t,e,r){"use strict";var n=r(703),o=r(7517),i=r(708)(),a=r(3492),s=r(7379),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in t&&a){var c=a(t,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},7843(t,e,r){"use strict";var n=r(7517),o=r(708)(),i=r(3749).functionsHaveConfigurableNames(),a=r(7379);t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},7797(t,e,r){"use strict";var n=r(4922),o=r(7379),i=function(t,e,r){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,r||(n.next=t.next,t.next=n),n};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var r=function(t,e){if(t)return i(t,e,!0)}(t,e);return r&&t&&!t.next&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var r=i(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!i(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var n=i(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},1085(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(7379),s=n("%Map%",!0),u=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);t.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+i(t))},delete:function(e){if(t){var r=f(t,e);return 0===p(t)&&(t=void 0),r}return!1},get:function(e){if(t)return u(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,r){t||(t=new s),l(t,e,r)}};return e}},2468(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(1085),s=r(7379),u=n("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);t.exports=u?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(r){if(u&&r&&("object"==typeof r||"function"==typeof r)){if(t)return p(t,r)}else if(a&&e)return e.delete(r);return!1},get:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?f(t,r):!!e&&e.has(r)},set:function(r,n){u&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new u),c(t,r,n)):a&&(e||(e=a()),e.set(r,n))}};return r}:a},6746(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(7797),a=r(1085),s=r(2468)||a||i;t.exports=function(){var t,e={assert:function(t){if(!e.has(t)){var r=t&&Object(t)===t?"the given object key":o(t);throw new n("Side channel does not contain "+r)}},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=s()),t.set(e,r)}};return e}},4290(t,e,r){"use strict";var n=r(6520),o=r(7630),i=r(4111),a=r(333),s=r(1076),u=r(5363),l=r(5298),c=r(7657)(),f=r(1721),p=r(703),d=r(7379),h=p("%RegExp%"),y=l("String.prototype.indexOf"),g=r(2570),m=function(t){var e=g();if(c&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===h.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),y(s(r),"g")<0)throw new d("matchAll requires a global regular expression")}var i=m(t);if(void 0!==i)return n(i,t,[e])}var l=s(e),c=new h(t,"g");return n(m(c),c,[l])}},6410(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(4290),a=r(4683),s=r(3197),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2570(t,e,r){"use strict";var n=r(7657)(),o=r(1930);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},4683(t,e,r){"use strict";var n=r(4290);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},1930(t,e,r){"use strict";var n=r(3990),o=r(7630),i=r(5234),a=r(518),s=r(6117),u=r(1076),l=r(192),c=r(1721),f=r(7843),p=r(5298),d=r(703),h=r(7379),y=p("String.prototype.indexOf"),g=d("%RegExp%"),m="flags"in g.prototype,b=f(function(t){var e=this;if("Object"!==l(e))throw new h('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(c(e));return{flags:r,matcher:new t(m&&"string"==typeof r?e:t===g?e.source:e,r)}}(a(e,g),e),p=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var v=y(p,"g")>-1,w=y(p,"u")>-1;return n(d,r,v,w)},"[Symbol.matchAll]",!0);t.exports=b},3197(t,e,r){"use strict";var n=r(8189),o=r(7657)(),i=r(3492),a=r(4683),s=r(2570),u=Object.defineProperty;t.exports=function(){var t=a();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&i){var r=i(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var l=s(),c={};c[e]=l;var f={};f[e]=function(){return RegExp.prototype[e]!==l},n(RegExp.prototype,c,f)}return t}},3952(t,e,r){"use strict";var n=r(5363),o=r(2501),i=r(5298),a=r(5537),s=i("String.prototype.replace"),u=i("String.prototype.charAt"),l=i("String.prototype.slice"),c=/^\s$/.test("᠎"),f=c?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,p=a(c?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);t.exports=function(){for(var t=s(o(n(this)),f,""),e=t.length;e>0&&p(u(t,e-1));)e-=1;return l(t,0,e)}},7724(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(5363),a=r(3952),s=r(8821),u=r(5795),l=n(s()),c=function(t){return i(t),l(t)};o(c,{getPolyfill:s,implementation:a,shim:u}),t.exports=c},8821(t,e,r){"use strict";var n=r(3952);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},5795(t,e,r){"use strict";var n=r(708)(),o=r(7517),i=r(8821);t.exports=function(){var t=i();return String.prototype.trim!==t&&(n?o(String.prototype,"trim",t,!0):o(String.prototype,"trim",t)),t}},2179(){},6917(t,e,r){"use strict";var n=r(6562),o=r(7379),i=r(1029),a=r(6241);t.exports=function(t,e,r){if("string"!=typeof t)throw new o("Assertion failed: `S` must be a String");if(!i(e)||e<0||e>a)throw new o("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("boolean"!=typeof r)throw new o("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+n(t,e)["[[CodeUnitCount]]"]:e+1}},6520(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(7379),a=r(3443),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6562(t,e,r){"use strict";var n=r(7379),o=r(5298),i=r(3283),a=r(8537),s=r(1300),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("string"!=typeof t)throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),c=u(t,e),f=i(o),p=a(o);if(!f&&!p)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(p||e+1===r)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":s(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},44(t,e,r){"use strict";var n=r(7379);t.exports=function(t,e){if("boolean"!=typeof e)throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},3990(t,e,r){"use strict";var n=r(703),o=r(7657)(),i=r(7379),a=r(4938),s=n("%IteratorPrototype%",!0),u=r(6917),l=r(44),c=r(355),f=r(7630),p=r(2021),d=r(3936),h=r(5234),y=r(6117),g=r(1076),m=r(6561),b=r(3148),v=function(t,e,r,n){if("string"!=typeof e)throw new i("`S` must be a string");if("boolean"!=typeof r)throw new i("`global` must be a boolean");if("boolean"!=typeof n)throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};s&&(v.prototype=p(s)),c(v.prototype,"next",function(){var t=this;if(!a(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return l(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return m.set(t,"[[Done]]",!0),l(void 0,!0);if(n){if(""===g(f(s,"0"))){var c=y(f(e,"lastIndex")),p=u(r,c,o);h(e,"lastIndex",p,!0)}return l(s,!1)}return m.set(t,"[[Done]]",!0),l(s,!1)},!1),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,function(){return this},!1),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},355(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(9271),a=r(1181),s=r(5855);t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `homeObject` is not an Object");if(!s(e))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if("function"!=typeof r)throw new n("Assertion failed: `closure` is not a function");if("boolean"!=typeof u)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(t))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(t,e,{"[[Value]]":r,"[[Writable]]":!0,"[[Enumerable]]":u,"[[Configurable]]":!0})}},9271(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(6843),a=r(9999),s=r(5848),u=r(7817),l=r(5855),c=r(925),f=r(6309);t.exports=function(t,e,r){if(!o(t))throw new n("Assertion failed: Type(O) is not Object");if(!l(e))throw new n("Assertion failed: P is not a Property Key");var p=i(r)?r:f(r);if(!i(p))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return a(u,c,s,t,e,p)}},5848(t,e,r){"use strict";var n=r(7379),o=r(6843),i=r(3003);t.exports=function(t){if(void 0!==t&&!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(t)}},7630(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855),a=r(4938);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},4111(t,e,r){"use strict";var n=r(7379),o=r(7818),i=r(1816),a=r(5855),s=r(4922);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},7818(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},3443(t,e,r){"use strict";t.exports=r(8622)},1816(t,e,r){"use strict";t.exports=r(2719)},3478(t,e,r){"use strict";var n=r(4334)("%Reflect.construct%",!0),o=r(9271);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},7817(t,e,r){"use strict";var n=r(7379),o=r(9939),i=r(6843);t.exports=function(t){if(void 0===t)return!1;if(!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!o(t,"[[Value]]")&&!o(t,"[[Writable]]"))}},1181(t,e,r){"use strict";var n=r(703),o=n("%Object.preventExtensions%",!0),i=n("%Object.isExtensible%",!0),a=r(9258);t.exports=o?function(t){return!a(t)&&i(t)}:function(t){return!a(t)}},333(t,e,r){"use strict";var n=r(703)("%Symbol.match%",!0),o=r(4587),i=r(4938),a=r(4801);t.exports=function(t){if(!i(t))return!1;if(n){var e=t[n];if(void 0!==e)return a(e)}return o(t)}},2021(t,e,r){"use strict";var n=r(703)("%Object.create%",!0),o=r(7379),i=r(7388),a=r(4938),s=r(3443),u=r(5713),l=r(6561),c=r(6052)();t.exports=function(t){if(null!==t&&!a(t))throw new o("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(c)e={__proto__:t};else if(n)e=n(t);else{if(null===t)throw new i("native Object.create support is required to create null objects");var f=function(){};f.prototype=t,e=new f}return r.length>0&&u(r,function(t){l.set(e,t,void 0)}),e}},3936(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5298)("RegExp.prototype.exec"),a=r(6520),s=r(7630),u=r(1816);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: `R` must be an Object");if("string"!=typeof e)throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(u(r)){var l=a(r,t,[e]);if(null===l||o(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},925(t,e,r){"use strict";var n=r(5518);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},5234(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5855),a=r(925),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof u)throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!a(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||a(t[e],r)}catch(t){return!1}}},518(t,e,r){"use strict";var n=r(703)("%Symbol.species%",!0),o=r(7379),i=r(4938),a=r(3478);t.exports=function(t,e){if(!i(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if(!i(r))throw new o("O.constructor is not an Object");var s=n?r[n]:void 0;if(null==s)return e;if(a(s))return s;throw new o("no constructor found")}},9893(t,e,r){"use strict";var n=r(703),o=n("%RegExp%"),i=r(7379),a=n("%parseInt%"),s=r(5298),u=r(5537),l=s("String.prototype.slice"),c=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),h=r(7724);t.exports=function t(e){if("string"!=typeof e)throw new i("Assertion failed: `argument` is not a String");if(c(e))return+a(l(e,2),2);if(f(e))return+a(l(e,2),8);if(d(e)||p(e))return NaN;var r=h(e);return r!==e?t(r):+e}},4801(t){"use strict";t.exports=function(t){return!!t}},7210(t,e,r){"use strict";var n=r(3312),o=r(6354),i=r(5518),a=r(1084);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},6117(t,e,r){"use strict";var n=r(6241),o=r(7210);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},3312(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%Number%"),a=r(9258),s=r(3760),u=r(9893);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):+e}},3760(t,e,r){"use strict";var n=r(2632);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},6309(t,e,r){"use strict";var n=r(9939),o=r(7379),i=r(4938),a=r(1816),s=r(4801);t.exports=function(t){if(!i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!a(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},1076(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},192(t,e,r){"use strict";var n=r(3225);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1300(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%String.fromCharCode%"),a=r(3283),s=r(8537);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},7060(t,e,r){"use strict";var n=r(2153);t.exports=function(t){return"bigint"==typeof t?t:n(t)}},6354(t,e,r){"use strict";var n=r(7060),o=r(7379);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new o("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2501(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},3225(t,e,r){"use strict";var n=r(4938);t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":n(t)?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},4334(t,e,r){"use strict";t.exports=r(703)},9999(t,e,r){"use strict";var n=r(708),o=r(9173),i=n.hasArrayLengthDefineBug(),a=i&&r(8622),s=r(5298)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,u,l){if(!o){if(!t(l))return!1;if(!l["[[Configurable]]"]||!l["[[Writable]]"])return!1;if(u in n&&s(n,u)!==!!l["[[Enumerable]]"])return!1;var c=l["[[Value]]"];return n[u]=c,e(n[u],c)}return i&&"length"===u&&"[[Value]]"in l&&a(n)&&n.length!==l["[[Value]]"]?(n.length=l["[[Value]]"],n.length===l["[[Value]]"]):(o(n,u,r(l)),!0)}},8622(t,e,r){"use strict";var n=r(703)("%Array%"),o=!n.isArray&&r(5298)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},5713(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},9258(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},5855(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},8537(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},6843(t,e,r){"use strict";var n=r(7379),o=r(9939),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(o(t,e)&&!i[e])return!1;var r=o(t,"[[Value]]")||o(t,"[[Writable]]"),a=o(t,"[[Get]]")||o(t,"[[Set]]");if(r&&a)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(3618);function e(e,r,n){let o=0;const i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.A)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){const e=document.createElement("div");return e.appendChild(t.cloneContents()),function(t){var e;for(const e of Array.from(t.querySelectorAll("br")))e.replaceWith(document.createTextNode(" "));return null!==(e=t.textContent)&&void 0!==e?e:""}(e)}function i(t,e){let r=0;for(const n of t){if(!(n{if(i=e===a.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===a.Forwards?0:t.length;u=s(t,r,e)}};for(;i&&-1===u&&i!==o;)l();if(i&&u>=0)return{node:i,offset:u};throw new RangeError("No text nodes with non-whitespace text found in range")}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1?e-1:0),n=1;no?(a.push({node:s,offset:o-l}),o=r.shift()):(u=i.nextNode(),l+=s.data.length);for(;void 0!==o&&s&&l===o;)a.push({node:s,offset:s.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}let d=function(t){return t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS",t}({});class h{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=f(e),e=e.parentElement;return new h(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return p(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return h.fromPoint(t,e);case Node.ELEMENT_NODE:return new h(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=f(t)+e;return new h(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const t=u(e,a.Forwards),r=t.node,n=t.offset;r&&n>=0&&e.setStart(r,n)}if(!n){const t=u(e,a.Backwards),r=t.node,n=t.offset;r&&n>0&&e.setEnd(r,n)}return e}(y.fromRange(t).toRange())}}class g{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=y.fromRange(e).relativeTo(t);return new g(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new g(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return y.fromOffsets(this.root,this.start,this.end).toRange()}}class m{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){var r;const n=null!==(r=t.textContent)&&void 0!==r?r:"",i=y.fromRange(e).relativeTo(t),a=i.start.offset,s=i.end.offset,u=o(e),l=o(y.fromOffsets(t,Math.max(0,a-32),a).toRange()),c=o(y.fromOffsets(t,s,Math.min(n.length,s+32)).toRange());return new m(t,u,{prefix:l,suffix:c})}static fromSelector(t,e){const r=e.prefix,n=e.suffix;return new m(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t){let e="";const r=[],n=t=>{var o;if(t.nodeType!==Node.TEXT_NODE){if(t.nodeType===Node.ELEMENT_NODE){if("BR"===t.tagName)return r.push(e.length),void(e+=" ");for(const e of Array.from(t.childNodes))n(e)}}else e+=null!==(o=t.textContent)&&void 0!==o?o:""};return n(t),{text:e,brPositionsInText:r}}(this.root),o=r.text,a=r.brPositionsInText,s=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const s=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,s=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let u=1;return"number"==typeof o.hint&&(u=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*s+2*u)/92},u=a.map(t=>({start:t.start,end:t.end,score:s(t)}));return u.sort((t,e)=>e.score-t.score),u[0]}(o,this.exact,{...this.context,hint:t.hint});if(!s)throw new Error("Quote not found");return new g(this.root,i(a,s.start),i(a,s.end))}}var b,v=r(6410);function w(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;x(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return x(">>> createOrderedRange RANGE REVERSE OK."),o;x(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void x("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=y.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let s=n.slice(Math.max(0,i-200),i),u=s.search(/\P{L}\p{L}/gu);-1!==u&&(s=s.slice(u+1));let l=n.slice(a,Math.min(n.length,a+200)),c=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==c&&c.index>1&&(l=l.slice(0,c.index+1)),{highlight:e,before:s,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return D(t.getRangeAt(0).getBoundingClientRect())}catch(t){return L(t),null}}()}:null}function x(){_.apply(null,arguments)}r.n(v)().shim(),window.addEventListener("error",function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})},!1),window.addEventListener("load",function(){var t;new ResizeObserver(()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(function(){O=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(R()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!R()){var t=I(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),j()})}).observe(document.body)},!1);var S,E,A=!1,O=0;function j(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(R()&&!P()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;b={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;C()&&(e=Math.abs(e)),b={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(A||window.requestAnimationFrame(function(){var t;t=b,webkit.messageHandlers.progressionChanged.postMessage(t),A=!1}),A=!0)}function R(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function P(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function C(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function T(t,e){return R()?M({top:t.top+window.scrollY,animated:e}):M({left:I(t.left+window.scrollX),animated:e}),!0}function N(t,e){var r=window.scrollX,n=window.innerWidth,o=Math.abs(r-t)/n>.01;return o&&M({left:t,animated:e}),o}function M(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.left,r=t.top,n=t.animated;document.scrollingElement.scrollTo({left:e,top:r,behavior:n?"smooth":"instant"})}function I(t){const e=t+(C()?-1:1);return e-e%O}function k(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new m(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments){let e;try{e=decodeURIComponent(t)}catch(t){continue}if(r=document.getElementById(e))break}if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){L(t)}return null}function $(t,e){null===e?F(t):document.documentElement.style.setProperty(t,e,"important")}function F(t){document.documentElement.style.removeProperty(t)}function _(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function B(t){L(new Error(t))}function L(t){webkit.messageHandlers.logError.postMessage({message:t.message})}function D(t){let e=W({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function W(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function U(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=q(function(t){const e=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const n of t)if(r!==n&&e.has(n)&&H(n,r,1)){J(),e.delete(r);break}}else J(),e.delete(r);return Array.from(e)}(z(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){J();break}J(),o.splice(t,1)}}return J((n.length,o.length)),o}function z(t,e,r){for(let n=0;nt!==i&&t!==a),o=V(i,a);return n.push(o),z(n,e,r)}}return t}function V(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function H(t,e,r){return G(t,e.left,e.top,r)&&G(t,e.right,e.top,r)&&G(t,e.left,e.bottom,r)&&G(t,e.right,e.bottom,r)}function G(t,e,r,n){return(t.lefte||Y(t.right,e,n))&&(t.topr||Y(t.bottom,r,n))}function q(t){for(let e=0;et!==e);return Array.prototype.push.apply(a,r),q(a)}}else J()}return t}function X(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function K(t,e,r){return(t.left=0&&Y(t.left,e.right,r))&&(e.left=0&&Y(e.left,t.right,r))&&(t.top=0&&Y(t.top,e.bottom,r))&&(e.top=0&&Y(e.top,t.bottom,r))}function Y(t,e,r){return Math.abs(t-e)<=r}function J(){}window.addEventListener("scroll",j),document.addEventListener("selectionchange",(S=function(){webkit.messageHandlers.selectionChanged.postMessage(w())},function(){var t=this,e=arguments;clearTimeout(E),E=setTimeout(function(){S.apply(t,e),E=null},50)}));var Z,Q=[],tt=function(){return Q.some(function(t){return t.activeTargets.length>0})},et="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Z||(Z={}));var rt,nt=function(t){return Object.freeze(t)},ot=function(t,e){this.inlineSize=t,this.blockSize=e,nt(this)},it=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,nt(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),at=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(at(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},ut=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},lt="undefined"!=typeof window?window:{},ct=new WeakMap,ft=/auto|scroll/,pt=/^tb|vertical/,dt=/msie|trident/i.test(lt.navigator&<.navigator.userAgent),ht=function(t){return parseFloat(t||"0")},yt=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new ot((r?e:t)||0,(r?t:e)||0)},gt=nt({devicePixelContentBoxSize:yt(),borderBoxSize:yt(),contentBoxSize:yt(),contentRect:new it(0,0,0,0)}),mt=function(t,e){if(void 0===e&&(e=!1),ct.has(t)&&!e)return ct.get(t);if(st(t))return ct.set(t,gt),gt;var r=getComputedStyle(t),n=at(t)&&t.ownerSVGElement&&t.getBBox(),o=!dt&&"border-box"===r.boxSizing,i=pt.test(r.writingMode||""),a=!n&&ft.test(r.overflowY||""),s=!n&&ft.test(r.overflowX||""),u=n?0:ht(r.paddingTop),l=n?0:ht(r.paddingRight),c=n?0:ht(r.paddingBottom),f=n?0:ht(r.paddingLeft),p=n?0:ht(r.borderTopWidth),d=n?0:ht(r.borderRightWidth),h=n?0:ht(r.borderBottomWidth),y=f+l,g=u+c,m=(n?0:ht(r.borderLeftWidth))+d,b=p+h,v=s?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?y+m:0,S=o?g+b:0,E=n?n.width:ht(r.width)-x-w,A=n?n.height:ht(r.height)-S-v,O=E+y+w+m,j=A+g+v+b,R=nt({devicePixelContentBoxSize:yt(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:yt(O,j,i),contentBoxSize:yt(E,A,i),contentRect:new it(f,u,E,A)});return ct.set(t,R),R},bt=function(t,e,r){var n=mt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case Z.DEVICE_PIXEL_CONTENT_BOX:return a;case Z.BORDER_BOX:return o;default:return i}},vt=function(t){var e=mt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=nt([e.borderBoxSize]),this.contentBoxSize=nt([e.contentBoxSize]),this.devicePixelContentBoxSize=nt([e.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},xt=function(){var t=1/0,e=[];Q.forEach(function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach(function(e){var r=new vt(e.target),o=wt(e.target);n.push(r),e.lastReportedSize=bt(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))})})},Et=[],At=0,Ot={attributes:!0,characterData:!0,childList:!0,subtree:!0},jt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,Ct=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var r,n=Rt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(St(e);tt();)e=xt(),St(e);return Q.some(function(t){return t.skippedTargets.length>0})&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:et}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=et),window.dispatchEvent(t)),e>0}()}finally{if(Pt=!1,t=n-Rt(),!At)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!rt){var e=0,r=document.createTextNode("");new MutationObserver(function(){return Et.splice(0).forEach(function(t){return t()})}).observe(r,{characterData:!0}),rt=function(){r.textContent="".concat(e?e--:e++)}}Et.push(t),rt()}(function(){requestAnimationFrame(r)})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Ot)};document.body?e():lt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jt.forEach(function(e){return lt.addEventListener(e,t.listener,!0)}))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),jt.forEach(function(e){return lt.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},t}(),Tt=new Ct,Nt=function(t){!At&&t>0&&Tt.start(),!(At+=t)&&Tt.stop()},Mt=function(){function t(t,e){this.target=t,this.observedBox=e||Z.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=bt(this.target,this.observedBox,!0);return t=this.target,at(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),It=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},kt=new WeakMap,$t=function(t,e){for(var r=0;r=0&&(o&&Q.splice(Q.indexOf(r),1),r.observationTargets.splice(n,1),Nt(-1))},t.disconnect=function(t){var e=this,r=kt.get(t);r.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),_t=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ft.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.unobserve(this,t)},t.prototype.disconnect=function(){Ft.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}(t,e)||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 Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Ut.forEach(function(t){t.requestLayout()}))}).observe(t)},!1);const Gt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function qt(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}const Xt={selectors:[Gt.id,Gt.class,Gt.tag,Gt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1,ignoreGeneratedClassNames:!1};function Kt(t){return!!t}function Yt(t){return t instanceof RegExp}function Jt(t){return["string","function"].includes(typeof t)||Yt(t)}function Zt(t){return Array.isArray(t)?t.filter(Jt):[]}function Qt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return null!=t&&"object"==typeof t&&"nodeType"in t&&"number"==typeof t.nodeType}(t)&&e.includes(t.nodeType)}function te(t,e){if(Qt(t))return t.contains(e)||qt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const r=e.getRootNode({composed:!1});return Qt(r)?(r!==document&&qt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):se(e)}function ee(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function re(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce((t,e)=>t.filter(t=>e.includes(t)),e)}function ne(t){const e=t.map(t=>{if(Yt(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(qt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return qt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(e=>e(t))}function oe(t,e,r){const n=Array.from(te(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every(t=>n.includes(t))}function ie(t,e){e=null!=e?e:se(t);const r=[];let n=t;for(;n&&n!==e;)Ht(n)&&r.push(n),n=n.parentNode;return r}function ae(t,e){return re(t.map(t=>ie(t,e)))}function se(t){return t.ownerDocument.querySelector(":root")}const ue=new RegExp(["^$","\\s"].join("|")),le=new RegExp(["^$"].join("|")),ce=[Gt.nthoftype,Gt.tag,Gt.id,Gt.class,Gt.attribute,Gt.nthchild],fe=ne(["class","id","ng-*"]);function pe({name:t}){return`[${t}]`}function de({name:t,value:e}){return`[${t}='${e}']`}function he({nodeName:t,nodeValue:e}){return{name:Ce(t),value:Ce(null!=e?e:void 0)}}function ye(t,e){const r=Array.from(t.attributes).filter(e=>function({nodeName:t,nodeValue:e},r){const n=r.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||fe(t))}(e,t)).map(he);return[...r.map(pe),...r.map(de)]}const ge=/^[a-z_-]{3,}$/i,me=/[bcdfghjklmnpqrstvwxyz]{4,}/i;function be(t,e){var r;const n=(null!==(r=t.getAttribute("class"))&&void 0!==r?r:"").trim().split(/\s+/).filter(t=>!le.test(t));let o=n;if(null==e?void 0:e.ignoreGeneratedClassNames){const t=ne(e.whitelist);o=n.filter(e=>{const r=`.${Ce(e)}`;return!!t(r)||function(t){if(!ge.test(t))return!1;if(t.includes("_")&&!t.includes("__"))return!1;if(/^(css|sc|jsx|emotion|makeStyles|MuiButton|MuiBox)-/i.test(t))return!1;const e=t.split(/--|__|[-]|(?<=[a-z])(?=[A-Z])/).filter(t=>t.length>0);if(0===e.length)return!1;if(1===e.length&&e[0].length<4)return!1;for(const t of e){if(t.length<=2)return!1;if(me.test(t))return!1}return!0}(e)})}return o.map(t=>`.${Ce(t)}`)}function ve(t,e){var r;const n=null!==(r=t.getAttribute("id"))&&void 0!==r?r:"",o=`#${Ce(n)}`,i=t.getRootNode({composed:!1});return!ue.test(n)&&oe([t],o,i)?[o]:[]}function we(t,e){const r=t.parentNode,n=r&&"children"in r?r.children:null;if(n)for(let e=0;exe(t)),[].concat(...n)))];var n;return 0===r.length||r.length>1?[]:[r[0]]}function Ee(t,e){const r=Se([t])[0],n=t.parentNode,o=n&&"children"in n?n:null;if(o){const e=Array.from(o.children).filter(t=>t.tagName.toLowerCase()===r),n=e.indexOf(t);if(n>-1)return[`${r}:nth-of-type(${String(n+1)})`]}return[]}function*Ae(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=je(1);for(;n.length<=t.length&&rt[e]);yield e,n=Oe(n,t.length-1)}}function Oe(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return je(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?je(r+1):n}function je(t=1){return Array.from(Array(t).keys())}const Re=":".charCodeAt(0).toString(16).toUpperCase(),Pe=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Ce(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map(t=>":"===t?`\\${Re} `:Pe.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\")).join("")}(t)}const Te={tag:Se,id:function(t,e){return 0===t.length||t.length>1?[]:ve(t[0])},class:function(t,e){return re(t.map(t=>be(t,e)))},attribute:function(t,e){return re(t.map(t=>ye(t)))},nthchild:function(t,e){return re(t.map(t=>we(t)))},nthoftype:function(t,e){return re(t.map(t=>Ee(t)))}},Ne={tag:xe,id:ve,class:be,attribute:ye,nthchild:we,nthoftype:Ee};function Me(t){return t.includes(Gt.tag)||t.includes(Gt.nthoftype)?[...t]:[...t,Gt.tag]}function*Ie(t,e){const r={};for(const n of t){const t=e[n];t&&t.length>0&&(r[n]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const r=[{index:e.length-1,partial:{}}];for(;r.length>0;){const t=r.pop();if(!t)break;const{index:n,partial:o}=t;if(n<0){yield o;continue}const[i,a]=e[n];for(let t=a.length-1;t>=0;t--)r.push({index:n-1,partial:Object.assign(Object.assign({},o),{[i]:a[t]})})}}(r))yield ke(t)}function ke(t={}){const e=[...ce];return t[Gt.tag]&&t[Gt.nthoftype]&&e.splice(e.indexOf(Gt.tag),1),e.map(e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n}).join("")}function $e(t,e){return[...t.map(t=>e+" "+t),...t.map(t=>e+" > "+t)]}function*Fe(t,e,r="",n){const o=function*(t,e){const r=new Set,n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=ne(r),s=ne(n);return function(t){const{selectors:e,includeTag:r}=t,n=[...e];return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce((r,n)=>{const u=function(t,e,r){return(0,Te[e])(t,r)}(t,n,e),l=function(t=[],e,r){return t.filter(t=>r(t)||!e(t))}(u,a,s),c=function(t=[],e){return t.sort((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0})}(l,s);return r[n]=o?Array.from(Ae(c,{maxResults:i})):c.map(t=>[t]),r},{})}(t,e);for(const t of function*(t,e){for(const r of function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Ae(t,{maxResults:e}))}(e,{maxResults:o}):e.map(t=>[t]);return n?i.map(Me):i}(e))yield*Ie(r,t)}(n,e))r.has(t)||(r.add(t),yield t)}(t,n);for(const n of function*(t,e){if(""===e)yield*t;else for(const r of t)yield*$e([r],e)}(o,r))oe(t,n,e)&&(yield n)}function*_e(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...ae(t,e).map(t=>[t])];for(const t of o)for(const o of Fe(t,e,r,n))yield{foundElements:t,selector:o}}function Be(t){return{value:t,include:!1}}function Le({selectors:t,operator:e}){let r=[...ce];t[Gt.tag]&&t[Gt.nthoftype]&&(r=r.filter(t=>t!==Gt.tag));let n="";return r.forEach(e=>{var r;(null!==(r=t[e])&&void 0!==r?r:[]).forEach(({value:t,include:e})=>{e&&(n+=t)})}),e+n}function De(t,e){return t.map(t=>function(t,e){const r=ie(t,e).reverse(),n=e instanceof ShadowRoot,o=r.map((t,e)=>{var r;const o=function(t,e,r=""){const n={};return e.forEach(e=>{Reflect.set(n,e,function(t,e){return Ne[e](t,void 0)}(t,e).map(Be))}),{element:t,operator:r,selectors:n}}(t,[Gt.nthchild],n&&0===e?"":" > ");return(null!==(r=o.selectors.nthchild)&&void 0!==r?r:[]).forEach(t=>{t.include=!0}),o});return[n?"":e?":scope":":root",...o.map(Le)].join("")}(t,e)).join(", ")}function We(t,e={}){const r=function*(t,e={}){var r;const n=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Ht);return[...new Set(e)]}(t),o=function(t,e={}){const r=Object.assign(Object.assign({},Xt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter(t=>{return e=Gt,r=t,Object.values(e).includes(r);var e,r}):[]),whitelist:Zt(r.whitelist),blacklist:Zt(r.blacklist),root:te(r.root,t),combineWithinSelector:Kt(r.combineWithinSelector),combineBetweenSelectors:Kt(r.combineBetweenSelectors),includeTag:Kt(r.includeTag),maxCombinations:ee(r.maxCombinations),maxCandidates:ee(r.maxCandidates),useScope:Kt(r.useScope),maxResults:ee(r.maxResults),ignoreGeneratedClassNames:Kt(r.ignoreGeneratedClassNames)};var n}(n[0],e),i=null!==(r=o.root)&&void 0!==r?r:se(n[0]);let a=0;for(const t of function*({elements:t,root:e,rootSelector:r="",options:n}){let o=e,i=r,a=!0;for(;a;){let r=!1;for(const a of _e(t,o,i,n)){const{foundElements:n,selector:s}=a;if(r=!0,!oe(t,s,e)){o=n[0],i=s;break}yield s}r||(a=!1)}}({elements:n,options:o,root:i,rootSelector:""}))if(yield t,a++,a>=o.maxResults)return;if(n.length>1){const{maxResults:t}=e,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);oWe(t,r)).join(", "),a++,a>=o.maxResults)return}const s=void 0!==e.root;yield De(n,o.useScope||s?i:void 0)}(t,Object.assign(Object.assign({},e),{maxResults:1}));return r.next().value}function Ue(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Ue(t.parentElement):null}function ze(t){for(var e=0;e0&&e.top0&&e.left{var n;if(t.nodeType===Node.TEXT_NODE)e.push(null!==(n=t.nodeValue)&&void 0!==n?n:"");else if(t.nodeType===Node.ELEMENT_NODE){const n=t;var o;"img"===n.tagName.toLowerCase()?e.push(null!==(o=n.getAttribute("alt"))&&void 0!==o?o:""):n.childNodes.forEach(r)}};return t.childNodes.forEach(r),e.join(" ").replace(/\s+/g," ").trim()||null}function Ye(t,e){const r=t.getAttribute(e);return r&&r.split(/\s+/).filter(t=>t.length>0).map(e=>t.ownerDocument.getElementById(e)).filter(t=>null!=t).map(t=>{var e,r;return(null===(e=t.getAttribute("aria-label"))||void 0===e?void 0:e.trim())||(null===(r=t.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||""}).filter(t=>t.length>0).join(" ")||null}function Je(t,e){var r;const n=t.querySelector(`:scope > ${e}`);return(null==n||null===(r=n.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||null}function Ze(t){var e,r,n,o,i;const a=null===(e=t.closest("figure"))||void 0===e?void 0:e.querySelector(":scope > figcaption");if(!a||a.contains(t))return null;const s=((null!==(r=t.getAttribute("aria-details"))&&void 0!==r?r:"")+" "+(null!==(n=t.getAttribute("aria-describedby"))&&void 0!==n?n:"")).split(/\s+/).filter(t=>t.length>0);if(s.includes(null!==(o=a.getAttribute("id"))&&void 0!==o?o:""))return null;const u=t=>{var e;return"details"===t.tagName.toLowerCase()||s.includes(null!==(e=t.getAttribute("id"))&&void 0!==e?e:"")},l=a.cloneNode(!0),c=l.querySelectorAll("*");for(let t=0;tt.hasAttribute(e))}let nr=!1;function or(t){if(!getSelection().isCollapsed)return;let e=W({x:t.clientX,y:t.clientY}),r={defaultPrevented:t.defaultPrevented,x:e.x,y:e.y,targetElement:t.target.outerHTML,interactiveElement:Ue(t.target)};(function(t,e){let r=Vt(t);return!!r&&(webkit.messageHandlers.decorationActivated.postMessage({id:r.item.decoration.id,group:r.group,rect:D(r.item.range.getBoundingClientRect()),click:e}),!0)})(t,r)||webkit.messageHandlers.tap.postMessage(r)}function ir(t){lr("down",t)}function ar(t){lr("up",t)}function sr(t){lr("move",t)}function ur(t){lr("cancel",t)}function lr(t,e){var r,n;nr&&(t="cancel"),"move"!=t&&(r=Ue(e.target),n=function(t){if(!t)return t;let e=t.frame,r=W({x:e.x,y:e.y});return{...t,frame:{...e,x:r.x,y:r.y}}}(function(t){var e,r;if(!t||!t.getBoundingClientRect)return null;const n=function(t){const e=["img","svg"];let r=t;for(;r&&r!==document.documentElement;){if(e.includes(r.tagName.toLowerCase()))return r;r=r.parentElement}return null}(t);if(!n)return null;let o=n.getAttribute("src")||n.getAttribute("href"),i=o?null:function(t){if("svg"!==t.tagName.toLowerCase())return null;if(rr(t))return null;let e=null;for(const r of Array.from(t.children)){const t=r.tagName.toLowerCase();if(!tr.includes(t)){if("image"!==t||e)return null;e=r}}return e?rr(e)?null:e:null}(n);const a=i&&((s=i).getAttribute("href")||s.getAttributeNS(Qe,"href")||s.getAttribute("xlink:href"))||null;var s;a?o=a:i=null;let u=(null!=i?i:n).getBoundingClientRect();(u.width<=0||u.height<=0)&&(u=n.getBoundingClientRect());const l=o?new URL(o,document.baseURI).href:null,c=function(t){var e,r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ownerDocument.baseURI;const i=t.tagName.toLowerCase(),a=(null===(e=t.getAttribute("title"))||void 0===e?void 0:e.trim())||null,s=null===(r=t.getAttribute("role"))||void 0===r?void 0:r.toLowerCase().split(/\s+/).find(t=>t.length>0),u=t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby")||t.hasAttribute("aria-description")||t.hasAttribute("aria-details");if("true"===(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||("presentation"===s||"none"===s)&&!u)return{name:null,description:null,extendedDescriptions:[]};let l=null,c=!1;var f;l=Ye(t,"aria-labelledby"),l||(l=(null===(f=t.getAttribute("aria-label"))||void 0===f?void 0:f.trim())||null),l||("img"===i?t.hasAttribute("alt")&&(l=t.getAttribute("alt").trim()||null,l||(c=!0)):"svg"===i&&(l=Je(t,"title")));let p=!1;l||c||!a||(l=a,p=!0),l||"img"!==i||t.hasAttribute("alt")||t.hasAttribute("title")||(l=function(t){const e=t.closest("figure"),r=null==e?void 0:e.querySelector(":scope > figcaption");if(!e||!r)return null;const n=t=>{var e;return null!==(e=null==t?void 0:t.replace(/\s+/g," ").trim())&&void 0!==e?e:""};if(n(e.textContent)!==n(r.textContent))return null;const o=e.querySelectorAll("img, svg, audio, video, object, iframe, embed");for(let e=0;e desc")?d=Je(t,"desc"):p||(d=a),{name:l,description:d,extendedDescriptions:Ge(t,o)}}(n);return{tag:n.tagName.toLowerCase(),html:l?null:n.outerHTML,src:l,resourceHref:null!==(e=null===(r=window.readium)||void 0===r||null===(r=r.link)||void 0===r?void 0:r.href)&&void 0!==e?e:null,frame:{x:u.left,y:u.top,width:u.width,height:u.height},accessibleName:c.name,accessibleDescription:c.description,extendedDescriptions:c.extendedDescriptions,caption:Ze(n),cssSelector:We(n)}}(e.target)));let o=W({x:e.clientX,y:e.clientY}),i={phase:t,defaultPrevented:e.defaultPrevented,pointerId:e.pointerId,pointerType:e.pointerType,x:o.x,y:o.y,buttons:e.buttons,interactiveElement:r,targetElement:n,option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey};null==Vt(e)&&webkit.messageHandlers.pointerEventReceived.postMessage(i)}function cr(t){return t.defaultPrevented||null!=Ue(document.activeElement)}function fr(t){t.stopPropagation(),t.preventDefault()}function pr(t,e){e.repeat||webkit.messageHandlers.keyEventReceived.postMessage({phase:t,code:e.code,key:String.fromCharCode(e.keyCode),option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey})}window.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",or,!1),document.addEventListener("pointerdown",ir,!1),document.addEventListener("pointerup",ar,!1),document.addEventListener("pointermove",sr,!1),document.addEventListener("pointercancel",ur,!1),document.addEventListener("selectionchange",function(){nr=!window.getSelection().isCollapsed})}),window.addEventListener("keydown",t=>{cr(t)||(fr(t),pr("down",t))}),window.addEventListener("keyup",t=>{cr(t)||(fr(t),pr("up",t))}),globalThis.readium={scrollToId:function(t,e){let r=document.getElementById(t);return!!r&&(T(r.getBoundingClientRect(),e),!0)},scrollToPosition:function(t,e,r){t<0||t>1?console.error(`Expected a valid progression in scrollToPosition, got ${t}`):R()?P()?M({left:-document.scrollingElement.scrollWidth*t,animated:r}):M({top:document.scrollingElement.scrollHeight*t,animated:r}):M({left:I(document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1)),animated:r})},scrollToLocator:function(t,e){let r=k(t);return!!r&&function(t,e){return T(t.getBoundingClientRect(),e)}(r,e)},scrollLeft:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX-o,a=r?-(n-o):0;return N(Math.max(i,a),e)},scrollRight:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX+o,a=r?0:n-o;return N(Math.min(i,a),e)},setCSSProperties:function(t){for(const e in t)$(e,t[e])},setProperty:$,removeProperty:F,registerDecorationTemplates:function(t){var e="";for(const n of Object.entries(t)){var r=Bt(n,2);const t=r[0],o=r[1];Wt.set(t,o),o.stylesheet&&(e+=o.stylesheet+"\n")}if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Ut.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=k(e.locator);if(!i)return void _("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),u(a)}function s(t){let e=r.findIndex(e=>e.decoration.id===t);if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function u(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame(function(){null!=o&&document.body.append(o)})),o),i=Wt.get(r.decoration.style);if(!i)return void B(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const s=getComputedStyle(document.body).writingMode,u="vertical-rl"===s||"vertical-lr"===s,l=document.scrollingElement,c=l.scrollLeft,f=l.scrollTop,p=u?window.innerHeight:window.innerWidth,d=u?window.innerWidth:window.innerHeight,h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,y=(u?d:p)/h;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-c+"px":t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-c+l.clientWidth}px`:t.style.left=`${r.left+c}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+c}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void B(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!s.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=U(r.range,t).sort((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left);for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,s),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=s,g(t,b,b,s),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function l(){o&&(o.remove(),o=null)}return{add:a,remove:s,update:function(t){s(t.id),a(t)},clear:function(){l(),r.length=0},items:r,requestLayout:function(){l(),r.forEach(t=>u(t))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+zt++,t),Ut.set(t,e)),e},findFirstVisibleLocator:function(){const t=ze(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:We(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",function(){window.requestAnimationFrame(function(){webkit.messageHandlers.spreadLoaded.postMessage({})});let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)})})()})(); +(()=>{var t={3618(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,u=e[r]|s,l=u|a,c=(u&i)+i^i|u,f=a|~(c|i),p=i&c,d=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(l|(f|=n(o)-s)),a=f&l,t.P[r]=i,t.M[r]=a,d}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var u=new Uint32Array(a+1),l=new Map,c=[],f=0;f<256;f++)c.push(u);for(var p=0;p=e.length||e.charCodeAt(m)===d&&(h[y]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]0?r:0,!0)},o?o(t.exports,"apply",{value:a}):t.exports.apply=a},5298(t,e,r){"use strict";var n=r(703),o=r(5312),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},7517(t,e,r){"use strict";var n=r(9173),o=r(7388),i=r(7379),a=r(3492);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!a&&a(t,e);if(n)n(t,e,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8189(t,e,r){"use strict";var n=r(1748),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(7517),u=r(708)(),l=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s0&&arguments[1]||"Cannot call method on "+t);return t}},9253(t){"use strict";t.exports=Object},4938(t){"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},3148(t,e,r){"use strict";var n=r(703)("%Object.defineProperty%",!0),o=r(6618)(),i=r(9939),a=r(7379),s=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==r&&"boolean"!=typeof r||void 0!==o&&"boolean"!=typeof o)throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!s||!r&&i(t,s)||(n?n(t,s,{configurable:!o,enumerable:!1,value:e,writable:!1}):t[s]=e)}},2632(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(2719),i=r(5833),a=r(1718),s=r(7379),u=r(5465),l=r(7377);t.exports=function(t){if(u(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=l(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(u(c))return c;throw new s("unable to convert exotic object to primitive")}return"default"===r&&(i(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new s("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new s('hint must be "string" or "number"');var r,n,i,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(i=0;i1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return W(t,V,function(t,e,r,o){n[n.length]=r?W(o,H,"$1"):e||t}),n}(t),n=r.length>0?r[0]:"",o=G("%"+n+"%",e),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],D(r,L([0,1],u)));for(var f=1,p=!0;f=r.length){var g=x(a,d);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[d]}else p=B(a,d),a=a[d];p&&!s&&(I[i]=a)}}return a}},8819(t,e,r){"use strict";var n=r(9253);t.exports=n.getPrototypeOf||null},2517(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1611(t,e,r){"use strict";var n=r(2517),o=r(8819),i=r(1449);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:i?function(t){return i(t)}:null},4656(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},3492(t,e,r){"use strict";var n=r(4656);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},708(t,e,r){"use strict";var n=r(9173),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},6052(t){"use strict";var e={__proto__:null,foo:{}},r={__proto__:e}.foo===e.foo&&!(e instanceof Object);t.exports=function(){return r}},7657(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(8123);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},8123(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6618(t,e,r){"use strict";var n=r(8123);t.exports=function(){return n()&&!!Symbol.toStringTag}},9939(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3583);t.exports=i.call(n,o)},6561(t,e,r){"use strict";var n=r(9939),o=r(6746)(),i=r(7379),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");if(o.assert(t),!a.has(t,e))throw new i("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var r=o.get(t);return!!r&&n(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`O` is not an object");if("string"!=typeof e)throw new i("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},2719(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((c||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},5833(t,e,r){"use strict";var n=r(5298),o=n("Date.prototype.getDay"),i=n("Object.prototype.toString"),a=r(6618)();t.exports=function(t){return"object"==typeof t&&null!==t&&(a?function(t){try{return o(t),!0}catch(t){return!1}}(t):"[object Date]"===i(t))}},4587(t,e,r){"use strict";var n,o=r(5298),i=r(6618)(),a=r(9939),s=r(3492);if(i){var u=o("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(t){if(!t||"object"!=typeof t)return!1;var e=s(t,"lastIndex");if(!e||!a(e,"value"))return!1;try{u(t,f)}catch(t){return t===l}}}else{var p=o("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===p(t)}}t.exports=n},1718(t,e,r){"use strict";var n=r(5298),o=n("Object.prototype.toString"),i=r(7657)(),a=r(5537);if(i){var s=n("Symbol.prototype.toString"),u=a(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==o(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u(s(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},9895(t){"use strict";t.exports=Math.abs},6241(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991},2153(t){"use strict";t.exports=Math.floor},1084(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1029(t,e,r){"use strict";var n=r(9895),o=r(2153),i=r(5518),a=r(1084);t.exports=function(t){if("number"!=typeof t||i(t)||!a(t))return!1;var e=n(t);return o(e)===e}},5518(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},457(t){"use strict";t.exports=Math.max},1179(t){"use strict";t.exports=Math.min},5985(t){"use strict";t.exports=Math.pow},8639(t){"use strict";t.exports=Math.round},5738(t,e,r){"use strict";var n=r(5518);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},4922(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var $=r(2179),F=$.custom,_=H(F)?F:null,B={__proto__:null,double:'"',single:"'"},L={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function D(t,e,r){var n=r.quoteStyle||e,o=B[n];return o+t+o}function W(t){return v.call(String(t),/"/g,""")}function U(t){return!N||!("object"==typeof t&&(N in t||void 0!==t[N]))}function z(t){return"[object Array]"===X(t)&&U(t)}function V(t){return"[object RegExp]"===X(t)&&U(t)}function H(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&!q(B,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Y(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return y?k(e,w):w}if("bigint"==typeof e){var S=String(e)+"n";return y?k(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var P,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(K(o,e)>=0)return"[Circular]";function L(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!V(e)){var G=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),J=rt(e,L);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+A.call(J,", ")+" }":"")}if(H(e)){var nt=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?nt:Z(nt)}if((P=e)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ot="<"+x.call(String(e.nodeName)),it=e.attributes||[],at=0;at"}if(z(e)){if(0===e.length)return"[]";var st=rt(e,L);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+et(st,F)+"]":"[ "+A.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&U(t)}(e)){var ut=rt(e,L);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+L(e.cause),ut),", ")+" }"}if("object"==typeof e&&u){if(_&&"function"==typeof e[_]&&$)return $(e,{depth:j-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var lt=[];return a&&a.call(e,function(t,r){lt.push(L(r,e,!0)+" => "+L(t,e))}),tt("Map",i.call(e),lt,F)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(L(t,e))}),tt("Set",l.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return"[object Number]"===X(t)&&U(t)}(e))return Z(L(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return Z(L(R.call(e)));if(function(t){return"[object Boolean]"===X(t)&&U(t)}(e))return Z(h.call(e));if(function(t){return"[object String]"===X(t)&&U(t)}(e))return Z(L(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof globalThis&&e===globalThis)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&U(t)}(e)&&!V(e)){var ft=rt(e,L),pt=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,dt=e instanceof Object?"":"null prototype",ht=!pt&&N&&Object(e)===e&&N in e?b.call(X(e),8,-1):dt?"Object":"",yt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ht||dt?"["+A.call(E.call([],ht||[],dt||[]),": ")+"] ":"");return 0===ft.length?yt+"{}":F?yt+"{"+et(ft,F)+"}":yt+"{ "+A.call(ft,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Y(b.call(t,0,e.maxStringLength),e)+n}var o=L[e.quoteStyle||"single"];return o.lastIndex=0,D(v.call(v.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=z(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var y=0;y0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},3743(t,e,r){"use strict";var n=r(7843),o=r(7379),i=Object;t.exports=n(function(){if(null==this||this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)},1721(t,e,r){"use strict";var n=r(8189),o=r(7965),i=r(3743),a=r(4510),s=r(3980),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},4510(t,e,r){"use strict";var n=r(3743),o=r(8189).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),t.get.call(r),"dy"===e)return t.get}}return n}},3980(t,e,r){"use strict";var n=r(8189).supportsDescriptors,o=r(4510),i=r(3492),a=Object.defineProperty,s=r(9183),u=r(1611),l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(l),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},5537(t,e,r){"use strict";var n=r(5298),o=r(4587),i=n("RegExp.prototype.exec"),a=r(7379);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},2644(t,e,r){"use strict";var n=r(703),o=r(7517),i=r(708)(),a=r(3492),s=r(7379),u=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||u(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in t&&a){var c=a(t,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},7843(t,e,r){"use strict";var n=r(7517),o=r(708)(),i=r(3749).functionsHaveConfigurableNames(),a=r(7379);t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},7797(t,e,r){"use strict";var n=r(4922),o=r(7379),i=function(t,e,r){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,r||(n.next=t.next,t.next=n),n};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var r=function(t,e){if(t)return i(t,e,!0)}(t,e);return r&&t&&!t.next&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var r=i(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!i(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var n=i(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},1085(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(7379),s=n("%Map%",!0),u=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);t.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+i(t))},delete:function(e){if(t){var r=f(t,e);return 0===p(t)&&(t=void 0),r}return!1},get:function(e){if(t)return u(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,r){t||(t=new s),l(t,e,r)}};return e}},2468(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(4922),a=r(1085),s=r(7379),u=n("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);t.exports=u?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(r){if(u&&r&&("object"==typeof r||"function"==typeof r)){if(t)return p(t,r)}else if(a&&e)return e.delete(r);return!1},get:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&t?f(t,r):!!e&&e.has(r)},set:function(r,n){u&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new u),c(t,r,n)):a&&(e||(e=a()),e.set(r,n))}};return r}:a},6746(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(7797),a=r(1085),s=r(2468)||a||i;t.exports=function(){var t,e={assert:function(t){if(!e.has(t)){var r=t&&Object(t)===t?"the given object key":o(t);throw new n("Side channel does not contain "+r)}},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=s()),t.set(e,r)}};return e}},4290(t,e,r){"use strict";var n=r(6520),o=r(7630),i=r(4111),a=r(333),s=r(1076),u=r(5363),l=r(5298),c=r(7657)(),f=r(1721),p=r(703),d=r(7379),h=p("%RegExp%"),y=l("String.prototype.indexOf"),g=r(2570),m=function(t){var e=g();if(c&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===h.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),y(s(r),"g")<0)throw new d("matchAll requires a global regular expression")}var i=m(t);if(void 0!==i)return n(i,t,[e])}var l=s(e),c=new h(t,"g");return n(m(c),c,[l])}},6410(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(4290),a=r(4683),s=r(3197),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2570(t,e,r){"use strict";var n=r(7657)(),o=r(1930);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},4683(t,e,r){"use strict";var n=r(4290);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},1930(t,e,r){"use strict";var n=r(3990),o=r(7630),i=r(5234),a=r(518),s=r(6117),u=r(1076),l=r(192),c=r(1721),f=r(7843),p=r(5298),d=r(703),h=r(7379),y=p("String.prototype.indexOf"),g=d("%RegExp%"),m="flags"in g.prototype,b=f(function(t){var e=this;if("Object"!==l(e))throw new h('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(c(e));return{flags:r,matcher:new t(m&&"string"==typeof r?e:t===g?e.source:e,r)}}(a(e,g),e),p=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var v=y(p,"g")>-1,w=y(p,"u")>-1;return n(d,r,v,w)},"[Symbol.matchAll]",!0);t.exports=b},3197(t,e,r){"use strict";var n=r(8189),o=r(7657)(),i=r(3492),a=r(4683),s=r(2570),u=Object.defineProperty;t.exports=function(){var t=a();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),u&&i){var r=i(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var l=s(),c={};c[e]=l;var f={};f[e]=function(){return RegExp.prototype[e]!==l},n(RegExp.prototype,c,f)}return t}},3952(t,e,r){"use strict";var n=r(5363),o=r(2501),i=r(5298),a=r(5537),s=i("String.prototype.replace"),u=i("String.prototype.charAt"),l=i("String.prototype.slice"),c=/^\s$/.test("᠎"),f=c?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,p=a(c?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]$/);t.exports=function(){for(var t=s(o(n(this)),f,""),e=t.length;e>0&&p(u(t,e-1));)e-=1;return l(t,0,e)}},7724(t,e,r){"use strict";var n=r(7965),o=r(8189),i=r(5363),a=r(3952),s=r(8821),u=r(5795),l=n(s()),c=function(t){return i(t),l(t)};o(c,{getPolyfill:s,implementation:a,shim:u}),t.exports=c},8821(t,e,r){"use strict";var n=r(3952);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},5795(t,e,r){"use strict";var n=r(708)(),o=r(7517),i=r(8821);t.exports=function(){var t=i();return String.prototype.trim!==t&&(n?o(String.prototype,"trim",t,!0):o(String.prototype,"trim",t)),t}},2179(){},6917(t,e,r){"use strict";var n=r(6562),o=r(7379),i=r(1029),a=r(6241);t.exports=function(t,e,r){if("string"!=typeof t)throw new o("Assertion failed: `S` must be a String");if(!i(e)||e<0||e>a)throw new o("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("boolean"!=typeof r)throw new o("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+n(t,e)["[[CodeUnitCount]]"]:e+1}},6520(t,e,r){"use strict";var n=r(703),o=r(5298),i=r(7379),a=r(3443),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6562(t,e,r){"use strict";var n=r(7379),o=r(5298),i=r(3283),a=r(8537),s=r(1300),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("string"!=typeof t)throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),c=u(t,e),f=i(o),p=a(o);if(!f&&!p)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(p||e+1===r)return{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":s(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":c,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},44(t,e,r){"use strict";var n=r(7379);t.exports=function(t,e){if("boolean"!=typeof e)throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},3990(t,e,r){"use strict";var n=r(703),o=r(7657)(),i=r(7379),a=r(4938),s=n("%IteratorPrototype%",!0),u=r(6917),l=r(44),c=r(355),f=r(7630),p=r(2021),d=r(3936),h=r(5234),y=r(6117),g=r(1076),m=r(6561),b=r(3148),v=function(t,e,r,n){if("string"!=typeof e)throw new i("`S` must be a string");if("boolean"!=typeof r)throw new i("`global` must be a boolean");if("boolean"!=typeof n)throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};s&&(v.prototype=p(s)),c(v.prototype,"next",function(){var t=this;if(!a(t))throw new i("receiver must be an object");if(!(t instanceof v&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return l(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return m.set(t,"[[Done]]",!0),l(void 0,!0);if(n){if(""===g(f(s,"0"))){var c=y(f(e,"lastIndex")),p=u(r,c,o);h(e,"lastIndex",p,!0)}return l(s,!1)}return m.set(t,"[[Done]]",!0),l(s,!1)},!1),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,function(){return this},!1),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},355(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(9271),a=r(1181),s=r(5855);t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `homeObject` is not an Object");if(!s(e))throw new n("Assertion failed: `key` is not a Property Key or a Private Name");if("function"!=typeof r)throw new n("Assertion failed: `closure` is not a function");if("boolean"!=typeof u)throw new n("Assertion failed: `enumerable` is not a Boolean");if(!a(t))throw new n("Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties");i(t,e,{"[[Value]]":r,"[[Writable]]":!0,"[[Enumerable]]":u,"[[Configurable]]":!0})}},9271(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(6843),a=r(9999),s=r(5848),u=r(7817),l=r(5855),c=r(925),f=r(6309);t.exports=function(t,e,r){if(!o(t))throw new n("Assertion failed: Type(O) is not Object");if(!l(e))throw new n("Assertion failed: P is not a Property Key");var p=i(r)?r:f(r);if(!i(p))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return a(u,c,s,t,e,p)}},5848(t,e,r){"use strict";var n=r(7379),o=r(6843),i=r(3003);t.exports=function(t){if(void 0!==t&&!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return i(t)}},7630(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855),a=r(4938);t.exports=function(t,e){if(!a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},4111(t,e,r){"use strict";var n=r(7379),o=r(7818),i=r(1816),a=r(5855),s=r(4922);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: P is not a Property Key");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},7818(t,e,r){"use strict";var n=r(7379),o=r(4922),i=r(5855);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: P is not a Property Key, got "+o(e));return t[e]}},3443(t,e,r){"use strict";t.exports=r(8622)},1816(t,e,r){"use strict";t.exports=r(2719)},3478(t,e,r){"use strict";var n=r(4334)("%Reflect.construct%",!0),o=r(9271);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},7817(t,e,r){"use strict";var n=r(7379),o=r(9939),i=r(6843);t.exports=function(t){if(void 0===t)return!1;if(!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!o(t,"[[Value]]")&&!o(t,"[[Writable]]"))}},1181(t,e,r){"use strict";var n=r(703),o=n("%Object.preventExtensions%",!0),i=n("%Object.isExtensible%",!0),a=r(9258);t.exports=o?function(t){return!a(t)&&i(t)}:function(t){return!a(t)}},333(t,e,r){"use strict";var n=r(703)("%Symbol.match%",!0),o=r(4587),i=r(4938),a=r(4801);t.exports=function(t){if(!i(t))return!1;if(n){var e=t[n];if(void 0!==e)return a(e)}return o(t)}},2021(t,e,r){"use strict";var n=r(703)("%Object.create%",!0),o=r(7379),i=r(7388),a=r(4938),s=r(3443),u=r(5713),l=r(6561),c=r(6052)();t.exports=function(t){if(null!==t&&!a(t))throw new o("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(c)e={__proto__:t};else if(n)e=n(t);else{if(null===t)throw new i("native Object.create support is required to create null objects");var f=function(){};f.prototype=t,e=new f}return r.length>0&&u(r,function(t){l.set(e,t,void 0)}),e}},3936(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5298)("RegExp.prototype.exec"),a=r(6520),s=r(7630),u=r(1816);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: `R` must be an Object");if("string"!=typeof e)throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(u(r)){var l=a(r,t,[e]);if(null===l||o(l))return l;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},925(t,e,r){"use strict";var n=r(5518);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},5234(t,e,r){"use strict";var n=r(7379),o=r(4938),i=r(5855),a=r(925),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if(!o(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof u)throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!a(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||a(t[e],r)}catch(t){return!1}}},518(t,e,r){"use strict";var n=r(703)("%Symbol.species%",!0),o=r(7379),i=r(4938),a=r(3478);t.exports=function(t,e){if(!i(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if(!i(r))throw new o("O.constructor is not an Object");var s=n?r[n]:void 0;if(null==s)return e;if(a(s))return s;throw new o("no constructor found")}},9893(t,e,r){"use strict";var n=r(703),o=n("%RegExp%"),i=r(7379),a=n("%parseInt%"),s=r(5298),u=r(5537),l=s("String.prototype.slice"),c=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),h=r(7724);t.exports=function t(e){if("string"!=typeof e)throw new i("Assertion failed: `argument` is not a String");if(c(e))return+a(l(e,2),2);if(f(e))return+a(l(e,2),8);if(d(e)||p(e))return NaN;var r=h(e);return r!==e?t(r):+e}},4801(t){"use strict";t.exports=function(t){return!!t}},7210(t,e,r){"use strict";var n=r(3312),o=r(6354),i=r(5518),a=r(1084);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},6117(t,e,r){"use strict";var n=r(6241),o=r(7210);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},3312(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%Number%"),a=r(9258),s=r(3760),u=r(9893);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):+e}},3760(t,e,r){"use strict";var n=r(2632);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},6309(t,e,r){"use strict";var n=r(9939),o=r(7379),i=r(4938),a=r(1816),s=r(4801);t.exports=function(t){if(!i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!a(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},1076(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},192(t,e,r){"use strict";var n=r(3225);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1300(t,e,r){"use strict";var n=r(703),o=r(7379),i=n("%String.fromCharCode%"),a=r(3283),s=r(8537);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},7060(t,e,r){"use strict";var n=r(2153);t.exports=function(t){return"bigint"==typeof t?t:n(t)}},6354(t,e,r){"use strict";var n=r(7060),o=r(7379);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new o("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2501(t,e,r){"use strict";var n=r(703)("%String%"),o=r(7379);t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return n(t)}},3225(t,e,r){"use strict";var n=r(4938);t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":n(t)?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},4334(t,e,r){"use strict";t.exports=r(703)},9999(t,e,r){"use strict";var n=r(708),o=r(9173),i=n.hasArrayLengthDefineBug(),a=i&&r(8622),s=r(5298)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,u,l){if(!o){if(!t(l))return!1;if(!l["[[Configurable]]"]||!l["[[Writable]]"])return!1;if(u in n&&s(n,u)!==!!l["[[Enumerable]]"])return!1;var c=l["[[Value]]"];return n[u]=c,e(n[u],c)}return i&&"length"===u&&"[[Value]]"in l&&a(n)&&n.length!==l["[[Value]]"]?(n.length=l["[[Value]]"],n.length===l["[[Value]]"]):(o(n,u,r(l)),!0)}},8622(t,e,r){"use strict";var n=r(703)("%Array%"),o=!n.isArray&&r(5298)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},5713(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},9258(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},5855(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},8537(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},6843(t,e,r){"use strict";var n=r(7379),o=r(9939),i={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(o(t,e)&&!i[e])return!1;var r=o(t,"[[Value]]")||o(t,"[[Writable]]"),a=o(t,"[[Get]]")||o(t,"[[Set]]");if(r&&a)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(3618);function e(e,r,n){let o=0;const i=[];for(;-1!==o;)o=e.indexOf(r,o),-1!==o&&(i.push({start:o,end:o+r.length,errors:0}),o+=1);return i.length>0?i:(0,t.A)(e,r,n)}function n(t,r){return 0===r.length||0===t.length?0:1-e(t,r,r.length)[0].errors/r.length}function o(t){const e=document.createElement("div");return e.appendChild(t.cloneContents()),function(t){var e;for(const e of Array.from(t.querySelectorAll("br")))e.replaceWith(document.createTextNode(" "));return null!==(e=t.textContent)&&void 0!==e?e:""}(e)}function i(t,e){let r=0;for(const n of t){if(!(n{if(i=e===a.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===a.Forwards?0:t.length;u=s(t,r,e)}};for(;i&&-1===u&&i!==o;)l();if(i&&u>=0)return{node:i,offset:u};throw new RangeError("No text nodes with non-whitespace text found in range")}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1?e-1:0),n=1;no?(a.push({node:s,offset:o-l}),o=r.shift()):(u=i.nextNode(),l+=s.data.length);for(;void 0!==o&&s&&l===o;)a.push({node:s,offset:s.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}let d=function(t){return t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS",t}({});class h{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=f(e),e=e.parentElement;return new h(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return p(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return h.fromPoint(t,e);case Node.ELEMENT_NODE:return new h(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=f(t)+e;return new h(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const t=u(e,a.Forwards),r=t.node,n=t.offset;r&&n>=0&&e.setStart(r,n)}if(!n){const t=u(e,a.Backwards),r=t.node,n=t.offset;r&&n>0&&e.setEnd(r,n)}return e}(y.fromRange(t).toRange())}}class g{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=y.fromRange(e).relativeTo(t);return new g(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new g(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return y.fromOffsets(this.root,this.start,this.end).toRange()}}class m{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){var r;const n=null!==(r=t.textContent)&&void 0!==r?r:"",i=y.fromRange(e).relativeTo(t),a=i.start.offset,s=i.end.offset,u=o(e),l=o(y.fromOffsets(t,Math.max(0,a-32),a).toRange()),c=o(y.fromOffsets(t,s,Math.min(n.length,s+32)).toRange());return new m(t,u,{prefix:l,suffix:c})}static fromSelector(t,e){const r=e.prefix,n=e.suffix;return new m(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(t).toRange()}toPositionAnchor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(t){let e="";const r=[],n=t=>{var o;if(t.nodeType!==Node.TEXT_NODE){if(t.nodeType===Node.ELEMENT_NODE){if("BR"===t.tagName)return r.push(e.length),void(e+=" ");for(const e of Array.from(t.childNodes))n(e)}}else e+=null!==(o=t.textContent)&&void 0!==o?o:""};return n(t),{text:e,brPositionsInText:r}}(this.root),o=r.text,a=r.brPositionsInText,s=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===r.length)return null;const i=Math.min(256,r.length/2),a=e(t,r,i);if(0===a.length)return null;const s=e=>{const i=1-e.errors/r.length,a=o.prefix?n(t.slice(Math.max(0,e.start-o.prefix.length),e.start),o.prefix):1,s=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let u=1;return"number"==typeof o.hint&&(u=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*s+2*u)/92},u=a.map(t=>({start:t.start,end:t.end,score:s(t)}));return u.sort((t,e)=>e.score-t.score),u[0]}(o,this.exact,{...this.context,hint:t.hint});if(!s)throw new Error("Quote not found");return new g(this.root,i(a,s.start),i(a,s.end))}}var b,v=r(6410);function w(){if(!readium.link)return null;const t=readium.link.href;if(!t)return null;const e=function(){const t=window.getSelection();if(!t)return;if(t.isCollapsed)return;const e=t.toString();if(0===e.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const r=1===t.rangeCount?t.getRangeAt(0):function(t,e,r,n){const o=new Range;if(o.setStart(t,e),o.setEnd(r,n),!o.collapsed)return o;x(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return x(">>> createOrderedRange RANGE REVERSE OK."),o;x(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void x("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=y.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let s=n.slice(Math.max(0,i-200),i),u=s.search(/\P{L}\p{L}/gu);-1!==u&&(s=s.slice(u+1));let l=n.slice(a,Math.min(n.length,a+200)),c=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==c&&c.index>1&&(l=l.slice(0,c.index+1)),{highlight:e,before:s,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return D(t.getRangeAt(0).getBoundingClientRect())}catch(t){return L(t),null}}()}:null}function x(){_.apply(null,arguments)}r.n(v)().shim(),window.addEventListener("error",function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})},!1),window.addEventListener("load",function(){var t;new ResizeObserver(()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(function(){O=window.innerWidth,function(){const t="readium-virtual-page";var e=document.getElementById(t);if(R()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var r;null===(r=e)||void 0===r||r.remove()}else{var n=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*n)/2%1>.1&&(e?e.remove():((e=document.createElement("div")).setAttribute("id",t),e.style.breakBefore="column",e.innerHTML="​",document.body.appendChild(e)))}}(),function(){if(!R()){var t=I(window.scrollX+1);document.scrollingElement.scrollLeft=t}}(),j()})}).observe(document.body)},!1);var S,E,A=!1,O=0;function j(){if(readium.isFixedLayout)return;let t=document.scrollingElement;if(R()&&!P()){const e=window.scrollY,r=window.innerHeight,n=t.scrollHeight;b={first:e/n,last:(e+r)/n}}else{let e=window.scrollX;const r=window.innerWidth,n=t.scrollWidth;C()&&(e=Math.abs(e)),b={first:e/n,last:(e+r)/n}}0!==t.scrollWidth&&0!==t.scrollHeight&&(A||window.requestAnimationFrame(function(){var t;t=b,webkit.messageHandlers.progressionChanged.postMessage(t),A=!1}),A=!0)}function R(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function P(){return window.getComputedStyle(document.documentElement).getPropertyValue("writing-mode").startsWith("vertical")}function C(){const t=window.getComputedStyle(document.documentElement);return"rtl"==t.getPropertyValue("direction")||"vertical-rl"==t.getPropertyValue("writing-mode")}function T(t,e){return R()?M({top:t.top+window.scrollY,animated:e}):M({left:I(t.left+window.scrollX),animated:e}),!0}function N(t,e){var r=window.scrollX,n=window.innerWidth,o=Math.abs(r-t)/n>.01;return o&&M({left:t,animated:e}),o}function M(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.left,r=t.top,n=t.animated;document.scrollingElement.scrollTo({left:e,top:r,behavior:n?"smooth":"instant"})}function I(t){const e=t+(C()?-1:1);return e-e%(O||window.innerWidth)}function k(t){try{let n=t.locations,o=t.text;var e;if(o&&o.highlight)return n&&n.cssSelector&&(e=document.querySelector(n.cssSelector)),e||(e=document.body),new m(e,o.highlight,{prefix:o.before,suffix:o.after}).toRange();if(n){var r=null;if(!r&&n.cssSelector&&(r=document.querySelector(n.cssSelector)),!r&&n.fragments)for(const t of n.fragments){let e;try{e=decodeURIComponent(t)}catch(t){continue}if(r=document.getElementById(e))break}if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){L(t)}return null}function $(t,e){null===e?F(t):document.documentElement.style.setProperty(t,e,"important")}function F(t){document.documentElement.style.removeProperty(t)}function _(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function B(t){L(new Error(t))}function L(t){webkit.messageHandlers.logError.postMessage({message:t.message})}function D(t){let e=W({x:t.left,y:t.top});const r=t.width,n=t.height,o=e.x,i=e.y;return{width:r,height:n,left:o,top:i,right:o+r,bottom:i+n}}function W(t){if(!frameElement)return t;let e=frameElement.getBoundingClientRect();if(!e)return t;let r=window.top.document.documentElement;return{x:t.x+e.x+r.scrollLeft,y:t.y+e.y+r.scrollTop}}function U(t,e){let r=t.getClientRects();const n=[];for(const t of r)n.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const o=q(function(t){const e=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const n of t)if(r!==n&&e.has(n)&&H(n,r,1)){J(),e.delete(r);break}}else J(),e.delete(r);return Array.from(e)}(z(n,1,e)));for(let t=o.length-1;t>=0;t--){const e=o[t];if(!(e.width*e.height>4)){if(!(o.length>1)){J();break}J(),o.splice(t,1)}}return J((n.length,o.length)),o}function z(t,e,r){for(let n=0;nt!==i&&t!==a),o=V(i,a);return n.push(o),z(n,e,r)}}return t}function V(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function H(t,e,r){return G(t,e.left,e.top,r)&&G(t,e.right,e.top,r)&&G(t,e.left,e.bottom,r)&&G(t,e.right,e.bottom,r)}function G(t,e,r,n){return(t.lefte||Y(t.right,e,n))&&(t.topr||Y(t.bottom,r,n))}function q(t){for(let e=0;et!==e);return Array.prototype.push.apply(a,r),q(a)}}else J()}return t}function X(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function K(t,e,r){return(t.left=0&&Y(t.left,e.right,r))&&(e.left=0&&Y(e.left,t.right,r))&&(t.top=0&&Y(t.top,e.bottom,r))&&(e.top=0&&Y(e.top,t.bottom,r))}function Y(t,e,r){return Math.abs(t-e)<=r}function J(){}window.addEventListener("scroll",j),document.addEventListener("selectionchange",(S=function(){webkit.messageHandlers.selectionChanged.postMessage(w())},function(){var t=this,e=arguments;clearTimeout(E),E=setTimeout(function(){S.apply(t,e),E=null},50)}));var Z,Q=[],tt=function(){return Q.some(function(t){return t.activeTargets.length>0})},et="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Z||(Z={}));var rt,nt=function(t){return Object.freeze(t)},ot=function(t,e){this.inlineSize=t,this.blockSize=e,nt(this)},it=function(){function t(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,nt(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),at=function(t){return t instanceof SVGElement&&"getBBox"in t},st=function(t){if(at(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},ut=function(t){var e;if(t instanceof Element)return!0;var r=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},lt="undefined"!=typeof window?window:{},ct=new WeakMap,ft=/auto|scroll/,pt=/^tb|vertical/,dt=/msie|trident/i.test(lt.navigator&<.navigator.userAgent),ht=function(t){return parseFloat(t||"0")},yt=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new ot((r?e:t)||0,(r?t:e)||0)},gt=nt({devicePixelContentBoxSize:yt(),borderBoxSize:yt(),contentBoxSize:yt(),contentRect:new it(0,0,0,0)}),mt=function(t,e){if(void 0===e&&(e=!1),ct.has(t)&&!e)return ct.get(t);if(st(t))return ct.set(t,gt),gt;var r=getComputedStyle(t),n=at(t)&&t.ownerSVGElement&&t.getBBox(),o=!dt&&"border-box"===r.boxSizing,i=pt.test(r.writingMode||""),a=!n&&ft.test(r.overflowY||""),s=!n&&ft.test(r.overflowX||""),u=n?0:ht(r.paddingTop),l=n?0:ht(r.paddingRight),c=n?0:ht(r.paddingBottom),f=n?0:ht(r.paddingLeft),p=n?0:ht(r.borderTopWidth),d=n?0:ht(r.borderRightWidth),h=n?0:ht(r.borderBottomWidth),y=f+l,g=u+c,m=(n?0:ht(r.borderLeftWidth))+d,b=p+h,v=s?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?y+m:0,S=o?g+b:0,E=n?n.width:ht(r.width)-x-w,A=n?n.height:ht(r.height)-S-v,O=E+y+w+m,j=A+g+v+b,R=nt({devicePixelContentBoxSize:yt(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:yt(O,j,i),contentBoxSize:yt(E,A,i),contentRect:new it(f,u,E,A)});return ct.set(t,R),R},bt=function(t,e,r){var n=mt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case Z.DEVICE_PIXEL_CONTENT_BOX:return a;case Z.BORDER_BOX:return o;default:return i}},vt=function(t){var e=mt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=nt([e.borderBoxSize]),this.contentBoxSize=nt([e.contentBoxSize]),this.devicePixelContentBoxSize=nt([e.devicePixelContentBoxSize])},wt=function(t){if(st(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},xt=function(){var t=1/0,e=[];Q.forEach(function(r){if(0!==r.activeTargets.length){var n=[];r.activeTargets.forEach(function(e){var r=new vt(e.target),o=wt(e.target);n.push(r),e.lastReportedSize=bt(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))})})},Et=[],At=0,Ot={attributes:!0,characterData:!0,childList:!0,subtree:!0},jt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rt=function(t){return void 0===t&&(t=0),Date.now()+t},Pt=!1,Ct=function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Pt){Pt=!0;var r,n=Rt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(St(e);tt();)e=xt(),St(e);return Q.some(function(t){return t.skippedTargets.length>0})&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:et}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=et),window.dispatchEvent(t)),e>0}()}finally{if(Pt=!1,t=n-Rt(),!At)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!rt){var e=0,r=document.createTextNode("");new MutationObserver(function(){return Et.splice(0).forEach(function(t){return t()})}).observe(r,{characterData:!0}),rt=function(){r.textContent="".concat(e?e--:e++)}}Et.push(t),rt()}(function(){requestAnimationFrame(r)})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Ot)};document.body?e():lt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jt.forEach(function(e){return lt.addEventListener(e,t.listener,!0)}))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),jt.forEach(function(e){return lt.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},t}(),Tt=new Ct,Nt=function(t){!At&&t>0&&Tt.start(),!(At+=t)&&Tt.stop()},Mt=function(){function t(t,e){this.target=t,this.observedBox=e||Z.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=bt(this.target,this.observedBox,!0);return t=this.target,at(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),It=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},kt=new WeakMap,$t=function(t,e){for(var r=0;r=0&&(o&&Q.splice(Q.indexOf(r),1),r.observationTargets.splice(n,1),Nt(-1))},t.disconnect=function(t){var e=this,r=kt.get(t);r.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),_t=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ft.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ut(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ft.unobserve(this,t)},t.prototype.disconnect=function(){Ft.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}(t,e)||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 Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Ut.forEach(function(t){t.requestLayout()}))}).observe(t)},!1);const Gt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function qt(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}const Xt={selectors:[Gt.id,Gt.class,Gt.tag,Gt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1,ignoreGeneratedClassNames:!1};function Kt(t){return!!t}function Yt(t){return t instanceof RegExp}function Jt(t){return["string","function"].includes(typeof t)||Yt(t)}function Zt(t){return Array.isArray(t)?t.filter(Jt):[]}function Qt(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return null!=t&&"object"==typeof t&&"nodeType"in t&&"number"==typeof t.nodeType}(t)&&e.includes(t.nodeType)}function te(t,e){if(Qt(t))return t.contains(e)||qt("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const r=e.getRootNode({composed:!1});return Qt(r)?(r!==document&&qt("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),r):se(e)}function ee(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function re(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce((t,e)=>t.filter(t=>e.includes(t)),e)}function ne(t){const e=t.map(t=>{if(Yt(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(qt("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",t),!1):r};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return t=>e.test(t)}return qt("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1});return t=>e.some(e=>e(t))}function oe(t,e,r){const n=Array.from(te(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every(t=>n.includes(t))}function ie(t,e){e=null!=e?e:se(t);const r=[];let n=t;for(;n&&n!==e;)Ht(n)&&r.push(n),n=n.parentNode;return r}function ae(t,e){return re(t.map(t=>ie(t,e)))}function se(t){return t.ownerDocument.querySelector(":root")}const ue=new RegExp(["^$","\\s"].join("|")),le=new RegExp(["^$"].join("|")),ce=[Gt.nthoftype,Gt.tag,Gt.id,Gt.class,Gt.attribute,Gt.nthchild],fe=ne(["class","id","ng-*"]);function pe({name:t}){return`[${t}]`}function de({name:t,value:e}){return`[${t}='${e}']`}function he({nodeName:t,nodeValue:e}){return{name:Ce(t),value:Ce(null!=e?e:void 0)}}function ye(t,e){const r=Array.from(t.attributes).filter(e=>function({nodeName:t,nodeValue:e},r){const n=r.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||fe(t))}(e,t)).map(he);return[...r.map(pe),...r.map(de)]}const ge=/^[a-z_-]{3,}$/i,me=/[bcdfghjklmnpqrstvwxyz]{4,}/i;function be(t,e){var r;const n=(null!==(r=t.getAttribute("class"))&&void 0!==r?r:"").trim().split(/\s+/).filter(t=>!le.test(t));let o=n;if(null==e?void 0:e.ignoreGeneratedClassNames){const t=ne(e.whitelist);o=n.filter(e=>{const r=`.${Ce(e)}`;return!!t(r)||function(t){if(!ge.test(t))return!1;if(t.includes("_")&&!t.includes("__"))return!1;if(/^(css|sc|jsx|emotion|makeStyles|MuiButton|MuiBox)-/i.test(t))return!1;const e=t.split(/--|__|[-]|(?<=[a-z])(?=[A-Z])/).filter(t=>t.length>0);if(0===e.length)return!1;if(1===e.length&&e[0].length<4)return!1;for(const t of e){if(t.length<=2)return!1;if(me.test(t))return!1}return!0}(e)})}return o.map(t=>`.${Ce(t)}`)}function ve(t,e){var r;const n=null!==(r=t.getAttribute("id"))&&void 0!==r?r:"",o=`#${Ce(n)}`,i=t.getRootNode({composed:!1});return!ue.test(n)&&oe([t],o,i)?[o]:[]}function we(t,e){const r=t.parentNode,n=r&&"children"in r?r.children:null;if(n)for(let e=0;exe(t)),[].concat(...n)))];var n;return 0===r.length||r.length>1?[]:[r[0]]}function Ee(t,e){const r=Se([t])[0],n=t.parentNode,o=n&&"children"in n?n:null;if(o){const e=Array.from(o.children).filter(t=>t.tagName.toLowerCase()===r),n=e.indexOf(t);if(n>-1)return[`${r}:nth-of-type(${String(n+1)})`]}return[]}function*Ae(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=je(1);for(;n.length<=t.length&&rt[e]);yield e,n=Oe(n,t.length-1)}}function Oe(t=[],e=0){const r=t.length;if(0===r)return[];const n=[...t];n[r-1]+=1;for(let t=r-1;t>=0;t--)if(n[t]>e){if(0===t)return je(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?je(r+1):n}function je(t=1){return Array.from(Array(t).keys())}const Re=":".charCodeAt(0).toString(16).toUpperCase(),Pe=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Ce(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map(t=>":"===t?`\\${Re} `:Pe.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\")).join("")}(t)}const Te={tag:Se,id:function(t,e){return 0===t.length||t.length>1?[]:ve(t[0])},class:function(t,e){return re(t.map(t=>be(t,e)))},attribute:function(t,e){return re(t.map(t=>ye(t)))},nthchild:function(t,e){return re(t.map(t=>we(t)))},nthoftype:function(t,e){return re(t.map(t=>Ee(t)))}},Ne={tag:xe,id:ve,class:be,attribute:ye,nthchild:we,nthoftype:Ee};function Me(t){return t.includes(Gt.tag)||t.includes(Gt.nthoftype)?[...t]:[...t,Gt.tag]}function*Ie(t,e){const r={};for(const n of t){const t=e[n];t&&t.length>0&&(r[n]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const r=[{index:e.length-1,partial:{}}];for(;r.length>0;){const t=r.pop();if(!t)break;const{index:n,partial:o}=t;if(n<0){yield o;continue}const[i,a]=e[n];for(let t=a.length-1;t>=0;t--)r.push({index:n-1,partial:Object.assign(Object.assign({},o),{[i]:a[t]})})}}(r))yield ke(t)}function ke(t={}){const e=[...ce];return t[Gt.tag]&&t[Gt.nthoftype]&&e.splice(e.indexOf(Gt.tag),1),e.map(e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n}).join("")}function $e(t,e){return[...t.map(t=>e+" "+t),...t.map(t=>e+" > "+t)]}function*Fe(t,e,r="",n){const o=function*(t,e){const r=new Set,n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=ne(r),s=ne(n);return function(t){const{selectors:e,includeTag:r}=t,n=[...e];return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce((r,n)=>{const u=function(t,e,r){return(0,Te[e])(t,r)}(t,n,e),l=function(t=[],e,r){return t.filter(t=>r(t)||!e(t))}(u,a,s),c=function(t=[],e){return t.sort((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0})}(l,s);return r[n]=o?Array.from(Ae(c,{maxResults:i})):c.map(t=>[t]),r},{})}(t,e);for(const t of function*(t,e){for(const r of function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(Ae(t,{maxResults:e}))}(e,{maxResults:o}):e.map(t=>[t]);return n?i.map(Me):i}(e))yield*Ie(r,t)}(n,e))r.has(t)||(r.add(t),yield t)}(t,n);for(const n of function*(t,e){if(""===e)yield*t;else for(const r of t)yield*$e([r],e)}(o,r))oe(t,n,e)&&(yield n)}function*_e(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...ae(t,e).map(t=>[t])];for(const t of o)for(const o of Fe(t,e,r,n))yield{foundElements:t,selector:o}}function Be(t){return{value:t,include:!1}}function Le({selectors:t,operator:e}){let r=[...ce];t[Gt.tag]&&t[Gt.nthoftype]&&(r=r.filter(t=>t!==Gt.tag));let n="";return r.forEach(e=>{var r;(null!==(r=t[e])&&void 0!==r?r:[]).forEach(({value:t,include:e})=>{e&&(n+=t)})}),e+n}function De(t,e){return t.map(t=>function(t,e){const r=ie(t,e).reverse(),n=e instanceof ShadowRoot,o=r.map((t,e)=>{var r;const o=function(t,e,r=""){const n={};return e.forEach(e=>{Reflect.set(n,e,function(t,e){return Ne[e](t,void 0)}(t,e).map(Be))}),{element:t,operator:r,selectors:n}}(t,[Gt.nthchild],n&&0===e?"":" > ");return(null!==(r=o.selectors.nthchild)&&void 0!==r?r:[]).forEach(t=>{t.include=!0}),o});return[n?"":e?":scope":":root",...o.map(Le)].join("")}(t,e)).join(", ")}function We(t,e={}){const r=function*(t,e={}){var r;const n=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Ht);return[...new Set(e)]}(t),o=function(t,e={}){const r=Object.assign(Object.assign({},Xt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter(t=>{return e=Gt,r=t,Object.values(e).includes(r);var e,r}):[]),whitelist:Zt(r.whitelist),blacklist:Zt(r.blacklist),root:te(r.root,t),combineWithinSelector:Kt(r.combineWithinSelector),combineBetweenSelectors:Kt(r.combineBetweenSelectors),includeTag:Kt(r.includeTag),maxCombinations:ee(r.maxCombinations),maxCandidates:ee(r.maxCandidates),useScope:Kt(r.useScope),maxResults:ee(r.maxResults),ignoreGeneratedClassNames:Kt(r.ignoreGeneratedClassNames)};var n}(n[0],e),i=null!==(r=o.root)&&void 0!==r?r:se(n[0]);let a=0;for(const t of function*({elements:t,root:e,rootSelector:r="",options:n}){let o=e,i=r,a=!0;for(;a;){let r=!1;for(const a of _e(t,o,i,n)){const{foundElements:n,selector:s}=a;if(r=!0,!oe(t,s,e)){o=n[0],i=s;break}yield s}r||(a=!1)}}({elements:n,options:o,root:i,rootSelector:""}))if(yield t,a++,a>=o.maxResults)return;if(n.length>1){const{maxResults:t}=e,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);oWe(t,r)).join(", "),a++,a>=o.maxResults)return}const s=void 0!==e.root;yield De(n,o.useScope||s?i:void 0)}(t,Object.assign(Object.assign({},e),{maxResults:1}));return r.next().value}function Ue(t){return null==t?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t.outerHTML:t.parentElement?Ue(t.parentElement):null}function ze(t){for(var e=0;e0&&e.top0&&e.left{var n;if(t.nodeType===Node.TEXT_NODE)e.push(null!==(n=t.nodeValue)&&void 0!==n?n:"");else if(t.nodeType===Node.ELEMENT_NODE){const n=t;var o;"img"===n.tagName.toLowerCase()?e.push(null!==(o=n.getAttribute("alt"))&&void 0!==o?o:""):n.childNodes.forEach(r)}};return t.childNodes.forEach(r),e.join(" ").replace(/\s+/g," ").trim()||null}function Ye(t,e){const r=t.getAttribute(e);return r&&r.split(/\s+/).filter(t=>t.length>0).map(e=>t.ownerDocument.getElementById(e)).filter(t=>null!=t).map(t=>{var e,r;return(null===(e=t.getAttribute("aria-label"))||void 0===e?void 0:e.trim())||(null===(r=t.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||""}).filter(t=>t.length>0).join(" ")||null}function Je(t,e){var r;const n=t.querySelector(`:scope > ${e}`);return(null==n||null===(r=n.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())||null}function Ze(t){var e,r,n,o,i;const a=null===(e=t.closest("figure"))||void 0===e?void 0:e.querySelector(":scope > figcaption");if(!a||a.contains(t))return null;const s=((null!==(r=t.getAttribute("aria-details"))&&void 0!==r?r:"")+" "+(null!==(n=t.getAttribute("aria-describedby"))&&void 0!==n?n:"")).split(/\s+/).filter(t=>t.length>0);if(s.includes(null!==(o=a.getAttribute("id"))&&void 0!==o?o:""))return null;const u=t=>{var e;return"details"===t.tagName.toLowerCase()||s.includes(null!==(e=t.getAttribute("id"))&&void 0!==e?e:"")},l=a.cloneNode(!0),c=l.querySelectorAll("*");for(let t=0;tt.hasAttribute(e))}let nr=!1;function or(t){if(!getSelection().isCollapsed)return;let e=W({x:t.clientX,y:t.clientY}),r={defaultPrevented:t.defaultPrevented,x:e.x,y:e.y,targetElement:t.target.outerHTML,interactiveElement:Ue(t.target)};(function(t,e){let r=Vt(t);return!!r&&(webkit.messageHandlers.decorationActivated.postMessage({id:r.item.decoration.id,group:r.group,rect:D(r.item.range.getBoundingClientRect()),click:e}),!0)})(t,r)||webkit.messageHandlers.tap.postMessage(r)}function ir(t){lr("down",t)}function ar(t){lr("up",t)}function sr(t){lr("move",t)}function ur(t){lr("cancel",t)}function lr(t,e){var r,n;nr&&(t="cancel"),"move"!=t&&(r=Ue(e.target),n=function(t){if(!t)return t;let e=t.frame,r=W({x:e.x,y:e.y});return{...t,frame:{...e,x:r.x,y:r.y}}}(function(t){var e,r;if(!t||!t.getBoundingClientRect)return null;const n=function(t){const e=["img","svg"];let r=t;for(;r&&r!==document.documentElement;){if(e.includes(r.tagName.toLowerCase()))return r;r=r.parentElement}return null}(t);if(!n)return null;let o=n.getAttribute("src")||n.getAttribute("href"),i=o?null:function(t){if("svg"!==t.tagName.toLowerCase())return null;if(rr(t))return null;let e=null;for(const r of Array.from(t.children)){const t=r.tagName.toLowerCase();if(!tr.includes(t)){if("image"!==t||e)return null;e=r}}return e?rr(e)?null:e:null}(n);const a=i&&((s=i).getAttribute("href")||s.getAttributeNS(Qe,"href")||s.getAttribute("xlink:href"))||null;var s;a?o=a:i=null;let u=(null!=i?i:n).getBoundingClientRect();(u.width<=0||u.height<=0)&&(u=n.getBoundingClientRect());const l=o?new URL(o,document.baseURI).href:null,c=function(t){var e,r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ownerDocument.baseURI;const i=t.tagName.toLowerCase(),a=(null===(e=t.getAttribute("title"))||void 0===e?void 0:e.trim())||null,s=null===(r=t.getAttribute("role"))||void 0===r?void 0:r.toLowerCase().split(/\s+/).find(t=>t.length>0),u=t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby")||t.hasAttribute("aria-description")||t.hasAttribute("aria-details");if("true"===(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||("presentation"===s||"none"===s)&&!u)return{name:null,description:null,extendedDescriptions:[]};let l=null,c=!1;var f;l=Ye(t,"aria-labelledby"),l||(l=(null===(f=t.getAttribute("aria-label"))||void 0===f?void 0:f.trim())||null),l||("img"===i?t.hasAttribute("alt")&&(l=t.getAttribute("alt").trim()||null,l||(c=!0)):"svg"===i&&(l=Je(t,"title")));let p=!1;l||c||!a||(l=a,p=!0),l||"img"!==i||t.hasAttribute("alt")||t.hasAttribute("title")||(l=function(t){const e=t.closest("figure"),r=null==e?void 0:e.querySelector(":scope > figcaption");if(!e||!r)return null;const n=t=>{var e;return null!==(e=null==t?void 0:t.replace(/\s+/g," ").trim())&&void 0!==e?e:""};if(n(e.textContent)!==n(r.textContent))return null;const o=e.querySelectorAll("img, svg, audio, video, object, iframe, embed");for(let e=0;e desc")?d=Je(t,"desc"):p||(d=a),{name:l,description:d,extendedDescriptions:Ge(t,o)}}(n);return{tag:n.tagName.toLowerCase(),html:l?null:n.outerHTML,src:l,resourceHref:null!==(e=null===(r=window.readium)||void 0===r||null===(r=r.link)||void 0===r?void 0:r.href)&&void 0!==e?e:null,frame:{x:u.left,y:u.top,width:u.width,height:u.height},accessibleName:c.name,accessibleDescription:c.description,extendedDescriptions:c.extendedDescriptions,caption:Ze(n),cssSelector:We(n)}}(e.target)));let o=W({x:e.clientX,y:e.clientY}),i={phase:t,defaultPrevented:e.defaultPrevented,pointerId:e.pointerId,pointerType:e.pointerType,x:o.x,y:o.y,buttons:e.buttons,interactiveElement:r,targetElement:n,option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey};null==Vt(e)&&webkit.messageHandlers.pointerEventReceived.postMessage(i)}function cr(t){return t.defaultPrevented||null!=Ue(document.activeElement)}function fr(t){t.stopPropagation(),t.preventDefault()}function pr(t,e){e.repeat||webkit.messageHandlers.keyEventReceived.postMessage({phase:t,code:e.code,key:String.fromCharCode(e.keyCode),option:e.altKey,control:e.ctrlKey,shift:e.shiftKey,command:e.metaKey})}window.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",or,!1),document.addEventListener("pointerdown",ir,!1),document.addEventListener("pointerup",ar,!1),document.addEventListener("pointermove",sr,!1),document.addEventListener("pointercancel",ur,!1),document.addEventListener("selectionchange",function(){nr=!window.getSelection().isCollapsed})}),window.addEventListener("keydown",t=>{cr(t)||(fr(t),pr("down",t))}),window.addEventListener("keyup",t=>{cr(t)||(fr(t),pr("up",t))}),globalThis.readium={scrollToId:function(t,e){let r=document.getElementById(t);return!!r&&(T(r.getBoundingClientRect(),e),!0)},scrollToPosition:function(t,e,r){t<0||t>1?console.error(`Expected a valid progression in scrollToPosition, got ${t}`):R()?P()?M({left:-document.scrollingElement.scrollWidth*t,animated:r}):M({top:document.scrollingElement.scrollHeight*t,animated:r}):M({left:I(document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1)),animated:r})},scrollToLocator:function(t,e){let r=k(t);return!!r&&function(t,e){return T(t.getBoundingClientRect(),e)}(r,e)},scrollLeft:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX-o,a=r?-(n-o):0;return N(Math.max(i,a),e)},scrollRight:function(t,e){var r="rtl"==t,n=document.scrollingElement.scrollWidth,o=window.innerWidth,i=window.scrollX+o,a=r?0:n-o;return N(Math.min(i,a),e)},setCSSProperties:function(t){for(const e in t)$(e,t[e])},setProperty:$,removeProperty:F,registerDecorationTemplates:function(t){var e="";for(const n of Object.entries(t)){var r=Bt(n,2);const t=r[0],o=r[1];Wt.set(t,o),o.stylesheet&&(e+=o.stylesheet+"\n")}if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Ut.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=k(e.locator);if(!i)return void _("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),u(a)}function s(t){let e=r.findIndex(e=>e.decoration.id===t);if(-1===e)return;let n=r[e];r.splice(e,1),n.clickableElements=null,n.container&&(n.container.remove(),n.container=null)}function u(r){let n=(o||((o=document.createElement("div")).id=t,o.dataset.group=e,o.style.pointerEvents="none",requestAnimationFrame(function(){null!=o&&document.body.append(o)})),o),i=Wt.get(r.decoration.style);if(!i)return void B(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.id=r.id,a.dataset.style=r.decoration.style,a.style.pointerEvents="none";const s=getComputedStyle(document.body).writingMode,u="vertical-rl"===s||"vertical-lr"===s,l=document.scrollingElement,c=l.scrollLeft,f=l.scrollTop,p=u?window.innerHeight:window.innerWidth,d=u?window.innerWidth:window.innerHeight,h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,y=(u?d:p)/h;function g(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${e.height}px`,t.style.height=`${p}px`;const r=Math.floor(e.top/p)*p;o?t.style.right=-e.right-c+"px":t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}else if("bounds"===i.width)t.style.width=`${r.height}px`,t.style.height=`${p}px`,o?t.style.right=`${-r.right-c+l.clientWidth}px`:t.style.left=`${r.left+c}px`,t.style.top=`${r.top+f}px`;else if("page"===i.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;o?t.style.right=`${-e.right-c+l.clientWidth}px`:t.style.left=`${e.left+c}px`,t.style.top=`${r+f}px`}}else if("wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+c}px`,t.style.top=`${e.top+f}px`;else if("viewport"===i.width){t.style.width=`${p}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/p)*p;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+c}px`,t.style.top=`${e.top+f}px`;else if("page"===i.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+c}px`,t.style.top=`${e.top+f}px`}}let m,b=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),m=t.content.firstElementChild}catch(t){return void B(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){const t=!s.startsWith("vertical"),e=(v=r.range.startContainer).nodeType===Node.ELEMENT_NODE?v:v.parentElement,n=getComputedStyle(e).writingMode,o=U(r.range,t).sort((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===n?e.left-t.left:t.left-e.left);for(let t of o){const e=m.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=n,g(e,t,b,s),a.append(e)}}else if("bounds"===i.layout){const t=m.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=s,g(t,b,b,s),a.append(t)}var v;n.append(a),r.container=a,r.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===r.clickableElements.length&&(r.clickableElements=Array.from(a.children))}function l(){o&&(o.remove(),o=null)}return{add:a,remove:s,update:function(t){s(t.id),a(t)},clear:function(){l(),r.length=0},items:r,requestLayout:function(){l(),r.forEach(t=>u(t))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+zt++,t),Ut.set(t,e)),e},findFirstVisibleLocator:function(){const t=ze(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:We(t)},text:{highlight:t.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",function(){window.requestAnimationFrame(function(){webkit.messageHandlers.spreadLoaded.postMessage({})});let t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(t)})})()})(); //# sourceMappingURL=readium-reflowable.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Scripts/src/utils.js b/Sources/Navigator/EPUB/Scripts/src/utils.js index 60f6590ae8..e6b118511e 100644 --- a/Sources/Navigator/EPUB/Scripts/src/utils.js +++ b/Sources/Navigator/EPUB/Scripts/src/utils.js @@ -279,7 +279,12 @@ function scrollTo({ left, top, animated } = {}) { function snapOffset(offset) { const delta = isRTL() ? -1 : 1; const value = offset + delta; - return value - (value % viewportWidth); + // `viewportWidth` is only set once the `ResizeObserver` callback ran, a + // frame after the page is rendered. The native side may already scroll + // to the initial location before that, and a modulo by 0 would yield + // `NaN`, an offset `scrollTo()` doesn't move the page to. + const pageWidth = viewportWidth || window.innerWidth; + return value - (value % pageWidth); } function snapCurrentPosition() {