From 2adda08c03ffb98de0a34f3f87d2678f64b70962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 6 May 2025 16:57:25 +0200 Subject: [PATCH 01/22] Implement the new `InputObservable` API and use the JS pointer events API --- .../Assets/Static/scripts/readium-fixed.js | 2 +- .../Static/scripts/readium-reflowable.js | 2 +- .../EPUB/EPUBNavigatorViewController.swift | 38 +++- Sources/Navigator/EPUB/EPUBSpreadView.swift | 175 ++++++++++++++---- .../Navigator/EPUB/Scripts/src/decorator.js | 54 +++--- .../Navigator/EPUB/Scripts/src/gestures.js | 54 +++++- .../Navigator/EPUB/Scripts/src/keyboard.js | 10 +- Sources/Navigator/Input/InputObservable.swift | 54 ++++++ .../Navigator/Input/InputObserverSet.swift | 39 ++++ Sources/Navigator/{ => Input}/KeyEvent.swift | 109 ++++------- Sources/Navigator/Input/KeyModifiers.swift | 83 +++++++++ Sources/Navigator/Input/PointerEvent.swift | 97 ++++++++++ 12 files changed, 566 insertions(+), 151 deletions(-) create mode 100644 Sources/Navigator/Input/InputObservable.swift create mode 100644 Sources/Navigator/Input/InputObserverSet.swift rename Sources/Navigator/{ => Input}/KeyEvent.swift (67%) create mode 100644 Sources/Navigator/Input/KeyModifiers.swift create mode 100644 Sources/Navigator/Input/PointerEvent.swift diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 73bdd4c28..5a06199bf 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 u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==V(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==V(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(H(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:Y(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==V(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return K("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return K("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return K("WeakRef");if(function(u){return!("[object Number]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return Y(X(x.call(t)));if(function(u){return!("[object Boolean]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(p.call(t));if(function(u){return!("[object String]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==V(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(V(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function V(u){return E.call(u)}function H(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function Y(u){return"Object("+u+")"}function K(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||H(u.right,t,r))&&(u.tope||H(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function V(u,t,e){return(u.left=0&&H(u.left,t.right,e))&&(t.left=0&&H(t.left,u.right,e))&&(u.top=0&&H(u.top,t.bottom,e))&&(t.top=0&&H(t.top,u.bottom,e))}function H(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,Y=[],K="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];Y.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);Y.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return Y.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:K}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=K),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&Y.splice(Y.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const Lu={NONE:"",DESCENDANT:" ",CHILD:" > "},$u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},_u="CssSelectorGenerator";function Wu(u="unknown problem",...t){console.warn(`${_u}: ${u}`,...t)}const Uu={selectors:[$u.id,$u.class,$u.tag,$u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function zu(u){return u instanceof RegExp}function Gu(u){return["string","function"].includes(typeof u)||zu(u)}function Vu(u){return Array.isArray(u)?u.filter(Gu):[]}function Hu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function qu(u,t){if(Hu(u))return u.contains(t)||Wu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return Hu(e)?(e!==document&&Wu("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."),e):t.ownerDocument.querySelector(":root")}function Xu(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ku(u){return[].concat(...u)}function Ju(u){const t=u.map((u=>{if(zu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Wu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Wu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Zu(u,t,e){const r=Array.from(qu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function Qu(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;ku(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function ut(u,t){return Yu(u.map((u=>Qu(u,t))))}const tt=new RegExp(["^$","\\s"].join("|")),et=new RegExp(["^$"].join("|")),rt=[$u.nthoftype,$u.tag,$u.id,$u.class,$u.attribute,$u.nthchild],nt=Ju(["class","id","ng-*"]);function ot({name:u}){return`[${u}]`}function Dt({name:u,value:t}){return`[${u}='${t}']`}function it({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:ht(t)};var e}function at(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||nt(u))}(t,u))).map(it);return[...t.map(ot),...t.map(Dt)]}function Ft(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!et.test(u))).map((u=>`.${ht(u)}`))}function ct(u){const t=u.getAttribute("id")||"",e=`#${ht(t)}`,r=u.getRootNode({composed:!1});return!tt.test(t)&&Zu([u],e,r)?[e]:[]}function st(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(ku).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function lt(u){return[ht(u.tagName.toLowerCase())]}function ft(u){const t=[...new Set(Ku(u.map(lt)))];return 0===t.length||t.length>1?[]:[t[0]]}function pt(u){const t=ft([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function Et(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=Ct(1);for(;r.length<=u.length&&eu[t]));yield t,r=At(r,u.length-1)}}(u,{maxResults:t}))}function At(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return Ct(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?Ct(e+1):r}function Ct(u=1){return Array.from(Array(u).keys())}const yt=":".charCodeAt(0).toString(16).toUpperCase(),dt=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ht(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${yt} `:dt.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const Bt={tag:ft,id:function(u){return 0===u.length||u.length>1?[]:ct(u[0])},class:function(u){return Yu(u.map(Ft))},attribute:function(u){return Yu(u.map(at))},nthchild:function(u){return Yu(u.map(st))},nthoftype:function(u){return Yu(u.map(pt))}},gt={tag:lt,id:ct,class:Ft,attribute:at,nthchild:st,nthoftype:pt};function mt(u){return u.includes($u.tag)||u.includes($u.nthoftype)?[...u]:[...u,$u.tag]}function bt(u={}){const t=[...rt];return u[$u.tag]&&u[$u.nthoftype]&&t.splice(t.indexOf($u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function vt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+Lu.DESCENDANT+u)),...u.map((u=>t+Lu.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Ju(e),i=Ju(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=Bt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?Et(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?Et(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(mt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(bt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ku(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Zu(u,t,r.root))return t;return null}function wt(u){return{value:u,include:!1}}function xt({selectors:u,operator:t}){let e=[...rt];u[$u.tag]&&u[$u.nthoftype]&&(e=e.filter((u=>u!==$u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function St(u){return[":root",...Qu(u).reverse().map((u=>{const t=function(u,t,e=Lu.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return gt[t](u)}(u,t).map(wt))})),{element:u,operator:e,selectors:r}}(u,[$u.nthchild],Lu.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(xt)].join("")}function Ot(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(ku);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},Uu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=$u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:qu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Xu(e.maxCombinations),maxCandidates:Xu(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...ut(u,t).map((u=>[u]))];for(const u of n){const t=vt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Zu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>Ot(u,r))).join(", "):function(u){return u.map(St).join(", ")}(e)}function jt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?jt(u.parentElement):null}function Pt(u){for(var t=0;t0&&t.top0&&t.left{Nt(u)||(Mt(u),kt(u,"keydown"))})),window.addEventListener("keyup",(u=>{Nt(u)||(Mt(u),kt(u,"keyup"))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Pt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Ot(u)},text:{highlight:u.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==H(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==H(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(V(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:K(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return Y("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return Y("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return Y("WeakRef");if(function(u){return!("[object Number]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return K(X(x.call(t)));if(function(u){return!("[object Boolean]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(p.call(t));if(function(u){return!("[object String]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(H(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function H(u){return E.call(u)}function V(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function K(u){return"Object("+u+")"}function Y(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||V(u.right,t,r))&&(u.tope||V(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function H(u,t,e){return(u.left=0&&V(u.left,t.right,e))&&(t.left=0&&V(t.left,u.right,e))&&(u.top=0&&V(u.top,t.bottom,e))&&(t.top=0&&V(t.top,u.bottom,e))}function V(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,K=[],Y="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];K.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);K.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return K.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:Y}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=Y),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&K.splice(K.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){if(0===Nu.size)return null;for(const[t,e]of Nu)if(e.isActivable())for(const r of e.items.reverse())if(r.clickableElements)for(const e of r.clickableElements){let n=e.getBoundingClientRect().toJSON();if(U(n,u.clientX,u.clientY,1))return{group:t,item:r,element:e,rect:n}}return null}function Lu(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const $u={NONE:"",DESCENDANT:" ",CHILD:" > "},_u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Wu="CssSelectorGenerator";function Uu(u="unknown problem",...t){console.warn(`${Wu}: ${u}`,...t)}const zu={selectors:[_u.id,_u.class,_u.tag,_u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Gu(u){return u instanceof RegExp}function Hu(u){return["string","function"].includes(typeof u)||Gu(u)}function Vu(u){return Array.isArray(u)?u.filter(Hu):[]}function qu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function Xu(u,t){if(qu(u))return u.contains(t)||Uu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return qu(e)?(e!==document&&Uu("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."),e):t.ownerDocument.querySelector(":root")}function Ku(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ju(u){return[].concat(...u)}function Zu(u){const t=u.map((u=>{if(Gu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Uu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Uu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Qu(u,t,e){const r=Array.from(Xu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function ut(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;Lu(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function tt(u,t){return Yu(u.map((u=>ut(u,t))))}const et=new RegExp(["^$","\\s"].join("|")),rt=new RegExp(["^$"].join("|")),nt=[_u.nthoftype,_u.tag,_u.id,_u.class,_u.attribute,_u.nthchild],ot=Zu(["class","id","ng-*"]);function Dt({name:u}){return`[${u}]`}function it({name:u,value:t}){return`[${u}='${t}']`}function at({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:Bt(t)};var e}function Ft(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||ot(u))}(t,u))).map(at);return[...t.map(Dt),...t.map(it)]}function ct(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!rt.test(u))).map((u=>`.${Bt(u)}`))}function st(u){const t=u.getAttribute("id")||"",e=`#${Bt(t)}`,r=u.getRootNode({composed:!1});return!et.test(t)&&Qu([u],e,r)?[e]:[]}function lt(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(Lu).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function ft(u){return[Bt(u.tagName.toLowerCase())]}function pt(u){const t=[...new Set(Ju(u.map(ft)))];return 0===t.length||t.length>1?[]:[t[0]]}function Et(u){const t=pt([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function At(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=yt(1);for(;r.length<=u.length&&eu[t]));yield t,r=Ct(r,u.length-1)}}(u,{maxResults:t}))}function Ct(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return yt(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?yt(e+1):r}function yt(u=1){return Array.from(Array(u).keys())}const dt=":".charCodeAt(0).toString(16).toUpperCase(),ht=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Bt(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${dt} `:ht.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const gt={tag:pt,id:function(u){return 0===u.length||u.length>1?[]:st(u[0])},class:function(u){return Yu(u.map(ct))},attribute:function(u){return Yu(u.map(Ft))},nthchild:function(u){return Yu(u.map(lt))},nthoftype:function(u){return Yu(u.map(Et))}},mt={tag:ft,id:st,class:ct,attribute:Ft,nthchild:lt,nthoftype:Et};function bt(u){return u.includes(_u.tag)||u.includes(_u.nthoftype)?[...u]:[...u,_u.tag]}function vt(u={}){const t=[...nt];return u[_u.tag]&&u[_u.nthoftype]&&t.splice(t.indexOf(_u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function wt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+$u.DESCENDANT+u)),...u.map((u=>t+$u.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Zu(e),i=Zu(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=gt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?At(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?At(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(bt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(vt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ju(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Qu(u,t,r.root))return t;return null}function xt(u){return{value:u,include:!1}}function St({selectors:u,operator:t}){let e=[...nt];u[_u.tag]&&u[_u.nthoftype]&&(e=e.filter((u=>u!==_u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function Ot(u){return[":root",...ut(u).reverse().map((u=>{const t=function(u,t,e=$u.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return mt[t](u)}(u,t).map(xt))})),{element:u,operator:e,selectors:r}}(u,[_u.nthchild],$u.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(St)].join("")}function jt(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(Lu);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},zu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=_u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:Xu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Ku(e.maxCombinations),maxCandidates:Ku(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...tt(u,t).map((u=>[u]))];for(const u of n){const t=wt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Qu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>jt(u,r))).join(", "):function(u){return u.map(Ot).join(", ")}(e)}function Pt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?Pt(u.parentElement):null}function Tt(u){for(var t=0;t0&&t.top0&&t.left{Wt(u)||(Ut(u),zt("down",u))})),window.addEventListener("keyup",(u=>{Wt(u)||(Ut(u),zt("up",u))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Tt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:jt(u)},text:{highlight:u.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 6ec420466..2e96202ac 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 u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==V(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==V(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(H(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:Y(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==V(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return K("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return K("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return K("WeakRef");if(function(u){return!("[object Number]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return Y(X(x.call(t)));if(function(u){return!("[object Boolean]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(p.call(t));if(function(u){return!("[object String]"!==V(u)||P&&"object"==typeof u&&P in u)}(t))return Y(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==V(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(V(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function V(u){return E.call(u)}function H(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function Y(u){return"Object("+u+")"}function K(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||H(u.right,t,r))&&(u.tope||H(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function V(u,t,e){return(u.left=0&&H(u.left,t.right,e))&&(t.left=0&&H(t.left,u.right,e))&&(u.top=0&&H(u.top,t.bottom,e))&&(t.top=0&&H(t.top,u.bottom,e))}function H(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,Y=[],K="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];Y.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);Y.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return Y.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:K}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=K),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&Y.splice(Y.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const Lu={NONE:"",DESCENDANT:" ",CHILD:" > "},$u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},_u="CssSelectorGenerator";function Wu(u="unknown problem",...t){console.warn(`${_u}: ${u}`,...t)}const Uu={selectors:[$u.id,$u.class,$u.tag,$u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function zu(u){return u instanceof RegExp}function Gu(u){return["string","function"].includes(typeof u)||zu(u)}function Vu(u){return Array.isArray(u)?u.filter(Gu):[]}function Hu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function qu(u,t){if(Hu(u))return u.contains(t)||Wu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return Hu(e)?(e!==document&&Wu("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."),e):t.ownerDocument.querySelector(":root")}function Xu(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ku(u){return[].concat(...u)}function Ju(u){const t=u.map((u=>{if(zu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Wu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Wu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Zu(u,t,e){const r=Array.from(qu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function Qu(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;ku(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function ut(u,t){return Yu(u.map((u=>Qu(u,t))))}const tt=new RegExp(["^$","\\s"].join("|")),et=new RegExp(["^$"].join("|")),rt=[$u.nthoftype,$u.tag,$u.id,$u.class,$u.attribute,$u.nthchild],nt=Ju(["class","id","ng-*"]);function ot({name:u}){return`[${u}]`}function Dt({name:u,value:t}){return`[${u}='${t}']`}function it({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:ht(t)};var e}function at(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||nt(u))}(t,u))).map(it);return[...t.map(ot),...t.map(Dt)]}function Ft(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!et.test(u))).map((u=>`.${ht(u)}`))}function ct(u){const t=u.getAttribute("id")||"",e=`#${ht(t)}`,r=u.getRootNode({composed:!1});return!tt.test(t)&&Zu([u],e,r)?[e]:[]}function st(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(ku).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function lt(u){return[ht(u.tagName.toLowerCase())]}function ft(u){const t=[...new Set(Ku(u.map(lt)))];return 0===t.length||t.length>1?[]:[t[0]]}function pt(u){const t=ft([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function Et(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=Ct(1);for(;r.length<=u.length&&eu[t]));yield t,r=At(r,u.length-1)}}(u,{maxResults:t}))}function At(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return Ct(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?Ct(e+1):r}function Ct(u=1){return Array.from(Array(u).keys())}const yt=":".charCodeAt(0).toString(16).toUpperCase(),dt=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ht(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${yt} `:dt.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const Bt={tag:ft,id:function(u){return 0===u.length||u.length>1?[]:ct(u[0])},class:function(u){return Yu(u.map(Ft))},attribute:function(u){return Yu(u.map(at))},nthchild:function(u){return Yu(u.map(st))},nthoftype:function(u){return Yu(u.map(pt))}},gt={tag:lt,id:ct,class:Ft,attribute:at,nthchild:st,nthoftype:pt};function mt(u){return u.includes($u.tag)||u.includes($u.nthoftype)?[...u]:[...u,$u.tag]}function bt(u={}){const t=[...rt];return u[$u.tag]&&u[$u.nthoftype]&&t.splice(t.indexOf($u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function vt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+Lu.DESCENDANT+u)),...u.map((u=>t+Lu.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Ju(e),i=Ju(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=Bt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?Et(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?Et(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(mt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(bt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ku(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Zu(u,t,r.root))return t;return null}function wt(u){return{value:u,include:!1}}function xt({selectors:u,operator:t}){let e=[...rt];u[$u.tag]&&u[$u.nthoftype]&&(e=e.filter((u=>u!==$u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function St(u){return[":root",...Qu(u).reverse().map((u=>{const t=function(u,t,e=Lu.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return gt[t](u)}(u,t).map(wt))})),{element:u,operator:e,selectors:r}}(u,[$u.nthchild],Lu.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(xt)].join("")}function Ot(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(ku);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},Uu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=$u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:qu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Xu(e.maxCombinations),maxCandidates:Xu(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...ut(u,t).map((u=>[u]))];for(const u of n){const t=vt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Zu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>Ot(u,r))).join(", "):function(u){return u.map(St).join(", ")}(e)}function jt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?jt(u.parentElement):null}function Pt(u){for(var t=0;t0&&t.top0&&t.left{Nt(u)||(Mt(u),kt(u,"keydown"))})),window.addEventListener("keyup",(u=>{Nt(u)||(Mt(u),kt(u,"keyup"))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Pt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Ot(u)},text:{highlight:u.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let u=document.createElement("meta");u.setAttribute("name","viewport"),u.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(u)}))})()})(); +(()=>{var u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==H(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==H(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(V(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:K(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return Y("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return Y("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return Y("WeakRef");if(function(u){return!("[object Number]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return K(X(x.call(t)));if(function(u){return!("[object Boolean]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(p.call(t));if(function(u){return!("[object String]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(H(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function H(u){return E.call(u)}function V(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function K(u){return"Object("+u+")"}function Y(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||V(u.right,t,r))&&(u.tope||V(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function H(u,t,e){return(u.left=0&&V(u.left,t.right,e))&&(t.left=0&&V(t.left,u.right,e))&&(u.top=0&&V(u.top,t.bottom,e))&&(t.top=0&&V(t.top,u.bottom,e))}function V(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,K=[],Y="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];K.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);K.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return K.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:Y}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=Y),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&K.splice(K.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){if(0===Nu.size)return null;for(const[t,e]of Nu)if(e.isActivable())for(const r of e.items.reverse())if(r.clickableElements)for(const e of r.clickableElements){let n=e.getBoundingClientRect().toJSON();if(U(n,u.clientX,u.clientY,1))return{group:t,item:r,element:e,rect:n}}return null}function Lu(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const $u={NONE:"",DESCENDANT:" ",CHILD:" > "},_u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Wu="CssSelectorGenerator";function Uu(u="unknown problem",...t){console.warn(`${Wu}: ${u}`,...t)}const zu={selectors:[_u.id,_u.class,_u.tag,_u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Gu(u){return u instanceof RegExp}function Hu(u){return["string","function"].includes(typeof u)||Gu(u)}function Vu(u){return Array.isArray(u)?u.filter(Hu):[]}function qu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function Xu(u,t){if(qu(u))return u.contains(t)||Uu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return qu(e)?(e!==document&&Uu("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."),e):t.ownerDocument.querySelector(":root")}function Ku(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ju(u){return[].concat(...u)}function Zu(u){const t=u.map((u=>{if(Gu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Uu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Uu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Qu(u,t,e){const r=Array.from(Xu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function ut(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;Lu(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function tt(u,t){return Yu(u.map((u=>ut(u,t))))}const et=new RegExp(["^$","\\s"].join("|")),rt=new RegExp(["^$"].join("|")),nt=[_u.nthoftype,_u.tag,_u.id,_u.class,_u.attribute,_u.nthchild],ot=Zu(["class","id","ng-*"]);function Dt({name:u}){return`[${u}]`}function it({name:u,value:t}){return`[${u}='${t}']`}function at({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:Bt(t)};var e}function Ft(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||ot(u))}(t,u))).map(at);return[...t.map(Dt),...t.map(it)]}function ct(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!rt.test(u))).map((u=>`.${Bt(u)}`))}function st(u){const t=u.getAttribute("id")||"",e=`#${Bt(t)}`,r=u.getRootNode({composed:!1});return!et.test(t)&&Qu([u],e,r)?[e]:[]}function lt(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(Lu).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function ft(u){return[Bt(u.tagName.toLowerCase())]}function pt(u){const t=[...new Set(Ju(u.map(ft)))];return 0===t.length||t.length>1?[]:[t[0]]}function Et(u){const t=pt([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function At(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=yt(1);for(;r.length<=u.length&&eu[t]));yield t,r=Ct(r,u.length-1)}}(u,{maxResults:t}))}function Ct(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return yt(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?yt(e+1):r}function yt(u=1){return Array.from(Array(u).keys())}const dt=":".charCodeAt(0).toString(16).toUpperCase(),ht=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Bt(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${dt} `:ht.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const gt={tag:pt,id:function(u){return 0===u.length||u.length>1?[]:st(u[0])},class:function(u){return Yu(u.map(ct))},attribute:function(u){return Yu(u.map(Ft))},nthchild:function(u){return Yu(u.map(lt))},nthoftype:function(u){return Yu(u.map(Et))}},mt={tag:ft,id:st,class:ct,attribute:Ft,nthchild:lt,nthoftype:Et};function bt(u){return u.includes(_u.tag)||u.includes(_u.nthoftype)?[...u]:[...u,_u.tag]}function vt(u={}){const t=[...nt];return u[_u.tag]&&u[_u.nthoftype]&&t.splice(t.indexOf(_u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function wt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+$u.DESCENDANT+u)),...u.map((u=>t+$u.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Zu(e),i=Zu(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=gt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?At(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?At(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(bt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(vt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ju(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Qu(u,t,r.root))return t;return null}function xt(u){return{value:u,include:!1}}function St({selectors:u,operator:t}){let e=[...nt];u[_u.tag]&&u[_u.nthoftype]&&(e=e.filter((u=>u!==_u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function Ot(u){return[":root",...ut(u).reverse().map((u=>{const t=function(u,t,e=$u.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return mt[t](u)}(u,t).map(xt))})),{element:u,operator:e,selectors:r}}(u,[_u.nthchild],$u.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(St)].join("")}function jt(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(Lu);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},zu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=_u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:Xu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Ku(e.maxCombinations),maxCandidates:Ku(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...tt(u,t).map((u=>[u]))];for(const u of n){const t=wt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Qu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>jt(u,r))).join(", "):function(u){return u.map(Ot).join(", ")}(e)}function Pt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?Pt(u.parentElement):null}function Tt(u){for(var t=0;t0&&t.top0&&t.left{Wt(u)||(Ut(u),zt("down",u))})),window.addEventListener("keyup",(u=>{Wt(u)||(Ut(u),zt("up",u))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Tt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:jt(u)},text:{highlight:u.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let u=document.createElement("meta");u.setAttribute("name","viewport"),u.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(u)}))})()})(); //# sourceMappingURL=readium-reflowable.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 618bcdc95..e1d6a2300 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -36,7 +36,7 @@ public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) open class EPUBNavigatorViewController: UIViewController, VisualNavigator, SelectableNavigator, DecorableNavigator, - Configurable, Loggable + Configurable, InputObservable, Loggable { public enum EPUBError: Error { /// The provided publication is restricted. Check that any DRM was @@ -240,6 +240,7 @@ open class EPUBNavigatorViewController: UIViewController, public private(set) var currentLocation: Locator? private let loadPositionsByReadingOrder: () async -> ReadResult<[[Locator]]> private var positionsByReadingOrder: [[Locator]] = [] + private var inputObservers = InputObserverSet() private let tasks = CancellableTasks() private let viewModel: EPUBNavigatorViewModel @@ -422,7 +423,8 @@ open class EPUBNavigatorViewController: UIViewController, if isFirstResponder { for press in presses { if let event = KeyEvent(uiPress: press) { - didPressKey(event) + // FIXME: + delegate?.navigator(self, didPressKey: event) didHandleEvent = true } } @@ -890,16 +892,23 @@ open class EPUBNavigatorViewController: UIViewController, paginationView?.isScrollEnabled = isPaginationViewScrollingEnabled } + // MARK: - InputObservable + + @discardableResult + public func addInputObserver(_ observer: any InputObserver) -> InputObserverToken { + inputObservers.addInputObserver(observer) + } + + public func removeObserver(_ token: InputObserverToken) { + inputObservers.removeObserver(token) + } + // MARK: - User interactions private func didTap(at point: CGPoint) { delegate?.navigator(self, didTapAt: point) } - private func didPressKey(_ event: KeyEvent) { - delegate?.navigator(self, didPressKey: event) - } - // MARK: - EPUB-specific extensions /// Evaluates the given JavaScript on the currently visible HTML resource. @@ -1061,12 +1070,21 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { // } } - func spreadView(_ spreadView: EPUBSpreadView, didPressKey event: KeyEvent) { - didPressKey(event) + func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { + _ = inputObservers.didReceive(event) } - func spreadView(_ spreadView: EPUBSpreadView, didReleaseKey event: KeyEvent) { - delegate?.navigator(self, didReleaseKey: event) + func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) { + _ = inputObservers.didReceive(event) + + switch event.phase { + case .down: + delegate?.navigator(self, didPressKey: event) + case .cancel, .up: + delegate?.navigator(self, didReleaseKey: event) + case .change: + break + } } func spreadView(_ spreadView: EPUBSpreadView, didTapOnExternalURL url: URL) { diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 6961a4ef6..14966a822 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -33,11 +33,11 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the spread view needs to present a view controller. func spreadView(_ spreadView: EPUBSpreadView, present viewController: UIViewController) - /// Called when the user pressed a key down and it was not handled by the resource. - func spreadView(_ spreadView: EPUBSpreadView, didPressKey event: KeyEvent) + /// Called when the user triggered an input pointer event. + func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) - /// Called when the user released a key and it was not handled by the resource. - func spreadView(_ spreadView: EPUBSpreadView, didReleaseKey event: KeyEvent) + /// Called when the user triggered an input key event. + func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) /// Called when WKWebview terminates func spreadViewDidTerminate() @@ -205,6 +205,24 @@ class EPUBSpreadView: UIView, Loggable, PageView { } } + /// Called from the JS code when receiving a pointer event. + private func didReceivePointerEvent(_ data: Any) { + guard + let json = data as? [String: Any], + // FIXME: Really needed? + let defaultPrevented = json["defaultPrevented"] as? Bool, + !defaultPrevented, + // Ignores events on interactive elements + (json["interactiveElement"] as? String) == nil, + var event = PointerEvent(json: json) + else { + return + } + + event.location = convertPointToNavigatorSpace(event.location) + delegate?.spreadView(self, didReceive: event) + } + /// Converts the given JavaScript point into a point in the webview's coordinate space. func convertPointToNavigatorSpace(_ point: CGPoint) -> CGPoint { // To override in subclasses. @@ -367,11 +385,12 @@ class EPUBSpreadView: UIView, Loggable, PageView { registerJSMessage(named: "log") { [weak self] in self?.didLog($0) } registerJSMessage(named: "logError") { [weak self] in self?.didLogError($0) } registerJSMessage(named: "tap") { [weak self] in self?.didTap($0) } + registerJSMessage(named: "pointerEventReceived") { [weak self] in self?.didReceivePointerEvent($0) } registerJSMessage(named: "spreadLoadStarted") { [weak self] in self?.spreadLoadDidStart($0) } registerJSMessage(named: "spreadLoaded") { [weak self] in self?.spreadDidLoad($0) } registerJSMessage(named: "selectionChanged") { [weak self] in self?.selectionDidChange($0) } registerJSMessage(named: "decorationActivated") { [weak self] in self?.decorationDidActivate($0) } - registerJSMessage(named: "pressKey") { [weak self] in self?.didPressKey($0) } + registerJSMessage(named: "keyEventReceived") { [weak self] in self?.didReceiveKeyEvent($0) } } /// Add the message handlers for incoming javascript events. @@ -396,21 +415,15 @@ class EPUBSpreadView: UIView, Loggable, PageView { } } - private func didPressKey(_ event: Any) { - guard let dict = event as? [String: Any], - let type = dict["type"] as? String, - let keyEvent = KeyEvent(dict: dict) + private func didReceiveKeyEvent(_ event: Any) { + guard + let dict = event as? [String: Any], + let keyEvent = KeyEvent(dict: dict) else { return } - if type == "keydown" { - delegate?.spreadView(self, didPressKey: keyEvent) - } else if type == "keyup" { - delegate?.spreadView(self, didReleaseKey: keyEvent) - } else { - fatalError("Unexpected key event type: \(type)") - } + delegate?.spreadView(self, didReceive: keyEvent) } // MARK: - Decorator @@ -608,13 +621,110 @@ struct ClickEvent { } } +/// Produced by gestures.js +private extension PointerEvent { + init?(json: [String: Any]) { + guard + let pointerId = json["pointerId"] as? Int, + let pointerType = json["pointerType"] as? String, + let phase = PointerEvent.Phase(json: json["phase"]), + let x = json["x"] as? Double, + let y = json["y"] as? Double + else { + return nil + } + + let optionalPointer: Pointer? = switch pointerType { + case "mouse": + .mouse(MousePointer(id: pointerId, buttons: MouseButtons(json: json))) + case "touch": + .touch(TouchPointer(id: pointerId)) + default: + nil + } + + guard let pointer = optionalPointer else { + return nil + } + + self.init( + pointer: pointer, + phase: phase, + location: CGPoint(x: x, y: y), + modifiers: KeyModifiers(json: json) + ) + // FIXME: +// targetElement = dict["targetElement"] as? String ?? "" +// interactiveElement = dict["interactiveElement"] as? String + } +} + +private extension MouseButtons { + init(json: [String: Any]) { + self.init() + + guard let buttons = json["buttons"] as? [Int] else { + return + } + + if buttons.contains(0) { + insert(.main) + } + if buttons.contains(1) { + insert(.auxiliary) + } + if buttons.contains(2) { + insert(.secondary) + } + } +} + +private extension PointerEvent.Phase { + init?(json: Any?) { + guard let json = json as? String else { + return nil + } + + switch json { + case "down": self = .down + case "cancel": self = .cancel + case "move": self = .move + case "up": self = .up + default: return nil + } + } +} + +private extension KeyModifiers { + init(json: [String: Any]) { + self.init() + + if (json["control"] as? Bool) ?? false { + insert(.control) + } + if (json["command"] as? Bool) ?? false { + insert(.command) + } + if (json["shift"] as? Bool) ?? false { + insert(.shift) + } + if (json["option"] as? Bool) ?? false { + insert(.option) + } + } +} + private extension KeyEvent { /// Parses the dictionary created in keyboard.js init?(dict: [String: Any]) { - guard let code = dict["code"] as? String else { + guard + let phase = Phase(json: dict["phase"]), + let code = dict["code"] as? String + else { return nil } + let key: Key switch code { case "Enter": key = .enter @@ -662,22 +772,25 @@ private extension KeyEvent { key = .character(char.lowercased()) } - var modifiers: KeyModifiers = [] - if let holdCommand = dict["command"] as? Bool, holdCommand { - modifiers.insert(.command) - } - if let holdControl = dict["control"] as? Bool, holdControl { - modifiers.insert(.control) - } - if let holdOption = dict["option"] as? Bool, holdOption { - modifiers.insert(.option) - } - if let holdShift = dict["shift"] as? Bool, holdShift { - modifiers.insert(.shift) - } + var modifiers = KeyModifiers(json: dict) if let modifier = KeyModifiers(key: key) { modifiers.remove(modifier) } - self.modifiers = modifiers + + self.init(phase: phase, key: key, modifiers: modifiers) + } +} + +private extension KeyEvent.Phase { + init?(json: Any?) { + guard let json = json as? String else { + return nil + } + + switch json { + case "up": self = .up + case "down": self = .down + default: return nil + } } } diff --git a/Sources/Navigator/EPUB/Scripts/src/decorator.js b/Sources/Navigator/EPUB/Scripts/src/decorator.js index 894f6520f..b474f14aa 100644 --- a/Sources/Navigator/EPUB/Scripts/src/decorator.js +++ b/Sources/Navigator/EPUB/Scripts/src/decorator.js @@ -59,31 +59,7 @@ export function getDecorations(groupName) { * Returns whether a decoration matched this event. */ export function handleDecorationClickEvent(event, clickEvent) { - if (groups.size === 0) { - return false; - } - - function findTarget() { - for (const [group, groupContent] of groups) { - if (!groupContent.isActivable()) { - continue; - } - - for (const item of groupContent.items.reverse()) { - if (!item.clickableElements) { - continue; - } - for (const element of item.clickableElements) { - let rect = element.getBoundingClientRect().toJSON(); - if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) { - return { group, item, element, rect }; - } - } - } - } - } - - let target = findTarget(); + let target = findDecorationTarget(event); if (!target) { return false; } @@ -96,6 +72,34 @@ export function handleDecorationClickEvent(event, clickEvent) { return true; } +/** + * Finds any Decoration under the given pointer event, if any. + */ +export function findDecorationTarget(event) { + if (groups.size === 0) { + return null; + } + + for (const [group, groupContent] of groups) { + if (!groupContent.isActivable()) { + continue; + } + + for (const item of groupContent.items.reverse()) { + if (!item.clickableElements) { + continue; + } + for (const element of item.clickableElements) { + let rect = element.getBoundingClientRect().toJSON(); + if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) { + return { group, item, element, rect }; + } + } + } + } + return null; +} + /** * Creates a DecorationGroup object from a unique HTML ID and its name. */ diff --git a/Sources/Navigator/EPUB/Scripts/src/gestures.js b/Sources/Navigator/EPUB/Scripts/src/gestures.js index a3020e621..7071b5b03 100644 --- a/Sources/Navigator/EPUB/Scripts/src/gestures.js +++ b/Sources/Navigator/EPUB/Scripts/src/gestures.js @@ -4,12 +4,16 @@ // available in the top-level LICENSE file of the project. // -import { handleDecorationClickEvent } from "./decorator"; +import { findDecorationTarget, handleDecorationClickEvent } from "./decorator"; import { adjustPointToViewport } from "./rect"; import { findNearestInteractiveElement } from "./dom"; window.addEventListener("DOMContentLoaded", function () { document.addEventListener("click", onClick, false); + document.addEventListener("pointerdown", onPointerDown, false); + document.addEventListener("pointerup", onPointerUp, false); + document.addEventListener("pointermove", onPointerMove, false); + document.addEventListener("pointercancel", onPointerCancel, false); }); function onClick(event) { @@ -40,3 +44,51 @@ function onClick(event) { // event.stopPropagation(); // event.preventDefault(); } + +function onPointerDown(event) { + onPointerEvent("down", event); +} + +function onPointerUp(event) { + onPointerEvent("up", event); +} + +function onPointerMove(event) { + onPointerEvent("move", event); +} + +function onPointerCancel(event) { + onPointerEvent("cancel", event); +} + +function onPointerEvent(phase, event) { + let point = adjustPointToViewport({ x: event.clientX, y: event.clientY }); + let pointerEvent = { + phase: phase, + defaultPrevented: event.defaultPrevented, + pointerId: event.pointerId, + pointerType: event.pointerType, + x: point.x, + y: point.y, + buttons: event.buttons, + targetElement: event.target.outerHTML, + interactiveElement: findNearestInteractiveElement(event.target), + option: event.altKey, + control: event.ctrlKey, + shift: event.shiftKey, + command: event.metaKey, + }; + + if (findDecorationTarget(event) != null) { + return; + } + + // Send the pointer data over the JS bridge even if it's been handled + // within the webview, so that it can be preserved and used + // by the WKNavigationDelegate if needed. + webkit.messageHandlers.pointerEventReceived.postMessage(pointerEvent); + + // We don't want to disable the default WebView behavior as it breaks some features without bringing any value. + // event.stopPropagation(); + // event.preventDefault(); +} diff --git a/Sources/Navigator/EPUB/Scripts/src/keyboard.js b/Sources/Navigator/EPUB/Scripts/src/keyboard.js index 388c7c2da..8e9ce7b30 100644 --- a/Sources/Navigator/EPUB/Scripts/src/keyboard.js +++ b/Sources/Navigator/EPUB/Scripts/src/keyboard.js @@ -12,7 +12,7 @@ window.addEventListener("keydown", (event) => { } preventDefault(event); - sendPressKeyMessage(event, "keydown"); + sendKeyEvent("down", event); }); window.addEventListener("keyup", (event) => { @@ -21,7 +21,7 @@ window.addEventListener("keyup", (event) => { } preventDefault(event); - sendPressKeyMessage(event, "keyup"); + sendKeyEvent("up", event); }); function shouldIgnoreEvent(event) { @@ -38,10 +38,10 @@ function preventDefault(event) { event.preventDefault(); } -function sendPressKeyMessage(event, keyType) { +function sendKeyEvent(phase, event) { if (event.repeat) return; - webkit.messageHandlers.pressKey.postMessage({ - type: keyType, + webkit.messageHandlers.keyEventReceived.postMessage({ + phase: phase, code: event.code, // We use a deprecated `keyCode` property, because the value of `event.key` // changes depending on which modifier is pressed, while `event.code` shows diff --git a/Sources/Navigator/Input/InputObservable.swift b/Sources/Navigator/Input/InputObservable.swift new file mode 100644 index 000000000..f4169fdb6 --- /dev/null +++ b/Sources/Navigator/Input/InputObservable.swift @@ -0,0 +1,54 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +/// A type broadcasting user input events (e.g. touch or keyboard events) to +/// a set of observers. +public protocol InputObservable { + /// Registers a new ``InputObserver`` for the observable receiver. + /// + /// - Returns: An opaque token which can be used to remove the observer with + /// `removeInputObserver`. + @discardableResult + mutating func addInputObserver(_ observer: InputObserver) -> InputObserverToken + + /// Unregisters an ``InputObserver`` from this receiver using the given + /// `token` returned by `addInputObserver`. + mutating func removeObserver(_ token: InputObserverToken) +} + +/// A type observing user input events (e.g. touch or keyboard events) +/// broadcasted by an ``InputObservable`` instance. +public protocol InputObserver { + /// Called when receiving a pointer event, such as a mouse click or a touch + /// event. + /// + /// - Returns: Indicates whether this observer consumed the event, which + /// will not be forwarded to other observers. + func didReceive(_ event: PointerEvent) -> Bool + + /// Called when receiving a keyboard event. + /// + /// - Returns: Indicates whether this observer consumed the event, which + /// will not be forwarded to other observers. + func didReceive(_ event: KeyEvent) -> Bool +} + +public extension InputObserver { + func didReceive(_ event: PointerEvent) -> Bool { false } + func didReceive(_ event: KeyEvent) -> Bool { false } +} + +/// A token which can be used to remove an ``InputObserver`` from an +/// ``InputObservable``. +public struct InputObserverToken: Hashable, Identifiable { + public let id: AnyHashable + + public init(id: AnyHashable = UUID()) { + self.id = id + } +} diff --git a/Sources/Navigator/Input/InputObserverSet.swift b/Sources/Navigator/Input/InputObserverSet.swift new file mode 100644 index 000000000..9af94c9a6 --- /dev/null +++ b/Sources/Navigator/Input/InputObserverSet.swift @@ -0,0 +1,39 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +/// Utility to store and manage a set of ``InputObserver``. +struct InputObserverSet: InputObserver, InputObservable { + private var observers: [InputObserverToken: InputObserver] = [:] + + mutating func addInputObserver(_ observer: any InputObserver) -> InputObserverToken { + let token = InputObserverToken() + precondition(observers[token] == nil) + observers[token] = observer + return token + } + + mutating func removeObserver(_ token: InputObserverToken) { + observers.removeValue(forKey: token) + } + + func didReceive(_ event: PointerEvent) -> Bool { + for (_, observer) in observers { + if observer.didReceive(event) { + return true + } + } + return false + } + + func didReceive(_ event: KeyEvent) -> Bool { + for (_, observer) in observers { + if observer.didReceive(event) { + return true + } + } + return false + } +} diff --git a/Sources/Navigator/KeyEvent.swift b/Sources/Navigator/Input/KeyEvent.swift similarity index 67% rename from Sources/Navigator/KeyEvent.swift rename to Sources/Navigator/Input/KeyEvent.swift index 1188af7b6..7814b61ee 100644 --- a/Sources/Navigator/KeyEvent.swift +++ b/Sources/Navigator/Input/KeyEvent.swift @@ -9,19 +9,40 @@ import UIKit /// Represents a keyboard event emitted by a Navigator. public struct KeyEvent: Equatable, CustomStringConvertible { + /// Phase of this event, e.g. pressed or released. + public let phase: Phase + /// Key the user pressed or released. public let key: Key /// Additional key modifiers for keyboard shortcuts. public let modifiers: KeyModifiers - public init(key: Key, modifiers: KeyModifiers = []) { + public init(phase: Phase, key: Key, modifiers: KeyModifiers = []) { + self.phase = phase self.key = key self.modifiers = modifiers } public var description: String { - modifiers.description + " " + key.description + "\(phase) \(modifiers) \(key.description)" + } + + /// Phase of a key event, e.g. pressed or released. + public enum Phase: Equatable, CustomStringConvertible { + case down + case change + case up + case cancel + + public var description: String { + switch self { + case .down: "down" + case .up: "up" + case .change: "change" + case .cancel: "cancel" + } + } } } @@ -101,57 +122,6 @@ public enum Key: Equatable, CustomStringConvertible { } } -/// Represents a set of modifier keys held together. -public struct KeyModifiers: OptionSet, CustomStringConvertible { - public static let command = KeyModifiers(rawValue: 1 << 0) - public static let control = KeyModifiers(rawValue: 1 << 1) - public static let option = KeyModifiers(rawValue: 1 << 2) - public static let shift = KeyModifiers(rawValue: 1 << 3) - - public var rawValue: Int - - public init(rawValue: Int) { - self.rawValue = rawValue - } - - public init?(key: Key) { - switch key { - case .command: - self = .command - case .control: - self = .control - case .option: - self = .option - case .shift: - self = .shift - default: - return nil - } - } - - public var description: String { - var modifiers: [String] = [] - if contains(.command) { - modifiers.append("Command") - } - if contains(.control) { - modifiers.append("Control") - } - if contains(.option) { - modifiers.append("Option") - } - if contains(.shift) { - modifiers.append("Shift") - } - - guard !modifiers.isEmpty else { - return "[]" - } - - return "[" + modifiers.joined(separator: ",") + "]" - } -} - // MARK: - UIKit extensions public extension KeyEvent { @@ -167,7 +137,15 @@ public extension KeyEvent { modifiers.remove(modKey) } - self.init(key: key, modifiers: modifiers) + let phase: Phase = switch uiPress.phase { + case .began: .down + case .changed, .stationary: .change + case .ended: .up + case .cancelled: .cancel + @unknown default: .change + } + + self.init(phase: phase, key: key, modifiers: modifiers) } } @@ -220,26 +198,3 @@ public extension Key { } } } - -public extension KeyModifiers { - init?(uiPress: UIPress) { - guard let flags = uiPress.key?.modifierFlags else { - return nil - } - - self = [] - - if flags.contains(.shift) { - insert(.shift) - } - if flags.contains(.command) { - insert(.command) - } - if flags.contains(.control) { - insert(.control) - } - if flags.contains(.alternate) { - insert(.option) - } - } -} diff --git a/Sources/Navigator/Input/KeyModifiers.swift b/Sources/Navigator/Input/KeyModifiers.swift new file mode 100644 index 000000000..9dce1d606 --- /dev/null +++ b/Sources/Navigator/Input/KeyModifiers.swift @@ -0,0 +1,83 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import UIKit + +/// Represents a set of modifier keys held together. +public struct KeyModifiers: OptionSet, Equatable, CustomStringConvertible { + public static let command = KeyModifiers(rawValue: 1 << 0) + public static let control = KeyModifiers(rawValue: 1 << 1) + public static let option = KeyModifiers(rawValue: 1 << 2) + public static let shift = KeyModifiers(rawValue: 1 << 3) + + public var rawValue: Int + + public init(rawValue: Int) { + self.rawValue = rawValue + } + + public init?(key: Key) { + switch key { + case .command: + self = .command + case .control: + self = .control + case .option: + self = .option + case .shift: + self = .shift + default: + return nil + } + } + + public var description: String { + var modifiers: [String] = [] + if contains(.command) { + modifiers.append("Command") + } + if contains(.control) { + modifiers.append("Control") + } + if contains(.option) { + modifiers.append("Option") + } + if contains(.shift) { + modifiers.append("Shift") + } + + guard !modifiers.isEmpty else { + return "[]" + } + + return "[" + modifiers.joined(separator: ",") + "]" + } +} + +// MARK: - UIKit Extensions + +public extension KeyModifiers { + init?(uiPress: UIPress) { + guard let flags = uiPress.key?.modifierFlags else { + return nil + } + + self = [] + + if flags.contains(.shift) { + insert(.shift) + } + if flags.contains(.command) { + insert(.command) + } + if flags.contains(.control) { + insert(.control) + } + if flags.contains(.alternate) { + insert(.option) + } + } +} diff --git a/Sources/Navigator/Input/PointerEvent.swift b/Sources/Navigator/Input/PointerEvent.swift new file mode 100644 index 000000000..9a0f80d79 --- /dev/null +++ b/Sources/Navigator/Input/PointerEvent.swift @@ -0,0 +1,97 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +/// Represents a pointer event (e.g. touch, mouse) emitted by a navigator. +public struct PointerEvent: Equatable { + /// Pointer causing this event. + public var pointer: Pointer + + /// Phase of this event, e.g. up or move. + public var phase: Phase + + /// Location of the pointer event relative to the navigator's view. + public var location: CGPoint + + /// Key modifiers pressed alongside the pointer. + public var modifiers: KeyModifiers + + /// Phase of a pointer event. + public enum Phase: Equatable { + /// Fired when a pointer becomes active. + case down + + /// Fired when a pointer changes coordinates. This event is also used if + /// the change in pointer state cannot be reported by other events. + case move + + /// Fired when a pointer is no longer active. + case up + + /// Fired if the navigator cannot generate more events for this pointer, + /// for example because the interaction was captured by the system. + case cancel + } +} + +/// Represents a pointer device, such as a mouse or a physical touch. +public enum Pointer: Equatable { + case touch(TouchPointer) + case mouse(MousePointer) + + /// Unique identifier for this pointer. + var id: AnyHashable { + switch self { + case let .touch(pointer): + return pointer.id + case let .mouse(pointer): + return pointer.id + } + } +} + +/// Represents a physical touch pointer. +public struct TouchPointer: Identifiable, Equatable { + /// Unique identifier for this pointer. + public let id: AnyHashable + + public init(id: AnyHashable) { + self.id = id + } +} + +/// Represents a mouse pointer. +public struct MousePointer: Identifiable, Equatable { + /// Unique identifier for this pointer. + public let id: AnyHashable + + /// Indicates which buttons are pressed on the mouse. + public let buttons: MouseButtons + + public init(id: AnyHashable, buttons: MouseButtons) { + self.id = id + self.buttons = buttons + } +} + +/// Represents a set of mouse buttons. +public struct MouseButtons: OptionSet, Equatable { + /// Main button, usually the left button. + public static let main = MouseButtons(rawValue: 1 << 0) + + /// Auxiliary button, usually the wheel button or the middle button. + public static let auxiliary = MouseButtons(rawValue: 1 << 1) + + /// Secondary button, usually the right button. + public static let secondary = MouseButtons(rawValue: 1 << 2) + + public var rawValue: Int + + public init(rawValue: Int) { + self.rawValue = rawValue + } +} From 6bc7aeb7be6c1012490f6199e9fcce7dd0b0c378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 6 May 2025 18:04:16 +0200 Subject: [PATCH 02/22] Add a tap observer --- .../EPUB/EPUBNavigatorViewController.swift | 6 +- Sources/Navigator/Input/InputObservable.swift | 28 +--- .../Navigator/Input/InputObserverSet.swift | 39 ------ Sources/Navigator/Input/InputObserving.swift | 132 ++++++++++++++++++ Sources/Navigator/Input/PointerEvent.swift | 2 +- 5 files changed, 139 insertions(+), 68 deletions(-) delete mode 100644 Sources/Navigator/Input/InputObserverSet.swift create mode 100644 Sources/Navigator/Input/InputObserving.swift diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index e1d6a2300..3da155c1b 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -240,7 +240,7 @@ open class EPUBNavigatorViewController: UIViewController, public private(set) var currentLocation: Locator? private let loadPositionsByReadingOrder: () async -> ReadResult<[[Locator]]> private var positionsByReadingOrder: [[Locator]] = [] - private var inputObservers = InputObserverSet() + private var inputObservers = InputObservingSet() private let tasks = CancellableTasks() private let viewModel: EPUBNavigatorViewModel @@ -895,11 +895,11 @@ open class EPUBNavigatorViewController: UIViewController, // MARK: - InputObservable @discardableResult - public func addInputObserver(_ observer: any InputObserver) -> InputObserverToken { + public func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { inputObservers.addInputObserver(observer) } - public func removeObserver(_ token: InputObserverToken) { + public func removeObserver(_ token: InputObservableToken) { inputObservers.removeObserver(token) } diff --git a/Sources/Navigator/Input/InputObservable.swift b/Sources/Navigator/Input/InputObservable.swift index f4169fdb6..d79c036ec 100644 --- a/Sources/Navigator/Input/InputObservable.swift +++ b/Sources/Navigator/Input/InputObservable.swift @@ -14,38 +14,16 @@ public protocol InputObservable { /// - Returns: An opaque token which can be used to remove the observer with /// `removeInputObserver`. @discardableResult - mutating func addInputObserver(_ observer: InputObserver) -> InputObserverToken + mutating func addInputObserver(_ observer: InputObserving) -> InputObservableToken /// Unregisters an ``InputObserver`` from this receiver using the given /// `token` returned by `addInputObserver`. - mutating func removeObserver(_ token: InputObserverToken) -} - -/// A type observing user input events (e.g. touch or keyboard events) -/// broadcasted by an ``InputObservable`` instance. -public protocol InputObserver { - /// Called when receiving a pointer event, such as a mouse click or a touch - /// event. - /// - /// - Returns: Indicates whether this observer consumed the event, which - /// will not be forwarded to other observers. - func didReceive(_ event: PointerEvent) -> Bool - - /// Called when receiving a keyboard event. - /// - /// - Returns: Indicates whether this observer consumed the event, which - /// will not be forwarded to other observers. - func didReceive(_ event: KeyEvent) -> Bool -} - -public extension InputObserver { - func didReceive(_ event: PointerEvent) -> Bool { false } - func didReceive(_ event: KeyEvent) -> Bool { false } + mutating func removeObserver(_ token: InputObservableToken) } /// A token which can be used to remove an ``InputObserver`` from an /// ``InputObservable``. -public struct InputObserverToken: Hashable, Identifiable { +public struct InputObservableToken: Hashable, Identifiable { public let id: AnyHashable public init(id: AnyHashable = UUID()) { diff --git a/Sources/Navigator/Input/InputObserverSet.swift b/Sources/Navigator/Input/InputObserverSet.swift deleted file mode 100644 index 9af94c9a6..000000000 --- a/Sources/Navigator/Input/InputObserverSet.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright 2025 Readium Foundation. All rights reserved. -// Use of this source code is governed by the BSD-style license -// available in the top-level LICENSE file of the project. -// - -/// Utility to store and manage a set of ``InputObserver``. -struct InputObserverSet: InputObserver, InputObservable { - private var observers: [InputObserverToken: InputObserver] = [:] - - mutating func addInputObserver(_ observer: any InputObserver) -> InputObserverToken { - let token = InputObserverToken() - precondition(observers[token] == nil) - observers[token] = observer - return token - } - - mutating func removeObserver(_ token: InputObserverToken) { - observers.removeValue(forKey: token) - } - - func didReceive(_ event: PointerEvent) -> Bool { - for (_, observer) in observers { - if observer.didReceive(event) { - return true - } - } - return false - } - - func didReceive(_ event: KeyEvent) -> Bool { - for (_, observer) in observers { - if observer.didReceive(event) { - return true - } - } - return false - } -} diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift new file mode 100644 index 000000000..8c4291a9a --- /dev/null +++ b/Sources/Navigator/Input/InputObserving.swift @@ -0,0 +1,132 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +/// A type observing user input events (e.g. touch or keyboard events) +/// broadcasted by an ``InputObservable`` instance. +public protocol InputObserving { + /// Called when receiving a pointer event, such as a mouse click or a touch + /// event. + /// + /// - Returns: Indicates whether this observer consumed the event, which + /// will not be forwarded to other observers. + func didReceive(_ event: PointerEvent) -> Bool + + /// Called when receiving a keyboard event. + /// + /// - Returns: Indicates whether this observer consumed the event, which + /// will not be forwarded to other observers. + func didReceive(_ event: KeyEvent) -> Bool +} + +public extension InputObserving { + func didReceive(_ event: PointerEvent) -> Bool { false } + func didReceive(_ event: KeyEvent) -> Bool { false } +} + +public extension InputObserving where Self == TapObserver { + static func tap(_ onTap: @escaping (PointerEvent) -> Bool) -> TapObserver { + TapObserver(onTap: onTap) + } +} + +public final class TapObserver: InputObserving { + public var onTap: (PointerEvent) -> Bool + + public init(onTap: @escaping (PointerEvent) -> Bool) { + self.onTap = onTap + } + + /// Last location of the single active pointer. + private var lastLocation: CGPoint? = nil + + /// Set of currently active pointer IDs. + private var activePointers: Set = [] + + /// True if a multitouch gesture has been detected (and should ignore tap). + private var isMultitouch = false + + /// Indicates whether the touch moved enough to cancel the tap. + private var hasMoved: Bool = false + + public func didReceive(_ event: PointerEvent) -> Bool { + guard case .touch = event.pointer else { + return false + } + + var handled = false + + switch event.phase { + case .down: + activePointers.insert(event.pointer.id) + if activePointers.count > 1 { + isMultitouch = true + } else { + lastLocation = event.location + } + + case .move: + guard !isMultitouch, !hasMoved, let lastLocation = lastLocation else { + break + } + if abs(lastLocation.x - event.location.x) > 1 || abs(lastLocation.y - event.location.y) > 1 { + hasMoved = true + } + + case .up: + activePointers.remove(event.pointer.id) + + // Only recognize tap if: + // - This was not part of a multitouch gesture + // - There are no more active pointers (all fingers up) + if !isMultitouch && !hasMoved { + handled = onTap(event) + } + case .cancel: + activePointers.remove(event.pointer.id) + } + + // If all pointers are up, reset state. + if activePointers.isEmpty { + isMultitouch = false + hasMoved = false + } + + return handled + } +} +/// Utility to store and manage a set of ``InputObserver``. +struct InputObservingSet: InputObservable { + private var observers: [InputObservableToken: InputObserving] = [:] + + mutating func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { + let token = InputObservableToken() + precondition(observers[token] == nil) + observers[token] = observer + return token + } + + mutating func removeObserver(_ token: InputObservableToken) { + observers.removeValue(forKey: token) + } + + func didReceive(_ event: PointerEvent) { + for (_, observer) in observers { + if observer.didReceive(event) { + return + } + } + } + + func didReceive(_ event: KeyEvent) { + for (_, observer) in observers { + if observer.didReceive(event) { + return + } + } + } +} diff --git a/Sources/Navigator/Input/PointerEvent.swift b/Sources/Navigator/Input/PointerEvent.swift index 9a0f80d79..e4a5656bf 100644 --- a/Sources/Navigator/Input/PointerEvent.swift +++ b/Sources/Navigator/Input/PointerEvent.swift @@ -44,7 +44,7 @@ public enum Pointer: Equatable { case mouse(MousePointer) /// Unique identifier for this pointer. - var id: AnyHashable { + public var id: AnyHashable { switch self { case let .touch(pointer): return pointer.id From d290fb3a0aeb3600c35c92cdcd4f7c0e73cd0431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 6 May 2025 18:50:46 +0200 Subject: [PATCH 03/22] Fix tap observer --- .../DirectionalNavigationAdapter.swift | 16 ++++ .../EPUB/EPUBNavigatorViewController.swift | 2 +- Sources/Navigator/Input/InputObservable.swift | 4 +- Sources/Navigator/Input/InputObserving.swift | 92 +++++++++++-------- Sources/Navigator/Input/KeyEvent.swift | 6 +- 5 files changed, 77 insertions(+), 43 deletions(-) diff --git a/Sources/Navigator/DirectionalNavigationAdapter.swift b/Sources/Navigator/DirectionalNavigationAdapter.swift index 85d13e0cf..7af2d702b 100644 --- a/Sources/Navigator/DirectionalNavigationAdapter.swift +++ b/Sources/Navigator/DirectionalNavigationAdapter.swift @@ -76,6 +76,22 @@ public final class DirectionalNavigationAdapter { self.minimumVerticalEdgeSize = minimumVerticalEdgeSize self.verticalEdgeThresholdPercent = verticalEdgeThresholdPercent self.animatedTransition = animatedTransition + + if let navigator = navigator { + bind(to: navigator) + } + } + + /// Binds the adapter to the given visual navigator. + /// + /// It will automatically observe pointer and key events to turn pages. + public func bind(to navigator: VisualNavigator) { + self.navigator = navigator + if let observable = navigator as? InputObservable { + observable.addInputObserver(.tap { event in + await self.didTap(at: event.location) + }) + } } /// Turn pages when `point` is located in one of the tap edges. diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 3da155c1b..ea03570db 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -240,7 +240,7 @@ open class EPUBNavigatorViewController: UIViewController, public private(set) var currentLocation: Locator? private let loadPositionsByReadingOrder: () async -> ReadResult<[[Locator]]> private var positionsByReadingOrder: [[Locator]] = [] - private var inputObservers = InputObservingSet() + private let inputObservers = InputObservingSet() private let tasks = CancellableTasks() private let viewModel: EPUBNavigatorViewModel diff --git a/Sources/Navigator/Input/InputObservable.swift b/Sources/Navigator/Input/InputObservable.swift index d79c036ec..64f412ddd 100644 --- a/Sources/Navigator/Input/InputObservable.swift +++ b/Sources/Navigator/Input/InputObservable.swift @@ -14,11 +14,11 @@ public protocol InputObservable { /// - Returns: An opaque token which can be used to remove the observer with /// `removeInputObserver`. @discardableResult - mutating func addInputObserver(_ observer: InputObserving) -> InputObservableToken + func addInputObserver(_ observer: InputObserving) -> InputObservableToken /// Unregisters an ``InputObserver`` from this receiver using the given /// `token` returned by `addInputObserver`. - mutating func removeObserver(_ token: InputObservableToken) + func removeObserver(_ token: InputObservableToken) } /// A token which can be used to remove an ``InputObserver`` from an diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift index 8c4291a9a..cc94814af 100644 --- a/Sources/Navigator/Input/InputObserving.swift +++ b/Sources/Navigator/Input/InputObserving.swift @@ -8,58 +8,63 @@ import Foundation /// A type observing user input events (e.g. touch or keyboard events) /// broadcasted by an ``InputObservable`` instance. -public protocol InputObserving { +public protocol InputObserving: Sendable { /// Called when receiving a pointer event, such as a mouse click or a touch /// event. /// /// - Returns: Indicates whether this observer consumed the event, which /// will not be forwarded to other observers. - func didReceive(_ event: PointerEvent) -> Bool + func didReceive(_ event: PointerEvent) async -> Bool /// Called when receiving a keyboard event. /// /// - Returns: Indicates whether this observer consumed the event, which /// will not be forwarded to other observers. - func didReceive(_ event: KeyEvent) -> Bool + func didReceive(_ event: KeyEvent) async -> Bool } public extension InputObserving { - func didReceive(_ event: PointerEvent) -> Bool { false } - func didReceive(_ event: KeyEvent) -> Bool { false } + func didReceive(_ event: PointerEvent) async -> Bool { false } + func didReceive(_ event: KeyEvent) async -> Bool { false } } public extension InputObserving where Self == TapObserver { - static func tap(_ onTap: @escaping (PointerEvent) -> Bool) -> TapObserver { - TapObserver(onTap: onTap) + static func tap(modifiers: KeyModifiers = [], _ onTap: @escaping (PointerEvent) async -> Bool) -> TapObserver { + TapObserver(modifiers: modifiers, onTap: onTap) } } -public final class TapObserver: InputObserving { - public var onTap: (PointerEvent) -> Bool - - public init(onTap: @escaping (PointerEvent) -> Bool) { +public actor TapObserver: InputObserving { + private let modifiers: KeyModifiers + private let onTap: (PointerEvent) async -> Bool + + public init( + modifiers: KeyModifiers = [], + onTap: @escaping (PointerEvent) async -> Bool + ) { + self.modifiers = modifiers self.onTap = onTap } - + /// Last location of the single active pointer. private var lastLocation: CGPoint? = nil /// Set of currently active pointer IDs. private var activePointers: Set = [] - + /// True if a multitouch gesture has been detected (and should ignore tap). private var isMultitouch = false - + /// Indicates whether the touch moved enough to cancel the tap. private var hasMoved: Bool = false - - public func didReceive(_ event: PointerEvent) -> Bool { + + public func didReceive(_ event: PointerEvent) async -> Bool { guard case .touch = event.pointer else { return false } - + var handled = false - + switch event.phase { case .down: activePointers.insert(event.pointer.id) @@ -68,7 +73,7 @@ public final class TapObserver: InputObserving { } else { lastLocation = event.location } - + case .move: guard !isMultitouch, !hasMoved, let lastLocation = lastLocation else { break @@ -76,20 +81,20 @@ public final class TapObserver: InputObserving { if abs(lastLocation.x - event.location.x) > 1 || abs(lastLocation.y - event.location.y) > 1 { hasMoved = true } - + case .up: activePointers.remove(event.pointer.id) - + // Only recognize tap if: // - This was not part of a multitouch gesture // - There are no more active pointers (all fingers up) - if !isMultitouch && !hasMoved { - handled = onTap(event) + if !isMultitouch, !hasMoved { + handled = await onTap(event) } case .cancel: activePointers.remove(event.pointer.id) } - + // If all pointers are up, reset state. if activePointers.isEmpty { isMultitouch = false @@ -99,33 +104,46 @@ public final class TapObserver: InputObserving { return handled } } + /// Utility to store and manage a set of ``InputObserver``. -struct InputObservingSet: InputObservable { - private var observers: [InputObservableToken: InputObserving] = [:] +final class InputObservingSet: InputObservable { + private typealias Observer = (token: InputObservableToken, observer: InputObserving) + + private var observers: [Observer] = [] - mutating func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { + func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { let token = InputObservableToken() - precondition(observers[token] == nil) - observers[token] = observer + precondition(!observers.contains { $0.token == token }) + observers.append(Observer(token: token, observer: observer)) return token } - mutating func removeObserver(_ token: InputObservableToken) { - observers.removeValue(forKey: token) + func removeObserver(_ token: InputObservableToken) { + observers.removeAll { $0.token == token } } func didReceive(_ event: PointerEvent) { - for (_, observer) in observers { - if observer.didReceive(event) { - return + Task { + var event = event + for (_, observer) in observers { + if await observer.didReceive(event) { + // Cancel the event for the other observers, as it was + // handled by this one. + event.phase = .cancel + } } } } func didReceive(_ event: KeyEvent) { - for (_, observer) in observers { - if observer.didReceive(event) { - return + Task { + var event = event + for (_, observer) in observers { + if await observer.didReceive(event) { + // Cancel the event for the other observers, as it was + // handled by this one. + event.phase = .cancel + } } } } diff --git a/Sources/Navigator/Input/KeyEvent.swift b/Sources/Navigator/Input/KeyEvent.swift index 7814b61ee..9a751c9eb 100644 --- a/Sources/Navigator/Input/KeyEvent.swift +++ b/Sources/Navigator/Input/KeyEvent.swift @@ -10,13 +10,13 @@ import UIKit /// Represents a keyboard event emitted by a Navigator. public struct KeyEvent: Equatable, CustomStringConvertible { /// Phase of this event, e.g. pressed or released. - public let phase: Phase + public var phase: Phase /// Key the user pressed or released. - public let key: Key + public var key: Key /// Additional key modifiers for keyboard shortcuts. - public let modifiers: KeyModifiers + public var modifiers: KeyModifiers public init(phase: Phase, key: Key, modifiers: KeyModifiers = []) { self.phase = phase From 323c7c3a1f1cbad41b90f055cb453c68422ebd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 14:29:21 +0200 Subject: [PATCH 04/22] Refactoring --- .../DirectionalNavigationAdapter.swift | 2 +- .../scripts/readium-fixed-wrapper-one.js | 2 +- .../scripts/readium-fixed-wrapper-two.js | 2 +- .../Assets/Static/scripts/readium-fixed.js | 2 +- .../Static/scripts/readium-reflowable.js | 2 +- Sources/Navigator/EPUB/EPUBSpreadView.swift | 12 +- Sources/Navigator/EPUB/Scripts/package.json | 18 +-- Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml | 22 +-- .../Input/ActivatePointerObserver.swift | 143 ++++++++++++++++++ Sources/Navigator/Input/InputObserving.swift | 77 ---------- Sources/Navigator/Input/PointerEvent.swift | 79 +++++++++- 11 files changed, 241 insertions(+), 120 deletions(-) create mode 100644 Sources/Navigator/Input/ActivatePointerObserver.swift diff --git a/Sources/Navigator/DirectionalNavigationAdapter.swift b/Sources/Navigator/DirectionalNavigationAdapter.swift index 7af2d702b..5a2307681 100644 --- a/Sources/Navigator/DirectionalNavigationAdapter.swift +++ b/Sources/Navigator/DirectionalNavigationAdapter.swift @@ -59,7 +59,7 @@ public final class DirectionalNavigationAdapter { /// - animatedTransition: Indicates whether the page turns should be /// animated. public init( - navigator: VisualNavigator, + navigator: VisualNavigator? = nil, tapEdges: TapEdges = .horizontal, handleTapsWhileScrolling: Bool = false, minimumHorizontalEdgeSize: Double = 80.0, diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-one.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-one.js index f202edb81..cb106f70b 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-one.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-one.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var e=function(t){var e=null,n=null,i=null,o=document.getElementById("page");o.addEventListener("load",(function(){var t=o.contentWindow.document.querySelector("meta[name=viewport]");if(t){for(var n,i=/(\w+) *= *([^\s,]+)/g,l={};n=i.exec(t.content);)l[n[1]]=n[2];var a=Number.parseFloat(l.width),s=Number.parseFloat(l.height);a&&s&&(e={width:a,height:s},r())}}));var l=o.closest(".viewport");function r(){if(e&&n&&i){o.style.width=e.width+"px",o.style.height=e.height+"px",o.style.marginTop=i.top-i.bottom+"px",o.style.marginLeft=i.left-i.right+"px";var t=n.width/e.width,l=n.height/e.height,r=Math.min(t,l);document.querySelector("meta[name=viewport]").content="initial-scale="+r+", minimum-scale="+r}}return{isLoading:!1,link:null,load:function(t,e){if(t.link&&t.url){var n=this;n.link=t.link,n.isLoading=!0,o.addEventListener("load",(function i(){o.removeEventListener("load",i),setTimeout((function(){n.isLoading=!1,o.contentWindow.eval("readium.link = ".concat(JSON.stringify(t.link),";")),e&&e()}),100)})),o.src=t.url}else e&&e()},reset:function(){this.link&&(this.link=null,e=null,o.src="about:blank")},eval:function(t){if(this.link&&!this.isLoading)return o.contentWindow.eval(t)},setViewport:function(t,e){n=t,i=e,r()},show:function(){l.style.display="block"},hide:function(){l.style.display="none"}}}();t.g.spread={load:function(t){0!==t.length&&e.load(t[0],(function(){webkit.messageHandlers.spreadLoaded.postMessage({})}))},eval:function(t,n){var i;if("#"===t||""===t||(null===(i=e.link)||void 0===i?void 0:i.href)===t)return e.eval(n)},setViewport:function(t,n){e.setViewport(t,n)}}})(); +(()=>{"use strict";var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var e=function(t){var e=null,n=null,i=null,o=document.getElementById("page");o.addEventListener("load",(function(){var t=o.contentWindow.document.querySelector("meta[name=viewport]");if(t){for(var n,i=/(\w+) *= *([^\s,]+)/g,l={};n=i.exec(t.content);)l[n[1]]=n[2];var a=Number.parseFloat(l.width),s=Number.parseFloat(l.height);a&&s&&(e={width:a,height:s},r())}}));var l=o.closest(".viewport");function r(){if(e&&n&&i){o.style.width=e.width+"px",o.style.height=e.height+"px",o.style.marginTop=i.top-i.bottom+"px",o.style.marginLeft=i.left-i.right+"px";var t=n.width/e.width,l=n.height/e.height,r=Math.min(t,l);document.querySelector("meta[name=viewport]").content="initial-scale="+r+", minimum-scale="+r}}return{isLoading:!1,link:null,load:function(t,e){if(t.link&&t.url){var n=this;n.link=t.link,n.isLoading=!0,o.addEventListener("load",(function i(){o.removeEventListener("load",i),setTimeout((function(){n.isLoading=!1,o.contentWindow.eval(`readium.link = ${JSON.stringify(t.link)};`),e&&e()}),100)})),o.src=t.url}else e&&e()},reset:function(){this.link&&(this.link=null,e=null,o.src="about:blank")},eval:function(t){if(this.link&&!this.isLoading)return o.contentWindow.eval(t)},setViewport:function(t,e){n=t,i=e,r()},show:function(){l.style.display="block"},hide:function(){l.style.display="none"}}}();t.g.spread={load:function(t){0!==t.length&&e.load(t[0],(function(){webkit.messageHandlers.spreadLoaded.postMessage({})}))},eval:function(t,n){var i;if("#"===t||""===t||(null===(i=e.link)||void 0===i?void 0:i.href)===t)return e.eval(n)},setViewport:function(t,n){e.setViewport(t,n)}}})(); //# sourceMappingURL=readium-fixed-wrapper-one.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-two.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-two.js index 09830d9e0..845f3537f 100644 --- a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-two.js +++ b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed-wrapper-two.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var t={};function e(t){var e=null,n=null,i=null,o=document.getElementById(t);o.addEventListener("load",(function(){var t=o.contentWindow.document.querySelector("meta[name=viewport]");if(t){for(var n,i=/(\w+) *= *([^\s,]+)/g,r={};n=i.exec(t.content);)r[n[1]]=n[2];var a=Number.parseFloat(r.width),s=Number.parseFloat(r.height);a&&s&&(e={width:a,height:s},l())}}));var r=o.closest(".viewport");function l(){if(e&&n&&i){o.style.width=e.width+"px",o.style.height=e.height+"px",o.style.marginTop=i.top-i.bottom+"px",o.style.marginLeft=i.left-i.right+"px";var t=n.width/e.width,r=n.height/e.height,l=Math.min(t,r);document.querySelector("meta[name=viewport]").content="initial-scale="+l+", minimum-scale="+l}}return{isLoading:!1,link:null,load:function(t,e){if(t.link&&t.url){var n=this;n.link=t.link,n.isLoading=!0,o.addEventListener("load",(function i(){o.removeEventListener("load",i),setTimeout((function(){n.isLoading=!1,o.contentWindow.eval("readium.link = ".concat(JSON.stringify(t.link),";")),e&&e()}),100)})),o.src=t.url}else e&&e()},reset:function(){this.link&&(this.link=null,e=null,o.src="about:blank")},eval:function(t){if(this.link&&!this.isLoading)return o.contentWindow.eval(t)},setViewport:function(t,e){n=t,i=e,l()},show:function(){r.style.display="block"},hide:function(){r.style.display="none"}}}t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var n={left:e("page-left"),right:e("page-right"),center:e("page-center")};function i(t){for(const e in n)t(n[e])}t.g.spread={load:function(t){function e(){n.left.isLoading||n.right.isLoading||n.center.isLoading||webkit.messageHandlers.spreadLoaded.postMessage({})}i((function(t){t.reset(),t.hide()}));for(const i in t){const o=t[i],r=n[o.page];r&&(r.show(),r.load(o,e))}},eval:function(t,e){if("#"===t||""===t)i((function(t){t.eval(e)}));else{var o=function(t){for(const o in n){var e,i=n[o];if((null===(e=i.link)||void 0===e?void 0:e.href)===t)return i}return null}(t);if(o)return o.eval(e)}},setViewport:function(t,e){t.width/=2,n.left.setViewport(t,{top:e.top,right:0,bottom:e.bottom,left:e.left}),n.right.setViewport(t,{top:e.top,right:e.right,bottom:e.bottom,left:0}),n.center.setViewport(t,{top:e.top,right:0,bottom:e.bottom,left:0})}}})(); +(()=>{"use strict";var t={};function e(t){var e=null,n=null,i=null,o=document.getElementById(t);o.addEventListener("load",(function(){var t=o.contentWindow.document.querySelector("meta[name=viewport]");if(t){for(var n,i=/(\w+) *= *([^\s,]+)/g,r={};n=i.exec(t.content);)r[n[1]]=n[2];var a=Number.parseFloat(r.width),s=Number.parseFloat(r.height);a&&s&&(e={width:a,height:s},l())}}));var r=o.closest(".viewport");function l(){if(e&&n&&i){o.style.width=e.width+"px",o.style.height=e.height+"px",o.style.marginTop=i.top-i.bottom+"px",o.style.marginLeft=i.left-i.right+"px";var t=n.width/e.width,r=n.height/e.height,l=Math.min(t,r);document.querySelector("meta[name=viewport]").content="initial-scale="+l+", minimum-scale="+l}}return{isLoading:!1,link:null,load:function(t,e){if(t.link&&t.url){var n=this;n.link=t.link,n.isLoading=!0,o.addEventListener("load",(function i(){o.removeEventListener("load",i),setTimeout((function(){n.isLoading=!1,o.contentWindow.eval(`readium.link = ${JSON.stringify(t.link)};`),e&&e()}),100)})),o.src=t.url}else e&&e()},reset:function(){this.link&&(this.link=null,e=null,o.src="about:blank")},eval:function(t){if(this.link&&!this.isLoading)return o.contentWindow.eval(t)},setViewport:function(t,e){n=t,i=e,l()},show:function(){r.style.display="block"},hide:function(){r.style.display="none"}}}t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var n={left:e("page-left"),right:e("page-right"),center:e("page-center")};function i(t){for(const e in n)t(n[e])}t.g.spread={load:function(t){function e(){n.left.isLoading||n.right.isLoading||n.center.isLoading||webkit.messageHandlers.spreadLoaded.postMessage({})}i((function(t){t.reset(),t.hide()}));for(const i in t){const o=t[i],r=n[o.page];r&&(r.show(),r.load(o,e))}},eval:function(t,e){if("#"===t||""===t)i((function(t){t.eval(e)}));else{var o=function(t){for(const o in n){var e,i=n[o];if((null===(e=i.link)||void 0===e?void 0:e.href)===t)return i}return null}(t);if(o)return o.eval(e)}},setViewport:function(t,e){t.width/=2,n.left.setViewport(t,{top:e.top,right:0,bottom:e.bottom,left:e.left}),n.right.setViewport(t,{top:e.top,right:e.right,bottom:e.bottom,left:0}),n.center.setViewport(t,{top:e.top,right:0,bottom:e.bottom,left:0})}}})(); //# sourceMappingURL=readium-fixed-wrapper-two.js.map \ No newline at end of file diff --git a/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js b/Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js index 5a06199bf..367f6f439 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 u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==H(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==H(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(V(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:K(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return Y("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return Y("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return Y("WeakRef");if(function(u){return!("[object Number]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return K(X(x.call(t)));if(function(u){return!("[object Boolean]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(p.call(t));if(function(u){return!("[object String]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(H(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function H(u){return E.call(u)}function V(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function K(u){return"Object("+u+")"}function Y(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||V(u.right,t,r))&&(u.tope||V(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function H(u,t,e){return(u.left=0&&V(u.left,t.right,e))&&(t.left=0&&V(t.left,u.right,e))&&(u.top=0&&V(u.top,t.bottom,e))&&(t.top=0&&V(t.top,u.bottom,e))}function V(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,K=[],Y="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];K.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);K.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return K.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:Y}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=Y),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&K.splice(K.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){if(0===Nu.size)return null;for(const[t,e]of Nu)if(e.isActivable())for(const r of e.items.reverse())if(r.clickableElements)for(const e of r.clickableElements){let n=e.getBoundingClientRect().toJSON();if(U(n,u.clientX,u.clientY,1))return{group:t,item:r,element:e,rect:n}}return null}function Lu(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const $u={NONE:"",DESCENDANT:" ",CHILD:" > "},_u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Wu="CssSelectorGenerator";function Uu(u="unknown problem",...t){console.warn(`${Wu}: ${u}`,...t)}const zu={selectors:[_u.id,_u.class,_u.tag,_u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Gu(u){return u instanceof RegExp}function Hu(u){return["string","function"].includes(typeof u)||Gu(u)}function Vu(u){return Array.isArray(u)?u.filter(Hu):[]}function qu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function Xu(u,t){if(qu(u))return u.contains(t)||Uu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return qu(e)?(e!==document&&Uu("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."),e):t.ownerDocument.querySelector(":root")}function Ku(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ju(u){return[].concat(...u)}function Zu(u){const t=u.map((u=>{if(Gu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Uu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Uu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Qu(u,t,e){const r=Array.from(Xu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function ut(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;Lu(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function tt(u,t){return Yu(u.map((u=>ut(u,t))))}const et=new RegExp(["^$","\\s"].join("|")),rt=new RegExp(["^$"].join("|")),nt=[_u.nthoftype,_u.tag,_u.id,_u.class,_u.attribute,_u.nthchild],ot=Zu(["class","id","ng-*"]);function Dt({name:u}){return`[${u}]`}function it({name:u,value:t}){return`[${u}='${t}']`}function at({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:Bt(t)};var e}function Ft(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||ot(u))}(t,u))).map(at);return[...t.map(Dt),...t.map(it)]}function ct(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!rt.test(u))).map((u=>`.${Bt(u)}`))}function st(u){const t=u.getAttribute("id")||"",e=`#${Bt(t)}`,r=u.getRootNode({composed:!1});return!et.test(t)&&Qu([u],e,r)?[e]:[]}function lt(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(Lu).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function ft(u){return[Bt(u.tagName.toLowerCase())]}function pt(u){const t=[...new Set(Ju(u.map(ft)))];return 0===t.length||t.length>1?[]:[t[0]]}function Et(u){const t=pt([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function At(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=yt(1);for(;r.length<=u.length&&eu[t]));yield t,r=Ct(r,u.length-1)}}(u,{maxResults:t}))}function Ct(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return yt(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?yt(e+1):r}function yt(u=1){return Array.from(Array(u).keys())}const dt=":".charCodeAt(0).toString(16).toUpperCase(),ht=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Bt(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${dt} `:ht.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const gt={tag:pt,id:function(u){return 0===u.length||u.length>1?[]:st(u[0])},class:function(u){return Yu(u.map(ct))},attribute:function(u){return Yu(u.map(Ft))},nthchild:function(u){return Yu(u.map(lt))},nthoftype:function(u){return Yu(u.map(Et))}},mt={tag:ft,id:st,class:ct,attribute:Ft,nthchild:lt,nthoftype:Et};function bt(u){return u.includes(_u.tag)||u.includes(_u.nthoftype)?[...u]:[...u,_u.tag]}function vt(u={}){const t=[...nt];return u[_u.tag]&&u[_u.nthoftype]&&t.splice(t.indexOf(_u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function wt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+$u.DESCENDANT+u)),...u.map((u=>t+$u.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Zu(e),i=Zu(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=gt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?At(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?At(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(bt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(vt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ju(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Qu(u,t,r.root))return t;return null}function xt(u){return{value:u,include:!1}}function St({selectors:u,operator:t}){let e=[...nt];u[_u.tag]&&u[_u.nthoftype]&&(e=e.filter((u=>u!==_u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function Ot(u){return[":root",...ut(u).reverse().map((u=>{const t=function(u,t,e=$u.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return mt[t](u)}(u,t).map(xt))})),{element:u,operator:e,selectors:r}}(u,[_u.nthchild],$u.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(St)].join("")}function jt(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(Lu);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},zu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=_u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:Xu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Ku(e.maxCombinations),maxCandidates:Ku(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...tt(u,t).map((u=>[u]))];for(const u of n){const t=wt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Qu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>jt(u,r))).join(", "):function(u){return u.map(Ot).join(", ")}(e)}function Pt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?Pt(u.parentElement):null}function Tt(u){for(var t=0;t0&&t.top0&&t.left{Wt(u)||(Ut(u),zt("down",u))})),window.addEventListener("keyup",(u=>{Wt(u)||(Ut(u),zt("up",u))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Tt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:jt(u)},text:{highlight:u.textContent}}}},window.readium.isFixedLayout=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({})})()})(); +(()=>{var t={9116:(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],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}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,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),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}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=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;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(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=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),I=O.call(Function.call,String.prototype.slice),C=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,k=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=I(t,0,1),r=I(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),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},648: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}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.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)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(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,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=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,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,C="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("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(1740),D=$.custom,F=U(D)?D:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==H(t)||C&&"object"==typeof t&&C in t)}function W(t){return!("[object RegExp]"!==H(t)||C&&"object"==typeof t&&C in t)}function U(t){if(I)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(G(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!G(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.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 q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?k(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?k(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=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)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return G(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=I?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||I?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||C&&"object"==typeof t&&C in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(F&&"function"==typeof e[F]&&$)return $(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}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 Y("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 Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==H(t)||C&&"object"==typeof t&&C in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||C&&"object"==typeof t&&C in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==H(t)||C&&"object"==typeof t&&C in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==H(t)||C&&"object"==typeof t&&C in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&C&&Object(e)===e&&C in e?b.call(H(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function H(t){return h.call(t)}function V(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 q(b.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(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 K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),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)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).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&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;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}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();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&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\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]+/,c=a?/[\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(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=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 u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(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),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(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)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(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 c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);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}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(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?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}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}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(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)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,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.c)(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){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{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+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(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=1===t.direction,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 u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(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=i(t)+e;return new u(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;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(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,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 u=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,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){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;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return k(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&I.apply(null,arguments)}window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const t="readium-virtual-page";var e=document.getElementById(t);if(E()||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)))}}(),x()})).observe(document.body),window.addEventListener("orientationchange",(function(){S(),function(){if(!E()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}()})),S()}),!1);var h,g,m=0,b=0,v=!1,w=0;function x(){readium.isFixedLayout||(b=window.scrollY/document.scrollingElement.scrollHeight,m=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(v||window.requestAnimationFrame((function(){var t;t=(E()?b:m).toString(),webkit.messageHandlers.progressionChanged.postMessage(t),v=!1})),v=!0))}function S(){w=0===window.orientation||180==window.orientation?screen.width:screen.height}function E(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function A(t){return E()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){var e=t+1;return e-e%w}function T(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 l(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)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function I(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function C(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",x),document.addEventListener("selectionchange",(50,h=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(g),g=setTimeout((function(){h.apply(t,e),g=null}),50)}));const M=!1;function k(t){let e=$({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 $(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 D(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=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){H("CLIENT RECT: remove contained"),r.delete(e);break}}else H("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(F(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)){H("CLIENT RECT: remove small, but keep otherwise empty!");break}H("CLIENT RECT: remove small"),o.splice(t,1)}}return H(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function F(t,e,r){for(let n=0;nt!==i&&t!==a)),o=L(i,a);return n.push(o),F(n,e,r)}}return t}function L(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 B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||G(t.right,e,n))&&(t.topr||G(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else H("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(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 z(t,e,r){return(t.left=0&&G(t.left,e.right,r))&&(e.left=0&&G(e.left,t.right,r))&&(t.top=0&&G(t.top,e.bottom,r))&&(e.top=0&&G(e.top,t.bottom,r))}function G(t,e,r){return Math.abs(t-e)<=r}function H(){M&&I.apply(null,arguments)}var V,q=[],X="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"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=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,Y(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}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(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)},et=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)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=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 pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=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),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((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,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(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}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),It=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.");Rt.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(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.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(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const Ct=window.ResizeObserver||It;let Nt=new Map,Mt=new Map;var kt=0;function $t(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new Ct((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Ft={NONE:"",DESCENDANT:" ",CHILD:" > "},Lt={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Lt.id,Lt.class,Lt.tag,Lt.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Gt(t){return Array.isArray(t)?t.filter(zt):[]}function Ht(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Ht(t))return t.contains(e)||_t("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 nto work as intended."),t;const r=e.getRootNode({composed:!1});return Ht(r)?(r!==document&&_t("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):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("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 _t("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 Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Lt.nthoftype,Lt.tag,Lt.id,Lt.class,Lt.attribute,Lt.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(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 ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Lt.tag)||t.includes(Lt.nthoftype)?[...t]:[...t,Lt.tag]}function Ee(t={}){const e=[...re];return t[Lt.tag]&&t[Lt.nthoftype]&&e.splice(e.indexOf(Lt.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Ft.DESCENDANT+t)),...t.map((t=>e+Ft.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Lt.tag]&&t[Lt.nthoftype]&&(r=r.filter((t=>t!==Lt.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Ft.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Lt.nthchild],Ft.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Lt,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Gt(r.whitelist),blacklist:Gt(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(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?Re(t.parentElement):null}function Ie(t){for(var e=0;e0&&e.top0&&e.left{Be(t)||(_e(t),We("down",t))})),window.addEventListener("keyup",(t=>{Be(t)||(_e(t),We("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(console.log("ScrollToPosition"),t<0||t>1)console.log("InvalidPosition");else if(E()){let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void I("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(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 c(r){let n=(o||((o=document.createElement("div")).setAttribute("id",t),o.setAttribute("data-group",e),o.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void C(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.setAttribute("id",r.id),a.setAttribute("data-style",r.decoration.style),a.style.setProperty("pointer-events","none");let u=window.innerWidth,c=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),s=u/(c||1),l=document.scrollingElement,f=l.scrollLeft,p=l.scrollTop;function y(t,e,r){if(t.style.position="absolute","wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===i.width){t.style.width=`${u}px`,t.style.height=`${e.height}px`;let r=Math.floor(e.left/u)*u;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+f}px`,t.style.top=`${e.top+p}px`;else if("page"===i.width){t.style.width=`${s}px`,t.style.height=`${e.height}px`;let r=Math.floor(e.left/s)*s;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}}let d,h=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),d=t.content.firstElementChild}catch(t){return void C(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){let t=!0,e=D(r.range,t);e=e.sort(((t,e)=>t.tope.top?1:0));for(let t of e){const e=d.cloneNode(!0);e.style.setProperty("pointer-events","none"),y(e,t,h),a.append(e)}}else if("bounds"===i.layout){const t=d.cloneNode(!0);t.style.setProperty("pointer-events","none"),y(t,h,h),a.append(t)}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 s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+kt++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ie(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(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 2e96202ac..d50dd5470 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 u={9116:(u,t)=>{"use strict";function e(u){return u.split("").reverse().join("")}function r(u){return(u|-u)>>31&1}function n(u,t,e,n){var o=u.P[e],D=u.M[e],i=n>>>31,a=t[e]|i,F=a|D,c=(a&o)+o^o|a,s=D|~(c|o),l=o&c,f=r(s&u.lastRowMask[e])-r(l&u.lastRowMask[e]);return s<<=1,l<<=1,o=(l|=i)|~(F|(s|=r(n)-i)),D=s&F,u.P[e]=o,u.M[e]=D,f}function o(u,t,e){if(0===t.length)return[];e=Math.min(e,t.length);var r=[],o=32,D=Math.ceil(t.length/o)-1,i={P:new Uint32Array(D+1),M:new Uint32Array(D+1),lastRowMask:new Uint32Array(D+1)};i.lastRowMask.fill(1<<31),i.lastRowMask[D]=1<<(t.length-1)%o;for(var a=new Uint32Array(D+1),F=new Map,c=[],s=0;s<256;s++)c.push(a);for(var l=0;l=t.length||t.charCodeAt(C)===f&&(p[E]|=1<0&&d[y]>=e+o;)y-=1;y===D&&d[y]<=e&&(d[y]{"use strict";var r=e(4624),n=e(5096),o=n(r("String.prototype.indexOf"));u.exports=function(u,t){var e=r(u,!!t);return"function"==typeof e&&o(u,".prototype.")>-1?n(e):e}},5096:(u,t,e)=>{"use strict";var r=e(3520),n=e(4624),o=e(5676),D=e(2824),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),F=n("%Reflect.apply%",!0)||r.call(a,i),c=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(u){c=null}u.exports=function(u){if("function"!=typeof u)throw new D("a function is required");var t=F(r,a,arguments);return o(t,1+s(0,u.length-(arguments.length-1)),!0)};var l=function(){return F(r,i,arguments)};c?c(u.exports,"apply",{value:l}):u.exports.apply=l},2448:(u,t,e)=>{"use strict";var r=e(3268)(),n=e(4624),o=r&&n("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var D=e(6500),i=e(2824),a=e(6168);u.exports=function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)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 r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,F=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],s=!!a&&a(u,t);if(o)o(u,t,{configurable:null===F&&s?s.configurable:!F,enumerable:null===r&&s?s.enumerable:!r,value:e,writable:null===n&&s?s.writable:!n});else{if(!c&&(r||n||F))throw new D("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");u[t]=e}}},2732:(u,t,e)=>{"use strict";var r=e(2812),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,D=Array.prototype.concat,i=e(2448),a=e(3268)(),F=function(u,t,e,r){if(t in u)if(!0===r){if(u[t]===e)return}else if("function"!=typeof(n=r)||"[object Function]"!==o.call(n)||!r())return;var n;a?i(u,t,e,!0):i(u,t,e)},c=function(u,t){var e=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=D.call(o,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";u.exports=EvalError},1152:u=>{"use strict";u.exports=Error},1932:u=>{"use strict";u.exports=RangeError},5028:u=>{"use strict";u.exports=ReferenceError},6500:u=>{"use strict";u.exports=SyntaxError},2824:u=>{"use strict";u.exports=TypeError},5488:u=>{"use strict";u.exports=URIError},9200:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=e(4712)(),o=e(4440),D=n?Symbol.toStringTag:null;u.exports=function(u,t){var e=arguments.length>2&&arguments[2]&&arguments[2].force;!D||!e&&o(u,D)||(r?r(u,D,{configurable:!0,enumerable:!1,value:t,writable:!1}):u[D]=t)}},108:(u,t,e)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=e(5988),o=e(648),D=e(1844),i=e(7256);u.exports=function(u){if(n(u))return u;var t,e="default";if(arguments.length>1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number")),r&&(Symbol.toPrimitive?t=function(u,t){var e=u[t];if(null!=e){if(!o(e))throw new TypeError(e+" returned for property "+t+" of object "+u+" is not a function");return e}}(u,Symbol.toPrimitive):i(u)&&(t=Symbol.prototype.valueOf)),void 0!==t){var a=t.call(u,e);if(n(a))return a;throw new TypeError("unable to convert exotic object to primitive")}return"default"===e&&(D(u)||i(u))&&(e="string"),function(u,t){if(null==u)throw new TypeError("Cannot call method on "+u);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var e,r,D,i="string"===t?["toString","valueOf"]:["valueOf","toString"];for(D=0;D{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},1480:u=>{"use strict";var t=Object.prototype.toString,e=Math.max,r=function(u,t){for(var e=[],r=0;r{"use strict";var r=e(1480);u.exports=Function.prototype.bind||r},2656:u=>{"use strict";var t=function(){return"string"==typeof function(){}.name},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch(u){e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var u=e((function(){}),"name");return!!u&&!!u.configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},u.exports=t},4624:(u,t,e)=>{"use strict";var r,n=e(1152),o=e(7261),D=e(1932),i=e(5028),a=e(6500),F=e(2824),c=e(5488),s=Function,l=function(u){try{return s('"use strict"; return ('+u+").constructor;")()}catch(u){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(u){f=null}var p=function(){throw new F},E=f?function(){try{return p}catch(u){try{return f(arguments,"callee").get}catch(u){return p}}}():p,A=e(9800)(),C=e(7e3)(),y=Object.getPrototypeOf||(C?function(u){return u.__proto__}:null),d={},h="undefined"!=typeof Uint8Array&&y?y(Uint8Array):r,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":D,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&y?y(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":h,"%TypeError%":F,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(u){var g=y(y(u));B["%Error.prototype%"]=g}var m=function u(t){var e;if("%AsyncFunction%"===t)e=l("async function () {}");else if("%GeneratorFunction%"===t)e=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)e=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=u("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=u("%AsyncGenerator%");n&&y&&(e=y(n.prototype))}return B[t]=e,e},b={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=e(3520),w=e(4440),x=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),P=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,I=function(u,t){var e,r=u;if(w(b,r)&&(r="%"+(e=b[r])[0]+"%"),w(B,r)){var n=B[r];if(n===d&&(n=m(r)),void 0===n&&!t)throw new F("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:e,name:r,value:n}}throw new a("intrinsic "+u+" does not exist!")};u.exports=function(u,t){if("string"!=typeof u||0===u.length)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new F('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,u))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var e=function(u){var t=j(u,0,1),e=j(u,-1);if("%"===t&&"%"!==e)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===e&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return O(u,T,(function(u,t,e,n){r[r.length]=e?O(n,R,"$1"):t||u})),r}(u),r=e.length>0?e[0]:"",n=I("%"+r+"%",t),o=n.name,D=n.value,i=!1,c=n.alias;c&&(r=c[0],S(e,x([0,1],c)));for(var s=1,l=!0;s=e.length){var C=f(D,p);D=(l=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:D[p]}else l=w(D,p),D=D[p];l&&!i&&(B[o]=D)}}return D}},6168:(u,t,e)=>{"use strict";var r=e(4624)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(u){r=null}u.exports=r},3268:(u,t,e)=>{"use strict";var r=e(4624)("%Object.defineProperty%",!0),n=function(){if(r)try{return r({},"a",{value:1}),!0}catch(u){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==r([],"length",{value:1}).length}catch(u){return!0}},u.exports=n},7e3:u=>{"use strict";var t={foo:{}},e=Object;u.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)}},9800:(u,t,e)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,n=e(7904);u.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}},7904:u=>{"use strict";u.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var u={},t=Symbol("test"),e=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(t in u[t]=42,u)return!1;if("function"==typeof Object.keys&&0!==Object.keys(u).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(u).length)return!1;var r=Object.getOwnPropertySymbols(u);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(u,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(u,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},4712:(u,t,e)=>{"use strict";var r=e(7904);u.exports=function(){return r()&&!!Symbol.toStringTag}},4440:(u,t,e)=>{"use strict";var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=e(3520);u.exports=o.call(r,n)},7284:(u,t,e)=>{"use strict";var r=e(4440),n=e(3147)(),o=e(2824),D={assert:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");if(n.assert(u),!D.has(u,t))throw new o("`"+t+"` is not present on `O`")},get:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return e&&e["$"+t]},has:function(u,t){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var e=n.get(u);return!!e&&r(e,"$"+t)},set:function(u,t,e){if(!u||"object"!=typeof u&&"function"!=typeof u)throw new o("`O` is not an object");if("string"!=typeof t)throw new o("`slot` must be a string");var r=n.get(u);r||(r={},n.set(u,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(D),u.exports=D},648:u=>{"use strict";var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(u){u!==e&&(n=null)}else n=null;var o=/^\s*class\b/,D=function(u){try{var t=r.call(u);return o.test(t)}catch(u){return!1}},i=function(u){try{return!D(u)&&(r.call(u),!0)}catch(u){return!1}},a=Object.prototype.toString,F="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(s=function(u){if((c||!u)&&(void 0===u||"object"==typeof u))try{var t=a.call(u);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==u("")}catch(u){}return!1})}u.exports=n?function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;try{n(u,null,t)}catch(u){if(u!==e)return!1}return!D(u)&&i(u)}:function(u){if(s(u))return!0;if(!u)return!1;if("function"!=typeof u&&"object"!=typeof u)return!1;if(F)return i(u);if(D(u))return!1;var t=a.call(u);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&i(u)}},1844:(u,t,e)=>{"use strict";var r=Date.prototype.getDay,n=Object.prototype.toString,o=e(4712)();u.exports=function(u){return"object"==typeof u&&null!==u&&(o?function(u){try{return r.call(u),!0}catch(u){return!1}}(u):"[object Date]"===n.call(u))}},1476:(u,t,e)=>{"use strict";var r,n,o,D,i=e(668),a=e(4712)();if(a){r=i("Object.prototype.hasOwnProperty"),n=i("RegExp.prototype.exec"),o={};var F=function(){throw o};D={toString:F,valueOf:F},"symbol"==typeof Symbol.toPrimitive&&(D[Symbol.toPrimitive]=F)}var c=i("Object.prototype.toString"),s=Object.getOwnPropertyDescriptor;u.exports=a?function(u){if(!u||"object"!=typeof u)return!1;var t=s(u,"lastIndex");if(!t||!r(t,"value"))return!1;try{n(u,D)}catch(u){return u===o}}:function(u){return!(!u||"object"!=typeof u&&"function"!=typeof u)&&"[object RegExp]"===c(u)}},7256:(u,t,e)=>{"use strict";var r=Object.prototype.toString;if(e(9800)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;u.exports=function(u){if("symbol"==typeof u)return!0;if("[object Symbol]"!==r.call(u))return!1;try{return function(u){return"symbol"==typeof u.valueOf()&&o.test(n.call(u))}(u)}catch(u){return!1}}}else u.exports=function(u){return!1}},4152:(u,t,e)=>{var r="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&n&&"function"==typeof n.get?n.get:null,D=r&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=i&&a&&"function"==typeof a.get?a.get:null,c=i&&Set.prototype.forEach,s="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,E=Object.prototype.toString,A=Function.prototype.toString,C=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,h=String.prototype.toUpperCase,B=String.prototype.toLowerCase,g=RegExp.prototype.test,m=Array.prototype.concat,b=Array.prototype.join,v=Array.prototype.slice,w=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(u){return u.__proto__}:null);function I(u,t){if(u===1/0||u===-1/0||u!=u||u&&u>-1e3&&u<1e3||g.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof u){var r=u<0?-w(-u):w(u);if(r!==u){var n=String(r),o=y.call(t,n.length+1);return d.call(n,e,"$&_")+"."+d.call(d.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(t,e,"$&_")}var N=e(1740),M=N.custom,k=U(M)?M:null;function L(u,t,e){var r="double"===(e.quoteStyle||t)?'"':"'";return r+u+r}function $(u){return d.call(String(u),/"/g,""")}function _(u){return!("[object Array]"!==H(u)||P&&"object"==typeof u&&P in u)}function W(u){return!("[object RegExp]"!==H(u)||P&&"object"==typeof u&&P in u)}function U(u){if(j)return u&&"object"==typeof u&&u instanceof Symbol;if("symbol"==typeof u)return!0;if(!u||"object"!=typeof u||!O)return!1;try{return O.call(u),!0}catch(u){}return!1}u.exports=function u(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var E=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof E&&"symbol"!==E)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return q(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var g=String(t);return h?I(t,g):g}if("bigint"==typeof t){var w=String(t)+"n";return h?I(t,w):w}var S=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=S&&S>0&&"object"==typeof t)return _(t)?"[Array]":"[Object]";var M,z=function(u,t){var e;if("\t"===u.indent)e="\t";else{if(!("number"==typeof u.indent&&u.indent>0))return null;e=b.call(Array(u.indent+1)," ")}return{base:e,prev:b.call(Array(t+1),e)}}(a,n);if(void 0===i)i=[];else if(V(i,t)>=0)return"[Circular]";function X(t,e,r){if(e&&(i=v.call(i)).push(e),r){var o={depth:a.depth};return G(a,"quoteStyle")&&(o.quoteStyle=a.quoteStyle),u(t,o,n+1,i)}return u(t,a,n+1,i)}if("function"==typeof t&&!W(t)){var uu=function(u){if(u.name)return u.name;var t=C.call(A.call(u),/^function\s*([\w$]+)/);return t?t[1]:null}(t),tu=Q(t,X);return"[Function"+(uu?": "+uu:" (anonymous)")+"]"+(tu.length>0?" { "+b.call(tu,", ")+" }":"")}if(U(t)){var eu=j?d.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?eu:K(eu)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var ru="<"+B.call(String(t.nodeName)),nu=t.attributes||[],ou=0;ou"}if(_(t)){if(0===t.length)return"[]";var Du=Q(t,X);return z&&!function(u){for(var t=0;t=0)return!1;return!0}(Du)?"["+Z(Du,z)+"]":"[ "+b.call(Du,", ")+" ]"}if(function(u){return!("[object Error]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)){var iu=Q(t,X);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===iu.length?"["+String(t)+"]":"{ ["+String(t)+"] "+b.call(iu,", ")+" }":"{ ["+String(t)+"] "+b.call(m.call("[cause]: "+X(t.cause),iu),", ")+" }"}if("object"==typeof t&&E){if(k&&"function"==typeof t[k]&&N)return N(t,{depth:S-n});if("symbol"!==E&&"function"==typeof t.inspect)return t.inspect()}if(function(u){if(!o||!u||"object"!=typeof u)return!1;try{o.call(u);try{F.call(u)}catch(u){return!0}return u instanceof Map}catch(u){}return!1}(t)){var au=[];return D&&D.call(t,(function(u,e){au.push(X(e,t,!0)+" => "+X(u,t))})),J("Map",o.call(t),au,z)}if(function(u){if(!F||!u||"object"!=typeof u)return!1;try{F.call(u);try{o.call(u)}catch(u){return!0}return u instanceof Set}catch(u){}return!1}(t)){var Fu=[];return c&&c.call(t,(function(u){Fu.push(X(u,t))})),J("Set",F.call(t),Fu,z)}if(function(u){if(!s||!u||"object"!=typeof u)return!1;try{s.call(u,s);try{l.call(u,l)}catch(u){return!0}return u instanceof WeakMap}catch(u){}return!1}(t))return Y("WeakMap");if(function(u){if(!l||!u||"object"!=typeof u)return!1;try{l.call(u,l);try{s.call(u,s)}catch(u){return!0}return u instanceof WeakSet}catch(u){}return!1}(t))return Y("WeakSet");if(function(u){if(!f||!u||"object"!=typeof u)return!1;try{return f.call(u),!0}catch(u){}return!1}(t))return Y("WeakRef");if(function(u){return!("[object Number]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(Number(t)));if(function(u){if(!u||"object"!=typeof u||!x)return!1;try{return x.call(u),!0}catch(u){}return!1}(t))return K(X(x.call(t)));if(function(u){return!("[object Boolean]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(p.call(t));if(function(u){return!("[object String]"!==H(u)||P&&"object"==typeof u&&P in u)}(t))return K(X(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===e.g)return"{ [object globalThis] }";if(!function(u){return!("[object Date]"!==H(u)||P&&"object"==typeof u&&P in u)}(t)&&!W(t)){var cu=Q(t,X),su=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,lu=t instanceof Object?"":"null prototype",fu=!su&&P&&Object(t)===t&&P in t?y.call(H(t),8,-1):lu?"Object":"",pu=(su||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fu||lu?"["+b.call(m.call([],fu||[],lu||[]),": ")+"] ":"");return 0===cu.length?pu+"{}":z?pu+"{"+Z(cu,z)+"}":pu+"{ "+b.call(cu,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(u){return u in this};function G(u,t){return z.call(u,t)}function H(u){return E.call(u)}function V(u,t){if(u.indexOf)return u.indexOf(t);for(var e=0,r=u.length;et.maxStringLength){var e=u.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return q(y.call(u,0,t.maxStringLength),t)+r}return L(d.call(d.call(u,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(u){var t=u.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+h.call(t.toString(16))}function K(u){return"Object("+u+")"}function Y(u){return u+" { ? }"}function J(u,t,e,r){return u+" ("+t+") {"+(r?Z(e,r):b.call(e,", "))+"}"}function Z(u,t){if(0===u.length)return"";var e="\n"+t.prev+t.base;return e+b.call(u,","+e)+"\n"+t.prev}function Q(u,t){var e=_(u),r=[];if(e){r.length=u.length;for(var n=0;n{"use strict";var r;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,D=e(9096),i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),F=i.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(u){var t=u.constructor;return t&&t.prototype===u},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var u in window)try{if(!l["$"+u]&&n.call(window,u)&&null!==window[u]&&"object"==typeof window[u])try{s(window[u])}catch(u){return!0}}catch(u){return!0}return!1}();r=function(u){var t=null!==u&&"object"==typeof u,e="[object Function]"===o.call(u),r=D(u),i=t&&"[object String]"===o.call(u),l=[];if(!t&&!e&&!r)throw new TypeError("Object.keys called on a non-object");var p=F&&e;if(i&&u.length>0&&!n.call(u,0))for(var E=0;E0)for(var A=0;A{"use strict";var r=Array.prototype.slice,n=e(9096),o=Object.keys,D=o?function(u){return o(u)}:e(9560),i=Object.keys;D.shim=function(){if(Object.keys){var u=function(){var u=Object.keys(arguments);return u&&u.length===arguments.length}(1,2);u||(Object.keys=function(u){return n(u)?i(r.call(u)):i(u)})}else Object.keys=D;return Object.keys||D},u.exports=D},9096:u=>{"use strict";var t=Object.prototype.toString;u.exports=function(u){var e=t.call(u),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==u&&"object"==typeof u&&"number"==typeof u.length&&u.length>=0&&"[object Function]"===t.call(u.callee)),r}},7636:(u,t,e)=>{"use strict";var r=e(6308),n=e(2824),o=Object;u.exports=r((function(){if(null==this||this!==o(this))throw new n("RegExp.prototype.flags getter called on non-object");var u="";return this.hasIndices&&(u+="d"),this.global&&(u+="g"),this.ignoreCase&&(u+="i"),this.multiline&&(u+="m"),this.dotAll&&(u+="s"),this.unicode&&(u+="u"),this.unicodeSets&&(u+="v"),this.sticky&&(u+="y"),u}),"get flags",!0)},2192:(u,t,e)=>{"use strict";var r=e(2732),n=e(5096),o=e(7636),D=e(9296),i=e(736),a=n(D());r(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},9296:(u,t,e)=>{"use strict";var r=e(7636),n=e(2732).supportsDescriptors,o=Object.getOwnPropertyDescriptor;u.exports=function(){if(n&&"gim"===/a/gim.flags){var u=o(RegExp.prototype,"flags");if(u&&"function"==typeof u.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",e={};if(Object.defineProperty(e,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(e,"sticky",{get:function(){t+="y"}}),"dy"===t)return u.get}}return r}},736:(u,t,e)=>{"use strict";var r=e(2732).supportsDescriptors,n=e(9296),o=Object.getOwnPropertyDescriptor,D=Object.defineProperty,i=TypeError,a=Object.getPrototypeOf,F=/a/;u.exports=function(){if(!r||!a)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=n(),t=a(F),e=o(t,"flags");return e&&e.get===u||D(t,"flags",{configurable:!0,enumerable:!1,get:u}),u}},860:(u,t,e)=>{"use strict";var r=e(668),n=e(1476),o=r("RegExp.prototype.exec"),D=e(2824);u.exports=function(u){if(!n(u))throw new D("`regex` must be a RegExp");return function(t){return null!==o(u,t)}}},5676:(u,t,e)=>{"use strict";var r=e(4624),n=e(2448),o=e(3268)(),D=e(6168),i=e(2824),a=r("%Math.floor%");u.exports=function(u,t){if("function"!=typeof u)throw new i("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||a(t)!==t)throw new i("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],r=!0,F=!0;if("length"in u&&D){var c=D(u,"length");c&&!c.configurable&&(r=!1),c&&!c.writable&&(F=!1)}return(r||F||!e)&&(o?n(u,"length",t,!0,!0):n(u,"length",t)),u}},6308:(u,t,e)=>{"use strict";var r=e(2448),n=e(3268)(),o=e(2656).functionsHaveConfigurableNames(),D=TypeError;u.exports=function(u,t){if("function"!=typeof u)throw new D("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(n?r(u,"name",t,!0,!0):r(u,"name",t)),u}},3147:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=e(4152),D=e(2824),i=r("%WeakMap%",!0),a=r("%Map%",!0),F=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),s=n("WeakMap.prototype.has",!0),l=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),p=n("Map.prototype.has",!0),E=function(u,t){for(var e,r=u;null!==(e=r.next);r=e)if(e.key===t)return r.next=e.next,e.next=u.next,u.next=e,e};u.exports=function(){var u,t,e,r={assert:function(u){if(!r.has(u))throw new D("Side channel does not contain "+o(u))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return F(u,r)}else if(a){if(t)return l(t,r)}else if(e)return function(u,t){var e=E(u,t);return e&&e.value}(e,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(u)return s(u,r)}else if(a){if(t)return p(t,r)}else if(e)return function(u,t){return!!E(u,t)}(e,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(u||(u=new i),c(u,r,n)):a?(t||(t=new a),f(t,r,n)):(e||(e={key:{},next:null}),function(u,t,e){var r=E(u,t);r?r.value=e:u.next={key:t,next:u.next,value:e}}(e,r,n))}};return r}},9508:(u,t,e)=>{"use strict";var r=e(1700),n=e(3672),o=e(5552),D=e(3816),i=e(5424),a=e(4656),F=e(668),c=e(9800)(),s=e(2192),l=F("String.prototype.indexOf"),f=e(6288),p=function(u){var t=f();if(c&&"symbol"==typeof Symbol.matchAll){var e=o(u,Symbol.matchAll);return e===RegExp.prototype[Symbol.matchAll]&&e!==t?t:e}if(D(u))return t};u.exports=function(u){var t=a(this);if(null!=u){if(D(u)){var e="flags"in u?n(u,"flags"):s(u);if(a(e),l(i(e),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(u);if(void 0!==o)return r(o,u,[t])}var F=i(t),c=new RegExp(u,"g");return r(p(c),c,[F])}},3732:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(9508),D=e(5844),i=e(4148),a=r(o);n(a,{getPolyfill:D,implementation:o,shim:i}),u.exports=a},6288:(u,t,e)=>{"use strict";var r=e(9800)(),n=e(7492);u.exports=function(){return r&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:n}},5844:(u,t,e)=>{"use strict";var r=e(9508);u.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(u){return String.prototype.matchAll}return r}},7492:(u,t,e)=>{"use strict";var r=e(5211),n=e(3672),o=e(4e3),D=e(8652),i=e(4784),a=e(5424),F=e(8645),c=e(2192),s=e(6308),l=e(668)("String.prototype.indexOf"),f=RegExp,p="flags"in RegExp.prototype,E=s((function(u){var t=this;if("Object"!==F(t))throw new TypeError('"this" value must be an Object');var e=a(u),s=function(u,t){var e="flags"in t?n(t,"flags"):a(c(t));return{flags:e,matcher:new u(p&&"string"==typeof e?t:u===f?t.source:t,e)}}(D(t,f),t),E=s.flags,A=s.matcher,C=i(n(t,"lastIndex"));o(A,"lastIndex",C,!0);var y=l(E,"g")>-1,d=l(E,"u")>-1;return r(A,e,y,d)}),"[Symbol.matchAll]",!0);u.exports=E},4148:(u,t,e)=>{"use strict";var r=e(2732),n=e(9800)(),o=e(5844),D=e(6288),i=Object.defineProperty,a=Object.getOwnPropertyDescriptor;u.exports=function(){var u=o();if(r(String.prototype,{matchAll:u},{matchAll:function(){return String.prototype.matchAll!==u}}),n){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(r(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),i&&a){var e=a(Symbol,t);e&&!e.configurable||i(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var F=D(),c={};c[t]=F;var s={};s[t]=function(){return RegExp.prototype[t]!==F},r(RegExp.prototype,c,s)}return u}},6936:(u,t,e)=>{"use strict";var r=e(4656),n=e(5424),o=e(668)("String.prototype.replace"),D=/^\s$/.test("᠎"),i=D?/^[\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]+/,a=D?/[\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]+$/;u.exports=function(){var u=n(r(this));return o(o(u,i,""),a,"")}},9292:(u,t,e)=>{"use strict";var r=e(5096),n=e(2732),o=e(4656),D=e(6936),i=e(6684),a=e(9788),F=r(i()),c=function(u){return o(u),F(u)};n(c,{getPolyfill:i,implementation:D,shim:a}),u.exports=c},6684:(u,t,e)=>{"use strict";var r=e(6936);u.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:r}},9788:(u,t,e)=>{"use strict";var r=e(2732),n=e(6684);u.exports=function(){var u=n();return r(String.prototype,{trim:u},{trim:function(){return String.prototype.trim!==u}}),u}},1740:()=>{},1056:(u,t,e)=>{"use strict";var r=e(4624),n=e(8536),o=e(8645),D=e(7724),i=e(9132),a=r("%TypeError%");u.exports=function(u,t,e){if("String"!==o(u))throw new a("Assertion failed: `S` must be a String");if(!D(t)||t<0||t>i)throw new a("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==o(e))throw new a("Assertion failed: `unicode` must be a Boolean");return e?t+1>=u.length?t+1:t+n(u,t)["[[CodeUnitCount]]"]:t+1}},1700:(u,t,e)=>{"use strict";var r=e(4624),n=e(668),o=r("%TypeError%"),D=e(1720),i=r("%Reflect.apply%",!0)||n("Function.prototype.apply");u.exports=function(u,t){var e=arguments.length>2?arguments[2]:[];if(!D(e))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(u,t,e)}},8536:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668),o=e(1712),D=e(8444),i=e(8645),a=e(2320),F=n("String.prototype.charAt"),c=n("String.prototype.charCodeAt");u.exports=function(u,t){if("String"!==i(u))throw new r("Assertion failed: `string` must be a String");var e=u.length;if(t<0||t>=e)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=c(u,t),s=F(u,t),l=o(n),f=D(n);if(!l&&!f)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(f||t+1===e)return{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=c(u,t+1);return D(p)?{"[[CodePoint]]":a(n,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":s,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(8645);u.exports=function(u,t){if("Boolean"!==n(t))throw new r("Assertion failed: Type(done) is not Boolean");return{value:u,done:t}}},2672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4436),o=e(8924),D=e(3880),i=e(2968),a=e(8800),F=e(8645);u.exports=function(u,t,e){if("Object"!==F(u))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");return n(D,a,o,u,t,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":e,"[[Writable]]":!0})}},5211:(u,t,e)=>{"use strict";var r=e(4624),n=e(9800)(),o=r("%TypeError%"),D=r("%IteratorPrototype%",!0),i=e(1056),a=e(4288),F=e(2672),c=e(3672),s=e(6216),l=e(8972),f=e(4e3),p=e(4784),E=e(5424),A=e(8645),C=e(7284),y=e(9200),d=function(u,t,e,r){if("String"!==A(t))throw new o("`S` must be a string");if("Boolean"!==A(e))throw new o("`global` must be a boolean");if("Boolean"!==A(r))throw new o("`fullUnicode` must be a boolean");C.set(this,"[[IteratingRegExp]]",u),C.set(this,"[[IteratedString]]",t),C.set(this,"[[Global]]",e),C.set(this,"[[Unicode]]",r),C.set(this,"[[Done]]",!1)};D&&(d.prototype=s(D)),F(d.prototype,"next",(function(){var u=this;if("Object"!==A(u))throw new o("receiver must be an object");if(!(u instanceof d&&C.has(u,"[[IteratingRegExp]]")&&C.has(u,"[[IteratedString]]")&&C.has(u,"[[Global]]")&&C.has(u,"[[Unicode]]")&&C.has(u,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(C.get(u,"[[Done]]"))return a(void 0,!0);var t=C.get(u,"[[IteratingRegExp]]"),e=C.get(u,"[[IteratedString]]"),r=C.get(u,"[[Global]]"),n=C.get(u,"[[Unicode]]"),D=l(t,e);if(null===D)return C.set(u,"[[Done]]",!0),a(void 0,!0);if(r){if(""===E(c(D,"0"))){var F=p(c(t,"lastIndex")),s=i(e,F,n);f(t,"lastIndex",s,!0)}return a(D,!1)}return C.set(u,"[[Done]]",!0),a(D,!1)})),n&&(y(d.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof d.prototype[Symbol.iterator])&&F(d.prototype,Symbol.iterator,(function(){return this})),u.exports=function(u,t,e,r){return new d(u,t,e,r)}},7268:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(320),o=e(4436),D=e(8924),i=e(4936),a=e(3880),F=e(2968),c=e(8800),s=e(5696),l=e(8645);u.exports=function(u,t,e){if("Object"!==l(u))throw new r("Assertion failed: Type(O) is not Object");if(!F(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var f=n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},e)?e:s(e);if(!n({Type:l,IsDataDescriptor:a,IsAccessorDescriptor:i},f))throw new r("Assertion failed: Desc is not a valid Property Descriptor");return o(a,c,D,u,t,f)}},8924:(u,t,e)=>{"use strict";var r=e(3600),n=e(3504),o=e(8645);u.exports=function(u){return void 0!==u&&r(o,"Property Descriptor","Desc",u),n(u)}},3672:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968),D=e(8645);u.exports=function(u,t){if("Object"!==D(u))throw new r("Assertion failed: Type(O) is not Object");if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},5552:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(3396),o=e(3048),D=e(2968),i=e(4152);u.exports=function(u,t){if(!D(t))throw new r("Assertion failed: IsPropertyKey(P) is not true");var e=n(u,t);if(null!=e){if(!o(e))throw new r(i(t)+" is not a function: "+i(e));return e}}},3396:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(4152),o=e(2968);u.exports=function(u,t){if(!o(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+n(t));return u[t]}},4936:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Get]]")&&!r(u,"[[Set]]")))}},1720:(u,t,e)=>{"use strict";u.exports=e(704)},3048:(u,t,e)=>{"use strict";u.exports=e(648)},211:(u,t,e)=>{"use strict";var r=e(8600)("%Reflect.construct%",!0),n=e(7268);try{n({},"",{"[[Get]]":function(){}})}catch(u){n=null}if(n&&r){var o={},D={};n(D,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),u.exports=function(u){try{r(u,D)}catch(u){return u===o}}}else u.exports=function(u){return"function"==typeof u&&!!u.prototype}},3880:(u,t,e)=>{"use strict";var r=e(4440),n=e(8645),o=e(3600);u.exports=function(u){return void 0!==u&&(o(n,"Property Descriptor","Desc",u),!(!r(u,"[[Value]]")&&!r(u,"[[Writable]]")))}},2968:u=>{"use strict";u.exports=function(u){return"string"==typeof u||"symbol"==typeof u}},3816:(u,t,e)=>{"use strict";var r=e(4624)("%Symbol.match%",!0),n=e(1476),o=e(6848);u.exports=function(u){if(!u||"object"!=typeof u)return!1;if(r){var t=u[r];if(void 0!==t)return o(t)}return n(u)}},6216:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Object.create%",!0),o=r("%TypeError%"),D=r("%SyntaxError%"),i=e(1720),a=e(8645),F=e(4672),c=e(7284),s=e(7e3)();u.exports=function(u){if(null!==u&&"Object"!==a(u))throw new o("Assertion failed: `proto` must be null or an object");var t,e=arguments.length<2?[]:arguments[1];if(!i(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(n)t=n(u);else if(s)t={__proto__:u};else{if(null===u)throw new D("native Object.create support is required to create null objects");var r=function(){};r.prototype=u,t=new r}return e.length>0&&F(e,(function(u){c.set(t,u,void 0)})),t}},8972:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(668)("RegExp.prototype.exec"),o=e(1700),D=e(3672),i=e(3048),a=e(8645);u.exports=function(u,t){if("Object"!==a(u))throw new r("Assertion failed: `R` must be an Object");if("String"!==a(t))throw new r("Assertion failed: `S` must be a String");var e=D(u,"exec");if(i(e)){var F=o(e,u,[t]);if(null===F||"Object"===a(F))return F;throw new r('"exec" method must return `null` or an Object')}return n(u,t)}},4656:(u,t,e)=>{"use strict";u.exports=e(176)},8800:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u,t){return u===t?0!==u||1/u==1/t:r(u)&&r(t)}},4e3:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%"),n=e(2968),o=e(8800),D=e(8645),i=function(){try{return delete[].length,!0}catch(u){return!1}}();u.exports=function(u,t,e,a){if("Object"!==D(u))throw new r("Assertion failed: `O` must be an Object");if(!n(t))throw new r("Assertion failed: `P` must be a Property Key");if("Boolean"!==D(a))throw new r("Assertion failed: `Throw` must be a Boolean");if(a){if(u[t]=e,i&&!o(u[t],e))throw new r("Attempted to assign to readonly property.");return!0}try{return u[t]=e,!i||o(u[t],e)}catch(u){return!1}}},8652:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Symbol.species%",!0),o=r("%TypeError%"),D=e(211),i=e(8645);u.exports=function(u,t){if("Object"!==i(u))throw new o("Assertion failed: Type(O) is not Object");var e=u.constructor;if(void 0===e)return t;if("Object"!==i(e))throw new o("O.constructor is not an Object");var r=n?e[n]:void 0;if(null==r)return t;if(D(r))return r;throw new o("no constructor found")}},8772:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Number%"),o=r("%RegExp%"),D=r("%TypeError%"),i=r("%parseInt%"),a=e(668),F=e(860),c=a("String.prototype.slice"),s=F(/^0b[01]+$/i),l=F(/^0o[0-7]+$/i),f=F(/^[-+]0x[0-9a-f]+$/i),p=F(new o("["+["…","​","￾"].join("")+"]","g")),E=e(9292),A=e(8645);u.exports=function u(t){if("String"!==A(t))throw new D("Assertion failed: `argument` is not a String");if(s(t))return n(i(c(t,2),2));if(l(t))return n(i(c(t,2),8));if(p(t)||f(t))return NaN;var e=E(t);return e!==t?u(e):n(t)}},6848:u=>{"use strict";u.exports=function(u){return!!u}},9424:(u,t,e)=>{"use strict";var r=e(7220),n=e(2592),o=e(2808),D=e(2931);u.exports=function(u){var t=r(u);return o(t)||0===t?0:D(t)?n(t):t}},4784:(u,t,e)=>{"use strict";var r=e(9132),n=e(9424);u.exports=function(u){var t=n(u);return t<=0?0:t>r?r:t}},7220:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%Number%"),D=e(2336),i=e(5556),a=e(8772);u.exports=function(u){var t=D(u)?u:i(u,o);if("symbol"==typeof t)throw new n("Cannot convert a Symbol value to a number");if("bigint"==typeof t)throw new n("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof t?a(t):o(t)}},5556:(u,t,e)=>{"use strict";var r=e(108);u.exports=function(u){return arguments.length>1?r(u,arguments[1]):r(u)}},5696:(u,t,e)=>{"use strict";var r=e(4440),n=e(4624)("%TypeError%"),o=e(8645),D=e(6848),i=e(3048);u.exports=function(u){if("Object"!==o(u))throw new n("ToPropertyDescriptor requires an object");var t={};if(r(u,"enumerable")&&(t["[[Enumerable]]"]=D(u.enumerable)),r(u,"configurable")&&(t["[[Configurable]]"]=D(u.configurable)),r(u,"value")&&(t["[[Value]]"]=u.value),r(u,"writable")&&(t["[[Writable]]"]=D(u.writable)),r(u,"get")){var e=u.get;if(void 0!==e&&!i(e))throw new n("getter must be a function");t["[[Get]]"]=e}if(r(u,"set")){var a=u.set;if(void 0!==a&&!i(a))throw new n("setter must be a function");t["[[Set]]"]=a}if((r(t,"[[Get]]")||r(t,"[[Set]]"))&&(r(t,"[[Value]]")||r(t,"[[Writable]]")))throw new n("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},5424:(u,t,e)=>{"use strict";var r=e(4624),n=r("%String%"),o=r("%TypeError%");u.exports=function(u){if("symbol"==typeof u)throw new o("Cannot convert a Symbol value to a string");return n(u)}},8645:(u,t,e)=>{"use strict";var r=e(7936);u.exports=function(u){return"symbol"==typeof u?"Symbol":"bigint"==typeof u?"BigInt":r(u)}},2320:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%String.fromCharCode%"),D=e(1712),i=e(8444);u.exports=function(u,t){if(!D(u)||!i(t))throw new n("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(u)+o(t)}},2312:(u,t,e)=>{"use strict";var r=e(8645),n=Math.floor;u.exports=function(u){return"BigInt"===r(u)?u:n(u)}},2592:(u,t,e)=>{"use strict";var r=e(4624),n=e(2312),o=r("%TypeError%");u.exports=function(u){if("number"!=typeof u&&"bigint"!=typeof u)throw new o("argument must be a Number or a BigInt");var t=u<0?-n(-u):n(u);return 0===t?0:t}},176:(u,t,e)=>{"use strict";var r=e(4624)("%TypeError%");u.exports=function(u,t){if(null==u)throw new r(t||"Cannot call method on "+u);return u}},7936:u=>{"use strict";u.exports=function(u){return null===u?"Null":void 0===u?"Undefined":"function"==typeof u||"object"==typeof u?"Object":"number"==typeof u?"Number":"boolean"==typeof u?"Boolean":"string"==typeof u?"String":void 0}},8600:(u,t,e)=>{"use strict";u.exports=e(4624)},4436:(u,t,e)=>{"use strict";var r=e(3268),n=e(4624),o=r()&&n("%Object.defineProperty%",!0),D=r.hasArrayLengthDefineBug(),i=D&&e(704),a=e(668)("Object.prototype.propertyIsEnumerable");u.exports=function(u,t,e,r,n,F){if(!o){if(!u(F))return!1;if(!F["[[Configurable]]"]||!F["[[Writable]]"])return!1;if(n in r&&a(r,n)!==!!F["[[Enumerable]]"])return!1;var c=F["[[Value]]"];return r[n]=c,t(r[n],c)}return D&&"length"===n&&"[[Value]]"in F&&i(r)&&r.length!==F["[[Value]]"]?(r.length=F["[[Value]]"],r.length===F["[[Value]]"]):(o(r,n,e(F)),!0)}},704:(u,t,e)=>{"use strict";var r=e(4624)("%Array%"),n=!r.isArray&&e(668)("Object.prototype.toString");u.exports=r.isArray||function(u){return"[object Array]"===n(u)}},3600:(u,t,e)=>{"use strict";var r=e(4624),n=r("%TypeError%"),o=r("%SyntaxError%"),D=e(4440),i=e(7724),a={"Property Descriptor":function(u){var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!u)return!1;for(var e in u)if(D(u,e)&&!t[e])return!1;var r=D(u,"[[Value]]"),o=D(u,"[[Get]]")||D(u,"[[Set]]");if(r&&o)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":e(5092),"Iterator Record":function(u){return D(u,"[[Iterator]]")&&D(u,"[[NextMethod]]")&&D(u,"[[Done]]")},"PromiseCapability Record":function(u){return!!u&&D(u,"[[Resolve]]")&&"function"==typeof u["[[Resolve]]"]&&D(u,"[[Reject]]")&&"function"==typeof u["[[Reject]]"]&&D(u,"[[Promise]]")&&u["[[Promise]]"]&&"function"==typeof u["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(u){return!!u&&D(u,"[[Completion]]")&&D(u,"[[Capability]]")&&a["PromiseCapability Record"](u["[[Capability]]"])},"RegExp Record":function(u){return u&&D(u,"[[IgnoreCase]]")&&"boolean"==typeof u["[[IgnoreCase]]"]&&D(u,"[[Multiline]]")&&"boolean"==typeof u["[[Multiline]]"]&&D(u,"[[DotAll]]")&&"boolean"==typeof u["[[DotAll]]"]&&D(u,"[[Unicode]]")&&"boolean"==typeof u["[[Unicode]]"]&&D(u,"[[CapturingGroupsCount]]")&&"number"==typeof u["[[CapturingGroupsCount]]"]&&i(u["[[CapturingGroupsCount]]"])&&u["[[CapturingGroupsCount]]"]>=0}};u.exports=function(u,t,e,r){var D=a[t];if("function"!=typeof D)throw new o("unknown record type: "+t);if("Object"!==u(r)||!D(r))throw new n(e+" must be a "+t)}},4672:u=>{"use strict";u.exports=function(u,t){for(var e=0;e{"use strict";u.exports=function(u){if(void 0===u)return u;var t={};return"[[Value]]"in u&&(t.value=u["[[Value]]"]),"[[Writable]]"in u&&(t.writable=!!u["[[Writable]]"]),"[[Get]]"in u&&(t.get=u["[[Get]]"]),"[[Set]]"in u&&(t.set=u["[[Set]]"]),"[[Enumerable]]"in u&&(t.enumerable=!!u["[[Enumerable]]"]),"[[Configurable]]"in u&&(t.configurable=!!u["[[Configurable]]"]),t}},2931:(u,t,e)=>{"use strict";var r=e(2808);u.exports=function(u){return("number"==typeof u||"bigint"==typeof u)&&!r(u)&&u!==1/0&&u!==-1/0}},7724:(u,t,e)=>{"use strict";var r=e(4624),n=r("%Math.abs%"),o=r("%Math.floor%"),D=e(2808),i=e(2931);u.exports=function(u){if("number"!=typeof u||D(u)||!i(u))return!1;var t=n(u);return o(t)===t}},1712:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=55296&&u<=56319}},5092:(u,t,e)=>{"use strict";var r=e(4440);u.exports=function(u){return r(u,"[[StartIndex]]")&&r(u,"[[EndIndex]]")&&u["[[StartIndex]]"]>=0&&u["[[EndIndex]]"]>=u["[[StartIndex]]"]&&String(parseInt(u["[[StartIndex]]"],10))===String(u["[[StartIndex]]"])&&String(parseInt(u["[[EndIndex]]"],10))===String(u["[[EndIndex]]"])}},2808:u=>{"use strict";u.exports=Number.isNaN||function(u){return u!=u}},2336:u=>{"use strict";u.exports=function(u){return null===u||"function"!=typeof u&&"object"!=typeof u}},320:(u,t,e)=>{"use strict";var r=e(4624),n=e(4440),o=r("%TypeError%");u.exports=function(u,t){if("Object"!==u.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(n(t,r)&&!e[r])return!1;if(u.IsDataDescriptor(t)&&u.IsAccessorDescriptor(t))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:u=>{"use strict";u.exports=function(u){return"number"==typeof u&&u>=56320&&u<=57343}},9132:u=>{"use strict";u.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},t={};function e(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return u[r](o,o.exports,e),o.exports}e.n=u=>{var t=u&&u.__esModule?()=>u.default:()=>u;return e.d(t,{a:t}),t},e.d=(u,t)=>{for(var r in t)e.o(t,r)&&!e.o(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:t[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(u){if("object"==typeof window)return window}}(),e.o=(u,t)=>Object.prototype.hasOwnProperty.call(u,t),(()=>{"use strict";var u=e(9116);function t(t,e,r){let n=0,o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,u.c)(t,e,r)}function r(u,e){return 0===e.length||0===u.length?0:1-t(u,e,e.length)[0].errors/e.length}function n(u){switch(u.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return u.textContent.length;default:return 0}}function o(u){let t=u.previousSibling,e=0;for(;t;)e+=n(t),t=t.previousSibling;return e}function D(u){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;rn?(D.push({node:i,offset:n-F}),n=e.shift()):(a=o.nextNode(),F+=i.data.length);for(;void 0!==n&&i&&F===n;)D.push({node:i,offset:i.data.length}),n=e.shift();if(void 0!==n)throw new RangeError("Offset exceeds text length");return D}class i{constructor(u,t){if(t<0)throw new Error("Offset is invalid");this.element=u,this.offset=t}relativeTo(u){if(!u.contains(this.element))throw new Error("Parent is not an ancestor of current element");let t=this.element,e=this.offset;for(;t!==u;)e+=o(t),t=t.parentElement;return new i(t,e)}resolve(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return D(this.element,this.offset)[0]}catch(t){if(0===this.offset&&void 0!==u.direction){const e=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);e.currentNode=this.element;const r=1===u.direction,n=r?e.nextNode():e.previousNode();if(!n)throw t;return{node:n,offset:r?0:n.data.length}}throw t}}static fromCharOffset(u,t){switch(u.nodeType){case Node.TEXT_NODE:return i.fromPoint(u,t);case Node.ELEMENT_NODE:return new i(u,t);default:throw new Error("Node is not an element or text node")}}static fromPoint(u,t){switch(u.nodeType){case Node.TEXT_NODE:{if(t<0||t>u.data.length)throw new Error("Text node offset is out of range");if(!u.parentElement)throw new Error("Text node has no parent");const e=o(u)+t;return new i(u.parentElement,e)}case Node.ELEMENT_NODE:{if(t<0||t>u.childNodes.length)throw new Error("Child node offset is out of range");let e=0;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:{};this.root=u,this.exact=t,this.context=e}static fromRange(u,t){const e=u.textContent,r=a.fromRange(t).relativeTo(u),n=r.start.offset,o=r.end.offset;return new l(u,e.slice(n,o),{prefix:e.slice(Math.max(0,n-32),n),suffix:e.slice(o,Math.min(e.length,o+32))})}static fromSelector(u,t){const{prefix:e,suffix:r}=t;return new l(u,t.exact,{prefix:e,suffix:r})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.toPositionAnchor(u).toRange()}toPositionAnchor(){let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=function(u,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===e.length)return null;const o=Math.min(256,e.length/2),D=t(u,e,o);if(0===D.length)return null;const i=t=>{const o=1-t.errors/e.length,D=n.prefix?r(u.slice(Math.max(0,t.start-n.prefix.length),t.start),n.prefix):1,i=n.suffix?r(u.slice(t.end,t.end+n.suffix.length),n.suffix):1;let a=1;return"number"==typeof n.hint&&(a=1-Math.abs(t.start-n.hint)/u.length),(50*o+20*D+20*i+2*a)/92},a=D.map((u=>({start:u.start,end:u.end,score:i(u)})));return a.sort(((u,t)=>t.score-u.score)),a[0]}(this.root.textContent,this.exact,c(c({},this.context),{},{hint:u.hint}));if(!e)throw new Error("Quote not found");return new s(this.root,e.start,e.end)}}var f=e(3732);e.n(f)().shim();const p=!0;function E(){if(!readium.link)return null;const u=readium.link.href;if(!u)return null;const t=function(){const u=window.getSelection();if(!u)return;if(u.isCollapsed)return;const t=u.toString();if(0===t.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!u.anchorNode||!u.focusNode)return;const e=1===u.rangeCount?u.getRangeAt(0):function(u,t,e,r){const n=new Range;if(n.setStart(u,t),n.setEnd(e,r),!n.collapsed)return n;A(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const o=new Range;if(o.setStart(e,r),o.setEnd(u,t),!o.collapsed)return A(">>> createOrderedRange RANGE REVERSE OK."),n;A(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(u.anchorNode,u.anchorOffset,u.focusNode,u.focusOffset);if(!e||e.collapsed)return void A("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const r=document.body.textContent,n=a.fromRange(e).relativeTo(document.body),o=n.start.offset,D=n.end.offset;let i=r.slice(Math.max(0,o-200),o),F=i.search(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/g);-1!==F&&(i=i.slice(F+1));let c=r.slice(D,Math.min(r.length,D+200)),s=Array.from(c.matchAll(/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF20-\uDF2C\uDF41\uDF4A-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0-\uDFFF]|\uD801[\uDC9E-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE5-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD24-\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF46-\uDF6F\uDF82-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDD02\uDD27-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDD9\uDDDB\uDDDD-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g)).pop();return void 0!==s&&s.index>1&&(c=c.slice(0,s.index+1)),{highlight:t,before:i,after:c}}();return t?{href:u,text:t,rect:function(){try{let u=window.getSelection();if(!u)return;return M(u.getRangeAt(0).getBoundingClientRect())}catch(u){return I(u),null}}()}:null}function A(){p&&T.apply(null,arguments)}window.addEventListener("error",(function(u){webkit.messageHandlers.logError.postMessage({message:u.message,filename:u.filename,line:u.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const u="readium-virtual-page";var t=document.getElementById(u);if(v()||2!=parseInt(window.getComputedStyle(document.documentElement).getPropertyValue("column-count"))){var e;null===(e=t)||void 0===e||e.remove()}else{var r=document.scrollingElement.scrollWidth/window.innerWidth;Math.round(2*r)/2%1>.1&&(t?t.remove():((t=document.createElement("div")).setAttribute("id",u),t.style.breakBefore="column",t.innerHTML="​",document.body.appendChild(t)))}}(),m()})).observe(document.body),window.addEventListener("orientationchange",(function(){b(),function(){if(!v()){var u=S(window.scrollX+1);document.scrollingElement.scrollLeft=u}}()})),b()}),!1);var C,y,d=0,h=0,B=!1,g=0;function m(){readium.isFixedLayout||(h=window.scrollY/document.scrollingElement.scrollHeight,d=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(B||window.requestAnimationFrame((function(){var u;u=(v()?h:d).toString(),webkit.messageHandlers.progressionChanged.postMessage(u),B=!1})),B=!0))}function b(){g=0===window.orientation||180==window.orientation?screen.width:screen.height}function v(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function w(u){return v()?document.scrollingElement.scrollTop=u.top+window.scrollY:document.scrollingElement.scrollLeft=S(u.left+window.scrollX),!0}function x(u){var t=window.scrollX,e=window.innerWidth;return document.scrollingElement.scrollLeft=u,Math.abs(t-u)/e>.01}function S(u){var t=u+1;return t-t%g}function O(u){try{let r=u.locations,n=u.text;var t;if(n&&n.highlight)return r&&r.cssSelector&&(t=document.querySelector(r.cssSelector)),t||(t=document.body),new l(t,n.highlight,{prefix:n.before,suffix:n.after}).toRange();if(r){var e=null;if(!e&&r.cssSelector&&(e=document.querySelector(r.cssSelector)),!e&&r.fragments)for(const u of r.fragments)if(e=document.getElementById(u))break;if(e){let u=document.createRange();return u.setStartBefore(e),u.setEndAfter(e),u}}}catch(u){I(u)}return null}function j(u,t){null===t?P(u):document.documentElement.style.setProperty(u,t,"important")}function P(u){document.documentElement.style.removeProperty(u)}function T(){var u=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(u)}function R(u){I(new Error(u))}function I(u){webkit.messageHandlers.logError.postMessage({message:u.message})}window.addEventListener("scroll",m),document.addEventListener("selectionchange",(50,C=function(){webkit.messageHandlers.selectionChanged.postMessage(E())},function(){var u=this,t=arguments;clearTimeout(y),y=setTimeout((function(){C.apply(u,t),y=null}),50)}));const N=!1;function M(u){let t=k({x:u.left,y:u.top});const e=u.width,r=u.height,n=t.x,o=t.y;return{width:e,height:r,left:n,top:o,right:n+e,bottom:o+r}}function k(u){if(!frameElement)return u;let t=frameElement.getBoundingClientRect();if(!t)return u;let e=window.top.document.documentElement;return{x:u.x+t.x+e.scrollLeft,y:u.y+t.y+e.scrollTop}}function L(u,t){let e=u.getClientRects();const r=[];for(const u of e)r.push({bottom:u.bottom,height:u.height,left:u.left,right:u.right,top:u.top,width:u.width});const n=z(function(u,t){const e=new Set(u);for(const t of u)if(t.width>1&&t.height>1){for(const r of u)if(t!==r&&e.has(r)&&W(r,t,1)){q("CLIENT RECT: remove contained"),e.delete(t);break}}else q("CLIENT RECT: remove tiny"),e.delete(t);return Array.from(e)}($(r,1,t)));for(let u=n.length-1;u>=0;u--){const t=n[u];if(!(t.width*t.height>4)){if(!(n.length>1)){q("CLIENT RECT: remove small, but keep otherwise empty!");break}q("CLIENT RECT: remove small"),n.splice(u,1)}}return q("CLIENT RECT: reduced ".concat(r.length," --\x3e ").concat(n.length)),n}function $(u,t,e){for(let r=0;ru!==o&&u!==D)),n=_(o,D);return r.push(n),$(r,t,e)}}return u}function _(u,t){const e=Math.min(u.left,t.left),r=Math.max(u.right,t.right),n=Math.min(u.top,t.top),o=Math.max(u.bottom,t.bottom);return{bottom:o,height:o-n,left:e,right:r,top:n,width:r-e}}function W(u,t,e){return U(u,t.left,t.top,e)&&U(u,t.right,t.top,e)&&U(u,t.left,t.bottom,e)&&U(u,t.right,t.bottom,e)}function U(u,t,e,r){return(u.leftt||V(u.right,t,r))&&(u.tope||V(u.bottom,e,r))}function z(u){for(let t=0;tu!==t));return Array.prototype.push.apply(D,e),z(D)}}else q("replaceOverlapingRects rect1 === rect2 ??!")}return u}function G(u,t){const e=function(u,t){const e=Math.max(u.left,t.left),r=Math.min(u.right,t.right),n=Math.max(u.top,t.top),o=Math.min(u.bottom,t.bottom);return{bottom:o,height:Math.max(0,o-n),left:e,right:r,top:n,width:Math.max(0,r-e)}}(t,u);if(0===e.height||0===e.width)return[u];const r=[];{const t={bottom:u.bottom,height:0,left:u.left,right:e.left,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:e.top,height:0,left:e.left,right:e.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.left,right:e.right,top:e.bottom,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}{const t={bottom:u.bottom,height:0,left:e.right,right:u.right,top:u.top,width:0};t.width=t.right-t.left,t.height=t.bottom-t.top,0!==t.height&&0!==t.width&&r.push(t)}return r}function H(u,t,e){return(u.left=0&&V(u.left,t.right,e))&&(t.left=0&&V(t.left,u.right,e))&&(u.top=0&&V(u.top,t.bottom,e))&&(t.top=0&&V(t.top,u.bottom,e))}function V(u,t,e){return Math.abs(u-t)<=e}function q(){N&&T.apply(null,arguments)}var X,K=[],Y="ResizeObserver loop completed with undelivered notifications.";!function(u){u.BORDER_BOX="border-box",u.CONTENT_BOX="content-box",u.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(X||(X={}));var J,Z=function(u){return Object.freeze(u)},Q=function(u,t){this.inlineSize=u,this.blockSize=t,Z(this)},uu=function(){function u(u,t,e,r){return this.x=u,this.y=t,this.width=e,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Z(this)}return u.prototype.toJSON=function(){var u=this;return{x:u.x,y:u.y,top:u.top,right:u.right,bottom:u.bottom,left:u.left,width:u.width,height:u.height}},u.fromRect=function(t){return new u(t.x,t.y,t.width,t.height)},u}(),tu=function(u){return u instanceof SVGElement&&"getBBox"in u},eu=function(u){if(tu(u)){var t=u.getBBox(),e=t.width,r=t.height;return!e&&!r}var n=u,o=n.offsetWidth,D=n.offsetHeight;return!(o||D||u.getClientRects().length)},ru=function(u){var t;if(u instanceof Element)return!0;var e=null===(t=null==u?void 0:u.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(e&&u instanceof e.Element)},nu="undefined"!=typeof window?window:{},ou=new WeakMap,Du=/auto|scroll/,iu=/^tb|vertical/,au=/msie|trident/i.test(nu.navigator&&nu.navigator.userAgent),Fu=function(u){return parseFloat(u||"0")},cu=function(u,t,e){return void 0===u&&(u=0),void 0===t&&(t=0),void 0===e&&(e=!1),new Q((e?t:u)||0,(e?u:t)||0)},su=Z({devicePixelContentBoxSize:cu(),borderBoxSize:cu(),contentBoxSize:cu(),contentRect:new uu(0,0,0,0)}),lu=function(u,t){if(void 0===t&&(t=!1),ou.has(u)&&!t)return ou.get(u);if(eu(u))return ou.set(u,su),su;var e=getComputedStyle(u),r=tu(u)&&u.ownerSVGElement&&u.getBBox(),n=!au&&"border-box"===e.boxSizing,o=iu.test(e.writingMode||""),D=!r&&Du.test(e.overflowY||""),i=!r&&Du.test(e.overflowX||""),a=r?0:Fu(e.paddingTop),F=r?0:Fu(e.paddingRight),c=r?0:Fu(e.paddingBottom),s=r?0:Fu(e.paddingLeft),l=r?0:Fu(e.borderTopWidth),f=r?0:Fu(e.borderRightWidth),p=r?0:Fu(e.borderBottomWidth),E=s+F,A=a+c,C=(r?0:Fu(e.borderLeftWidth))+f,y=l+p,d=i?u.offsetHeight-y-u.clientHeight:0,h=D?u.offsetWidth-C-u.clientWidth:0,B=n?E+C:0,g=n?A+y:0,m=r?r.width:Fu(e.width)-B-h,b=r?r.height:Fu(e.height)-g-d,v=m+E+h+C,w=b+A+d+y,x=Z({devicePixelContentBoxSize:cu(Math.round(m*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:cu(v,w,o),contentBoxSize:cu(m,b,o),contentRect:new uu(s,a,m,b)});return ou.set(u,x),x},fu=function(u,t,e){var r=lu(u,e),n=r.borderBoxSize,o=r.contentBoxSize,D=r.devicePixelContentBoxSize;switch(t){case X.DEVICE_PIXEL_CONTENT_BOX:return D;case X.BORDER_BOX:return n;default:return o}},pu=function(u){var t=lu(u);this.target=u,this.contentRect=t.contentRect,this.borderBoxSize=Z([t.borderBoxSize]),this.contentBoxSize=Z([t.contentBoxSize]),this.devicePixelContentBoxSize=Z([t.devicePixelContentBoxSize])},Eu=function(u){if(eu(u))return 1/0;for(var t=0,e=u.parentNode;e;)t+=1,e=e.parentNode;return t},Au=function(){var u=1/0,t=[];K.forEach((function(e){if(0!==e.activeTargets.length){var r=[];e.activeTargets.forEach((function(t){var e=new pu(t.target),n=Eu(t.target);r.push(e),t.lastReportedSize=fu(t.target,t.observedBox),nu?t.activeTargets.push(e):t.skippedTargets.push(e))}))}))},yu=[],du=0,hu={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gu=function(u){return void 0===u&&(u=0),Date.now()+u},mu=!1,bu=function(){function u(){var u=this;this.stopped=!0,this.listener=function(){return u.schedule()}}return u.prototype.run=function(u){var t=this;if(void 0===u&&(u=250),!mu){mu=!0;var e,r=gu(u);e=function(){var e=!1;try{e=function(){var u,t=0;for(Cu(t);K.some((function(u){return u.activeTargets.length>0}));)t=Au(),Cu(t);return K.some((function(u){return u.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?u=new ErrorEvent("error",{message:Y}):((u=document.createEvent("Event")).initEvent("error",!1,!1),u.message=Y),window.dispatchEvent(u)),t>0}()}finally{if(mu=!1,u=r-gu(),!du)return;e?t.run(1e3):u>0?t.run(u):t.start()}},function(u){if(!J){var t=0,e=document.createTextNode("");new MutationObserver((function(){return yu.splice(0).forEach((function(u){return u()}))})).observe(e,{characterData:!0}),J=function(){e.textContent="".concat(t?t--:t++)}}yu.push(u),J()}((function(){requestAnimationFrame(e)}))}},u.prototype.schedule=function(){this.stop(),this.run()},u.prototype.observe=function(){var u=this,t=function(){return u.observer&&u.observer.observe(document.body,hu)};document.body?t():nu.addEventListener("DOMContentLoaded",t)},u.prototype.start=function(){var u=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bu.forEach((function(t){return nu.addEventListener(t,u.listener,!0)})))},u.prototype.stop=function(){var u=this;this.stopped||(this.observer&&this.observer.disconnect(),Bu.forEach((function(t){return nu.removeEventListener(t,u.listener,!0)})),this.stopped=!0)},u}(),vu=new bu,wu=function(u){!du&&u>0&&vu.start(),!(du+=u)&&vu.stop()},xu=function(){function u(u,t){this.target=u,this.observedBox=t||X.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return u.prototype.isActive=function(){var u,t=fu(this.target,this.observedBox,!0);return u=this.target,tu(u)||function(u){switch(u.tagName){case"INPUT":if("image"!==u.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(u)||"inline"!==getComputedStyle(u).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},u}(),Su=function(u,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=u,this.callback=t},Ou=new WeakMap,ju=function(u,t){for(var e=0;e=0&&(n&&K.splice(K.indexOf(e),1),e.observationTargets.splice(r,1),wu(-1))},u.disconnect=function(u){var t=this,e=Ou.get(u);e.observationTargets.slice().forEach((function(e){return t.unobserve(u,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},u}(),Tu=function(){function u(u){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof u)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Pu.connect(this,u)}return u.prototype.observe=function(u,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.observe(this,u,t)},u.prototype.unobserve=function(u){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ru(u))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Pu.unobserve(this,u)},u.prototype.disconnect=function(){Pu.disconnect(this)},u.toString=function(){return"function ResizeObserver () { [polyfill code] }"},u}();const Ru=window.ResizeObserver||Tu;let Iu=new Map,Nu=new Map;var Mu=0;function ku(u){if(0===Nu.size)return null;for(const[t,e]of Nu)if(e.isActivable())for(const r of e.items.reverse())if(r.clickableElements)for(const e of r.clickableElements){let n=e.getBoundingClientRect().toJSON();if(U(n,u.clientX,u.clientY,1))return{group:t,item:r,element:e,rect:n}}return null}function Lu(u){return u&&u instanceof Element}window.addEventListener("load",(function(){const u=document.body;var t={width:0,height:0};new Ru((()=>{t.width===u.clientWidth&&t.height===u.clientHeight||(t={width:u.clientWidth,height:u.clientHeight},Nu.forEach((function(u){u.requestLayout()})))})).observe(u)}),!1);const $u={NONE:"",DESCENDANT:" ",CHILD:" > "},_u={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Wu="CssSelectorGenerator";function Uu(u="unknown problem",...t){console.warn(`${Wu}: ${u}`,...t)}const zu={selectors:[_u.id,_u.class,_u.tag,_u.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Gu(u){return u instanceof RegExp}function Hu(u){return["string","function"].includes(typeof u)||Gu(u)}function Vu(u){return Array.isArray(u)?u.filter(Hu):[]}function qu(u){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(u){return u instanceof Node}(u)&&t.includes(u.nodeType)}function Xu(u,t){if(qu(u))return u.contains(t)||Uu("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 nto work as intended."),u;const e=t.getRootNode({composed:!1});return qu(e)?(e!==document&&Uu("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."),e):t.ownerDocument.querySelector(":root")}function Ku(u){return"number"==typeof u?u:Number.POSITIVE_INFINITY}function Yu(u=[]){const[t=[],...e]=u;return 0===e.length?t:e.reduce(((u,t)=>u.filter((u=>t.includes(u)))),t)}function Ju(u){return[].concat(...u)}function Zu(u){const t=u.map((u=>{if(Gu(u))return t=>u.test(t);if("function"==typeof u)return t=>{const e=u(t);return"boolean"!=typeof e?(Uu("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",u),!1):e};if("string"==typeof u){const t=new RegExp("^"+u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return u=>t.test(u)}return Uu("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",u),()=>!1}));return u=>t.some((t=>t(u)))}function Qu(u,t,e){const r=Array.from(Xu(e,u[0]).querySelectorAll(t));return r.length===u.length&&u.every((u=>r.includes(u)))}function ut(u,t){t=null!=t?t:function(u){return u.ownerDocument.querySelector(":root")}(u);const e=[];let r=u;for(;Lu(r)&&r!==t;)e.push(r),r=r.parentElement;return e}function tt(u,t){return Yu(u.map((u=>ut(u,t))))}const et=new RegExp(["^$","\\s"].join("|")),rt=new RegExp(["^$"].join("|")),nt=[_u.nthoftype,_u.tag,_u.id,_u.class,_u.attribute,_u.nthchild],ot=Zu(["class","id","ng-*"]);function Dt({name:u}){return`[${u}]`}function it({name:u,value:t}){return`[${u}='${t}']`}function at({nodeName:u,nodeValue:t}){return{name:(e=u,e.replace(/:/g,"\\:")),value:Bt(t)};var e}function Ft(u){const t=Array.from(u.attributes).filter((t=>function({nodeName:u},t){const e=t.tagName.toLowerCase();return!(["input","option"].includes(e)&&"value"===u||ot(u))}(t,u))).map(at);return[...t.map(Dt),...t.map(it)]}function ct(u){return(u.getAttribute("class")||"").trim().split(/\s+/).filter((u=>!rt.test(u))).map((u=>`.${Bt(u)}`))}function st(u){const t=u.getAttribute("id")||"",e=`#${Bt(t)}`,r=u.getRootNode({composed:!1});return!et.test(t)&&Qu([u],e,r)?[e]:[]}function lt(u){const t=u.parentNode;if(t){const e=Array.from(t.childNodes).filter(Lu).indexOf(u);if(e>-1)return[`:nth-child(${e+1})`]}return[]}function ft(u){return[Bt(u.tagName.toLowerCase())]}function pt(u){const t=[...new Set(Ju(u.map(ft)))];return 0===t.length||t.length>1?[]:[t[0]]}function Et(u){const t=pt([u])[0],e=u.parentElement;if(e){const r=Array.from(e.children).filter((u=>u.tagName.toLowerCase()===t)),n=r.indexOf(u);if(n>-1)return[`${t}:nth-of-type(${n+1})`]}return[]}function At(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(function*(u=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let e=0,r=yt(1);for(;r.length<=u.length&&eu[t]));yield t,r=Ct(r,u.length-1)}}(u,{maxResults:t}))}function Ct(u=[],t=0){const e=u.length;if(0===e)return[];const r=[...u];r[e-1]+=1;for(let u=e-1;u>=0;u--)if(r[u]>t){if(0===u)return yt(e+1);r[u-1]++,r[u]=r[u-1]+1}return r[e-1]>t?yt(e+1):r}function yt(u=1){return Array.from(Array(u).keys())}const dt=":".charCodeAt(0).toString(16).toUpperCase(),ht=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function Bt(u=""){var t,e;return null!==(e=null===(t=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===t?void 0:t.call(CSS,u))&&void 0!==e?e:function(u=""){return u.split("").map((u=>":"===u?`\\${dt} `:ht.test(u)?`\\${u}`:escape(u).replace(/%/g,"\\"))).join("")}(u)}const gt={tag:pt,id:function(u){return 0===u.length||u.length>1?[]:st(u[0])},class:function(u){return Yu(u.map(ct))},attribute:function(u){return Yu(u.map(Ft))},nthchild:function(u){return Yu(u.map(lt))},nthoftype:function(u){return Yu(u.map(Et))}},mt={tag:ft,id:st,class:ct,attribute:Ft,nthchild:lt,nthoftype:Et};function bt(u){return u.includes(_u.tag)||u.includes(_u.nthoftype)?[...u]:[...u,_u.tag]}function vt(u={}){const t=[...nt];return u[_u.tag]&&u[_u.nthoftype]&&t.splice(t.indexOf(_u.tag),1),t.map((t=>{return(r=u)[e=t]?r[e].join(""):"";var e,r})).join("")}function wt(u,t,e="",r){const n=function(u,t){return""===t?u:function(u,t){return[...u.map((u=>t+$u.DESCENDANT+u)),...u.map((u=>t+$u.CHILD+u))]}(u,t)}(function(u,t,e){const r=function(u,t){const{blacklist:e,whitelist:r,combineWithinSelector:n,maxCombinations:o}=t,D=Zu(e),i=Zu(r);return function(u){const{selectors:t,includeTag:e}=u,r=[].concat(t);return e&&!r.includes("tag")&&r.push("tag"),r}(t).reduce(((t,e)=>{const r=function(u,t){var e;return(null!==(e=gt[t])&&void 0!==e?e:()=>[])(u)}(u,e),a=function(u=[],t,e){return u.filter((u=>e(u)||!t(u)))}(r,D,i),F=function(u=[],t){return u.sort(((u,e)=>{const r=t(u),n=t(e);return r&&!n?-1:!r&&n?1:0}))}(a,i);return t[e]=n?At(F,{maxResults:o}):F.map((u=>[u])),t}),{})}(u,e),n=function(u,t){return function(u){const{selectors:t,combineBetweenSelectors:e,includeTag:r,maxCandidates:n}=u,o=e?At(t,{maxResults:n}):t.map((u=>[u]));return r?o.map(bt):o}(t).map((t=>function(u,t){const e={};return u.forEach((u=>{const r=t[u];r.length>0&&(e[u]=r)})),function(u={}){let t=[];return Object.entries(u).forEach((([u,e])=>{t=e.flatMap((e=>0===t.length?[{[u]:e}]:t.map((t=>Object.assign(Object.assign({},t),{[u]:e})))))})),t}(e).map(vt)}(t,u))).filter((u=>u.length>0))}(r,e),o=Ju(n);return[...new Set(o)]}(u,r.root,r),e);for(const t of n)if(Qu(u,t,r.root))return t;return null}function xt(u){return{value:u,include:!1}}function St({selectors:u,operator:t}){let e=[...nt];u[_u.tag]&&u[_u.nthoftype]&&(e=e.filter((u=>u!==_u.tag)));let r="";return e.forEach((t=>{(u[t]||[]).forEach((({value:u,include:t})=>{t&&(r+=u)}))})),t+r}function Ot(u){return[":root",...ut(u).reverse().map((u=>{const t=function(u,t,e=$u.NONE){const r={};return t.forEach((t=>{Reflect.set(r,t,function(u,t){return mt[t](u)}(u,t).map(xt))})),{element:u,operator:e,selectors:r}}(u,[_u.nthchild],$u.CHILD);return t.selectors.nthchild.forEach((u=>{u.include=!0})),t})).map(St)].join("")}function jt(u,t={}){const e=function(u){(u instanceof NodeList||u instanceof HTMLCollection)&&(u=Array.from(u));const t=(Array.isArray(u)?u:[u]).filter(Lu);return[...new Set(t)]}(u),r=function(u,t={}){const e=Object.assign(Object.assign({},zu),t);return{selectors:(r=e.selectors,Array.isArray(r)?r.filter((u=>{return t=_u,e=u,Object.values(t).includes(e);var t,e})):[]),whitelist:Vu(e.whitelist),blacklist:Vu(e.blacklist),root:Xu(e.root,u),combineWithinSelector:!!e.combineWithinSelector,combineBetweenSelectors:!!e.combineBetweenSelectors,includeTag:!!e.includeTag,maxCombinations:Ku(e.maxCombinations),maxCandidates:Ku(e.maxCandidates)};var r}(e[0],t);let n="",o=r.root;function D(){return function(u,t,e="",r){if(0===u.length)return null;const n=[u.length>1?u:[],...tt(u,t).map((u=>[u]))];for(const u of n){const t=wt(u,0,e,r);if(t)return{foundElements:u,selector:t}}return null}(e,o,n,r)}let i=D();for(;i;){const{foundElements:u,selector:t}=i;if(Qu(e,t,r.root))return t;o=u[0],n=t,i=D()}return e.length>1?e.map((u=>jt(u,r))).join(", "):function(u){return u.map(Ot).join(", ")}(e)}function Pt(u){return null==u?null:-1!==["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(u.nodeName.toLowerCase())||u.hasAttribute("contenteditable")&&"false"!=u.getAttribute("contenteditable").toLowerCase()?u.outerHTML:u.parentElement?Pt(u.parentElement):null}function Tt(u){for(var t=0;t0&&t.top0&&t.left{Wt(u)||(Ut(u),zt("down",u))})),window.addEventListener("keyup",(u=>{Wt(u)||(Ut(u),zt("up",u))})),e.g.readium={scrollToId:function(u){let t=document.getElementById(u);return!!t&&(w(t.getBoundingClientRect()),!0)},scrollToPosition:function(u,t){if(console.log("ScrollToPosition"),u<0||u>1)console.log("InvalidPosition");else if(v()){let t=document.scrollingElement.scrollHeight*u;document.scrollingElement.scrollTop=t}else{let e=document.scrollingElement.scrollWidth*u*("rtl"==t?-1:1);document.scrollingElement.scrollLeft=S(e)}},scrollToLocator:function(u){let t=O(u);return!!t&&function(u){return w(u.getBoundingClientRect())}(t)},scrollLeft:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX-r,o=t?-(e-r):0;return x(Math.max(n,o))},scrollRight:function(u){var t="rtl"==u,e=document.scrollingElement.scrollWidth,r=window.innerWidth,n=window.scrollX+r,o=t?0:e-r;return x(Math.min(n,o))},setCSSProperties:function(u){for(const t in u)j(t,u[t])},setProperty:j,removeProperty:P,registerDecorationTemplates:function(u){var t="";for(const[e,r]of Object.entries(u))Iu.set(e,r),r.stylesheet&&(t+=r.stylesheet+"\n");if(t){let u=document.createElement("style");u.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(u)}},getDecorations:function(u){var t=Nu.get(u);return t||(t=function(u,t){var e=[],r=0,n=null,o=!1;function D(t){let n=u+"-"+r++,o=O(t.locator);if(!o)return void T("Can't locate DOM range for decoration",t);let D={id:n,decoration:t,range:o};e.push(D),a(D)}function i(u){let t=e.findIndex((t=>t.decoration.id===u));if(-1===t)return;let r=e[t];e.splice(t,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}function a(e){let r=(n||((n=document.createElement("div")).setAttribute("id",u),n.setAttribute("data-group",t),n.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=n&&document.body.append(n)}))),n),o=Iu.get(e.decoration.style);if(!o)return void R("Unknown decoration style: ".concat(e.decoration.style));let D=document.createElement("div");D.setAttribute("id",e.id),D.setAttribute("data-style",e.decoration.style),D.style.setProperty("pointer-events","none");let i=window.innerWidth,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),F=i/(a||1),c=document.scrollingElement,s=c.scrollLeft,l=c.scrollTop;function f(u,t,e){if(u.style.position="absolute","wrap"===o.width)u.style.width="".concat(t.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(t.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("viewport"===o.width){u.style.width="".concat(i,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/i)*i;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}else if("bounds"===o.width)u.style.width="".concat(e.width,"px"),u.style.height="".concat(t.height,"px"),u.style.left="".concat(e.left+s,"px"),u.style.top="".concat(t.top+l,"px");else if("page"===o.width){u.style.width="".concat(F,"px"),u.style.height="".concat(t.height,"px");let e=Math.floor(t.left/F)*F;u.style.left="".concat(e+s,"px"),u.style.top="".concat(t.top+l,"px")}}let p,E=e.range.getBoundingClientRect();try{let u=document.createElement("template");u.innerHTML=e.decoration.element.trim(),p=u.content.firstElementChild}catch(u){return void R('Invalid decoration element "'.concat(e.decoration.element,'": ').concat(u.message))}if("boxes"===o.layout){let u=!0,t=L(e.range,u);t=t.sort(((u,t)=>u.topt.top?1:0));for(let u of t){const t=p.cloneNode(!0);t.style.setProperty("pointer-events","none"),f(t,u,E),D.append(t)}}else if("bounds"===o.layout){const u=p.cloneNode(!0);u.style.setProperty("pointer-events","none"),f(u,E,E),D.append(u)}r.append(D),e.container=D,e.clickableElements=Array.from(D.querySelectorAll("[data-activable='1']")),0===e.clickableElements.length&&(e.clickableElements=Array.from(D.children))}function F(){n&&(n.remove(),n=null)}return{add:D,remove:i,update:function(u){i(u.id),D(u)},clear:function(){F(),e.length=0},items:e,requestLayout:function(){F(),e.forEach((u=>a(u)))},isActivable:function(){return o},setActivable:function(){o=!0}}}("r2-decoration-"+Mu++,u),Nu.set(u,t)),t},findFirstVisibleLocator:function(){const u=Tt(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:jt(u)},text:{highlight:u.textContent}}}},window.readium.isReflowable=!0,webkit.messageHandlers.spreadLoadStarted.postMessage({}),window.addEventListener("load",(function(){window.requestAnimationFrame((function(){webkit.messageHandlers.spreadLoaded.postMessage({})}));let u=document.createElement("meta");u.setAttribute("name","viewport"),u.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),document.head.appendChild(u)}))})()})(); +(()=>{var t={9116:(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],u=o>>>31,c=e[r]|u,s=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=u)|~(s|(f|=n(o)-u)),a=f&s,t.P[r]=i,t.M[r]=a,y}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,u={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};u.lastRowMask.fill(1<<31),u.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),s=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(d[h]|=1<0&&v[b]>=r+i;)b-=1;b===a&&v[b]<=r&&(v[b]{"use strict";var n=r(4624),o=r(5096),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}},5096:(t,e,r)=>{"use strict";var n=r(3520),o=r(4624),i=r(5676),a=r(2824),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=s(n,c,arguments);return i(e,1+f(0,t.length-(arguments.length-1)),!0)};var p=function(){return s(n,u,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},2448:(t,e,r)=>{"use strict";var n=r(3268)(),o=r(4624),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=r(6500),u=r(2824),c=r(6168);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===s&&f?f.configurable:!s,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||s))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},2732:(t,e,r)=>{"use strict";var n=r(2812),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=r(2448),c=r(3268)(),s=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;c?u(t,e,r,!0):u(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var u=0;u{"use strict";t.exports=EvalError},1152:t=>{"use strict";t.exports=Error},1932:t=>{"use strict";t.exports=RangeError},5028:t=>{"use strict";t.exports=ReferenceError},6500:t=>{"use strict";t.exports=SyntaxError},2824:t=>{"use strict";t.exports=TypeError},5488:t=>{"use strict";t.exports=URIError},9200:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=r(4712)(),i=r(4440),a=o?Symbol.toStringTag:null;t.exports=function(t,e){var r=arguments.length>2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},108:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(5988),i=r(648),a=r(1844),u=r(7256);t.exports=function(t){if(o(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=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):u(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||u(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,u="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1480:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(1480);t.exports=Function.prototype.bind||n},2656:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},4624:(t,e,r)=>{"use strict";var n,o=r(1152),i=r(7261),a=r(1932),u=r(5028),c=r(6500),s=r(2824),l=r(5488),f=Function,p=function(t){try{return f('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(t){y=null}var d=function(){throw new s},h=y?function(){try{return d}catch(t){try{return y(arguments,"callee").get}catch(t){return d}}}():d,g=r(9800)(),m=r(7e3)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":h,"%TypedArray%":w,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var S=b(b(t));x["%Error.prototype%"]=S}var E=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return x[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(3520),j=r(4440),T=O.call(Function.call,Array.prototype.concat),P=O.call(Function.apply,Array.prototype.splice),R=O.call(Function.call,String.prototype.replace),C=O.call(Function.call,String.prototype.slice),I=O.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,k=function(t,e){var r,n=t;if(j(A,n)&&(n="%"+(r=A[n])[0]+"%"),j(x,n)){var o=x[n];if(o===v&&(o=E(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,N,(function(t,e,r,o){n[n.length]=r?R(o,M,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),i=o.name,a=o.value,u=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,p=!0;f=r.length){var m=y(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=j(a,d),a=a[d];p&&!u&&(x[i]=a)}}return a}},6168:(t,e,r)=>{"use strict";var n=r(4624)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},3268:(t,e,r)=>{"use strict";var n=r(4624)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7e3:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},9800:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7904);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7904: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},4712:(t,e,r)=>{"use strict";var n=r(7904);t.exports=function(){return n()&&!!Symbol.toStringTag}},4440:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(3520);t.exports=i.call(n,o)},7284:(t,e,r)=>{"use strict";var n=r(4440),o=r(3147)(),i=r(2824),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},648: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}},u=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.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)&&u(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return u(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&u(t)}},1844:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(4712)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},1476:(t,e,r)=>{"use strict";var n,o,i,a,u=r(668),c=r(4712)();if(c){n=u("Object.prototype.hasOwnProperty"),o=u("RegExp.prototype.exec"),i={};var s=function(){throw i};a={toString:s,valueOf:s},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=s)}var l=u("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7256:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(9800)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4152:(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,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=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,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("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(1740),D=$.custom,L=U(D)?D:null;function F(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function B(t){return v.call(String(t),/"/g,""")}function _(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function W(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,o,u){var c=n||{};if(G(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var h=!G(c,"customInspect")||c.customInspect;if("boolean"!=typeof h&&"symbol"!==h)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.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 q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var S=String(e);return w?k(e,S):S}if("bigint"==typeof e){var j=String(e)+"n";return w?k(e,j):j}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var D,z=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)}}(c,o);if(void 0===u)u=[];else if(V(u,e)>=0)return"[Circular]";function X(e,r,n){if(r&&(u=O.call(u)).push(r),n){var i={depth:c.depth};return G(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),t(e,i,o+1,u)}return t(e,c,o+1,u)}if("function"==typeof e&&!W(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,X);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+A.call(et,", ")+" }":"")}if(U(e)){var rt=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||C?rt:K(rt)}if((D=e)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var nt="<"+x.call(String(e.nodeName)),ot=e.attributes||[],it=0;it"}if(_(e)){if(0===e.length)return"[]";var at=Z(e,X);return z&&!function(t){for(var e=0;e=0)return!1;return!0}(at)?"["+Q(at,z)+"]":"[ "+A.call(at,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var ut=Z(e,X);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(ut,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+X(e.cause),ut),", ")+" }"}if("object"==typeof e&&h){if(L&&"function"==typeof e[L]&&$)return $(e,{depth:P-o});if("symbol"!==h&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(X(r,e,!0)+" => "+X(t,e))})),J("Map",i.call(e),ct,z)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(X(t,e))})),J("Set",s.call(e),st,z)}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 Y("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 Y("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(X(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(d.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(X(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!W(e)){var lt=Z(e,X),ft=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,pt=e instanceof Object?"":"null prototype",yt=!ft&&I&&Object(e)===e&&I in e?b.call(H(e),8,-1):pt?"Object":"",dt=(ft||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(yt||pt?"["+A.call(E.call([],yt||[],pt||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":z?dt+"{"+Q(lt,z)+"}":dt+"{ "+A.call(lt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function H(t){return h.call(t)}function V(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 q(b.call(t,0,e.maxStringLength),e)+n}return F(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(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 K(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):A.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=_(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(9096),u=Object.prototype.propertyIsEnumerable,c=!u.call({toString:null},"toString"),s=u.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),u=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(u&&t.length>0&&!o.call(t,0))for(var h=0;h0)for(var g=0;g{"use strict";var n=Array.prototype.slice,o=r(9096),i=Object.keys,a=i?function(t){return i(t)}:r(9560),u=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?u(n.call(t)):u(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9096:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7636:(t,e,r)=>{"use strict";var n=r(6308),o=r(2824),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)},2192:(t,e,r)=>{"use strict";var n=r(2732),o=r(5096),i=r(7636),a=r(9296),u=r(736),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},9296:(t,e,r)=>{"use strict";var n=r(7636),o=r(2732).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&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},736:(t,e,r)=>{"use strict";var n=r(2732).supportsDescriptors,o=r(9296),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,u=TypeError,c=Object.getPrototypeOf,s=/a/;t.exports=function(){if(!n||!c)throw new u("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(s),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},860:(t,e,r)=>{"use strict";var n=r(668),o=r(1476),i=n("RegExp.prototype.exec"),a=r(2824);t.exports=function(t){if(!o(t))throw new a("`regex` must be a RegExp");return function(e){return null!==i(t,e)}}},5676:(t,e,r)=>{"use strict";var n=r(4624),o=r(2448),i=r(3268)(),a=r(6168),u=r(2824),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(s=!1)}return(n||s||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},6308:(t,e,r)=>{"use strict";var n=r(2448),o=r(3268)(),i=r(2656).functionsHaveConfigurableNames(),a=TypeError;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}},3147:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=r(4152),a=r(2824),u=n("%WeakMap%",!0),c=n("%Map%",!0),s=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),h=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return s(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=h(t,e);return r&&r.value}(r,n)},has:function(n){if(u&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return d(e,n)}else if(r)return function(t,e){return!!h(t,e)}(r,n);return!1},set:function(n,o){u&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new u),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=h(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},9508:(t,e,r)=>{"use strict";var n=r(1700),o=r(3672),i=r(5552),a=r(3816),u=r(5424),c=r(4656),s=r(668),l=r(9800)(),f=r(2192),p=s("String.prototype.indexOf"),y=r(6288),d=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(u(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=d(t);if(void 0!==i)return n(i,t,[e])}var s=u(e),l=new RegExp(t,"g");return n(d(l),l,[s])}},3732:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(9508),a=r(5844),u=r(4148),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:u}),t.exports=c},6288:(t,e,r)=>{"use strict";var n=r(9800)(),o=r(7492);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},5844:(t,e,r)=>{"use strict";var n=r(9508);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},7492:(t,e,r)=>{"use strict";var n=r(5211),o=r(3672),i=r(4e3),a=r(8652),u=r(4784),c=r(5424),s=r(8645),l=r(2192),f=r(6308),p=r(668)("String.prototype.indexOf"),y=RegExp,d="flags"in RegExp.prototype,h=f((function(t){var e=this;if("Object"!==s(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),h=f.flags,g=f.matcher,m=u(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(h,"g")>-1,v=p(h,"u")>-1;return n(g,r,b,v)}),"[Symbol.matchAll]",!0);t.exports=h},4148:(t,e,r)=>{"use strict";var n=r(2732),o=r(9800)(),i=r(5844),a=r(6288),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();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&&c){var r=c(Symbol,e);r&&!r.configurable||u(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var s=a(),l={};l[e]=s;var f={};f[e]=function(){return RegExp.prototype[e]!==s},n(RegExp.prototype,l,f)}return t}},6936:(t,e,r)=>{"use strict";var n=r(4656),o=r(5424),i=r(668)("String.prototype.replace"),a=/^\s$/.test("᠎"),u=a?/^[\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]+/,c=a?/[\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(){var t=o(n(this));return i(i(t,u,""),c,"")}},9292:(t,e,r)=>{"use strict";var n=r(5096),o=r(2732),i=r(4656),a=r(6936),u=r(6684),c=r(9788),s=n(u()),l=function(t){return i(t),s(t)};o(l,{getPolyfill:u,implementation:a,shim:c}),t.exports=l},6684:(t,e,r)=>{"use strict";var n=r(6936);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9788:(t,e,r)=>{"use strict";var n=r(2732),o=r(6684);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1740:()=>{},1056:(t,e,r)=>{"use strict";var n=r(4624),o=r(8536),i=r(8645),a=r(7724),u=r(9132),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>u)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},1700:(t,e,r)=>{"use strict";var n=r(4624),o=r(668),i=n("%TypeError%"),a=r(1720),u=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 u(t,e,r)}},8536:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668),i=r(1712),a=r(8444),u=r(8645),c=r(2320),s=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==u(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),f=s(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var d=l(t,e+1);return a(d)?{"[[CodePoint]]":c(o,d),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},4288:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(8645);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},2672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4436),i=r(8924),a=r(3880),u=r(2968),c=r(8800),s=r(8645);t.exports=function(t,e,r){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},5211:(t,e,r)=>{"use strict";var n=r(4624),o=r(9800)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),u=r(1056),c=r(4288),s=r(2672),l=r(3672),f=r(6216),p=r(8972),y=r(4e3),d=r(4784),h=r(5424),g=r(8645),m=r(7284),b=r(9200),v=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(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)};a&&(v.prototype=f(a)),s(v.prototype,"next",(function(){var t=this;if("Object"!==g(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 c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===h(l(a,"0"))){var s=d(l(e,"lastIndex")),f=u(r,s,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&s(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},7268:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(320),i=r(4436),a=r(8924),u=r(4936),c=r(3880),s=r(2968),l=r(8800),f=r(5696),p=r(8645);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:u},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8924:(t,e,r)=>{"use strict";var n=r(3600),o=r(3504),i=r(8645);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},3672:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968),a=r(8645);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},5552:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(3396),i=r(3048),a=r(2968),u=r(4152);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(u(e)+" is not a function: "+u(r));return r}}},3396:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(4152),i=r(2968);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},4936:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},1720:(t,e,r)=>{"use strict";t.exports=r(704)},3048:(t,e,r)=>{"use strict";t.exports=r(648)},211:(t,e,r)=>{"use strict";var n=r(8600)("%Reflect.construct%",!0),o=r(7268);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}},3880:(t,e,r)=>{"use strict";var n=r(4440),o=r(8645),i=r(3600);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},2968:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},3816:(t,e,r)=>{"use strict";var n=r(4624)("%Symbol.match%",!0),o=r(1476),i=r(6848);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},6216:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),u=r(1720),c=r(8645),s=r(4672),l=r(7284),f=r(7e3)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!u(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&s(r,(function(t){l.set(e,t,void 0)})),e}},8972:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(668)("RegExp.prototype.exec"),i=r(1700),a=r(3672),u=r(3048),c=r(8645);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(u(r)){var s=i(r,t,[e]);if(null===s||"Object"===c(s))return s;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},4656:(t,e,r)=>{"use strict";t.exports=r(176)},8800:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},4e3:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%"),o=r(2968),i=r(8800),a=r(8645),u=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,u&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!u||i(t[e],r)}catch(t){return!1}}},8652:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(211),u=r(8645);t.exports=function(t,e){if("Object"!==u(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==u(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},8772:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),u=n("%parseInt%"),c=r(668),s=r(860),l=c("String.prototype.slice"),f=s(/^0b[01]+$/i),p=s(/^0o[0-7]+$/i),y=s(/^[-+]0x[0-9a-f]+$/i),d=s(new i("["+["…","​","￾"].join("")+"]","g")),h=r(9292),g=r(8645);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(u(l(e,2),2));if(p(e))return o(u(l(e,2),8));if(d(e)||y(e))return NaN;var r=h(e);return r!==e?t(r):o(e)}},6848:t=>{"use strict";t.exports=function(t){return!!t}},9424:(t,e,r)=>{"use strict";var n=r(7220),o=r(2592),i=r(2808),a=r(2931);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},4784:(t,e,r)=>{"use strict";var n=r(9132),o=r(9424);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},7220:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%Number%"),a=r(2336),u=r(5556),c=r(8772);t.exports=function(t){var e=a(t)?t:u(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?c(e):i(e)}},5556:(t,e,r)=>{"use strict";var n=r(108);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},5696:(t,e,r)=>{"use strict";var n=r(4440),o=r(4624)("%TypeError%"),i=r(8645),a=r(6848),u=r(3048);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!u(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!u(c))throw new o("setter must be a function");e["[[Set]]"]=c}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}},5424:(t,e,r)=>{"use strict";var n=r(4624),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},8645:(t,e,r)=>{"use strict";var n=r(7936);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},2320:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(1712),u=r(8444);t.exports=function(t,e){if(!a(t)||!u(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)}},2312:(t,e,r)=>{"use strict";var n=r(8645),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},2592:(t,e,r)=>{"use strict";var n=r(4624),o=r(2312),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},176:(t,e,r)=>{"use strict";var n=r(4624)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},7936:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},8600:(t,e,r)=>{"use strict";t.exports=r(4624)},4436:(t,e,r)=>{"use strict";var n=r(3268),o=r(4624),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),u=a&&r(704),c=r(668)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,s){if(!i){if(!t(s))return!1;if(!s["[[Configurable]]"]||!s["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!s["[[Enumerable]]"])return!1;var l=s["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in s&&u(n)&&n.length!==s["[[Value]]"]?(n.length=s["[[Value]]"],n.length===s["[[Value]]"]):(i(n,o,r(s)),!0)}},704:(t,e,r)=>{"use strict";var n=r(4624)("%Array%"),o=!n.isArray&&r(668)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},3600:(t,e,r)=>{"use strict";var n=r(4624),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(4440),u=r(7724),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(5092),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&u(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},4672:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},2931:(t,e,r)=>{"use strict";var n=r(2808);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7724:(t,e,r)=>{"use strict";var n=r(4624),o=n("%Math.abs%"),i=n("%Math.floor%"),a=r(2808),u=r(2931);t.exports=function(t){if("number"!=typeof t||a(t)||!u(t))return!1;var e=o(t);return i(e)===e}},1712:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},5092:(t,e,r)=>{"use strict";var n=r(4440);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},2808:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},2336:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},320:(t,e,r)=>{"use strict";var n=r(4624),o=r(4440),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},8444:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},9132:t=>{"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(9116);function e(e,r,n){let o=0,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.c)(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){switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return t.textContent.length;default:return 0}}function i(t){let e=t.previousSibling,r=0;for(;e;)r+=o(e),e=e.previousSibling;return r}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;no?(a.push({node:u,offset:o-s}),o=r.shift()):(c=i.nextNode(),s+=u.data.length);for(;void 0!==o&&u&&s===o;)a.push({node:u,offset:u.data.length}),o=r.shift();if(void 0!==o)throw new RangeError("Offset exceeds text length");return a}class u{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+=i(e),e=e.parentElement;return new u(e,r)}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return a(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=1===t.direction,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 u.fromPoint(t,e);case Node.ELEMENT_NODE:return new u(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=i(t)+e;return new u(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;n2&&void 0!==arguments[2]?arguments[2]:{};this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=c.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new l(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new l(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,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 u=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,u=o.suffix?n(t.slice(e.end,e.end+o.suffix.length),o.suffix):1;let c=1;return"number"==typeof o.hint&&(c=1-Math.abs(e.start-o.hint)/t.length),(50*i+20*a+20*u+2*c)/92},c=a.map((t=>({start:t.start,end:t.end,score:u(t)})));return c.sort(((t,e)=>e.score-t.score)),c[0]}(this.root.textContent,this.exact,{...this.context,hint:t.hint});if(!r)throw new Error("Quote not found");return new s(this.root,r.start,r.end)}}var f=r(3732);r.n(f)().shim();const p=!0;function y(){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;d(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const i=new Range;if(i.setStart(r,n),i.setEnd(t,e),!i.collapsed)return d(">>> createOrderedRange RANGE REVERSE OK."),o;d(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!r||r.collapsed)return void d("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const n=document.body.textContent,o=c.fromRange(r).relativeTo(document.body),i=o.start.offset,a=o.end.offset;let u=n.slice(Math.max(0,i-200),i),s=u.search(/\P{L}\p{L}/gu);-1!==s&&(u=u.slice(s+1));let l=n.slice(a,Math.min(n.length,a+200)),f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:e,before:u,after:l}}();return e?{href:t,text:e,rect:function(){try{let t=window.getSelection();if(!t)return;return k(t.getRangeAt(0).getBoundingClientRect())}catch(t){return N(t),null}}()}:null}function d(){p&&C.apply(null,arguments)}window.addEventListener("error",(function(t){webkit.messageHandlers.logError.postMessage({message:t.message,filename:t.filename,line:t.lineno})}),!1),window.addEventListener("load",(function(){new ResizeObserver((()=>{!function(){const t="readium-virtual-page";var e=document.getElementById(t);if(E()||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)))}}(),x()})).observe(document.body),window.addEventListener("orientationchange",(function(){S(),function(){if(!E()){var t=j(window.scrollX+1);document.scrollingElement.scrollLeft=t}}()})),S()}),!1);var h,g,m=0,b=0,v=!1,w=0;function x(){readium.isFixedLayout||(b=window.scrollY/document.scrollingElement.scrollHeight,m=Math.abs(window.scrollX/document.scrollingElement.scrollWidth),0!==document.scrollingElement.scrollWidth&&0!==document.scrollingElement.scrollHeight&&(v||window.requestAnimationFrame((function(){var t;t=(E()?b:m).toString(),webkit.messageHandlers.progressionChanged.postMessage(t),v=!1})),v=!0))}function S(){w=0===window.orientation||180==window.orientation?screen.width:screen.height}function E(){return"readium-scroll-on"==document.documentElement.style.getPropertyValue("--USER__view").trim()}function A(t){return E()?document.scrollingElement.scrollTop=t.top+window.scrollY:document.scrollingElement.scrollLeft=j(t.left+window.scrollX),!0}function O(t){var e=window.scrollX,r=window.innerWidth;return document.scrollingElement.scrollLeft=t,Math.abs(e-t)/r>.01}function j(t){var e=t+1;return e-e%w}function T(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 l(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)if(r=document.getElementById(t))break;if(r){let t=document.createRange();return t.setStartBefore(r),t.setEndAfter(r),t}}}catch(t){N(t)}return null}function P(t,e){null===e?R(t):document.documentElement.style.setProperty(t,e,"important")}function R(t){document.documentElement.style.removeProperty(t)}function C(){var t=Array.prototype.slice.call(arguments).join(" ");webkit.messageHandlers.log.postMessage(t)}function I(t){N(new Error(t))}function N(t){webkit.messageHandlers.logError.postMessage({message:t.message})}window.addEventListener("scroll",x),document.addEventListener("selectionchange",(50,h=function(){webkit.messageHandlers.selectionChanged.postMessage(y())},function(){var t=this,e=arguments;clearTimeout(g),g=setTimeout((function(){h.apply(t,e),g=null}),50)}));const M=!1;function k(t){let e=$({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 $(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 D(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=W(function(t,e){const r=new Set(t);for(const e of t)if(e.width>1&&e.height>1){for(const n of t)if(e!==n&&r.has(n)&&B(n,e,1)){H("CLIENT RECT: remove contained"),r.delete(e);break}}else H("CLIENT RECT: remove tiny"),r.delete(e);return Array.from(r)}(L(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)){H("CLIENT RECT: remove small, but keep otherwise empty!");break}H("CLIENT RECT: remove small"),o.splice(t,1)}}return H(`CLIENT RECT: reduced ${n.length} --\x3e ${o.length}`),o}function L(t,e,r){for(let n=0;nt!==i&&t!==a)),o=F(i,a);return n.push(o),L(n,e,r)}}return t}function F(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 B(t,e,r){return _(t,e.left,e.top,r)&&_(t,e.right,e.top,r)&&_(t,e.left,e.bottom,r)&&_(t,e.right,e.bottom,r)}function _(t,e,r,n){return(t.lefte||G(t.right,e,n))&&(t.topr||G(t.bottom,r,n))}function W(t){for(let e=0;et!==e));return Array.prototype.push.apply(a,r),W(a)}}else H("replaceOverlapingRects rect1 === rect2 ??!")}return t}function U(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 z(t,e,r){return(t.left=0&&G(t.left,e.right,r))&&(e.left=0&&G(e.left,t.right,r))&&(t.top=0&&G(t.top,e.bottom,r))&&(e.top=0&&G(e.top,t.bottom,r))}function G(t,e,r){return Math.abs(t-e)<=r}function H(){M&&C.apply(null,arguments)}var V,q=[],X="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"}(V||(V={}));var K,Y=function(t){return Object.freeze(t)},J=function(t,e){this.inlineSize=t,this.blockSize=e,Y(this)},Q=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,Y(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}(),Z=function(t){return t instanceof SVGElement&&"getBBox"in t},tt=function(t){if(Z(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)},et=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)},rt="undefined"!=typeof window?window:{},nt=new WeakMap,ot=/auto|scroll/,it=/^tb|vertical/,at=/msie|trident/i.test(rt.navigator&&rt.navigator.userAgent),ut=function(t){return parseFloat(t||"0")},ct=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new J((r?e:t)||0,(r?t:e)||0)},st=Y({devicePixelContentBoxSize:ct(),borderBoxSize:ct(),contentBoxSize:ct(),contentRect:new Q(0,0,0,0)}),lt=function(t,e){if(void 0===e&&(e=!1),nt.has(t)&&!e)return nt.get(t);if(tt(t))return nt.set(t,st),st;var r=getComputedStyle(t),n=Z(t)&&t.ownerSVGElement&&t.getBBox(),o=!at&&"border-box"===r.boxSizing,i=it.test(r.writingMode||""),a=!n&&ot.test(r.overflowY||""),u=!n&&ot.test(r.overflowX||""),c=n?0:ut(r.paddingTop),s=n?0:ut(r.paddingRight),l=n?0:ut(r.paddingBottom),f=n?0:ut(r.paddingLeft),p=n?0:ut(r.borderTopWidth),y=n?0:ut(r.borderRightWidth),d=n?0:ut(r.borderBottomWidth),h=f+s,g=c+l,m=(n?0:ut(r.borderLeftWidth))+y,b=p+d,v=u?t.offsetHeight-b-t.clientHeight:0,w=a?t.offsetWidth-m-t.clientWidth:0,x=o?h+m:0,S=o?g+b:0,E=n?n.width:ut(r.width)-x-w,A=n?n.height:ut(r.height)-S-v,O=E+h+w+m,j=A+g+v+b,T=Y({devicePixelContentBoxSize:ct(Math.round(E*devicePixelRatio),Math.round(A*devicePixelRatio),i),borderBoxSize:ct(O,j,i),contentBoxSize:ct(E,A,i),contentRect:new Q(f,c,E,A)});return nt.set(t,T),T},ft=function(t,e,r){var n=lt(t,r),o=n.borderBoxSize,i=n.contentBoxSize,a=n.devicePixelContentBoxSize;switch(e){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},pt=function(t){var e=lt(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Y([e.borderBoxSize]),this.contentBoxSize=Y([e.contentBoxSize]),this.devicePixelContentBoxSize=Y([e.devicePixelContentBoxSize])},yt=function(t){if(tt(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},dt=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 pt(e.target),o=yt(e.target);n.push(r),e.lastReportedSize=ft(e.target,e.observedBox),ot?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},gt=[],mt=0,bt={attributes:!0,characterData:!0,childList:!0,subtree:!0},vt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wt=function(t){return void 0===t&&(t=0),Date.now()+t},xt=!1,St=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),!xt){xt=!0;var r,n=wt(t);r=function(){var r=!1;try{r=function(){var t,e=0;for(ht(e);q.some((function(t){return t.activeTargets.length>0}));)e=dt(),ht(e);return q.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:X}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=X),window.dispatchEvent(t)),e>0}()}finally{if(xt=!1,t=n-wt(),!mt)return;r?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!K){var e=0,r=document.createTextNode("");new MutationObserver((function(){return gt.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),K=function(){r.textContent="".concat(e?e--:e++)}}gt.push(t),K()}((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,bt)};document.body?e():rt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vt.forEach((function(e){return rt.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),vt.forEach((function(e){return rt.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}(),Et=new St,At=function(t){!mt&&t>0&&Et.start(),!(mt+=t)&&Et.stop()},Ot=function(){function t(t,e){this.target=t,this.observedBox=e||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ft(this.target,this.observedBox,!0);return t=this.target,Z(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}(),jt=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Tt=new WeakMap,Pt=function(t,e){for(var r=0;r=0&&(o&&q.splice(q.indexOf(r),1),r.observationTargets.splice(n,1),At(-1))},t.disconnect=function(t){var e=this,r=Tt.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Ct=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.");Rt.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(!et(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.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(!et(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Rt.unobserve(this,t)},t.prototype.disconnect=function(){Rt.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const It=window.ResizeObserver||Ct;let Nt=new Map,Mt=new Map;var kt=0;function $t(t){if(0===Mt.size)return null;for(const[e,r]of Mt)if(r.isActivable())for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements){let o=r.getBoundingClientRect().toJSON();if(_(o,t.clientX,t.clientY,1))return{group:e,item:n,element:r,rect:o}}return null}function Dt(t){return t&&t instanceof Element}window.addEventListener("load",(function(){const t=document.body;var e={width:0,height:0};new It((()=>{e.width===t.clientWidth&&e.height===t.clientHeight||(e={width:t.clientWidth,height:t.clientHeight},Mt.forEach((function(t){t.requestLayout()})))})).observe(t)}),!1);const Lt={NONE:"",DESCENDANT:" ",CHILD:" > "},Ft={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},Bt="CssSelectorGenerator";function _t(t="unknown problem",...e){console.warn(`${Bt}: ${t}`,...e)}const Wt={selectors:[Ft.id,Ft.class,Ft.tag,Ft.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function Ut(t){return t instanceof RegExp}function zt(t){return["string","function"].includes(typeof t)||Ut(t)}function Gt(t){return Array.isArray(t)?t.filter(zt):[]}function Ht(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function Vt(t,e){if(Ht(t))return t.contains(e)||_t("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 nto work as intended."),t;const r=e.getRootNode({composed:!1});return Ht(r)?(r!==document&&_t("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):e.ownerDocument.querySelector(":root")}function qt(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function Xt(t=[]){const[e=[],...r]=t;return 0===r.length?e:r.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function Kt(t){return[].concat(...t)}function Yt(t){const e=t.map((t=>{if(Ut(t))return e=>t.test(e);if("function"==typeof t)return e=>{const r=t(e);return"boolean"!=typeof r?(_t("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 _t("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 Jt(t,e,r){const n=Array.from(Vt(r,t[0]).querySelectorAll(e));return n.length===t.length&&t.every((t=>n.includes(t)))}function Qt(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const r=[];let n=t;for(;Dt(n)&&n!==e;)r.push(n),n=n.parentElement;return r}function Zt(t,e){return Xt(t.map((t=>Qt(t,e))))}const te=new RegExp(["^$","\\s"].join("|")),ee=new RegExp(["^$"].join("|")),re=[Ft.nthoftype,Ft.tag,Ft.id,Ft.class,Ft.attribute,Ft.nthchild],ne=Yt(["class","id","ng-*"]);function oe({name:t}){return`[${t}]`}function ie({name:t,value:e}){return`[${t}='${e}']`}function ae({nodeName:t,nodeValue:e}){return{name:(r=t,r.replace(/:/g,"\\:")),value:ve(e)};var r}function ue(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const r=e.tagName.toLowerCase();return!(["input","option"].includes(r)&&"value"===t||ne(t))}(e,t))).map(ae);return[...e.map(oe),...e.map(ie)]}function ce(t){return(t.getAttribute("class")||"").trim().split(/\s+/).filter((t=>!ee.test(t))).map((t=>`.${ve(t)}`))}function se(t){const e=t.getAttribute("id")||"",r=`#${ve(e)}`,n=t.getRootNode({composed:!1});return!te.test(e)&&Jt([t],r,n)?[r]:[]}function le(t){const e=t.parentNode;if(e){const r=Array.from(e.childNodes).filter(Dt).indexOf(t);if(r>-1)return[`:nth-child(${r+1})`]}return[]}function fe(t){return[ve(t.tagName.toLowerCase())]}function pe(t){const e=[...new Set(Kt(t.map(fe)))];return 0===e.length||e.length>1?[]:[e[0]]}function ye(t){const e=pe([t])[0],r=t.parentElement;if(r){const n=Array.from(r.children).filter((t=>t.tagName.toLowerCase()===e)),o=n.indexOf(t);if(o>-1)return[`${e}:nth-of-type(${o+1})`]}return[]}function de(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(function*(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let r=0,n=ge(1);for(;n.length<=t.length&&rt[e]));yield e,n=he(n,t.length-1)}}(t,{maxResults:e}))}function he(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 ge(r+1);n[t-1]++,n[t]=n[t-1]+1}return n[r-1]>e?ge(r+1):n}function ge(t=1){return Array.from(Array(t).keys())}const me=":".charCodeAt(0).toString(16).toUpperCase(),be=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function ve(t=""){var e,r;return null!==(r=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==r?r:function(t=""){return t.split("").map((t=>":"===t?`\\${me} `:be.test(t)?`\\${t}`:escape(t).replace(/%/g,"\\"))).join("")}(t)}const we={tag:pe,id:function(t){return 0===t.length||t.length>1?[]:se(t[0])},class:function(t){return Xt(t.map(ce))},attribute:function(t){return Xt(t.map(ue))},nthchild:function(t){return Xt(t.map(le))},nthoftype:function(t){return Xt(t.map(ye))}},xe={tag:fe,id:se,class:ce,attribute:ue,nthchild:le,nthoftype:ye};function Se(t){return t.includes(Ft.tag)||t.includes(Ft.nthoftype)?[...t]:[...t,Ft.tag]}function Ee(t={}){const e=[...re];return t[Ft.tag]&&t[Ft.nthoftype]&&e.splice(e.indexOf(Ft.tag),1),e.map((e=>{return(n=t)[r=e]?n[r].join(""):"";var r,n})).join("")}function Ae(t,e,r="",n){const o=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+Lt.DESCENDANT+t)),...t.map((t=>e+Lt.CHILD+t))]}(t,e)}(function(t,e,r){const n=function(t,e){const{blacklist:r,whitelist:n,combineWithinSelector:o,maxCombinations:i}=e,a=Yt(r),u=Yt(n);return function(t){const{selectors:e,includeTag:r}=t,n=[].concat(e);return r&&!n.includes("tag")&&n.push("tag"),n}(e).reduce(((e,r)=>{const n=function(t,e){var r;return(null!==(r=we[e])&&void 0!==r?r:()=>[])(t)}(t,r),c=function(t=[],e,r){return t.filter((t=>r(t)||!e(t)))}(n,a,u),s=function(t=[],e){return t.sort(((t,r)=>{const n=e(t),o=e(r);return n&&!o?-1:!n&&o?1:0}))}(c,u);return e[r]=o?de(s,{maxResults:i}):s.map((t=>[t])),e}),{})}(t,r),o=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:r,includeTag:n,maxCandidates:o}=t,i=r?de(e,{maxResults:o}):e.map((t=>[t]));return n?i.map(Se):i}(e).map((e=>function(t,e){const r={};return t.forEach((t=>{const n=e[t];n.length>0&&(r[t]=n)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,r])=>{e=r.flatMap((r=>0===e.length?[{[t]:r}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:r})))))})),e}(r).map(Ee)}(e,t))).filter((t=>t.length>0))}(n,r),i=Kt(o);return[...new Set(i)]}(t,n.root,n),r);for(const e of o)if(Jt(t,e,n.root))return e;return null}function Oe(t){return{value:t,include:!1}}function je({selectors:t,operator:e}){let r=[...re];t[Ft.tag]&&t[Ft.nthoftype]&&(r=r.filter((t=>t!==Ft.tag)));let n="";return r.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(n+=t)}))})),e+n}function Te(t){return[":root",...Qt(t).reverse().map((t=>{const e=function(t,e,r=Lt.NONE){const n={};return e.forEach((e=>{Reflect.set(n,e,function(t,e){return xe[e](t)}(t,e).map(Oe))})),{element:t,operator:r,selectors:n}}(t,[Ft.nthchild],Lt.CHILD);return e.selectors.nthchild.forEach((t=>{t.include=!0})),e})).map(je)].join("")}function Pe(t,e={}){const r=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(Dt);return[...new Set(e)]}(t),n=function(t,e={}){const r=Object.assign(Object.assign({},Wt),e);return{selectors:(n=r.selectors,Array.isArray(n)?n.filter((t=>{return e=Ft,r=t,Object.values(e).includes(r);var e,r})):[]),whitelist:Gt(r.whitelist),blacklist:Gt(r.blacklist),root:Vt(r.root,t),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:qt(r.maxCombinations),maxCandidates:qt(r.maxCandidates)};var n}(r[0],e);let o="",i=n.root;function a(){return function(t,e,r="",n){if(0===t.length)return null;const o=[t.length>1?t:[],...Zt(t,e).map((t=>[t]))];for(const t of o){const e=Ae(t,0,r,n);if(e)return{foundElements:t,selector:e}}return null}(r,i,o,n)}let u=a();for(;u;){const{foundElements:t,selector:e}=u;if(Jt(r,e,n.root))return e;i=t[0],o=e,u=a()}return r.length>1?r.map((t=>Pe(t,n))).join(", "):function(t){return t.map(Te).join(", ")}(r)}function Re(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?Re(t.parentElement):null}function Ce(t){for(var e=0;e0&&e.top0&&e.left{Be(t)||(_e(t),We("down",t))})),window.addEventListener("keyup",(t=>{Be(t)||(_e(t),We("up",t))})),r.g.readium={scrollToId:function(t){let e=document.getElementById(t);return!!e&&(A(e.getBoundingClientRect()),!0)},scrollToPosition:function(t,e){if(console.log("ScrollToPosition"),t<0||t>1)console.log("InvalidPosition");else if(E()){let e=document.scrollingElement.scrollHeight*t;document.scrollingElement.scrollTop=e}else{let r=document.scrollingElement.scrollWidth*t*("rtl"==e?-1:1);document.scrollingElement.scrollLeft=j(r)}},scrollToLocator:function(t){let e=T(t);return!!e&&function(t){return A(t.getBoundingClientRect())}(e)},scrollLeft:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX-n,i=e?-(r-n):0;return O(Math.max(o,i))},scrollRight:function(t){var e="rtl"==t,r=document.scrollingElement.scrollWidth,n=window.innerWidth,o=window.scrollX+n,i=e?0:r-n;return O(Math.min(o,i))},setCSSProperties:function(t){for(const e in t)P(e,t[e])},setProperty:P,removeProperty:R,registerDecorationTemplates:function(t){var e="";for(const[r,n]of Object.entries(t))Nt.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){let t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},getDecorations:function(t){var e=Mt.get(t);return e||(e=function(t,e){var r=[],n=0,o=null,i=!1;function a(e){let o=t+"-"+n++,i=T(e.locator);if(!i)return void C("Can't locate DOM range for decoration",e);let a={id:o,decoration:e,range:i};r.push(a),c(a)}function u(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 c(r){let n=(o||((o=document.createElement("div")).setAttribute("id",t),o.setAttribute("data-group",e),o.style.setProperty("pointer-events","none"),requestAnimationFrame((function(){null!=o&&document.body.append(o)}))),o),i=Nt.get(r.decoration.style);if(!i)return void I(`Unknown decoration style: ${r.decoration.style}`);let a=document.createElement("div");a.setAttribute("id",r.id),a.setAttribute("data-style",r.decoration.style),a.style.setProperty("pointer-events","none");let u=window.innerWidth,c=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count")),s=u/(c||1),l=document.scrollingElement,f=l.scrollLeft,p=l.scrollTop;function y(t,e,r){if(t.style.position="absolute","wrap"===i.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===i.width){t.style.width=`${u}px`,t.style.height=`${e.height}px`;let r=Math.floor(e.left/u)*u;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}else if("bounds"===i.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+f}px`,t.style.top=`${e.top+p}px`;else if("page"===i.width){t.style.width=`${s}px`,t.style.height=`${e.height}px`;let r=Math.floor(e.left/s)*s;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}}let d,h=r.range.getBoundingClientRect();try{let t=document.createElement("template");t.innerHTML=r.decoration.element.trim(),d=t.content.firstElementChild}catch(t){return void I(`Invalid decoration element "${r.decoration.element}": ${t.message}`)}if("boxes"===i.layout){let t=!0,e=D(r.range,t);e=e.sort(((t,e)=>t.tope.top?1:0));for(let t of e){const e=d.cloneNode(!0);e.style.setProperty("pointer-events","none"),y(e,t,h),a.append(e)}}else if("bounds"===i.layout){const t=d.cloneNode(!0);t.style.setProperty("pointer-events","none"),y(t,h,h),a.append(t)}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 s(){o&&(o.remove(),o=null)}return{add:a,remove:u,update:function(t){u(t.id),a(t)},clear:function(){s(),r.length=0},items:r,requestLayout:function(){s(),r.forEach((t=>c(t)))},isActivable:function(){return i},setActivable:function(){i=!0}}}("r2-decoration-"+kt++,t),Mt.set(t,e)),e},findFirstVisibleLocator:function(){const t=Ce(document.body);return{href:"#",type:"application/xhtml+xml",locations:{cssSelector:Pe(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/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 14966a822..6bed5800e 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -663,19 +663,11 @@ private extension MouseButtons { init(json: [String: Any]) { self.init() - guard let buttons = json["buttons"] as? [Int] else { + guard let buttons = json["buttons"] as? Int else { return } - if buttons.contains(0) { - insert(.main) - } - if buttons.contains(1) { - insert(.auxiliary) - } - if buttons.contains(2) { - insert(.secondary) - } + self = MouseButtons(rawValue: buttons) } } diff --git a/Sources/Navigator/EPUB/Scripts/package.json b/Sources/Navigator/EPUB/Scripts/package.json index 0c3ef4367..4aad9b38e 100644 --- a/Sources/Navigator/EPUB/Scripts/package.json +++ b/Sources/Navigator/EPUB/Scripts/package.json @@ -12,22 +12,22 @@ "format": "prettier --list-different --write '**/*.js'" }, "browserslist": [ - "iOS 11" + "iOS 13" ], "devDependencies": { - "@babel/core": "^7.16.0", - "@babel/preset-env": "^7.16.0", - "babel-loader": "^8.2.3", - "eslint": "^7.29.0", + "@babel/core": "^7.23.9", + "@babel/preset-env": "^7.23.9", + "babel-loader": "^8.3.0", + "eslint": "^7.32.0", "prettier": "2.3.1", - "webpack": "^5.88.2", + "webpack": "^5.90.1", "webpack-cli": "^5.1.4" }, "dependencies": { - "@juggle/resize-observer": "^3.3.1", + "@juggle/resize-observer": "^3.4.0", "approx-string-match": "^1.1.0", - "css-selector-generator": "^3.6.1", - "string.prototype.matchall": "^4.0.5" + "css-selector-generator": "^3.6.6", + "string.prototype.matchall": "^4.0.10" }, "packageManager": "pnpm@8.15.1" } diff --git a/Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml b/Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml index 10efcaa2f..75eb2605e 100644 --- a/Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml +++ b/Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml @@ -6,36 +6,36 @@ settings: dependencies: '@juggle/resize-observer': - specifier: ^3.3.1 + specifier: ^3.4.0 version: 3.4.0 approx-string-match: specifier: ^1.1.0 version: 1.1.0 css-selector-generator: - specifier: ^3.6.1 + specifier: ^3.6.6 version: 3.6.6 string.prototype.matchall: - specifier: ^4.0.5 + specifier: ^4.0.10 version: 4.0.10 devDependencies: '@babel/core': - specifier: ^7.16.0 + specifier: ^7.23.9 version: 7.23.9 '@babel/preset-env': - specifier: ^7.16.0 + specifier: ^7.23.9 version: 7.23.9(@babel/core@7.23.9) babel-loader: - specifier: ^8.2.3 + specifier: ^8.3.0 version: 8.3.0(@babel/core@7.23.9)(webpack@5.90.1) eslint: - specifier: ^7.29.0 + specifier: ^7.32.0 version: 7.32.0 prettier: specifier: 2.3.1 version: 2.3.1 webpack: - specifier: ^5.88.2 + specifier: ^5.90.1 version: 5.90.1(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 @@ -1675,7 +1675,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001587 + caniuse-lite: 1.0.30001717 electron-to-chromium: 1.4.665 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.3) @@ -1700,8 +1700,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001587: - resolution: {integrity: sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==} + /caniuse-lite@1.0.30001717: + resolution: {integrity: sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==} dev: true /chalk@2.4.2: diff --git a/Sources/Navigator/Input/ActivatePointerObserver.swift b/Sources/Navigator/Input/ActivatePointerObserver.swift new file mode 100644 index 000000000..3320e834a --- /dev/null +++ b/Sources/Navigator/Input/ActivatePointerObserver.swift @@ -0,0 +1,143 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation +import ReadiumShared + +public extension InputObserving where Self == ActivatePointerObserver { + /// Recognizes a tap input event, if the given key `modifiers` are pressed. + static func tap( + modifiers: KeyModifiers = [], + _ onTap: @escaping (PointerEvent) async -> Bool + ) -> InputObserving { + ActivatePointerObserver( + modifiers: modifiers, + shouldIgnore: { $0.pointer.type != .touch }, + onActivate: onTap + ) + } + + /// Recognizes a click event, if the given key `modifiers` and mouse + /// `buttons` are pressed. + static func click( + buttons: MouseButtons = [.main], + modifiers: KeyModifiers = [], + _ onClick: @escaping (PointerEvent) async -> Bool + ) -> InputObserving { + ActivatePointerObserver( + modifiers: modifiers, + shouldIgnore: { + guard + case let .mouse(pointer) = $0.pointer, + $0.phase == .up || pointer.buttons == buttons + else { + return true + } + return false + }, + onActivate: onClick + ) + } +} + +/// Pointer observer recognizing a single button activation (e.g. a tap +/// or a click). +/// +/// If multiple pointers are activated or the pointer moved (e.g. drag), the +/// activation is considered cancelled. +public actor ActivatePointerObserver: InputObserving, Loggable { + private let modifiers: KeyModifiers + private let shouldIgnore: (PointerEvent) -> Bool + private let onActivate: (PointerEvent) async -> Bool + + public init( + modifiers: KeyModifiers = [], + shouldIgnore: @escaping (PointerEvent) -> Bool, + onActivate: @escaping (PointerEvent) async -> Bool + ) { + self.modifiers = modifiers + self.shouldIgnore = shouldIgnore + self.onActivate = onActivate + } + + private enum State { + case idle + case recognizing(id: AnyHashable, lastLocation: CGPoint) + case recognized(event: PointerEvent) + case failed(activePointers: Set) + } + + private var state: State = .idle { + didSet { +// log(.trace, "state \(state)") + } + } + + public func didReceive(_ event: PointerEvent) async -> Bool { + let ignored = shouldIgnore(event) +// log(.trace, "on \(ignored ? "ignored " : "")\(event)") + + guard !ignored else { + return false + } + + state = transition(state: state, event: event) + + if case let .recognized(event) = state { + let handled = await onActivate(event) + state = .idle + + return handled + } + + return false + } + + private func transition(state: State, event: PointerEvent) -> State { + let id = event.pointer.id + + switch (state, event.phase) { + case (.idle, .down): + if event.modifiers == modifiers { + return .recognizing(id: event.pointer.id, lastLocation: event.location) + } else { + return .failed(activePointers: [id]) + } + + case let (.recognizing(recognizingID, _), .down) where recognizingID != id: + return .failed(activePointers: [recognizingID, id]) + + case let (.recognizing(recognizingID, _), .cancel) where recognizingID == id: + return .idle + + case let (.recognizing(recognizingID, lastLocation), .move): + if recognizingID != id || abs(lastLocation.x - event.location.x) > 1 || abs(lastLocation.y - event.location.y) > 1 { + return .failed(activePointers: [recognizingID, id]) + } else { + return .recognizing(id: recognizingID, lastLocation: event.location) + } + + case let (.recognizing(recognizingID, _), .up) where recognizingID == id: + return .recognized(event: event) + + case var (.failed(activePointers), .down): + activePointers.insert(id) + return .failed(activePointers: activePointers) + + case var (.failed(activePointers), .up), + var (.failed(activePointers), .cancel): + activePointers.remove(id) + if activePointers.isEmpty { + return .idle + } else { + return .failed(activePointers: activePointers) + } + + default: + return state + } + } +} diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift index cc94814af..a26571251 100644 --- a/Sources/Navigator/Input/InputObserving.swift +++ b/Sources/Navigator/Input/InputObserving.swift @@ -28,83 +28,6 @@ public extension InputObserving { func didReceive(_ event: KeyEvent) async -> Bool { false } } -public extension InputObserving where Self == TapObserver { - static func tap(modifiers: KeyModifiers = [], _ onTap: @escaping (PointerEvent) async -> Bool) -> TapObserver { - TapObserver(modifiers: modifiers, onTap: onTap) - } -} - -public actor TapObserver: InputObserving { - private let modifiers: KeyModifiers - private let onTap: (PointerEvent) async -> Bool - - public init( - modifiers: KeyModifiers = [], - onTap: @escaping (PointerEvent) async -> Bool - ) { - self.modifiers = modifiers - self.onTap = onTap - } - - /// Last location of the single active pointer. - private var lastLocation: CGPoint? = nil - - /// Set of currently active pointer IDs. - private var activePointers: Set = [] - - /// True if a multitouch gesture has been detected (and should ignore tap). - private var isMultitouch = false - - /// Indicates whether the touch moved enough to cancel the tap. - private var hasMoved: Bool = false - - public func didReceive(_ event: PointerEvent) async -> Bool { - guard case .touch = event.pointer else { - return false - } - - var handled = false - - switch event.phase { - case .down: - activePointers.insert(event.pointer.id) - if activePointers.count > 1 { - isMultitouch = true - } else { - lastLocation = event.location - } - - case .move: - guard !isMultitouch, !hasMoved, let lastLocation = lastLocation else { - break - } - if abs(lastLocation.x - event.location.x) > 1 || abs(lastLocation.y - event.location.y) > 1 { - hasMoved = true - } - - case .up: - activePointers.remove(event.pointer.id) - - // Only recognize tap if: - // - This was not part of a multitouch gesture - // - There are no more active pointers (all fingers up) - if !isMultitouch, !hasMoved { - handled = await onTap(event) - } - case .cancel: - activePointers.remove(event.pointer.id) - } - - // If all pointers are up, reset state. - if activePointers.isEmpty { - isMultitouch = false - hasMoved = false - } - - return handled - } -} - /// Utility to store and manage a set of ``InputObserver``. final class InputObservingSet: InputObservable { private typealias Observer = (token: InputObservableToken, observer: InputObserving) diff --git a/Sources/Navigator/Input/PointerEvent.swift b/Sources/Navigator/Input/PointerEvent.swift index e4a5656bf..73d66f6f8 100644 --- a/Sources/Navigator/Input/PointerEvent.swift +++ b/Sources/Navigator/Input/PointerEvent.swift @@ -21,7 +21,7 @@ public struct PointerEvent: Equatable { public var modifiers: KeyModifiers /// Phase of a pointer event. - public enum Phase: Equatable { + public enum Phase: Equatable, CustomStringConvertible { /// Fired when a pointer becomes active. case down @@ -35,25 +35,55 @@ public struct PointerEvent: Equatable { /// Fired if the navigator cannot generate more events for this pointer, /// for example because the interaction was captured by the system. case cancel + + public var description: String { + switch self { + case .down: "down" + case .move: "move" + case .up: "up" + case .cancel: "cancel" + } + } } } /// Represents a pointer device, such as a mouse or a physical touch. -public enum Pointer: Equatable { +public enum Pointer: Equatable, CustomStringConvertible { case touch(TouchPointer) case mouse(MousePointer) /// Unique identifier for this pointer. public var id: AnyHashable { + switch self { + case let .touch(pointer): pointer.id + case let .mouse(pointer): pointer.id + } + } + + /// Type of the pointer. + public var type: PointerType { + switch self { + case .touch: .touch + case .mouse: .mouse + } + } + + public var description: String { switch self { case let .touch(pointer): - return pointer.id + return "touch (\(pointer.id))" case let .mouse(pointer): - return pointer.id + return "mouse (\(pointer.id)) \(pointer.buttons)" } } } +/// Type of a pointer. +public enum PointerType: Equatable { + case touch + case mouse +} + /// Represents a physical touch pointer. public struct TouchPointer: Identifiable, Equatable { /// Unique identifier for this pointer. @@ -79,19 +109,52 @@ public struct MousePointer: Identifiable, Equatable { } /// Represents a set of mouse buttons. -public struct MouseButtons: OptionSet, Equatable { +/// +/// The values are derived from https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#value +public struct MouseButtons: OptionSet, Equatable, CustomStringConvertible { /// Main button, usually the left button. public static let main = MouseButtons(rawValue: 1 << 0) + /// Secondary button, usually the right button. + public static let secondary = MouseButtons(rawValue: 1 << 1) + /// Auxiliary button, usually the wheel button or the middle button. - public static let auxiliary = MouseButtons(rawValue: 1 << 1) + public static let auxiliary = MouseButtons(rawValue: 1 << 2) - /// Secondary button, usually the right button. - public static let secondary = MouseButtons(rawValue: 1 << 2) + /// 4th button (typically the "Browser Back" button). + public static let fourth = MouseButtons(rawValue: 1 << 3) + + /// 5th button (typically the "Browser Forward" button) + public static let fifth = MouseButtons(rawValue: 1 << 4) public var rawValue: Int public init(rawValue: Int) { self.rawValue = rawValue } + + public var description: String { + var buttons: [String] = [] + if contains(.main) { + buttons.append("main") + } + if contains(.secondary) { + buttons.append("secondary") + } + if contains(.auxiliary) { + buttons.append("auxiliary") + } + if contains(.fourth) { + buttons.append("fourth") + } + if contains(.fifth) { + buttons.append("fifth") + } + + guard !buttons.isEmpty else { + return "[]" + } + + return "[" + buttons.joined(separator: ",") + "]" + } } From 8cd67ef36790a6c12d0ebcac30ab6884d08a2cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 14:46:37 +0200 Subject: [PATCH 05/22] Activate helper --- .../Input/ActivatePointerObserver.swift | 19 +++++++++++++++++++ Sources/Shared/Logger/LoggerStub.swift | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Sources/Navigator/Input/ActivatePointerObserver.swift b/Sources/Navigator/Input/ActivatePointerObserver.swift index 3320e834a..2e6c20e6e 100644 --- a/Sources/Navigator/Input/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/ActivatePointerObserver.swift @@ -8,6 +8,25 @@ import Foundation import ReadiumShared public extension InputObserving where Self == ActivatePointerObserver { + /// Recognizes a tap or (main) click input event, if the given key + /// `modifiers` are pressed. + static func activate( + modifiers: KeyModifiers = [], + _ onActivate: @escaping (PointerEvent) async -> Bool + ) -> InputObserving { + ActivatePointerObserver( + modifiers: modifiers, + shouldIgnore: { + switch $0.pointer { + case .mouse(let pointer): + return $0.phase != .up && pointer.buttons != [.main] + case .touch: + return false + } + }, + onActivate: onActivate + ) + } /// Recognizes a tap input event, if the given key `modifiers` are pressed. static func tap( modifiers: KeyModifiers = [], diff --git a/Sources/Shared/Logger/LoggerStub.swift b/Sources/Shared/Logger/LoggerStub.swift index aabc728b0..3a5d5f2c5 100644 --- a/Sources/Shared/Logger/LoggerStub.swift +++ b/Sources/Shared/Logger/LoggerStub.swift @@ -17,6 +17,6 @@ public class LoggerStub: LoggerType { return } let fileName = URL(fileURLWithPath: file).lastPathComponent - print("\(level.symbol) \(fileName):\(line):\t\(String(describing: value))") + print("\(level.symbol) \(fileName):\(line): \(String(describing: value))") } } From 670ce214cc0cc85603edd759724362aaa5467037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 16:11:12 +0200 Subject: [PATCH 06/22] Add the `KeyObserver` --- .../Input/{KeyEvent.swift => Key/Key.swift} | 101 +++++++----------- Sources/Navigator/Input/Key/KeyEvent.swift | 74 +++++++++++++ .../Input/{ => Key}/KeyModifiers.swift | 22 ++-- Sources/Navigator/Input/Key/KeyObserver.swift | 67 ++++++++++++ .../ActivatePointerObserver.swift | 25 +++-- .../Input/{ => Pointer}/PointerEvent.swift | 0 6 files changed, 201 insertions(+), 88 deletions(-) rename Sources/Navigator/Input/{KeyEvent.swift => Key/Key.swift} (65%) create mode 100644 Sources/Navigator/Input/Key/KeyEvent.swift rename Sources/Navigator/Input/{ => Key}/KeyModifiers.swift (83%) create mode 100644 Sources/Navigator/Input/Key/KeyObserver.swift rename Sources/Navigator/Input/{ => Pointer}/ActivatePointerObserver.swift (90%) rename Sources/Navigator/Input/{ => Pointer}/PointerEvent.swift (100%) diff --git a/Sources/Navigator/Input/KeyEvent.swift b/Sources/Navigator/Input/Key/Key.swift similarity index 65% rename from Sources/Navigator/Input/KeyEvent.swift rename to Sources/Navigator/Input/Key/Key.swift index 9a751c9eb..5472241f1 100644 --- a/Sources/Navigator/Input/KeyEvent.swift +++ b/Sources/Navigator/Input/Key/Key.swift @@ -7,45 +7,6 @@ import Foundation import UIKit -/// Represents a keyboard event emitted by a Navigator. -public struct KeyEvent: Equatable, CustomStringConvertible { - /// Phase of this event, e.g. pressed or released. - public var phase: Phase - - /// Key the user pressed or released. - public var key: Key - - /// Additional key modifiers for keyboard shortcuts. - public var modifiers: KeyModifiers - - public init(phase: Phase, key: Key, modifiers: KeyModifiers = []) { - self.phase = phase - self.key = key - self.modifiers = modifiers - } - - public var description: String { - "\(phase) \(modifiers) \(key.description)" - } - - /// Phase of a key event, e.g. pressed or released. - public enum Phase: Equatable, CustomStringConvertible { - case down - case change - case up - case cancel - - public var description: String { - switch self { - case .down: "down" - case .up: "up" - case .change: "change" - case .cancel: "cancel" - } - } - } -} - public enum Key: Equatable, CustomStringConvertible { // Printable character. case character(String) @@ -120,35 +81,47 @@ public enum Key: Equatable, CustomStringConvertible { return "Escape" } } + + public static let a: Key = .character("a") + public static let b: Key = .character("b") + public static let c: Key = .character("c") + public static let d: Key = .character("d") + public static let e: Key = .character("e") + public static let f: Key = .character("f") + public static let g: Key = .character("g") + public static let h: Key = .character("h") + public static let i: Key = .character("i") + public static let j: Key = .character("j") + public static let k: Key = .character("k") + public static let l: Key = .character("l") + public static let m: Key = .character("m") + public static let n: Key = .character("n") + public static let o: Key = .character("o") + public static let p: Key = .character("p") + public static let q: Key = .character("q") + public static let r: Key = .character("r") + public static let s: Key = .character("s") + public static let t: Key = .character("t") + public static let u: Key = .character("u") + public static let v: Key = .character("v") + public static let w: Key = .character("w") + public static let x: Key = .character("x") + public static let y: Key = .character("y") + public static let z: Key = .character("z") + public static let zero: Key = .character("0") + public static let one: Key = .character("1") + public static let two: Key = .character("2") + public static let three: Key = .character("3") + public static let four: Key = .character("4") + public static let five: Key = .character("5") + public static let six: Key = .character("6") + public static let seven: Key = .character("7") + public static let eight: Key = .character("8") + public static let nine: Key = .character("9") } // MARK: - UIKit extensions -public extension KeyEvent { - init?(uiPress: UIPress) { - guard - let key = Key(uiPress: uiPress), - var modifiers = KeyModifiers(uiPress: uiPress) - else { - return nil - } - - if let modKey = KeyModifiers(key: key) { - modifiers.remove(modKey) - } - - let phase: Phase = switch uiPress.phase { - case .began: .down - case .changed, .stationary: .change - case .ended: .up - case .cancelled: .cancel - @unknown default: .change - } - - self.init(phase: phase, key: key, modifiers: modifiers) - } -} - public extension Key { init?(uiPress: UIPress) { guard let key = uiPress.key else { diff --git a/Sources/Navigator/Input/Key/KeyEvent.swift b/Sources/Navigator/Input/Key/KeyEvent.swift new file mode 100644 index 000000000..12b733291 --- /dev/null +++ b/Sources/Navigator/Input/Key/KeyEvent.swift @@ -0,0 +1,74 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation +import UIKit + +/// Represents a keyboard event emitted by a Navigator. +public struct KeyEvent: Equatable, CustomStringConvertible { + /// Phase of this event, e.g. pressed or released. + public var phase: Phase + + /// Key the user pressed or released. + public var key: Key + + /// Additional key modifiers for keyboard shortcuts. + public var modifiers: KeyModifiers + + public init(phase: Phase, key: Key, modifiers: KeyModifiers = []) { + self.phase = phase + self.key = key + self.modifiers = modifiers + } + + public var description: String { + "\(phase) \(modifiers) \(key.description)" + } + + /// Phase of a key event, e.g. pressed or released. + public enum Phase: Equatable, CustomStringConvertible { + case down + case change + case up + case cancel + + public var description: String { + switch self { + case .down: "down" + case .up: "up" + case .change: "change" + case .cancel: "cancel" + } + } + } +} + +// MARK: - UIKit extensions + +public extension KeyEvent { + init?(uiPress: UIPress) { + guard + let key = Key(uiPress: uiPress), + var modifiers = KeyModifiers(uiPress: uiPress) + else { + return nil + } + + if let modKey = KeyModifiers(key: key) { + modifiers.remove(modKey) + } + + let phase: Phase = switch uiPress.phase { + case .began: .down + case .changed, .stationary: .change + case .ended: .up + case .cancelled: .cancel + @unknown default: .change + } + + self.init(phase: phase, key: key, modifiers: modifiers) + } +} diff --git a/Sources/Navigator/Input/KeyModifiers.swift b/Sources/Navigator/Input/Key/KeyModifiers.swift similarity index 83% rename from Sources/Navigator/Input/KeyModifiers.swift rename to Sources/Navigator/Input/Key/KeyModifiers.swift index 9dce1d606..be38cddd2 100644 --- a/Sources/Navigator/Input/KeyModifiers.swift +++ b/Sources/Navigator/Input/Key/KeyModifiers.swift @@ -34,26 +34,26 @@ public struct KeyModifiers: OptionSet, Equatable, CustomStringConvertible { } } - public var description: String { - var modifiers: [String] = [] + /// Returns the modifiers as keys. + public var keys: [Key] { + var keys: [Key] = [] if contains(.command) { - modifiers.append("Command") + keys.append(.command) } if contains(.control) { - modifiers.append("Control") + keys.append(.control) } if contains(.option) { - modifiers.append("Option") + keys.append(.option) } if contains(.shift) { - modifiers.append("Shift") - } - - guard !modifiers.isEmpty else { - return "[]" + keys.append(.shift) } + return keys + } - return "[" + modifiers.joined(separator: ",") + "]" + public var description: String { + keys.map(\.description).joined(separator: "+") } } diff --git a/Sources/Navigator/Input/Key/KeyObserver.swift b/Sources/Navigator/Input/Key/KeyObserver.swift new file mode 100644 index 000000000..63fa2e790 --- /dev/null +++ b/Sources/Navigator/Input/Key/KeyObserver.swift @@ -0,0 +1,67 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +public extension InputObserving where Self == KeyObserver { + /// Recognizes any key press. + /// + /// Inspect the provided ``KeyEvent`` to know which keys were pressed. + static func key( + onKey: @escaping (KeyEvent) async -> Bool + ) -> KeyObserver { + KeyObserver(onKey: onKey) + } + + /// Recognizes a key combination pressed (e.g. A or Cmd+B). + static func key( + _ key: Key, + _ modifiers: KeyModifiers = [], + onKey: @escaping () async -> Bool + ) -> KeyObserver { + KeyObserver(key: key, modifiers: modifiers, onKey: onKey) + } +} + +/// An input observer used to recognize a single key combination pressed. +public actor KeyObserver: InputObserving { + private typealias KeyCombo = (KeyModifiers, Key) + + private let keyCombo: KeyCombo? + private let onKey: (KeyEvent) async -> Bool + + public init( + key: Key, + modifiers: KeyModifiers, + onKey: @escaping () async -> Bool + ) { + keyCombo = (modifiers, key) + self.onKey = { _ in await onKey() } + } + + public init( + onKey: @escaping (KeyEvent) async -> Bool + ) { + keyCombo = nil + self.onKey = onKey + } + + public func didReceive(_ event: KeyEvent) async -> Bool { + guard event.phase == .down else { + return false + } + if let (modifiers, key) = keyCombo { + guard + event.key == key, + event.modifiers == modifiers + else { + return false + } + } + + return await onKey(event) + } +} diff --git a/Sources/Navigator/Input/ActivatePointerObserver.swift b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift similarity index 90% rename from Sources/Navigator/Input/ActivatePointerObserver.swift rename to Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift index 2e6c20e6e..388ded5e4 100644 --- a/Sources/Navigator/Input/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift @@ -12,13 +12,13 @@ public extension InputObserving where Self == ActivatePointerObserver { /// `modifiers` are pressed. static func activate( modifiers: KeyModifiers = [], - _ onActivate: @escaping (PointerEvent) async -> Bool - ) -> InputObserving { + onActivate: @escaping (PointerEvent) async -> Bool + ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, shouldIgnore: { switch $0.pointer { - case .mouse(let pointer): + case let .mouse(pointer): return $0.phase != .up && pointer.buttons != [.main] case .touch: return false @@ -27,11 +27,12 @@ public extension InputObserving where Self == ActivatePointerObserver { onActivate: onActivate ) } + /// Recognizes a tap input event, if the given key `modifiers` are pressed. static func tap( modifiers: KeyModifiers = [], - _ onTap: @escaping (PointerEvent) async -> Bool - ) -> InputObserving { + onTap: @escaping (PointerEvent) async -> Bool + ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, shouldIgnore: { $0.pointer.type != .touch }, @@ -44,8 +45,8 @@ public extension InputObserving where Self == ActivatePointerObserver { static func click( buttons: MouseButtons = [.main], modifiers: KeyModifiers = [], - _ onClick: @escaping (PointerEvent) async -> Bool - ) -> InputObserving { + onClick: @escaping (PointerEvent) async -> Bool + ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, shouldIgnore: { @@ -85,7 +86,7 @@ public actor ActivatePointerObserver: InputObserving, Loggable { private enum State { case idle case recognizing(id: AnyHashable, lastLocation: CGPoint) - case recognized(event: PointerEvent) + case recognized case failed(activePointers: Set) } @@ -105,11 +106,9 @@ public actor ActivatePointerObserver: InputObserving, Loggable { state = transition(state: state, event: event) - if case let .recognized(event) = state { - let handled = await onActivate(event) + if case .recognized = state { state = .idle - - return handled + return await onActivate(event) } return false @@ -140,7 +139,7 @@ public actor ActivatePointerObserver: InputObserving, Loggable { } case let (.recognizing(recognizingID, _), .up) where recognizingID == id: - return .recognized(event: event) + return .recognized case var (.failed(activePointers), .down): activePointers.insert(id) diff --git a/Sources/Navigator/Input/PointerEvent.swift b/Sources/Navigator/Input/Pointer/PointerEvent.swift similarity index 100% rename from Sources/Navigator/Input/PointerEvent.swift rename to Sources/Navigator/Input/Pointer/PointerEvent.swift From 466773c7fd10d5b43b9b229acc0a668d6509198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 16:11:55 +0200 Subject: [PATCH 07/22] Refactoring --- .../Navigator/EPUB/EPUBNavigatorViewController.swift | 10 +++++----- Sources/Navigator/Input/InputObservable.swift | 7 ++++++- Sources/Navigator/Input/InputObserving.swift | 10 +++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index ea03570db..184683d24 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -240,7 +240,7 @@ open class EPUBNavigatorViewController: UIViewController, public private(set) var currentLocation: Locator? private let loadPositionsByReadingOrder: () async -> ReadResult<[[Locator]]> private var positionsByReadingOrder: [[Locator]] = [] - private let inputObservers = InputObservingSet() + private let inputObservers = CompositeInputObserver() private let tasks = CancellableTasks() private let viewModel: EPUBNavigatorViewModel @@ -895,8 +895,8 @@ open class EPUBNavigatorViewController: UIViewController, // MARK: - InputObservable @discardableResult - public func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { - inputObservers.addInputObserver(observer) + public func addObserver(_ observer: any InputObserving) -> InputObservableToken { + inputObservers.addObserver(observer) } public func removeObserver(_ token: InputObservableToken) { @@ -1071,11 +1071,11 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { - _ = inputObservers.didReceive(event) + inputObservers.didReceive(event) } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) { - _ = inputObservers.didReceive(event) + inputObservers.didReceive(event) switch event.phase { case .down: diff --git a/Sources/Navigator/Input/InputObservable.swift b/Sources/Navigator/Input/InputObservable.swift index 64f412ddd..9dfb329d0 100644 --- a/Sources/Navigator/Input/InputObservable.swift +++ b/Sources/Navigator/Input/InputObservable.swift @@ -14,7 +14,7 @@ public protocol InputObservable { /// - Returns: An opaque token which can be used to remove the observer with /// `removeInputObserver`. @discardableResult - func addInputObserver(_ observer: InputObserving) -> InputObservableToken + func addObserver(_ observer: InputObserving) -> InputObservableToken /// Unregisters an ``InputObserver`` from this receiver using the given /// `token` returned by `addInputObserver`. @@ -29,4 +29,9 @@ public struct InputObservableToken: Hashable, Identifiable { public init(id: AnyHashable = UUID()) { self.id = id } + + /// Stores the receiver in the given `set` of tokens. + public func store(in set: inout Set) { + set.insert(self) + } } diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift index a26571251..ec6a506f3 100644 --- a/Sources/Navigator/Input/InputObserving.swift +++ b/Sources/Navigator/Input/InputObserving.swift @@ -28,13 +28,17 @@ public extension InputObserving { func didReceive(_ event: KeyEvent) async -> Bool { false } } -/// Utility to store and manage a set of ``InputObserver``. -final class InputObservingSet: InputObservable { +/// Utility for storing and managing a list of ``InputObserving`` objects. +/// +/// The order of the observers is significant because a previous observer might +/// consume an event. When an event is consumed, the other observers will still +/// receive the event but with a `cancel` phase. +final class CompositeInputObserver: InputObservable { private typealias Observer = (token: InputObservableToken, observer: InputObserving) private var observers: [Observer] = [] - func addInputObserver(_ observer: any InputObserving) -> InputObservableToken { + func addObserver(_ observer: any InputObserving) -> InputObservableToken { let token = InputObservableToken() precondition(!observers.contains { $0.token == token }) observers.append(Observer(token: token, observer: observer)) From 9887d5ddd09447e052a4b938cf60fb2f6b67a362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 17:01:51 +0200 Subject: [PATCH 08/22] Update the `DirectionalNavigationAdapter` --- .../DirectionalNavigationAdapter.swift | 96 ++++++++++++------- .../Reader/Common/ReaderViewController.swift | 29 ++++-- .../Common/VisualReaderViewController.swift | 56 ++++++----- 3 files changed, 113 insertions(+), 68 deletions(-) diff --git a/Sources/Navigator/DirectionalNavigationAdapter.swift b/Sources/Navigator/DirectionalNavigationAdapter.swift index 5a2307681..d4cf462ef 100644 --- a/Sources/Navigator/DirectionalNavigationAdapter.swift +++ b/Sources/Navigator/DirectionalNavigationAdapter.swift @@ -30,7 +30,6 @@ public final class DirectionalNavigationAdapter { } } - private weak var navigator: VisualNavigator? private let tapEdges: TapEdges private let handleTapsWhileScrolling: Bool private let minimumHorizontalEdgeSize: Double @@ -39,10 +38,11 @@ public final class DirectionalNavigationAdapter { private let verticalEdgeThresholdPercent: Double? private let animatedTransition: Bool + private weak var navigator: VisualNavigator? + /// Initializes a new `DirectionalNavigationAdapter`. /// /// - Parameters: - /// - navigator: Navigator used to turn pages. /// - tapEdges: Indicates which viewport edges handle taps. /// - handleTapsWhileScrolling: Indicates whether the page turns should be /// handled when the publication is scrollable. @@ -59,7 +59,6 @@ public final class DirectionalNavigationAdapter { /// - animatedTransition: Indicates whether the page turns should be /// animated. public init( - navigator: VisualNavigator? = nil, tapEdges: TapEdges = .horizontal, handleTapsWhileScrolling: Bool = false, minimumHorizontalEdgeSize: Double = 80.0, @@ -68,7 +67,6 @@ public final class DirectionalNavigationAdapter { verticalEdgeThresholdPercent: Double? = 0.3, animatedTransition: Bool = false ) { - self.navigator = navigator self.tapEdges = tapEdges self.handleTapsWhileScrolling = handleTapsWhileScrolling self.minimumHorizontalEdgeSize = minimumHorizontalEdgeSize @@ -76,37 +74,30 @@ public final class DirectionalNavigationAdapter { self.minimumVerticalEdgeSize = minimumVerticalEdgeSize self.verticalEdgeThresholdPercent = verticalEdgeThresholdPercent self.animatedTransition = animatedTransition - - if let navigator = navigator { - bind(to: navigator) - } } /// Binds the adapter to the given visual navigator. /// /// It will automatically observe pointer and key events to turn pages. public func bind(to navigator: VisualNavigator) { - self.navigator = navigator - if let observable = navigator as? InputObservable { - observable.addInputObserver(.tap { event in - await self.didTap(at: event.location) - }) - } + navigator.addObserver(.tap { [self, weak navigator] event in + guard let navigator = navigator else { + return false + } + return await onTap(at: event.location, in: navigator) + }) + + navigator.addObserver(.key { [self, weak navigator] event in + guard let navigator = navigator else { + return false + } + return await onKey(event, in: navigator) + }) } - /// Turn pages when `point` is located in one of the tap edges. - /// - /// To be called from `VisualNavigatorDelegate.navigator(_:didTapAt:)`. - /// - /// - Parameter point: Tap point in the navigator bounds. - /// - Returns: Whether the tap triggered a page turn. @MainActor - @discardableResult - public func didTap(at point: CGPoint) async -> Bool { - guard - let navigator = navigator, - handleTapsWhileScrolling || !navigator.presentation.scroll - else { + private func onTap(at point: CGPoint, in navigator: VisualNavigator) async -> Bool { + guard handleTapsWhileScrolling || !navigator.presentation.scroll else { return false } @@ -144,17 +135,8 @@ public final class DirectionalNavigationAdapter { return false } - /// Turn pages when the arrow or space keys are used. - /// - /// To be called from `VisualNavigatorDelegate.navigator(_:didPressKey:)` - /// - /// - Returns: Whether the key press triggered a page turn. - @discardableResult - public func didPressKey(event: KeyEvent) async -> Bool { - guard - let navigator = navigator, - event.modifiers.isEmpty - else { + private func onKey(_ event: KeyEvent, in navigator: VisualNavigator) async -> Bool { + guard event.modifiers.isEmpty else { return false } @@ -173,4 +155,44 @@ public final class DirectionalNavigationAdapter { return false } } + + @available(*, deprecated, message: "Use the initializer without the navigator parameter and call `bind(to:)`. See the migration guide.") + public init( + navigator: VisualNavigator, + tapEdges: TapEdges = .horizontal, + handleTapsWhileScrolling: Bool = false, + minimumHorizontalEdgeSize: Double = 80.0, + horizontalEdgeThresholdPercent: Double? = 0.3, + minimumVerticalEdgeSize: Double = 80.0, + verticalEdgeThresholdPercent: Double? = 0.3, + animatedTransition: Bool = false + ) { + self.navigator = navigator + self.tapEdges = tapEdges + self.handleTapsWhileScrolling = handleTapsWhileScrolling + self.minimumHorizontalEdgeSize = minimumHorizontalEdgeSize + self.horizontalEdgeThresholdPercent = horizontalEdgeThresholdPercent + self.minimumVerticalEdgeSize = minimumVerticalEdgeSize + self.verticalEdgeThresholdPercent = verticalEdgeThresholdPercent + self.animatedTransition = animatedTransition + } + + @available(*, deprecated, message: "Use `bind(to:)` instead of notifying the event yourself. See the migration guide.") + @MainActor + @discardableResult + public func didTap(at point: CGPoint) async -> Bool { + guard let navigator = navigator else { + return false + } + return await onTap(at: point, in: navigator) + } + + @available(*, deprecated, message: "Use `bind(to:)` instead of notifying the event yourself. See the migration guide.") + @discardableResult + public func didPressKey(event: KeyEvent) async -> Bool { + guard let navigator = navigator else { + return false + } + return await onKey(event, in: navigator) + } } diff --git a/TestApp/Sources/Reader/Common/ReaderViewController.swift b/TestApp/Sources/Reader/Common/ReaderViewController.swift index dad858ea1..5db699737 100644 --- a/TestApp/Sources/Reader/Common/ReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/ReaderViewController.swift @@ -25,7 +25,7 @@ class ReaderViewController: UIViewController, var subscriptions = Set() - private var searchViewModel: SearchViewModel? + private(set) var searchViewModel: SearchViewModel? private var searchViewController: UIHostingController? init( @@ -165,21 +165,32 @@ class ReaderViewController: UIViewController, @objc func showSearchUI() { if searchViewModel == nil { searchViewModel = SearchViewModel(publication: publication) - searchViewModel?.$selectedLocator.sink(receiveValue: { [weak self] locator in - self?.searchViewController?.dismiss(animated: true, completion: nil) - if let self = self, let locator = locator { + searchViewModel?.$selectedLocator.sink { [weak self] locator in + guard let self else { return } + + self.searchViewController?.dismiss(animated: true, completion: nil) + if let locator = locator { Task { await self.navigator.go( to: locator, options: NavigatorGoOptions(animated: true) ) - if let decorator = self.navigator as? DecorableNavigator { - let decoration = Decoration(id: "selectedSearchResult", locator: locator, style: Decoration.Style.highlight(tint: .yellow, isActive: false)) - decorator.apply(decorations: [decoration], in: "search") - } } } - }).store(in: &subscriptions) + + if let decorator = self.navigator as? DecorableNavigator { + var decorations: [Decoration] = [] + if let locator = locator { + decorations.append(Decoration( + id: "selectedSearchResult", + locator: locator, + style: .highlight(tint: .yellow, isActive: false) + )) + } + decorator.apply(decorations: decorations, in: "search") + } + } + .store(in: &subscriptions) } let searchView = SearchView(viewModel: searchViewModel!) diff --git a/TestApp/Sources/Reader/Common/VisualReaderViewController.swift b/TestApp/Sources/Reader/Common/VisualReaderViewController.swift index 7723d2b7e..7d0f79268 100644 --- a/TestApp/Sources/Reader/Common/VisualReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/VisualReaderViewController.swift @@ -40,6 +40,7 @@ class VisualReaderViewController: ReaderViewCon bookmarks: bookmarks ) + setupUserInteraction() addHighlightDecorationsObserverOnce() updateHighlightDecorations() @@ -50,6 +51,39 @@ class VisualReaderViewController: ReaderViewCon } } + /// Setups the user interaction (e.g. taps) with the navigator. + private func setupUserInteraction() { + guard let navigator = navigator as? VisualNavigator else { + return + } + + /// This adapter will automatically turn pages when the user taps the + /// screen edges or press arrow keys. + /// + /// Bind it to the navigator before adding your own observers to prevent + /// triggering your actions when turning pages. + DirectionalNavigationAdapter().bind(to: navigator) + + // Clear the current search highlight on tap. + navigator.addObserver(.tap { [weak self] _ in + guard + let searchViewModel = self?.searchViewModel, + searchViewModel.selectedLocator != nil + else { + return false + } + + searchViewModel.selectedLocator = nil + return true + }) + + // Toggle the navigation bar on tap, if nothing else took precedence. + navigator.addObserver(.tap { [weak self] _ in + self?.toggleNavigationBar() + return true + }) + } + @available(*, unavailable) required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") @@ -161,28 +195,6 @@ class VisualReaderViewController: ReaderViewCon }() } - func navigator(_ navigator: VisualNavigator, didTapAt point: CGPoint) { - Task { - // Turn pages when tapping the edge of the screen. - guard await !DirectionalNavigationAdapter(navigator: navigator).didTap(at: point) else { - return - } - // clear a current search highlight - if let decorator = self.navigator as? DecorableNavigator { - decorator.apply(decorations: [], in: "search") - } - - toggleNavigationBar() - } - } - - func navigator(_ navigator: VisualNavigator, didPressKey event: KeyEvent) { - Task { - // Turn pages when pressing the arrow keys. - await DirectionalNavigationAdapter(navigator: navigator).didPressKey(event: event) - } - } - // MARK: - Highlights private let highlights: HighlightRepository? From 76f7cc7a09627ef9768a6e76c84fc13b8f2888e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 7 May 2025 17:34:59 +0200 Subject: [PATCH 09/22] Add documentation --- docs/Guides/Navigator/Input.md | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 docs/Guides/Navigator/Input.md diff --git a/docs/Guides/Navigator/Input.md b/docs/Guides/Navigator/Input.md new file mode 100644 index 000000000..8204b00bc --- /dev/null +++ b/docs/Guides/Navigator/Input.md @@ -0,0 +1,71 @@ +# Observing user input + +In visual publications like EPUB or PDF, users can interact with the `VisualNavigator` instance using gestures, a keyboard, a mouse, a pencil, or a trackpad. When the publication does not override user input events, you may want to intercept them to trigger actions in your user interface. For example, you can turn pages or toggle the navigation bar on taps, or open a bookmarks screen when pressing the Command-Shift-D hotkey. + +`VisualNavigator` implements `InputObservable`, providing a way to intercept input events. + +## Implementing an input observer + +Here's an example of a simple `InputObserving` implementation that logs all key and pointer events emitted by the navigator. + +```swift +navigator.addObserver(InputObserver()) + +final class InputObserver: InputObserving { + func didReceive(_ event: PointerEvent) async -> Bool { + print("Received pointer event: \(event)") + return false + } + + func didReceive(_ event: KeyEvent) async -> Bool { + print("Received key event: \(event)") + return false + } +} +``` + +If you choose to handle a specific event, return `true` to prevent subsequent observers from using it. This is useful when you want to avoid triggering multiple actions upon receiving an event. + +An `InputObserving` implementation receives low-level events that can be used to create higher-level gesture recognizers, such as taps or pinches. To assist you, the toolkit also offers helpers to observe tap, click and key press events. + +## Observing tap and click events + +The `ActivatePointerObserver` is an implementation of `InputObserving` recognizing single taps or clicks. You can use the convenient static factories to observe these events. + +```swift +navigator.addObserver(.tap { event in + print("User tapped at \(event.location)") + return false +}) + +// Key modifiers can be used to recognize an event only when a modifier key is pressed. +navigator.addObserver(.click(modifiers: [.shift]) { event in + print("User clicked at \(event.location)") + return false +}) +``` + +## Observing keyboard events + +Similarly, the `KeyboardObserver` implementation provides an easy method to intercept keyboard events. + +```swift +navigator.addObserver(.key { event in + print("User pressed the key \(event.key) with modifiers \(event.modifiers)") + return false +}) +``` + +It can also be used to observe a specific keyboard shortcut. + +```swift +navigator.addObserver(.key(.a) { + self.log(.info, "User pressed A") + return false +}) + +navigator.addObserver(.key(.a, [.control, .shift]) { + self.log(.info, "User pressed Control+Shift+A") + return false +}) +``` \ No newline at end of file From 2fd0cb4223b6779acdc4d33334d7ff3d70f4b69a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 13 May 2025 13:42:05 +0200 Subject: [PATCH 10/22] Update Carthage project --- Support/Carthage/.xcodegen | 13 +++- .../Readium.xcodeproj/project.pbxproj | 60 +++++++++++++++++-- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/Support/Carthage/.xcodegen b/Support/Carthage/.xcodegen index 49a684399..e2a3785c4 100644 --- a/Support/Carthage/.xcodegen +++ b/Support/Carthage/.xcodegen @@ -519,7 +519,18 @@ ../../Sources/Navigator/EPUB/Scripts/src/vendor/hypothesis/README.md ../../Sources/Navigator/EPUB/Scripts/webpack.config.js ../../Sources/Navigator/EPUB/UserSettings.swift -../../Sources/Navigator/KeyEvent.swift +../../Sources/Navigator/Input +../../Sources/Navigator/Input/.DS_Store +../../Sources/Navigator/Input/InputObservable.swift +../../Sources/Navigator/Input/InputObserving.swift +../../Sources/Navigator/Input/Key +../../Sources/Navigator/Input/Key/Key.swift +../../Sources/Navigator/Input/Key/KeyEvent.swift +../../Sources/Navigator/Input/Key/KeyModifiers.swift +../../Sources/Navigator/Input/Key/KeyObserver.swift +../../Sources/Navigator/Input/Pointer +../../Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift +../../Sources/Navigator/Input/Pointer/PointerEvent.swift ../../Sources/Navigator/Navigator.swift ../../Sources/Navigator/PDF ../../Sources/Navigator/PDF/PDFDocumentHolder.swift diff --git a/Support/Carthage/Readium.xcodeproj/project.pbxproj b/Support/Carthage/Readium.xcodeproj/project.pbxproj index e5f0d5995..f7f18d5dc 100644 --- a/Support/Carthage/Readium.xcodeproj/project.pbxproj +++ b/Support/Carthage/Readium.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 01AD628D6DE82E1C1C4C281D /* NavigationDocumentParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29AD63CD2A41586290547212 /* NavigationDocumentParser.swift */; }; 01E785BEA7F30AD1C8A5F3DE /* SearchService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B5B029CA09EE1F86A19612A /* SearchService.swift */; }; 01F29BAD25D4597903AF253F /* CompositeFormatSniffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41E54A18E2983098A6A4DAE0 /* CompositeFormatSniffer.swift */; }; + 02FD203F4290109CF240D278 /* KeyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = AACBE378F01200C74992CA91 /* KeyObserver.swift */; }; 035807359AFA2EE23E00F8AB /* TransformingContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0918DA360AAB646144E435D5 /* TransformingContainer.swift */; }; 03B5862162A21448DC7813C6 /* HTTPServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BCDF341872EEFB88B6674DE /* HTTPServer.swift */; }; 0411D7B6ACD75F2D03547787 /* RARFormatSniffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FEF14E6F136136D43A39897 /* RARFormatSniffer.swift */; }; @@ -68,6 +69,7 @@ 25E7A4A839D3BDB07D8A7203 /* Streamer.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE961CB4827D937CE3862B51 /* Streamer.swift */; }; 26CA8F00CA85378CA0F8B3F2 /* MediaTypeSniffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3080C801A414DECC0227690 /* MediaTypeSniffer.swift */; }; 26CC9CB6CA4D81EB60AE860C /* CryptoSwift.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E37F94C388A86CB8A34812A5 /* CryptoSwift.xcframework */; }; + 27317F73ADCE4F5369BAACD0 /* Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DC02496961068F28D1B2A52 /* Key.swift */; }; 27697B901FB5808F319FD1F6 /* PublicationAsset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 419064D714A90CE07D575629 /* PublicationAsset.swift */; }; 27E40D709BD64E86EEF8EE7E /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6B9F632E457F20ADC4235EF /* Database.swift */; }; 294217B18570409AB1C317AD /* DeviceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616C70674FBF020FE4607617 /* DeviceService.swift */; }; @@ -98,6 +100,7 @@ 36653806ADC48EFC65316955 /* AccessibilityDisplayString+Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5420CABB4B38006F64160F49 /* AccessibilityDisplayString+Generated.swift */; }; 36F389148BCED8C5C501FE27 /* AudioSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ECD1D0BE2C4BB5B58E32BFD /* AudioSession.swift */; }; 37F8A777BB5C13CA98545F6E /* DefaultLocatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C28B8CD48F8A660141F5983 /* DefaultLocatorService.swift */; }; + 3886B24981CA3B3CD0E6DEC6 /* InputObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20ED98539825B35F64D8262 /* InputObservable.swift */; }; 38E81FCDABFBB514685402B8 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 342D5C0FEE79A2ABEE24A43E /* CoreServices.framework */; }; 39326587EF76BFD5AD68AED2 /* ReadiumShared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97BC822B36D72EF548162129 /* ReadiumShared.framework */; }; 39B1DDE3571AB3F3CC6824F4 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA827FC94F5CB3F9032028F /* JSON.swift */; }; @@ -131,6 +134,7 @@ 4DAD724BAB72A5C6D2473770 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F89BC365BDD19BE84F4D3B5 /* Collection.swift */; }; 4DB4C10CB9AB5D38C56C1609 /* StringEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB11EA964FBB42D44C3E4A50 /* StringEncoding.swift */; }; 4E84353322A4CDBBCAD6C070 /* TailCachingResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571BBA35C6F496B007C5158C /* TailCachingResource.swift */; }; + 4F9DAB2373AE0B6225D2C589 /* InputObserving.swift in Sources */ = {isa = PBXBuildFile; fileRef = 421AE163B6A0248637504A07 /* InputObserving.swift */; }; 4FDA33D3776855A106D40A66 /* AudioPreferencesEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C32FDF5E2D35BE71E45ED0 /* AudioPreferencesEditor.swift */; }; 50736D15B35B2C53140A9C14 /* ControlFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BC4119B8937D17ED80B1AB /* ControlFlow.swift */; }; 50A1CBD97B996D53AA4E531C /* Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = D83D2271E64F38A8A1CEF491 /* Accessibility.swift */; }; @@ -142,6 +146,7 @@ 56CB87DACCA10F737710BFF6 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FF131876FA3A63025F2662 /* Language.swift */; }; 5730E84475195005D1291672 /* Publication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DF03272C07D6951ADC1311E /* Publication.swift */; }; 57583D27AB12063C3D114A47 /* AudioParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9FFEB1FF4B5CD74EB35CD63 /* AudioParser.swift */; }; + 58CF10569C00484BDB797609 /* ActivatePointerObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F485F9F15CF41925D2D3D5C /* ActivatePointerObserver.swift */; }; 58E8C178E0748B7CBEA9D7AC /* CSSLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51A36BFDC79EB5377D69582 /* CSSLayout.swift */; }; 5912EC9BB073282862F325F2 /* DocumentTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A00FF0C84822A134A353BD4 /* DocumentTypes.swift */; }; 594CE84C2B11169AA0B86615 /* HTMLResourceContentIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB954525AC159166C96A36 /* HTMLResourceContentIterator.swift */; }; @@ -242,6 +247,7 @@ 999EF656A5CDAF3BA30C26EF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD03AFC9C69E785886FB9620 /* Logger.swift */; }; 9A1877FBEAA0BFC4C74AD3BB /* Encryption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87727AC33D368A88A60A12B9 /* Encryption.swift */; }; 9A463F872E1B05B64E026EBB /* LCPLicenseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3230FB63D7ADDD514D74F7E6 /* LCPLicenseRepository.swift */; }; + 9AF316DF0B1CD4452D785EBC /* KeyModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0812058DB4FBFDF0A862E57E /* KeyModifiers.swift */; }; 9BC4D1F2958D2F7D7BDB88DA /* CursorList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C361F965E7A7962CA3E4C0BA /* CursorList.swift */; }; 9DB9674C11DF356966CBFA79 /* EPUBNavigatorViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9ACC1EB3903149EBF21BC0 /* EPUBNavigatorViewModel.swift */; }; 9E064BC9E99D4F7D8AC3109B /* MediaOverlays.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F5FEE0323287B9CAA09F03 /* MediaOverlays.swift */; }; @@ -319,7 +325,6 @@ C8A94F023B6C0F96875D5D62 /* LinkRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB0EF21FADD12D51D0619C0D /* LinkRelation.swift */; }; C9DAA3C193FA36B843113EC6 /* HTTPContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BFD453E8BF6FA24F340EE0 /* HTTPContainer.swift */; }; C9FBD23E459FB395377E149E /* ReadiumWebPubParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6E97CCA91F910315C260373 /* ReadiumWebPubParser.swift */; }; - CAEBD6BA3F2F88E8752CB987 /* KeyEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422C1DA91ED351C9ABA139DF /* KeyEvent.swift */; }; CB95F5EAA4D0DB5177FED4F7 /* TableOfContentsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5BCDE636CED5B883CC5F2B4 /* TableOfContentsService.swift */; }; CC85122A71D3145940827338 /* Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F90C4D94134D9F741D38D8AA /* Comparable.swift */; }; CCAF8FB4DBD81448C99D589A /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BB152578CBA091A41A51B25 /* Language.swift */; }; @@ -327,12 +332,14 @@ CDE5EE79D3F0D00F9CAED8B8 /* ReadiumZIPFoundation.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E17C4870C64264819EB227 /* ReadiumZIPFoundation.xcframework */; }; CE0720B9C9C3D9C4353F6ED2 /* OPDSFormatSniffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAA7CEF568A02BA2CB4AAD7F /* OPDSFormatSniffer.swift */; }; CEC42C02BB2B02562785B259 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3E08C8187DCC3099CF9D22 /* Range.swift */; }; + D09B0E0352339A7B092464D8 /* PointerEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76073E8E6DACE7F9D22E0DD /* PointerEvent.swift */; }; D1248D9E9EE269C3245927F7 /* Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BBD54FD376456C1925316BC /* Cancellable.swift */; }; D25058A427D47ABEA88A3F4B /* PublicationSpeechSynthesizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99DE4955327D8C2DE6F866D3 /* PublicationSpeechSynthesizer.swift */; }; D29E1DBC5BD1B82C996427C4 /* Closeable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02A9225D636D845BF24F6AC /* Closeable.swift */; }; D3058C80ABFBAED1CAA1B0CC /* TDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28792F801221D49F61B92CF8 /* TDM.swift */; }; D4BBC0AD7652265497B5CD1C /* URLExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10894CC9684584098A22D8FA /* URLExtensions.swift */; }; D525E9E2AFA0ED63151A4FBC /* Assets in Resources */ = {isa = PBXBuildFile; fileRef = DBCE9786DD346E6BDB2E50FF /* Assets */; }; + D53F33C86A0171051790B52C /* KeyEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 677FB438D08746809CB91DF4 /* KeyEvent.swift */; }; D589F337B244F5B58E85AEFB /* AudioSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9D0ACCBA7B6E4473A95D5E /* AudioSettings.swift */; }; D5AF26F18E98CEF06AEC0329 /* SQLiteLCPLicenseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17ACAC3E8F61DA108DCC9F51 /* SQLiteLCPLicenseRepository.swift */; }; D65BEF9DAF1FEB1A5BEED700 /* EPUBParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C234075C7F7573BA54B77D /* EPUBParser.swift */; }; @@ -507,6 +514,7 @@ 06AD6A912937694B20AD54C9 /* Configurable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configurable.swift; sourceTree = ""; }; 06C4BDFF128C774BCD660419 /* ReadiumCSS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadiumCSS.swift; sourceTree = ""; }; 07B5469E40752E598C070E5B /* OPDSParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPDSParser.swift; sourceTree = ""; }; + 0812058DB4FBFDF0A862E57E /* KeyModifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyModifiers.swift; sourceTree = ""; }; 0918DA360AAB646144E435D5 /* TransformingContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransformingContainer.swift; sourceTree = ""; }; 093629E752DE17264B97C598 /* LCPLicense.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCPLicense.swift; sourceTree = ""; }; 0977FA3A6BDEDE2F91A7C444 /* BitmapFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BitmapFormatSniffer.swift; sourceTree = ""; }; @@ -587,7 +595,7 @@ 41B61198128D628CFB3FD22A /* DiffableDecoration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiffableDecoration.swift; sourceTree = ""; }; 41E54A18E2983098A6A4DAE0 /* CompositeFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompositeFormatSniffer.swift; sourceTree = ""; }; 41EB258B894B86A0DA1D00D4 /* ArchiveOpener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveOpener.swift; sourceTree = ""; }; - 422C1DA91ED351C9ABA139DF /* KeyEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyEvent.swift; sourceTree = ""; }; + 421AE163B6A0248637504A07 /* InputObserving.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputObserving.swift; sourceTree = ""; }; 42BAA4F11B7355F1962FEAD9 /* HTTPResource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPResource.swift; sourceTree = ""; }; 42EFF9139B59D763CE254F92 /* Presentation+EPUB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Presentation+EPUB.swift"; sourceTree = ""; }; 42FD63C2720614E558522675 /* ReadiumInternal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReadiumInternal.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -642,6 +650,7 @@ 65C8719E9CC8EF0D2430AD85 /* CompletionList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletionList.swift; sourceTree = ""; }; 667B76C4766DFF58D066D40B /* PublicationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicationService.swift; sourceTree = ""; }; 6770362D551A8616EB41CBF1 /* DefaultHTTPClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultHTTPClient.swift; sourceTree = ""; }; + 677FB438D08746809CB91DF4 /* KeyEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyEvent.swift; sourceTree = ""; }; 67905E2F89366AB3521C320E /* EPUBPreferencesEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EPUBPreferencesEditor.swift; sourceTree = ""; }; 67DEBFCD9D71243C4ACC3A49 /* LCPService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCPService.swift; sourceTree = ""; }; 68719C5F09F9193E378DF585 /* LCPDecryptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCPDecryptor.swift; sourceTree = ""; }; @@ -695,7 +704,9 @@ 8B72B76AB39E09E4A2E465AF /* PDFFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFFormatSniffer.swift; sourceTree = ""; }; 8BF64D7C05A790D9CA5DD442 /* Types.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = ""; }; 8DA31089FCAD8DFB9AC46E4E /* Tokenizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tokenizer.swift; sourceTree = ""; }; + 8DC02496961068F28D1B2A52 /* Key.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Key.swift; sourceTree = ""; }; 8EA0008AF1B9B97962824D85 /* FallbackContentProtection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FallbackContentProtection.swift; sourceTree = ""; }; + 8F485F9F15CF41925D2D3D5C /* ActivatePointerObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivatePointerObserver.swift; sourceTree = ""; }; 91F34B9B08BC6FB84CE54A26 /* LCPProgress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCPProgress.swift; sourceTree = ""; }; 9234A0351FDE626D8D242223 /* ContainerLicenseContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerLicenseContainer.swift; sourceTree = ""; }; 925CDE3176715EBEBF40B21F /* GeneratedCoverService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneratedCoverService.swift; sourceTree = ""; }; @@ -737,6 +748,7 @@ A8F9AFE740CFFFAD65BA095E /* ContentKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentKey.swift; sourceTree = ""; }; A90EA81ECD9488CB3CBDAB41 /* Archive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Archive.swift; sourceTree = ""; }; A94DA04D56753CC008F65B1A /* VisualNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisualNavigator.swift; sourceTree = ""; }; + AACBE378F01200C74992CA91 /* KeyObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyObserver.swift; sourceTree = ""; }; AB0EF21FADD12D51D0619C0D /* LinkRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkRelation.swift; sourceTree = ""; }; AB3E08C8187DCC3099CF9D22 /* Range.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Range.swift; sourceTree = ""; }; AB528B8FB604E0953E345D26 /* Range.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Range.swift; sourceTree = ""; }; @@ -823,6 +835,7 @@ E19D31097B3A8050A46CDAA5 /* URLHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHelper.swift; sourceTree = ""; }; E1DAAE19E8372F6ECF772E0A /* MediaOverlayNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaOverlayNode.swift; sourceTree = ""; }; E1FB533E84CE563807BDB012 /* FormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatSniffer.swift; sourceTree = ""; }; + E20ED98539825B35F64D8262 /* InputObservable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputObservable.swift; sourceTree = ""; }; E233289C75C9F73E6E28DDB4 /* EPUBSpreadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EPUBSpreadView.swift; sourceTree = ""; }; E2D5DCD95C7B908BB6CA77C8 /* ResourceLicenseContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResourceLicenseContainer.swift; sourceTree = ""; }; E37F94C388A86CB8A34812A5 /* CryptoSwift.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = CryptoSwift.xcframework; path = ../../Carthage/Build/CryptoSwift.xcframework; sourceTree = ""; }; @@ -860,6 +873,7 @@ F6D87AB6FB1B213E6269736B /* PublicationServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicationServer.swift; sourceTree = ""; }; F6E45005E776078B46DB8E14 /* Memoize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Memoize.swift; sourceTree = ""; }; F6EB7CAF6D058380A2AB711A /* CGPDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGPDF.swift; sourceTree = ""; }; + F76073E8E6DACE7F9D22E0DD /* PointerEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointerEvent.swift; sourceTree = ""; }; F820DAECA1FC23C42719CD68 /* EncryptionParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionParser.swift; sourceTree = ""; }; F8A3CDE3EA555A97BBFE1EEF /* ZIPFoundationContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZIPFoundationContainer.swift; sourceTree = ""; }; F8C32FDF5E2D35BE71E45ED0 /* AudioPreferencesEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioPreferencesEditor.swift; sourceTree = ""; }; @@ -1155,6 +1169,17 @@ path = Audio; sourceTree = ""; }; + 2B899CEEE36736DE73D3044B /* Input */ = { + isa = PBXGroup; + children = ( + E20ED98539825B35F64D8262 /* InputObservable.swift */, + 421AE163B6A0248637504A07 /* InputObserving.swift */, + EB64264B8AED33E93297BA5C /* Key */, + F2877F50E88B9EDB0194EE3E /* Pointer */, + ); + path = Input; + sourceTree = ""; + }; 2C4C6FBF69B19C83DFCCF835 /* License */ = { isa = PBXGroup; children = ( @@ -1938,7 +1963,6 @@ children = ( 85F7D914B293DF0A912613D2 /* DirectionalNavigationAdapter.swift */, F5C6D0C5860E802EDA23068C /* EditingAction.swift */, - 422C1DA91ED351C9ABA139DF /* KeyEvent.swift */, 2BD6F93E379D0DC6FA1DCDEE /* Navigator.swift */, 4567A7ABB678715C37661DE3 /* SelectableNavigator.swift */, A94DA04D56753CC008F65B1A /* VisualNavigator.swift */, @@ -1946,6 +1970,7 @@ 33B6E1542712449105E9E9F1 /* CBZ */, A640EC1D9AF67158A5570F4E /* Decorator */, 14202851C5A61498AAC9D709 /* EPUB */, + 2B899CEEE36736DE73D3044B /* Input */, 08D09A44D576111182909F09 /* PDF */, 0EBE9D0DC9E68FDD963BCE15 /* Preferences */, 7F01FB1E5DDEA0BA0A04EA49 /* Resources */, @@ -2007,6 +2032,17 @@ path = OPDS; sourceTree = ""; }; + EB64264B8AED33E93297BA5C /* Key */ = { + isa = PBXGroup; + children = ( + 8DC02496961068F28D1B2A52 /* Key.swift */, + 677FB438D08746809CB91DF4 /* KeyEvent.swift */, + 0812058DB4FBFDF0A862E57E /* KeyModifiers.swift */, + AACBE378F01200C74992CA91 /* KeyObserver.swift */, + ); + path = Key; + sourceTree = ""; + }; EDEF56C60A6E1D06CED9F70F /* Encryption */ = { isa = PBXGroup; children = ( @@ -2059,6 +2095,15 @@ path = LCP; sourceTree = ""; }; + F2877F50E88B9EDB0194EE3E /* Pointer */ = { + isa = PBXGroup; + children = ( + 8F485F9F15CF41925D2D3D5C /* ActivatePointerObserver.swift */, + F76073E8E6DACE7F9D22E0DD /* PointerEvent.swift */, + ); + path = Pointer; + sourceTree = ""; + }; F389B1290B1CAA8E5F65573B /* Resources */ = { isa = PBXGroup; children = ( @@ -2381,6 +2426,7 @@ buildActionMask = 2147483647; files = ( E6554CEB01222DA2255163D5 /* AVTTSEngine.swift in Sources */, + 58CF10569C00484BDB797609 /* ActivatePointerObserver.swift in Sources */, 47125BFFEC67DEB2C3D1B48C /* AudioNavigator.swift in Sources */, A526C9EC79DC4461D0BF8D27 /* AudioPreferences.swift in Sources */, 4FDA33D3776855A106D40A66 /* AudioPreferencesEditor.swift in Sources */, @@ -2412,7 +2458,12 @@ E16AA8A927AAE141702F2D3B /* HTMLFontFamilyDeclaration.swift in Sources */, B01E5FC64FD1411DD9899ADC /* HTMLInjection.swift in Sources */, A036CCF310EB7408408FFF00 /* ImageViewController.swift in Sources */, - CAEBD6BA3F2F88E8752CB987 /* KeyEvent.swift in Sources */, + 3886B24981CA3B3CD0E6DEC6 /* InputObservable.swift in Sources */, + 4F9DAB2373AE0B6225D2C589 /* InputObserving.swift in Sources */, + 27317F73ADCE4F5369BAACD0 /* Key.swift in Sources */, + D53F33C86A0171051790B52C /* KeyEvent.swift in Sources */, + 9AF316DF0B1CD4452D785EBC /* KeyModifiers.swift in Sources */, + 02FD203F4290109CF240D278 /* KeyObserver.swift in Sources */, CCAF8FB4DBD81448C99D589A /* Language.swift in Sources */, 731B5BA4531CD86FA60D1698 /* MappedPreference.swift in Sources */, 607DE2CDFCDEDFCFD9A6C2AA /* Navigator.swift in Sources */, @@ -2424,6 +2475,7 @@ 25A925BF87206CB1781B04A5 /* PDFSettings.swift in Sources */, DB423F5860A1C47EF2E18113 /* PDFTapGestureController.swift in Sources */, 12EC61BDF29D2CAAEF913877 /* PaginationView.swift in Sources */, + D09B0E0352339A7B092464D8 /* PointerEvent.swift in Sources */, 2FBD9C31AE37009993674C52 /* Preference.swift in Sources */, 4BA6238471D9F7FB8A130B2B /* PreferencesEditor.swift in Sources */, DEF375FF574461E670FF45B9 /* ProgressionStrategy.swift in Sources */, From 436b7e4d8b8625d2fe08f03d6c43d4be5c397a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 13 May 2025 16:43:31 +0200 Subject: [PATCH 11/22] Refactor UIKit handling --- .../DirectionalNavigationAdapter.swift | 2 +- .../EPUB/EPUBNavigatorViewController.swift | 92 +++++---- .../Input/CompositeInputObserver.swift | 62 ++++++ Sources/Navigator/Input/InputObservable.swift | 2 +- Sources/Navigator/Input/InputObserving.swift | 50 +---- Sources/Navigator/Input/Key/Key.swift | 52 ----- Sources/Navigator/Input/Key/KeyEvent.swift | 27 --- .../Navigator/Input/Key/KeyModifiers.swift | 25 --- Sources/Navigator/Input/Key/KeyObserver.swift | 12 +- .../Pointer/ActivatePointerObserver.swift | 24 +-- .../Input/UIKitInputObserverAdapter.swift | 189 ++++++++++++++++++ .../PDF/PDFNavigatorViewController.swift | 4 +- Support/Carthage/.xcodegen | 3 + .../Readium.xcodeproj/project.pbxproj | 8 + TestApp/Sources/App/AppModule.swift | 2 +- docs/Guides/Navigator/Input.md | 8 +- 16 files changed, 345 insertions(+), 217 deletions(-) create mode 100644 Sources/Navigator/Input/CompositeInputObserver.swift create mode 100644 Sources/Navigator/Input/UIKitInputObserverAdapter.swift diff --git a/Sources/Navigator/DirectionalNavigationAdapter.swift b/Sources/Navigator/DirectionalNavigationAdapter.swift index d4cf462ef..ba057238e 100644 --- a/Sources/Navigator/DirectionalNavigationAdapter.swift +++ b/Sources/Navigator/DirectionalNavigationAdapter.swift @@ -79,7 +79,7 @@ public final class DirectionalNavigationAdapter { /// Binds the adapter to the given visual navigator. /// /// It will automatically observe pointer and key events to turn pages. - public func bind(to navigator: VisualNavigator) { + @MainActor public func bind(to navigator: VisualNavigator) { navigator.addObserver(.tap { [self, weak navigator] event in guard let navigator = navigator else { return false diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 184683d24..cdda73741 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -36,7 +36,7 @@ public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) open class EPUBNavigatorViewController: UIViewController, VisualNavigator, SelectableNavigator, DecorableNavigator, - Configurable, InputObservable, Loggable + Configurable, Loggable { public enum EPUBError: Error { /// The provided publication is restricted. Check that any DRM was @@ -228,10 +228,10 @@ open class EPUBNavigatorViewController: UIViewController, switch state { case .initializing, .loading, .jumping, .moving: paginationView?.isUserInteractionEnabled = false - tapGestureRecognizer.isEnabled = true + shouldIgnoreUIKitInputEvents = false case .idle: paginationView?.isUserInteractionEnabled = true - tapGestureRecognizer.isEnabled = false + shouldIgnoreUIKitInputEvents = true } } } @@ -240,9 +240,12 @@ open class EPUBNavigatorViewController: UIViewController, public private(set) var currentLocation: Locator? private let loadPositionsByReadingOrder: () async -> ReadResult<[[Locator]]> private var positionsByReadingOrder: [[Locator]] = [] - private let inputObservers = CompositeInputObserver() private let tasks = CancellableTasks() + private let inputObservers = CompositeInputObserver() + private lazy var uikitInputObserverAdapter = UIKitInputObserverAdapter(observer: inputObservers) + private var shouldIgnoreUIKitInputEvents = false + private let viewModel: EPUBNavigatorViewModel public var publication: Publication { viewModel.publication } @@ -324,11 +327,6 @@ open class EPUBNavigatorViewController: UIViewController, fatalError("init(coder:) has not been implemented") } - /// Tap gesture recognizer used to intercept taps and clicks when a web view - /// is not yet ready. - private lazy var tapGestureRecognizer: UIGestureRecognizer = - UITapGestureRecognizer(target: self, action: #selector(didTapBackground)) - override open func viewDidLoad() { super.viewDidLoad() @@ -336,7 +334,7 @@ open class EPUBNavigatorViewController: UIViewController, // the current resource. We can use this to go to the next resource. view.accessibilityTraits.insert(.causesPageTurn) - view.addGestureRecognizer(tapGestureRecognizer) + uikitInputObserverAdapter.view = view tasks.add { await initialize() @@ -388,11 +386,6 @@ open class EPUBNavigatorViewController: UIViewController, super.buildMenu(with: builder) } - /// Intercepts tap gesture when the web views are not loaded. - @objc private func didTapBackground(_ gesture: UITapGestureRecognizer) { - didTap(at: gesture.location(in: view)) - } - override open func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) viewModel.viewSizeWillChange(view.bounds.size) @@ -416,41 +409,62 @@ open class EPUBNavigatorViewController: UIViewController, becomeFirstResponder() } + // MARK: - UIResponder + override open var canBecomeFirstResponder: Bool { true } override open func pressesBegan(_ presses: Set, with event: UIPressesEvent?) { - var didHandleEvent = false + super.pressesBegan(presses, with: event) + if isFirstResponder { - for press in presses { - if let event = KeyEvent(uiPress: press) { - // FIXME: - delegate?.navigator(self, didPressKey: event) - didHandleEvent = true - } - } + uikitInputObserverAdapter.on(.down, presses: presses, with: event) } + } - if !didHandleEvent { - super.pressesBegan(presses, with: event) + override open func pressesChanged(_ presses: Set, with event: UIPressesEvent?) { + super.pressesChanged(presses, with: event) + + if isFirstResponder { + uikitInputObserverAdapter.on(.change, presses: presses, with: event) } } - override open func pressesEnded(_ presses: Set, with event: UIPressesEvent?) { - var didHandleEvent = false + override open func pressesCancelled(_ presses: Set, with event: UIPressesEvent?) { + super.pressesCancelled(presses, with: event) + if isFirstResponder { - for press in presses { - if let event = KeyEvent(uiPress: press) { - delegate?.navigator(self, didReleaseKey: event) - didHandleEvent = true - } - } + uikitInputObserverAdapter.on(.cancel, presses: presses, with: event) } + } + + override open func pressesEnded(_ presses: Set, with event: UIPressesEvent?) { + super.pressesEnded(presses, with: event) - if !didHandleEvent { - super.pressesEnded(presses, with: event) + if isFirstResponder { + uikitInputObserverAdapter.on(.up, presses: presses, with: event) } } + override open func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + uikitInputObserverAdapter.on(.down, touches: touches, event: event) + } + + override open func touchesMoved(_ touches: Set, with event: UIEvent?) { + super.touchesMoved(touches, with: event) + uikitInputObserverAdapter.on(.move, touches: touches, event: event) + } + + override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { + super.touchesCancelled(touches, with: event) + uikitInputObserverAdapter.on(.cancel, touches: touches, event: event) + } + + override open func touchesEnded(_ touches: Set, with event: UIEvent?) { + super.touchesEnded(touches, with: event) + uikitInputObserverAdapter.on(.up, touches: touches, event: event) + } + @discardableResult private func on(_ event: Event) -> Bool { assert(Thread.isMainThread, "Raising navigation events must be done from the main thread") @@ -1071,11 +1085,15 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { - inputObservers.didReceive(event) + Task { + _ = await inputObservers.didReceive(event) + } } func spreadView(_ spreadView: EPUBSpreadView, didReceive event: KeyEvent) { - inputObservers.didReceive(event) + Task { + _ = await inputObservers.didReceive(event) + } switch event.phase { case .down: diff --git a/Sources/Navigator/Input/CompositeInputObserver.swift b/Sources/Navigator/Input/CompositeInputObserver.swift new file mode 100644 index 000000000..18716b4d6 --- /dev/null +++ b/Sources/Navigator/Input/CompositeInputObserver.swift @@ -0,0 +1,62 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +/// Utility for storing and managing a list of ``InputObserving`` objects. +/// +/// The order of the observers is significant because a previous observer might +/// consume an event. When an event is consumed, the other observers will still +/// receive the event but with a `cancel` phase. +@MainActor +final class CompositeInputObserver: InputObservable, InputObserving { + private typealias Observer = (token: InputObservableToken, observer: InputObserving) + + private var observers: [Observer] = [] + + func addObserver(_ observer: any InputObserving) -> InputObservableToken { + let token = InputObservableToken() + precondition(!observers.contains { $0.token == token }) + observers.append(Observer(token: token, observer: observer)) + return token + } + + func removeObserver(_ token: InputObservableToken) { + observers.removeAll { $0.token == token } + } + + func didReceive(_ event: PointerEvent) async -> Bool { + var handled = false + var event = event + + for (_, observer) in observers { + handled = await observer.didReceive(event) + if handled { + // Cancel the event for the other observers, as it was + // handled by this one. + event.phase = .cancel + } + } + + return handled + } + + func didReceive(_ event: KeyEvent) async -> Bool { + var handled = false + var event = event + + for (_, observer) in observers { + handled = await observer.didReceive(event) + if handled { + // Cancel the event for the other observers, as it was + // handled by this one. + event.phase = .cancel + } + } + + return handled + } +} diff --git a/Sources/Navigator/Input/InputObservable.swift b/Sources/Navigator/Input/InputObservable.swift index 9dfb329d0..e34236397 100644 --- a/Sources/Navigator/Input/InputObservable.swift +++ b/Sources/Navigator/Input/InputObservable.swift @@ -8,7 +8,7 @@ import Foundation /// A type broadcasting user input events (e.g. touch or keyboard events) to /// a set of observers. -public protocol InputObservable { +@MainActor public protocol InputObservable { /// Registers a new ``InputObserver`` for the observable receiver. /// /// - Returns: An opaque token which can be used to remove the observer with diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift index ec6a506f3..2b0845517 100644 --- a/Sources/Navigator/Input/InputObserving.swift +++ b/Sources/Navigator/Input/InputObserving.swift @@ -8,7 +8,7 @@ import Foundation /// A type observing user input events (e.g. touch or keyboard events) /// broadcasted by an ``InputObservable`` instance. -public protocol InputObserving: Sendable { +@MainActor public protocol InputObserving { /// Called when receiving a pointer event, such as a mouse click or a touch /// event. /// @@ -27,51 +27,3 @@ public extension InputObserving { func didReceive(_ event: PointerEvent) async -> Bool { false } func didReceive(_ event: KeyEvent) async -> Bool { false } } - -/// Utility for storing and managing a list of ``InputObserving`` objects. -/// -/// The order of the observers is significant because a previous observer might -/// consume an event. When an event is consumed, the other observers will still -/// receive the event but with a `cancel` phase. -final class CompositeInputObserver: InputObservable { - private typealias Observer = (token: InputObservableToken, observer: InputObserving) - - private var observers: [Observer] = [] - - func addObserver(_ observer: any InputObserving) -> InputObservableToken { - let token = InputObservableToken() - precondition(!observers.contains { $0.token == token }) - observers.append(Observer(token: token, observer: observer)) - return token - } - - func removeObserver(_ token: InputObservableToken) { - observers.removeAll { $0.token == token } - } - - func didReceive(_ event: PointerEvent) { - Task { - var event = event - for (_, observer) in observers { - if await observer.didReceive(event) { - // Cancel the event for the other observers, as it was - // handled by this one. - event.phase = .cancel - } - } - } - } - - func didReceive(_ event: KeyEvent) { - Task { - var event = event - for (_, observer) in observers { - if await observer.didReceive(event) { - // Cancel the event for the other observers, as it was - // handled by this one. - event.phase = .cancel - } - } - } - } -} diff --git a/Sources/Navigator/Input/Key/Key.swift b/Sources/Navigator/Input/Key/Key.swift index 5472241f1..7ecd05ce3 100644 --- a/Sources/Navigator/Input/Key/Key.swift +++ b/Sources/Navigator/Input/Key/Key.swift @@ -119,55 +119,3 @@ public enum Key: Equatable, CustomStringConvertible { public static let eight: Key = .character("8") public static let nine: Key = .character("9") } - -// MARK: - UIKit extensions - -public extension Key { - init?(uiPress: UIPress) { - guard let key = uiPress.key else { - return nil - } - - switch key.keyCode { - case .keyboardReturnOrEnter, .keypadEnter: - self = .enter - case .keyboardTab: - self = .tab - case .keyboardSpacebar: - self = .space - case .keyboardDownArrow: - self = .arrowDown - case .keyboardUpArrow: - self = .arrowUp - case .keyboardLeftArrow: - self = .arrowLeft - case .keyboardRightArrow: - self = .arrowRight - case .keyboardEnd: - self = .end - case .keyboardHome: - self = .home - case .keyboardPageDown: - self = .pageDown - case .keyboardPageUp: - self = .pageUp - case .keyboardComma, .keypadComma: - self = .command - case .keyboardLeftControl, .keyboardRightControl: - self = .control - case .keyboardLeftAlt, .keyboardRightAlt: - self = .option - case .keyboardLeftShift, .keyboardRightShift: - self = .shift - case .keyboardEscape: - self = .escape - - default: - let character = key.charactersIgnoringModifiers - guard character != "" else { - return nil - } - self = .character(character) - } - } -} diff --git a/Sources/Navigator/Input/Key/KeyEvent.swift b/Sources/Navigator/Input/Key/KeyEvent.swift index 12b733291..bef108614 100644 --- a/Sources/Navigator/Input/Key/KeyEvent.swift +++ b/Sources/Navigator/Input/Key/KeyEvent.swift @@ -45,30 +45,3 @@ public struct KeyEvent: Equatable, CustomStringConvertible { } } } - -// MARK: - UIKit extensions - -public extension KeyEvent { - init?(uiPress: UIPress) { - guard - let key = Key(uiPress: uiPress), - var modifiers = KeyModifiers(uiPress: uiPress) - else { - return nil - } - - if let modKey = KeyModifiers(key: key) { - modifiers.remove(modKey) - } - - let phase: Phase = switch uiPress.phase { - case .began: .down - case .changed, .stationary: .change - case .ended: .up - case .cancelled: .cancel - @unknown default: .change - } - - self.init(phase: phase, key: key, modifiers: modifiers) - } -} diff --git a/Sources/Navigator/Input/Key/KeyModifiers.swift b/Sources/Navigator/Input/Key/KeyModifiers.swift index be38cddd2..99338e2fa 100644 --- a/Sources/Navigator/Input/Key/KeyModifiers.swift +++ b/Sources/Navigator/Input/Key/KeyModifiers.swift @@ -56,28 +56,3 @@ public struct KeyModifiers: OptionSet, Equatable, CustomStringConvertible { keys.map(\.description).joined(separator: "+") } } - -// MARK: - UIKit Extensions - -public extension KeyModifiers { - init?(uiPress: UIPress) { - guard let flags = uiPress.key?.modifierFlags else { - return nil - } - - self = [] - - if flags.contains(.shift) { - insert(.shift) - } - if flags.contains(.command) { - insert(.command) - } - if flags.contains(.control) { - insert(.control) - } - if flags.contains(.alternate) { - insert(.option) - } - } -} diff --git a/Sources/Navigator/Input/Key/KeyObserver.swift b/Sources/Navigator/Input/Key/KeyObserver.swift index 63fa2e790..3e8187e88 100644 --- a/Sources/Navigator/Input/Key/KeyObserver.swift +++ b/Sources/Navigator/Input/Key/KeyObserver.swift @@ -11,7 +11,7 @@ public extension InputObserving where Self == KeyObserver { /// /// Inspect the provided ``KeyEvent`` to know which keys were pressed. static func key( - onKey: @escaping (KeyEvent) async -> Bool + onKey: @MainActor @escaping (KeyEvent) async -> Bool ) -> KeyObserver { KeyObserver(onKey: onKey) } @@ -20,30 +20,30 @@ public extension InputObserving where Self == KeyObserver { static func key( _ key: Key, _ modifiers: KeyModifiers = [], - onKey: @escaping () async -> Bool + onKey: @MainActor @escaping () async -> Bool ) -> KeyObserver { KeyObserver(key: key, modifiers: modifiers, onKey: onKey) } } /// An input observer used to recognize a single key combination pressed. -public actor KeyObserver: InputObserving { +@MainActor public final class KeyObserver: InputObserving { private typealias KeyCombo = (KeyModifiers, Key) private let keyCombo: KeyCombo? - private let onKey: (KeyEvent) async -> Bool + private let onKey: @MainActor (KeyEvent) async -> Bool public init( key: Key, modifiers: KeyModifiers, - onKey: @escaping () async -> Bool + onKey: @MainActor @escaping () async -> Bool ) { keyCombo = (modifiers, key) self.onKey = { _ in await onKey() } } public init( - onKey: @escaping (KeyEvent) async -> Bool + onKey: @MainActor @escaping (KeyEvent) async -> Bool ) { keyCombo = nil self.onKey = onKey diff --git a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift index 388ded5e4..1b453b907 100644 --- a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift @@ -12,7 +12,7 @@ public extension InputObserving where Self == ActivatePointerObserver { /// `modifiers` are pressed. static func activate( modifiers: KeyModifiers = [], - onActivate: @escaping (PointerEvent) async -> Bool + onActivate: @MainActor @escaping (PointerEvent) async -> Bool ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, @@ -31,7 +31,7 @@ public extension InputObserving where Self == ActivatePointerObserver { /// Recognizes a tap input event, if the given key `modifiers` are pressed. static func tap( modifiers: KeyModifiers = [], - onTap: @escaping (PointerEvent) async -> Bool + onTap: @MainActor @escaping (PointerEvent) async -> Bool ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, @@ -43,16 +43,16 @@ public extension InputObserving where Self == ActivatePointerObserver { /// Recognizes a click event, if the given key `modifiers` and mouse /// `buttons` are pressed. static func click( - buttons: MouseButtons = [.main], + buttons: MouseButtons = .main, modifiers: KeyModifiers = [], - onClick: @escaping (PointerEvent) async -> Bool + onClick: @MainActor @escaping (PointerEvent) async -> Bool ) -> ActivatePointerObserver { ActivatePointerObserver( modifiers: modifiers, shouldIgnore: { guard case let .mouse(pointer) = $0.pointer, - $0.phase == .up || pointer.buttons == buttons + pointer.buttons == buttons || (pointer.buttons == [] && buttons == .main) else { return true } @@ -68,15 +68,15 @@ public extension InputObserving where Self == ActivatePointerObserver { /// /// If multiple pointers are activated or the pointer moved (e.g. drag), the /// activation is considered cancelled. -public actor ActivatePointerObserver: InputObserving, Loggable { +@MainActor public final class ActivatePointerObserver: InputObserving, Loggable { private let modifiers: KeyModifiers - private let shouldIgnore: (PointerEvent) -> Bool - private let onActivate: (PointerEvent) async -> Bool + private let shouldIgnore: @MainActor (PointerEvent) -> Bool + private let onActivate: @MainActor (PointerEvent) async -> Bool public init( modifiers: KeyModifiers = [], - shouldIgnore: @escaping (PointerEvent) -> Bool, - onActivate: @escaping (PointerEvent) async -> Bool + shouldIgnore: @MainActor @escaping (PointerEvent) -> Bool, + onActivate: @MainActor @escaping (PointerEvent) async -> Bool ) { self.modifiers = modifiers self.shouldIgnore = shouldIgnore @@ -92,13 +92,13 @@ public actor ActivatePointerObserver: InputObserving, Loggable { private var state: State = .idle { didSet { -// log(.trace, "state \(state)") +// log(.info, "state \(state)") } } public func didReceive(_ event: PointerEvent) async -> Bool { let ignored = shouldIgnore(event) -// log(.trace, "on \(ignored ? "ignored " : "")\(event)") +// log(.info, "on \(ignored ? "ignored " : "")\(event)") guard !ignored else { return false diff --git a/Sources/Navigator/Input/UIKitInputObserverAdapter.swift b/Sources/Navigator/Input/UIKitInputObserverAdapter.swift new file mode 100644 index 000000000..4d4fe51e2 --- /dev/null +++ b/Sources/Navigator/Input/UIKitInputObserverAdapter.swift @@ -0,0 +1,189 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import UIKit + +@MainActor final class UIKitInputObserverAdapter { + weak var view: UIView? + private let observer: InputObserving + + init(observer: InputObserving) { + self.observer = observer + } + + // MARK: - Presses + + func on(_ phase: KeyEvent.Phase, presses: Set, with event: UIPressesEvent?) { + Task { + for press in presses { + guard let event = KeyEvent(phase: phase, uiPress: press) else { + continue + } + _ = await observer.didReceive(event) + } + } + } + + // MARK: - Touches + + func on(_ phase: PointerEvent.Phase, touches: Set, event: UIEvent?) { + Task { + for touch in touches { + guard let view = view else { + continue + } + + _ = await observer.didReceive(PointerEvent( + pointer: pointer(for: touch, with: event), + phase: phase, + location: touch.location(in: view), + modifiers: KeyModifiers(event: event) + )) + } + } + } + + private func pointer(for touch: UITouch, with event: UIEvent?) -> Pointer { + let id = AnyHashable("UITouch.TouchType(\(touch.type))") + + return switch touch.type { + case .direct, .indirect: + .touch(TouchPointer(id: id)) + case .pencil, .indirectPointer: + fallthrough + @unknown default: + .mouse(MousePointer(id: id, buttons: MouseButtons(event: event))) + } + } +} + +public extension KeyEvent { + init?(phase: KeyEvent.Phase, uiPress: UIPress) { + guard + let key = Key(uiPress: uiPress), + var modifiers = KeyModifiers(uiPress: uiPress) + else { + return nil + } + + if let modKey = KeyModifiers(key: key) { + modifiers.remove(modKey) + } + + self.init(phase: phase, key: key, modifiers: modifiers) + } +} + +public extension Key { + init?(uiPress: UIPress) { + guard let key = uiPress.key else { + return nil + } + + switch key.keyCode { + case .keyboardReturnOrEnter, .keypadEnter: + self = .enter + case .keyboardTab: + self = .tab + case .keyboardSpacebar: + self = .space + case .keyboardDownArrow: + self = .arrowDown + case .keyboardUpArrow: + self = .arrowUp + case .keyboardLeftArrow: + self = .arrowLeft + case .keyboardRightArrow: + self = .arrowRight + case .keyboardEnd: + self = .end + case .keyboardHome: + self = .home + case .keyboardPageDown: + self = .pageDown + case .keyboardPageUp: + self = .pageUp + case .keyboardComma, .keypadComma: + self = .command + case .keyboardLeftControl, .keyboardRightControl: + self = .control + case .keyboardLeftAlt, .keyboardRightAlt: + self = .option + case .keyboardLeftShift, .keyboardRightShift: + self = .shift + case .keyboardEscape: + self = .escape + + default: + let character = key.charactersIgnoringModifiers + guard character != "" else { + return nil + } + self = .character(character) + } + } +} + +private extension MouseButtons { + init(event: UIEvent?) { + self.init() + + guard let mask = event?.buttonMask else { + return + } + + if mask.contains(.primary) { + insert(.main) + } + if mask.contains(.secondary) { + insert(.secondary) + } + } +} + +private extension KeyModifiers { + init(event: UIEvent?) { + self.init() + + guard let flags = event?.modifierFlags else { + return + } + + if flags.contains(.shift) { + insert(.shift) + } + if flags.contains(.control) { + insert(.control) + } + if flags.contains(.alternate) { + insert(.option) + } + if flags.contains(.command) { + insert(.command) + } + } + + init?(uiPress: UIPress) { + guard let flags = uiPress.key?.modifierFlags else { + return nil + } + + self = [] + + if flags.contains(.shift) { + insert(.shift) + } + if flags.contains(.command) { + insert(.command) + } + if flags.contains(.control) { + insert(.control) + } + if flags.contains(.alternate) { + insert(.option) + } + } +} diff --git a/Sources/Navigator/PDF/PDFNavigatorViewController.swift b/Sources/Navigator/PDF/PDFNavigatorViewController.swift index 8ce87857d..06d29d9ae 100644 --- a/Sources/Navigator/PDF/PDFNavigatorViewController.swift +++ b/Sources/Navigator/PDF/PDFNavigatorViewController.swift @@ -220,7 +220,7 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select var didHandleEvent = false if isFirstResponder { for press in presses { - if let event = KeyEvent(uiPress: press) { + if let event = KeyEvent(phase: .down, uiPress: press) { delegate?.navigator(self, didPressKey: event) didHandleEvent = true } @@ -236,7 +236,7 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select var didHandleEvent = false if isFirstResponder { for press in presses { - if let event = KeyEvent(uiPress: press) { + if let event = KeyEvent(phase: .up, uiPress: press) { delegate?.navigator(self, didReleaseKey: event) didHandleEvent = true } diff --git a/Support/Carthage/.xcodegen b/Support/Carthage/.xcodegen index e2a3785c4..a996f38ee 100644 --- a/Support/Carthage/.xcodegen +++ b/Support/Carthage/.xcodegen @@ -521,6 +521,7 @@ ../../Sources/Navigator/EPUB/UserSettings.swift ../../Sources/Navigator/Input ../../Sources/Navigator/Input/.DS_Store +../../Sources/Navigator/Input/CompositeInputObserver.swift ../../Sources/Navigator/Input/InputObservable.swift ../../Sources/Navigator/Input/InputObserving.swift ../../Sources/Navigator/Input/Key @@ -529,8 +530,10 @@ ../../Sources/Navigator/Input/Key/KeyModifiers.swift ../../Sources/Navigator/Input/Key/KeyObserver.swift ../../Sources/Navigator/Input/Pointer +../../Sources/Navigator/Input/Pointer/.DS_Store ../../Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift ../../Sources/Navigator/Input/Pointer/PointerEvent.swift +../../Sources/Navigator/Input/UIKitInputObserverAdapter.swift ../../Sources/Navigator/Navigator.swift ../../Sources/Navigator/PDF ../../Sources/Navigator/PDF/PDFDocumentHolder.swift diff --git a/Support/Carthage/Readium.xcodeproj/project.pbxproj b/Support/Carthage/Readium.xcodeproj/project.pbxproj index f7f18d5dc..04de39b60 100644 --- a/Support/Carthage/Readium.xcodeproj/project.pbxproj +++ b/Support/Carthage/Readium.xcodeproj/project.pbxproj @@ -248,6 +248,7 @@ 9A1877FBEAA0BFC4C74AD3BB /* Encryption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87727AC33D368A88A60A12B9 /* Encryption.swift */; }; 9A463F872E1B05B64E026EBB /* LCPLicenseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3230FB63D7ADDD514D74F7E6 /* LCPLicenseRepository.swift */; }; 9AF316DF0B1CD4452D785EBC /* KeyModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0812058DB4FBFDF0A862E57E /* KeyModifiers.swift */; }; + 9B0369F8C0187528486440F4 /* CompositeInputObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC8E202B8A16B960AE73CABF /* CompositeInputObserver.swift */; }; 9BC4D1F2958D2F7D7BDB88DA /* CursorList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C361F965E7A7962CA3E4C0BA /* CursorList.swift */; }; 9DB9674C11DF356966CBFA79 /* EPUBNavigatorViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9ACC1EB3903149EBF21BC0 /* EPUBNavigatorViewModel.swift */; }; 9E064BC9E99D4F7D8AC3109B /* MediaOverlays.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F5FEE0323287B9CAA09F03 /* MediaOverlays.swift */; }; @@ -278,6 +279,7 @@ AD87094AA40926939955E9F2 /* LCPRenewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 230985A228FA74F24735D6BB /* LCPRenewDelegate.swift */; }; B01E5FC64FD1411DD9899ADC /* HTMLInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B535BBE6EE5898327DB52 /* HTMLInjection.swift */; }; B02109488289D631DF959B8D /* ReadiumFuzi.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2828D89EBB52CCA782ED1146 /* ReadiumFuzi.xcframework */; }; + B06476E5CCB09C8D913CCFA7 /* UIKitInputObserverAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */; }; B066F9DDCD00A8917478CB6C /* LCPDialogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BB64178365BFA9ED75C7078 /* LCPDialogViewController.swift */; }; B0B2C38D1A7B36E73C3E3779 /* DifferenceKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F95F3F20D758BE0E7005EA3 /* DifferenceKit.xcframework */; }; B0F62AC136EF3587E147468E /* AssetRetriever.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C054DDC6D1BCF4A420C980C /* AssetRetriever.swift */; }; @@ -534,6 +536,7 @@ 13C2DC41BEDB70085FCBBC00 /* PDFPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFPreferences.swift; sourceTree = ""; }; 15980B67505AAF10642B56C8 /* LicenseContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicenseContainer.swift; sourceTree = ""; }; 1674CCC0BA8B1F4E2D2B3A4C /* AudiobookFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudiobookFormatSniffer.swift; sourceTree = ""; }; + 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitInputObserverAdapter.swift; sourceTree = ""; }; 17ACAC3E8F61DA108DCC9F51 /* SQLiteLCPLicenseRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteLCPLicenseRepository.swift; sourceTree = ""; }; 17D22986A3ADE9E883691EE2 /* Deferred.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deferred.swift; sourceTree = ""; }; 18E809378D79D09192A0AAE1 /* ContentService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentService.swift; sourceTree = ""; }; @@ -849,6 +852,7 @@ EC329362A0E8AC6CC018452A /* ReadiumOPDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReadiumOPDS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EC59A963F316359DF8B119AC /* Metadata+Presentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Metadata+Presentation.swift"; sourceTree = ""; }; EC5ED9E15482AED288A6634F /* EPUBNavigatorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EPUBNavigatorViewController.swift; sourceTree = ""; }; + EC8E202B8A16B960AE73CABF /* CompositeInputObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompositeInputObserver.swift; sourceTree = ""; }; EC96A56AB406203898059B6C /* UserKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserKey.swift; sourceTree = ""; }; EC9ACC1EB3903149EBF21BC0 /* EPUBNavigatorViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EPUBNavigatorViewModel.swift; sourceTree = ""; }; ECF32CF55DD942ACB06389C5 /* Preference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preference.swift; sourceTree = ""; }; @@ -1172,8 +1176,10 @@ 2B899CEEE36736DE73D3044B /* Input */ = { isa = PBXGroup; children = ( + EC8E202B8A16B960AE73CABF /* CompositeInputObserver.swift */, E20ED98539825B35F64D8262 /* InputObservable.swift */, 421AE163B6A0248637504A07 /* InputObserving.swift */, + 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */, EB64264B8AED33E93297BA5C /* Key */, F2877F50E88B9EDB0194EE3E /* Pointer */, ); @@ -2437,6 +2443,7 @@ 58E8C178E0748B7CBEA9D7AC /* CSSLayout.swift in Sources */, 1B15166C79C7C05CE491AD2C /* CSSProperties.swift in Sources */, FED01A1734FAAD72683CC79E /* CompletionList.swift in Sources */, + 9B0369F8C0187528486440F4 /* CompositeInputObserver.swift in Sources */, E42CCC4CB1D491564664B5B6 /* Configurable.swift in Sources */, 9BC4D1F2958D2F7D7BDB88DA /* CursorList.swift in Sources */, 0ECE94F27E005FC454EA9D12 /* DecorableNavigator.swift in Sources */, @@ -2490,6 +2497,7 @@ E12A731DD41BD2BC3C8076F8 /* TargetAction.swift in Sources */, 4A5F53CCC083D3E348379963 /* Types.swift in Sources */, D8C9C54CC84D1C0810343D9E /* UIColor.swift in Sources */, + B06476E5CCB09C8D913CCFA7 /* UIKitInputObserverAdapter.swift in Sources */, 8BA982B992E0370C7BF94DF6 /* UIView.swift in Sources */, 47FE7B25B5DB153D406CF0CE /* UserSettings.swift in Sources */, B96E8865DCA4A0CEFDA24DDF /* VisualNavigator.swift in Sources */, diff --git a/TestApp/Sources/App/AppModule.swift b/TestApp/Sources/App/AppModule.swift index ed6272827..5eedd8fda 100644 --- a/TestApp/Sources/App/AppModule.swift +++ b/TestApp/Sources/App/AppModule.swift @@ -57,7 +57,7 @@ final class AppModule { opds = OPDSModule(delegate: self) // Set Readium 2's logging minimum level. - ReadiumEnableLog(withMinimumSeverityLevel: .trace) + ReadiumEnableLog(withMinimumSeverityLevel: .info) } private(set) lazy var aboutViewController: UIViewController = { diff --git a/docs/Guides/Navigator/Input.md b/docs/Guides/Navigator/Input.md index 8204b00bc..e3d83895b 100644 --- a/docs/Guides/Navigator/Input.md +++ b/docs/Guides/Navigator/Input.md @@ -11,13 +11,13 @@ Here's an example of a simple `InputObserving` implementation that logs all key ```swift navigator.addObserver(InputObserver()) -final class InputObserver: InputObserving { - func didReceive(_ event: PointerEvent) async -> Bool { +@MainActor final class InputObserver: InputObserving { + func didReceive(_ event: PointerEvent) -> Bool { print("Received pointer event: \(event)") return false } - func didReceive(_ event: KeyEvent) async -> Bool { + func didReceive(_ event: KeyEvent) -> Bool { print("Received key event: \(event)") return false } @@ -68,4 +68,4 @@ navigator.addObserver(.key(.a, [.control, .shift]) { self.log(.info, "User pressed Control+Shift+A") return false }) -``` \ No newline at end of file +``` From c041805bbd89ea71c794dab361879090bf8b2e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Tue, 13 May 2025 16:46:32 +0200 Subject: [PATCH 12/22] Make the `VisualNavigator` conform to `InputObservable` --- .../Navigator/CBZ/CBZNavigatorViewController.swift | 13 +++++++++++++ .../Navigator/PDF/PDFNavigatorViewController.swift | 12 ++++++++++++ Sources/Navigator/VisualNavigator.swift | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift index 51879ab60..15f12e7f2 100644 --- a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift +++ b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift @@ -30,6 +30,8 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab private let publicationEndpoint: HTTPServerEndpoint? private var publicationBaseURL: HTTPURL! + private let inputObservers = CompositeInputObserver() + public convenience init( publication: Publication, initialLocation: Locator?, @@ -247,6 +249,17 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab public func goBackward(options: NavigatorGoOptions) async -> Bool { await goToResourceAtIndex(currentResourceIndex - 1, options: options, isJump: false) } + + // MARK: - InputObservable + + @discardableResult + public func addObserver(_ observer: any InputObserving) -> InputObservableToken { + inputObservers.addObserver(observer) + } + + public func removeObserver(_ token: InputObservableToken) { + inputObservers.removeObserver(token) + } } extension CBZNavigatorViewController: UIPageViewControllerDataSource { diff --git a/Sources/Navigator/PDF/PDFNavigatorViewController.swift b/Sources/Navigator/PDF/PDFNavigatorViewController.swift index 06d29d9ae..b45a0caad 100644 --- a/Sources/Navigator/PDF/PDFNavigatorViewController.swift +++ b/Sources/Navigator/PDF/PDFNavigatorViewController.swift @@ -76,6 +76,7 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select private let server: HTTPServer? private let publicationEndpoint: HTTPServerEndpoint? private var publicationBaseURL: HTTPURL! + private let inputObservers = CompositeInputObserver() public init( publication: Publication, @@ -532,6 +533,17 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select ) } + // MARK: - InputObservable + + @discardableResult + public func addObserver(_ observer: any InputObserving) -> InputObservableToken { + inputObservers.addObserver(observer) + } + + public func removeObserver(_ token: InputObservableToken) { + inputObservers.removeObserver(token) + } + // MARK: - SelectableNavigator public var currentSelection: Selection? { editingActions.selection } diff --git a/Sources/Navigator/VisualNavigator.swift b/Sources/Navigator/VisualNavigator.swift index 8d6143293..36c94bb77 100644 --- a/Sources/Navigator/VisualNavigator.swift +++ b/Sources/Navigator/VisualNavigator.swift @@ -9,7 +9,7 @@ import ReadiumShared import UIKit /// A navigator rendering the publication visually on-screen. -public protocol VisualNavigator: Navigator { +public protocol VisualNavigator: Navigator, InputObservable { /// Viewport view. var view: UIView! { get } From 68c8a4e74db385d3ccb992c5fa51d1c2ea1d18e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 10:35:51 +0200 Subject: [PATCH 13/22] Forward to legacy callbacks --- .../CBZ/CBZNavigatorViewController.swift | 15 +++++++++ .../EPUB/EPUBNavigatorViewController.swift | 26 ++++++++------- .../Input/InputObservable+Legacy.swift | 32 +++++++++++++++++++ .../PDF/PDFNavigatorViewController.swift | 15 +++++++++ Support/Carthage/.xcodegen | 4 ++- .../Readium.xcodeproj/project.pbxproj | 16 +++++++--- 6 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 Sources/Navigator/Input/InputObservable+Legacy.swift diff --git a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift index 15f12e7f2..d5390cee0 100644 --- a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift +++ b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift @@ -105,6 +105,21 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab ) super.init(nibName: nil, bundle: nil) + + setupLegacyInputCallbacks( + onTap: { [weak self] point in + guard let self else { return } + self.delegate?.navigator(self, didTapAt: point) + }, + onPressKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didPressKey: event) + }, + onReleaseKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didReleaseKey: event) + } + ) } private func didLoadPositions(_ positions: [Locator]?) { diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index cdda73741..1a8132612 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -19,17 +19,6 @@ public protocol EPUBNavigatorDelegate: VisualNavigatorDelegate, SelectableNaviga public extension EPUBNavigatorDelegate { func navigator(_ navigator: EPUBNavigatorViewController, setupUserScripts userContentController: WKUserContentController) {} - - @available(*, unavailable, message: "Implement navigator(_:didTapAt:) instead.") - func middleTapHandler() {} - @available(*, unavailable, message: "Implement navigator(_:locationDidChange:) instead, to save the last read location") - func willExitPublication(documentIndex: Int, progression: Double?) {} - @available(*, unavailable, message: "Implement navigator(_:locationDidChange:) instead") - func didChangedDocumentPage(currentDocumentIndex: Int) {} - @available(*, unavailable) - func didNavigateViaInternalLinkTap(to documentIndex: Int) {} - @available(*, unavailable, message: "Implement navigator(_:presentError:) instead") - func presentError(_ error: NavigatorError) {} } public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) @@ -320,6 +309,21 @@ open class EPUBNavigatorViewController: UIViewController, viewModel.delegate = self viewModel.editingActions.delegate = self + + setupLegacyInputCallbacks( + onTap: { [weak self] point in + guard let self else { return } + self.delegate?.navigator(self, didTapAt: point) + }, + onPressKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didPressKey: event) + }, + onReleaseKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didReleaseKey: event) + } + ) } @available(*, unavailable) diff --git a/Sources/Navigator/Input/InputObservable+Legacy.swift b/Sources/Navigator/Input/InputObservable+Legacy.swift new file mode 100644 index 000000000..3b5270868 --- /dev/null +++ b/Sources/Navigator/Input/InputObservable+Legacy.swift @@ -0,0 +1,32 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import Foundation + +extension InputObservable { + func setupLegacyInputCallbacks( + onTap: @MainActor @escaping (CGPoint) -> Void, + onPressKey: @MainActor @escaping (KeyEvent) -> Void, + onReleaseKey: @MainActor @escaping (KeyEvent) -> Void + ) { + addObserver(.activate { event in + onTap(event.location) + return false + }) + + addObserver(.key { event in + switch event.phase { + case .down: + onPressKey(event) + case .up: + onReleaseKey(event) + case .change, .cancel: + break + } + return false + }) + } +} diff --git a/Sources/Navigator/PDF/PDFNavigatorViewController.swift b/Sources/Navigator/PDF/PDFNavigatorViewController.swift index b45a0caad..6611cbc20 100644 --- a/Sources/Navigator/PDF/PDFNavigatorViewController.swift +++ b/Sources/Navigator/PDF/PDFNavigatorViewController.swift @@ -143,6 +143,21 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select documentHolder, service.pdfFactory, ]) } + + setupLegacyInputCallbacks( + onTap: { [weak self] point in + guard let self else { return } + self.delegate?.navigator(self, didTapAt: point) + }, + onPressKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didPressKey: event) + }, + onReleaseKey: { [weak self] event in + guard let self else { return } + self.delegate?.navigator(self, didReleaseKey: event) + } + ) } @available(*, unavailable) diff --git a/Support/Carthage/.xcodegen b/Support/Carthage/.xcodegen index a996f38ee..f9703c100 100644 --- a/Support/Carthage/.xcodegen +++ b/Support/Carthage/.xcodegen @@ -523,7 +523,10 @@ ../../Sources/Navigator/Input/.DS_Store ../../Sources/Navigator/Input/CompositeInputObserver.swift ../../Sources/Navigator/Input/InputObservable.swift +../../Sources/Navigator/Input/InputObservable+Legacy.swift +../../Sources/Navigator/Input/InputObservableViewController.swift ../../Sources/Navigator/Input/InputObserving.swift +../../Sources/Navigator/Input/InputObservingGestureRecognizerAdapter.swift ../../Sources/Navigator/Input/Key ../../Sources/Navigator/Input/Key/Key.swift ../../Sources/Navigator/Input/Key/KeyEvent.swift @@ -533,7 +536,6 @@ ../../Sources/Navigator/Input/Pointer/.DS_Store ../../Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift ../../Sources/Navigator/Input/Pointer/PointerEvent.swift -../../Sources/Navigator/Input/UIKitInputObserverAdapter.swift ../../Sources/Navigator/Navigator.swift ../../Sources/Navigator/PDF ../../Sources/Navigator/PDF/PDFDocumentHolder.swift diff --git a/Support/Carthage/Readium.xcodeproj/project.pbxproj b/Support/Carthage/Readium.xcodeproj/project.pbxproj index 04de39b60..4bfe581c1 100644 --- a/Support/Carthage/Readium.xcodeproj/project.pbxproj +++ b/Support/Carthage/Readium.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 0411D7B6ACD75F2D03547787 /* RARFormatSniffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FEF14E6F136136D43A39897 /* RARFormatSniffer.swift */; }; 048A8C8447FBF687484CD248 /* ReadiumFuzi.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2828D89EBB52CCA782ED1146 /* ReadiumFuzi.xcframework */; }; 04ABB38248C997C524C0001F /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB528B8FB604E0953E345D26 /* Range.swift */; }; + 0512D1F6F6EC5CDAD0C68EA6 /* InputObservingGestureRecognizerAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CDE839ECF121D2EDD0C31C7 /* InputObservingGestureRecognizerAdapter.swift */; }; 0569A7E5E5B31AF3B4C8C234 /* EPUBContainerParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78033AFDF98C92351785D17F /* EPUBContainerParser.swift */; }; 061C798F8A5DACFACB414B15 /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48856E9AB402E2907B5230F3 /* CGRect.swift */; }; 06CF9F75A9DB1B6241CA7719 /* LCPService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67DEBFCD9D71243C4ACC3A49 /* LCPService.swift */; }; @@ -98,6 +99,7 @@ 346C4DA09157847639648F56 /* OPDSParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5469E40752E598C070E5B /* OPDSParser.swift */; }; 349F6BB9FDD28532C2B030EC /* LCPPassphraseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FCA24A94D6376487FECAEF1 /* LCPPassphraseRepository.swift */; }; 36653806ADC48EFC65316955 /* AccessibilityDisplayString+Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5420CABB4B38006F64160F49 /* AccessibilityDisplayString+Generated.swift */; }; + 368C947182F11C8F9D3E242C /* InputObservable+Legacy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7457AD096857CA307F6ED6A /* InputObservable+Legacy.swift */; }; 36F389148BCED8C5C501FE27 /* AudioSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ECD1D0BE2C4BB5B58E32BFD /* AudioSession.swift */; }; 37F8A777BB5C13CA98545F6E /* DefaultLocatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C28B8CD48F8A660141F5983 /* DefaultLocatorService.swift */; }; 3886B24981CA3B3CD0E6DEC6 /* InputObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20ED98539825B35F64D8262 /* InputObservable.swift */; }; @@ -113,6 +115,7 @@ 3D594DCB0A9FA1F50E4B69B3 /* Streamable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739566E777BA37891BCECB95 /* Streamable.swift */; }; 3E195F4601612E7B4B9CB232 /* DirectoryContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48435C1A16C23C5BBB9C590C /* DirectoryContainer.swift */; }; 3E9F244ACDA938D330B9EAEA /* Subject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CD4C99103DC795E44F56AE /* Subject.swift */; }; + 3ECB25D3B226C7059D4A922A /* InputObservableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FF49B3B34628DC67CF8255 /* InputObservableViewController.swift */; }; 3ECB525CEB712CEC5EFCD26D /* WarningLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3510E7E84A5361BCECC90569 /* WarningLogger.swift */; }; 40A44414CC911BF49BB5EE60 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DA31089FCAD8DFB9AC46E4E /* Tokenizer.swift */; }; 422FF6643B32F9BCE8043757 /* ReadiumFuzi.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2828D89EBB52CCA782ED1146 /* ReadiumFuzi.xcframework */; }; @@ -279,7 +282,6 @@ AD87094AA40926939955E9F2 /* LCPRenewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 230985A228FA74F24735D6BB /* LCPRenewDelegate.swift */; }; B01E5FC64FD1411DD9899ADC /* HTMLInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B535BBE6EE5898327DB52 /* HTMLInjection.swift */; }; B02109488289D631DF959B8D /* ReadiumFuzi.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2828D89EBB52CCA782ED1146 /* ReadiumFuzi.xcframework */; }; - B06476E5CCB09C8D913CCFA7 /* UIKitInputObserverAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */; }; B066F9DDCD00A8917478CB6C /* LCPDialogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BB64178365BFA9ED75C7078 /* LCPDialogViewController.swift */; }; B0B2C38D1A7B36E73C3E3779 /* DifferenceKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F95F3F20D758BE0E7005EA3 /* DifferenceKit.xcframework */; }; B0F62AC136EF3587E147468E /* AssetRetriever.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C054DDC6D1BCF4A420C980C /* AssetRetriever.swift */; }; @@ -536,7 +538,6 @@ 13C2DC41BEDB70085FCBBC00 /* PDFPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFPreferences.swift; sourceTree = ""; }; 15980B67505AAF10642B56C8 /* LicenseContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicenseContainer.swift; sourceTree = ""; }; 1674CCC0BA8B1F4E2D2B3A4C /* AudiobookFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudiobookFormatSniffer.swift; sourceTree = ""; }; - 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitInputObserverAdapter.swift; sourceTree = ""; }; 17ACAC3E8F61DA108DCC9F51 /* SQLiteLCPLicenseRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteLCPLicenseRepository.swift; sourceTree = ""; }; 17D22986A3ADE9E883691EE2 /* Deferred.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deferred.swift; sourceTree = ""; }; 18E809378D79D09192A0AAE1 /* ContentService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentService.swift; sourceTree = ""; }; @@ -688,6 +689,7 @@ 7C2787EBE9D5565DA8593711 /* Properties+Presentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Properties+Presentation.swift"; sourceTree = ""; }; 7C28B8CD48F8A660141F5983 /* DefaultLocatorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultLocatorService.swift; sourceTree = ""; }; 7C9B7B0A5A1B891BA3D9B9C0 /* BufferingResource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BufferingResource.swift; sourceTree = ""; }; + 7CDE839ECF121D2EDD0C31C7 /* InputObservingGestureRecognizerAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputObservingGestureRecognizerAdapter.swift; sourceTree = ""; }; 7EE333717736247C6F846CEF /* AudioPublicationManifestAugmentor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioPublicationManifestAugmentor.swift; sourceTree = ""; }; 7FCA24A94D6376487FECAEF1 /* LCPPassphraseRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCPPassphraseRepository.swift; sourceTree = ""; }; 819D931708B3EE95CF9ADFED /* OPDSCopies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPDSCopies.swift; sourceTree = ""; }; @@ -768,6 +770,7 @@ B39BF68DBB28D655023ADB62 /* Fetcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fetcher.swift; sourceTree = ""; }; B53B841C2F5A59BA3B161258 /* Resource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Resource.swift; sourceTree = ""; }; B5CE464C519852D38F873ADB /* PotentialRights.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PotentialRights.swift; sourceTree = ""; }; + B7457AD096857CA307F6ED6A /* InputObservable+Legacy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "InputObservable+Legacy.swift"; sourceTree = ""; }; B7C9D54352714641A87F64A0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; BAA7CEF568A02BA2CB4AAD7F /* OPDSFormatSniffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPDSFormatSniffer.swift; sourceTree = ""; }; BAFBCF0D898A8BF16923E264 /* ArchiveProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveProperties.swift; sourceTree = ""; }; @@ -878,6 +881,7 @@ F6E45005E776078B46DB8E14 /* Memoize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Memoize.swift; sourceTree = ""; }; F6EB7CAF6D058380A2AB711A /* CGPDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGPDF.swift; sourceTree = ""; }; F76073E8E6DACE7F9D22E0DD /* PointerEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointerEvent.swift; sourceTree = ""; }; + F7FF49B3B34628DC67CF8255 /* InputObservableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputObservableViewController.swift; sourceTree = ""; }; F820DAECA1FC23C42719CD68 /* EncryptionParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionParser.swift; sourceTree = ""; }; F8A3CDE3EA555A97BBFE1EEF /* ZIPFoundationContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZIPFoundationContainer.swift; sourceTree = ""; }; F8C32FDF5E2D35BE71E45ED0 /* AudioPreferencesEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioPreferencesEditor.swift; sourceTree = ""; }; @@ -1178,8 +1182,10 @@ children = ( EC8E202B8A16B960AE73CABF /* CompositeInputObserver.swift */, E20ED98539825B35F64D8262 /* InputObservable.swift */, + B7457AD096857CA307F6ED6A /* InputObservable+Legacy.swift */, + F7FF49B3B34628DC67CF8255 /* InputObservableViewController.swift */, 421AE163B6A0248637504A07 /* InputObserving.swift */, - 16C19CB22649198DFA492DEF /* UIKitInputObserverAdapter.swift */, + 7CDE839ECF121D2EDD0C31C7 /* InputObservingGestureRecognizerAdapter.swift */, EB64264B8AED33E93297BA5C /* Key */, F2877F50E88B9EDB0194EE3E /* Pointer */, ); @@ -2465,8 +2471,11 @@ E16AA8A927AAE141702F2D3B /* HTMLFontFamilyDeclaration.swift in Sources */, B01E5FC64FD1411DD9899ADC /* HTMLInjection.swift in Sources */, A036CCF310EB7408408FFF00 /* ImageViewController.swift in Sources */, + 368C947182F11C8F9D3E242C /* InputObservable+Legacy.swift in Sources */, 3886B24981CA3B3CD0E6DEC6 /* InputObservable.swift in Sources */, + 3ECB25D3B226C7059D4A922A /* InputObservableViewController.swift in Sources */, 4F9DAB2373AE0B6225D2C589 /* InputObserving.swift in Sources */, + 0512D1F6F6EC5CDAD0C68EA6 /* InputObservingGestureRecognizerAdapter.swift in Sources */, 27317F73ADCE4F5369BAACD0 /* Key.swift in Sources */, D53F33C86A0171051790B52C /* KeyEvent.swift in Sources */, 9AF316DF0B1CD4452D785EBC /* KeyModifiers.swift in Sources */, @@ -2497,7 +2506,6 @@ E12A731DD41BD2BC3C8076F8 /* TargetAction.swift in Sources */, 4A5F53CCC083D3E348379963 /* Types.swift in Sources */, D8C9C54CC84D1C0810343D9E /* UIColor.swift in Sources */, - B06476E5CCB09C8D913CCFA7 /* UIKitInputObserverAdapter.swift in Sources */, 8BA982B992E0370C7BF94DF6 /* UIView.swift in Sources */, 47FE7B25B5DB153D406CF0CE /* UserSettings.swift in Sources */, B96E8865DCA4A0CEFDA24DDF /* VisualNavigator.swift in Sources */, From 6a25e520e1555c9d894b3d547252f33a18e457f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 10:42:45 +0200 Subject: [PATCH 14/22] Refactor UIKit event forwarding --- .../CBZ/CBZNavigatorViewController.swift | 18 +-- .../EPUB/EPUBNavigatorViewController.swift | 120 +----------------- .../EPUB/EPUBReflowableSpreadView.swift | 16 +-- Sources/Navigator/EPUB/EPUBSpreadView.swift | 49 ++++--- ...ft => InputObservableViewController.swift} | 107 +++++++++++++--- .../Pointer/ActivatePointerObserver.swift | 2 +- .../PDF/PDFNavigatorViewController.swift | 57 +-------- 7 files changed, 137 insertions(+), 232 deletions(-) rename Sources/Navigator/Input/{UIKitInputObserverAdapter.swift => InputObservableViewController.swift} (55%) diff --git a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift index d5390cee0..ae47df1f0 100644 --- a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift +++ b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift @@ -11,7 +11,10 @@ import UIKit public protocol CBZNavigatorDelegate: VisualNavigatorDelegate {} /// A view controller used to render a CBZ `Publication`. -open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggable { +open class CBZNavigatorViewController: + InputObservableViewController, + VisualNavigator, Loggable +{ enum Error: Swift.Error { /// The provided publication is restricted. Check that any DRM was /// properly unlocked using a Content Protection. @@ -30,8 +33,6 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab private let publicationEndpoint: HTTPServerEndpoint? private var publicationBaseURL: HTTPURL! - private let inputObservers = CompositeInputObserver() - public convenience init( publication: Publication, initialLocation: Locator?, @@ -264,17 +265,6 @@ open class CBZNavigatorViewController: UIViewController, VisualNavigator, Loggab public func goBackward(options: NavigatorGoOptions) async -> Bool { await goToResourceAtIndex(currentResourceIndex - 1, options: options, isJump: false) } - - // MARK: - InputObservable - - @discardableResult - public func addObserver(_ observer: any InputObserving) -> InputObservableToken { - inputObservers.addObserver(observer) - } - - public func removeObserver(_ token: InputObservableToken) { - inputObservers.removeObserver(token) - } } extension CBZNavigatorViewController: UIPageViewControllerDataSource { diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 1a8132612..6900e78be 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -23,7 +23,7 @@ public extension EPUBNavigatorDelegate { public typealias EPUBContentInsets = (top: CGFloat, bottom: CGFloat) -open class EPUBNavigatorViewController: UIViewController, +open class EPUBNavigatorViewController: InputObservableViewController, VisualNavigator, SelectableNavigator, DecorableNavigator, Configurable, Loggable { @@ -217,10 +217,8 @@ open class EPUBNavigatorViewController: UIViewController, switch state { case .initializing, .loading, .jumping, .moving: paginationView?.isUserInteractionEnabled = false - shouldIgnoreUIKitInputEvents = false case .idle: paginationView?.isUserInteractionEnabled = true - shouldIgnoreUIKitInputEvents = true } } } @@ -231,10 +229,6 @@ open class EPUBNavigatorViewController: UIViewController, private var positionsByReadingOrder: [[Locator]] = [] private let tasks = CancellableTasks() - private let inputObservers = CompositeInputObserver() - private lazy var uikitInputObserverAdapter = UIKitInputObserverAdapter(observer: inputObservers) - private var shouldIgnoreUIKitInputEvents = false - private let viewModel: EPUBNavigatorViewModel public var publication: Publication { viewModel.publication } @@ -338,8 +332,6 @@ open class EPUBNavigatorViewController: UIViewController, // the current resource. We can use this to go to the next resource. view.accessibilityTraits.insert(.causesPageTurn) - uikitInputObserverAdapter.view = view - tasks.add { await initialize() } @@ -407,68 +399,6 @@ open class EPUBNavigatorViewController: UIViewController, } } - override open func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - - becomeFirstResponder() - } - - // MARK: - UIResponder - - override open var canBecomeFirstResponder: Bool { true } - - override open func pressesBegan(_ presses: Set, with event: UIPressesEvent?) { - super.pressesBegan(presses, with: event) - - if isFirstResponder { - uikitInputObserverAdapter.on(.down, presses: presses, with: event) - } - } - - override open func pressesChanged(_ presses: Set, with event: UIPressesEvent?) { - super.pressesChanged(presses, with: event) - - if isFirstResponder { - uikitInputObserverAdapter.on(.change, presses: presses, with: event) - } - } - - override open func pressesCancelled(_ presses: Set, with event: UIPressesEvent?) { - super.pressesCancelled(presses, with: event) - - if isFirstResponder { - uikitInputObserverAdapter.on(.cancel, presses: presses, with: event) - } - } - - override open func pressesEnded(_ presses: Set, with event: UIPressesEvent?) { - super.pressesEnded(presses, with: event) - - if isFirstResponder { - uikitInputObserverAdapter.on(.up, presses: presses, with: event) - } - } - - override open func touchesBegan(_ touches: Set, with event: UIEvent?) { - super.touchesBegan(touches, with: event) - uikitInputObserverAdapter.on(.down, touches: touches, event: event) - } - - override open func touchesMoved(_ touches: Set, with event: UIEvent?) { - super.touchesMoved(touches, with: event) - uikitInputObserverAdapter.on(.move, touches: touches, event: event) - } - - override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { - super.touchesCancelled(touches, with: event) - uikitInputObserverAdapter.on(.cancel, touches: touches, event: event) - } - - override open func touchesEnded(_ touches: Set, with event: UIEvent?) { - super.touchesEnded(touches, with: event) - uikitInputObserverAdapter.on(.up, touches: touches, event: event) - } - @discardableResult private func on(_ event: Event) -> Bool { assert(Thread.isMainThread, "Raising navigation events must be done from the main thread") @@ -910,23 +840,6 @@ open class EPUBNavigatorViewController: UIViewController, paginationView?.isScrollEnabled = isPaginationViewScrollingEnabled } - // MARK: - InputObservable - - @discardableResult - public func addObserver(_ observer: any InputObserving) -> InputObservableToken { - inputObservers.addObserver(observer) - } - - public func removeObserver(_ token: InputObservableToken) { - inputObservers.removeObserver(token) - } - - // MARK: - User interactions - - private func didTap(at point: CGPoint) { - delegate?.navigator(self, didTapAt: point) - } - // MARK: - EPUB-specific extensions /// Evaluates the given JavaScript on the currently visible HTML resource. @@ -1068,28 +981,10 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { } } - func spreadView(_ spreadView: EPUBSpreadView, didTapAt point: CGPoint) { - // We allow taps in any state, because we should always be able to toggle the navigation bar, - // even while a locator is pending. - - didTap(at: view.convert(point, from: spreadView)) - - // Uncomment to debug the coordinates of the tap point. -// let tapView = UIView(frame: .init(x: 0, y: 0, width: 50, height: 50)) -// view.addSubview(tapView) -// tapView.backgroundColor = .red -// tapView.center = point -// tapView.layer.cornerRadius = 25 -// tapView.layer.masksToBounds = true -// UIView.animate(withDuration: 0.8, animations: { -// tapView.alpha = 0 -// }) { _ in -// tapView.removeFromSuperview() -// } - } - func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent) { Task { + var event = event + event.location = view.convert(event.location, from: spreadView) _ = await inputObservers.didReceive(event) } } @@ -1098,15 +993,6 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate { Task { _ = await inputObservers.didReceive(event) } - - switch event.phase { - case .down: - delegate?.navigator(self, didPressKey: event) - case .cancel, .up: - delegate?.navigator(self, didReleaseKey: event) - case .change: - break - } } func spreadView(_ spreadView: EPUBSpreadView, didTapOnExternalURL url: URL) { diff --git a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift index 730767988..2db94b0c4 100644 --- a/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift @@ -111,17 +111,11 @@ final class EPUBReflowableSpreadView: EPUBSpreadView { override func convertPointToNavigatorSpace(_ point: CGPoint) -> CGPoint { var point = point if viewModel.scroll { - // Starting from iOS 12, the contentInset are not taken into account in the JS touch event. - if #available(iOS 12.0, *) { - if scrollView.contentOffset.x < 0 { - point.x += abs(scrollView.contentOffset.x) - } - if scrollView.contentOffset.y < 0 { - point.y += abs(scrollView.contentOffset.y) - } - } else { - point.x += scrollView.contentInset.left - point.y += scrollView.contentInset.top + if scrollView.contentOffset.x < 0 { + point.x += abs(scrollView.contentOffset.x) + } + if scrollView.contentOffset.y < 0 { + point.y += abs(scrollView.contentOffset.y) } } point.x += webView.frame.minX diff --git a/Sources/Navigator/EPUB/EPUBSpreadView.swift b/Sources/Navigator/EPUB/EPUBSpreadView.swift index 6bed5800e..4a503740f 100644 --- a/Sources/Navigator/EPUB/EPUBSpreadView.swift +++ b/Sources/Navigator/EPUB/EPUBSpreadView.swift @@ -12,9 +12,6 @@ protocol EPUBSpreadViewDelegate: AnyObject { /// Called when the spread view finished loading. func spreadViewDidLoad(_ spreadView: EPUBSpreadView) - /// Called when the user tapped on the spread contents. - func spreadView(_ spreadView: EPUBSpreadView, didTapAt point: CGPoint) - /// Called when the user tapped on an external link. func spreadView(_ spreadView: EPUBSpreadView, didTapOnExternalURL url: URL) @@ -82,10 +79,6 @@ class EPUBSpreadView: UIView, Loggable, PageView { addSubview(webView) setupWebView() - let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapBackground)) - gestureRecognizer.delegate = self - addGestureRecognizer(gestureRecognizer) - for script in scripts { webView.configuration.userContentController.addUserScript(script) } @@ -197,12 +190,6 @@ class EPUBSpreadView: UIView, Loggable, PageView { return } lastClick = clickEvent - - // Ignores taps on interactive elements, or if the script prevents the default behavior. - if !clickEvent.defaultPrevented, clickEvent.interactiveElement == nil { - let point = convertPointToNavigatorSpace(clickEvent.point) - delegate?.spreadView(self, didTapAt: point) - } } /// Called from the JS code when receiving a pointer event. @@ -235,10 +222,38 @@ class EPUBSpreadView: UIView, Loggable, PageView { rect } - /// Called by the UITapGestureRecognizer as a fallback tap when tapping around the webview. - @objc private func didTapBackground(_ gesture: UITapGestureRecognizer) { - let point = gesture.location(in: self) - delegate?.spreadView(self, didTapAt: point) + // We override the UIResponder touches callbacks to handle taps around the + // web view. + + override open func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + on(.down, touches: touches, event: event) + } + + override open func touchesMoved(_ touches: Set, with event: UIEvent?) { + super.touchesMoved(touches, with: event) + on(.move, touches: touches, event: event) + } + + override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { + super.touchesCancelled(touches, with: event) + on(.cancel, touches: touches, event: event) + } + + override open func touchesEnded(_ touches: Set, with event: UIEvent?) { + super.touchesEnded(touches, with: event) + on(.up, touches: touches, event: event) + } + + private func on(_ phase: PointerEvent.Phase, touches: Set, event: UIEvent?) { + for touch in touches { + delegate?.spreadView(self, didReceive: PointerEvent( + pointer: Pointer(touch: touch, event: event), + phase: phase, + location: touch.location(in: self), + modifiers: KeyModifiers(event: event) + )) + } } private func spreadLoadDidStart(_ body: Any) { diff --git a/Sources/Navigator/Input/UIKitInputObserverAdapter.swift b/Sources/Navigator/Input/InputObservableViewController.swift similarity index 55% rename from Sources/Navigator/Input/UIKitInputObserverAdapter.swift rename to Sources/Navigator/Input/InputObservableViewController.swift index 4d4fe51e2..33cb2d937 100644 --- a/Sources/Navigator/Input/UIKitInputObserverAdapter.swift +++ b/Sources/Navigator/Input/InputObservableViewController.swift @@ -6,38 +6,105 @@ import UIKit -@MainActor final class UIKitInputObserverAdapter { - weak var view: UIView? - private let observer: InputObserving +/// Base implementation of ``UIViewController`` which implements +/// ``InputObservable`` to forward UIKit touches and presses events to +/// observers. +open class InputObservableViewController: UIViewController, InputObservable { + let inputObservers = CompositeInputObserver() - init(observer: InputObserving) { - self.observer = observer + override open func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + becomeFirstResponder() + } + + // MARK: - InputObservable + + @discardableResult + public func addObserver(_ observer: any InputObserving) -> InputObservableToken { + inputObservers.addObserver(observer) + } + + public func removeObserver(_ token: InputObservableToken) { + inputObservers.removeObserver(token) + } + + // MARK: - UIResponder + + override open var canBecomeFirstResponder: Bool { true } + + override open func pressesBegan(_ presses: Set, with event: UIPressesEvent?) { + if isFirstResponder { + on(.down, presses: presses, with: event) + } else { + super.pressesBegan(presses, with: event) + } } - // MARK: - Presses + override open func pressesChanged(_ presses: Set, with event: UIPressesEvent?) { + if isFirstResponder { + on(.change, presses: presses, with: event) + } else { + super.pressesChanged(presses, with: event) + } + } - func on(_ phase: KeyEvent.Phase, presses: Set, with event: UIPressesEvent?) { + override open func pressesCancelled(_ presses: Set, with event: UIPressesEvent?) { + if isFirstResponder { + on(.cancel, presses: presses, with: event) + } else { + super.pressesCancelled(presses, with: event) + } + } + + override open func pressesEnded(_ presses: Set, with event: UIPressesEvent?) { + if isFirstResponder { + on(.up, presses: presses, with: event) + } else { + super.pressesEnded(presses, with: event) + } + } + + private func on(_ phase: KeyEvent.Phase, presses: Set, with event: UIPressesEvent?) { Task { for press in presses { guard let event = KeyEvent(phase: phase, uiPress: press) else { continue } - _ = await observer.didReceive(event) + _ = await inputObservers.didReceive(event) } } } - // MARK: - Touches + override open func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + on(.down, touches: touches, event: event) + } - func on(_ phase: PointerEvent.Phase, touches: Set, event: UIEvent?) { + override open func touchesMoved(_ touches: Set, with event: UIEvent?) { + super.touchesMoved(touches, with: event) + on(.move, touches: touches, event: event) + } + + override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { + super.touchesCancelled(touches, with: event) + on(.cancel, touches: touches, event: event) + } + + override open func touchesEnded(_ touches: Set, with event: UIEvent?) { + super.touchesEnded(touches, with: event) + on(.up, touches: touches, event: event) + } + + private func on(_ phase: PointerEvent.Phase, touches: Set, event: UIEvent?) { Task { for touch in touches { guard let view = view else { continue } - _ = await observer.didReceive(PointerEvent( - pointer: pointer(for: touch, with: event), + _ = await inputObservers.didReceive(PointerEvent( + pointer: Pointer(touch: touch, event: event), phase: phase, location: touch.location(in: view), modifiers: KeyModifiers(event: event) @@ -45,11 +112,13 @@ import UIKit } } } +} - private func pointer(for touch: UITouch, with event: UIEvent?) -> Pointer { - let id = AnyHashable("UITouch.TouchType(\(touch.type))") +extension Pointer { + init(touch: UITouch, event: UIEvent?) { + let id = AnyHashable(ObjectIdentifier(touch)) - return switch touch.type { + self = switch touch.type { case .direct, .indirect: .touch(TouchPointer(id: id)) case .pencil, .indirectPointer: @@ -60,7 +129,7 @@ import UIKit } } -public extension KeyEvent { +extension KeyEvent { init?(phase: KeyEvent.Phase, uiPress: UIPress) { guard let key = Key(uiPress: uiPress), @@ -77,7 +146,7 @@ public extension KeyEvent { } } -public extension Key { +extension Key { init?(uiPress: UIPress) { guard let key = uiPress.key else { return nil @@ -127,7 +196,7 @@ public extension Key { } } -private extension MouseButtons { +extension MouseButtons { init(event: UIEvent?) { self.init() @@ -144,7 +213,7 @@ private extension MouseButtons { } } -private extension KeyModifiers { +extension KeyModifiers { init(event: UIEvent?) { self.init() diff --git a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift index 1b453b907..f5860bd91 100644 --- a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift @@ -19,7 +19,7 @@ public extension InputObserving where Self == ActivatePointerObserver { shouldIgnore: { switch $0.pointer { case let .mouse(pointer): - return $0.phase != .up && pointer.buttons != [.main] + return pointer.buttons != [] && pointer.buttons != .main case .touch: return false } diff --git a/Sources/Navigator/PDF/PDFNavigatorViewController.swift b/Sources/Navigator/PDF/PDFNavigatorViewController.swift index 6611cbc20..fc59219ec 100644 --- a/Sources/Navigator/PDF/PDFNavigatorViewController.swift +++ b/Sources/Navigator/PDF/PDFNavigatorViewController.swift @@ -21,7 +21,10 @@ public extension PDFNavigatorDelegate { } /// A view controller used to render a PDF `Publication`. -open class PDFNavigatorViewController: UIViewController, VisualNavigator, SelectableNavigator, Configurable, Loggable { +open class PDFNavigatorViewController: + InputObservableViewController, + VisualNavigator, SelectableNavigator, Configurable, Loggable +{ public struct Configuration { /// Initial set of setting preferences. public var preferences: PDFPreferences @@ -76,7 +79,6 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select private let server: HTTPServer? private let publicationEndpoint: HTTPServerEndpoint? private var publicationBaseURL: HTTPURL! - private let inputObservers = CompositeInputObserver() public init( publication: Publication, @@ -204,12 +206,6 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select } } - override open func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - - becomeFirstResponder() - } - override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) @@ -230,40 +226,6 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select } } - override open var canBecomeFirstResponder: Bool { true } - - override open func pressesBegan(_ presses: Set, with event: UIPressesEvent?) { - var didHandleEvent = false - if isFirstResponder { - for press in presses { - if let event = KeyEvent(phase: .down, uiPress: press) { - delegate?.navigator(self, didPressKey: event) - didHandleEvent = true - } - } - } - - if !didHandleEvent { - super.pressesBegan(presses, with: event) - } - } - - override open func pressesEnded(_ presses: Set, with event: UIPressesEvent?) { - var didHandleEvent = false - if isFirstResponder { - for press in presses { - if let event = KeyEvent(phase: .up, uiPress: press) { - delegate?.navigator(self, didReleaseKey: event) - didHandleEvent = true - } - } - } - - if !didHandleEvent { - super.pressesEnded(presses, with: event) - } - } - @available(iOS 13.0, *) override open func buildMenu(with builder: UIMenuBuilder) { editingActions.buildMenu(with: builder) @@ -548,17 +510,6 @@ open class PDFNavigatorViewController: UIViewController, VisualNavigator, Select ) } - // MARK: - InputObservable - - @discardableResult - public func addObserver(_ observer: any InputObserving) -> InputObservableToken { - inputObservers.addObserver(observer) - } - - public func removeObserver(_ token: InputObservableToken) { - inputObservers.removeObserver(token) - } - // MARK: - SelectableNavigator public var currentSelection: Selection? { editingActions.selection } From 6662f55c3b64d87fc5a70dcc758ae6a4a4010c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 10:44:09 +0200 Subject: [PATCH 15/22] Add the `InputObservingGestureRecognizerAdapter` --- .../CBZ/CBZNavigatorViewController.swift | 9 +- .../EPUB/EPUBNavigatorViewController.swift | 2 +- .../Input/InputObservable+Legacy.swift | 2 +- ...putObservingGestureRecognizerAdapter.swift | 87 +++++++++++++++++++ 4 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 Sources/Navigator/Input/InputObservingGestureRecognizerAdapter.swift diff --git a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift index ae47df1f0..bddabb3a1 100644 --- a/Sources/Navigator/CBZ/CBZNavigatorViewController.swift +++ b/Sources/Navigator/CBZ/CBZNavigatorViewController.swift @@ -106,7 +106,7 @@ open class CBZNavigatorViewController: ) super.init(nibName: nil, bundle: nil) - + setupLegacyInputCallbacks( onTap: { [weak self] point in guard let self else { return } @@ -150,7 +150,7 @@ open class CBZNavigatorViewController: view.addSubview(pageViewController.view) pageViewController.didMove(toParent: self) - view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTap))) + view.addGestureRecognizer(InputObservingGestureRecognizerAdapter(observer: inputObservers)) tasks.add { try? await didLoadPositions(publication.positions().get()) @@ -205,11 +205,6 @@ open class CBZNavigatorViewController: return true } - @objc private func didTap(_ gesture: UITapGestureRecognizer) { - let point = gesture.location(in: view) - delegate?.navigator(self, didTapAt: point) - } - private func imageViewController(at index: Int) -> ImageViewController? { guard publication.readingOrder.indices.contains(index) else { return nil diff --git a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift index 6900e78be..e84ae40cf 100644 --- a/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift +++ b/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift @@ -303,7 +303,7 @@ open class EPUBNavigatorViewController: InputObservableViewController, viewModel.delegate = self viewModel.editingActions.delegate = self - + setupLegacyInputCallbacks( onTap: { [weak self] point in guard let self else { return } diff --git a/Sources/Navigator/Input/InputObservable+Legacy.swift b/Sources/Navigator/Input/InputObservable+Legacy.swift index 3b5270868..b2074bc4f 100644 --- a/Sources/Navigator/Input/InputObservable+Legacy.swift +++ b/Sources/Navigator/Input/InputObservable+Legacy.swift @@ -16,7 +16,7 @@ extension InputObservable { onTap(event.location) return false }) - + addObserver(.key { event in switch event.phase { case .down: diff --git a/Sources/Navigator/Input/InputObservingGestureRecognizerAdapter.swift b/Sources/Navigator/Input/InputObservingGestureRecognizerAdapter.swift new file mode 100644 index 000000000..3383b7172 --- /dev/null +++ b/Sources/Navigator/Input/InputObservingGestureRecognizerAdapter.swift @@ -0,0 +1,87 @@ +// +// Copyright 2025 Readium Foundation. All rights reserved. +// Use of this source code is governed by the BSD-style license +// available in the top-level LICENSE file of the project. +// + +import UIKit +import UIKit.UIGestureRecognizerSubclass + +/// A ``UIGestureRecognizer`` that will forward the touch events to an +/// ``InputObserving``. It will never recognize any gesture, only forward the +/// events. +final class InputObservingGestureRecognizerAdapter: UIGestureRecognizer { + let observer: InputObserving + + init(observer: CompositeInputObserver) { + self.observer = observer + super.init(target: nil, action: nil) + } + + /// Stores the ``PointerEvent`` that were notified to the `observer`, to + /// cancel them if the gesture recognizer is resetted before the touches + /// are cancelled or ended. + private var pendingPointers: [AnyHashable: PointerEvent] = [:] + + override func touchesBegan(_ touches: Set, with event: UIEvent) { + super.touchesBegan(touches, with: event) + on(.down, touches: touches, event: event) + } + + override func touchesMoved(_ touches: Set, with event: UIEvent) { + super.touchesMoved(touches, with: event) + on(.move, touches: touches, event: event) + } + + override func touchesCancelled(_ touches: Set, with event: UIEvent) { + super.touchesCancelled(touches, with: event) + on(.cancel, touches: touches, event: event) + } + + override func touchesEnded(_ touches: Set, with event: UIEvent) { + super.touchesEnded(touches, with: event) + on(.up, touches: touches, event: event) + } + + override func reset() { + // The gesture recognizer can be resetted without receiving the ended + // or cancelled callbacks for touch events already sent. We will cancel + // them manually for the observer. + let pointersToReset = pendingPointers + pendingPointers = [:] + Task { + for (_, event) in pointersToReset { + var event = event + event.phase = .cancel + _ = await observer.didReceive(event) + } + } + } + + private func on(_ phase: PointerEvent.Phase, touches: Set, event: UIEvent) { + Task { + for touch in touches { + guard let view = view else { + continue + } + + let pointer = Pointer(touch: touch, event: event) + let pointerEvent = PointerEvent( + pointer: pointer, + phase: phase, + location: touch.location(in: view), + modifiers: KeyModifiers(event: event) + ) + + switch phase { + case .down, .move: + pendingPointers[pointer.id] = pointerEvent + case .up, .cancel: + pendingPointers.removeValue(forKey: pointer.id) + } + + _ = await observer.didReceive(pointerEvent) + } + } + } +} From 57031476e14841eaffc156e8f1a33262fc0f9dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 12:14:22 +0200 Subject: [PATCH 16/22] Minor change --- Sources/Navigator/Input/InputObserving.swift | 5 ----- Sources/Navigator/Input/Key/KeyObserver.swift | 4 ++++ .../Navigator/Input/Pointer/ActivatePointerObserver.swift | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Sources/Navigator/Input/InputObserving.swift b/Sources/Navigator/Input/InputObserving.swift index 2b0845517..35ddb1b75 100644 --- a/Sources/Navigator/Input/InputObserving.swift +++ b/Sources/Navigator/Input/InputObserving.swift @@ -22,8 +22,3 @@ import Foundation /// will not be forwarded to other observers. func didReceive(_ event: KeyEvent) async -> Bool } - -public extension InputObserving { - func didReceive(_ event: PointerEvent) async -> Bool { false } - func didReceive(_ event: KeyEvent) async -> Bool { false } -} diff --git a/Sources/Navigator/Input/Key/KeyObserver.swift b/Sources/Navigator/Input/Key/KeyObserver.swift index 3e8187e88..e82b0fb99 100644 --- a/Sources/Navigator/Input/Key/KeyObserver.swift +++ b/Sources/Navigator/Input/Key/KeyObserver.swift @@ -48,6 +48,10 @@ public extension InputObserving where Self == KeyObserver { keyCombo = nil self.onKey = onKey } + + public func didReceive(_ event: PointerEvent) async -> Bool { + false + } public func didReceive(_ event: KeyEvent) async -> Bool { guard event.phase == .down else { diff --git a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift index f5860bd91..109389540 100644 --- a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift @@ -113,6 +113,10 @@ public extension InputObserving where Self == ActivatePointerObserver { return false } + + public func didReceive(_ event: KeyEvent) async -> Bool { + false + } private func transition(state: State, event: PointerEvent) -> State { let id = event.pointer.id From 4a9485d57834ff1a88e5e4498b8757bccabe175b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 12:50:53 +0200 Subject: [PATCH 17/22] Fix PDF --- .../Input/InputObservableViewController.swift | 12 +++-- Sources/Navigator/Input/Key/KeyObserver.swift | 2 +- .../Pointer/ActivatePointerObserver.swift | 2 +- .../PDF/PDFNavigatorViewController.swift | 54 ++++++++++++------- .../PDF/PDFTapGestureController.swift | 33 ++++++------ 5 files changed, 63 insertions(+), 40 deletions(-) diff --git a/Sources/Navigator/Input/InputObservableViewController.swift b/Sources/Navigator/Input/InputObservableViewController.swift index 33cb2d937..4f229b68e 100644 --- a/Sources/Navigator/Input/InputObservableViewController.swift +++ b/Sources/Navigator/Input/InputObservableViewController.swift @@ -215,11 +215,15 @@ extension MouseButtons { extension KeyModifiers { init(event: UIEvent?) { - self.init() - - guard let flags = event?.modifierFlags else { - return + if let flags = event?.modifierFlags { + self.init(flags: flags) + } else { + self.init() } + } + + init(flags: UIKeyModifierFlags) { + self.init() if flags.contains(.shift) { insert(.shift) diff --git a/Sources/Navigator/Input/Key/KeyObserver.swift b/Sources/Navigator/Input/Key/KeyObserver.swift index e82b0fb99..b13b39000 100644 --- a/Sources/Navigator/Input/Key/KeyObserver.swift +++ b/Sources/Navigator/Input/Key/KeyObserver.swift @@ -48,7 +48,7 @@ public extension InputObserving where Self == KeyObserver { keyCombo = nil self.onKey = onKey } - + public func didReceive(_ event: PointerEvent) async -> Bool { false } diff --git a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift index 109389540..c95229610 100644 --- a/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift +++ b/Sources/Navigator/Input/Pointer/ActivatePointerObserver.swift @@ -113,7 +113,7 @@ public extension InputObserving where Self == ActivatePointerObserver { return false } - + public func didReceive(_ event: KeyEvent) async -> Bool { false } diff --git a/Sources/Navigator/PDF/PDFNavigatorViewController.swift b/Sources/Navigator/PDF/PDFNavigatorViewController.swift index fc59219ec..fe9bd063c 100644 --- a/Sources/Navigator/PDF/PDFNavigatorViewController.swift +++ b/Sources/Navigator/PDF/PDFNavigatorViewController.swift @@ -73,8 +73,9 @@ open class PDFNavigatorViewController: /// Holds the currently opened PDF Document. private let documentHolder = PDFDocumentHolder() - /// Holds a reference to make sure it is not garbage-collected. + // Holds a reference to make sure they are not garbage-collected. private var tapGestureController: PDFTapGestureController? + private var clickGestureController: PDFTapGestureController? private let server: HTTPServer? private let publicationEndpoint: HTTPServerEndpoint? @@ -145,21 +146,6 @@ open class PDFNavigatorViewController: documentHolder, service.pdfFactory, ]) } - - setupLegacyInputCallbacks( - onTap: { [weak self] point in - guard let self else { return } - self.delegate?.navigator(self, didTapAt: point) - }, - onPressKey: { [weak self] event in - guard let self else { return } - self.delegate?.navigator(self, didPressKey: event) - }, - onReleaseKey: { [weak self] event in - guard let self else { return } - self.delegate?.navigator(self, didReleaseKey: event) - } - ) } @available(*, unavailable) @@ -261,7 +247,18 @@ open class PDFNavigatorViewController: pdfView.autoresizingMask = [.flexibleWidth, .flexibleHeight] view.addSubview(pdfView) - tapGestureController = PDFTapGestureController(pdfView: pdfView, target: self, action: #selector(didTap)) + tapGestureController = PDFTapGestureController( + pdfView: pdfView, + touchTypes: [.direct, .indirect], + target: self, + action: #selector(didTap) + ) + clickGestureController = PDFTapGestureController( + pdfView: pdfView, + touchTypes: [.indirectPointer], + target: self, + action: #selector(didClick) + ) apply(settings: settings, to: pdfView) delegate?.navigator(self, setupPDFView: pdfView) @@ -347,8 +344,27 @@ open class PDFNavigatorViewController: open func setupPDFView() {} @objc private func didTap(_ gesture: UITapGestureRecognizer) { - let point = gesture.location(in: view) - delegate?.navigator(self, didTapAt: point) + let location = gesture.location(in: view) + let pointer = Pointer.touch(TouchPointer(id: ObjectIdentifier(gesture))) + let modifiers = KeyModifiers(flags: gesture.modifierFlags) + Task { + _ = await inputObservers.didReceive(PointerEvent(pointer: pointer, phase: .down, location: location, modifiers: modifiers)) + _ = await inputObservers.didReceive(PointerEvent(pointer: pointer, phase: .up, location: location, modifiers: modifiers)) + } + + delegate?.navigator(self, didTapAt: location) + } + + @objc private func didClick(_ gesture: UITapGestureRecognizer) { + let location = gesture.location(in: view) + let pointer = Pointer.mouse(MousePointer(id: ObjectIdentifier(gesture), buttons: .main)) + let modifiers = KeyModifiers(flags: gesture.modifierFlags) + Task { + _ = await inputObservers.didReceive(PointerEvent(pointer: pointer, phase: .down, location: location, modifiers: modifiers)) + _ = await inputObservers.didReceive(PointerEvent(pointer: pointer, phase: .up, location: location, modifiers: modifiers)) + } + + delegate?.navigator(self, didTapAt: location) } @objc private func pageDidChange() { diff --git a/Sources/Navigator/PDF/PDFTapGestureController.swift b/Sources/Navigator/PDF/PDFTapGestureController.swift index 639b4a4af..c3a7671f2 100644 --- a/Sources/Navigator/PDF/PDFTapGestureController.swift +++ b/Sources/Navigator/PDF/PDFTapGestureController.swift @@ -15,7 +15,12 @@ final class PDFTapGestureController: NSObject { private let tapAction: TargetAction private var tapRecognizer: UITapGestureRecognizer! - init(pdfView: PDFView, target: AnyObject, action: Selector) { + init( + pdfView: PDFView, + touchTypes: [UITouch.TouchType], + target: AnyObject, + action: Selector + ) { assert(pdfView.superview != nil, "The PDFView must be in the view hierarchy") self.pdfView = pdfView @@ -24,24 +29,22 @@ final class PDFTapGestureController: NSObject { super.init() tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTap)) + tapRecognizer.allowedTouchTypes = touchTypes.map { NSNumber(value: $0.rawValue) } + tapRecognizer.requiresExclusiveTouchType = true - if #available(iOS 13.0, *) { - // If we add the gesture on the superview on iOS 13, then it will be triggered when - // taping a link. - // The delegate will be used to make sure that this recognizer has a lower precedence - // over the default tap recognizer of the `PDFView`, which is used to handle links. - tapRecognizer.delegate = self - pdfView.addGestureRecognizer(tapRecognizer) - - } else { - // Before iOS 13, the gesture must be on the superview to prevent conflicts. - pdfView.superview?.addGestureRecognizer(tapRecognizer) - } + // If we add the gesture on the superview on iOS 13, then it will be + // triggered when taping a link. + // + // The delegate will be used to make sure that this recognizer has a + // lower precedence over the default tap recognizer of the `PDFView`, + // which is used to handle links. + tapRecognizer.delegate = self + pdfView.addGestureRecognizer(tapRecognizer) } @objc private func didTap(_ gesture: UITapGestureRecognizer) { - // On iOS 13, the tap to clear text selection is broken by adding the tap recognizer, so - // we clear it manually. + // On iOS 13, the tap to clear text selection is broken by adding the + // tap recognizer, so we clear it manually. guard pdfView.currentSelection == nil else { pdfView.clearSelection() return From 0cc886e3bdad40bdfc21cf30ee16d9eac90631b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 12:52:13 +0200 Subject: [PATCH 18/22] Fix tab bar --- TestApp/Sources/Library/LibraryModule.swift | 6 +++++- .../Library/LibraryViewController.swift | 1 - .../Reader/Common/ReaderViewController.swift | 12 ++++++++++++ .../Common/VisualReaderViewController.swift | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/TestApp/Sources/Library/LibraryModule.swift b/TestApp/Sources/Library/LibraryModule.swift index dc3ae12da..11ea59bbb 100644 --- a/TestApp/Sources/Library/LibraryModule.swift +++ b/TestApp/Sources/Library/LibraryModule.swift @@ -53,7 +53,11 @@ final class LibraryModule: LibraryModuleAPI { self.delegate = delegate } - private(set) lazy var rootViewController: UINavigationController = .init(rootViewController: libraryViewController) + private(set) lazy var rootViewController: UINavigationController = { + let nav = UINavigationController(rootViewController: libraryViewController) + nav.navigationBar.backgroundColor = .systemBackground + return nav + }() private lazy var libraryViewController: LibraryViewController = { let library: LibraryViewController = factory.make() diff --git a/TestApp/Sources/Library/LibraryViewController.swift b/TestApp/Sources/Library/LibraryViewController.swift index d1fe732aa..789154605 100644 --- a/TestApp/Sources/Library/LibraryViewController.swift +++ b/TestApp/Sources/Library/LibraryViewController.swift @@ -49,7 +49,6 @@ class LibraryViewController: UIViewController, Loggable { @IBOutlet var collectionView: UICollectionView! { didSet { - collectionView.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) collectionView.contentInset = UIEdgeInsets(top: 15, left: 20, bottom: 20, right: 20) collectionView.register(UINib(nibName: "PublicationCollectionViewCell", bundle: nil), diff --git a/TestApp/Sources/Reader/Common/ReaderViewController.swift b/TestApp/Sources/Reader/Common/ReaderViewController.swift index 5db699737..582158d66 100644 --- a/TestApp/Sources/Reader/Common/ReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/ReaderViewController.swift @@ -58,6 +58,18 @@ class ReaderViewController: UIViewController, navigationItem.rightBarButtonItems = makeNavigationBarButtons() } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + tabBarController?.isTabBarHidden = true + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + tabBarController?.isTabBarHidden = false + } // MARK: - Navigation bar diff --git a/TestApp/Sources/Reader/Common/VisualReaderViewController.swift b/TestApp/Sources/Reader/Common/VisualReaderViewController.swift index 7d0f79268..158c68ed9 100644 --- a/TestApp/Sources/Reader/Common/VisualReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/VisualReaderViewController.swift @@ -57,6 +57,25 @@ class VisualReaderViewController: ReaderViewCon return } + // Show a red dot at the location where the user tapped. +// navigator.addObserver(.tap { [weak self] event in +// guard let self else { return false } +// +// let tapView = UIView(frame: .init(x: 0, y: 0, width: 50, height: 50)) +// view.addSubview(tapView) +// tapView.backgroundColor = .red +// tapView.center = event.location +// tapView.layer.cornerRadius = 25 +// tapView.layer.masksToBounds = true +// UIView.animate(withDuration: 0.8, animations: { +// tapView.alpha = 0 +// }) { _ in +// tapView.removeFromSuperview() +// } +// +// return false +// }) + /// This adapter will automatically turn pages when the user taps the /// screen edges or press arrow keys. /// From 9a44d9aa8623db6dd2caddf76d34f22095494f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 13:04:57 +0200 Subject: [PATCH 19/22] Update documentation --- CHANGELOG.md | 4 ++ .../Reader/Common/ReaderViewController.swift | 8 +-- docs/Migration Guide.md | 64 ++++++++++++++++++- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9122943af..e43a0b42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. Take a look * Implementation of the [W3C Accessibility Metadata Display Guide](https://w3c.github.io/publ-a11y/a11y-meta-display-guide/2.0/guidelines/) specification to facilitate displaying accessibility metadata to users. [See the dedicated user guide](docs/Guides/Accessibility.md). +#### Navigator + +* A new `InputObserving` API has been added to enable more flexible gesture recognition and support for mouse pointers. [See the dedicated user guide](docs/Guides/Navigator/Input.md). + ### Fixed #### Navigator diff --git a/TestApp/Sources/Reader/Common/ReaderViewController.swift b/TestApp/Sources/Reader/Common/ReaderViewController.swift index 582158d66..32aedb308 100644 --- a/TestApp/Sources/Reader/Common/ReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/ReaderViewController.swift @@ -58,16 +58,16 @@ class ReaderViewController: UIViewController, navigationItem.rightBarButtonItems = makeNavigationBarButtons() } - + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - + tabBarController?.isTabBarHidden = true } - + override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - + tabBarController?.isTabBarHidden = false } diff --git a/docs/Migration Guide.md b/docs/Migration Guide.md index 0489e2c5a..9cd1d9e5b 100644 --- a/docs/Migration Guide.md +++ b/docs/Migration Guide.md @@ -2,7 +2,69 @@ All migration steps necessary in reading apps to upgrade to major versions of the Swift Readium toolkit will be documented in this file. - +## Unreleased + +### New Input API + +A new `InputObserving` API has been added to enable more flexible gesture recognition and support for mouse pointers. [See the dedicated user guide](Guides/Navigator/Input.md). + +The `DirectionalNavigationAdapter` was also updated to use this new API, and is easier to use. + +To migrate the old API, remove the old `VisualNavigatorDelegate` callbacks, for example: + +```diff +-func navigator(_ navigator: VisualNavigator, didTapAt point: CGPoint) { +- Task { +- // Turn pages when tapping the edge of the screen. +- guard await !DirectionalNavigationAdapter(navigator: navigator).didTap(at: point) else { +- return +- } +- // clear a current search highlight +- if let decorator = self.navigator as? DecorableNavigator { +- decorator.apply(decorations: [], in: "search") +- } +- +- toggleNavigationBar() +- } +-} +- +-func navigator(_ navigator: VisualNavigator, didPressKey event: KeyEvent) { +- Task { +- // Turn pages when pressing the arrow keys. +- await DirectionalNavigationAdapter(navigator: navigator).didPressKey(event: event) +- } +-} +``` + +Instead, setup your observers after initializing the navigator. Return `true` if you want to stop the propagation of a particular event to the next observers. + +```swift +/// This adapter will automatically turn pages when the user taps the +/// screen edges or press arrow keys. +/// +/// Bind it to the navigator before adding your own observers to prevent +/// triggering your actions when turning pages. +DirectionalNavigationAdapter().bind(to: navigator) + +// Clear the current search highlight on tap. +navigator.addObserver(.tap { [weak self] _ in + guard + let searchViewModel = self?.searchViewModel, + searchViewModel.selectedLocator != nil + else { + return false + } + + searchViewModel.selectedLocator = nil + return true +}) + +// Toggle the navigation bar on tap, if nothing else took precedence. +navigator.addObserver(.tap { [weak self] _ in + self?.toggleNavigationBar() + return true +}) +``` ## 3.1.0 From 67a845d9c0febac2faacfd22cf8b0a2feeb2d39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 13:23:45 +0200 Subject: [PATCH 20/22] Fix --- Sources/Navigator/Input/InputObservableViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Navigator/Input/InputObservableViewController.swift b/Sources/Navigator/Input/InputObservableViewController.swift index 4f229b68e..131cc2fcc 100644 --- a/Sources/Navigator/Input/InputObservableViewController.swift +++ b/Sources/Navigator/Input/InputObservableViewController.swift @@ -122,7 +122,7 @@ extension Pointer { case .direct, .indirect: .touch(TouchPointer(id: id)) case .pencil, .indirectPointer: - fallthrough + .mouse(MousePointer(id: id, buttons: MouseButtons(event: event))) @unknown default: .mouse(MousePointer(id: id, buttons: MouseButtons(event: event))) } From c2c86c6581cd5951a5f03cc5a6693865d2d818f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 13:37:14 +0200 Subject: [PATCH 21/22] Fix --- TestApp/Sources/Reader/Common/ReaderViewController.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/TestApp/Sources/Reader/Common/ReaderViewController.swift b/TestApp/Sources/Reader/Common/ReaderViewController.swift index 32aedb308..6b746bbff 100644 --- a/TestApp/Sources/Reader/Common/ReaderViewController.swift +++ b/TestApp/Sources/Reader/Common/ReaderViewController.swift @@ -62,13 +62,17 @@ class ReaderViewController: UIViewController, override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - tabBarController?.isTabBarHidden = true + if #available(iOS 18.0, *) { + tabBarController?.isTabBarHidden = true + } } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - tabBarController?.isTabBarHidden = false + if #available(iOS 18.0, *) { + tabBarController?.isTabBarHidden = false + } } // MARK: - Navigation bar From be67c09fd67c1fff348b767c7b02d1e1d0fc63b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Wed, 14 May 2025 13:56:51 +0200 Subject: [PATCH 22/22] Bump Xcode requirement --- .github/workflows/checks.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a8cfcfbdb..fee815bcd 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,7 +9,7 @@ env: platform: ${{ 'iOS Simulator' }} device: ${{ 'iPhone SE (3rd generation)' }} commit_sha: ${{ github.sha }} - DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer jobs: build: diff --git a/README.md b/README.md index c2aa08783..ed91b4e73 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Guides are available to help you make the most of the toolkit. | Readium | iOS | Swift compiler | Xcode | |-----------|------|----------------|-------| -| `develop` | 13.4 | 5.10 | 15.4 | +| `develop` | 13.4 | 6.0 | 16.2 | | 3.0.0 | 13.4 | 5.10 | 15.4 | | 2.5.1 | 11.0 | 5.6.1 | 13.4 | | 2.5.0 | 10.0 | 5.6.1 | 13.4 |