diff --git a/bundle.js b/bundle.js index 238cf0d..340d709 100644 --- a/bundle.js +++ b/bundle.js @@ -1,2 +1,2 @@ -!function(){"use strict";var t=-1;function e(o,a,s,l){if(o===a)return o?[[0,o]]:[];if(null!=s){var h=function(t,e,u){var n="number"==typeof u?{index:u,length:0}:u.oldRange,i="number"==typeof u?null:u.newRange,r=t.length,o=e.length;if(0===n.length&&(null===i||0===i.length)){var a=n.index,s=t.slice(0,a),l=t.slice(a),h=i?i.index:null,c=a+o-r;if((null===h||h===c)&&!(c<0||c>o)){var d=e.slice(0,c);if((E=e.slice(c))===l){var f=Math.min(a,c);if((F=s.slice(0,f))===(g=d.slice(0,f)))return D(F,s.slice(f),d.slice(f),l)}}if(null===h||h===a){var p=a,E=(d=e.slice(0,p),e.slice(p));if(d===s){var C=Math.min(r-p,o-p);if((A=l.slice(l.length-C))===(v=E.slice(E.length-C)))return D(s,l.slice(0,l.length-C),E.slice(0,E.length-C),A)}}}if(n.length>0&&i&&0===i.length){var F=t.slice(0,n.index),A=t.slice(n.index+n.length);if(!(o<(f=F.length)+(C=A.length))){var g=e.slice(0,f),v=e.slice(o-C);if(F===g&&A===v)return D(F,t.slice(f,r-C),e.slice(f,o-C),A)}}return null}(o,a,s);if(h)return h}var c=n(o,a),d=o.substring(0,c);c=i(o=o.substring(c),a=a.substring(c));var f=o.substring(o.length-c),p=function(r,o){var a;if(!r)return[[1,o]];if(!o)return[[t,r]];var s=r.length>o.length?r:o,l=r.length>o.length?o:r,D=s.indexOf(l);if(-1!==D)return a=[[1,s.substring(0,D)],[0,l],[1,s.substring(D+l.length)]],r.length>o.length&&(a[0][0]=a[2][0]=t),a;if(1===l.length)return[[t,r],[1,o]];var h=function(t,e){var u=t.length>e.length?t:e,r=t.length>e.length?e:t;if(u.length<4||2*r.length=t.length?[r,o,a,s,h]:null}var a,s,l,D,h,c=o(u,r,Math.ceil(u.length/4)),d=o(u,r,Math.ceil(u.length/2));if(!c&&!d)return null;a=d?c&&c[4].length>d[4].length?c:d:c;t.length>e.length?(s=a[0],l=a[1],D=a[2],h=a[3]):(D=a[0],h=a[1],s=a[2],l=a[3]);var f=a[4];return[s,l,D,h,f]}(r,o);if(h){var c=h[0],d=h[1],f=h[2],p=h[3],E=h[4],C=e(c,f),F=e(d,p);return C.concat([[0,E]],F)}return function(e,n){for(var i=e.length,r=n.length,o=Math.ceil((i+r)/2),a=o,s=2*o,l=new Array(s),D=new Array(s),h=0;hi)p+=2;else if(v>r)f+=2;else if(d){if((y=a+c-A)>=0&&y=(B=i-D[y]))return u(e,n,N,v)}}for(var m=-F+E;m<=F-C;m+=2){for(var B,y=a+m,w=(B=m===-F||m!==F&&D[y-1]i)C+=2;else if(w>r)E+=2;else if(!d){if((g=a+c-m)>=0&&g=(B=i-B))return u(e,n,N,v)}}}}return[[t,e],[1,n]]}(r,o)}(o=o.substring(0,o.length-c),a=a.substring(0,a.length-c));return d&&p.unshift([0,d]),f&&p.push([0,f]),r(p,l),p}function u(t,u,n,i){var r=t.substring(0,n),o=u.substring(0,i),a=t.substring(n),s=u.substring(i),l=e(r,o),D=e(a,s);return l.concat(D)}function n(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var u=0,n=Math.min(t.length,e.length),i=n,r=0;u=0&&l(e[f][1])){var p=e[f][1].slice(-1);if(e[f][1]=e[f][1].slice(0,-1),c=p+c,d=p+d,!e[f][1]){e.splice(f,1),a--;var E=f-1;e[E]&&1===e[E][0]&&(h++,d=e[E][1]+d,E--),e[E]&&e[E][0]===t&&(D++,c=e[E][1]+c,E--),f=E}}if(s(e[a][1])){p=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=p,d+=p}}if(a0||d.length>0){c.length>0&&d.length>0&&(0!==(o=n(d,c))&&(f>=0?e[f][1]+=d.substring(0,o):(e.splice(0,0,[0,d.substring(0,o)]),a++),d=d.substring(o),c=c.substring(o)),0!==(o=i(d,c))&&(e[a][1]=d.substring(d.length-o)+e[a][1],d=d.substring(0,d.length-o),c=c.substring(0,c.length-o)));var C=h+D;0===c.length&&0===d.length?(e.splice(a-C,C),a-=C):0===c.length?(e.splice(a-C,C,[1,d]),a=a-C+1):0===d.length?(e.splice(a-C,C,[t,c]),a=a-C+1):(e.splice(a-C,C,[t,c],[1,d]),a=a-C+2)}0!==a&&0===e[a-1][0]?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,h=0,D=0,c="",d=""}""===e[e.length-1][1]&&e.pop();var F=!1;for(a=1;a=55296&&t<=56319}function a(t){return t>=56320&&t<=57343}function s(t){return a(t.charCodeAt(0))}function l(t){return o(t.charCodeAt(t.length-1))}function D(e,u,n,i){return l(e)||s(i)?null:function(t){for(var e=[],u=0;u0&&e.push(t[u]);return e}([[0,e],[t,u],[1,n],[0,i]])}function h(t,u,n){return e(t,u,n,!0)}h.INSERT=1,h.DELETE=t,h.EQUAL=0;var c,d,f=h,p=(c=function(t,e){function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n,i,r,o=u(f);function a(t){e.isDebug=t}function s(t){switch(t){case"ltr":return e.PageProgression.LTR;case"rtl":return e.PageProgression.RTL;default:throw new Error("unknown PageProgression: "+t)}}function l(t){var e=Array.from(t),u=null;return e[0]instanceof Error&&(u=e.shift()),{error:u,messages:e}}function D(t){var e=t.error,u=e&&(e.frameTrace||e.stack),n=[].concat(t.messages);return e&&(n.length>0&&(n=n.concat(["\n"])),n=n.concat([e.toString()]),u&&(n=n.concat(["\n"]).concat(u))),n}e.isDebug=!1,e.PageProgression=void 0,function(t){t.LTR="ltr",t.RTL="rtl"}(e.PageProgression||(e.PageProgression={})),e.PageSide=void 0,(n=e.PageSide||(e.PageSide={})).LEFT="left",n.RIGHT="right",e.ReadyState=void 0,(i=e.ReadyState||(e.ReadyState={})).LOADING="loading",i.INTERACTIVE="interactive",i.COMPLETE="complete",function(t){t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR"}(r||(r={}));var h,c=new(function(){function t(t){this.opt_console=void 0,this.listeners={},this.opt_console=t}var e=t.prototype;return e.consoleDebug=function(t){var e,u,n;this.opt_console?this.opt_console.debug?(e=this.opt_console).debug.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).debug.apply(n,t)},e.consoleInfo=function(t){var e,u,n;this.opt_console?this.opt_console.info?(e=this.opt_console).info.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).info.apply(n,t)},e.consoleWarn=function(t){var e,u,n;this.opt_console?this.opt_console.warn?(e=this.opt_console).warn.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).warn.apply(n,t)},e.consoleError=function(t){var e,u,n;this.opt_console?this.opt_console.error?(e=this.opt_console).error.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).error.apply(n,t)},e.triggerListeners=function(t,e){var u=this.listeners[t];u&&u.forEach((function(t){t(e)}))},e.addListener=function(t,e){var u=this.listeners[t];u||(u=this.listeners[t]=[]),u.push(e)},e.debug=function(){var t=l(arguments);this.consoleDebug(D(t)),this.triggerListeners(r.DEBUG,t)},e.info=function(){var t=l(arguments);this.consoleInfo(D(t)),this.triggerListeners(r.INFO,t)},e.warn=function(){var t=l(arguments);this.consoleWarn(D(t)),this.triggerListeners(r.WARN,t)},e.error=function(){var t=l(arguments);this.consoleError(D(t)),this.triggerListeners(r.ERROR,t)},t}());e.HOOKS=void 0,(h=e.HOOKS||(e.HOOKS={})).SIMPLE_PROPERTY="SIMPLE_PROPERTY",h.PREPROCESS_SINGLE_DOCUMENT="PREPROCESS_SINGLE_DOCUMENT",h.PREPROCESS_TEXT_CONTENT="PREPROCESS_TEXT_CONTENT",h.PREPROCESS_ELEMENT_STYLE="PREPROCESS_ELEMENT_STYLE",h.POLYFILLED_INHERITED_PROPS="POLYFILLED_INHERITED_PROPS",h.CONFIGURATION="CONFIGURATION",h.RESOLVE_TEXT_NODE_BREAKER="RESOLVE_TEXT_NODE_BREAKER",h.RESOLVE_FORMATTING_CONTEXT="RESOLVE_FORMATTING_CONTEXT",h.RESOLVE_LAYOUT_PROCESSOR="RESOLVE_LAYOUT_PROCESSOR",h.POST_LAYOUT_BLOCK="POST_LAYOUT_BLOCK";var d={};function p(t,u,n){if(e.HOOKS[t]){var i=d[t];i||(i=d[t]=[]),n?i.unshift(u):i.push(u)}else c.warn(new Error("Skipping unknown plugin hook '"+t+"'."))}function E(t,u){if(e.HOOKS[t]){var n=d[t];if(n){var i=n.indexOf(u);i>=0&&n.splice(i,1)}}else c.warn(new Error("Ignoring unknown plugin hook '"+t+"'."))}function C(t){return d[t]||[]}var F={registerHook:p,removeHook:E},A=function(){function t(t){this.performanceInstance=void 0,this.timestamps={},this.registerTiming=void 0,this.registerStartTiming=void 0,this.registerEndTiming=void 0,this.performanceInstance=t,this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g}var e=t.prototype;return e.forceRegisterStartTiming=function(t,e){v.call(this,t,"start",e)},e.forceRegisterEndTiming=function(t,e){v.call(this,t,"end",e)},e.printTimings=function(){var t=this.timestamps,e="";Object.keys(t).forEach((function(u){for(var n=t[u],i=n.length,r=0;r1&&(e+="("+r+")"),e+=" => start: "+o.start+", end: "+o.end+", duration: "+(o.end-o.start)+"\n"}})),c.info(e)},e.disable=function(){this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g},e.enable=function(){this.registerTiming=v,this.registerStartTiming=this.registerStartTiming=m,this.registerEndTiming=this.registerEndTiming=B},e.isEnabled=function(){return this.registerStartTiming===m},t}();function g(){}function v(t,e,u){u||(u=this.performanceInstance.now());var n,i=this.timestamps[t];i||(i=this.timestamps[t]=[]);for(var r=i.length-1;r>=0&&(!(n=i[r])||n[e]);r--)n=null;n||i.push(n={}),n[e]=u}function m(t,e){this.registerTiming(t,"start",e)}function B(t,e){this.registerTiming(t,"end",e)}var y={now:Date.now},w=new A(window&&window.performance||y);w.forceRegisterStartTiming("load_vivliostyle");var N={profiler:{registerStartTiming:w.registerStartTiming,registerEndTiming:w.registerEndTiming,printTimings:w.printTimings,disable:w.disable,enable:w.enable}};function b(t,e){for(var u=0;ut.length)&&(e=t.length);for(var u=0,n=new Array(e);u=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var _=/^(?:[\t-\r -#%-\*,-\/:;\?@\[-\]_\{\}\xA0\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u0300-\u036F\u037E\u0387\u0483-\u0487\u055A-\u055F\u0589\u058A\u0591-\u05C7\u05F3\u05F4\u0609\u060A\u060C\u060D\u0610-\u061B\u061D-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0700-\u070D\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F7-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0830-\u083E\u0859-\u085B\u085E\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0965\u0970\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FD\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A76\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF0\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C77\u0C81\u0C84\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0DF4\u0E31\u0E34-\u0E3A\u0E47-\u0E4F\u0E5A\u0E5B\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u0FD0-\u0FD4\u0FD9\u0FDA\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u104A-\u104F\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u10FB\u135D-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1712-\u1714\u1732\u1733\u1735\u1736\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D6\u17D8-\u17DA\u17DD\u1800-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1944\u1945\u1A17\u1A18\u1A1B\u1A1E\u1A1F\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B5A-\u1B60\u1B6B-\u1B73\u1B7D\u1B7E\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1BFC-\u1BFF\u1C2C-\u1C33\u1C36\u1C37\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD0-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CEF-\u2CF1\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2D7F\u2DE0-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3000-\u3003\u3008-\u3011\u3014-\u301F\u302A-\u302D\u3030\u303D\u3099\u309A\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA66F\uA673-\uA67E\uA69E\uA69F\uA6F0-\uA6F7\uA802\uA806\uA80B\uA825\uA826\uA82C\uA874-\uA877\uA8C4\uA8C5\uA8CE\uA8CF\uA8E0-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA951\uA95F\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9C1-\uA9CD\uA9DE\uA9DF\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA5C-\uAA5F\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAADE\uAADF\uAAEC\uAAED\uAAF0\uAAF1\uAAF6\uABE5\uABE8\uABEB\uABED\uFB1E\uFD3E\uFD3F\uFE00-\uFE19\uFE20-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFEFF\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDDFD\uDEE0\uDF76-\uDF7A\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDE50-\uDE58\uDE7F\uDEE5\uDEE6\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD24-\uDD27\uDEAB-\uDEAD\uDEFD-\uDEFF\uDF46-\uDF50\uDF55-\uDF59\uDF82-\uDF89]|\uD804[\uDC01\uDC38-\uDC4D\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9-\uDCBC\uDCBE-\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD40-\uDD43\uDD73-\uDD75\uDD80\uDD81\uDDB6-\uDDBE\uDDC5-\uDDCD\uDDCF\uDDDB\uDDDD-\uDDDF\uDE2F-\uDE31\uDE34\uDE36-\uDE3E\uDE41\uDEA9\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDCC6\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF-\uDDD7\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F-\uDE43\uDE60-\uDE6C\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDEB9\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B\uDF3C-\uDF3E]|\uD806[\uDC2F-\uDC37\uDC39-\uDC3B\uDD3B\uDD3C\uDD3E\uDD43-\uDD46\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDDE2\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC41-\uDC45\uDC70\uDC71\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDEF7\uDEF8\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDE6E\uDE6F\uDEF0-\uDEF5\uDF30-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDF4F\uDF8F-\uDF92\uDFE2\uDFE4]|\uD82F[\uDC9D-\uDC9F]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD5E\uDD5F]|\uDB40[\uDD00-\uDDEF])*(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\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\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\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\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\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\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\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\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\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\uABF0-\uABF9\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\uFF10-\uFF19\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\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\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\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\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\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\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]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\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\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\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]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*)*/,M="data-adapt-eloff",U={};function V(t){return JSON.parse(t)}function H(t){var e=t.match(/^([^#]*)/);return e?e[1]:t}var z=window.location.href;function G(t){z=t}var W,X=window.location.href;function j(t){X=t}function K(t,e){if(/^data:/i.test(e))return t||e;if(!e||t.match(/^\w{2,}:/))return t.toLowerCase().match("^javascript:")?"#":(t.match(/^\w{2,}:\/\/[^\/]+$/)&&(t+="/"),t);var u;if(e.match(/^\w{2,}:\/\/[^\/]+$/)&&(e+="/"),t.match(/^\/\//))return(u=e.match(/^(\w{2,}:)\/\//))?u[1]+t:t;if(t.match(/^\//))return(u=e.match(/^(\w{2,}:\/\/[^\/]+)\//))?u[1]+t:t;if(t.match(/^\.(\/|$)/)&&(t=t.substr(2)),e=function(t){var e=t.match(/^([^#?]*)/);return e?e[1]:t}(e),t.match(/^#/))return e+t;var n=e.lastIndexOf("/");if(n<0)return t;var i=e.substr(0,n+1)+t,r="";for((u=i.match(/^([^?#]*)([?#].*)$/))&&(i=u[1],r=u[2]);!((n=i.indexOf("/../"))<=0);){var o=i.lastIndexOf("/",n-1);if(o<=0)break;i=i.substr(0,o)+i.substr(n+3)}return i.replace(/\/(\.\/)+/g,"/")+r}function Y(t){var e;return(e=/^(https?:)\/\/github\.com\/([^/]+\/[^/]+)\/(blob\/|tree\/|raw\/)?(.*)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/"+e[2]+"/"+(e[3]?"":"master/")+e[4]:(e=/^(https?:)\/\/www\.aozora\.gr\.jp\/(cards\/[^/]+\/files\/[^/.]+\.html)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/aozorabunko/aozorabunko/master/"+e[2]:(e=/^(https?:)\/\/gist\.github\.com\/([^/]+\/\w+)(\/|$)(raw(\/|$))?(.*)$/.exec(t))?t=e[1]+"//gist.githubusercontent.com/"+e[2]+"/raw/"+e[6]:(e=/^(https?:)\/\/(?:[^/.]+\.)?jsbin\.com\/(?!(?:blog|help)\b)(\w+)((\/\d+)?).*$/.exec(t))&&(t=e[1]+"//output.jsbin.com/"+e[2]+e[3]+"/"),t}function q(t){return null==t?t:t.toString()}!function(t){t.epub="http://www.idpf.org/2007/ops",t.EV="http://www.w3.org/2001/xml-events",t.MATHML="http://www.w3.org/1998/Math/MathML",t.XML="http://www.w3.org/XML/1998/namespace",t.XHTML="http://www.w3.org/1999/xhtml",t.XLINK="http://www.w3.org/1999/xlink",t.SHADOW="http://www.pyroxy.com/ns/shadow",t.SVG="http://www.w3.org/2000/svg",t.DC="http://purl.org/dc/elements/1.1/",t.NCX="http://www.daisy.org/z3986/2005/ncx/"}(W||(W={}));var $=function(){function t(){this.queue=[null]}var e=t.prototype;return e.length=function(){return this.queue.length-1},e.add=function(t){for(var e=this.queue.length;e>1;){var u=Math.floor(e/2),n=this.queue[u];if(n.compare(t)>0)return void(this.queue[e]=t);this.queue[e]=n,e=u}this.queue[1]=t},e.peek=function(){return this.queue[1]},e.remove=function(){var t=this.queue[1],e=this.queue.pop(),u=this.queue.length;if(u>1){for(var n=1;;){var i=2*n;if(i>=u)break;if(this.queue[i].compare(e)>0)i+10&&i++;else{if(!(i+10))break;i++}this.queue[n]=this.queue[i],n=i}this.queue[n]=e}return t},t}(),Q=["","-webkit-","-moz-"],Z={};function J(t,e){return CSS.supports(t+e,"unset")}function tt(t){var e=Z[t];if(e||null===e)return e;switch(t){case"behavior":case"template":case"ua-list-item-count":case"x-first-pseudo":return Z[t]=null,null;case"text-combine-upright":if(J("-webkit-","text-combine")&&!J("","text-combine-upright"))return Z[t]=["-webkit-text-combine"],["-webkit-text-combine"]}for(var u,n=O(Q);!(u=n()).done;){var i=u.value;if(J(i,t))return Z[t]=e=[i+t],e}return c.warn("Property not supported by the browser: ",t),Z[t]=null,null}function et(t,e,u){var n=null==t?void 0:t.style;if(n)if(e.startsWith("--"))n.setProperty(e,u||" ");else{var i=tt(e);if(i)for(var r,o=O(i);!(r=o()).done;){var a=r.value;switch(a){case"-webkit-text-combine":"all"===u&&(u="horizontal");break;case"text-combine-upright":"all"===u&&n.setProperty("text-indent","0")}n.setProperty(a,u)}}}function ut(t,e,u){try{var n=Z[e];return t.style.getPropertyValue(n?n[0]:e)}catch(t){}return u||""}function nt(t){var e=t.getAttributeNS(W.XML,"lang");return e||t.namespaceURI!=W.XHTML||(e=t.getAttribute("lang")),e}var it=function(){function t(){this.list=[]}var e=t.prototype;return e.append=function(t){return this.list.push(t),this},e.clear=function(){this.list=[]},e.toString=function(){var t=this.list.join("");return this.list=[t],t},t}();function rt(t){return"\\"+t.charCodeAt(0).toString(16)+" "}function ot(t){return t.replace(/[^-_a-zA-Z0-9\u0080-\uFFFF]/g,rt)}function at(t){return t.replace(/[\u0000-\u001F"\\]/g,rt)}function st(t){return t.replace(/[\s+&?=#\u007F-\uFFFF]+/g,encodeURIComponent)}function lt(t){return!!t.match(/^[a-zA-Z\u009E\u009F\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F\u037B-\u037D\u0386\u0388-\u0482\u048A-\u0527]$/)}function Dt(t,e){return t.replace(/[^-a-zA-Z0-9_]/g,(function(t){return function(t,e){return(e="string"==typeof e?e:"\\u")+(65536|t.charCodeAt(0)).toString(16).substr(1)}(t,e)}))}function ht(t){return Dt(t)}function ct(t,e){for(var u=0,n=t;;){if(0==u||e(u-1),n==t||e(n),u==n)return u;var i=u+n>>1;e(i)?n=i:u=i+1}}function dt(t,e){return t-e}function ft(t,e){for(var u,n={},i=O(t);!(u=i()).done;){var r=u.value,o=e(r);o&&!n[o]&&(n[o]=r)}return n}function pt(t,e){for(var u,n={},i=O(t);!(u=i()).done;){var r=u.value,o=e(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}var Et=function(){function t(){this.listeners={}}var e=t.prototype;return e.dispatchEvent=function(t){var e=this.listeners[t.type];if(e){t.target=this,t.currentTarget=this;for(var u=0;u=0&&n.splice(i,1)}}},t}();function Ct(t){if(1==t.nodeType){var e=t.getAttribute("id");if(e)return e}return null}function Ft(t){return"^"+t}function At(t){return t.replace(/[\[\]\(\),=;^]/g,Ft)}function gt(t){return t.substr(1)}function vt(t){return t?t.replace(/\^[\[\]\(\),=;^]/g,gt):t}function mt(t){var e=[];do{var u=t.match(/^(\^,|[^,])*/),n=vt(u[0]);if(!(t=t.substr(u[0].length+1))&&!e.length)return n;e.push(n)}while(t);return e}function Bt(t){for(var e={};t;){var u=t.match(/^;([^;=]+)=(([^;]|\^;)*)/);if(!u)return e;e[u[1]]=mt(u[2]),t=t.substr(u[0].length)}return e}var yt=function(){function t(){}var e=t.prototype;return e.appendTo=function(t){t.append("!")},e.applyTo=function(t){return!1},t}(),wt=function(){function t(t,e,u){this.index=void 0,this.id=void 0,this.sideBias=void 0,this.index=t,this.id=e,this.sideBias=u}var e=t.prototype;return e.appendTo=function(t){t.append("/"),t.append(this.index.toString()),(this.id||this.sideBias)&&(t.append("["),this.id&&t.append(this.id),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},e.applyTo=function(t){if(1!=t.node.nodeType)throw new Error("E_CFI_NOT_ELEMENT");var e,u=t.node,n=u.children,i=n.length,r=Math.floor(this.index/2)-1;if(r<0||0==i)t.node=(e=u.firstChild)||u;else{if(e=n[Math.min(r,i-1)],1&this.index){var o=e.nextSibling;o&&1!=o.nodeType?e=o:t.after=!0}t.node=e}if(this.id&&(t.after||this.id!=Ct(t.node))){var a=u.ownerDocument.getElementById(this.id);a?t.node=a:c.warn("E_CFI_ID_MISMATCH:",this.id)}return t.sideBias=this.sideBias,!0},t}(),Nt=function(){function t(t,e,u,n){this.offset=void 0,this.textBefore=void 0,this.textAfter=void 0,this.sideBias=void 0,this.offset=t,this.textBefore=e,this.textAfter=u,this.sideBias=n}var e=t.prototype;return e.applyTo=function(t){if(this.offset>0&&!t.after){for(var e=this.offset,u=t.node;;){var n=u.nodeType;if(1==n)break;var i=u.nextSibling;if(3<=n&&n<=5){var r=u.textContent.length;if(e<=r)break;if(!i){e=r;break}e-=r}if(!i){e=0;break}u=i}t.node=u,t.offset=e}return t.sideBias=this.sideBias,!0},e.appendTo=function(t){t.append(":"),t.append(this.offset.toString()),(this.textBefore||this.textAfter||this.sideBias)&&(t.append("["),(this.textBefore||this.textAfter)&&(this.textBefore&&t.append(At(this.textBefore)),t.append(","),this.textAfter&&t.append(At(this.textAfter))),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},t}(),bt=function(){function t(){this.steps=null}var e=t.prototype;return e.fromString=function(t){var e=t.match(/^#?epubcfi\((.*)\)$/);if(!e)throw new Error("E_CFI_NOT_CFI");for(var u=decodeURIComponent(e[1]),n=0,i=[];;){var r=void 0;switch(u.charAt(n)){case"/":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[(.*?)(;([^\]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var o=parseInt(e[1],10),a=e[3];r=Bt(e[4]),i.push(new wt(o,a,q(r.s)));break;case":":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[((([^\];,]|\^[\];,])*)(,(([^\];,]|\^[\];,])*))?)(;([^]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var s=parseInt(e[1],10),l=e[4];l&&(l=vt(l));var D=e[7];D&&(D=vt(D)),r=Bt(e[10]),i.push(new Nt(s,l,D,q(r.s)));break;case"!":n++,i.push(new yt);break;case"~":case"@":case"":return void(this.steps=i);default:throw new Error("E_CFI_PARSE_ERROR")}}},e.navigate=function(e){for(var u={node:e.documentElement,offset:0,after:!1,sideBias:null,ref:null},n=0;nl&&(e=l),u=!0,o=s.substr(0,e),a=s.substr(e)),t=t.previousSibling;continue;case 8:t=t.previousSibling;continue}break}for((e>0||o||a)&&(o=this.trim(o,!1),a=this.trim(a,!0),i.push(new Nt(e,o,a,n)),n=null);r&&r&&9!=r.nodeType;){for(var D=u?null:Ct(t),h=u?1:0;t;)1==t.nodeType&&(h+=2),t=t.previousSibling;i.push(new wt(h,D,n)),n=null,t=r,r=r.parentNode,u=!1}i.reverse(),this.steps?(i.push(new yt),this.steps=i.concat(this.steps)):this.steps=i},e.toString=function(){if(!this.steps)return"";var t=new it;t.append("epubcfi(");for(var e=0;er?i:r;case"pvw":return u;case"pvh":return n;case"pvi":return this.pageVertical?n:u;case"pvb":return this.pageVertical?u:n;case"pvmin":return un?u:n}}return"em"==t||"rem"==t?e?this.initialFontSize:this.fontSize():"ex"==t?Mt.ex*(e?this.initialFontSize:this.fontSize())/Mt.em:"lh"==t||"rlh"==t?this.rootLineHeight:Mt[t]},e.evalName=function(t,e){do{var u=t.values[e];if(u)return u;if(t.resolver&&(u=t.resolver.call(this,e,!1)))return u;t=t.parent}while(t);throw new Error("Name '"+e+"' is undefined")},e.evalCall=function(t,e,u,n){do{var i=t.funcs[e];if(i)return i;if(t.resolver&&(i=t.resolver.call(this,e,!0)))return i;var r=t.builtIns[e];if(r){if(n)return t.zero;for(var o=Array(u.length),a=0;a=Number(i);case"max":return r<=Number(i);default:return r==i}else if(null!=r&&null==e)return 0!==r;return!1},e.evalSupportsTest=function(t,e,u){return!1},e.queryVal=function(t,e){var u=t&&this.scopes[t.scopeKey];return u?u[e]:void 0},e.storeVal=function(t,e,u){this.getScopeContext(t)[e]=u},t}(),Ht=function(){function t(t){this.scope=void 0,this.key=void 0,this.scope=t,this.scope=t,this.key="_"+Lt++}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,0),t.toString()},e.appendTo=function(t,e){throw new Error("F_ABSTRACT")},e.evaluateCore=function(t){throw new Error("F_ABSTRACT")},e.expand=function(t,e){return this},e.dependCore=function(t,e,u){return t===this},e.dependOuter=function(t,e,u){var n=u[this.key];if(null!=n)return n!==Tt&&n;u[this.key]=Tt;var i=this.dependCore(t,e,u);return u[this.key]=i,i},e.depend=function(t,e){return this.dependOuter(t,e,{})},e.evaluate=function(t){var e=t.queryVal(this.scope,this.key);return void 0!==e||(e=this.evaluateCore(t),this.scope&&t.storeVal(this.scope,this.key,e)),e},e.isMediaName=function(){return!1},t}(),zt=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}x(e,t);var u=e.prototype;return u.getOp=function(){throw new Error("F_ABSTRACT")},u.evalPrefix=function(t){throw new Error("F_ABSTRACT")},u.evaluateCore=function(t){var e=this.val.evaluate(t);return this.evalPrefix(e)},u.dependCore=function(t,e,u){return t===this||this.val.dependOuter(t,e,u)},u.appendTo=function(t,e){10"},u.evalInfix=function(t,e){return t>e},e}(Xt),re=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return">="},u.evalInfix=function(t,e){return t>=e},e}(Xt),oe=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"=="},u.evalInfix=function(t,e){return t==e},e}(Xt),ae=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"!="},u.evalInfix=function(t,e){return t!=e},e}(Xt),se=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"+"},u.evalInfix=function(t,e){return t+e},e}(jt),le=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return" - "},u.evalInfix=function(t,e){return t-e},e}(jt),De=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"*"},u.evalInfix=function(t,e){return t*e},e}(Kt),he=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"/"},u.evalInfix=function(t,e){return t/e},e}(Kt),ce=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"%"},u.evalInfix=function(t,e){return t%e},e}(Kt),de=function(t){function e(e,u,n){var i,r;return(r=t.call(this,e)||this).num=void 0,r.unit=void 0,r.num=u,r.unit=null!=(i=null==n?void 0:n.toLowerCase())?i:"",r}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.num.toString()),t.append(ot(this.unit))},u.evaluateCore=function(t){return this.num*t.queryUnitSize(this.unit,!1)},e}(Ht),fe=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).qualifiedName=void 0,n.qualifiedName=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName)},u.evaluateCore=function(t){return t.evalName(this.scope,this.qualifiedName).evaluate(t)},u.dependCore=function(t,e,u){return t===this||e.evalName(this.scope,this.qualifiedName).dependOuter(t,e,u)},e}(Ht),pe=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).not=void 0,i.name=void 0,i.not=u,i.name=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.not&&t.append("not "),t.append(ot(this.name))},u.evaluateCore=function(t){return t.evalMediaName(this.name,this.not)},u.isMediaName=function(){return!0},e}(Ht),Ee=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).fn=void 0,i.str=void 0,i.fn=u,i.str=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.str)},u.evaluateCore=function(t){return this.fn.call(t)},e}(Ht),Ce=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).qualifiedName=void 0,i.params=void 0,i.qualifiedName=u,i.params=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName),function(t,e){t.append("(");for(var u=0;u0&&t.append("("),this.cond.appendTo(t,0),t.append("?"),this.ifTrue.appendTo(t,0),t.append(":"),this.ifFalse.appendTo(t,0),e>0&&t.append(")")},u.evaluateCore=function(t){return this.cond.evaluate(t)?this.ifTrue.evaluate(t):this.ifFalse.evaluate(t)},u.dependCore=function(t,e,u){return t===this||this.cond.dependOuter(t,e,u)||this.ifTrue.dependOuter(t,e,u)||this.ifFalse.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.cond.expand(t,u),i=this.ifTrue.expand(t,u),r=this.ifFalse.expand(t,u);return n===this.cond&&i===this.ifTrue&&r===this.ifFalse?this:new e(this.scope,n,i,r)},e}(Ht),Ae=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){switch(typeof this.val){case"number":case"boolean":t.append(this.val.toString());break;case"string":t.append('"'),t.append(at(this.val)),t.append('"');break;default:throw new Error("F_UNEXPECTED_STATE")}},u.evaluateCore=function(t){return this.val},e}(Ht),ge=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).name=void 0,i.value=void 0,i.name=u,i.value=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("("),t.append(at(this.name.name)),t.append(":"),this.value.appendTo(t,0),t.append(")")},u.evaluateCore=function(t){return t.evalMediaTest(this.name.name,this.value)},u.dependCore=function(t,e,u){return t===this||this.value.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.value.expand(t,u);return n===this.value?this:new e(this.scope,this.name,n)},e}(Ht),ve=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e)||this).name=void 0,r.value=void 0,r.isFunc=void 0,r.name=u,r.value=n,r.isFunc=i,r}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.isFunc&&t.append(this.name),t.append("("),!this.isFunc&&this.name&&(t.append(this.name),t.append(":")),t.append(this.value),t.append(")")},u.evaluateCore=function(t){return t.evalSupportsTest(this.name,this.value,this.isFunc)},e}(Ht),me=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).index=void 0,n.index=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("$"),t.append(this.index.toString())},u.expand=function(t,e){var u=e[this.index];if(!u)throw new Error("Parameter missing: "+this.index);return u},e}(Ht);function Be(t,e,u){return e===t._false||e===t.zero||u==t._false||u==t.zero?t._false:e===t._true||e===t.one?u:u===t._true||u===t.one?e:new Qt(t,e,u)}function ye(t,e,u){return e===t.zero?u:u===t.zero?e:new se(t,e,u)}function we(t,e,u){return e===t.zero?new $t(t,u):u===t.zero?e:new le(t,e,u)}function Ne(t,e,u){return e===t.zero||u===t.zero?t.zero:e===t.one?u:u===t.one?e:new De(t,e,u)}function be(t,e,u){return e===t.zero?t.zero:u===t.one?e:new he(t,e,u)}var Se=function(){function t(){}var e=t.prototype;return e.visitValues=function(t){for(var e=0;e0){var r;null==(r=e[0])||r.appendTo(t,n);for(var o=1;o2&&t.startsWith("--")}var lu=function(t,e,u,n){this.x1=void 0,this.y1=void 0,this.x2=void 0,this.y2=void 0,this.x1=t,this.y1=e,this.x2=u,this.y2=n},Du=function(t,e){this.x=void 0,this.y=void 0,this.x=t,this.y=e},hu=function(t,e,u,n){this.left=void 0,this.top=void 0,this.right=void 0,this.bottom=void 0,this.left=t,this.top=e,this.right=u,this.bottom=n},cu=function(t,e,u,n){this.low=void 0,this.high=void 0,this.winding=void 0,this.shapeId=void 0,this.low=t,this.high=e,this.winding=u,this.shapeId=n},du=function(t,e,u,n){this.y1=void 0,this.y2=void 0,this.x1=void 0,this.x2=void 0,this.left=null,this.right=null,this.y1=t,this.y2=e,this.x1=u,this.x2=n};function fu(t,e){return t.low.y-e.low.y||t.low.x-e.low.x}var pu=function(){function t(t){this.points=void 0,this.points=t}var e=t.prototype;return e.addSegments=function(t,e){for(var u=this.points,n=u.length,i=u[n-1],r=0;r=n?(o=Au(e,n),a=e.winding):(o=e.high.x,a=0),i=0;){var i=n;((n=e[u]).y2-n.y1<1||n.x1==i.x1&&n.x2==i.x2)&&(i.y1=n.y1,e.splice(u,1),n=i),u--}}function bu(t,e){for(var u=0,n=t.length;u=t[i].y2?u=i+1:n=i}return u}function Su(t,e){if(!t.length)return e;var u,n,i=e.y1;for(n=0;ne.y1&&u.x1-.1<=e.x1&&u.x2+.1>=e.x2);n++)i=Math.max(i,u.y2);for(var r=i;n=e.y2||u.x1-.1>e.x1||u.x2+.1=0&&(u=t[n],!(n===t.length-1&&u.y2=e.x2);n--)i=Math.min(i,u.y1);for(var r=Math.min(i,u.y2);n>=0&&!((u=t[n]).y2<=e.y1||u.x1-.1>e.x1||u.x2+.10){var o=[];switch(this.coords.forEach((function(t,e){if("%"==t.unit){var a=e%2==0?u:n;3==e&&"circle"==r.name&&(a=Math.sqrt((u*u+n*n)/2)),o.push(t.num*a/100)}else o.push(t.num*i.queryUnitSize(t.unit,!1))})),this.name){case"polygon":if(o.length%2==0){for(var a=[],s=0;s0?i[c-1]:-1,p=ca)break;if(d>=o){if(s<0&&(s=d,h=-1),l<0)if(d===o)l=d;else{fa||p<0)&&(s=l=D=h=d)}return n[{first:s,start:l,last:D,"first-except":h}[u]]||""},e.setNamedString=function(t,e,u){(this.namedStringValues[t]||(this.namedStringValues[t]={}))[u]=e},e.setRunningElement=function(t,e){(this.runningElements[t]||(this.runningElements[t]={}))[e]=String(e)},t}(),Gu=function(){function t(t){this.documentURLTransformer=void 0,this.countersById={},this.pageCountersById={},this.currentPageCounters={},this.previousPageCounters={},this.currentPageCountersStack=[],this.pageIndicesById={},this.currentPage=null,this.newReferencesOfCurrentPage=[],this.referencesToSolve=[],this.referencesToSolveStack=[],this.unresolvedReferences={},this.resolvedReferences={},this.pagesCounterExprs=[],this.pageCounterExprs=[],this.documentURLTransformer=t,this.currentPageCounters.page=[0]}var e=t.prototype;return e.createCounterListener=function(t){return new Hu(this,t)},e.createCounterResolver=function(t,e,u){return new zu(this,t,e,u)},e.setCurrentPage=function(t){this.currentPage=t},e.definePageCounter=function(t,e){this.currentPageCounters[t]?this.currentPageCounters[t].push(e):this.currentPageCounters[t]=[e]},e.forceSetPageCounter=function(t){var e=this.currentPageCounters.page;e&&e.length?e[e.length-1]=t:this.currentPageCounters.page=[t]},e.updatePageCounters=function(t,e){var u;this.previousPageCounters=Mu(this.currentPageCounters);var n,i=t["counter-reset"];if(i){var r=i.evaluate(e);r&&(u=Ou(r,!0))}if(u)for(var o in u)this.definePageCounter(o,u[o]);var a=t["counter-increment"];if(a){var s=a.evaluate(e);s&&(n=Ou(s,!1))}for(var l in n?"page"in n||(n.page=1):(n={}).page=1,n){this.currentPageCounters[l]||this.definePageCounter(l,0);var D=this.currentPageCounters[l];D[D.length-1]+=n[l]}},e.pushPageCounters=function(t){this.currentPageCountersStack.push(this.currentPageCounters),this.currentPageCounters=Mu(t)},e.popPageCounters=function(){this.currentPageCounters=this.currentPageCountersStack.pop()},e.resolveReference=function(t){var e=this.unresolvedReferences[t],u=this.resolvedReferences[t];u||(u=this.resolvedReferences[t]=[]);for(var n=!1,i=0;i=0&&e.splice(o,1)}u.push(r),n=!0}else i++}n||this.saveReferenceOfCurrentPage(t,!0)},e.saveReferenceOfCurrentPage=function(t,e){if(!this.newReferencesOfCurrentPage.some((function(e){return e.targetId===t}))){var u=new Vu(t,e);this.newReferencesOfCurrentPage.push(u)}},e.finishPage=function(t,e){var u=this,n=Object.keys(this.currentPage.elementsById);if(n.length>0){var i=Mu(this.currentPageCounters);n.forEach((function(n){u.pageCountersById[n]=i;var r=u.pageIndicesById[n];if(r&&r.pageIndex=0,a=!o&&this.pageCounterExprs.findIndex((function(e){return e.expr===t}))>=0;if(o||a){var s=u.createElementNS(W.XHTML,"span");return s.textContent=e,s.setAttribute(o?Wu:Xu,t.key),s}return null},e.fixPageCounterInRunningElement=function(t){for(var e,u=this,n=function(){var t=e.value,n=t.getAttribute(Xu),i=u.pageCounterExprs.find((function(t){return t.expr.key===n})),r=(null==i?void 0:i.expr).str,o=null==r?void 0:r.replace(/^page-counters?-/,""),a=u.currentPageCounters[o];a&&(t.textContent=i.format(a))},i=O(t.querySelectorAll("["+Xu+"]"));!(e=i()).done;)n()},e.finishLastPage=function(t){for(var e,u=this,n=t.root.querySelectorAll("["+Wu+"]"),i=this.currentPageCounters.page[0],r=function(){var t=e.value,n=t.getAttribute(Wu),r=u.pagesCounterExprs.findIndex((function(t){return t.expr.key===n}));t.textContent=u.pagesCounterExprs[r].format([i])},o=O(n);!(e=o()).done;)r()},e.createLayoutConstraint=function(t){return new ju(this,t)},t}(),Wu="data-vivliostyle-pages-counter",Xu="data-vivliostyle-page-counter",ju=function(){function t(t,e){this.counterStore=void 0,this.pageIndex=void 0,this.counterStore=t,this.pageIndex=e}return t.prototype.allowLayout=function(t){if(!t||t.after)return!0;var e=t.viewNode;if(!e||1!==e.nodeType)return!0;var u=e.getAttribute("data-vivliostyle-id")||e.getAttribute("id")||e.getAttribute("name");if(!u)return!0;if(!this.counterStore.resolvedReferences[u]&&!this.counterStore.unresolvedReferences[u])return!0;var n=this.counterStore.pageIndicesById[u];return!n||this.pageIndex>=n.pageIndex},t}();function Ku(t){if((t=t.substr(1)).match(/^[^0-9a-fA-F\n\r]$/))return t;var e=parseInt(t,16);return isNaN(e)?"":0===e||e>=55296&&e<=57343||e>1114111?"�":String.fromCodePoint(e)}function Yu(t){return t.replace(/\\([0-9a-fA-F]{1,6}(\r\n|[ \n\r\t\f])?|[^0-9a-fA-F\n\r])/g,Ku)}!function(t){t[t.EOF=0]="EOF",t[t.IDENT=1]="IDENT",t[t.STR=2]="STR",t[t.NUMERIC=3]="NUMERIC",t[t.NUM=4]="NUM",t[t.INT=5]="INT",t[t.FUNC=6]="FUNC",t[t.HASH=7]="HASH",t[t.URL=8]="URL",t[t.CLASS=9]="CLASS",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.O_BRC=12]="O_BRC",t[t.C_BRC=13]="C_BRC",t[t.O_BRK=14]="O_BRK",t[t.C_BRK=15]="C_BRK",t[t.COMMA=16]="COMMA",t[t.SEMICOL=17]="SEMICOL",t[t.COLON=18]="COLON",t[t.SLASH=19]="SLASH",t[t.AT=20]="AT",t[t.PERCENT=21]="PERCENT",t[t.QMARK=22]="QMARK",t[t.PLUS=23]="PLUS",t[t.MINUS=24]="MINUS",t[t.BAR_BAR=25]="BAR_BAR",t[t.AMP_AMP=26]="AMP_AMP",t[t.URANGE=27]="URANGE",t[t.BANG=31]="BANG",t[t.DOLLAR=32]="DOLLAR",t[t.HAT=33]="HAT",t[t.BAR=34]="BAR",t[t.TILDE=35]="TILDE",t[t.STAR=36]="STAR",t[t.GT=37]="GT",t[t.LT=38]="LT",t[t.EQ=39]="EQ",t[t.BANG_EQ=41]="BANG_EQ",t[t.DOLLAR_EQ=42]="DOLLAR_EQ",t[t.HAT_EQ=43]="HAT_EQ",t[t.BAR_EQ=44]="BAR_EQ",t[t.TILDE_EQ=45]="TILDE_EQ",t[t.STAR_EQ=46]="STAR_EQ",t[t.GT_EQ=47]="GT_EQ",t[t.LT_EQ=48]="LT_EQ",t[t.EQ_EQ=49]="EQ_EQ",t[t.COL_COL=50]="COL_COL",t[t.CDO=51]="CDO",t[t.CDC=52]="CDC",t[t.UNKNOWN=53]="UNKNOWN",t[t.INVALID=54]="INVALID",t[t.LAST=54]="LAST"}(Uu||(Uu={}));var qu,$u=function(){function t(){this.type=void 0,this.precededBySpace=!1,this.num=0,this.text="",this.position=0,this.type=Uu.EOF}return t.prototype.toString=function(){switch(this.type){case Uu.O_PAR:return"(";case Uu.C_PAR:return")";case Uu.O_BRC:return"{";case Uu.C_BRC:return"}";case Uu.O_BRK:return"[";case Uu.C_BRK:return"]";case Uu.COMMA:return",";case Uu.SEMICOL:return";";case Uu.COLON:return":";case Uu.SLASH:return"/";case Uu.PERCENT:return"%";case Uu.QMARK:return"?";case Uu.PLUS:return"+";case Uu.MINUS:return"-";case Uu.BAR_BAR:return"||";case Uu.AMP_AMP:return"&&";case Uu.BANG:return"!";case Uu.DOLLAR:return"$";case Uu.HAT:return"^";case Uu.BAR:return"|";case Uu.TILDE:return"~";case Uu.STAR:return"*";case Uu.GT:return">";case Uu.LT:return"<";case Uu.EQ:return"=";case Uu.BANG_EQ:return"!=";case Uu.DOLLAR_EQ:return"$=";case Uu.HAT_EQ:return"^=";case Uu.BAR_EQ:return"|=";case Uu.TILDE_EQ:return"~=";case Uu.STAR_EQ:return"*=";case Uu.GT_EQ:return">=";case Uu.LT_EQ:return"<=";case Uu.EQ_EQ:return"==";case Uu.COL_COL:return"::";case Uu.CDO:return"\x3c!--";case Uu.CDC:return"--\x3e";case Uu.NUMERIC:return this.num.toString()+this.text;case Uu.NUM:case Uu.INT:return this.num.toString();case Uu.AT:return"@"+this.text;case Uu.HASH:return"#"+this.text;case Uu.FUNC:return this.text+"(";case Uu.CLASS:return"."+this.text;case Uu.EOF:return"/*EOF*/";default:return this.text}},t}();function Qu(t,e){var u,n=Array(128);for(u=0;u<128;u++)n[u]=t;for(n.NaN=t==qu.END?qu.END:qu.INVALID,u=0;u=e?e+=u:e--,e==t)throw new Error("F_CSSTOK_INTERNAL");for(var n=Zu,i=this.input,r=this.position,o=this.buffer,a=Uu.EOF,s=0,l="",D=0,h=!1,c=o[t],d=-9;;){var f=i.charCodeAt(r);switch(n[f]||n[65]){case qu.INVALID:l=i.substring(s,r),a=isNaN(f)?Uu.EOF:Uu.INVALID,n=Zu;break;case qu.SPACE:r++,h=!0;continue;case qu.INT:s=r++,n=nn;continue;case qu.IDENT:a=Uu.IDENT,s=r++,n=Ju;continue;case qu.BANG:s=r++,a=Uu.BANG,n=an;continue;case qu.STR1:a=Uu.STR,s=++r,n=An;continue;case qu.STR2:a=Uu.STR,s=++r,n=gn;continue;case qu.HASH:s=++r,a=Uu.HASH,n=Ju;continue;case qu.DOLLAR:s=r++,a=Uu.DOLLAR,n=an;continue;case qu.PERCENT:s=r++,a=Uu.PERCENT;break;case qu.AMP:s=r++,a=Uu.DOLLAR,n=Dn;continue;case qu.O_PAR:s=r++,a=Uu.O_PAR;break;case qu.C_PAR:s=r++,a=Uu.C_PAR;break;case qu.STAR:s=r++,a=Uu.STAR,n=an;continue;case qu.PLUS:s=r++,a=Uu.PLUS;break;case qu.COMMA:s=r++,a=Uu.COMMA;break;case qu.MINUS:a=Uu.MINUS,s=r++,n=en;continue;case qu.DOT:s=r++,n=tn;continue;case qu.TOCLASS:s=r++,a=Uu.CLASS,n=Ju;continue;case qu.SLASH:s=r++,a=Uu.SLASH,n=hn;continue;case qu.COLON:s=r++,a=Uu.COLON,n=sn;continue;case qu.COL_COL:r++,a=Uu.COL_COL;break;case qu.SEMICOL:s=r++,a=Uu.SEMICOL;break;case qu.LT:s=r++,a=Uu.LT,n=pn;continue;case qu.EQ:s=r++,a=Uu.EQ,n=an;continue;case qu.GT:s=r++,a=Uu.GT,n=an;continue;case qu.QMARK:s=r++,a=Uu.QMARK;break;case qu.AT:s=++r,a=Uu.AT,n=Ju;continue;case qu.O_BRK:s=r++,a=Uu.O_BRK;break;case qu.C_BRK:s=r++,a=Uu.C_BRK;break;case qu.O_BRC:s=r++,a=Uu.O_BRC;break;case qu.C_BRC:s=r++,a=Uu.C_BRC;break;case qu.BSLASH:d=s=r++,a=Uu.IDENT,n=Fn;continue;case qu.HAT:s=r++,a=Uu.HAT,n=an;continue;case qu.BAR:s=r++,a=Uu.BAR,n=ln;continue;case qu.TILDE:s=r++,a=Uu.TILDE,n=an;continue;case qu.END:break;case qu.EQTAIL:r++,a=a+Uu.BANG_EQ-Uu.BANG;break;case qu.ENDINT:a=Uu.INT,D=parseInt(i.substring(s,r),10);break;case qu.ENDNUM:a=Uu.NUM,D=parseFloat(i.substring(s,r));break;case qu.CONT:r++;continue;case qu.UNIT:a=Uu.NUMERIC,D=parseFloat(i.substring(s,r)),s=r++,n=Ju;continue;case qu.PCUNIT:a=Uu.NUMERIC,D=parseFloat(i.substring(s,r)),l="%",s=r++;break;case qu.NUMBER:r++,n=rn;continue;case qu.ENDIDNT:if(l=Yu(i.substring(s,r)),a===Uu.URANGE&&63===f||a===Uu.IDENT&&"u"===l.toLowerCase()&&/^(\bu\+[?0-9a-f]+(-[?0-9a-f]+)?|,|\s+|\/\*([^*]|\*[^/])*\*\/)+[;}]/i.test(i.substring(r-1))){a=Uu.URANGE,r++;continue}break;case qu.IDNTESC:d=r++,n=Fn;continue;case qu.ENDIDES:l=Yu(i.substring(s,r));break;case qu.ENDSTR:l=i.substring(s,r),r++;break;case qu.ENDESTR:l=Yu(i.substring(s,r)),r++;break;case qu.STR1ESC:d=r,r+=2,n=vn;continue;case qu.STR2ESC:d=r,r+=2,n=mn;continue;case qu.BAR_BAR:r++,a=Uu.BAR_BAR;break;case qu.AMP_AMP:r++,a=Uu.AMP_AMP;break;case qu.FUNC:if(l=i.substring(s,r),a==Uu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Uu.FUNC}break;case qu.FUNCES:if(l=Yu(i.substring(s,r)),a==Uu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Uu.FUNC}break;case qu.COMMENT:n=cn,r++;continue;case qu.COMMST:n=dn,r++;continue;case qu.ENDNOTK:n=Zu,r++;continue;case qu.MINMIN:n=fn,">"!==i[++r]&&(a=Uu.IDENT,n=Ju);continue;case qu.CDO:a=Uu.CDO,l=i.substring(s,++r),n=Zu;break;case qu.CDC:a=Uu.CDC,l=i.substring(s,++r),n=Zu;break;case qu.TOINT:a=Uu.INT,n=nn,r++;continue;case qu.TONUM:a=Uu.NUM,n=rn,r++;continue;case qu.TOIDENT:a=Uu.IDENT,n=Ju,r++;continue;case qu.TOIDES:a=Uu.IDENT,n=Fn,d=r++;continue;case qu.KILL1:r--;break;case qu.KILL2:r-=2;break;case qu.URL:s=r++,n=yn;continue;case qu.URL1:s=++r,n=wn;continue;case qu.URL2:s=++r,n=Nn;continue;case qu.ENDURL:a=Uu.URL,l=Yu(i.substring(s,r)),r++;break;case qu.FINURL:r++;break;case qu.LT_BG:n=En,r++;continue;case qu.LT_BG_M:n=Cn,r++;continue;case qu.CHKSP:if(r-d<8&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])|[ \t]$/)){r++;continue}case qu.TERMURL:a=Uu.URL,l=Yu(i.substring(s,r)),r++,n=bn;continue;case qu.CHKPOSN:if(++r-d<9&&i.substring(d+1,r).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])$/))continue;a=Uu.INVALID,l="E_CSS_UNEXPECTED_NEWLINE",n=Zu;break;case qu.CHKPOSS:if(r-d<9&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}[ \t]$/)){r++,n=Ju;continue}l=Yu(i.substring(s,r));break;case qu.URLESC:d=r++;continue;case qu.IDESCH:r++,n=un;continue;default:if(n!==Zu){a=Uu.INVALID,l="E_CSS_UNEXPECTED_STATE";break}s=r,a=Uu.EOF}if(c.type=a,c.precededBySpace=h,c.num=D,c.text=l,c.position=s,++t>=e)break;n=Zu,h=!1,c=o[t&u]}this.position=r,this.tail=t&u},t}(),xn=null,Tn=null;function In(){return xn}function Pn(t){if(!xn)throw new Error("E_TASK_NO_CONTEXT");xn.name||(xn.name=t);var e=xn,u=new zn(e,e.top,t);return e.top=u,u.state=on.ACTIVE,u}function Rn(t){return new Vn(t)}function kn(t,e,u){var n=Pn(t);n.handler=u;try{e(n)}catch(t){n.task.raise(t,n)}return n.result()}!function(t){t[t.INIT=0]="INIT",t[t.ACTIVE=1]="ACTIVE",t[t.FINISHED=2]="FINISHED",t[t.DEAD=3]="DEAD"}(on||(on={}));var Ln,On=function(){function t(){}var e=t.prototype;return e.currentTime=function(){return(new Date).valueOf()},e.setTimeout=function(t){function e(e,u){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setTimeout(t,e)})),e.clearTimeout=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){clearTimeout(t)})),t}(),_n=function(){function t(t){this.timer=void 0,this.timeout=1,this.slice=25,this.sliceOverTime=0,this.queue=void 0,this.wakeupTime=null,this.timeoutToken=null,this.inTimeSlice=!1,this.order=0,this.timer=t,this.queue=new $,Tn||(Tn=this)}var e=t.prototype;return e.setSlice=function(t){this.slice=t},e.setTimeout=function(t){this.timeout=t},e.isTimeSliceOver=function(){return this.timer.currentTime()>=this.sliceOverTime},e.arm=function(){var t=this;if(!this.inTimeSlice){var e=this.queue.peek().scheduledTime,u=this.timer.currentTime();if(null!=this.timeoutToken){if(u+this.timeout>this.wakeupTime)return;this.timer.clearTimeout(this.timeoutToken)}var n=e-u;n<=this.timeout&&(n=this.timeout),this.wakeupTime=u+n,this.timeoutToken=this.timer.setTimeout((function(){t.timeoutToken=null,t.doTimeSlice()}),n)}},e.schedule=function(t,e){var u=t,n=this.timer.currentTime();u.order=this.order++,u.scheduledTime=n+(e||0),this.queue.add(u),this.arm()},e.doTimeSlice=function(){null!=this.timeoutToken&&(this.timer.clearTimeout(this.timeoutToken),this.timeoutToken=null),this.inTimeSlice=!0;try{var t=this.timer.currentTime();for(this.sliceOverTime=t+this.slice;this.queue.length();){var e=this.queue.peek();if(e.scheduledTime>t)break;if(this.queue.remove(),e.canceled||e.resumeInternal(),(t=this.timer.currentTime())>=this.sliceOverTime)break}}catch(t){c.error(t)}this.inTimeSlice=!1,this.queue.length()&&this.arm()},e.run=function(t,e){var u=new Un(this,e||"");u.top=new zn(u,null,"bootstrap"),u.top.state=on.ACTIVE,u.top.then((function(){var e=function(){u.running=!1;for(var t,e=O(u.callbacks);!(t=e()).done;){var n=t.value;try{n()}catch(t){c.error(t)}}};try{t().then((function(t){u.result=t,e()}))}catch(t){u.raise(t),e()}}));var n=xn;return xn=u,this.schedule(u.top.suspend("bootstrap")),xn=n,u},t}(),Mn=function(){function t(t){this.task=void 0,this.scheduledTime=0,this.order=0,this.result=null,this.canceled=!1,this.task=t}var e=t.prototype;return e.compare=function(t){return t.scheduledTime-this.scheduledTime||t.order-this.order},e.getTask=function(){return this.task},e.schedule=function(t,e){this.result=t,this.task.scheduler.schedule(this,e)},e.resumeInternal=function(){var t=this.task;if(this.task=null,t&&t.continuation==this){t.continuation=null;var e=xn;return xn=t,t.top.finish(this.result),xn=e,!0}return!1},e.cancel=function(){this.canceled=!0},t}(),Un=function(){function t(t,e){this.scheduler=void 0,this.name=void 0,this.callbacks=[],this.exception=null,this.running=!0,this.result=null,this.waitTarget=null,this.top=null,this.continuation=null,this.scheduler=t,this.name=e}var e=t.prototype;return e.getName=function(){return this.name},e.interrupt=function(t){if(this.raise(t||new Error("E_TASK_INTERRUPT")),this!==xn&&this.continuation){this.continuation.cancel();var e=new Mn(this);this.waitTarget="interrupt",this.continuation=e,this.scheduler.schedule(e)}},e.getScheduler=function(){return this.scheduler},e.isRunning=function(){return this.running},e.whenDone=function(t){this.callbacks.push(t)},e.join=function(){var t=this,e=Pn("Task.join");if(this.running){var u=e.suspend(this);this.whenDone((function(){u.schedule(t.result)}))}else e.finish(this.result);return e.result()},e.unwind=function(){for(;this.top&&!this.top.handler;)this.top=this.top.parent;if(this.top&&this.top.handler&&this.exception){var t=this.exception;this.exception=null,this.top.handler(this.top,t)}else this.exception&&c.error(this.exception,"Unhandled exception in task",this.name)},e.raise=function(t,e){if(this.fillStack(t),e){for(var u=this.top;u&&u!=e;)u=u.parent;u==e&&(this.top=u)}this.exception=t,this.unwind()},e.fillStack=function(t){var e=t.frameTrace;if(!e){e=t.stack?t.stack+"\n\t---- async ---\n":"";for(var u=this.top;u;u=u.parent)e+="\t",e+=u.getName(),e+="\n";t.frameTrace=e}},t}(),Vn=function(){function t(t){this.value=void 0,this.value=t}var e=t.prototype;return e.then=function(t){t(this.value)},e.thenAsync=function(t){return t(this.value)},e.thenReturn=function(e){return new t(e)},e.thenFinish=function(t){t.finish(this.value)},e.isPending=function(){return!1},e.get=function(){return this.value},t}(),Hn=function(){function t(t){this.frame=void 0,this.frame=t}var e=t.prototype;return e.then=function(t){this.frame.then(t)},e.thenAsync=function(t){if(this.isPending()){var e=new zn(this.frame.task,this.frame.parent,"AsyncResult.thenAsync");return e.state=on.ACTIVE,this.frame.parent=e,this.frame.then((function(u){t(u).then((function(t){e.finish(t)}))})),e.result()}return t(this.frame.res)},e.thenReturn=function(t){return this.isPending()?this.thenAsync((function(){return new Vn(t)})):new Vn(t)},e.thenFinish=function(t){this.isPending()?this.then((function(e){t.finish(e)})):t.finish(this.frame.res)},e.isPending=function(){return this.frame.state==on.ACTIVE},e.get=function(){if(this.isPending())throw new Error("Result is pending");return this.frame.res},t}(),zn=function(){function t(t,e,u){this.task=void 0,this.parent=void 0,this.name=void 0,this.res=null,this.state=void 0,this.callback=null,this.handler=null,this.task=t,this.parent=e,this.name=u,this.state=on.INIT}var e=t.prototype;return e.checkEnvironment=function(){if(!xn)throw new Error("F_TASK_NO_CONTEXT");if(this!==xn.top)throw new Error("F_TASK_NOT_TOP_FRAME")},e.result=function(){return new Hn(this)},e.finish=function(t){this.checkEnvironment(),xn&&!xn.exception&&(this.res=t),this.state=on.FINISHED;var e=this.parent;if(xn&&(xn.top=e),this.callback){try{this.callback(t)}catch(t){this.task.raise(t,e)}this.state=on.DEAD}},e.getTask=function(){return this.task},e.getName=function(){return this.name},e.getScheduler=function(){return this.task.scheduler},e.then=function(t){switch(this.state){case on.ACTIVE:if(this.callback)throw new Error("F_TASK_FRAME_ALREADY_HAS_CALLBACK");this.callback=t;break;case on.FINISHED:var e=this.task,u=this.parent;try{t(this.res),this.state=on.DEAD}catch(t){this.state=on.DEAD,e.raise(t,u)}break;case on.DEAD:throw new Error("F_TASK_DEAD_FRAME");default:throw new Error("F_TASK_UNEXPECTED_FRAME_STATE "+this.state)}},e.timeSlice=function(){var t=Pn("Frame.timeSlice");return t.getScheduler().isTimeSliceOver()?(c.debug("-- time slice --"),t.suspend().schedule(!0)):t.finish(!0),t.result()},e.sleep=function(t){var e=Pn("Frame.sleep");return e.suspend().schedule(!0,t),e.result()},e.loop=function(t){var e=Pn("Frame.loop");return function u(n){try{for(;n;){var i=t();if(i.isPending())return void i.then(u);i.then((function(t){n=t}))}e.finish(!0)}catch(t){e.task.raise(t,e)}}(!0),e.result()},e.loopWithFrame=function(t){var e=xn;if(!e)throw new Error("E_TASK_NO_CONTEXT");return this.loop((function(){var u;do{var n=new Gn(e,e.top);e.top=n,n.state=on.ACTIVE,t(n),u=n.result()}while(!u.isPending()&&u.get());return u}))},e.suspend=function(t){if(this.checkEnvironment(),this.task.continuation)throw new Error("E_TASK_ALREADY_SUSPENDED");var e=new Mn(this.task);return this.task.continuation=e,xn=null,this.task.waitTarget=t||null,e},t}(),Gn=function(t){function e(e,u){return t.call(this,e,u,"loop")||this}x(e,t);var u=e.prototype;return u.continueLoop=function(){this.finish(!0)},u.breakLoop=function(){this.finish(!1)},e}(zn),Wn=function(){function t(t,e){this.fetch=void 0,this.name=void 0,this.arrived=!1,this.resource=null,this.task=null,this.piggybacks=[],this.fetch=t,this.name=e}var e=t.prototype;return e.start=function(){var t=this;this.task||(this.task=In().getScheduler().run((function(){var e=Pn("Fetcher.run");return t.fetch().then((function(u){var n=t.piggybacks;if(t.arrived=!0,t.resource=u,t.task=null,t.piggybacks=[],n)for(var i=0;i=400&&e)throw new Error((u||"Failed to fetch required resource: "+t)+" ("+s.status+(s.statusText?" "+s.statusText:"")+")");r?(t+="?viv-toc-box",s.url+="?viv-toc-box"):a&&(s.url=t=o),n.parser(s,n).then((function(e){delete n.fetchers[t],n.resources[t]=e,i.finish(e)}))})),i.result()},e.fetch=function(t,e,u){var n=this;if(t=H(t),this.resources[t])return null;var i=this.fetchers[t];return i||(i=new Wn((function(){return n.fetchInner(t,e,u)}),"Fetch "+t),this.fetchers[t]=i,i.start()),i},e.get=function(t){return this.resources[H(t)]},e.delete=function(t){delete this.resources[H(t)]},t}();function ni(t,e){var u=t.responseText;return Rn(u?V(u):null)}function ii(t,e){var u=new Wn((function(){var u=Pn("loadElement"),n=u.suspend(t),i=!1,r=function(t){i||(i=!0,n.schedule(t?t.type:"timeout"))};return t.addEventListener("load",r,!1),t.addEventListener("error",r,!1),t.addEventListener("abort",r,!1),t.namespaceURI==W.SVG?(e&&t.setAttributeNS(W.XLINK,"xlink:href",e),setTimeout(r,300)):"script"===t.localName?setTimeout(r,3e3):e&&(t.src=e),u.result()}),"loadElement "+(e||t.localName));return u.start(),u}var ri,oi=33554432,ai=50331648,si=67108864;!function(t){t.USER_AGENT="UA",t.USER="User",t.AUTHOR="Author"}(ri||(ri={}));var li,Di=function(){function t(t){this.scope=void 0,this.flavor=void 0,this.scope=t,this.flavor=ri.AUTHOR}var e=t.prototype;return e.getCurrentToken=function(){return null},e.getScope=function(){return this.scope},e.error=function(t,e){},e.startStylesheet=function(t){this.flavor=t},e.tagSelector=function(t,e){},e.classSelector=function(t){},e.pseudoclassSelector=function(t,e){},e.pseudoelementSelector=function(t,e){},e.idSelector=function(t){},e.attributeSelector=function(t,e,u,n){},e.descendantSelector=function(){},e.childSelector=function(){},e.adjacentSiblingSelector=function(){},e.followingSiblingSelector=function(){},e.nextSelector=function(){},e.startSelectorRule=function(){},e.startFontFaceRule=function(){},e.startFootnoteRule=function(t){},e.startViewportRule=function(){},e.startDefineRule=function(){},e.startRegionRule=function(){},e.startPageRule=function(){},e.startPageMarginBoxRule=function(t){},e.startWhenRule=function(t){},e.startMediaRule=function(t){this.startWhenRule(t)},e.startFlowRule=function(t){},e.startPageTemplateRule=function(){},e.startPageMasterRule=function(t,e,u){},e.startPartitionRule=function(t,e,u){},e.startPartitionGroupRule=function(t,e,u){},e.startRuleBody=function(){},e.property=function(t,e,u){},e.endRule=function(){},e.startFuncWithSelector=function(t){},e.endFuncWithSelector=function(){},e.pushSelectorText=function(t){},e.getImportantSpecificity=function(){switch(this.flavor){case ri.USER_AGENT:return 0;case ri.USER:return 100663296;default:return 83886080}},e.getBaseSpecificity=function(){switch(this.flavor){case ri.USER_AGENT:return 0;case ri.USER:return 16777216;default:return oi}},t}(),hi=function(t){function e(){var e;return(e=t.call(this,null)||this).stack=[],e.tokenizer=null,e.slave=null,e}x(e,t);var u=e.prototype;return u.pushHandler=function(t){this.stack.push(this.slave),this.slave=t},u.popHandler=function(){this.slave=this.stack.pop()},u.getCurrentToken=function(){return this.tokenizer?this.tokenizer.token():null},u.getScope=function(){return this.slave.getScope()},u.error=function(t,e){this.slave.error(t,e)},u.errorMsg=function(t,e){var u;c.warn(t,null!=(u=null==e?void 0:e.toString())?u:"")},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.stack.length>0&&(this.slave=this.stack[0],this.stack=[]),this.slave.startStylesheet(e)},u.tagSelector=function(t,e){this.slave.tagSelector(t,e)},u.classSelector=function(t){this.slave.classSelector(t)},u.pseudoclassSelector=function(t,e){this.slave.pseudoclassSelector(t,e)},u.pseudoelementSelector=function(t,e){this.slave.pseudoelementSelector(t,e)},u.idSelector=function(t){this.slave.idSelector(t)},u.attributeSelector=function(t,e,u,n){this.slave.attributeSelector(t,e,u,n)},u.descendantSelector=function(){this.slave.descendantSelector()},u.childSelector=function(){this.slave.childSelector()},u.adjacentSiblingSelector=function(){this.slave.adjacentSiblingSelector()},u.followingSiblingSelector=function(){this.slave.followingSiblingSelector()},u.nextSelector=function(){this.slave.nextSelector()},u.startSelectorRule=function(){this.slave.startSelectorRule()},u.startFontFaceRule=function(){this.slave.startFontFaceRule()},u.startFootnoteRule=function(t){this.slave.startFootnoteRule(t)},u.startViewportRule=function(){this.slave.startViewportRule()},u.startDefineRule=function(){this.slave.startDefineRule()},u.startRegionRule=function(){this.slave.startRegionRule()},u.startPageRule=function(){this.slave.startPageRule()},u.startPageMarginBoxRule=function(t){this.slave.startPageMarginBoxRule(t)},u.startWhenRule=function(t){this.slave.startWhenRule(t)},u.startFlowRule=function(t){this.slave.startFlowRule(t)},u.startPageTemplateRule=function(){this.slave.startPageTemplateRule()},u.startPageMasterRule=function(t,e,u){this.slave.startPageMasterRule(t,e,u)},u.startPartitionRule=function(t,e,u){this.slave.startPartitionRule(t,e,u)},u.startPartitionGroupRule=function(t,e,u){this.slave.startPartitionGroupRule(t,e,u)},u.startRuleBody=function(){this.slave.startRuleBody()},u.property=function(t,e,u){this.slave.property(t,e,u)},u.endRule=function(){this.slave.endRule()},u.startFuncWithSelector=function(t){this.slave.startFuncWithSelector(t)},u.endFuncWithSelector=function(){this.slave.endFuncWithSelector()},u.pushSelectorText=function(t){this.slave.pushSelectorText(t)},e}(Di),ci=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).owner=void 0,i.topLevel=void 0,i.depth=0,i.owner=u,i.topLevel=n,u&&(i.flavor=u.flavor),i}x(e,t);var u=e.prototype;return u.getCurrentToken=function(){return this.owner.getCurrentToken()},u.error=function(t,e){this.owner.errorMsg(t,e)},u.startRuleBody=function(){this.depth++},u.endRule=function(){0!=--this.depth||this.topLevel||this.owner.popHandler()},e}(Di),di=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.report=function(t){this.error(t,this.getCurrentToken())},u.reportAndSkip=function(t){this.report(t),this.owner.pushHandler(new ci(this.scope,this.owner,!1))},u.startSelectorRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR")},u.startFontFaceRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_FONT_FACE")},u.startFootnoteRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FOOTNOTE")},u.startViewportRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_VIEWPORT")},u.startDefineRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_DEFINE")},u.startRegionRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_REGION")},u.startPageRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE")},u.startWhenRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_WHEN")},u.startFlowRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FLOW")},u.startPageTemplateRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_TEMPLATE")},u.startPageMasterRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_MASTER")},u.startPartitionRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION")},u.startPartitionGroupRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION_GROUP")},u.startFuncWithSelector=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR_FUNC")},u.endFuncWithSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_END_SELECTOR_FUNC")},u.property=function(t,e,u){this.error("E_CSS_UNEXPECTED_PROPERTY",this.getCurrentToken())},e}(ci),fi=[],pi=[],Ei=[],Ci=[],Fi=[],Ai=[],gi=[],vi=[],mi=[],Bi=[],yi=[],wi=[],Ni=[];!function(t){t[t.SELECTOR_NAME_1=1]="SELECTOR_NAME_1",t[t.SELECTOR_NAME=2]="SELECTOR_NAME",t[t.SELECTOR_ANY_1=3]="SELECTOR_ANY_1",t[t.SELECTOR_ANY=4]="SELECTOR_ANY",t[t.SELECTOR_ID_1=5]="SELECTOR_ID_1",t[t.SELECTOR_ID=6]="SELECTOR_ID",t[t.SELECTOR_CLASS_1=7]="SELECTOR_CLASS_1",t[t.SELECTOR_CLASS=8]="SELECTOR_CLASS",t[t.SELECTOR_ATTR_1=9]="SELECTOR_ATTR_1",t[t.SELECTOR_ATTR=10]="SELECTOR_ATTR",t[t.SELECTOR_CHILD=11]="SELECTOR_CHILD",t[t.SELECTOR_SIBLING=12]="SELECTOR_SIBLING",t[t.SELECTOR_BODY=13]="SELECTOR_BODY",t[t.SELECTOR_PSEUDOCLASS=14]="SELECTOR_PSEUDOCLASS",t[t.VAL_IDENT=15]="VAL_IDENT",t[t.VAL_HASH=16]="VAL_HASH",t[t.VAL_NUM=17]="VAL_NUM",t[t.VAL_INT=18]="VAL_INT",t[t.VAL_NUMERIC=19]="VAL_NUMERIC",t[t.VAL_STR=20]="VAL_STR",t[t.VAL_URL=21]="VAL_URL",t[t.VAL_COMMA=22]="VAL_COMMA",t[t.VAL_SLASH=23]="VAL_SLASH",t[t.VAL_FUNC=24]="VAL_FUNC",t[t.VAL_C_PAR=25]="VAL_C_PAR",t[t.VAL_END=26]="VAL_END",t[t.RULE_END=27]="RULE_END",t[t.IDENT=28]="IDENT",t[t.SELECTOR_START=29]="SELECTOR_START",t[t.AT=30]="AT",t[t.EXPR_IDENT=31]="EXPR_IDENT",t[t.EXPR_NUM=32]="EXPR_NUM",t[t.EXPR_NUMERIC=33]="EXPR_NUMERIC",t[t.EXPR_STR=34]="EXPR_STR",t[t.EXPR_PARAM=35]="EXPR_PARAM",t[t.EXPR_PREFIX=36]="EXPR_PREFIX",t[t.EXPR_INFIX=37]="EXPR_INFIX",t[t.EXPR_FUNC=38]="EXPR_FUNC",t[t.EXPR_C_PAR=39]="EXPR_C_PAR",t[t.EXPR_O_PAR=40]="EXPR_O_PAR",t[t.SELECTOR_NEXT=41]="SELECTOR_NEXT",t[t.SELECTOR_PSEUDOELEM=42]="SELECTOR_PSEUDOELEM",t[t.EXPR_O_BRC=43]="EXPR_O_BRC",t[t.VAL_FINISH=44]="VAL_FINISH",t[t.EXPR_INFIX_NAME=45]="EXPR_INFIX_NAME",t[t.PROP=46]="PROP",t[t.VAL_BANG=47]="VAL_BANG",t[t.VAL_BRC=48]="VAL_BRC",t[t.EXPR_SEMICOL=49]="EXPR_SEMICOL",t[t.ERROR_PUSH=50]="ERROR_PUSH",t[t.ERROR_POP=51]="ERROR_POP",t[t.ERROR_POP_DECL=52]="ERROR_POP_DECL",t[t.ERROR_SEMICOL=53]="ERROR_SEMICOL",t[t.VAL_PLUS=54]="VAL_PLUS",t[t.SELECTOR_PSEUDOCLASS_1=55]="SELECTOR_PSEUDOCLASS_1",t[t.SELECTOR_FOLLOWING_SIBLING=56]="SELECTOR_FOLLOWING_SIBLING",t[t.VAL_URANGE=57]="VAL_URANGE",t[t.SELECTOR_PSEUDOELEM_1=58]="SELECTOR_PSEUDOELEM_1",t[t.DONE=200]="DONE"}(li||(li={}));var bi,Si=Uu.LAST+1,xi=Uu.LAST+2,Ti=Uu.LAST+3;fi[Uu.IDENT]=li.IDENT,fi[Uu.STAR]=li.SELECTOR_START,fi[Uu.HASH]=li.SELECTOR_START,fi[Uu.CLASS]=li.SELECTOR_START,fi[Uu.O_BRK]=li.SELECTOR_START,fi[Uu.COLON]=li.SELECTOR_START,fi[Uu.COL_COL]=li.SELECTOR_START,fi[Uu.AT]=li.AT,fi[Uu.C_BRC]=li.RULE_END,fi[Uu.EOF]=li.DONE,pi[Uu.IDENT]=li.PROP,pi[Uu.EOF]=li.DONE,Ai[Uu.IDENT]=li.SELECTOR_NAME,Ai[Uu.STAR]=li.SELECTOR_ANY,Ai[Uu.HASH]=li.SELECTOR_ID,Ai[Uu.CLASS]=li.SELECTOR_CLASS,Ai[Uu.O_BRK]=li.SELECTOR_ATTR,Ai[Uu.COLON]=li.SELECTOR_PSEUDOCLASS,Ai[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM,Ei[Uu.GT]=li.SELECTOR_CHILD,Ei[Uu.PLUS]=li.SELECTOR_SIBLING,Ei[Uu.TILDE]=li.SELECTOR_FOLLOWING_SIBLING,Ei[Uu.IDENT]=li.SELECTOR_NAME_1,Ei[Uu.STAR]=li.SELECTOR_ANY_1,Ei[Uu.HASH]=li.SELECTOR_ID_1,Ei[Uu.CLASS]=li.SELECTOR_CLASS_1,Ei[Uu.O_BRK]=li.SELECTOR_ATTR_1,Ei[Uu.O_BRC]=li.SELECTOR_BODY,Ei[Uu.COLON]=li.SELECTOR_PSEUDOCLASS_1,Ei[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM_1,Ei[Uu.COMMA]=li.SELECTOR_NEXT,Ci[Uu.GT]=li.SELECTOR_CHILD,Ci[Uu.PLUS]=li.SELECTOR_SIBLING,Ci[Uu.TILDE]=li.SELECTOR_FOLLOWING_SIBLING,Ci[Uu.IDENT]=li.SELECTOR_NAME_1,Ci[Uu.STAR]=li.SELECTOR_ANY_1,Ci[Uu.HASH]=li.SELECTOR_ID_1,Ci[Uu.CLASS]=li.SELECTOR_CLASS_1,Ci[Uu.O_BRK]=li.SELECTOR_ATTR_1,Ci[Uu.COLON]=li.SELECTOR_PSEUDOCLASS_1,Fi[Uu.IDENT]=li.SELECTOR_NAME,Fi[Uu.STAR]=li.SELECTOR_ANY,Fi[Uu.HASH]=li.SELECTOR_ID,Fi[Uu.CLASS]=li.SELECTOR_CLASS,Fi[Uu.COLON]=li.SELECTOR_PSEUDOCLASS,Fi[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM,Fi[Uu.O_BRK]=li.SELECTOR_ATTR,Fi[Uu.O_BRC]=li.SELECTOR_BODY,gi[Uu.IDENT]=li.VAL_IDENT,gi[Uu.HASH]=li.VAL_HASH,gi[Uu.NUM]=li.VAL_NUM,gi[Uu.INT]=li.VAL_INT,gi[Uu.NUMERIC]=li.VAL_NUMERIC,gi[Uu.STR]=li.VAL_STR,gi[Uu.URL]=li.VAL_URL,gi[Uu.URANGE]=li.VAL_URANGE,gi[Uu.COMMA]=li.VAL_COMMA,gi[Uu.SLASH]=li.VAL_SLASH,gi[Uu.FUNC]=li.VAL_FUNC,gi[Uu.C_PAR]=li.VAL_C_PAR,gi[Uu.SEMICOL]=li.VAL_END,gi[Uu.C_BRC]=li.VAL_BRC,gi[Uu.BANG]=li.VAL_BANG,gi[Uu.PLUS]=li.VAL_PLUS,gi[Uu.EOF]=li.VAL_FINISH,vi[Uu.IDENT]=li.EXPR_IDENT,vi[Uu.NUM]=li.EXPR_NUM,vi[Uu.INT]=li.EXPR_NUM,vi[Uu.NUMERIC]=li.EXPR_NUMERIC,vi[Uu.STR]=li.EXPR_STR,vi[Uu.O_PAR]=li.EXPR_O_PAR,vi[Uu.FUNC]=li.EXPR_FUNC,vi[Uu.BANG]=li.EXPR_PREFIX,vi[Uu.MINUS]=li.EXPR_PREFIX,vi[Uu.DOLLAR]=li.EXPR_PARAM,mi[Uu.IDENT]=li.EXPR_INFIX_NAME,mi[Uu.COMMA]=li.EXPR_INFIX,mi[Uu.GT]=li.EXPR_INFIX,mi[Uu.LT]=li.EXPR_INFIX,mi[Uu.GT_EQ]=li.EXPR_INFIX,mi[Uu.LT_EQ]=li.EXPR_INFIX,mi[Uu.EQ]=li.EXPR_INFIX,mi[Uu.EQ_EQ]=li.EXPR_INFIX,mi[Uu.BANG_EQ]=li.EXPR_INFIX,mi[Uu.AMP_AMP]=li.EXPR_INFIX,mi[Uu.BAR_BAR]=li.EXPR_INFIX,mi[Uu.PLUS]=li.EXPR_INFIX,mi[Uu.MINUS]=li.EXPR_INFIX,mi[Uu.SLASH]=li.EXPR_INFIX,mi[Uu.PERCENT]=li.EXPR_INFIX,mi[Uu.STAR]=li.EXPR_INFIX,mi[Uu.COLON]=li.EXPR_INFIX,mi[Uu.QMARK]=li.EXPR_INFIX,mi[Uu.C_PAR]=li.EXPR_C_PAR,mi[Uu.O_BRC]=li.EXPR_O_BRC,mi[Uu.SEMICOL]=li.EXPR_SEMICOL,Bi[Uu.EOF]=li.DONE,Bi[Uu.O_BRC]=li.ERROR_PUSH,Bi[Uu.C_BRC]=li.ERROR_POP,Bi[Uu.O_BRK]=li.ERROR_PUSH,Bi[Uu.C_BRK]=li.ERROR_POP,Bi[Uu.O_PAR]=li.ERROR_PUSH,Bi[Uu.C_PAR]=li.ERROR_POP,Bi[Uu.SEMICOL]=li.ERROR_SEMICOL,yi[Uu.EOF]=li.DONE,yi[Uu.O_BRC]=li.ERROR_PUSH,yi[Uu.C_BRC]=li.ERROR_POP_DECL,yi[Uu.O_BRK]=li.ERROR_PUSH,yi[Uu.C_BRK]=li.ERROR_POP,yi[Uu.O_PAR]=li.ERROR_PUSH,yi[Uu.C_PAR]=li.ERROR_POP,yi[Uu.SEMICOL]=li.ERROR_SEMICOL,wi[Uu.EOF]=li.DONE,wi[Uu.O_BRC]=li.ERROR_PUSH,wi[Uu.C_BRC]=li.ERROR_POP,wi[Uu.O_BRK]=li.ERROR_PUSH,wi[Uu.C_BRK]=li.ERROR_POP,wi[Uu.O_PAR]=li.ERROR_PUSH,wi[Uu.C_PAR]=li.ERROR_POP,Ni[Uu.C_PAR]=0,Ni[Uu.COMMA]=0,Ni[Uu.QMARK]=1,Ni[Uu.COLON]=1,Ni[Uu.AMP_AMP]=2,Ni[Uu.BAR_BAR]=2,Ni[Uu.LT]=3,Ni[Uu.GT]=3,Ni[Uu.LT_EQ]=3,Ni[Uu.GT_EQ]=3,Ni[Uu.EQ]=3,Ni[Uu.EQ_EQ]=3,Ni[Uu.BANG_EQ]=3,Ni[Uu.PLUS]=4,Ni[Uu.MINUS]=4,Ni[Uu.STAR]=5,Ni[Uu.SLASH]=5,Ni[Uu.PERCENT]=5,Ni[Uu.EOF]=6,Ni[Si]=2,Ni[xi]=2,function(t){t[t.PROP=0]="PROP",t[t.WHEN=1]="WHEN",t[t.MEDIA=2]="MEDIA",t[t.IMPORT=3]="IMPORT",t[t.SUPPORTS=4]="SUPPORTS"}(bi||(bi={}));var Ii=function(){function t(t,e,u,n){this.actions=void 0,this.tokenizer=void 0,this.handler=void 0,this.baseURL=void 0,this.valStack=[],this.namespacePrefixToURI={},this.defaultNamespaceURI=null,this.propName=null,this.propImportant=!1,this.exprContext=void 0,this.result=null,this.importReady=!1,this.importURL=null,this.importCondition=null,this.errorBrackets=[],this.ruleStack=[],this.regionRule=!1,this.pageRule=!1,this.inStyleDeclaration=!1,this.actions=t,this.tokenizer=e,this.handler=u,this.baseURL=n,this.exprContext=bi.MEDIA}var e=t.prototype;return e.extractVals=function(t,e){for(var u=[],n=this.valStack;e1&&n.splice(i+1,o,new je(n.slice(i+1,n.length))),","==t)return null;i++;do{u=n[--i]}while(void 0!==u&&("string"!=typeof u||","==u));if(o=n.length-(i+1),"("==u){")"!=t&&e.type!==Uu.EOF&&(this.handler.error("E_CSS_MISMATCHED_C_PAR",e),this.actions=yi);var a=new Ye(n[i-1],this.extractVals(",",i+1));if(n.splice(i-1,o+2,a),"var"===a.name){var s=a.values[0]instanceof _e&&a.values[0].name;su(s)&&s!==this.propName||(this.handler.error("E_CSS_INVALID_VAR "+a.toString(),e),this.actions=yi)}return a}if(";"!=t||i>=0)return this.handler.error("E_CSS_UNEXPECTED_VAL_END",e),this.actions=yi,null;if(o>1)return new Ke(this.extractVals(",",i+1));var l=n[0];return l instanceof Te?l:l?new $e(l.toString()):Pe},e.exprError=function(t,e){this.actions=this.propName?yi:Bi,c.warn(t,e.toString())},e.exprStackReduce=function(t,e){for(var u,n=this.valStack,i=this.handler,r=n.pop();;){var o=n.pop();if(t==Uu.C_PAR){for(var a=[r];o==Uu.COMMA;)a.unshift(n.pop()),o=n.pop();if("string"==typeof o){if("{"==o){for(;a.length>=2;){var s=a.shift(),l=a.shift(),D=new te(i.getScope(),s,l);a.unshift(D)}return n.push(new qe(a[0])),!0}if("("==o){var h=n.pop(),c=n.pop();r=new Ce(i.getScope(),kt(c,h),a),t=Uu.EOF;continue}}if(o==Uu.O_PAR){r.isMediaName()&&(r=new ge(i.getScope(),r,null)),t=Uu.EOF;continue}}else if("string"==typeof o){n.push(o);break}if(o<0)if(o==-Uu.BANG)r=new Yt(i.getScope(),r);else if(o==-Uu.MINUS)r=new $t(i.getScope(),r);else{if(o!=-Ti)return this.exprError("F_UNEXPECTED_STATE",e),!1;r=new qt(i.getScope(),r)}else{if(Ni[t]>Ni[o]){n.push(o);break}switch(u=n.pop(),o){case Uu.AMP_AMP:r=new Qt(i.getScope(),u,r);break;case Si:r=new Zt(i.getScope(),u,r);break;case xi:r=new ee(i.getScope(),u,r);break;case Uu.BAR_BAR:r=new Jt(i.getScope(),u,r);break;case Uu.LT:r=new ue(i.getScope(),u,r);break;case Uu.GT:r=new ie(i.getScope(),u,r);break;case Uu.LT_EQ:r=new ne(i.getScope(),u,r);break;case Uu.GT_EQ:r=new re(i.getScope(),u,r);break;case Uu.EQ:case Uu.EQ_EQ:r=new oe(i.getScope(),u,r);break;case Uu.BANG_EQ:r=new ae(i.getScope(),u,r);break;case Uu.PLUS:r=new se(i.getScope(),u,r);break;case Uu.MINUS:r=new le(i.getScope(),u,r);break;case Uu.STAR:r=new De(i.getScope(),u,r);break;case Uu.SLASH:r=new he(i.getScope(),u,r);break;case Uu.PERCENT:r=new ce(i.getScope(),u,r);break;case Uu.COLON:if(!(n.length>1))return this.exprError("E_CSS_EXPR_COND",e),!1;switch(n[n.length-1]){case Uu.QMARK:n.pop(),r=new Fe(i.getScope(),n.pop(),u,r);break;case Uu.O_PAR:if(!u.isMediaName())return this.exprError("E_CSS_MEDIA_TEST",e),!1;r=new ge(i.getScope(),u,r)}break;case Uu.QMARK:if(t!=Uu.COLON)return this.exprError("E_CSS_EXPR_COND",e),!1;case Uu.O_PAR:return n.push(u),n.push(o),n.push(r),!1;default:return this.exprError("F_UNEXPECTED_STATE",e),!1}}}return n.push(r),!1},e.readSupportsTest=function(t){var e,u,n=t.type===Uu.FUNC,i=this.tokenizer;if(n)e=t.position+(u=t.text).length+1;else{if(t.type!==Uu.O_PAR)return null;var r=i.nthToken(1),o=i.nthToken(2);if(r.type===Uu.IDENT&&o.type===Uu.COLON)i.consume(),i.consume(),u=r.text,e=o.position+1;else{if(r.type===Uu.O_PAR||r.type===Uu.FUNC||r.type===Uu.IDENT&&"not"===r.text.toLowerCase()&&(o.type===Uu.O_PAR||o.type===Uu.FUNC))return null;e=t.position+1}}for(var a,s=0,l=0;s>=0;)switch(i.consume(),(a=i.token()).type){case Uu.C_PAR:s--;break;case Uu.O_PAR:case Uu.FUNC:s++;break;case Uu.COMMA:0===s&&l++;break;case Uu.EOF:return this.exprError("E_CSS_UNEXPECTED_EOF",a),null}i.consume();var D=n&&"selector"===u&&l>0?"":i.input.substring(e,a.position).trim();return new ve(this.handler.getScope(),u,D,n)},e.readPseudoParams=function(){for(var t=[];;){var e=this.tokenizer.token();switch(e.type){case Uu.IDENT:t.push(e.text);break;case Uu.PLUS:t.push("+");break;case Uu.NUM:case Uu.INT:t.push(e.num);break;default:return t}this.tokenizer.consume()}},e.readNthPseudoParams=function(){var t=!1,e=this.tokenizer.token();if(e.type===Uu.PLUS)t=!0,this.tokenizer.consume(),e=this.tokenizer.token();else if(e.type===Uu.IDENT&&("even"===e.text||"odd"===e.text))return this.tokenizer.consume(),[2,"odd"===e.text?1:0];switch(e.type){case Uu.NUMERIC:if(t&&e.num<0)return null;case Uu.IDENT:if(t&&"-"===e.text.charAt(0))return null;if("n"===e.text||"-n"===e.text){if(t&&e.precededBySpace)return null;var u="-n"===e.text?-1:1;e.type===Uu.NUMERIC&&(u=e.num);var n=0;this.tokenizer.consume();var i=(e=this.tokenizer.token()).type===Uu.MINUS,r=e.type===Uu.PLUS||i;if(r&&(this.tokenizer.consume(),e=this.tokenizer.token()),e.type===Uu.INT){if(1/(n=e.num)==-1/0){if(n=0,r)return null}else if(n<0){if(r)return null}else if(n>=0&&!r)return null;this.tokenizer.consume()}else if(r)return null;return[u,i&&n>0?-n:n]}if("n-"===e.text||"-n-"===e.text){if(t&&e.precededBySpace)return null;var o="-n-"===e.text?-1:1;if(e.type===Uu.NUMERIC&&(o=e.num),this.tokenizer.consume(),(e=this.tokenizer.token()).type===Uu.INT)return e.num<0||1/e.num==-1/0?null:(this.tokenizer.consume(),[o,e.num])}else{var a=e.text.match(/^n(-[0-9]+)$/);if(a)return t&&e.precededBySpace?null:(this.tokenizer.consume(),[e.type===Uu.NUMERIC?e.num:1,parseInt(a[1],10)]);if(a=e.text.match(/^-n(-[0-9]+)$/))return this.tokenizer.consume(),[-1,parseInt(a[1],10)]}return null;case Uu.INT:return t&&(e.precededBySpace||e.num<0)?null:(this.tokenizer.consume(),[0,e.num])}return null},e.makeCondition=function(t,e){var u=this.handler.getScope();if(!u)return null;if(e=e||u._true,t)for(var n,i=O(t.split(/\s+/));!(n=i()).done;)switch(n.value){case"vertical":e=Be(u,e,new Yt(u,new fe(u,"pref-horizontal")));break;case"horizontal":e=Be(u,e,new fe(u,"pref-horizontal"));break;case"day":e=Be(u,e,new Yt(u,new fe(u,"pref-night-mode")));break;case"night":e=Be(u,e,new fe(u,"pref-night-mode"));break;default:e=u._false}return e===u._true?null:new qe(e)},e.isInsidePropertyOnlyRule=function(){switch(this.ruleStack[this.ruleStack.length-1]){case"[selector]":case"font-face":case"-epubx-flow":case"-epubx-viewport":case"-epubx-define":case"-adapt-footnote-area":return!0}return!1},e.runParser=function(t,e,u,n,i,r){var o,a,s,l,D,h,c,d=this.handler,f=this.tokenizer,p=this.valStack,E=null;for(u&&(this.inStyleDeclaration=!0),n&&(this.exprContext=bi.MEDIA,this.valStack.push("{"));t>0;--t)if(o=f.token(),i&&null===E&&"("===f.input[E=o.position-1]&&E++,this.actions===gi&&this.errorBrackets.length>0&&(o.type===this.errorBrackets[this.errorBrackets.length-1]||o.type===Uu.SEMICOL||o.type===Uu.BANG)){if(o.type===this.errorBrackets[this.errorBrackets.length-1]&&(this.errorBrackets.pop(),o.type===Uu.C_PAR&&this.valStackReduce(")",o))){f.consume();continue}p.push(new $e(o.toString())),f.consume()}else switch(this.actions[o.type]){case li.IDENT:if(!this.inStyleDeclaration||f.nthToken(1).type!=Uu.COLON){this.isInsidePropertyOnlyRule()?(d.error("E_CSS_COLON_EXPECTED",f.nthToken(1)),this.actions=yi):(this.actions=Ai,d.startSelectorRule());continue}this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gi,p.splice(0,p.length);continue;case li.PROP:if(f.nthToken(1).type!=Uu.COLON){this.actions=yi,d.error("E_CSS_COLON_EXPECTED",f.nthToken(1));continue}this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gi,p.splice(0,p.length);continue;case li.SELECTOR_START:this.actions=Ai,d.startSelectorRule();continue;case li.SELECTOR_NAME_1:if(!o.precededBySpace){this.actions=wi,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case li.SELECTOR_NAME:if(f.nthToken(1).type==Uu.BAR)if(f.consume(),f.consume(),null!=(s=this.namespacePrefixToURI[o.text]))switch((o=f.token()).type){case Uu.IDENT:d.tagSelector(s,o.text),this.actions=i?Ci:Ei,f.consume();break;case Uu.STAR:d.tagSelector(s,null),this.actions=i?Ci:Ei,f.consume();break;default:this.actions=Bi,d.error("E_CSS_NAMESPACE",o)}else this.actions=Bi,d.error("E_CSS_UNDECLARED_PREFIX",o);else d.tagSelector(this.defaultNamespaceURI,o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_ANY_1:if(!o.precededBySpace){this.actions=wi,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case li.SELECTOR_ANY:if(f.nthToken(1).type==Uu.BAR)switch(f.consume(),f.consume(),(o=f.token()).type){case Uu.IDENT:d.tagSelector(null,o.text),this.actions=i?Ci:Ei,f.consume();break;case Uu.STAR:d.tagSelector(null,null),this.actions=i?Ci:Ei,f.consume();break;default:this.actions=Bi,d.error("E_CSS_NAMESPACE",o)}else d.tagSelector(this.defaultNamespaceURI,null),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_ID_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_ID:if(!o.text){d.error("E_CSS_SYNTAX",o),f.consume();continue}d.idSelector(o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_CLASS_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_CLASS:d.classSelector(o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_PSEUDOCLASS_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_PSEUDOCLASS:f.consume();t:switch((o=f.token()).type){case Uu.IDENT:d.pseudoclassSelector(o.text,null),f.consume(),this.actions=i?Ci:Ei;continue;case Uu.FUNC:switch(l=o.text,f.consume(),l){case"is":case"not":case"where":case"has":this.actions=Ai,d.startFuncWithSelector(l),this.actions=this.runParser(Number.POSITIVE_INFINITY,!1,!1,!1,!0,"has"===l)?Ei:wi;continue;case"lang":case"href-epub-type":if((o=f.token()).type===Uu.IDENT){c=[o.text],f.consume();break}break t;case"nth-child":case"nth-of-type":case"nth-last-child":case"nth-last-of-type":case"nth":if(c=this.readNthPseudoParams())break;break t;default:c=this.readPseudoParams()}if((o=f.token()).type==Uu.C_PAR){d.pseudoclassSelector(l,c),f.consume(),this.actions=i?Ci:Ei;continue}}d.error("E_CSS_PSEUDOCLASS_SYNTAX",o),this.actions=Bi;continue;case li.SELECTOR_PSEUDOELEM_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_PSEUDOELEM:switch(f.consume(),(o=f.token()).type){case Uu.IDENT:d.pseudoelementSelector(o.text,null),this.actions=i?Ci:Ei,f.consume();continue;case Uu.FUNC:if(l=o.text,f.consume(),"nth-fragment"==l){if(null===(c=this.readNthPseudoParams()))break}else c=this.readPseudoParams();if((o=f.token()).type==Uu.C_PAR){d.pseudoelementSelector(l,c),this.actions=i?Ci:Ei,f.consume();continue}}d.error("E_CSS_PSEUDOELEM_SYNTAX",o),this.actions=Bi;continue;case li.SELECTOR_ATTR_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_ATTR:if(f.consume(),(o=f.token()).type==Uu.IDENT)l=o.text,f.consume();else if(o.type==Uu.STAR)l=null,f.consume();else{if(o.type!=Uu.BAR){this.actions=wi,d.error("E_CSS_ATTR",o),f.consume();continue}l=""}if((o=f.token()).type==Uu.BAR){if(null==(s=l?this.namespacePrefixToURI[l]:l)){this.actions=wi,d.error("E_CSS_UNDECLARED_PREFIX",o),f.consume();continue}if(f.consume(),(o=f.token()).type!=Uu.IDENT){this.actions=wi,d.error("E_CSS_ATTR_NAME_EXPECTED",o);continue}l=o.text,f.consume(),o=f.token()}else s="";switch(o.type){case Uu.EQ:case Uu.TILDE_EQ:case Uu.BAR_EQ:case Uu.HAT_EQ:case Uu.DOLLAR_EQ:case Uu.STAR_EQ:case Uu.COL_COL:D=o.type,f.consume(),o=f.token();break;case Uu.C_BRK:d.attributeSelector(s,l,Uu.EOF,null),this.actions=i?Ci:Ei,f.consume();continue;default:this.actions=wi,d.error("E_CSS_ATTR_OP_EXPECTED",o);continue}switch(o.type){case Uu.IDENT:case Uu.STR:d.attributeSelector(s,l,D,o.text),f.consume(),o=f.token();break;default:this.actions=wi,d.error("E_CSS_ATTR_VAL_EXPECTED",o);continue}if(o.type!=Uu.C_BRK){this.actions=wi,d.error("E_CSS_ATTR",o);continue}this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_CHILD:d.childSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_SIBLING:d.adjacentSiblingSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_FOLLOWING_SIBLING:d.followingSiblingSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_BODY:this.regionRule?(this.ruleStack.push("-epubx-region"),this.regionRule=!1):this.pageRule?(this.ruleStack.push("page"),this.pageRule=!1,this.inStyleDeclaration=!0):(this.ruleStack.push("[selector]"),this.inStyleDeclaration=!0),d.startRuleBody(),this.actions=fi,f.consume();continue;case li.SELECTOR_NEXT:d.nextSelector(),this.actions=Ai,f.consume();continue;case li.VAL_IDENT:p.push(Me(o.text)),f.consume();continue;case li.VAL_HASH:D=parseInt(o.text,16),p.push(new ze(o.text)),f.consume();continue;case li.VAL_NUM:p.push(new Ve(o.num)),f.consume();continue;case li.VAL_INT:p.push(new He(o.num)),f.consume();continue;case li.VAL_NUMERIC:p.push(new Ue(o.num,o.text)),f.consume();continue;case li.VAL_STR:p.push(new Le(o.text)),f.consume();continue;case li.VAL_URL:p.push(new Ge(K(o.text,this.baseURL))),f.consume();continue;case li.VAL_URANGE:p.push(new We(o.text)),f.consume();continue;case li.VAL_COMMA:this.valStackReduce(",",o),p.push(","),f.consume();continue;case li.VAL_SLASH:p.push(ke),f.consume();continue;case li.VAL_FUNC:"-epubx-expr"==(l=o.text.toLowerCase())||"env"==l?(this.actions=vi,this.exprContext=bi.PROP,p.push("{")):(p.push(l),p.push("("),this.errorBrackets.length>0&&this.errorBrackets.push(Uu.C_PAR)),f.consume();continue;case li.VAL_C_PAR:this.valStackReduce(")",o),f.consume();continue;case li.VAL_BANG:if(f.consume(),o=f.token(),a=f.nthToken(1),o.type==Uu.IDENT&&"important"==o.text.toLowerCase()&&(a.type==Uu.SEMICOL||a.type==Uu.EOF||a.type==Uu.C_BRC)){f.consume(),this.propImportant=!0;continue}this.exprError("E_CSS_SYNTAX",o);continue;case li.VAL_PLUS:switch((a=f.nthToken(1)).type){case Uu.NUM:case Uu.NUMERIC:case Uu.INT:if(!a.precededBySpace){f.consume();continue}}p.push(new $e("+")),f.consume();continue;case li.VAL_END:f.consume();case li.VAL_BRC:(h=this.valStackReduce(";",o))&&this.propName&&d.property(this.propName,h,this.propImportant),this.actions=u?pi:fi;continue;case li.VAL_FINISH:for(f.consume();p.length>0;){var C=p.length;if(!(h=this.valStackReduce(";",o))||p.length===C)break}return e?(this.result=h,!0):(this.propName&&h&&d.property(this.propName,h,this.propImportant),!0);case li.EXPR_IDENT:if((a=f.nthToken(1)).type==Uu.CLASS)f.nthToken(2).type!=Uu.O_PAR||f.nthToken(2).precededBySpace?(p.push(new fe(d.getScope(),kt(o.text,a.text))),this.actions=mi):(p.push(o.text,a.text,"("),f.consume()),f.consume();else{if(this.exprContext==bi.MEDIA||this.exprContext==bi.IMPORT)"not"==o.text.toLowerCase()?(f.consume(),p.push(new pe(d.getScope(),!0,a.text))):("only"==o.text.toLowerCase()&&(f.consume(),o=a),p.push(new pe(d.getScope(),!1,o.text)));else{if(this.exprContext===bi.SUPPORTS&&"not"===o.text.toLowerCase()&&p[p.length-1]!==Si&&p[p.length-1]!==xi&&(a.type===Uu.O_PAR||a.type===Uu.FUNC)){p.push(-Ti),f.consume();continue}p.push(new fe(d.getScope(),o.text))}this.actions=mi}f.consume();continue;case li.EXPR_FUNC:if(this.exprContext===bi.SUPPORTS){p.push(this.readSupportsTest(o)),this.actions=mi;continue}p.push(null,o.text,"("),f.consume();continue;case li.EXPR_NUM:p.push(new Ae(d.getScope(),o.num)),f.consume(),this.actions=mi;continue;case li.EXPR_NUMERIC:"%"==(l=o.text)&&(l=this.propName&&this.propName.match(/height|^(top|bottom)$/)?"vh":"vw"),p.push(new de(d.getScope(),o.num,l)),f.consume(),this.actions=mi;continue;case li.EXPR_STR:p.push(new Ae(d.getScope(),o.text)),f.consume(),this.actions=mi;continue;case li.EXPR_PARAM:f.consume(),(o=f.token()).type!=Uu.INT||o.precededBySpace?this.exprError("E_CSS_SYNTAX",o):(p.push(new me(d.getScope(),o.num)),f.consume(),this.actions=mi);continue;case li.EXPR_PREFIX:p.push(-o.type),f.consume();continue;case li.EXPR_INFIX:this.actions=vi,this.exprStackReduce(o.type,o),p.push(o.type),f.consume();continue;case li.EXPR_INFIX_NAME:"and"===o.text.toLowerCase()&&p[p.length-2]!==xi&&p[p.length-2]!==-Ti?(this.actions=vi,this.exprStackReduce(Si,o),p.push(Si),f.consume()):"or"===o.text.toLowerCase()&&p[p.length-2]!==Si&&p[p.length-2]!==-Ti?(this.actions=vi,this.exprStackReduce(xi,o),p.push(xi),f.consume()):this.exprError("E_CSS_SYNTAX",o);continue;case li.EXPR_C_PAR:this.exprStackReduce(o.type,o)&&(this.actions=gi),f.consume();continue;case li.EXPR_O_BRC:this.exprStackReduce(Uu.C_PAR,o)&&(this.propName||this.exprContext==bi.IMPORT?this.exprError("E_CSS_UNEXPECTED_BRC",o):(this.exprContext==bi.WHEN?d.startWhenRule(p.pop()):d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=fi)),f.consume();continue;case li.EXPR_SEMICOL:if(this.exprStackReduce(Uu.C_PAR,o))return this.propName||this.exprContext!=bi.IMPORT?(this.exprError("E_CSS_UNEXPECTED_SEMICOL",o),this.actions=fi,f.consume(),!1):(this.importCondition=p.pop(),this.importReady=!0,this.actions=fi,f.consume(),!1);f.consume();continue;case li.EXPR_O_PAR:if(this.exprContext===bi.SUPPORTS){var F=this.readSupportsTest(o);if(F){p.push(F),this.actions=mi;continue}}p.push(o.type),f.consume();continue;case li.RULE_END:if(this.actions=fi,f.consume(),d.endRule(),this.inStyleDeclaration=!1,this.ruleStack.length)switch(this.ruleStack.pop(),this.ruleStack[this.ruleStack.length-1]){case"page":case"-epubx-page-master":case"-epubx-partition-group":this.inStyleDeclaration=!0}continue;case li.AT:switch(l=o.text.toLowerCase()){case"import":if(f.consume(),(o=f.token()).type==Uu.STR||o.type==Uu.URL){if(this.importURL=o.text,f.consume(),(o=f.token()).type==Uu.SEMICOL||o.type==Uu.EOF)return this.importReady=!0,f.consume(),!1;this.propName=null,this.exprContext=bi.IMPORT,this.actions=vi,p.push("{");continue}d.error("E_CSS_IMPORT_SYNTAX",o),this.actions=Bi;continue;case"namespace":switch(f.consume(),(o=f.token()).type){case Uu.IDENT:if(l=o.text,f.consume(),((o=f.token()).type==Uu.STR||o.type==Uu.URL)&&f.nthToken(1).type==Uu.SEMICOL){this.namespacePrefixToURI[l]=o.text,f.consume(),f.consume();continue}break;case Uu.STR:case Uu.URL:if(f.nthToken(1).type==Uu.SEMICOL){this.defaultNamespaceURI=o.text,f.consume(),f.consume();continue}}d.error("E_CSS_NAMESPACE_SYNTAX",o),this.actions=Bi;continue;case"charset":if(f.consume(),(o=f.token()).type==Uu.STR&&f.nthToken(1).type==Uu.SEMICOL){"utf-8"!=(l=o.text.toLowerCase())&&"utf-16"!=l&&d.error("E_CSS_UNEXPECTED_CHARSET "+l,o),f.consume(),f.consume();continue}d.error("E_CSS_CHARSET_SYNTAX",o),this.actions=Bi;continue;case"font-face":case"-epubx-page-template":case"-epubx-define":case"-epubx-viewport":if(f.nthToken(1).type==Uu.O_BRC){switch(f.consume(),f.consume(),l){case"font-face":d.startFontFaceRule(),this.inStyleDeclaration=!0;break;case"-epubx-page-template":d.startPageTemplateRule();break;case"-epubx-define":d.startDefineRule(),this.inStyleDeclaration=!0;break;case"-epubx-viewport":d.startViewportRule(),this.inStyleDeclaration=!0}this.ruleStack.push(l),d.startRuleBody();continue}break;case"-adapt-footnote-area":switch(f.consume(),(o=f.token()).type){case Uu.O_BRC:f.consume(),d.startFootnoteRule(null),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue;case Uu.COL_COL:if(f.consume(),(o=f.token()).type==Uu.IDENT&&f.nthToken(1).type==Uu.O_BRC){l=o.text,f.consume(),f.consume(),d.startFootnoteRule(l),this.ruleStack.push("-adapt-footnote-area"),d.startRuleBody(),this.inStyleDeclaration=!0;continue}}break;case"-epubx-region":f.consume(),d.startRegionRule(),this.regionRule=!0,this.actions=Ai;continue;case"page":f.consume(),d.startPageRule(),this.pageRule=!0,this.actions=Fi;continue;case"top-left-corner":case"top-left":case"top-center":case"top-right":case"top-right-corner":case"right-top":case"right-middle":case"right-bottom":case"bottom-right-corner":case"bottom-right":case"bottom-center":case"bottom-left":case"bottom-left-corner":case"left-bottom":case"left-middle":case"left-top":if(f.consume(),(o=f.token()).type==Uu.O_BRC){f.consume(),d.startPageMarginBoxRule(l),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"-epubx-when":f.consume(),this.propName=null,this.exprContext=bi.WHEN,this.actions=vi,p.push("{");continue;case"media":f.consume(),this.propName=null,this.exprContext=bi.MEDIA,this.actions=vi,p.push("{");continue;case"supports":f.consume(),this.propName=null,this.exprContext=bi.SUPPORTS,this.actions=vi,p.push("{");continue;case"-epubx-flow":if(f.nthToken(1).type==Uu.IDENT&&f.nthToken(2).type==Uu.O_BRC){d.startFlowRule(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"-epubx-page-master":case"-epubx-partition":case"-epubx-partition-group":f.consume();var A=null,g=null,v=[];for((o=f.token()).type==Uu.IDENT&&(A=o.text,f.consume(),o=f.token()),o.type==Uu.COLON&&f.nthToken(1).type==Uu.IDENT&&(g=f.nthToken(1).text,f.consume(),f.consume(),o=f.token());o.type==Uu.FUNC&&"class"==o.text.toLowerCase()&&f.nthToken(1).type==Uu.IDENT&&f.nthToken(2).type==Uu.C_PAR;)v.push(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),o=f.token();if(o.type==Uu.O_BRC){switch(f.consume(),l){case"-epubx-page-master":d.startPageMasterRule(A,g,v);break;case"-epubx-partition":d.startPartitionRule(A,g,v);break;case"-epubx-partition-group":d.startPartitionGroupRule(A,g,v)}this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"":d.error("E_CSS_UNEXPECTED_AT"+l,o),this.actions=wi;continue;default:d.error("E_CSS_AT_UNKNOWN "+l,o),this.actions=Bi;continue}d.error("E_CSS_AT_SYNTAX "+l,o),this.actions=Bi;continue;case li.ERROR_PUSH:this.errorBrackets.push(o.type+1),f.consume();continue;case li.ERROR_POP_DECL:if(0==this.errorBrackets.length){this.actions=fi;continue}case li.ERROR_POP:if(i&&0==this.errorBrackets.length&&o.type==Uu.C_PAR)return f.consume(),d.endFuncWithSelector(),!0;this.errorBrackets.length>0&&this.errorBrackets[this.errorBrackets.length-1]==o.type&&this.errorBrackets.pop(),0==this.errorBrackets.length&&o.type==Uu.C_BRC&&(this.actions=fi),f.consume();continue;case li.ERROR_SEMICOL:0==this.errorBrackets.length&&(this.actions=fi),f.consume();continue;case li.DONE:return!0;default:if(n)return!!this.exprStackReduce(Uu.C_PAR,o)&&(this.result=p.pop(),!0);if(i){switch(o.type){case Uu.COMMA:case Uu.C_PAR:if(this.actions===Ai)d.error("E_CSS_SYNTAX",o);else{var m=f.input.substring(E,o.position);d.pushSelectorText(m),E=o.position+1}if(o.type===Uu.COMMA){d.nextSelector(),this.actions=Ai,f.consume();continue}return d.endFuncWithSelector(),f.consume(),!0;case Uu.GT:case Uu.PLUS:case Uu.TILDE:if(r){this.actions=Ei;continue}break;case Uu.O_BRC:case Uu.O_BRK:case Uu.O_PAR:this.errorBrackets.push(o.type+1)}d.error("E_CSS_SYNTAX",o),f.consume(),this.actions=wi;continue}if(this.actions!==Bi&&this.actions!==wi&&this.actions!==yi){if(o.type==Uu.INVALID)d.error("E_CSS_SYNTAX",o);else{if(this.actions===gi){switch(o.type){case Uu.O_PAR:case Uu.O_BRC:case Uu.O_BRK:this.errorBrackets.push(o.type+1)}p.push(new $e(o.toString())),f.consume();continue}if(o.type===Uu.O_BRC&&this.actions==vi&&p.length>0){d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=fi,f.consume();continue}if(o.type===Uu.SEMICOL&&this.actions==vi)return this.actions=fi,f.consume(),!1;d.error("E_CSS_SYNTAX",o)}this.actions=this.isInsidePropertyOnlyRule()?yi:wi;continue}f.consume();continue}return!1},t}(),Pi=function(t){function e(e){var u;return(u=t.call(this,null)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.error=function(t,e){c.warn(t,e.toString())},u.getScope=function(){return this.scope},e}(Di);function Ri(t,e,u,n,i){return kn("parseStylesheetFromText",(function(r){(function(t,e,u,n,i){var r=Pn("parseStylesheet"),o=new Ii(fi,t,e,u),a=null;return i&&(a=function(t,e,u){var n=new Ii(vi,t,e,u);return n.runParser(Number.POSITIVE_INFINITY,!1,!1,!0,!1),n.result}(new Sn(i,e),e,u)),(a=o.makeCondition(n,a&&a.toExpr()))&&(e.startMediaRule(a),e.startRuleBody()),r.loop((function(){for(var t=function(){if(o.importReady){var t=K(o.importURL,u);o.importCondition&&(e.startMediaRule(o.importCondition),e.startRuleBody());var n=Pn("parseStylesheet.import");return ki(t,e,null,null).then((function(){o.importCondition&&e.endRule(),o.importReady=!1,o.importURL=null,o.importCondition=null,n.finish(!0)})),{v:n.result()}}var i=r.timeSlice();if(i.isPending)return{v:i}};!o.runParser(100,!1,!1,!1,!1);){var n=t();if("object"==typeof n)return n.v}return Rn(!1)})).then((function(){a&&e.endRule(),r.finish(!0)})),r.result()})(new Sn(t,e),e,u,n,i).thenFinish(r)}),(function(e,u){c.warn(u,"Failed to parse stylesheet text: "+t),e.finish(!1)}))}function ki(t,e,u,n){return kn("parseStylesheetFromURL",(function(i){ti(t).then((function(r){r.responseText?Ri(r.responseText,e,t,u,n).then((function(e){e||c.warn("Failed to parse stylesheet from "+t),i.finish(!0)})):i.finish(!0)}))}),(function(e,u){c.warn(u,"Exception while fetching and parsing:",t),e.finish(!0)}))}function Li(t,e,u){var n=new Ii(gi,e,new Pi(t),u);return n.runParser(Number.POSITIVE_INFINITY,!0,!1,!1,!1),n.result}var Oi={"z-index":!0,"column-count":!0,"flow-linger":!0,opacity:!0,page:!0,"flow-priority":!0,utilization:!0};function _i(t,e,u){return t-=u,0===e?0===t:t%e==0&&t/e>=0}var Mi=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.some((function(t){return t.matches()}))},t}(),Ui=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.every((function(t){return t.matches()}))},t}(),Vi=function(){function t(t,e,u){this.elementOffset=void 0,this.a=void 0,this.b=void 0,this.elementOffset=t,this.a=e,this.b=u}return t.registerFragmentIndex=function(e,u,n){var i=t.fragmentIndices;(!i[e]||i[e].priority<=n)&&(i[e]={fragmentIndex:u,priority:n})},t.clearFragmentIndices=function(){t.fragmentIndices={}},t.prototype.matches=function(){var e=t.fragmentIndices[this.elementOffset];return null!=e&&null!=e.fragmentIndex&&_i(e.fragmentIndex,this.a,this.b)},t}();Vi.fragmentIndices={};var Hi=function(){function t(){}return t.buildViewConditionMatcher=function(t,e){var u=e.split("_");return"NFS"==u[0]?new Vi(t,parseInt(u[1],10),parseInt(u[2],10)):null},t.buildAllMatcher=function(t){return new Ui(t)},t.buildAnyMatcher=function(t){return new Mi(t)},t}();function zi(t){var e,u;return"clone"===(null==t||null==(e=t.style)?void 0:e["box-decoration-break"])||"clone"===(null==t||null==(u=t.style)?void 0:u["-webkit-box-decoration-break"])}function Gi(t){var e=t.getAttribute("data-viv-box-break");return e?e.split(" "):[]}function Wi(t,e){t.setAttribute("data-viv-box-break",e.join(" "))}function Xi(t,e){var u=Gi(t);u.includes(e)||(u.push(e),Wi(t,u))}function ji(t,e){var u=function(t){var e=t.getAttribute("data-viv-margin-discard");return e?e.split(" "):[]}(t);u.includes(e)||(u.push(e),function(t,e){t.setAttribute("data-viv-margin-discard",e.join(" "))}(t,u))}var Ki={page:!0,left:!0,right:!0,recto:!0,verso:!0,column:!0,region:!0};function Yi(t){return!!Ki[t]}var qi={left:!0,right:!0,recto:!0,verso:!0};function $i(t){return!!qi[t]}var Qi,Zi,Ji,tr,er,ur,nr={avoid:!0,"avoid-page":!0,"avoid-column":!0,"avoid-region":!0};function ir(t){return!!nr[t]}function rr(t,e){if(!t)return e;if(!e)return t;if($i(e))return e;if($i(t))return t;var u=Yi(t),n=Yi(e);if(!u||!n)return n?e:u?t:ir(e)?e:ir(t)?t:e;switch(e){case"column":return t;case"region":return"column"===t?e:t;default:return e}}function or(t){return Yi(t)?t:"auto"}function ar(t){return t.reduce((function(t,e){return e[0]===o.default.DELETE?t:t+e[1]}),"")}function sr(t,e,u){var n=0,i=0;return t.some((function(t){for(var r=0;re)return!0}return!1})),Math.max(Math.min(e,i-1)+n,0)}p("SIMPLE_PROPERTY",(function(t){var e=t.name,u=t.value;switch(e){case"page-break-before":case"page-break-after":case"page-break-inside":return{name:e.replace(/^page-/,""),value:u===Je.always?Je.page:u,important:t.important};default:return t}})),function(t){t.isInstanceOfBlockFormattingContext=function(t){return t&&"Block"===t.formattingContextType}}(Qi||(Qi={})),function(t){!function(t){t.INLINE="inline",t.COLUMN="column",t.REGION="region",t.PAGE="page"}(t.FloatReference||(t.FloatReference={}))}(Zi||(Zi={})),function(t){t.isInstanceOfAfterIfContinuesLayoutConstraint=function(t){return t&&"AfterIfContinue"==t.flagmentLayoutConstraintType}}(Ji||(Ji={})),function(t){t.isInstanceOfRepetitiveElementsOwnerFormattingContext=function(t){return!!t&&("RepetitiveElementsOwner"===t.formattingContextType||er.isInstanceOfTableFormattingContext(t))},t.isInstanceOfRepetitiveElementsOwnerLayoutConstraint=function(t){return!!t&&("RepetitiveElementsOwner"===t.flagmentLayoutConstraintType||er.isInstanceOfTableRowLayoutConstraint(t))}}(tr||(tr={})),function(t){t.isInstanceOfTableFormattingContext=function(t){return t&&"Table"===t.formattingContextType},t.isInstanceOfTableRowLayoutConstraint=function(t){return t&&"TableRow"===t.flagmentLayoutConstraintType}}(er||(er={})),function(t){!function(t){t[t.IGNORE=0]="IGNORE",t[t.NEWLINE=1]="NEWLINE",t[t.PRESERVE=2]="PRESERVE"}(t.Whitespace||(t.Whitespace={})),function(t){t[t.NONE=0]="NONE",t[t.CONTENT=1]="CONTENT",t[t.ROOTLESS=2]="ROOTLESS",t[t.ROOTED=3]="ROOTED"}(t.ShadowType||(t.ShadowType={}))}(ur||(ur={}));var lr={transform:!0,"transform-origin":!0},Dr={top:!0,bottom:!0,left:!0,right:!0},hr=function(t,e,u){this.target=void 0,this.name=void 0,this.value=void 0,this.target=t,this.name=e,this.value=u},cr={show:function(t){t.style.visibility="visible"},hide:function(t){t.style.visibility="hidden"},play:function(t){t.currentTime=0,t.play()},pause:function(t){t.pause()},resume:function(t){t.play()},mute:function(t){t.muted=!0},unmute:function(t){t.muted=!1}};function dr(t,e){var u=cr[e];return u?function(){for(var e=0;et.priority||this.last)},t}();function vr(t,e){return t.top-e.top}function mr(t,e){return e.right-t.right}function Br(t,e){var u,n;return t===e||!(!t||!e)&&(t.node===e.node||!!t.shadowContext&&!!e.shadowContext&&t.shadowType===ur.ShadowType.ROOTLESS&&e.shadowType===ur.ShadowType.ROOTLESS&&(null==(u=t.node)?void 0:u.outerHTML)===(null==(n=e.node)?void 0:n.outerHTML))&&t.shadowType===e.shadowType&&xr(t.shadowContext,e.shadowContext)&&xr(t.nodeShadow,e.nodeShadow)&&Br(t.shadowSibling,e.shadowSibling)}function yr(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.offsetInNode!==e.offsetInNode||t.after!==e.after||t.steps.length!==e.steps.length)return!1;for(var u=0;u0&&this.positions[0].flowChunk.startOffset<=t},t}(),Lr=function(){function t(){this.page=0,this.flows={},this.flowPositions={},this.isBlankPage=!1,this.highestSeenOffset=0,this.highestSeenNode=void 0,this.lookupPositionOffset=void 0}var e=t.prototype;return e.clone=function(){var e=new t;for(var u in e.page=this.page,e.isBlankPage=this.isBlankPage,e.highestSeenNode=this.highestSeenNode,e.highestSeenOffset=this.highestSeenOffset,e.lookupPositionOffset=this.lookupPositionOffset,e.flows=this.flows,this.flowPositions)e.flowPositions[u]=this.flowPositions[u].clone();return e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.page!==t.page)return!1;var e=Object.keys(this.flowPositions),u=Object.keys(t.flowPositions);if(e.length!==u.length)return!1;for(var n=0,i=e;n=e.priority)&&u.isEnabled(t)?u.getBaseValue():e}function Jr(t,e,u,n){if(u){var i=t[e];(!i||u.priority>=i.priority)&&(n?u.isEnabled(n)&&(t[e]=u.getBaseValue()):t[e]=u)}else delete t[e]}var to={"region-id":!0,"fragment-selector-id":!0};function eo(t){return"_"===t.charAt(0)&&"_viewConditionalStyles"!==t}function uo(t){return"_"!==t.charAt(0)&&!to[t]}function no(t){return!!Ur[t]||su(t)}function io(t,e){return t[e]}function ro(t,e,u){u?t[e]=u:delete t[e]}function oo(t,e){return t[e]}function ao(t,e){var u=t[e];return u||(t[e]=u={}),u}var so=function(t){var e=t._viewConditionalStyles;return e||(t._viewConditionalStyles=e=[]),e};function lo(t,e){return t[e]}function Do(t,e){var u=t[e];return u||(t[e]=u=[]),u}function ho(t,e,u,n,i,r,o){for(var a in[{id:i,styleKey:"_pseudos"},{id:r,styleKey:"_regions"}].forEach((function(t){if(t.id){var u=ao(e,t.styleKey);(e=u[t.id])||(u[t.id]=e={})}})),o&&so(e).push({styles:e={},matcher:o}),u)if(!eo(a))if(to[a]){var s=lo(u,a),l=Do(e,a);Array.prototype.push.apply(l,s)}else{var D,h,c=io(u,a).increaseSpecificity(n);Jr(e,a,c,t);var d=null==(D=t.style)||null==(h=D.validatorSet.shorthands[a])?void 0:h.propList;if(d)for(var f,p=O(d);!(f=p()).done;){var E=f.value,C=new $r(Pe,c.priority);Jr(e,E,C,t)}}}function co(t,e){if(t.length>0){t.sort((function(t,e){return e.getPriority()-t.getPriority()}));for(var u=null,n=t.length-1;n>=0;n--)(u=t[n]).chained=e,e=u;return u}return e}var fo=function(t){function e(e,u){var n;return(n=t.call(this)||this).props=void 0,n.context=void 0,n.propName="",n.props=e,n.context=u,n}x(e,t);var u=e.prototype;return u.setPropName=function(t){this.propName=t},u.getFontSize=function(){var t=io(this.props,"font-size");if(!t.value.isNumeric())return Mt.em;var e=t.value;if(!function(t){switch(null==t?void 0:t.toLowerCase()){case"px":case"in":case"pt":case"pc":case"cm":case"mm":case"q":return!0;default:return!1}}(e.unit))throw new Error("Unexpected state");return e.num*Mt[e.unit]},u.visitNumeric=function(t){return"font-size"===this.propName?Eo(t,this.getFontSize(),this.context):"em"===t.unit||"ex"===t.unit||"rem"===t.unit||"lh"===t.unit||"rlh"===t.unit?po(t,this.getFontSize(),this.context):t},u.visitExpr=function(t){return"font-size"==this.propName?Ma(this.context,t,this.propName).visit(this):t},e}(xe);function po(t,e,u){var n=t.unit,i=t.num;return"em"===n||"ex"===n?new Ue(i*(Mt[n]/Mt.em)*e,"px"):"rem"===n?new Ue(i*u.fontSize(),"px"):"rlh"===n?new Ue(i*u.rootLineHeight,"px"):t}function Eo(t,e,u){var n=(t=po(t,e,u)).unit,i=t.num;return"px"===n?t:new Ue("%"===n?i/100*e:i*u.queryUnitSize(n,!1),"px")}var Co=function(){function t(){}var e=t.prototype;return e.apply=function(t){},e.mergeWith=function(t){return new Ao([this,t])},e.clone=function(){return this},t}(),Fo=function(t){function e(e){var u;return(u=t.call(this)||this).conditionItem=void 0,u.conditionItem=e,u}return x(e,t),e.prototype.apply=function(t){t.pushConditionItem(this.conditionItem.fresh(t))},e}(Co),Ao=function(t){function e(e){var u;return(u=t.call(this)||this).list=void 0,u.list=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e=0;e0)return}e=e.nextSibling}this.chained.apply(t)},u.getPriority=function(){return 4},e}(vo),Ho=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){!1===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),zo=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){!0===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),Go=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){var e=t.currentElement;!0!==e.selected&&!0!==e.checked||this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),Wo=function(t){function e(e){var u;return(u=t.call(this)||this).condition=void 0,u.condition=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){if(t.conditions[this.condition])try{t.dependentConditions.push(this.condition),this.chained.apply(t)}finally{t.dependentConditions.pop()}},u.getPriority=function(){return 5},e}(vo),Xo=function(t){function e(){var e;return(e=t.call(this)||this).applied=!1,e}x(e,t);var u=e.prototype;return u.apply=function(t){this.applied=!0},u.clone=function(){var t=new e;return t.applied=this.applied,t},e}(Co),jo=function(t){function e(e){var u;(u=t.call(this)||this).checkAppliedAction=void 0,u.firstActions=[],u.checkAppliedAction=new Xo;for(var n,i=O(e);!(n=i()).done;)u.firstActions.push(co(n.value,u.checkAppliedAction));return u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e,u=O(this.firstActions);!(e=u()).done&&(e.value.apply(t),!this.checkAppliedAction.applied););this.checkAppliedAction.applied===this.positive()&&this.chained.apply(t),this.checkAppliedAction.applied=!1},u.getPriority=function(){return Math.max.apply(Math,this.firstActions.map((function(t){return t instanceof vo?t.getPriority():0})))},u.positive=function(){return!0},u.relational=function(){return!1},e}(vo),Ko=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.positive=function(){return!1},e}(jo),Yo=function(t){function e(e){var u;return(u=t.call(this,[])||this).selectorTexts=void 0,u.selectorTexts=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e,u=O(this.selectorTexts);!(e=u()).done;){var n=e.value,i=void 0,r=void 0;/^\s*[+~]/.test(n)?(r=t.currentElement.parentElement,i=":scope > :nth-child("+(Array.from(r.children).indexOf(t.currentElement)+1)+") "+n):(r=t.currentElement,i=":scope "+n);try{if(r.querySelector(i)){this.checkAppliedAction.apply(t);break}}catch(t){}}this.checkAppliedAction.applied&&this.chained.apply(t),this.checkAppliedAction.applied=!1},u.relational=function(){return!0},e}(jo),qo=function(){function t(t,e,u){this.condition=void 0,this.viewConditionId=void 0,this.viewCondition=void 0,this.condition=t,this.viewConditionId=e,this.viewCondition=u}var e=t.prototype;return e.increment=function(t){t.increment(this.condition,this.viewCondition)},e.decrement=function(t){t.decrement(this.condition,this.viewCondition)},e.buildViewConditionMatcher=function(t){return t.buildViewConditionMatcher(this.viewConditionId)},t}(),$o=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e&&this.increment(t),!1},u.pop=function(t,e){return 0==e&&(this.decrement(t),!0)},e}(qo),Qo=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e?this.increment(t):1==e&&this.decrement(t),!1},u.pop=function(t,e){return 0==e?(this.decrement(t),!0):(1==e&&this.increment(t),!1)},e}(qo),Zo=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return!!this.fired&&(this.decrement(t),!0)},u.pop=function(t,e){return this.fired?(this.decrement(t),!0):(0==e&&(this.fired=!0,this.increment(t)),!1)},e}(qo),Jo=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return this.fired&&(-1==e?this.increment(t):0==e&&this.decrement(t)),!1},u.pop=function(t,e){if(this.fired){if(-1==e)return this.decrement(t),!0;0==e&&this.increment(t)}else 0==e&&(this.fired=!0,this.increment(t));return!1},e}(qo),ta=function(){function t(t,e){this.afterprop=void 0,this.element=void 0,this.afterprop=t,this.element=e}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.processPseudoelementProps(this.afterprop,this.element),!0)},t}(),ea=function(){function t(t){this.lang=void 0,this.lang=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.lang=this.lang,!0)},t}(),ua=function(){function t(t){this.oldQuotes=void 0,this.oldQuotes=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.quotes=this.oldQuotes,!0)},t}(),na=function(t){function e(e){var u;return(u=t.call(this)||this).element=void 0,u.element=e,u}x(e,t);var u=e.prototype;return u.createValueFromString=function(t,e){return"url"===e?new Ge(t||"about:invalid"):new Le(t||"")},u.visitFunc=function(e){if("attr"!==e.name)return t.prototype.visitFunc.call(this,e);var u,n="string",i=null;if(e.values[0]instanceof je){var r=e.values[0].values;r.length>=2&&(n=r[1].stringValue()),i=r[0].stringValue()}else i=e.values[0].stringValue();return u=this.createValueFromString(e.values.length>1?e.values[1].stringValue():null,n),this.element&&this.element.hasAttribute(i)?this.createValueFromString(this.element.getAttribute(i),n):u},e}(xe);function ia(t){if(Mr(t)){if(t instanceof Le)return t.stringValue();if(t instanceof je)return t.values.map((function(t){return ia(t)})).join("")}return""}var ra=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).cascade=void 0,i.element=void 0,i.counterResolver=void 0,i.cascade=e,i.element=u,i.counterResolver=n,i}x(e,t);var u=e.prototype;return u.visitIdent=function(t){var e=this.cascade,u=e.quotes,n=Math.floor(u.length/2)-1;switch(t.name){case"open-quote":var i=u[2*Math.min(n,e.quoteDepth)];return e.quoteDepth++,i;case"close-quote":return e.quoteDepth>0&&e.quoteDepth--,u[2*Math.min(n,e.quoteDepth)+1];case"no-open-quote":return e.quoteDepth++,new Le("");case"no-close-quote":return e.quoteDepth>0&&e.quoteDepth--,new Le("")}return t},u.format=function(t,e){var u,n=!1,i=!1;null!=(u=e.match(/^upper-(.*)/))?(n=!0,e=u[1]):null!=(u=e.match(/^lower-(.*)/))&&(i=!0,e=u[1]);var r="";return oa[e]?r=function(t,e){if(e>t[0]||e<=0||e!=Math.round(e))return"";for(var u="",n=1;n20)return"";for(e-=r*i;r>0;)u+=t[n+1],r--}return u}(oa[e],t):aa[e]?r=function(t,e){if(e<=0||e!=Math.round(e))return"";var u=function(t){for(var e=[],u=0;u0);return n}(aa[e],t):null!=sa[e]?r=sa[e]:"decimal-leading-zero"==e?1==(r=""+t).length&&(r="0"+r):r="cjk-ideographic"==e||"trad-chinese-informal"==e?function(t,e){if(t>9999||t<-9999)return""+t;if(0==t)return e.digits.charAt(0);var u=new it;if(t<0&&(u.append(e.negative),t=-t),t<10)u.append(e.digits.charAt(t));else if(!e.formal&&t<=19)u.append(e.markers.charAt(0)),0!=t&&u.append(e.digits.charAt(t-10));else{var n=Math.floor(t/1e3);n&&(u.append(e.digits.charAt(n)),u.append(e.markers.charAt(2)));var i=Math.floor(t/100)%10;i&&(u.append(e.digits.charAt(i)),u.append(e.markers.charAt(1)));var r=Math.floor(t/10)%10;r&&(u.append(e.digits.charAt(r)),u.append(e.markers.charAt(0)));var o=t%10;o&&u.append(e.digits.charAt(o))}return u.toString()}(t,la):""+t,n?r.toUpperCase():i?r.toLowerCase():r},u.visitFuncCounter=function(t){var e=this,u=t[0].toString(),n=t.length>1?t[1].stringValue():"decimal",i=this.cascade.counters[u];if(i&&i.length)return new Le(this.format(i&&i.length&&i[i.length-1]||0,n));var r=new qe(this.counterResolver.getPageCounterVal(u,(function(t){return e.format(t||0,n)})));return new je([r])},u.visitFuncCounters=function(t){var e=this,u=t[0].toString(),n=t[1].stringValue(),i=t.length>2?t[2].stringValue():"decimal",r=this.cascade.counters[u],o=new it;if(r&&r.length)for(var a=0;a0&&o.append(n),o.append(this.format(r[a],i));var s=new qe(this.counterResolver.getPageCountersVal(u,(function(t){var u=[];if(t.length)for(var r=0;r2?t[2].stringValue():"decimal",o=new qe(this.counterResolver.getTargetCounterVal(e,i,(function(t){return u.format(t||0,r)})));return new je([o])},u.visitFuncTargetCounters=function(t){var e,u=this,n=t[0];e=n instanceof Ge?n.url:n.stringValue();var i=t[1].toString(),r=t[2].stringValue(),o=t.length>3?t[3].stringValue():"decimal",a=new qe(this.counterResolver.getTargetCountersVal(e,i,(function(t){var e=t.map((function(t){return u.format(t,o)}));return e.length?e.join(r):u.format(0,o)})));return new je([a])},u.visitFuncString=function(t){var e=t.length>0?t[0].stringValue():"",u=t.length>1?t[1].stringValue():"first";return new qe(this.counterResolver.getNamedStringVal(e,u))},u.visitFuncElement=function(t){var e=t.length>0?t[0].stringValue():"",u=t.length>1?t[1].stringValue():"first";return new qe(this.counterResolver.getRunningElementVal(e,u))},u.visitFuncContent=function(t){var e=t.length>0?t[0].stringValue():"text",u="";switch(e){case"text":u=this.element.textContent;break;case"before":case"after":var n,i,r=oo(this.cascade.currentStyle,"_pseudos");u=ia(null==r||null==(n=r[e])||null==(i=n.content)?void 0:i.value);break;case"first-letter":var o,a,s,l,D=oo(this.cascade.currentStyle,"_pseudos"),h=(ia(null==D||null==(o=D.before)||null==(a=o.content)?void 0:a.value)||this.element.textContent||ia(null==D||null==(s=D.after)||null==(l=s.content)?void 0:l.value)).match(_);u=h?h[0]:""}return new Le(u)},u.visitFuncLeader=function(t){var e="";if(t[0]instanceof _e)switch(t[0].stringValue()){case"dotted":e=".";break;case"solid":e="_";break;case"space":e=" "}else t[0]instanceof Le&&(e=t[0].stringValue());return 0==e.length?new Le(""):new qe(new Ee(null,(function(){return e}),"viv-leader"))},u.visitFunc=function(t){switch(t.name){case"counter":if(t.values.length<=2)return this.visitFuncCounter(t.values);break;case"counters":if(t.values.length<=3)return this.visitFuncCounters(t.values);break;case"target-counter":if(t.values.length<=3)return this.visitFuncTargetCounter(t.values);break;case"target-counters":if(t.values.length<=4)return this.visitFuncTargetCounters(t.values);break;case"string":if(t.values.length<=2)return this.visitFuncString(t.values);break;case"element":if(t.values.length<=2)return this.visitFuncElement(t.values);break;case"content":if(t.values.length<=1)return this.visitFuncContent(t.values);break;case"leader":if(t.values.length<=1)return this.visitFuncLeader(t.values)}return t},e}(xe);p(e.HOOKS.POST_LAYOUT_BLOCK,(function(t,e,u){for(var n,i=function(){for(var t=n.value,e=t.parent;e&&e.inline;)e=e.parent;var i=t.viewNode,r=i.parentElement,o=i.getAttribute("data-viv-leader-value"),a=i.textContent||o,s=u.clientLayout.getElementComputedStyle(r),l=s.writingMode,D=s.direction,h=s.marginInlineEnd;function c(t){if("rtl"===D){var e="‏";i.textContent=(t.startsWith(e)?"":e)+t+(t.endsWith(e)?"":e)}else i.textContent=t}i.style.marginInlineStart="1px",c(o),r.style.display="inline-block",r.style.textIndent="0";var d=u.clientLayout.getElementClientRect(e.viewNode),f=u.clientLayout.getElementClientRect(r),p=u.parseComputedLength(h);function E(){var t=u.clientLayout.getElementClientRect(r);return d.left>t.left||d.rightt.top||d.bottom0?1===u.length?u[0]:Hi.buildAnyMatcher([].concat(u)):null})).filter((function(t){return t}));return n.length<=0?u:null===u?1===n.length?n[0]:Hi.buildAllMatcher(n):Hi.buildAllMatcher([u].concat(n))},e.applyAction=function(t,e){var u=t[e];u&&u.apply(this)},e.pushRule=function(t,e,u){this.currentElement=null,this.currentElementOffset=null,this.currentStyle=u,this.currentNamespace="",this.currentLocalName="",this.currentId="",this.currentXmlId="",this.currentClassNames=t,this.currentNSTag="",this.currentEpubTypes=pa,this.currentPageType=e,this.applyActions()},e.defineCounter=function(t,e){this.counters[t]?this.counters[t].push(e):this.counters[t]=[e];var u=this.counterScoping[this.counterScoping.length-1];u||(this.counterScoping[this.counterScoping.length-1]=u={}),u[t]=!0},e.pushCounters=function(t){var e,u=Je.inline,n=t.display;n&&(u=n.evaluate(this.context));var i=Je.inline,r=t.float;r&&(i=r.evaluate(this.context));var o=null,a=null,s=null,l=t["counter-reset"];if(l){var D=l.evaluate(this.context);D&&(o=Ou(D,!0))}var h=t["counter-set"];if(h){var c=h.evaluate(this.context);c&&(s=Ou(c,!1))}var d,f,p,E,C=t["counter-increment"];if(C){var F=C.evaluate(this.context);F&&(a=Ou(F,!1))}if("ol"!=this.currentLocalName&&"ul"!=this.currentLocalName||this.currentNamespace!=W.XHTML||(o||(o={}),o["ua-list-item"]=(null!=(d=null==(f=this.currentElement)?void 0:f.start)?d:1)-1),u===Je.list_item&&(a||(a={}),a["ua-list-item"]=1,/^\s*[-+]?\d/.test(null!=(p=null==(E=this.currentElement)?void 0:E.getAttribute("value"))?p:"")&&(o||(o={}),o["ua-list-item"]=this.currentElement.value-1)),(null==(e=this.currentElement)?void 0:e.parentNode.nodeType)===Node.DOCUMENT_NODE&&(o||(o={}),void 0===o.footnote&&(o.footnote=0)),i===Je.footnote&&(a||(a={}),void 0===a.footnote)){var A,g=null==(A=this.currentStyle["counter-increment"])?void 0:A.value;g&&(g===Je.footnote||g instanceof je&&g.values.includes(Je.footnote))||(a.footnote=1)}if(o)for(var v in o)this.defineCounter(v,o[v]);if(s)for(var m in s)if(this.counters[m]){var B=this.counters[m];B[B.length-1]=s[m]}else this.defineCounter(m,s[m]);if(a)for(var y in a){this.counters[y]||this.defineCounter(y,0);var w=this.counters[y];w[w.length-1]+=a[y]}if(u===Je.list_item){var N=this.counters["ua-list-item"];t["ua-list-item-count"]=new $r(new Ve(N[N.length-1]),0)}this.counterScoping.push(null)},e.popCounters=function(){var t=this.counterScoping.pop();if(t)for(var e in t){var u=this.counters[e];u&&(1==u.length?delete this.counters[e]:u.pop())}},e.setNamedStrings=function(t){var e=t["string-set"];if(e){for(var u,n=O((e=e.filterValue(new ra(this,this.currentElement,this.counterResolver))).value instanceof Ke?e.value.values:[e.value]);!(u=n()).done;){var i=u.value;if(i instanceof je){var r=i.values[0].stringValue(),o=i.values.slice(1).map((function(t){return ia(t)})).join("");this.counterResolver.setNamedString(r,o,this.currentElementOffset)}}delete t["string-set"]}},e.setRunningElement=function(t){var e=t.position;if((null==e?void 0:e.value)instanceof Ye&&"running"===e.value.name){var u=e.value.values[0].stringValue();this.counterResolver.setRunningElement(u,this.currentElementOffset)}},e.processPseudoelementProps=function(t,e){this.pushCounters(t);var u=t.content;u&&(t.content=u.filterValue(new ra(this,e,this.counterResolver))),this.popCounters()},e.pushElement=function(t,e,u,n){var i=this;this.currentPageType=null,this.currentElement=e,this.currentElementOffset=n,this.currentStyle=u,this.currentNamespace=e.namespaceURI,this.currentLocalName=e.localName;var r=this.code.nsPrefix[this.currentNamespace];this.currentNSTag=r?r+this.currentLocalName:"",this.currentId=e.getAttribute("id"),this.currentXmlId=e.getAttributeNS(W.XML,"id");var o=e.getAttribute("class");this.currentClassNames=o?o.split(/\s+/):pa;var a=e.getAttributeNS(W.epub,"type");this.currentEpubTypes=a?a.split(/\s+/):pa;var s=nt(e);s&&(this.stack[this.stack.length-1].push(new ea(this.lang)),this.lang=s.toLowerCase());var l=this.isRoot,D=this.siblingOrderStack;this.currentSiblingOrder=++D[D.length-1],D.push(0);var h=this.siblingTypeCountsStack,c=this.currentSiblingTypeCounts=h[h.length-1],d=c[this.currentNamespace];d||(d=c[this.currentNamespace]={}),d[this.currentLocalName]=(d[this.currentLocalName]||0)+1,h.push({});var f=this.followingSiblingOrderStack;this.currentFollowingSiblingOrder=null!==f[f.length-1]?--f[f.length-1]:null,f.push(null);var p=this.followingSiblingTypeCountsStack,E=this.currentFollowingSiblingTypeCounts=p[p.length-1];E&&E[this.currentNamespace]&&E[this.currentNamespace][this.currentLocalName]--,p.push({}),this.applyActions(),this.applyVarFilter([this.currentStyle],t,e),this.applyCalcFilter(this.currentStyle,this.context),this.applyAttrFilter(e);var C=u.quotes,F=null;if(C){var A=C.evaluate(this.context);A&&(F=new ua(this.quotes),A===Je.none?this.quotes=[new Le(""),new Le("")]:A===Je.auto||A===Je.initial?this.quotes=[new Le("“"),new Le("”"),new Le("‘"),new Le("’")]:A instanceof je&&(this.quotes=A.values))}this.pushCounters(this.currentStyle);var g=this.currentId||this.currentXmlId||e.getAttribute("name")||"";if(l||g){var v={};Object.keys(this.counters).forEach((function(t){v[t]=Array.from(i.counters[t])})),this.counterListener.countersOfId(g,v)}var m=oo(this.currentStyle,"_pseudos");if(m)for(var B,y=!0,w=O(Ea);!(B=w()).done;){var N=B.value;N||(y=!1);var b,S,x=m[N];x&&(("before"!==N&&"after"!==N||Mr(null==(b=x.content)?void 0:b.value))&&("footnote-call"!==N&&"footnote-marker"!==N||(null==(S=io(this.currentStyle,"float"))?void 0:S.value)===Je.footnote)?y?this.processPseudoelementProps(x,e):this.stack[this.stack.length-2].push(new ta(x,e)):delete m[N])}this.setNamedStrings(this.currentStyle),this.setRunningElement(this.currentStyle),F&&this.stack[this.stack.length-2].push(F)},e.applyAttrFilterInner=function(t,e){for(var u in e)uo(u)&&!su(u)&&(e[u]=e[u].filterValue(t))},e.applyAttrFilter=function(t){var e=new na(t),u=this.currentStyle,n=oo(u,"_pseudos");for(var i in n)this.applyAttrFilterInner(e,n[i]);this.applyAttrFilterInner(e,u)},e.applyVarFilter=function(t,e,u){var n=t[0],i=new Oa(t,e,u),r={};for(var o in n)if(eo(o)){var a=oo(n,o);for(var s in a)this.applyVarFilter([a[s]].concat(t),e,u)}else if(uo(o)){for(var l=io(n,o),D=l.value,h=0;;h++){if(h>=32){D=Pe;break}var c=D.visit(i);if(i.error){D=Pe,i.error=!1;break}if(c===D)break;D=c}if(D!==l.value){var d,f=e.validatorSet,p=null==f||null==(d=f.shorthands[o])?void 0:d.clone();if(p)if(ou(D)){for(var E,C=O(p.propList);!(E=C()).done;){var F=E.value,A=new $r(D,l.priority),g=io(n,F);ro(r,F,Zr(this.context,g,A))}delete n[o]}else{var v=Li(e.scope,new Sn(D.toString(),null),"");if(v&&(v.visit(p),!p.error)){for(var m,B=O(p.propList);!(m=B()).done;){var y,w,N=m.value,b=new $r(null!=(y=null!=(w=p.values[N])?w:f.defaultValues[N])?y:Je.initial,l.priority),S=io(n,N);ro(r,N,Zr(this.context,S,b))}delete n[o]}}else n[o]=new $r(D,l.priority)}if(r[o]){var x=io(n,o);x&&x.value!==Pe&&Jr(r,o,x,this.context)}}for(var T in r)n[T]=r[T]},e.applyCalcFilter=function(t,e){var u=new _a(e);for(var n in t)if(eo(n)){var i=oo(t,n);for(var r in i)this.applyCalcFilter(i[r],e)}else if(uo(n)&&!su(n)){var o=io(t,n),a=o.value.visit(u);a!==o.value&&(t[n]=new $r(a,o.priority))}},e.applyActions=function(){var t;for(t=0;t=-1;--e){var u=this.stack[this.stack.length-e-2];for(t=0;t=-1;--t)for(var e=this.stack[this.stack.length-t-2],u=0;u0&&u==e[0]){if(this.pseudoelement)return void this.invalidSelector("Double pseudo-element ::"+this.pseudoelement+"::"+t);this.pseudoelement="first-"+u+"-lines";break}}this.chain.push(new Wo(""));break;case"nth-fragment":e&&2==e.length?this.viewConditionId="NFS_"+e[0]+"_"+e[1]:this.chain.push(new Wo(""));break;default:return void this.invalidSelector("Unknown pseudo-element ::"+t)}this.specificity+=1},u.idSelector=function(t){this.specificity+=65536,this.chain.push(new Bo(t))},u.attributeSelector=function(t,e,u,n){var i;switch(this.specificity+=256,e=e.toLowerCase(),n=n||"",u){case Uu.EOF:i=new So(t,e);break;case Uu.EQ:i=new xo(t,e,n);break;case Uu.TILDE_EQ:i=!n||n.match(/\s/)?new Wo(""):new Io(t,e,new RegExp("(^|\\s)"+ht(n)+"($|\\s)"));break;case Uu.BAR_EQ:i=new Io(t,e,new RegExp("^"+ht(n)+"($|-)"));break;case Uu.HAT_EQ:i=n?new Io(t,e,new RegExp("^"+ht(n))):new Wo("");break;case Uu.DOLLAR_EQ:i=n?new Io(t,e,new RegExp(ht(n)+"$")):new Wo("");break;case Uu.STAR_EQ:i=n?new Io(t,e,new RegExp(ht(n))):new Wo("");break;case Uu.COL_COL:if("supported"!=n)return void this.invalidSelector("Unsupported :: attr selector op: "+n);i=new To(t,e);break;default:return void this.invalidSelector("Unsupported attr selector: "+u)}this.chain.push(i)},u.descendantSelector=function(){var t="d"+ga++;this.processChain(new Fo(new $o(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.childSelector=function(){var t="c"+ga++;this.processChain(new Fo(new Qo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.adjacentSiblingSelector=function(){var t="a"+ga++;this.processChain(new Fo(new Zo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.followingSiblingSelector=function(){var t="f"+ga++;this.processChain(new Fo(new Jo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.nextSelector=function(){this.finishChain(),this.pseudoelement=null,this.footnoteContent=!1,this.specificity=0,this.chain=[]},u.startSelectorRule=function(){this.isInsideSelectorRule("E_CSS_UNEXPECTED_SELECTOR")||(this.state=ca.SELECTOR,this.elementStyle={},this.pseudoelement=null,this.specificity=0,this.footnoteContent=!1,this.chain=[],this.invalid=!1)},u.error=function(e,u){t.prototype.error.call(this,e,u),this.state==ca.SELECTOR&&(this.state=ca.TOP),this.setInvalid()},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.state=ca.TOP},u.startRuleBody=function(){this.finishChain(),t.prototype.startRuleBody.call(this),this.state==ca.SELECTOR&&(this.state=ca.TOP)},u.endRule=function(){t.prototype.endRule.call(this),this.insideSelectorRule=ca.TOP},u.finishChain=function(){this.chain&&(this.processChain(this.makeApplyRuleAction(this.specificity)),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0)},u.makeApplyRuleAction=function(t){var e=this.regionId;return this.footnoteContent&&(e=e?"xxx-bogus-xxx":"footnote"),new go(this.elementStyle,t,this.pseudoelement,e,this.viewConditionId)},u.special=function(t,e){var u;u=this.condition?new Qr(e,0,this.condition):new $r(e,0),Do(this.elementStyle,t).push(u)},u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){"display"!=t||e!==Je.oeb_page_head&&e!==Je.oeb_page_foot||(this.simpleProperty("flow-options",new je([Je.exclusive,Je._static]),u),this.simpleProperty("flow-into",e,u),e=Je.block),C("SIMPLE_PROPERTY").forEach((function(n){var i=n({name:t,value:e,important:u});t=i.name,e=i.value,u=i.important}));var n=(u?this.getImportantSpecificity():this.getBaseSpecificity())+this.cascade.nextOrder(),i=this.condition?new Qr(e,n,this.condition):new $r(e,n);Jr(this.elementStyle,t,i)},u.finish=function(){return this.cascade},u.startFuncWithSelector=function(t){var e;switch(t){case"is":e=new va(this);break;case"not":e=new ma(this);break;case"where":e=new Ba(this);break;case"has":e=new ya(this)}e&&(e.startSelectorRule(),this.owner.pushHandler(e))},e}(di),Aa={"nth-child":Oo,"nth-of-type":_o,"nth-last-child":Mo,"nth-last-of-type":Uo},ga=0,va=function(t){function e(e){var u;return(u=t.call(this,e.scope,e.owner,e.condition,e,e.regionId,e.validatorSet,!1)||this).parent=void 0,u.parentChain=void 0,u.chains=[],u.maxSpecificity=0,u.selectorTexts=[],u.parent=e,u.parentChain=e.chain,u}x(e,t);var u=e.prototype;return u.nextSelector=function(){this.chain&&this.chains.push(this.chain),this.maxSpecificity=Math.max(this.maxSpecificity,this.specificity),this.chain=[],this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0},u.endFuncWithSelector=function(){this.chain&&this.chains.push(this.chain),this.chains.length>0?(this.maxSpecificity=Math.max(this.maxSpecificity,this.specificity),this.parentChain.push(this.relational()?new Yo(this.selectorTexts):this.positive()?new jo(this.chains):new Ko(this.chains)),this.increasingSpecificity()&&(this.parent.specificity+=this.maxSpecificity)):this.parentChain.push(new Wo("")),this.owner.popHandler()},u.startRuleBody=function(){this.reportAndSkip("E_CSS_UNEXPECTED_RULE_BODY")},u.error=function(u,n){t.prototype.error.call(this,u,n),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0;for(var i=!1,r=this;r instanceof e;r=r.parent)if(r.forgiving()){i=!0;break}i||this.owner.popHandler()},u.pushSelectorText=function(t){this.chain&&this.relational()&&this.selectorTexts.push(t)},u.positive=function(){return!0},u.increasingSpecificity=function(){return!0},u.forgiving=function(){return!0},u.relational=function(){return!1},e}(Fa),ma=function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var u=e.prototype;return u.positive=function(){return!1},u.forgiving=function(){return!1},e}(va),Ba=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.increasingSpecificity=function(){return!1},e}(va),ya=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.relational=function(){return!0},e}(va),wa=function(t){function e(e,u){return t.call(this,e,u,!1)||this}return x(e,t),e.prototype.property=function(t,e,u){if(this.scope.values[t])this.error("E_CSS_NAME_REDEFINED "+t,this.getCurrentToken());else{var n=t.match(/height|^(top|bottom)$/)?"vh":"vw",i=new de(this.scope,100,n);this.scope.defineName(t,e.toExpr(this.scope,i))}},e}(di),Na=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,!1)||this).condition=void 0,o.elementStyle=void 0,o.validatorSet=void 0,o.order=void 0,o.condition=n,o.elementStyle=i,o.validatorSet=r,o.order=0,o}x(e,t);var u=e.prototype;return u.property=function(t,e,u){u?c.warn("E_IMPORTANT_NOT_ALLOWED"):this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity();n+=this.order,this.order+=Da;var i=this.condition?new Qr(e,n,this.condition):new $r(e,n);Jr(this.elementStyle,t,i)},e}(di),ba=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).validatorSet=void 0,n.elementStyle={},n.order=0,n.validatorSet=u,n}x(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?si:ai;n+=this.order,this.order+=Da;var i=new $r(e,n);Jr(this.elementStyle,t,i)},e}(Pi);function Sa(t,e){var u=so(t);u&&u.forEach((function(t){t.matcher.matches()&&e(t.styles)}))}function xa(t,e,u){Sa(u,(function(u){ka(t,u,e)}))}function Ta(t,e,u){var n=t["writing-mode"];if(n){var i=n.evaluate(e,"writing-mode");if(i&&i!==Je.inherit&&i!==Je.revert&&i!==Je.unset)return i===Je.vertical_rl}return u}function Ia(t,e,u){var n=t.direction;if(n){var i=n.evaluate(e,"direction");if(i&&i!==Je.inherit&&i!==Je.revert&&i!==Je.unset)return i===Je.rtl}return u}function Pa(t,e,u,n,i){var r={};for(var o in t)uo(o)&&(r[o]=io(t,o));return xa(r,e,t),Ra(t,u,n,(function(t,u){ka(r,u,e),xa(r,e,u)})),r}function Ra(t,e,u,n){var i=oo(t,"_regions");if((e||u)&&i){if(u){var r=["footnote"];e=e?e.concat(r):r}for(var o,a=O(e);!(o=a()).done;){var s=o.value,l=i[s];l&&n(s,l)}}}function ka(t,e,u){for(var n in e)if(uo(n)){var i=io(e,n);t[n]=Zr(u,t[n],i)}}var La=function(t,e,u,n,i){var r=u?n?Yr:jr:n?qr:Kr;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(!a)continue;var s=r[o],l=void 0;if(s){var D=t[s];if(D&&D.priority>a.priority)continue;l=Wr[s]?s:o}else l=o;e[l]=i(o,a)}},Oa=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).elementStyles=void 0,i.styler=void 0,i.element=void 0,i.elementStyles=e,i.styler=u,i.element=n,i}x(e,t);var u=e.prototype;return u.getVarValue=function(t){var e,u,n=null!=(e=this.element)?e:this.styler.root;if(null!=(u=this.elementStyles)&&u.length){for(var i,r=O(this.elementStyles);!(i=r()).done;){var o,a=null==(o=i.value[t])?void 0:o.value;if(a)return a}this.element&&(n=this.element.parentElement)}for(;n;n=n.parentElement){var s,l,D=null==(s=this.styler.getStyle(n,!1))||null==(l=s[t])?void 0:l.value;if(D)return D}return null},u.visitFunc=function(e){if("var"!==e.name)return t.prototype.visitFunc.call(this,e);var u=e.values[0]instanceof _e&&e.values[0].name;return u&&su(u)?this.getVarValue(u)||(e.values.length<2?(this.error=!0,Pe):2===e.values.length?e.values[1]:new Ke(e.values.slice(1))):(this.error=!0,Pe)},e}(xe),_a=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).context=void 0,i.resolveViewportUnit=void 0,i.percentRef=void 0,i.context=e,i.resolveViewportUnit=u,i.percentRef=n,i}x(e,t);var u=e.prototype;return u.visitFunc=function(e){var u=t.prototype.visitFunc.call(this,e);if("calc"!==e.name)return u;var n=u.toString().replace(/^calc\b/,"-epubx-expr");if(/\d(%|em|ex|cap|ch|ic|lh|p?v[whbi]|p?vmin|p?vmax)\W|\Wvar\(\s*--/i.test(n))return u;var i=Li(this.context.rootScope,new Sn(n,null),"");if(i instanceof qe)try{var r=i.expr.evaluate(this.context);"number"==typeof r&&(u=new Ue(r,"px"))}catch(t){c.warn(t)}return u},u.visitNumeric=function(t){return this.resolveViewportUnit&&(_t(t.unit)||function(t){switch(null==t?void 0:t.toLowerCase()){case"rem":case"rlh":return!0;default:return!1}}(t.unit))?new Ue(t.num*this.context.queryUnitSize(t.unit,!1),"px"):"number"==typeof this.percentRef&&"%"===t.unit?new Ue(t.num*this.percentRef/100,"px"):t},e}(xe);function Ma(t,e,u,n){try{if(e instanceof qe)return e.expr instanceof Ee&&(e.expr.str.startsWith("named-string-")||e.expr.str.startsWith("running-element-"))?e:function(t,e,u){var n=e.evaluate(t);switch(typeof n){case"number":return function(t){return!!Oi[t]}(u)?n==Math.round(n)?new He(n):new Ve(n):new Ue(n,"px");case"string":return n?Li(e.scope,new Sn(n,null),""):Pe;case"boolean":return n?Je._true:Je._false;case"undefined":return Pe}throw new Error("E_UNEXPECTED")}(t,e.expr,u);if(e instanceof Ue||e instanceof Ye||e instanceof je||e instanceof Ke)return e.visit(new _a(t,!0,n))}catch(t){return c.warn(t),Pe}return e}function Ua(t,e){var u={};return Object.keys(t).forEach((function(n){var i=u[n]={},r=t[n];Object.keys(r).forEach((function(t){i[t]=r[t].map((function(t){var u=e?t.physical:t.logical;return{regexp:new RegExp("(-?)"+(e?t.logical:t.physical)+"(-?)"),to:"$1"+u+"$2"}}))}))})),u}function Va(t,e,u,n){var i=n[e];if(!i)throw new Error("unknown writing-mode: "+e);var r=i[u||"ltr"];if(!r)throw new Error("unknown direction: "+u);for(var o,a=O(r);!(o=a()).done;){var s=o.value,l=t.replace(s.regexp,s.to);if(l!==t)return l}return t}var Ha={"horizontal-tb":{ltr:[{logical:"inline-start",physical:"left"},{logical:"inline-end",physical:"right"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}],rtl:[{logical:"inline-start",physical:"right"},{logical:"inline-end",physical:"left"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}]},"vertical-rl":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]},"vertical-lr":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]}},za=Ua(Ha,!0);function Ga(t,e,u){return Va(t,e,u||null,za)}var Wa=Ua(Ha,!1);function Xa(t,e,u){return Va(t,e,u||null,Wa)}var ja,Ka={"horizontal-tb":[{logical:"line-left",physical:"left"},{logical:"line-right",physical:"right"},{logical:"over",physical:"top"},{logical:"under",physical:"bottom"}],"vertical-rl":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}],"vertical-lr":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}]};function Ya(t,e,u){var n={display:e.style.display,position:e.style.position,width:e.style.width,maxWidth:e.style.maxWidth,minWidth:e.style.minWidth,height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight},i=e.parentNode,r=e.ownerDocument.createElement("div");function o(u){return t.getElementComputedStyle(e).getPropertyValue(u)}et(r,"position",n.position),i.insertBefore(r,e),r.appendChild(e),et(e,"width","auto"),et(e,"max-width","none"),et(e,"min-width","0"),et(e,"height","auto"),et(e,"max-height","none"),et(e,"min-height","0");var a=tt("writing-mode"),s=(a?o(a[0]):null)||o("writing-mode"),l="vertical-rl"===s||"tb-rl"===s||"vertical-lr"===s||"tb-lr"===s,D=l?"height":"width",h=l?"width":"height";function c(){return et(e,"display","block"),et(e,"position","static"),o(D)}function d(){et(e,"display","inline-block"),et(r,D,"99999999px");var t=o(D);return et(r,D,""),t}function f(){et(e,"display","inline-block"),et(r,D,"0");var t=o(D);return et(r,D,""),t}function p(){var t=c(),e=f(),u=parseFloat(t);if(u<=parseFloat(e))return e;var n=d();return u<=parseFloat(n)?t:n}function E(){return o(h)}function C(){throw new Error("Getting fill-available block size is not implemented")}var F={};return u.forEach((function(t){var u,i;switch(t){case ja.FILL_AVAILABLE_INLINE_SIZE:i=c();break;case ja.MAX_CONTENT_INLINE_SIZE:i=d();break;case ja.MIN_CONTENT_INLINE_SIZE:i=f();break;case ja.FIT_CONTENT_INLINE_SIZE:i=p();break;case ja.FILL_AVAILABLE_BLOCK_SIZE:i=C();break;case ja.MAX_CONTENT_BLOCK_SIZE:case ja.MIN_CONTENT_BLOCK_SIZE:case ja.FIT_CONTENT_BLOCK_SIZE:i=E();break;case ja.FILL_AVAILABLE_WIDTH:i=l?C():c();break;case ja.FILL_AVAILABLE_HEIGHT:i=l?c():C();break;case ja.MAX_CONTENT_WIDTH:i=l?E():d();break;case ja.MAX_CONTENT_HEIGHT:i=l?d():E();break;case ja.MIN_CONTENT_WIDTH:i=l?E():f();break;case ja.MIN_CONTENT_HEIGHT:i=l?f():E();break;case ja.FIT_CONTENT_WIDTH:i=l?E():p();break;case ja.FIT_CONTENT_HEIGHT:i=l?p():E()}"0px"!==i||1!==e.childNodes.length||"img"!==(null==(u=e.firstElementChild)?void 0:u.localName)||e.firstElementChild.complete||(i="1px"),F[t]=parseFloat(i),et(e,"position",n.position),et(e,"display",n.display)})),et(e,"width",n.width),et(e,"max-width",n.maxWidth),et(e,"min-width",n.minWidth),et(e,"height",n.height),et(e,"max-height",n.maxHeight),et(e,"min-height",n.minHeight),i.insertBefore(e,r),i.removeChild(r),F}!function(t){t.FILL_AVAILABLE_INLINE_SIZE="fill-available inline size",t.FILL_AVAILABLE_BLOCK_SIZE="fill-available block size",t.FILL_AVAILABLE_WIDTH="fill-available width",t.FILL_AVAILABLE_HEIGHT="fill-available height",t.MAX_CONTENT_INLINE_SIZE="max-content inline size",t.MAX_CONTENT_BLOCK_SIZE="max-content block size",t.MAX_CONTENT_WIDTH="max-content width",t.MAX_CONTENT_HEIGHT="max-content height",t.MIN_CONTENT_INLINE_SIZE="min-content inline size",t.MIN_CONTENT_BLOCK_SIZE="min-content block size",t.MIN_CONTENT_WIDTH="min-content width",t.MIN_CONTENT_HEIGHT="min-content height",t.FIT_CONTENT_INLINE_SIZE="fit-content inline size",t.FIT_CONTENT_BLOCK_SIZE="fit-content block size",t.FIT_CONTENT_WIDTH="fit-content width",t.FIT_CONTENT_HEIGHT="fit-content height"}(ja||(ja={}));var qa=Zi.FloatReference;function $a(t){switch(t){case qa.INLINE:return!1;case qa.COLUMN:case qa.REGION:case qa.PAGE:return!0;default:throw new Error("Unknown float-reference: "+t)}}var Qa=function(){function t(t,e,u,n,i,r){this.nodePosition=void 0,this.floatReference=void 0,this.floatSide=void 0,this.clearSide=void 0,this.flowName=void 0,this.floatMinWrapBlock=void 0,this.order=null,this.id=null,this.nodePosition=t,this.floatReference=e,this.floatSide=u,this.clearSide=n,this.flowName=i,this.floatMinWrapBlock=r}var e=t.prototype;return e.getOrder=function(){if(null===this.order)throw new Error("The page float is not yet added");return this.order},e.getId=function(){if(!this.id)throw new Error("The page float is not yet added");return this.id},e.isAllowedOnContext=function(t){return t.isAnchorAlreadyAppeared(this.getId())},e.isAllowedToPrecede=function(t){return!1},t}(),Za=function(){function t(){this.floats=[],this.nextPageFloatIndex=0}var e=t.prototype;return e.nextOrder=function(){return this.nextPageFloatIndex++},e.createPageFloatId=function(t){return"pf"+t},e.addPageFloat=function(t){if(this.floats.findIndex((function(e){return yr(e.nodePosition,t.nodePosition)}))>=0)throw new Error("A page float with the same source node is already registered");var e=t.order=this.nextOrder();t.id=this.createPageFloatId(e),this.floats.push(t)},e.findPageFloatByNodePosition=function(t){var e=this.floats.findIndex((function(e){return yr(e.nodePosition,t)}));return e>=0?this.floats[e]:null},e.findPageFloatById=function(t){var e=this.floats.findIndex((function(e){return e.id===t}));return e>=0?this.floats[e]:null},t}(),Ja=function(){function t(t,e,u,n,i){this.floatReference=void 0,this.floatSide=void 0,this.continuations=void 0,this.area=void 0,this.continues=void 0,this.floatReference=t,this.floatSide=e,this.continuations=u,this.area=n,this.continues=i}var e=t.prototype;return e.hasFloat=function(t){return this.continuations.some((function(e){return e.float===t}))},e.findNotAllowedFloat=function(t){for(var e=this.continuations.length-1;e>=0;e--){var u=this.continuations[e].float;if(!u.isAllowedOnContext(t))return u}return null},e.getOuterShape=function(){return this.area.getOuterShape(null,null)},e.getOuterRect=function(){return this.area.getOuterRect()},e.getOrder=function(){var t=this.continuations.map((function(t){return t.float}));return Math.min.apply(null,t.map((function(t){return t.getOrder()})))},e.shouldBeStashedBefore=function(t){return this.getOrder()=0;r--){var o=this.children[r];if(o.floatReference===e&&o.flowName===u&&yr(o.generatingNodePosition,n))return o;if(o=o.getPreviousSiblingOf(null,e,u,n))return o}return null},e.getPreviousSibling=function(){for(var t,e=this,u=this.parent;u;){if(t=u.getPreviousSiblingOf(e,this.floatReference,this.flowName,this.generatingNodePosition))return t;e=u,u=u.parent}return null},e.getContainer=function(t){return t&&t!==this.floatReference?this.getParent(t).getContainer(t):this.container},e.setContainer=function(t){this.container=t,this.reattachFloatFragments()},e.addPageFloat=function(t){this.floatStore.addPageFloat(t)},e.getPageFloatLayoutContext=function(t){return t===this.floatReference?this:this.getParent(t).getPageFloatLayoutContext(t)},e.findPageFloatByNodePosition=function(t){return this.floatStore.findPageFloatByNodePosition(t)},e.forbid=function(t){var e=t.getId(),u=t.floatReference;u===this.floatReference?this.forbiddenFloats.includes(e)||(this.forbiddenFloats.push(e),(new ns).findByFloat(t).forbid(t,this)):this.getParent(u).forbid(t)},e.isForbidden=function(t){var e=t.getId(),u=t.floatReference;return u===this.floatReference?this.forbiddenFloats.includes(e):this.getParent(u).isForbidden(t)},e.addPageFloatFragment=function(t,e){var u=t.floatReference;u!==this.floatReference?this.getParent(u).addPageFloatFragment(t,e):this.floatFragments.includes(t)||(this.floatFragments.push(t),this.floatFragments.sort((function(t,e){return t.getOrder()-e.getOrder()}))),e||this.invalidate()},e.removePageFloatFragment=function(t,e){var u=t.floatReference;if(u!==this.floatReference)this.getParent(u).removePageFloatFragment(t,e);else{var n=this.floatFragments.indexOf(t);if(n>=0){var i=this.floatFragments.splice(n,1)[0],r=i.area&&i.area.element;r&&r.parentNode&&r.parentNode.removeChild(r),e||this.invalidate()}}},e.findPageFloatFragment=function(t){if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).findPageFloatFragment(t);var e=this.floatFragments.findIndex((function(e){return e.hasFloat(t)}));return e>=0?this.floatFragments[e]:null},e.hasFloatFragments=function(t){return!(!(this.floatFragments.length>0)||t&&!this.floatFragments.some(t))||!!this.parent&&this.parent.hasFloatFragments(t)},e.hasContinuingFloatFragmentsInFlow=function(t){return this.hasFloatFragments((function(e){return e.continues&&e.getFlowName()===t}))},e.registerPageFloatAnchor=function(t,e){this.floatAnchors[t.getId()]=e},e.collectPageFloatAnchors=function(){var t=Object.assign({},this.floatAnchors);return this.children.reduce((function(t,e){return Object.assign(t,e.collectPageFloatAnchors())}),t)},e.isAnchorAlreadyAppeared=function(t){if(this.getDeferredPageFloatContinuations().some((function(e){return e.float.getId()===t})))return!0;var e=this.collectPageFloatAnchors()[t];return!!e&&!(!this.container||!this.container.element)&&this.container.element.contains(e)},e.deferPageFloat=function(t){var e=t.float;if(e.floatReference===this.floatReference){var u=this.floatsDeferredToNext.findIndex((function(t){return t.float===e}));u>=0?this.floatsDeferredToNext.splice(u,1,t):this.floatsDeferredToNext.push(t)}else this.getParent(e.floatReference).deferPageFloat(t)},e.hasPrecedingFloatsDeferredToNext=function(t,e){if(!e&&t.floatReference!==this.floatReference)return this.getParent(t.floatReference).hasPrecedingFloatsDeferredToNext(t,!1);var u=t.getOrder();return!!this.floatsDeferredToNext.some((function(e){return e.float.getOrder()e&&(!u||i>u.getOrder())&&(u=n)}))})),this.parent){var n=this.parent.getLastFollowingFloatInFragments(t);n&&(!u||n.getOrder()>u.getOrder())&&(u=n)}return u},e.getDeferredPageFloatContinuations=function(t){t=t||this.flowName;var e=this.floatsDeferredFromPrevious.filter((function(e){return!t||e.float.flowName===t}));return this.parent&&(e=this.parent.getDeferredPageFloatContinuations(t).concat(e)),e.sort((function(t,e){return t.float.getOrder()-e.float.getOrder()}))},e.getPageFloatContinuationsDeferredToNext=function(t){t=t||this.flowName;var e=this.floatsDeferredToNext.filter((function(e){return!t||e.float.flowName===t}));return this.parent?this.parent.getPageFloatContinuationsDeferredToNext(t).concat(e):e},e.getFloatsDeferredToNextInChildContexts=function(){for(var t=[],e=[],u=this.children.length-1;u>=0;u--){var n=this.children[u];e.includes(n.flowName)||(e.push(n.flowName),t=(t=t.concat(n.floatsDeferredToNext.map((function(t){return t.float})))).concat(n.getFloatsDeferredToNextInChildContexts()))}return t},e.checkAndForbidNotAllowedFloat=function(){if(this.checkAndForbidFloatFollowingDeferredFloat())return!0;for(var t=this.floatFragments.length-1;t>=0;t--){var e=this.floatFragments[t],u=e.findNotAllowedFloat(this);if(u)return this.locked?this.invalidate():(this.removePageFloatFragment(e),this.forbid(u),this.removeEndFloatFragments(e.floatSide)),!0}return!(this.floatReference!==qa.REGION||!this.parent.locked)&&this.parent.checkAndForbidNotAllowedFloat()},e.checkAndForbidFloatFollowingDeferredFloat=function(){var t=this,e=this.getFloatsDeferredToNextInChildContexts(),u=this.floatFragments.reduce((function(t,e){return t.concat(e.continuations.map((function(t){return t.float})))}),[]);u.sort((function(t,e){return e.getOrder()-t.getOrder()}));for(var n,i=function(){var u=n.value,i=u.getOrder();if(e.some((function(t){return!u.isAllowedToPrecede(t)&&i>t.getOrder()}))){if(t.locked)t.invalidate();else{t.forbid(u);var r=t.findPageFloatFragment(u);t.removePageFloatFragment(r)}return{v:!0}}},r=O(u);!(n=r()).done;){var o=i();if("object"==typeof o)return o.v}return!1},e.finish=function(){var t=this;if(!this.checkAndForbidNotAllowedFloat()){for(var e=this.floatsDeferredToNext.length-1;e>=0;e--)if(!this.floatsDeferredToNext[e].float.isAllowedOnContext(this)){if(this.locked)return void this.invalidate();this.floatsDeferredToNext.splice(e,1)}this.floatsDeferredFromPrevious.forEach((function(e){t.floatsDeferredToNext.findIndex((function(t){return e.equals(t)}))>=0||t.floatFragments.some((function(t){return t.hasFloat(e.float)}))||t.floatsDeferredToNext.push(e)}))}},e.hasSameContainerAs=function(t){return!!this.container&&!!t.container&&this.container.element===t.container.element},e.invalidate=function(){var t=this;this.invalidated=!0,this.locked||(this.container&&(this.children.forEach((function(e){t.hasSameContainerAs(e)&&e.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),this.container.clear()),this.children.forEach((function(t){t.layoutConstraints.splice(0)})),this.children.splice(0),Object.keys(this.floatAnchors).forEach((function(e){delete t.floatAnchors[e]})))},e.detachChildren=function(){var t=this.children.splice(0);return t.forEach((function(t){t.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),t},e.attachChildren=function(t){var e=this;t.forEach((function(t){e.children.push(t),t.reattachFloatFragments()}))},e.isInvalidated=function(){return this.invalidated||!!this.parent&&this.parent.isInvalidated()},e.validate=function(){this.invalidated=!1},e.toLogical=function(t){return Xa(t,this.writingMode.toString(),this.direction.toString())},e.toPhysical=function(t){return Ga(t,this.writingMode.toString(),this.direction.toString())},e.removeEndFloatFragments=function(t){var e=this.toLogical(t);if("block-end"===e||"inline-end"===e)for(var u=0;u0&&(a=l.reduce((function(t,e){if(u&&!u(e,n))return t;var i=n.toLogical(e.floatSide),r=e.area,a=e.continuations[0].float.floatMinWrapBlock,l=t.top,D=t.left,h=t.bottom,c=t.right,d=t.floatMinWrapBlockStart,f=t.floatMinWrapBlockEnd;switch(i){case"inline-start":r.vertical?l=Math.max(l,r.top+r.height):D=Math.max(D,r.left+r.width);break;case"block-start":r.vertical?(a&&r.leftl&&(d=s(a,r.rootViewNodes[0],o.y2-o.y1)),l=Math.max(l,r.top+r.height));break;case"inline-end":r.vertical?h=Math.min(h,r.top):c=Math.min(c,r.left);break;case"block-end":r.vertical?(a&&r.left+r.width>D&&(f=s(a,r.rootViewNodes[0],o.x2-o.x1)),D=Math.max(D,r.left+r.width)):(a&&r.topi.left&&(i.left=r.left,i.floatMinWrapBlockEnd=r.floatMinWrapBlockEnd)):(r.top>i.top&&(i.top=r.top,i.floatMinWrapBlockStart=r.floatMinWrapBlockStart),r.bottom=0;e--){var u=us[e];if(u.appliesToNodeContext(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},e.findByFloat=function(t){for(var e=us.length-1;e>=0;e--){var u=us[e];if(u.appliesToFloat(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},t}();ns.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return $a(t.floatReference)},e.appliesToFloat=function(t){return!0},e.createPageFloat=function(t,e,u){var n=t.floatReference,i=t.floatSide,r=t.toNodePosition();return u.resolveFloatReferenceFromColumnSpan(n,t.columnSpan,t).thenAsync((function(u){var o=new Qa(r,n=u,i,t.clearSide,e.flowName,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)}))},e.createPageFloatFragment=function(t,e,u,n){return new Ja(t[0].float.floatReference,e,t,u,n)},e.findPageFloatFragment=function(t,e){return e.findPageFloatFragment(t)},e.adjustPageFloatArea=function(t,e,u){},e.forbid=function(t,e){},t}()));var is=Ja,rs=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,"block-end",null,n,r)||this).footnotePolicy=void 0,o.footnotePolicy=i,o}return x(e,t),e.prototype.isAllowedToPrecede=function(t){return!(t instanceof e)},e}(Qa),os=function(t){function e(e,u,n,i){return t.call(this,e,"block-end",u,n,i)||this}x(e,t);var u=e.prototype;return u.getOrder=function(){return 1/0},u.shouldBeStashedBefore=function(t){return t instanceof rs||this.getOrder()=s.left&&s.bottom>=s.top)return t.after?n?s.left:s.bottom:n?s.right:s.top}return NaN}var l=i.ownerDocument.createRange(),D=i.textContent.length;if(!D)return NaN;t.after&&(u+=D),u>=D&&(u=D-1),l.setStart(i,u),l.setEnd(i,u+1);var h=e.getRangeClientRects(l);return(h=h.filter((function(t){return t.right>t.left&&t.bottom>t.top}))).length?n?Math.min.apply(null,h.map((function(t){return t.left}))):Math.max.apply(null,h.map((function(t){return t.bottom}))):NaN}function Es(t,e,u){var n=e.clientLayout.getElementClientRect(t),i=e.getComputedMargin(t);return u?n.width+i.left+i.right:n.height+i.top+i.bottom}function Cs(t){for(;t;){if(t.parentNode===t.ownerDocument)return!1;t=t.parentNode}return!0}function Fs(t,e){if(t)for(var u;(u=t.lastChild)!=e;)t.removeChild(u)}function As(t){return!!t.getAttribute(pr)}function gs(t){var e;if(1!==(null==t?void 0:t.nodeType))return!1;var u=t;if(As(u))return!0;var n=null==(e=u.style)?void 0:e.position;return"absolute"===n||"fixed"===n}function vs(t){var e=null==t?void 0:t.viewNode;return 1===(null==e?void 0:e.nodeType)&&As(e)}function ms(t){for(var e=t.parent;e;e=e.parent)if("inline"!==e.display&&ds(e.display))return e;return null}ns.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return"footnote"===t.floatSide},e.appliesToFloat=function(t){return t instanceof rs},e.createPageFloat=function(t,e,u){var n=qa.REGION,i=e.getPageFloatLayoutContext(n);e.getPageFloatLayoutContext(qa.PAGE).hasSameContainerAs(i)&&(n=qa.PAGE);var r=t.toNodePosition(),o=new rs(r,n,e.flowName,t.footnotePolicy,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)},e.createPageFloatFragment=function(t,e,u,n){return new os(t[0].float.floatReference,t,u,n)},e.findPageFloatFragment=function(t,e){return e.getPageFloatLayoutContext(t.floatReference).floatFragments.filter((function(t){return t instanceof os}))[0]||null},e.adjustPageFloatArea=function(t,e,u){t.isFootnote=!0,t.adjustContentRelativeSize=!1;var n=t.element;t.vertical=u.layoutContext.applyFootnoteStyle(e.vertical,u.layoutContext.nodeContext&&"rtl"===u.layoutContext.nodeContext.direction,n),t.convertPercentageSizesToPx(n),u.setComputedInsets(n,t),u.setComputedWidthAndHeight(n,t)},e.forbid=function(t,e){var u=t;if(u.footnotePolicy===Je.line){var n=new as(u);e.addLayoutConstraint(n,u.floatReference)}},t}()));var Bs=function(){function t(){}var e=t.prototype;return e.calculateOffset=function(t){return ys(this.getNodeContext(),t.collectElementsOffset())},e.breakPositionChosen=function(t){},e.getNodeContext=function(){return null},t}();function ys(t,e){return{current:e.reduce((function(e,u){return e+u.calculateOffset(t)}),0),minimum:e.reduce((function(e,u){return e+u.calculateMinimumOffset(t)}),0)}}var ws=function(t){function e(e,u,n,i){var r;return(r=t.call(this)||this).position=void 0,r.breakOnEdge=void 0,r.overflows=void 0,r.computedBlockSize=void 0,r.overflowIfRepetitiveElementsDropped=void 0,r.isEdgeUpdated=!1,r.edge=0,r.position=e,r.breakOnEdge=u,r.overflows=n,r.computedBlockSize=i,r.overflowIfRepetitiveElementsDropped=n,r}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return this.updateOverflows(t),e1){for(var r=i.length-1,o=0;o=0;w--){var N,b=e[w];if(c(b)){m=!0;break}if(!b.display&&b.viewNode.nodeType===Node.TEXT_NODE&&b.viewNode.textContent.length>0){F=b.viewNode;break}if(b.display&&!/^(inline|ruby)\b/.test(b.display)||1===(null==(N=b.viewNode)?void 0:N.nodeType)&&("br"===b.viewNode.localName||Ys[b.viewNode.localName]))break;0===w&&(g=!0,n&&(v=!0,m=!0))}for(var S=a+1;S0){A=T.viewNode;break}if(T.display&&!/^(inline|ruby)\b/.test(T.display)||1===(null==(x=T.viewNode)?void 0:x.nodeType)&&("br"===T.viewNode.localName||Ys[T.viewNode.localName])){S===e.length-1&&r(T.viewNode)&&(y=!0);break}if(S===e.length-1){B=!0,y=!0;for(var I=T.viewNode.nextSibling;I;I=I.nextSibling)if(!r(I)){y=!1;break}}}u.processTextSpacing(o.viewNode,g,v,m,B,y,F,A,p,E,C,f,o.vertical)}},a=0;ai.left+i.width-u.width/10:u.lefti.top+i.height-u.height/10||u.top+u.heightu.top+e.width||e.left>u.left+u.width-e.width/10||e.left+e.widthu.left+e.height||e.top+e.heightu.top+u.height-e.height/10)}var g,v=!1,m=!1,B=!1,y=!1;if(u&&D.first&&/^["'\(\[\{\xAB\xBB\u0F3A\u0F3C\u169B\u2018-\u201F\u2039\u203A\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E22\u2E24\u2E26\u2E28\u2E42\u2E55\u2E57\u2E59\u2E5B\u3000\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-open",v=!0,m=!0):r&&D.last&&/^["'\)\]\}\xAB\xBB\u0F3B\u0F3D\u169C\u2018\u2019\u201B-\u201D\u201F\u2039\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-close",v=!0,B=!0):D.end&&/^[\u3001\u3002\uFF0C\uFF0E\uFF61\uFF64](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-close",v=!0,y=!0):(l.trimStart||l.trimAdjacent)&&/^[\u2018\u201C\u2329\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFF08\uFF3B\uFF5B\uFF5F](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-open",v=!0):(l.trimEnd||l.trimAdjacent)&&(/^[\u2019\u201D\u232A\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFF09\uFF3D\uFF5D\uFF60](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)||"zh-hans"===h&&/^[\uFF1A\uFF1B](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)||"zh-hant"!==h&&/^[\u3001\u3002\uFF0C\uFF0E](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E))&&(g="viv-ts-close",v=!0),v){var w=function(){return c?N.offsetLeft:N.offsetTop};if("viv-ts-inner"===t.parentElement.localName)return;var N=C.createElement(g),b=C.createElement("viv-ts-inner");N.appendChild(b),t.parentNode.insertBefore(N,t),b.appendChild(t);var S=.7*parseFloat(C.defaultView.getComputedStyle(N).fontSize),x=(c?b.offsetHeight:b.offsetWidth)>S;if(x||m||B||y)if("viv-ts-open"===g){if(m)N.className="viv-hang-first";else if(u||n)N.className=l.trimStart&&!l.spaceFirst?"viv-ts-trim":"viv-ts-space";else if(!l.trimStart&&F())N.className="viv-ts-space";else if(l.trimAdjacent&&o&&/[\(\)\[\]\{\}\xAB\xB7\xBB\u0F3A-\u0F3D\u169B\u169C\u2018-\u201F\u2027\u2039\u203A\u2045\u2046\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E29\u2E42\u2E55-\u2E5C\u3000-\u3002\u3008-\u3011\u3014-\u301B\u301D-\u301F\u30FB\uFD3E\uFD3F\uFE17\uFE18\uFE35-\uFE44\uFE47\uFE48\uFE59-\uFE5E\uFF08\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3B\uFF3D\uFF5B\uFF5D\uFF5F\uFF60\uFF62\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)&&(!/[\)\]\}\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)||"viv-ts-inner"===o.parentElement.localName&&(c?o.parentElement.offsetHeight:o.parentElement.offsetWidth)>S))N.className="viv-ts-trim";else if(l.trimStart&&F()){var T=w();N.className="viv-ts-auto",T!==w()||F()||(N.className="viv-ts-trim")}}else if("viv-ts-close"===g)if(B)N.className=x?"viv-hang-last":"viv-hang-last viv-hang-hw";else if(r||i)if(y){var I=N.offsetLeft,P=N.offsetTop;N.className=x?"viv-hang-end":"viv-hang-end viv-hang-hw",N.offsetLeft===I&&N.offsetTop===P&&(N.className="")}else N.className=l.trimEnd?"viv-ts-trim":"viv-ts-space";else if(a&&/^[\)\]\}\xB7\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u2027\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3000-\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\u30FB\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3D\uFF5D\uFF60\uFF63]/.test(a.textContent))x&&l.trimAdjacent&&(N.className="viv-ts-trim");else if(y){var R=A(),k=R&&D.allowEnd;k||(N.className=x?"viv-hang-end":"viv-hang-end viv-hang-hw"),x?k&&l.trimEnd&&!l.allowEnd?N.className="viv-ts-auto":k||A()?!R&&D.allowEnd&&(!l.trimEnd||l.allowEnd?(N.className="viv-ts-space",A()||(l.trimEnd?(N.className="viv-ts-auto",A()||(N.className="viv-hang-end")):N.className="viv-hang-end")):(N.className="viv-ts-auto",A()||(N.className="viv-hang-end"))):N.className="":R||A()||(N.className="")}else if(l.trimEnd)if(A())N.className=l.allowEnd?"viv-ts-space":"viv-ts-auto";else{var L=w();N.className="viv-ts-auto",L===w()&&(N.className="")}}function O(t){var e,u=null==t||null==(e=t.ownerDocument.defaultView)?void 0:e.getComputedStyle(t);return!!u&&("upright"===u.textOrientation||"all"===u.textCombineUpright||"horizontal"===u["-webkit-text-combine"])}function _(t,e){if(1===t.nodeType){var u=C.defaultView.getComputedStyle(t);if(parseFloat(u.marginInlineEnd)||parseFloat(u.borderInlineEndWidth)||parseFloat(u.paddingInlineEnd))return!0}var n=t.parentElement;if(n&&!n.contains(e))return _(n,e);if(1===e.nodeType){var i=C.defaultView.getComputedStyle(e);if(parseFloat(i.marginInlineStart)||parseFloat(i.borderInlineStartWidth)||parseFloat(i.paddingInlineStart))return!0}var r=e.parentElement;return!(!r||r.contains(t))&&_(t,r)}(s.ideographAlpha||s.ideographNumeric)&&(!(o&&/^(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/.test(E)&&(s.ideographAlpha&&/(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF]))(?:[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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)||s.ideographNumeric&&/(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)))||c&&O(o.parentElement)||_(o,t)||t.parentNode.insertBefore(C.createElement("viv-ts-thin-sp"),t),!(a&&/(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)&&(s.ideographAlpha&&/^(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF]))(?:[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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/.test(a.textContent)||s.ideographNumeric&&/^(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])/.test(a.textContent)))||c&&O(a.parentElement)||_(t,a)||t.parentNode.insertBefore(C.createElement("viv-ts-thin-sp"),t.nextSibling))},u.registerHooks=function(){p(e.HOOKS.POLYFILLED_INHERITED_PROPS,this.getPolyfilledInheritedProps.bind(this)),p(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT,this.preprocessSingleDocument.bind(this)),p(e.HOOKS.POST_LAYOUT_BLOCK,this.postLayoutBlock.bind(this),!0)},t}());qs.registerHooks();var $s=(new DOMParser).parseFromString('',"text/xml"),Qs=["footnote-marker","first-5-lines","first-4-lines","first-3-lines","first-2-lines","first-line","first-letter","before","","after"],Zs="data-adapt-pseudo";function Js(t){return t.getAttribute(Zs)||""}function tl(t,e){t.setAttribute(Zs,e)}var el=function(){function t(t,e,u,n,i){this.element=void 0,this.style=void 0,this.styler=void 0,this.context=void 0,this.exprContentListener=void 0,this.contentProcessed={},this.element=t,this.style=e,this.styler=u,this.context=n,this.exprContentListener=i}var e=t.prototype;return e.getStyle=function(t,e){var u=Js(t);this.styler&&u&&u.match(/after$/)&&(this.style=this.styler.getStyle(this.element,!0),this.styler=null);var n=oo(this.style,"_pseudos")[u]||{};if(u.match(/^first-/)&&!n["x-first-pseudo"]){var i,r=1;"first-letter"==u?r=0:null!=(i=u.match(/^first-([0-9]+)-lines$/))&&(r=i[1]-0),n["x-first-pseudo"]=new $r(new He(r),0)}return n},e.processContent=function(t,e,u){var n=Js(t);if(!this.contentProcessed[n]){this.contentProcessed[n]=!0;var i=e.content;i&&Mr(i)&&(i.visit(new _r(t,this.context,i,this.exprContentListener)),function(t){qs.preprocessForTextSpacing(t)}(t))}},t}(),ul=Vi.registerFragmentIndex,nl=function(){function t(t,e){this.sourceNode=void 0,this.styler=void 0,this.sourceNode=t,this.styler=e}var e=t.prototype;return e.createElement=function(t,e){var u=this,n=e.viewNode.ownerDocument.createElement("div"),i=new cl(t,n,e),r=i.getColumn().pageBreakType;return i.getColumn().pageBreakType=null,i.layout(this.createNodePositionForPseudoElement(),!0).thenAsync((function(){u.styler.contentProcessed["after-if-continues"]=!1,i.getColumn().pageBreakType=r;var t=n.firstChild;return et(t,"display","block"),Rn(t)}))},e.createNodePositionForPseudoElement=function(){var t=$s.createElementNS(W.XHTML,"div");tl(t,"after-if-continues");var e=this.createShadowContext(t);return new Pr({steps:[{node:t,shadowType:e.type,shadowContext:e,nodeShadow:null,shadowSibling:null}],offsetInNode:0,after:!1,preprocessedTextContent:null})},e.createShadowContext=function(t){return new Sr(this.sourceNode,t,null,null,null,ur.ShadowType.ROOTED,this.styler)},t}(),il=function(){function t(t,e,u){this.nodeContext=void 0,this.afterIfContinues=void 0,this.pseudoElementHeight=void 0,this.flagmentLayoutConstraintType="AfterIfContinue",this.nodeContext=t,this.afterIfContinues=e,this.pseudoElementHeight=u}var e=t.prototype;return e.allowLayout=function(t,e,u){return!(e&&!t||t&&t.overflow)},e.nextCandidate=function(t){return!1},e.postLayout=function(t,e,u,n){},e.finishBreak=function(t,e){var u=this;return this.getRepetitiveElements().affectTo(t)?this.afterIfContinues.createElement(e,this.nodeContext).thenAsync((function(t){return u.nodeContext.viewNode.appendChild(t),Rn(!0)})):Rn(!0)},e.getRepetitiveElements=function(){return new rl(this.nodeContext,this.pseudoElementHeight)},e.equalsTo=function(e){return e instanceof t&&this.afterIfContinues==e.afterIfContinues},e.getPriorityOfFinishBreak=function(){return 9},t}(),rl=function(){function t(t,e){this.nodeContext=void 0,this.pseudoElementHeight=void 0,this.nodeContext=t,this.pseudoElementHeight=e}var e=t.prototype;return e.calculateOffset=function(t){return this.affectTo(t)?this.pseudoElementHeight:0},e.calculateMinimumOffset=function(t){return this.calculateOffset(t)},e.affectTo=function(t){if(!t)return!1;var e=t.shadowContext?t.shadowContext.owner:t.sourceNode;if(e===this.nodeContext.sourceNode)return!!t.after;for(var u=e.parentNode;u;u=u.parentNode)if(u===this.nodeContext.sourceNode)return!0;return!1},t}();function ol(t,e){if(!t||!t.afterIfContinues||t.after||e.isFloatNodeContext(t))return Rn(t);var u=t.afterIfContinues;return u.createElement(e,t).thenAsync((function(n){var i=function(t,e,u){var n=t.viewNode;n.appendChild(u);var i=Es(u,e,t.vertical);return n.removeChild(u),i}(t,e,n);return e.fragmentLayoutConstraints.push(new il(t,u,i)),Rn(t)}))}function al(t,e){return t.thenAsync((function(t){return ol(t,e)}))}var sl={img:!0,svg:!0,audio:!0,video:!0},ll=function(){function t(t){this.constraints=void 0,this.constraints=t}return t.prototype.allowLayout=function(t){return this.constraints.every((function(e){return e.allowLayout(t)}))},t}(),Dl=function(t){function e(e,u){var n;return(n=t.call(this)||this).checkPoints=void 0,n.penalty=void 0,n.alreadyEvaluated=!1,n.breakNodeContext=null,n.checkPoints=e,n.penalty=u,n}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return e0),this.alreadyEvaluated=!0),this.breakNodeContext)},u.getMinBreakPenalty=function(){return this.penalty},u.getNodeContext=function(){return this.alreadyEvaluated?this.breakNodeContext:this.checkPoints[this.checkPoints.length-1]},e}(Bs),hl=function(t){function u(e,u,n,i,r){var o;return(o=t.call(this,e)||this).layoutContext=void 0,o.clientLayout=void 0,o.layoutConstraint=void 0,o.pageFloatLayoutContext=void 0,o.last=void 0,o.viewDocument=void 0,o.flowRootFormattingContext=null,o.isFloat=!1,o.isFootnote=!1,o.startEdge=0,o.endEdge=0,o.beforeEdge=0,o.afterEdge=0,o.footnoteEdge=0,o.box=null,o.chunkPositions=null,o.bands=null,o.overflown=!1,o.breakPositions=null,o.pageBreakType=null,o.forceNonfitting=!0,o.leftFloatEdge=0,o.rightFloatEdge=0,o.bottommostFloatTop=0,o.stopAtOverflow=!0,o.lastAfterPosition=null,o.fragmentLayoutConstraints=[],o.pseudoParent=null,o.nodeContextOverflowingDueToRepetitiveElements=null,o.blockDistanceToBlockEndFloats=NaN,o.breakAtTheEdgeBeforeFloat=null,o.layoutContext=u,o.clientLayout=n,o.layoutConstraint=i,o.pageFloatLayoutContext=r,o.last=e.lastChild,o.viewDocument=e.ownerDocument,r.setContainer(k(o)),o}x(u,t);var n=u.prototype;return n.getTopEdge=function(){return this.vertical?this.rtl?this.endEdge:this.startEdge:this.beforeEdge},n.getBottomEdge=function(){return this.vertical?this.rtl?this.startEdge:this.endEdge:this.afterEdge},n.getLeftEdge=function(){return this.vertical?this.afterEdge:this.rtl?this.endEdge:this.startEdge},n.getRightEdge=function(){return this.vertical?this.beforeEdge:this.rtl?this.startEdge:this.endEdge},n.isFloatNodeContext=function(t){return!(!t.floatSide||this.isFloat&&!t.parent)},n.stopByOverflow=function(t){return this.stopAtOverflow&&!!t&&t.overflow},n.isOverflown=function(t){return this.vertical?tthis.footnoteEdge},n.getExclusions=function(){var t=this.pageFloatLayoutContext.getFloatFragmentExclusions();return this.exclusions.concat(t)},n.openAllViews=function(t){var e=this,u=Pn("openAllViews"),n=t.steps;this.layoutContext.setViewRoot(this.element,this.isFootnote);var i=n.length-1,r=null;return u.loop((function(){for(;i>=0&&(r=Nr(n[i],r),i!==n.length-1||r.formattingContext||(r.formattingContext=e.flowRootFormattingContext),0!=i||(r.offsetInNode=e.calculateOffsetInNodeForNodeContext(t),r.after=t.after,r.preprocessedTextContent=t.preprocessedTextContent,!r.after));){var u=e.layoutContext.setCurrent(r,0==i&&0==r.offsetInNode);if(i--,u.isPending())return u}return Rn(!1)})).then((function(){u.finish(r)})),u.result()},n.calculateOffsetInNodeForNodeContext=function(t){return t.preprocessedTextContent?sr(t.preprocessedTextContent,t.offsetInNode,1):t.offsetInNode},n.maybePeelOff=function(t,e){if(t.firstPseudo&&t.inline&&!t.after&&0==t.firstPseudo.count&&1!=t.viewNode.nodeType){var u,n,i=t.viewNode.textContent,r=i.match(_),o=r?r[0].length:0;if(!r&&3===(null==(u=t.sourceNode)?void 0:u.nodeType)&&3===(null==(n=t.sourceNode.nextSibling)?void 0:n.nodeType)&&i===t.sourceNode.textContent){var a=i+t.sourceNode.nextSibling.textContent,s=a.match(_);if(s){var l=s[0];o=l.length,t.sourceNode.textContent=l,t.viewNode.textContent=l,t.sourceNode.nextSibling.textContent=a.substr(o)}}return this.layoutContext.peelOff(t,o)}return Rn(t)},n.buildViewToNextBlockEdge=function(t,e){var u=this,n=!1,i=Pn("buildViewToNextBlockEdge");return i.loopWithFrame((function(i){t.viewNode&&!vs(t)&&e.push(t.copy()),u.maybePeelOff(t,0).then((function(r){r!==t&&(vs(t=r)||e.push(t.copy())),u.nextInTree(t).then((function(e){(t=e)?(!n&&u.layoutConstraint.allowLayout(t)||(n=!0,(t=t.modify()).overflow=!0),u.isFloatNodeContext(t)&&($a(t.floatReference)||"footnote"===t.floatSide)?u.layoutFloatOrFootnote(t).then((function(e){t=e,u.pageFloatLayoutContext.isInvalidated()&&(t=null),t?i.continueLoop():i.breakLoop()})):t.inline?i.continueLoop():i.breakLoop()):i.breakLoop()}))}))})).then((function(){i.finish(t)})),i.result()},n.nextInTree=function(t,e){return al(this.layoutContext.nextInTree(t,e),this)},n.buildDeepElementView=function(t){var e=this;if(!t.viewNode)return Rn(t);var u=[],n=t.sourceNode,i=Pn("buildDeepElementView");return i.loopWithFrame((function(i){t.viewNode&&t.inline&&!vs(t)?u.push(t.copy()):(u.length>0&&e.postLayoutBlock(t,u),u=[]),e.maybePeelOff(t,0).then((function(r){var o=r;if(o!==t){for(var a=o;a&&a.sourceNode!=n;)a=a.parent;if(null==a)return t=o,void i.breakLoop();vs(o)||u.push(o.copy())}e.nextInTree(o).then((function(u){(t=u)&&t.sourceNode!=n?e.layoutConstraint.allowLayout(t)?i.continueLoop():((t=t.modify()).overflow=!0,e.stopAtOverflow?i.breakLoop():i.continueLoop()):i.breakLoop()}))}))})).then((function(){u.length>0&&e.postLayoutBlock(t,u),i.finish(t)})),i.result()},n.createFloat=function(t,e,u,n){var i=this.viewDocument.createElement("div");return this.vertical?(n>=this.height&&(n-=.1),et(i,"height",u+"px"),et(i,"width",n+"px")):(u>=this.width&&(u-=.1),et(i,"width",u+"px"),et(i,"height",n+"px")),et(i,"float",e),et(i,"clear",e),this.element.insertBefore(i,t),i},n.killFloats=function(){for(var t=this.element.firstChild;t;){var e=t.nextSibling;if(1==t.nodeType){var u=t,n=u.style.cssFloat;if("left"!=n&&"right"!=n&&"none"!==n)break;this.element.removeChild(u)}t=e}},n.createFloats=function(){for(var t,e=this.element.firstChild,u=this.bands,n=this.vertical?this.getTopEdge():this.getLeftEdge(),i=this.vertical?this.getBottomEdge():this.getRightEdge(),r=!1,o=O(u);!(t=o()).done;){var a=t.value,s=a.y2-a.y1;a.left=this.createFloat(e,"left",a.x1-n,s),a.right=this.createFloat(e,"right",i-a.x2,s),r||(a.x1>=i||a.x2<=n?et(a.right,"float","none"):r=!0)}},n.calculateEdge=function(t,e,u,n){var i;if(t&&Cs(t.viewNode))return NaN;if(t&&t.after&&!t.inline&&(i=ps(t,this.clientLayout,0,this.vertical),!isNaN(i)))return i;for(var r=n-(t=e[u]).boxOffset;;){if(i=ps(t,this.clientLayout,r,this.vertical),!isNaN(i))return i;if(r>0)r--;else{if(--u<0)return this.beforeEdge;1!=(t=e[u]).viewNode.nodeType&&(r=t.viewNode.textContent.length)}}},n.parseComputedLength=function(t){if("number"==typeof t)return t;var e=t.match(/^(-?[0-9]*(\.[0-9]*)?)px$/);return e?parseFloat(e[0]):0},n.getComputedMargin=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.marginLeft),u.top=this.parseComputedLength(e.marginTop),u.right=this.parseComputedLength(e.marginRight),u.bottom=this.parseComputedLength(e.marginBottom)),u},n.getComputedPaddingBorder=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)),u},n.getComputedInsets=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);if(e){if("border-box"==e.boxSizing)return this.getComputedMargin(t);u.left=this.parseComputedLength(e.marginLeft)+this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.marginTop)+this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.marginRight)+this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.marginBottom)+this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)}return u},n.setComputedInsets=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.marginLeft=this.parseComputedLength(u.marginLeft),e.borderLeft=this.parseComputedLength(u.borderLeftWidth),e.paddingLeft=this.parseComputedLength(u.paddingLeft),e.marginTop=this.parseComputedLength(u.marginTop),e.borderTop=this.parseComputedLength(u.borderTopWidth),e.paddingTop=this.parseComputedLength(u.paddingTop),e.marginRight=this.parseComputedLength(u.marginRight),e.borderRight=this.parseComputedLength(u.borderRightWidth),e.paddingRight=this.parseComputedLength(u.paddingRight),e.marginBottom=this.parseComputedLength(u.marginBottom),e.borderBottom=this.parseComputedLength(u.borderBottomWidth),e.paddingBottom=this.parseComputedLength(u.paddingBottom))},n.setComputedWidthAndHeight=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.width=this.parseComputedLength(u.width),e.height=this.parseComputedLength(u.height))},n.layoutUnbreakable=function(t){return this.buildDeepElementView(t)},n.layoutFloat=function(t){var e=this,u=Pn("layoutFloat"),n=t.viewNode,i=function(t,e,u){var n=e?"vertical-rl":"horizontal-tb";if("top"!==t&&"bottom"!==t||(t=Xa(t,n,u)),"block-start"===t&&(t="inline-start"),"block-end"===t&&(t="inline-end"),"inline-start"===t||"inline-end"===t){var i=function(t,e){var u=Ka[e];if(!u)throw new Error("unknown writing-mode: "+e);for(var n=0;nt.y2)return!1;for(var l=t.x1,D=t.x2,h=a;hl&&(l=c.x1),c.x2=e.length)return"left"==n?(u.x1=l,u.x2=l+r):(u.x1=D-r,u.x2=D),u.y2+=i-u.y1,u.y1=i,!0;i=e[a].y2,a++}}(p,e.bands,E,i),e.vertical&&(s=yu(E));var A,g=e.getComputedInsets(n);et(n,"width",s.x2-s.x1-g.left-g.right+"px"),et(n,"height",s.y2-s.y1-g.top-g.bottom+"px"),et(n,"position","absolute"),et(n,"display",t.display);var v=null;if(h&&(v=h.containingBlockForAbsolute?h:h.getContainingBlockForAbsolute()),v){var m=v.viewNode.ownerDocument.createElement("div");m.style.position="absolute",v.vertical?m.style.right="0":m.style.left="0",m.style.top="0",v.viewNode.appendChild(m),A=e.clientLayout.getElementClientRect(m),v.viewNode.removeChild(m)}else A={left:e.getLeftEdge()-e.paddingLeft,right:e.getRightEdge()+e.paddingRight,top:e.getTopEdge()-e.paddingTop};(v?v.vertical:e.vertical)?et(n,"right",A.right-s.x2+"px"):et(n,"left",s.x1-A.left+"px"),et(n,"top",s.y1-A.top+"px"),t.clearSpacer&&(t.clearSpacer.parentNode.removeChild(t.clearSpacer),t.clearSpacer=null);var B=e.vertical?s.x1:s.y2,y=e.vertical?s.x2:s.y1;e.isOverflown(B)&&0!=e.breakPositions.length?((t=t.modify()).overflow=!0,u.finish(t)):(e.killFloats(),p=new lu(e.getLeftEdge(),e.getTopEdge(),e.getRightEdge(),e.getBottomEdge()),e.vertical&&(p=Bu(p)),function(t,e,u,n,i){for(n||(n=[new du(u.y1,u.y2,u.x1,u.x2)]);n.length>0&&n[0].y2<=t.y1;)n.shift();if(0!=n.length){var r;n[0].y1D.y2&&(e.splice(s,0,new du(D.y2,r.y2,r.x1,r.x2)),r.y2=D.y2),D.x1!=D.x2&&("left"==i?r.x1=Math.min(D.x2,t.x2):r.x2=Math.max(D.x1,t.x1)),r.y2!=D.y2););}Nu(t,e)}}(p,e.bands,E,null,i),e.createFloats(),"left"==i?e.leftFloatEdge=B:e.rightFloatEdge=B,e.bottommostFloatTop=y,e.updateMaxReachedAfterEdge(B),u.finish(r))})),u.result()},n.setupFloatArea=function(t,e,u,n,i,r){var o=this.pageFloatLayoutContext,a=o.getContainer(e),s=t.element;a.element.parentNode.appendChild(s),t.isFloat=!0,t.originX=a.originX,t.originY=a.originY,t.vertical=a.vertical,t.rtl=a.rtl,t.marginLeft=t.marginRight=t.marginTop=t.marginBottom=0,t.borderLeft=t.borderRight=t.borderTop=t.borderBottom=0,t.paddingLeft=t.paddingRight=t.paddingTop=t.paddingBottom=0,t.exclusions=(a.exclusions||[]).concat(),t.forceNonfitting=!o.hasFloatFragments(),t.innerShape=null;var l=a.getPaddingRect();t.setHorizontalPosition(l.x1-a.originX,l.x2-l.x1),t.setVerticalPosition(l.y1-a.originY,l.y2-l.y1),i.adjustPageFloatArea(t,a,this),t.init();var D=!!o.setFloatAreaDimensions(t,e,u,n,!0,!o.hasFloatFragments(),r);return D?(t.killFloats(),t.init()):a.element.parentNode.removeChild(s),D},n.createPageFloatArea=function(t,e,u,n,i){var r=this.element.ownerDocument.createElement("div");et(r,"position","absolute");var o=this.pageFloatLayoutContext.getPageFloatLayoutContext(t.floatReference),a=new es(null,qa.COLUMN,null,this.pageFloatLayoutContext.flowName,t.nodePosition,null,null),s=o.getContainer(),l=new Cl(e,r,this.layoutContext.clone(),this.clientLayout,this.layoutConstraint,a,s);return a.setContainer(l),this.setupFloatArea(l,t.floatReference,e,u,n,i)?l:null},n.layoutSinglePageFloatFragment=function(t,e,u,n,i,r,o){var a=this.pageFloatLayoutContext,s=(t=(o?o.continuations:[]).concat(t))[0].float,l=a.getPageFloatPlacementCondition(s,e,u),D=this.createPageFloatArea(s,e,r,i,l),h={floatArea:D,pageFloatFragment:null,newPosition:null};if(!D)return Rn(h);var c=Pn("layoutSinglePageFloatFragment"),d=!1,f=0;return c.loopWithFrame((function(e){if(f>=t.length)e.breakLoop();else{var u=new Pr(t[f].nodePosition);D.layout(u,!0).then((function(t){h.newPosition=t,!t||n?(f++,e.continueLoop()):(d=!0,e.breakLoop())}))}})).then((function(){if(!d){var u=a.setFloatAreaDimensions(D,s.floatReference,e,r,!1,n,l);if(u){var o=i.createPageFloatFragment(t,u,D,!!h.newPosition);a.addPageFloatFragment(o,!0),h.pageFloatFragment=o}else d=!0}c.finish(h)})),c.result()},n.layoutPageFloatInner=function(t,e,u,n){var i=this,r=this.pageFloatLayoutContext,o=t.float;function a(e,u){u?r.removePageFloatFragment(u,!0):e&&e.element.parentNode.removeChild(e.element),r.restoreStashedFragments(o.floatReference),r.deferPageFloat(t)}r.stashEndFloatFragments(o);var s=Pn("layoutPageFloatInner");return this.layoutSinglePageFloatFragment([t],o.floatSide,o.clearSide,!r.hasFloatFragments(),e,u,n).then((function(t){var e=t.floatArea,u=t.pageFloatFragment,l=t.newPosition;u?i.layoutStashedPageFloats(o.floatReference,[n]).then((function(t){if(t){if(r.addPageFloatFragment(u),r.discardStashedFragments(o.floatReference),l){var n=new ts(o,l.primary);r.deferPageFloat(n)}s.finish(!0)}else a(e,u),s.finish(!1)})):(a(e,u),s.finish(!1))})),s.result()},n.layoutStashedPageFloats=function(t,e){var u=this,n=this.pageFloatLayoutContext,i=n.getStashedFloatFragments(t),r=[],o=[],a=!1,s=Pn("layoutStashedPageFloats"),l=0;return s.loopWithFrame((function(t){if(l>=i.length)t.breakLoop();else{var n=i[l];if(e.includes(n))return l++,void t.continueLoop();var s=(new ns).findByFloat(n.continuations[0].float);u.layoutSinglePageFloatFragment(n.continuations,n.floatSide,null,!1,s,null).then((function(e){var u=e.floatArea;u&&r.push(u);var n=e.pageFloatFragment;n?(o.push(n),l++,t.continueLoop()):(a=!0,t.breakLoop())}))}})).then((function(){a?(o.forEach((function(t){n.removePageFloatFragment(t,!0)})),r.forEach((function(t){var e=t.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))):i.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)})),s.finish(!a)})),s.result()},n.setFloatAnchorViewNode=function(t){var e=t.viewNode.parentNode,u=e.ownerDocument.createElement("span");u.setAttribute(pr,"1"),"footnote"===t.floatSide&&this.layoutContext.applyPseudoelementStyle(t,"footnote-call",u),e.appendChild(u),e.removeChild(t.viewNode);var n=t.modify();return n.after=!0,n.viewNode=u,n},n.resolveFloatReferenceFromColumnSpan=function(t,e,u){var n=this,i=Pn("resolveFloatReferenceFromColumnSpan"),r=this.pageFloatLayoutContext,o=r.getPageFloatLayoutContext(qa.REGION);return r.getContainer().widthn.width?qa.REGION:t)})):i.finish(e===Je.all?qa.REGION:t):i.finish(t),i.result()},n.layoutPageFloat=function(t){var e=this,u=this.pageFloatLayoutContext,n=(new ns).findByNodeContext(t),i=u.findPageFloatByNodePosition(t.toNodePosition());return(i?Rn(i):n.createPageFloat(t,u,this)).thenAsync((function(i){var r=wr(t,0),o=e.setFloatAnchorViewNode(t),a=n.findPageFloatFragment(i,u),s=new ts(i,r);if(a&&a.hasFloat(i))return u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(u.isForbidden(i)||u.hasPrecedingFloatsDeferredToNext(i))return u.deferPageFloat(s),u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(e.nodeContextOverflowingDueToRepetitiveElements)return Rn(null);var l=ps(o,e.clientLayout,0,e.vertical);return e.isOverflown(l)?Rn(o):e.layoutPageFloatInner(s,n,l,a).thenAsync((function(t){return t?Rn(null):(u.registerPageFloatAnchor(i,o.viewNode),Rn(o))}))}))},n.processLineStyling=function(t,e,u){var n=this,i=Pn("processLineStyling"),r=u.concat([]);u.splice(0,u.length);var o=0,a=t.firstPseudo;return 0==a.count&&(a=a.outer),i.loopWithFrame((function(u){if(a){var i=n.findLinePositions(r),s=a.count-o;if(i.length<=s)u.breakLoop();else{var l=n.findAcceptableBreakInside(r,i[s-1],!0);null!=l?n.finishBreak(l,!1,!1).then((function(){o+=s,n.layoutContext.peelOff(l,0).then((function(i){a=(t=i).firstPseudo,n.buildViewToNextBlockEdge(t,r=[]).then((function(t){e=t,u.continueLoop()}))}))})):u.breakLoop()}}else u.breakLoop()})).then((function(){Array.prototype.push.apply(u,r),i.finish(e)})),i.result()},n.isLoneImage=function(t){return!(2!=t.length&&this.breakPositions.length>0)&&t[0].sourceNode==t[1].sourceNode&&sl[t[0].sourceNode.localName]},n.getTrailingMarginEdgeAdjustment=function(t){for(var e=0,u=0,n=t.length-1;n>=0;n--){var i=t[n];if(!i.after||!i.viewNode||1!=i.viewNode.nodeType)break;var r=this.getComputedMargin(i.viewNode),o=this.vertical?-r.left:r.bottom;o>0?e=Math.max(e,o):u=Math.min(u,o)}return e+u},n.layoutBreakableBlock=function(t){var e=this,u=Pn("layoutBreakableBlock"),n=[];return this.buildViewToNextBlockEdge(t,n).then((function(i){var r=n.length-1;if(r<0)u.finish(i);else{e.postLayoutBlock(i,n);var o=e.calculateEdge(i,n,r,n[r].boxOffset),a=!1;if(!i||!Cs(i.viewNode)){var s=ys(i,e.collectElementsOffset());a=e.isOverflown(o+(e.vertical?-1:1)*s.minimum),e.isOverflown(o+(e.vertical?-1:1)*s.current)&&!e.nodeContextOverflowingDueToRepetitiveElements&&(e.nodeContextOverflowingDueToRepetitiveElements=i)}null==i&&(o+=e.getTrailingMarginEdgeAdjustment(n)),e.updateMaxReachedAfterEdge(o),(t.firstPseudo?e.processLineStyling(t,i,n):Rn(i)).then((function(t){n.length>0&&(e.saveBoxBreakPosition(n),a&&!e.isLoneImage(n)&&t&&((t=t.modify()).overflow=!0)),u.finish(t)}))}})),u.result()},n.postLayoutBlock=function(t,u){var n=this;C(e.HOOKS.POST_LAYOUT_BLOCK).forEach((function(e){e(t,u,n)}))},n.findEndOfLine=function(t,e,u){for(var n,i=this.vertical?t-1:t+1,r=0,o=e[0].boxOffset,a=r,s=e.length-1,l=e[s].boxOffset;on?D=h-1:a=h}var c=this.calculateEdge(null,e,a,n);if(this.vertical?c<=i:c>=i){for(l=n-1;e[a].boxOffset==n;)a--;s=a}else u&&this.updateMaxReachedAfterEdge(c),o=n,r=a}return{nodeContext:e[a],index:o,checkPointIndex:a}},n.findAcceptableBreakInside=function(t,e,u){var n,i=this.findEndOfLine(e,t,!0),r=i.nodeContext,o=r.viewNode;if(1!=o.nodeType&&"viv-ts-inner"!==(null==(n=o.parentElement)?void 0:n.localName)){var a=o;r=this.resolveTextNodeBreaker(r).breakTextNode(a,r,i.index,t,i.checkPointIndex,u)}else{var s=ms(r);if(s){var l;if((null==(l=this.breakPositions)?void 0:l[0])instanceof Dl&&null!=s&&s.viewNode.contains(this.breakPositions[0].checkPoints[0].viewNode))return null;r=s}}return this.clearOverflownViewNodes(r,!1),r},n.resolveTextNodeBreaker=function(t){return C(e.HOOKS.RESOLVE_TEXT_NODE_BREAKER).reduce((function(e,u){return u(t)||e}),dl.instance)},n.getRangeBoxes=function(t,e){for(var u,n=[],i=t.ownerDocument.createRange(),r=!1,o=t,a=null,s=!1,l=!0;l;){var D=!0;do{var h=null;o==e&&(l=1===e.nodeType&&!(!e.firstChild||r));var c=1===o.nodeType?o:null;c?r?r=!1:As(c)?D=!s:/^r(uby|[bt]c?)$/.test(c.localName)||"inline"!==(u=this.clientLayout.getElementComputedStyle(c).display)&&(ds(u)||fs(u))?((D=!s)&&("ruby"===c.localName&&o.firstChild&&(o=o.firstChild),i.setStartBefore(o),s=!0,a=o),o.contains(e)&&(l=!1)):h=o.firstChild:(s||(null==o.parentNode?l=!1:(i.setStartBefore(o),s=!0)),a=o),h||(h=o.nextSibling)||(r=!0,h=o.parentNode),o=h}while(D&&l);if(s){i.setEndAfter(a);for(var d=this.clientLayout.getRangeClientRects(i),f=0;f0){var h=Math.max(this.getBoxSize(l),1);D=s*this.getBeforeEdge(l)s*i?s*(i-this.getBeforeEdge(l))/h:1}if(0==o||D>=.6||D>=.2&&this.getStartEdge(l)>=r-1){r=this.getEndEdge(l),this.vertical?(n=0==o?l.right:Math.max(n,l.right),i=0==o?l.left:Math.min(i,l.left)):(n=0==o?l.top:Math.min(n,l.top),i=0==o?l.bottom:Math.max(i,l.bottom)),o++,a++;continue}}if(o>0&&(e.push(i),o=0),a>=u.length)break}return e.sort(dt),this.vertical&&e.reverse(),e},n.calculateClonedPaddingBorder=function(t){for(var e=0,u=t;u;u=u.parent)if(!u.inline&&zi(u.viewNode)){var n=this.getComputedPaddingBorder(u.viewNode);e+=u.vertical?-n.left:n.bottom,"table"===u.display&&(e+=(u.vertical?-1:1)*u.blockBorderSpacing)}return e},n.getOffsetByRepetitiveElements=function(t){return(t?t.calculateOffset(this):ys(null,this.collectElementsOffset())).current},n.findBoxBreakPosition=function(t,e){var u,n=this,i=this.element.parentNode,r=this.element.nextSibling;i.removeChild(this.element),i.insertBefore(this.element,r);for(var o,a,s=t.checkPoints,l=s[0];l.parent&&l.inline;)l=l.parent;e?(o=1,a=1):(o=Math.max((l.inheritedProps.widows||2)-0,1),a=Math.max((l.inheritedProps.orphans||2)-0,1));var D=this.calculateClonedPaddingBorder(l),h=this.findLinePositions(s),c=this.footnoteEdge-D,d=this.getBoxDir(),f=this.getOffsetByRepetitiveElements(t);c-=d*f;var p=this.findFirstOverflowingEdgeAndCheckPoint(s);isNaN(p.edge)&&(p.edge=1/0*d);var E=ct(h.length,(function(t){var e=h[t];return n.vertical?ec||e>=p.edge})),C=E<=0;C&&(E=ct(h.length,(function(t){return n.vertical?h[t]c})));var F,A=s[s.length-1].viewNode;if("viv-ts-inner"===(null==(u=A)?void 0:u.parentElement.localName)&&(A=A.parentElement.parentElement),(E===h.length&&A.nextSibling||E>=h.length-1&&A.parentElement.querySelector(".MJXc-display"))&&(o=0),(E=Math.min(h.length-o,E))=0&&!e;--i){e=(t=this.breakPositions[i]).findAcceptableBreak(this,u);var r=t.getMinBreakPenalty();r>u&&(n=Math.min(n,r))}}while(n>u&&!e&&this.forceNonfitting);return{breakPosition:e?t:null,nodeContext:e}},n.doFinishBreak=function(t,e,u,n){var i=this;if(this.pageFloatLayoutContext.isInvalidated()||this.pageBreakType||!e)return Rn(t);var r=Pn("doFinishBreak"),o=!1;if(!t){if(this.forceNonfitting)return c.warn("Could not find any page breaks?!!"),this.skipTailEdges(e).then((function(t){t?((t=t.modify()).overflow=!1,i.finishBreak(t,o,!0).then((function(){r.finish(t)}))):r.finish(t)})),r.result();t=u,o=!0,this.computedBlockSize=n}return this.finishBreak(t,o,!0).then((function(){r.finish(t)})),r.result()},n.isBreakable=function(t){return!!t.after||t.sourceNode.namespaceURI!==W.SVG&&!t.flexContainer},n.zeroIndent=function(t){var e=t.toString();return""==e||"auto"==e||!!e.match(/^0+(.0*)?[^0-9]/)},n.checkOverflowAndSaveEdge=function(t,e){if(!t)return!1;if(Cs(t.viewNode))return!1;var u=ps(t,this.clientLayout,0,this.vertical),n=ys(t,this.collectElementsOffset()),i=this.isOverflown(u+(this.vertical?-1:1)*n.minimum);if(this.isOverflown(u+(this.vertical?-1:1)*n.current)&&!this.nodeContextOverflowingDueToRepetitiveElements)this.nodeContextOverflowingDueToRepetitiveElements=t;else if(e){var r=u+this.getTrailingMarginEdgeAdjustment(e),o=this.footnoteEdge-this.getBoxDir()*n.current;u=this.vertical?Math.min(u,Math.max(r,o)):Math.max(u,Math.min(r,o))}return this.updateMaxReachedAfterEdge(u),i},n.checkOverflowAndSaveEdgeAndBreakPosition=function(t,e,u,n){if(!t)return!1;if(Cs(t.viewNode))return!1;var i=this.checkOverflowAndSaveEdge(t,e);return!u&&i||this.saveEdgeBreakPosition(t,n,i),i},n.applyClearance=function(t){if(!t.viewNode.parentNode)return!1;var e=this.getComputedMargin(t.viewNode),u=t.viewNode.ownerDocument.createElement("div");this.vertical?(u.style.bottom="0px",u.style.width="1px",u.style.marginRight=e.right+"px"):(u.style.right="0px",u.style.height="1px",u.style.marginTop=e.top+"px"),t.viewNode.parentNode.insertBefore(u,t.viewNode);var n=this.clientLayout.getElementClientRect(u),i=this.getBeforeEdge(n),r=this.getBoxDir(),o=t.clearSide,a=1/0*-this.getBoxDir();switch("all"===o&&(a=this.pageFloatLayoutContext.getPageFloatClearEdge(o,this)),o){case"left":a=r*Math.max(a*r,this.leftFloatEdge*r);break;case"right":a=r*Math.max(a*r,this.rightFloatEdge*r);break;default:a=r*Math.max(a*r,Math.max(this.rightFloatEdge*r,this.leftFloatEdge*r))}if(i*r>=a*r)return t.viewNode.parentNode.removeChild(u),!1;var s=Math.max(1,(a-i)*r);this.vertical?u.style.width=s+"px":u.style.height=s+"px",n=this.clientLayout.getElementClientRect(u);var l=this.getAfterEdge(n);if(!t.floatSide)if(this.vertical){var D=l+e.right-a;D>0==e.right>=0&&(D+=e.right),u.style.marginLeft=D+"px"}else{var h=a-(l+e.top);h>0==e.top>=0&&(h+=e.top),u.style.marginBottom=h+"px"}return t.clearSpacer=u,!0},n.isBFC=function(t){return!!Ts(t)||!!tr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t)},n.skipEdges=function(t,e,u){var n,i=this,r=t.after?null==(n=t.parent)?void 0:n.formattingContext:t.formattingContext;if(r&&!this.isBFC(r))return Rn(t);var o=Pn("skipEdges"),a=!u&&e&&t&&t.after,s=u,l=null,D=[],h=[],c=!1;function d(){return!!u||!e&&Yi(s)&&!function(){if(!l)return!1;for(var t=l;null!=(e=t)&&e.parent;t=t.parent){for(var e,u,n=t.after?t.viewNode:null==(u=t.viewNode)?void 0:u.previousSibling;n&&(Fr(n,t.parent.whitespace)||gs(n));)n=n.previousSibling;if(n)return!1}return!0}()}var f=function(){(t=D[0]||t).viewNode.parentNode.removeChild(t.viewNode),i.pageBreakType=s};return o.loopWithFrame((function(u){for(;t;){var n=(new Ns).find(t.formattingContext);do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(Fr(t.viewNode,t.whitespace))break;if(!t.after)return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)?(t=(i.stopAtOverflow&&l||t).modify()).overflow=!0:(t=t.modify()).breakBefore=s,void u.breakLoop()}if(!t.after){if(t.floatSide&&(i.breakAtTheEdgeBeforeFloat=ir(s)?s:null),n&&n.startNonInlineElementNode(t))break;if(t.clearSide&&i.applyClearance(t)&&e&&0===i.breakPositions.length&&i.saveEdgeBreakPosition(t.copy(),s,!1),!t.inline&&(l?ms(l):i.breakPositions[i.breakPositions.length-1]instanceof Dl)&&i.saveEdgeBreakPosition(t.copy(),s,!1),!i.isBFC(t.formattingContext)||tr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t.formattingContext)||i.isFloatNodeContext(t)||t.flexContainer||!t.nodeShadow&&!t.sourceNode.firstElementChild&&Fr(t.sourceNode.firstChild,t.whitespace))return D.push(t.copy()),s=rr(s,t.breakBefore),d()?f():!i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&i.layoutConstraint.allowLayout(t)||((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop()}if(1!=t.viewNode.nodeType)break;var r=t.viewNode.style;if(t.after){var o;t.floatSide&&(s=null!=(o=s)?o:i.breakAtTheEdgeBeforeFloat,i.breakAtTheEdgeBeforeFloat=null);var p=t.sourceNode;if("svg"===p.localName||"math"===p.localName||"true"===p.getAttribute("data-math-typeset")){c=!1,l=t.copy(),h.push(l),s=rr(null,t.breakAfter),i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s);break}if(t.inline)break;if(n&&n.afterNonInlineElementNode(t,i.stopAtOverflow))break;if(c){if(d())return f(),void u.breakLoop();D=[],e=!1,a=!1,s=null}c=!1,l=t.copy(),h.push(l),s=rr(s,t.breakAfter),!r||i.zeroIndent(r.paddingBottom)&&i.zeroIndent(r.borderBottomWidth)||(h=[l])}else{var E;if(D.push(t.copy()),s=rr(s,t.breakBefore),!(t.pageType==(null==(E=t.parent)?void 0:E.pageType)&&Yi(s)||i.layoutConstraint.allowLayout(t))&&(i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s),(t=t.modify()).overflow=!0,i.stopAtOverflow))return void u.breakLoop();if(sl[t.viewNode.localName])return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop();!r||i.zeroIndent(r.paddingTop)&&i.zeroIndent(r.borderTopWidth)||(a=!1,h=[]),c=!0}}while(0);var C=i.nextInTree(t,a);if(C.isPending())return void C.then((function(e){t=e,u.continueLoop()}));t=C.get()}i.checkOverflowAndSaveEdgeAndBreakPosition(l,h,!i.stopAtOverflow,s)?l&&i.stopAtOverflow&&((t=l.modify()).overflow=!0):Yi(s)&&(i.pageBreakType=s),u.breakLoop()})).then((function(){l&&(i.lastAfterPosition=l.toNodePosition()),o.finish(t)})),o.result()},n.skipTailEdges=function(t){var e=this,u=t.copy(),n=Pn("skipEdges"),i=null,r=!1;return n.loopWithFrame((function(n){for(;t;){do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(Fr(t.viewNode,t.whitespace))break;if(!t.after)return Yi(i)&&(e.pageBreakType=i),void n.breakLoop()}if(!t.after&&(e.isFloatNodeContext(t)||t.flexContainer))return Yi(i=rr(i,t.breakBefore))&&(e.pageBreakType=i),void n.breakLoop();if(1!=t.viewNode.nodeType)break;var o=t.viewNode.style;if(t.after){if(r){if(Yi(i))return e.pageBreakType=i,void n.breakLoop();i=null}r=!1,i=rr(i,t.breakAfter)}else{if(i=rr(i,t.breakBefore),sl[t.viewNode.localName])return Yi(i)&&(e.pageBreakType=i),void n.breakLoop();if(o&&(!e.zeroIndent(o.paddingTop)||!e.zeroIndent(o.borderTopWidth)))return void n.breakLoop()}r=!0}while(0);var a=e.layoutContext.nextInTree(t);if(a.isPending())return void a.then((function(e){t=e,n.continueLoop()}));t=a.get()}u=null,n.breakLoop()})).then((function(){n.finish(u)})),n.result()},n.layoutFloatOrFootnote=function(t){return $a(t.floatReference)||"footnote"===t.floatSide?this.layoutPageFloat(t):this.layoutFloat(t)},n.layoutNext=function(t,e,u){var n=this,i=Pn("layoutNext");return this.skipEdges(t,e,u||null).then((function(u){if(!(t=u)||n.pageBreakType||n.stopByOverflow(t))i.finish(t);else{var r=t.formattingContext;(new Ns).find(r).layout(t,n,e).thenFinish(i)}})),i.result()},n.clearOverflownViewNodes=function(t,e){if(t)for(var u=t.parent;t;t=u,u=u?u.parent:null){var n=(u||t).formattingContext;(new Ns).find(n).clearOverflownViewNodes(this,u,t,e),e=!1}},n.initGeom=function(){var t=this.element.ownerDocument.createElement("div");t.style.position="absolute",t.style.top=this.paddingTop+"px",t.style.right=this.paddingRight+"px",t.style.bottom=this.paddingBottom+"px",t.style.left=this.paddingLeft+"px",this.element.appendChild(t);var e=this.clientLayout.getElementClientRect(t);this.element.removeChild(t);var u=this.originX+this.left+this.getInsetLeft(),n=this.originY+this.top+this.getInsetTop();this.box=new lu(u,n,u+this.width,n+this.height),this.startEdge=e?this.vertical?this.rtl?e.bottom:e.top:this.rtl?e.right:e.left:0,this.endEdge=e?this.vertical?this.rtl?e.top:e.bottom:this.rtl?e.left:e.right:0,this.beforeEdge=e?this.vertical?e.right:e.top:0,this.afterEdge=e?this.vertical?e.left:e.bottom:0,this.leftFloatEdge=this.beforeEdge,this.rightFloatEdge=this.beforeEdge,this.bottommostFloatTop=this.beforeEdge,this.footnoteEdge=this.afterEdge,this.bands=function(t,e,u,n,i,r){r&&(t=Bu(t),e=e.map((function(t){return wu(t)})),u=u.map((function(t){return wu(t)})));var o,a,s,l=e.length,D=u?u.length:0,h=[],c=[];for(o=0;o=l;)f++;var p=c[f].low.y;p>t.y1&&h.push(new du(t.y1,p,t.x2,t.x2));for(var E,C,F=0,A=[];Fp&&A.push(s),F++;for(;F0;){var g=t.y2,v=Math.min((E=Math.ceil(p+8),(C=i)?Math.ceil(E/C)*C:E),t.y2);for(a=0;av;a++)(s=A[a]).low.x==s.high.x?s.high.yt.y2&&(g=t.y2);Fw&&(w=S,N=b)}h.push(0==w?new du(p,g,t.x2,t.x2):new du(p,g,Math.max(N,t.x1),Math.min(N+w,t.x2)))}if(g==t.y2)break;for(p=g,a=A.length-1;a>=0;a--)A[a].high.y<=g&&A.splice(a,1)}return Nu(t,h),h}(this.box,[this.getInnerShape()],this.getExclusions(),0,this.snapHeight,this.vertical),this.createFloats()},n.init=function(){this.chunkPositions=[],et(this.element,"width",this.width+"px"),et(this.element,"height",this.height+"px"),this.initGeom(),this.computedBlockSize=0,this.overflown=!1,this.pageBreakType=null,this.lastAfterPosition=null},n.saveEdgeBreakPosition=function(t,e,u){var n=t.copy(),i=(new Ns).find(t.formattingContext),r=this.calculateClonedPaddingBorder(n),o=i.createEdgeBreakPosition(n,e,u,this.computedBlockSize+r);this.breakPositions.push(o)},n.saveBoxBreakPosition=function(t){var e=t[0].breakPenalty;if(e){for(var u=t[0];u.parent&&u.inline;)u=u.parent;e=u.breakPenalty}var n=new Dl(t,e);this.breakPositions.push(n)},n.updateMaxReachedAfterEdge=function(t){if(!isNaN(t)){var e=this.getBoxDir()*(t-this.beforeEdge);this.computedBlockSize=Math.max(e,this.computedBlockSize)}},n.layout=function(t,e,u){var n=this;if(this.chunkPositions.push(t),t.primary.after&&(this.lastAfterPosition=t.primary),this.stopAtOverflow&&this.overflown)return Rn(t);if(this.isFullWithPageFloats())return Rn(t.primary.after&&1===t.primary.steps.length?null:t);var i=Pn("layout");return this.openAllViews(t.primary).then((function(t){var r=null;t.viewNode?r=t.copy():n.layoutContext.addEventListener("nextInTree",(function t(e){e.nodeContext.viewNode&&(r=e.nodeContext,n.layoutContext.removeEventListener("nextInTree",t))}));var o=new pl(e,u);o.layout(t,n).then((function(t){n.doFinishBreak(t,o.context.overflownNodeContext,r,o.initialComputedBlockSize).then((function(t){(n.pseudoParent?Rn(null):n.doFinishBreakOfFragmentLayoutConstraints(t)).then((function(){if(n.pageFloatLayoutContext.isInvalidated())i.finish(null);else if(t){n.overflown=!0;var e=new Pr(t.toNodePosition());i.finish(e)}else i.finish(null)}))}))}))})),i.result()},n.isFullWithPageFloats=function(){return this.pageFloatLayoutContext.isColumnFullWithPageFloats(this)},n.getMaxBlockSizeOfPageFloats=function(){return this.pageFloatLayoutContext.getMaxBlockSizeOfPageFloats()},n.doFinishBreakOfFragmentLayoutConstraints=function(t){var e=this,u=Pn("doFinishBreakOfFragmentLayoutConstraints"),n=[].concat(this.fragmentLayoutConstraints);n.sort((function(t,e){return t.getPriorityOfFinishBreak()-e.getPriorityOfFinishBreak()}));var i=0;return u.loop((function(){return i0&&isFinite(t)&&(this.blockDistanceToBlockEndFloats=this.getBoxDir()*(t-this.beforeEdge-this.computedBlockSize))},n.collectElementsOffset=function(){for(var t=this,e=[],u=this;u;u=u.pseudoParent)u.fragmentLayoutConstraints.forEach((function(u){if(tr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(u)){var n=u.getRepetitiveElements();e.push(n)}if(Ji.isInstanceOfAfterIfContinuesLayoutConstraint(u)){var i=u.getRepetitiveElements();e.push(i)}er.isInstanceOfTableRowLayoutConstraint(u)&&u.getElementsOffsetsForTableCell(t).forEach((function(t){e.push(t)}))}));return e},u}(Or),cl=function(){function t(t,e,u){this.startNodeContexts=[],this.column=void 0,this.column=Object.create(t),this.column.element=e,this.column.layoutContext=t.layoutContext.clone(),this.column.stopAtOverflow=!1,this.column.flowRootFormattingContext=u.formattingContext,this.column.pseudoParent=t;var n=this.column.calculateClonedPaddingBorder(u);this.column.footnoteEdge=this.column.footnoteEdge-n;var i=this;this.column.openAllViews=function(t){return hl.prototype.openAllViews.call(this,t).thenAsync((function(t){return i.startNodeContexts.push(t.copy()),Rn(t)}))}}var e=t.prototype;return e.layout=function(t,e){return this.column.layout(t,e)},e.findAcceptableBreakPosition=function(t){var e=this.column.findAcceptableBreakPosition();if(t){var u=this.startNodeContexts[0].copy(),n=new ws(u,null,u.overflow,0);if(n.findAcceptableBreak(this.column,0),!e.nodeContext)return{breakPosition:n,nodeContext:u}}return e},e.finishBreak=function(t,e,u){return this.column.finishBreak(t,e,u)},e.doFinishBreakOfFragmentLayoutConstraints=function(t){this.column.doFinishBreakOfFragmentLayoutConstraints(t)},e.isStartNodeContext=function(t){var e=this.startNodeContexts[0];return e.viewNode===t.viewNode&&e.after===t.after&&e.offsetInNode===t.offsetInNode},e.isLastAfterNodeContext=function(t){return yr(t.toNodePosition(),this.column.lastAfterPosition)},e.getColumnElement=function(){return this.column.element},e.getColumn=function(){return this.column},t}(),dl=function(){function t(){}var e=t.prototype;return e.breakTextNode=function(t,e,u,n,i,r){if(e.after)e.offsetInNode=t.length;else{var o=u-e.boxOffset,a=t.data;(o=173==a.charCodeAt(o)?this.breakAfterSoftHyphen(t,a,o,e):this.breakAfterOtherCharacter(t,a,o,e))>0&&(e=this.updateNodeContext(e,o,t))}return e},e.breakAfterSoftHyphen=function(t,e,u,n){return t.replaceData(u,e.length-u,n.breakWord?"":fl(n)),u+1},e.breakAfterOtherCharacter=function(t,e,u,n){var i=e.charAt(u);u++;var r=e.charAt(u);return t.replaceData(u,e.length-u,!n.breakWord&<(i)&<(r)?fl(n):""),u},e.updateNodeContext=function(t,e,u){return(t=t.modify()).offsetInNode+=e,t.breakBefore=null,t},t}();function fl(t){return t.hyphenateCharacter||t.parent&&t.parent.hyphenateCharacter||"-"}dl.instance=void 0,dl.instance=new dl;var pl=function(t){function e(e,u){var n;return(n=t.call(this)||this).leadingEdge=void 0,n.breakAfter=void 0,n.initialPageBreakType=null,n.initialComputedBlockSize=0,n.initialOverflown=!1,n.context={overflownNodeContext:null},n.leadingEdge=e,n.breakAfter=u||null,n}x(e,t);var u=e.prototype;return u.resolveLayoutMode=function(t){return new El(this.leadingEdge,this.breakAfter,this.context)},u.prepareLayout=function(t,e){e.fragmentLayoutConstraints=[],e.pseudoParent||(Ls=[])},u.clearNodes=function(e){t.prototype.clearNodes.call(this,e);for(var u=e;u;){var n=u.viewNode;n&&Fs(n.parentNode,n),u=u.parent}},u.saveState=function(e,u){t.prototype.saveState.call(this,e,u),this.initialPageBreakType=u.pageBreakType,this.initialComputedBlockSize=u.computedBlockSize,this.initialOverflown=u.overflown},u.restoreState=function(e,u){t.prototype.restoreState.call(this,e,u),u.pageBreakType=this.initialPageBreakType,u.computedBlockSize=this.initialComputedBlockSize,u.overflown=this.initialOverflown},e}(Is),El=function(){function t(t,e,u){this.leadingEdge=void 0,this.breakAfter=void 0,this.context=void 0,this.leadingEdge=t,this.breakAfter=e,this.context=u}var e=t.prototype;return e.doLayout=function(t,e){var u=this,n=Pn("DefaultLayoutMode.doLayout");return function(t,e){var u=Pn("processAfterIfContinuesOfAncestors"),n=t;return u.loop((function(){if(null!==n){var t=ol(n,e);return n=n.parent,t.thenReturn(!0)}return Rn(!1)})).then((function(){u.finish(!0)})),u.result()}(t,e).then((function(){e.doLayout(t,u.leadingEdge,u.breakAfter).then((function(t){u.context.overflownNodeContext=t.overflownNodeContext,n.finish(t.nodeContext)}))})),n.result()},e.accept=function(t,e){var u=this;return!(!e.pageFloatLayoutContext.isInvalidated()&&!e.pageBreakType)||e.fragmentLayoutConstraints.length<=0||e.fragmentLayoutConstraints.every((function(n){return n.allowLayout(t,u.context.overflownNodeContext,e)}))},e.postLayout=function(t,e,u,n){if(!n){var i=u.fragmentLayoutConstraints.some((function(e){return e.nextCandidate(t)}));n=!i}return u.fragmentLayoutConstraints.forEach((function(i){i.postLayout(n,t,e,u)})),n},t}(),Cl=function(t){function e(e,u,n,i,r,o,a){var s;return(s=t.call(this,u,n,i,r,o)||this).floatSide=void 0,s.parentContainer=void 0,s.rootViewNodes=[],s.floatMargins=[],s.adjustContentRelativeSize=!0,s.floatSide=e,s.parentContainer=a,s}x(e,t);var u=e.prototype;return u.openAllViews=function(e){var u=this;return t.prototype.openAllViews.call(this,e).thenAsync((function(t){return t&&u.fixFloatSizeAndPosition(t),Rn(t)}))},u.convertPercentageSizesToPx=function(t){var e=this.parentContainer.getPaddingRect(),u=e.x2-e.x1,n=e.y2-e.y1;function i(e,u){e.forEach((function(e){var n=ut(t,e);if(n&&"%"===n.charAt(n.length-1)){var i=parseFloat(n);et(t,e,u*i/100+"px")}}))}i(["width","max-width","min-width"],u),i(["height","max-height","min-height"],n),i(["margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left"],this.vertical?n:u),["margin-top","margin-right","margin-bottom","margin-left"].forEach((function(e){"auto"===ut(t,e)&&et(t,e,"0")}))},u.fixFloatSizeAndPosition=function(t){for(;t.parent;)t=t.parent;var e=t.viewNode;if(this.rootViewNodes.push(e),this.adjustContentRelativeSize&&this.convertPercentageSizesToPx(e),this.floatMargins.push(this.getComputedMargin(e)),this.adjustContentRelativeSize){var u=this.floatSide;if(this.parentContainer.vertical){if("block-end"===u||"left"===u){var n=ut(e,"height");""!==n&&"auto"!==n&&et(e,"margin-top","auto")}}else if("block-end"===u||"bottom"===u){var i=ut(e,"width");""!==i&&"auto"!==i&&et(e,"margin-left","auto")}}},u.getContentInlineSize=function(){var t=this;return Math.max.apply(null,this.rootViewNodes.map((function(e,u){var n=t.clientLayout.getElementClientRect(e),i=t.floatMargins[u];return t.vertical?i.top+n.height+i.bottom:i.left+n.width+i.right})))},e}(hl),Fl=function(){function t(t,e){this.parent=void 0,this.rootSourceNode=void 0,this.formattingContextType="RepetitiveElementsOwner",this.isRoot=!1,this.repetitiveElements=null,this.parent=t,this.rootSourceNode=e}var e=t.prototype;return e.getName=function(){return"Repetitive elements owner formatting context (RepetitiveElementsOwnerFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.getRepetitiveElements=function(){return this.repetitiveElements},e.getRootViewNode=function(t){var e=this.getRootNodeContext(t);return e?e.viewNode:null},e.getRootNodeContext=function(t){do{if(!t.belongsTo(this)&&t.sourceNode===this.rootSourceNode)return t}while(t=t.parent);return null},e.initializeRepetitiveElements=function(t){var e=this;this.repetitiveElements||Ls.some((function(t){return t.root===e.rootSourceNode&&(e.repetitiveElements=t.elements,!0)}))||(this.repetitiveElements=new Al(t,this.rootSourceNode),Ls.push({root:this.rootSourceNode,elements:this.repetitiveElements}))},e.saveState=function(){},e.restoreState=function(t){},t}(),Al=function(){function t(t,e){this.vertical=void 0,this.ownerSourceNode=void 0,this.headerSourceNode=null,this.footerSourceNode=null,this.headerViewNode=null,this.footerViewNode=null,this.headerNodePosition=null,this.footerNodePosition=null,this.headerHeight=0,this.footerHeight=0,this.isSkipHeader=!1,this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0,this.doneInitialLayout=!1,this.firstContentSourceNode=null,this.lastContentSourceNode=null,this.affectedNodeCache=[],this.afterLastContentNodeCache=[],this.allowInsert=!1,this.allowInsertRepeatitiveElements=void 0,this.vertical=t,this.ownerSourceNode=e}var e=t.prototype;return e.setHeaderNodeContext=function(t){this.headerNodePosition||(this.headerNodePosition=wr(t,0),this.headerSourceNode=t.sourceNode,this.headerViewNode=t.viewNode)},e.setFooterNodeContext=function(t){this.footerNodePosition||(this.footerNodePosition=wr(t,0),this.footerSourceNode=t.sourceNode,this.footerViewNode=t.viewNode)},e.updateHeight=function(t){this.headerViewNode&&(this.headerHeight=Es(this.headerViewNode,t,this.vertical),this.headerViewNode=null),this.footerViewNode&&(this.footerHeight=Es(this.footerViewNode,t,this.vertical),this.footerViewNode=null)},e.prepareLayoutFragment=function(){this.isSkipHeader=this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0},e.appendHeaderToFragment=function(t,e,u){return!this.headerNodePosition||this.isSkipHeader?Rn(!0):this.appendElementToFragment(this.headerNodePosition,t,e,u)},e.appendFooterToFragment=function(t,e,u){return!this.footerNodePosition||this.isSkipFooter?Rn(!0):this.appendElementToFragment(this.footerNodePosition,t,e,u)},e.appendElementToFragment=function(t,e,u,n){var i=this,r=e.viewNode,o=e.viewNode.ownerDocument.createElement("div");r.appendChild(o);var a=new cl(n,o,e),s=a.getColumn().pageBreakType;return a.getColumn().pageBreakType=null,this.allowInsertRepeatitiveElements=!0,a.layout(new Pr(t),!0).thenAsync((function(){return i.allowInsertRepeatitiveElements=!1,r.removeChild(o),i.moveChildren(o,r,u),a.getColumn().pageBreakType=s,Rn(!0)}))},e.moveChildren=function(t,e,u){if(e)for(;t.firstChild;){var n=t.firstChild;t.removeChild(n),n.setAttribute(pr,"1"),u?e.insertBefore(n,u):e.appendChild(n)}},e.calculateOffset=function(t){var e=0;return t&&!this.affectTo(t)||((!this.isSkipFooter||t&&this.isAfterLastContent(t))&&(e+=this.footerHeight),this.isSkipHeader||(e+=this.headerHeight)),e},e.calculateMinimumOffset=function(t){var e=0;return t&&!this.affectTo(t)||(t&&this.isAfterLastContent(t)&&(e+=this.footerHeight),this.enableSkippingHeader||(e+=this.headerHeight)),e},e.isAfterLastContent=function(t){var e=this;return this.findResultFromCache(t,this.afterLastContentNodeCache,(function(u){return e.isAfterNodeContextOf(e.lastContentSourceNode,t,!1)}))},e.affectTo=function(t){var e=this;return this.findResultFromCache(t,this.affectedNodeCache,(function(u){return e.isAfterNodeContextOf(e.ownerSourceNode,t,!0)}))},e.findResultFromCache=function(t,e,u){var n=e.filter((function(e){return e.nodeContext.sourceNode===t.sourceNode&&e.nodeContext.after===t.after}));if(n.length>0)return n[0].result;var i=u(t);return e.push({nodeContext:t,result:i}),i},e.isAfterNodeContextOf=function(t,e,u){for(var n=[],i=t;i;i=i.parentNode){if(e.sourceNode===i)return e.after;n.push(i)}for(var r=e.sourceNode;r;r=r.parentNode){var o=n.indexOf(r);if(o>=0)return!!u&&0===o;for(var a=r;a;a=a.previousElementSibling)if(n.includes(a))return!0}return e.after},e.isFirstContentNode=function(t){return t&&this.firstContentSourceNode===t.sourceNode},e.isEnableToUpdateState=function(){return!!(!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition||!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition)},e.updateState=function(){!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition?this.isSkipFooter=!0:!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition&&(this.isSkipHeader=!0)},e.preventSkippingHeader=function(){this.isSkipHeader=!1,this.enableSkippingHeader=!1},e.preventSkippingFooter=function(){this.isSkipFooter=!1,this.enableSkippingFooter=!1},e.isHeaderRegistered=function(){return!!this.headerNodePosition},e.isFooterRegistered=function(){return!!this.footerNodePosition},e.isHeaderSourceNode=function(t){return this.headerSourceNode===t},e.isFooterSourceNode=function(t){return this.footerSourceNode===t},t}(),gl=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!!t},e.postLayout=function(t,e,u,n){var i=this.formattingContext.getRepetitiveElements();return i&&(i.doneInitialLayout||(i.updateHeight(u),i.doneInitialLayout=!0)),n},t}(),vl=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!0},e.postLayout=function(t,e,u,n){return n},t}(),ml=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}x(e,t);var u=e.prototype;return u.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},u.accept=function(t,e){return!1},e}(gl),Bl=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}return x(e,t),e.prototype.doLayout=function(t,e){return t.belongsTo(this.formattingContext)||t.after||e.fragmentLayoutConstraints.unshift(new yl(t)),this.processor.doLayout(t,e)},e}(vl),yl=function(){function t(t){this.flagmentLayoutConstraintType="RepetitiveElementsOwner",this.nodeContext=void 0,this.nodeContext=t.formattingContext.getRootNodeContext(t)}var e=t.prototype;return e.allowLayout=function(t,e,u){var n=this.getRepetitiveElements();return!(n&&!Cs(this.nodeContext.viewNode)&&n.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},e.nextCandidate=function(t){var e=this.getRepetitiveElements();return!!e&&!!e.isEnableToUpdateState()&&(e.updateState(),!0)},e.postLayout=function(t,e,u,n){var i=this.getRepetitiveElements();i&&t&&n.stopAtOverflow&&(null==e||i.isAfterLastContent(e))&&i.preventSkippingFooter()},e.finishBreak=function(t,e){var u=this.nodeContext.formattingContext,n=this.getRepetitiveElements();if(!n)return Rn(!0);var i=this.nodeContext;return function(t,e,u){var n=t.getRepetitiveElements();if(n){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendHeaderToFragment(i,i.viewNode.firstChild,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return function(t,e,u){var n=t.getRepetitiveElements();if(n&&!n.isSkipFooter){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendFooterToFragment(i,null,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return n.prepareLayoutFragment(),Rn(!0)}))}))},e.getRepetitiveElements=function(){return this.nodeContext.formattingContext.getRepetitiveElements()},e.equalsTo=function(e){return e instanceof t&&this.nodeContext.formattingContext===e.nodeContext.formattingContext},e.getPriorityOfFinishBreak=function(){return 10},t}(),wl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.processor=void 0,n.formattingContext=e,n.processor=u,n}return x(e,t),e.prototype.resolveLayoutMode=function(t){var e=this.formattingContext.getRepetitiveElements();return t.belongsTo(this.formattingContext)||e.doneInitialLayout?(t.belongsTo(this.formattingContext)||t.after||e&&e.preventSkippingHeader(),new Bl(this.formattingContext,this.processor)):new ml(this.formattingContext,this.processor)},e}(Is),Nl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.formattingContext=e,n.column=u,n}x(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext,n=e.getRepetitiveElements();if(u.parent&&e.rootSourceNode===u.parent.sourceNode){switch(u.repeatOnBreak){case"header":if(!n.isHeaderRegistered())return n.setHeaderNodeContext(u),Rn(!0);u.repeatOnBreak="none";break;case"footer":if(!n.isFooterRegistered())return n.setFooterNodeContext(u),Rn(!0);u.repeatOnBreak="none"}n.firstContentSourceNode||(n.firstContentSourceNode=u.sourceNode)}return ks.prototype.startNonInlineElementNode.call(this,t)},u.afterNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext;return u.sourceNode===e.rootSourceNode&&(e.getRepetitiveElements().lastContentSourceNode=t.lastAfterNodeContext&&t.lastAfterNodeContext.sourceNode,t.break=!0),"header"===u.repeatOnBreak||"footer"===u.repeatOnBreak?Rn(!0):ks.prototype.afterNonInlineElementNode.call(this,t)},e}(ks);function bl(t,e){t&&function(t,e){for(var u=t;u;u=u.parent){var n=u.formattingContext;n&&n instanceof Fl&&!u.belongsTo(n)&&e(n,u)}}(t.after?t.parent:t,(function(t,u){er.isInstanceOfTableFormattingContext(t)||e.fragmentLayoutConstraints.push(new yl(u))}))}var Sl=new(function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var u=e.prototype;return u.layout=function(t,e,u){if(e.isFloatNodeContext(t))return e.layoutFloatOrFootnote(t);var n=t.formattingContext;return n.getRootViewNode(t)?(u&&bl(t.parent,e),t.belongsTo(n)?bs.prototype.layout.call(this,t,e,u):new wl(n,this).layout(t,e)):e.buildDeepElementView(t)},u.startNonInlineElementNode=function(t){var e=function(t){var e=t.formattingContext;return e&&e instanceof Fl?e:null}(t),u=e.getRepetitiveElements();return!!u&&(u.allowInsertRepeatitiveElements||!u.isHeaderSourceNode(t.sourceNode)&&!u.isFooterSourceNode(t.sourceNode)||t.viewNode.parentNode.removeChild(t.viewNode),!1)},u.doInitialLayout=function(t,e){var u=Pn("BlockLayoutProcessor.doInitialLayout");return this.layoutEntireBlock(t,e).thenFinish(u),u.result()},u.layoutEntireBlock=function(t,e){var u=new Nl(t.formattingContext,e);return new Rs(u,e.layoutContext).iterate(t)},u.doLayout=function(t,e){var u=t.formattingContext,n=Pn("doLayout");return al(e.layoutContext.nextInTree(t,!1),e).then((function(t){var i=t;n.loopWithFrame((function(t){for(var n=function(){var n=!0;if(e.layoutNext(i,!1).then((function(r){i=r,e.pageFloatLayoutContext.isInvalidated()||e.pageBreakType||i&&e.stopByOverflow(i)||i&&i.after&&i.sourceNode==u.rootSourceNode?t.breakLoop():n?n=!1:t.continueLoop()})),n)return n=!1,{v:void 0}};i;){var r=n();if("object"==typeof r)return r.v}t.breakLoop()})).then((function(){n.finish(i)}))})),n.result()},u.finishBreak=function(t,e,u,n){return bs.prototype.finishBreak.call(this,t,e,u,n)},u.clearOverflownViewNodes=function(t,e,u,n){bs.prototype.clearOverflownViewNodes(t,e,u,n)},e}(bs));p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof Fl&&!er.isInstanceOfTableFormattingContext(t)?Sl:null}));var xl=function(){function t(t,e){this.rowIndex=void 0,this.sourceNode=void 0,this.cells=[],this.rowIndex=t,this.sourceNode=e}var e=t.prototype;return e.addCell=function(t){this.cells.push(t)},e.getMinimumHeight=function(){return Math.min.apply(null,this.cells.map((function(t){return t.height})))},t}(),Tl=function(){function t(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.viewElement=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.height=0,this.anchorSlot=null,this.rowIndex=t,this.columnIndex=e,this.viewElement=u,this.colSpan=u.colSpan||1,this.rowSpan=u.rowSpan||1}var e=t.prototype;return e.setHeight=function(t){this.height=t},e.setAnchorSlot=function(t){this.anchorSlot=t},t}(),Il=function(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.cell=void 0,this.rowIndex=t,this.columnIndex=e,this.cell=u},Pl=function(){function t(t,e,u){this.column=void 0,this.cellNodeContext=void 0,this.pseudoColumn=void 0,this.empty=!1,this.column=t,this.cellNodeContext=u,this.pseudoColumn=new cl(t,e,u)}return t.prototype.findAcceptableBreakPosition=function(){var t=this.cellNodeContext.viewNode,e=this.cellNodeContext.verticalAlign;"middle"!==e&&"bottom"!==e||et(t,"vertical-align","top");var u=this.pseudoColumn.findAcceptableBreakPosition(!0);return et(t,"vertical-align",e),u},t}(),Rl=function(t,e){this.viewNode=void 0,this.side=void 0,this.viewNode=t,this.side=e},kl=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,n,i)||this).formattingContext=void 0,r.acceptableCellBreakPositions=null,r.rowIndex=null,r.formattingContext=e.formattingContext,r}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(e,u){var n=t.prototype.findAcceptableBreak.call(this,e,u);return ut}))},u.getCellFragmentOfCell=function(t){return this.cellFragments[t.rowIndex]&&this.cellFragments[t.rowIndex][t.columnIndex]},u.isFreelyFragmentableRow=function(t){return t.getMinimumHeight()>this.tableWidth/2},u.getColumnCount=function(){return this.columnCount<0&&(this.columnCount=Math.max.apply(null,this.rows.map((function(t){return t.cells.reduce((function(t,e){return t+e.colSpan}),0)})))),this.columnCount},u.updateCellSizes=function(t){var e=this;this.rows.forEach((function(u){u.cells.forEach((function(u){var n=t.getElementClientRect(u.viewElement);u.viewElement=null,u.setHeight(e.vertical?n.width:n.height)}))}))},u.findCellFromColumn=function(t){if(!t)return null;var e=null,u=0,n=0;t:for(u=0;u=t.rowIndex)return n;var o=i[t.columnIndex]&&e.getCellFragmentOfCell(i[t.columnIndex].cell);return!o||u.includes(o)||(e.collectElementsOffsetFromColumn(o.pseudoColumn.getColumn(),n),u.push(o)),n}),[])},u.collectElementsOffsetOfHighestColumn=function(){var t=this,e=[];return this.rows.forEach((function(u){u.cells.forEach((function(u,n){e[n]||(e[n]={collected:[],elements:[]});var i=e[n],r=t.getCellFragmentOfCell(u);r&&!i.collected.includes(r)&&(t.collectElementsOffsetFromColumn(r.pseudoColumn.getColumn(),i.elements),i.collected.push(r))}))})),[new _l(e.map((function(t){return t.elements})))]},u.collectElementsOffsetFromColumn=function(t,e){t.fragmentLayoutConstraints.forEach((function(t){if(tr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(t)){var u=t.getRepetitiveElements();e.push(u)}er.isInstanceOfTableRowLayoutConstraint(t)&&t.getElementsOffsetsForTableCell(null).forEach((function(t){e.push(t)}))}))},u.saveState=function(){return[].concat(this.cellBreakPositions)},u.restoreState=function(t){this.cellBreakPositions=t},e}(Fl),_l=function(){function t(t){this.repeatitiveElementsInColumns=void 0,this.repeatitiveElementsInColumns=t}var e=t.prototype;return e.calculateOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.current}))},e.calculateMinimumOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.minimum}))},e.calculateMaxOffsetOfColumn=function(t,e){var u=0;return this.repeatitiveElementsInColumns.forEach((function(n){var i=ys(t,n);u=Math.max(u,e(i))})),u},t}();function Ml(t){return function(t){return"table-row-group"===t||"table-header-group"===t||"table-footer-group"===t}(t)||function(t){return"table"===t||"inline-table"===t}(t)}function Ul(t,e,u){var n=t.nodeContext,i=n.display,r=n.parent?n.parent.display:null,o=!1;if("inline-table"===r&&!(n.formattingContext instanceof Ol))for(var a=n.parent;a;a=a.parent)if(a.formattingContext instanceof Ol){o=a.formattingContext===e;break}return o||"table-row"===i&&!Ml(r)||"table-cell"===i&&"table-row"!==r&&!Ml(r)||n.formattingContext instanceof Ol&&n.formattingContext!==e?u.buildDeepElementView(n).thenAsync((function(e){return t.nodeContext=e,Rn(!0)})):null}var Vl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.rowIndex=-1,n.columnIndex=0,n.inRow=!1,n.checkPoints=[],n.inHeaderOrFooter=!1,n.formattingContext=e,n.column=u,n}x(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(e){var u=this.formattingContext,n=Ul(e,u,this.column);if(n)return n;this.postLayoutBlockContents(e);var i=e.nodeContext,r=i.display,o=u.getRepetitiveElements();switch(r){case"table":u.inlineBorderSpacing=i.inlineBorderSpacing;break;case"table-caption":var a=new Rl(i.viewNode,i.captionSide);u.captions.push(a);break;case"table-header-group":return o.isHeaderRegistered()||(this.inHeaderOrFooter=!0,o.setHeaderNodeContext(i)),Rn(!0);case"table-footer-group":return o.isFooterRegistered()||(this.inHeaderOrFooter=!0,o.setFooterNodeContext(i)),Rn(!0);case"table-row":this.inHeaderOrFooter||(this.inRow=!0,this.rowIndex++,this.columnIndex=0,u.addRow(this.rowIndex,new xl(this.rowIndex,i.sourceNode)),o.firstContentSourceNode||(o.firstContentSourceNode=i.sourceNode))}return t.prototype.startNonInlineElementNode.call(this,e)},u.afterNonInlineElementNode=function(e){var u=this.formattingContext,n=e.nodeContext,i=n.display,r=this.column.clientLayout;if(this.postLayoutBlockContents(e),n.sourceNode===u.tableSourceNode){var o=r.getElementComputedStyle(u.getRootViewNode(n));u.tableWidth=parseFloat(o[u.vertical?"height":"width"]),u.getRepetitiveElements().lastContentSourceNode=e.lastAfterNodeContext&&e.lastAfterNodeContext.sourceNode,e.break=!0}else switch(i){case"table-header-group":case"table-footer-group":if(this.inHeaderOrFooter)return this.inHeaderOrFooter=!1,Rn(!0);break;case"table-row":this.inHeaderOrFooter||(u.lastRowViewNode=n.viewNode,this.inRow=!1);break;case"table-cell":this.inHeaderOrFooter||(this.inRow||(this.rowIndex++,this.columnIndex=0,this.inRow=!0),u.addCell(this.rowIndex,new Tl(this.rowIndex,this.columnIndex,n.viewNode)),this.columnIndex++)}return t.prototype.afterNonInlineElementNode.call(this,e)},u.startNonElementNode=function(t){this.registerCheckPoint(t)},u.afterNonElementNode=function(t){this.registerCheckPoint(t)},u.startInlineElementNode=function(t){this.registerCheckPoint(t)},u.afterInlineElementNode=function(t){this.registerCheckPoint(t)},u.registerCheckPoint=function(t){var e=t.nodeContext;e&&e.viewNode&&!vs(e)&&this.checkPoints.push(e.clone())},u.postLayoutBlockContents=function(t){this.checkPoints.length>0&&this.column.postLayoutBlock(t.nodeContext,this.checkPoints),this.checkPoints=[]},e}(ks),Hl=function(t){function e(e,u){var n;return(n=t.call(this,!0)||this).formattingContext=void 0,n.column=void 0,n.inRow=!1,n.currentRowIndex=-1,n.currentColumnIndex=0,n.originalStopAtOverflow=void 0,n.inHeader=void 0,n.inFooter=void 0,n.formattingContext=e,n.column=u,n.originalStopAtOverflow=u.stopAtOverflow,u.stopAtOverflow=!1,n}x(e,t);var u=e.prototype;return u.resetColumn=function(){this.column.stopAtOverflow=this.originalStopAtOverflow},u.getColSpanningCellWidth=function(t){for(var e=this.formattingContext.colWidths,u=0,n=0;n1&&(et(r,"box-sizing","border-box"),et(r,this.formattingContext.vertical?"height":"width",this.getColSpanningCellWidth(t)+"px"));var o=r.ownerDocument.createElement("div");r.appendChild(o);var a=new Pl(this.column,o,e);return this.formattingContext.addCellFragment(n,i,a),1===u.primary.steps.length&&u.primary.after&&(a.empty=!0),a.pseudoColumn.layout(u,!0).thenReturn(!0)},u.hasBrokenCellAtSlot=function(t){var e=this.formattingContext.cellBreakPositions[0];return!!e&&e.cell.anchorSlot.columnIndex===t},u.extractRowSpanningCellBreakPositions=function(){var t=this.formattingContext.cellBreakPositions;if(0===t.length)return[];var e=[],u=0;do{var n=t[u],i=n.cell.rowIndex;if(i1;){var r=n.cloneNode(!0);t.insertBefore(r,n),e.push(r)}e.push(n)}n=n.nextElementSibling}for(;u-- >0;)n=t.ownerDocument.createElement("col"),t.appendChild(n),e.push(n)})),e},e.addMissingColElements=function(t,e,u,n){if(t.length0){var a=t.colWidths=this.getColumnWidths(i,o,n,u.clientLayout),s=this.getColGroupElements(e),l=this.normalizeAndGetColElements(s);this.addMissingColElements(l,s,o,e),l.forEach((function(t,e){et(t,n?"height":"width",a[e]+"px")})),s.forEach((function(t){r.appendChild(t.cloneNode(!0))})),t.colGroups=r}else t.colGroups=r}},e.doInitialLayout=function(t,e){var u=this,n=t.formattingContext;n.vertical=t.vertical,n.initializeRepetitiveElements(t.vertical);var i,r,o,a=(i=t.sourceNode,r=zl.findIndex((function(t){return t.root===i})),(o=zl[r])?o.tableLayoutOption:null);!function(t){var e=zl.findIndex((function(e){return e.root===t}));e>=0&&zl.splice(e,1)}(t.sourceNode);var s=Pn("TableLayoutProcessor.doInitialLayout"),l=t.copy();return this.layoutEntireTable(t,e).then((function(i){var r=i.viewNode,o=e.clientLayout.getElementClientRect(r),D=e.vertical?o.left:o.bottom;if(D+=(e.vertical?-1:1)*ys(t,e.collectElementsOffset()).current,!(e.isOverflown(D)||a&&a.calculateBreakPositionsInside))return e.breakPositions.push(new jl(l)),void s.finish(i);u.normalizeColGroups(n,r,e),n.updateCellSizes(e.clientLayout),s.finish(null)})),s.result()},e.addCaptions=function(t,e,u){var n=t.captions;n.forEach((function(t,i){t&&(e.insertBefore(t.viewNode,u),"top"===t.side&&(n[i]=null))}))},e.addColGroups=function(t,e,u){t.colGroups&&0===this.getColGroupElements(e).length&&e.insertBefore(t.colGroups.cloneNode(!0),u)},e.removeColGroups=function(t,e){if(t.colGroups&&e){var u=this.getColGroupElements(e);u&&u.forEach((function(t){e.removeChild(t)}))}},e.doLayout=function(t,e){var u=t.formattingContext,n=u.getRootViewNode(t),i=n.firstChild;this.addCaptions(u,n,i),this.addColGroups(u,n,i);var r=new Hl(u,e),o=new Rs(r,e.layoutContext),a=Pn("TableFormattingContext.doLayout");return o.iterate(t).thenFinish(a),a.result()},e.layout=function(t,e,u){var n=t.formattingContext;return n.getRootViewNode(t)?(u&&bl(t.parent,e),new Wl(n,this).layout(t,e)):e.buildDeepElementView(t)},e.createEdgeBreakPosition=function(t,e,u,n){return new kl(t,e,u,n)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.finishBreak=function(t,e,u,n){var i=e.formattingContext;if("table-row"===e.display){var r,o=i.findRowIndexBySourceNode(e.sourceNode);if(i.cellBreakPositions=[],(r=e.after?i.getRowSpanningCellsOverflowingTheRow(o):i.getCellsFallingOnRow(o)).length){var a=Pn("TableLayoutProcessor.finishBreak"),s=0;return a.loopWithFrame((function(t){if(s!==r.length){var e=r[s++],u=i.getCellFragmentOfCell(e),n=u.findAcceptableBreakPosition().nodeContext,a=u.cellNodeContext,l=a.toNodePosition(),D=new Pr(n.toNodePosition());i.cellBreakPositions.push({cellNodePosition:l,breakChunkPosition:D,cell:e});var h=a.viewNode;u.column.layoutContext.processFragmentedBlockEdge(u.cellNodeContext),o=u.penalty)return!1;var n=e.layoutResult.columns;return Math.max.apply(null,n.map((function(t){return t.computedBlockSize})))>Math.max.apply(null,n.map((function(t){return t.getMaxBlockSizeOfPageFloats()})))+1}function nD(t,e){var u=Math.max.apply(null,t[t.length-1].layoutResult.columns.map((function(t){return isNaN(t.blockDistanceToBlockEndFloats)?t.computedBlockSize:t.computedBlockSize-t.blockDistanceToBlockEndFloats+1})))-1;ut.computedBlockSize}))}var oD,aD=function(t){function e(e,u,n){return t.call(this,n,e,u)||this}x(e,t);var u=e.prototype;return u.calculatePenalty=function(t){if(t.columns.every((function(t){return 0===t.computedBlockSize})))return 1/0;var e,u,n=t.columns.filter((function(t){return!t.pageBreakType})).map((function(t){return t.computedBlockSize}));return u=Ql(e=n),Ql(e.map((function(t){var e=t-u;return e*e})))},u.hasNextCandidate=function(t){return uD(t)},u.updateCondition=function(t){nD(t,this.layoutContainer)},e}(eD),sD=function(t,e,u){this.endStuckFixed=void 0,this.endFixed=void 0,this.endSlipped=void 0,this.endStuckFixed=t,this.endFixed=e,this.endSlipped=u},lD=function(){function t(){this.map=[]}var e=t.prototype;return e.getMaxFixed=function(){return 0==this.map.length?0:this.map[this.map.length-1].endFixed},e.getMaxSlipped=function(){return 0==this.map.length?0:this.map[this.map.length-1].endSlipped},e.addStuckRange=function(t){if(0==this.map.length)this.map.push(new sD(t,t,t));else{var e=this.map[this.map.length-1],u=e.endSlipped+t-e.endFixed;e.endFixed==e.endStuckFixed?(e.endFixed=t,e.endStuckFixed=t,e.endSlipped=u):this.map.push(new sD(t,t,u))}},e.addSlippedRange=function(t){0==this.map.length?this.map.push(new sD(t,0,0)):this.map[this.map.length-1].endFixed=t},e.slippedByFixed=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endFixed})),n=this.map[u];return n.endSlipped-Math.max(0,n.endStuckFixed-t)},e.fixedBySlipped=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endSlipped})),n=this.map[u];return n.endStuckFixed-(n.endSlipped-t)},t}(),DD=function(){function t(e,u,n,i,r,o,a,s){if(this.context=void 0,this.style=void 0,this.offset=void 0,this.isRoot=void 0,this.flowChunk=void 0,this.atBlockStart=void 0,this.atFlowStart=void 0,this.isParentBoxDisplayed=void 0,this.flowName=void 0,this.isBlockValue=null,this.hasBoxValue=null,this.styleValues={},this.beforeBox=null,this.afterBox=null,this.breakBefore=null,this.context=e,this.style=u,this.offset=n,this.isRoot=i,this.flowChunk=r,this.atBlockStart=o,this.atFlowStart=a,this.isParentBoxDisplayed=s,this.flowName=r.flowName,this.hasBox()){var l=u._pseudos;if(l&&l.before){var D=new t(e,l.before,n,!1,r,this.isBlock(),a,!0);Mr(D.styleValue("content"))&&(this.beforeBox=D,this.breakBefore=D.breakBefore)}}this.breakBefore=rr(this.getBreakValue("before"),this.breakBefore),this.atFlowStart&&Yi(this.breakBefore)&&(r.breakBefore=rr(r.breakBefore,this.breakBefore))}var e=t.prototype;return e.buildAfterPseudoElementBox=function(e,u,n){if(this.hasBox()){var i=this.style._pseudos;if(i&&i.after){var r=new t(this.context,i.after,e,!1,this.flowChunk,u,n,!0);Mr(r.styleValue("content"))&&(this.afterBox=r)}}},e.styleValue=function(t,e){if(!(t in this.styleValues)){var u=this.style[t];this.styleValues[t]=u?u.evaluate(this.context,t):e||null}return this.styleValues[t]},e.displayValue=function(){return this.styleValue("display",Je.inline)},e.isBlock=function(){if(null===this.isBlockValue){var t=this.displayValue(),e=this.styleValue("position"),u=this.styleValue("float");this.isBlockValue=cs(t,e,u,this.isRoot)}return this.isBlockValue},e.hasBox=function(){return null===this.hasBoxValue&&(this.hasBoxValue=this.isParentBoxDisplayed&&this.displayValue()!==Je.none),this.hasBoxValue},e.getBreakValue=function(t){var e=null;if(this.isBlock()){var u=this.styleValue("break-"+t);u&&(e=u.toString())}return e},t}(),hD=function(){function t(t){this.context=void 0,this.stack=[],this.atBlockStart=!0,this.atFlowStart=!0,this.atStartStack=[],this.context=t}var e=t.prototype;return e.empty=function(){return 0===this.stack.length},e.lastBox=function(){return this.stack[this.stack.length-1]},e.lastFlowName=function(){var t=this.lastBox();return t?t.flowChunk.flowName:null},e.isCurrentBoxDisplayed=function(){return this.stack.every((function(t){return t.displayValue()!==Je.none}))},e.push=function(t,e,u,n){var i=this.lastBox();n&&i&&n.flowName!==i.flowName&&this.atStartStack.push({atBlockStart:this.atBlockStart,atFlowStart:this.atFlowStart});var r=n||i.flowChunk,o=this.atFlowStart||!!n,a=this.isCurrentBoxDisplayed(),s=new DD(this.context,t,e,u,r,o||this.atBlockStart,o,a);return this.stack.push(s),this.atBlockStart=s.hasBox()?!s.beforeBox&&s.isBlock():this.atBlockStart,this.atFlowStart=s.hasBox()?!s.beforeBox&&o:this.atFlowStart,s},e.encounteredTextNode=function(t){var e=this.lastBox();if((t.nodeType===Node.TEXT_NODE||t.nodeType===Node.CDATA_SECTION_NODE)&&(this.atBlockStart||this.atFlowStart)&&e.hasBox()){var u=Cr(e.styleValue("white-space",Je.normal).toString());u&&!Fr(t,u)&&(this.atBlockStart=!1,this.atFlowStart=!1)}},e.pop=function(t){var e=this.stack.pop();if(e.buildAfterPseudoElementBox(t,this.atBlockStart,this.atFlowStart),this.atFlowStart&&e.afterBox){var u=e.afterBox.getBreakValue("before");e.flowChunk.breakBefore=rr(e.flowChunk.breakBefore,u)}var n=this.lastBox();if(n)if(n.flowName===e.flowName)e.hasBox()&&(this.atBlockStart=this.atFlowStart=!1);else{var i=this.atStartStack.pop();this.atBlockStart=i.atBlockStart,this.atFlowStart=i.atFlowStart}return e},e.nearestBlockStartOffset=function(t){if(!t.atBlockStart)return t.offset;var e=this.stack.length-1,u=this.stack[e];for(u===t&&(e--,u=this.stack[e]);e>=0;){if(u.flowName!==t.flowName)return t.offset;if(!u.atBlockStart)return u.offset;if(u.isRoot)return u.offset;t=u,u=this.stack[--e]}throw new Error("No block start offset found!")},t}(),cD=function(){function t(t,e,u,n,i,r,o,a){this.xmldoc=void 0,this.scope=void 0,this.context=void 0,this.primaryFlows=void 0,this.validatorSet=void 0,this.counterListener=void 0,this.root=void 0,this.cascadeHolder=void 0,this.last=void 0,this.rootStyle={},this.styleMap={},this.flows={},this.flowChunks=[],this.flowListener=null,this.flowToReach=null,this.idToReach=null,this.cascade=void 0,this.offsetMap=void 0,this.primary=!0,this.primaryStack=[],this.rootBackgroundAssigned=!1,this.rootLayoutAssigned=!1,this.lastOffset=void 0,this.breakBeforeValues={},this.boxStack=void 0,this.bodyReached=!0,this.xmldoc=t,this.scope=u,this.context=n,this.primaryFlows=i,this.validatorSet=r,this.counterListener=o,this.root=t.root,this.cascadeHolder=e,this.last=this.root,this.cascade=e.createInstance(n,o,a,t.lang),this.offsetMap=new lD;var s=t.getElementOffset(this.root);this.lastOffset=s,this.boxStack=new hD(n),this.offsetMap.addStuckRange(s);var l=this.getAttrStyle(this.root);this.cascade.pushElement(this,this.root,l,s),this.postprocessTopStyle(l,!1),this.root.namespaceURI===W.XHTML&&(this.bodyReached=!1),this.primaryStack.push(!0),this.styleMap={},this.styleMap["e"+s]=l,this.lastOffset++,this.replayFlowElementsFromOffset(-1)}var e=t.prototype;return e.hasProp=function(t,e,u){var n=t[u];return n&&n.evaluate(this.context)!==e[u]},e.transferPropsToRoot=function(t,e){for(var u in e){var n=t[u];if(n)this.rootStyle[u]=n,delete t[u];else{var i=e[u];i&&(this.rootStyle[u]=new $r(i,oi))}}},e.postprocessTopStyle=function(t,e){if(e)for(var u=0,n=["writing-mode","direction"];u=this.lastOffset)){var e=this.context,u=this.xmldoc.getElementOffset(this.root);if(t=this.lastOffset))for(;;){if(1!=a.nodeType)s+=a.textContent.length;else{var l=a,D=this.getStyle(l,!1),h=D["flow-into"];if(h){var c=h.evaluate(e,"flow-into").toString();this.encounteredFlowElement(c,D,l,s)}s++}if(s>=this.lastOffset)break;var d=a.firstChild;if(null==d)for(;!(d=a.nextSibling);)if((a=a.parentNode)===this.root)return;a=d}}},e.resetFlowChunkStream=function(t){this.flowListener=t;for(var e=0;e0&&this.code%2!=0},e.markAsEndAlternate=function(t){this.code=2*t+2},e.isEndAlternate=function(){return this.code>0&&this.code%2==0},e.getAlternate=function(){return Math.floor((this.code-1)/2)},t}(),pD=function(t,e){this.where=void 0,this.success=void 0,this.what=-1,this.where=t,this.success=e};!function(t){t[t.FOLLOW=1]="FOLLOW",t[t.OPTIONAL=2]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.ALTERNATE=4]="ALTERNATE"}(oD||(oD={}));var ED=function(){function t(){this.nodes=[],this.connections=[],this.match=[],this.nomatch=[],this.error=[],this.emptyHead=!0}var e=t.prototype;return e.connect=function(t,e){for(var u=0;u=0?e?i.markAsStartAlternate(u):i.markAsEndAlternate(u):e?i.markAsStartGroup():i.markAsEndGroup(),this.nodes.push(i),this.connect(t,n);var r=new pD(n,!0),o=new pD(n,!1);t.push(this.connections.length),this.connections.push(o),t.push(this.connections.length),this.connections.push(r)},e.endSpecialGroup=function(){for(var t=[this.match,this.nomatch,this.error],e=0;e=0&&(o.what+=u),this.connections.push(o)}for(var a=0;a=t.length)i=i.failure;else{var s=t[r],l=s;if(i.isSpecial()){var D=!0;i.isStartGroup()?(o?o.push(a):o=[a],a=[]):i.isEndGroup()?a=o.length>0?o.pop():null:i.isEndAlternate()?a[i.getAlternate()]="taken":D=null==a[i.getAlternate()],i=D?i.success:i.failure}else{if(0==r&&!e&&i.validator instanceof yD&&this instanceof yD){if(l=new je(t).visit(i.validator)){r=t.length,i=i.success;continue}}else if(0==r&&!e&&i.validator instanceof wD&&this instanceof yD){if(l=new Ke(t).visit(i.validator)){r=t.length,i=i.success;continue}}else l=s.visit(i.validator);if(!l){i=i.failure;continue}if(l!==s&&t===n){n=[];for(var h=0;h0:r==t.length)?n:null},u.validateSingle=function(t){for(var e=null,u=this.first;u!==this.successTerminal&&u!==this.failureTerminal;)t?u.isSpecial()?u=u.success:(e=t.visit(u.validator))?(t=null,u=u.success):u=u.failure:u=u.failure;return u===this.successTerminal?e:null},u.visitEmpty=function(t){return this.validateSingle(t)},u.visitSlash=function(t){return this.validateSingle(t)},u.visitStr=function(t){return this.validateSingle(t)},u.visitIdent=function(t){return this.validateSingle(t)},u.visitNumeric=function(t){return this.validateSingle(t)},u.visitNum=function(t){return this.validateSingle(t)},u.visitInt=function(t){return this.validateSingle(t)},u.visitHexColor=function(t){return this.validateSingle(t)},u.visitURL=function(t){return this.validateSingle(t)},u.visitURange=function(t){return this.validateSingle(t)},u.visitSpaceList=function(t){return null},u.visitCommaList=function(t){return null},u.visitFunc=function(t){return this.validateSingle(t)},u.visitExpr=function(t){return null},e}(AD),yD=function(t){function e(e){return t.call(this,e)||this}x(e,t);var u=e.prototype;return u.visitSpaceList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new je(e):null},u.visitCommaList=function(t){for(var e=this.first,u=!1;e;){if(e.validator instanceof wD){u=!0;break}e=e.failure}if(u){var n=this.validateList(t.values,!1,0);return n===t.values?t:n?new Ke(n):null}return null},u.validateForShorthand=function(t,e){return this.validateList(t,!0,e)},e}(BD),wD=function(t){function e(e){return t.call(this,e)||this}x(e,t);var u=e.prototype;return u.visitSpaceList=function(t){return this.validateSingle(t)},u.visitCommaList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Ke(e):null},u.validateForShorthand=function(t,e){for(var u,n=this.first;n!==this.failureTerminal;){if(u=n.validator.validateForShorthand(t,e))return u;n=n.failure}return null},e}(BD),ND=function(t){function e(e,u){var n;return(n=t.call(this,u)||this).name=void 0,n.name=e,n}x(e,t);var u=e.prototype;return u.validateSingle=function(t){return null},u.visitFunc=function(t){if(t.name.toLowerCase()!=this.name)return null;var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Ye(t.name,e):null},e}(BD),bD=function(){function t(){}var e=t.prototype;return e.tryParse=function(t,e,u){return e},e.success=function(t,e){},t}(),SD=function(t){function e(e,u){var n;return(n=t.call(this)||this).name=void 0,n.validator=void 0,n.name=u,n.validator=e.validators[n.name],n}x(e,t);var u=e.prototype;return u.tryParse=function(t,e,u){if(u.values[this.name])return e;var n=this.validator.validateForShorthand(t,e);if(n){var i=n.length,r=i>1?new je(n):n[0];return this.success(r,u),e+i}return e},u.success=function(t,e){e.values[this.name]=t},e}(bD),xD=function(t){function e(e,u){var n;return(n=t.call(this,e,u[0])||this).names=void 0,n.names=u,n}return x(e,t),e.prototype.success=function(t,e){for(var u=0;ue)e=n,u=0;else if(++u==this.syntax.length){this.error=!0;break}}return e},e}(ID),RD=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.validateList=function(t){if(t.length>this.syntax.length||0==t.length)return this.error=!0,0;for(var e=0;e=t.length;)u=1==u?0:u-2;if(this.syntax[e].tryParse(t,u,this)!=u+1)return this.error=!0,0}return t.length},u.createSyntaxNode=function(){return new xD(this.validatorSet,this.propList)},e}(ID),kD=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.validateList=function(t){for(var e=t.length,u=0;uthis.syntax.length||0==t.length)return this.error=!0,0;for(var n=0;n=e;)i=1==i?0:i-2;var r=void 0;if(e+1=t.length;)r-=r==e+2?1:2;else r=i;if(2!=this.syntax[n].tryParse([t[i],t[r]],0,this))return this.error=!0,0}return t.length},e}(ID),LD=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.mergeIn=function(t,e){for(var u,n=O(this.propList);!(u=n()).done;){var i,r,o=u.value,a=null!=(i=null!=(r=e[o])?r:this.validatorSet.defaultValues[o])?i:Je.initial,s=t[o];s||(t[o]=s=[]),s.push(a)}},u.visitCommaList=function(t){for(var e={},u=0;ue.length)return this.error=!0,u;this.error=!1;var r=this.validatorSet.validators;if(!e[u].visit(r["font-size"]))return this.error=!0,u;if(this.values["font-size"]=e[u++],e[u]===ke){if(2+ ++u>e.length)return this.error=!0,u;if(!e[u].visit(r["line-height"]))return this.error=!0,u;this.values["line-height"]=e[u++]}var o=u==e.length-1?e[u]:new je(e.slice(u,e.length));return o.visit(r["font-family"])?(this.values["font-family"]=o,e.length):(this.error=!0,u)},u.visitCommaList=function(t){if(t.values[0].visit(this),this.error)return null;for(var e=[this.values["font-family"]],u=1;u expected");var C=h.num,F=C;if(t.consume(),(h=t.token()).type==Uu.COMMA){if(t.consume(),(h=t.token()).type!=Uu.INT)throw new Error(" expected");F=h.num,t.consume(),h=t.token()}if(h.type!=Uu.C_BRC)throw new Error("'}' expected");i.push(e.addCounts(i.pop(),C,F));break;case Uu.SEMICOL:if(D=s(),r.length>0)throw new Error("unclosed '"+r.pop().b+"'");break;default:throw new Error("unexpected token")}}t.consume(),e.isBuiltIn(u)?e.namedValidators[u]=D:e.validators[u]=D.isSimple()?D.nodes[0].validator:new yD(D)};;){var n=u();if("object"==typeof n)return n.v}},e.parseDefaults=function(t){for(;;){var e=this.readNameAndPrefixes(t,2);if(!e)return;for(var u=[];;){t.consume();var n=t.token();if(n.type==Uu.SEMICOL){t.consume();break}switch(n.type){case Uu.IDENT:u.push(Me(n.text));break;case Uu.NUM:u.push(new Ve(n.num));break;case Uu.INT:u.push(new He(n.num));break;case Uu.NUMERIC:u.push(new Ue(n.num,n.text));break;default:throw new Error("unexpected token")}}this.defaultValues[e]=u.length>1?new je(u):u[0]}},e.parseShorthands=function(t){for(;;){var e=this.readNameAndPrefixes(t,3);if(!e)return;var u=t.nthToken(1),n=void 0;u.type==Uu.IDENT&&MD[u.text]?(n=new MD[u.text],t.consume()):n=new PD,n.setOwner(this);for(var i=!1,r=[],o=!1,a=[],s=[];!i;)switch(t.consume(),(u=t.token()).type){case Uu.IDENT:if(this.validators[u.text])r.push(n.syntaxNodeForProperty(u.text)),u.text.includes("_")||s.push(u.text);else{if(!(this.shorthands[u.text]instanceof RD))throw new Error("'"+u.text+"' is neither a simple property nor an inset shorthand");var l=this.shorthands[u.text];r.push(l.createSyntaxNode()),s.push.apply(s,l.propList)}break;case Uu.SLASH:if(r.length>0||o)throw new Error("unexpected slash");o=!0;break;case Uu.O_BRK:a.push({slash:o,syntax:r}),r=[],o=!1;break;case Uu.C_BRK:var D=new TD(r,o),h=a.pop();o=h.slash,(r=h.syntax).push(D);break;case Uu.SEMICOL:i=!0,t.consume();break;default:throw new Error("unexpected token")}n.init(r,s),this.shorthands[e]=n}},e.parse=function(t){var e=new Sn(t,null);this.parseValidators(e),this.parseDefaults(e),this.parseShorthands(e),this.backgroundProps=this.makePropSet(["background"]),this.layoutProps=this.makePropSet(["margin","border","padding","columns","column-gap","column-rule","column-fill"])},e.makePropSet=function(t){for(var e,u={},n=O(t);!(e=n()).done;)for(var i,r=e.value,o=this.shorthands[r],a=O(o?o.propList:[r]);!(i=a()).done;){var s,l=i.value;u[l]=null!=(s=this.defaultValues[l])?s:Je.initial}return u},e.validatePropertyAndHandleShorthand=function(t,e,u,n){if(su(t))n.simpleProperty(t,e,u);else if(i=e,r=new HD,i.visit(r),r.varFound)n.simpleProperty(t,e,u);else{var i,r,o="",a=t,s=(t=t.toLowerCase()).match(/^-([a-z]+)-([-a-z0-9]+)$/);s&&(o=s[1],t=s[2]);var l=this.prefixes[t];if(l&&l[o]){var D=this.validators[t];if(D){var h=ou(e)||e.isExpr()?e:e.visit(D);if(h)n.simpleProperty(t,h,u);else{if(!o&&CSS.supports(t,e.toString()))return void n.simpleProperty(t,e,u);n.invalidPropertyValue(a,e)}}else{var c=this.shorthands[t].clone();ou(e)?c.propagateDefaultingValue(e,u,n):(e.visit(c),c.finish(u,n)||n.invalidPropertyValue(a,e))}}else CSS.supports(t,e.toString())?n.simpleProperty(a,e,u):n.unknownProperty(a,e)}},t}();function VD(){var t=new UD;return t.initBuiltInValidators(),t.parse(Yn),t}var HD=function(t){function e(){for(var e,u=arguments.length,n=new Array(u),i=0;i0){var a=u+e.getInsetRight(),s=a-Math.floor(a/n)*n;s>0&&(e.snapOffsetX=n-s,r+=e.snapOffsetX)}e.paddingRight=r,e.snapWidth=n},e.assignTopPosition=function(t,e){var u=this.getPropAsNumber(t,"snap-height"),n=this.getPropAsNumber(t,"top"),i=this.getPropAsNumber(t,"margin-top"),r=this.getPropAsNumber(t,"padding-top"),o=this.getPropAsNumber(t,"border-top-width");if(e.top=n,e.marginTop=i,e.borderTop=o,e.snapHeight=u,!this.vertical&&u>0){var a=n+e.getInsetTop(),s=a-Math.floor(a/u)*u;s>0&&(e.snapOffsetY=u-s,r+=e.snapOffsetY)}e.paddingTop=r,et(e.element,"top",n+"px"),et(e.element,"margin-top",i+"px"),et(e.element,"padding-top",r+"px"),et(e.element,"border-top-width",o+"px")},e.assignBottomPosition=function(t,e){var u=this.getPropAsNumber(t,"margin-bottom"),n=this.getPropAsNumber(t,"padding-bottom"),i=this.getPropAsNumber(t,"border-bottom-width"),r=this.getPropAsNumber(t,"height")-e.snapOffsetY;et(e.element,"height",r+"px"),et(e.element,"margin-bottom",u+"px"),et(e.element,"padding-bottom",n+"px"),et(e.element,"border-bottom-width",i+"px"),e.height=r-e.snapOffsetY,e.marginBottom=u,e.borderBottom=i,e.paddingBottom=n},e.assignBeforePosition=function(t,e){this.vertical?this.assignRightPosition(t,e):this.assignTopPosition(t,e)},e.assignAfterPosition=function(t,e){this.vertical?this.assignLeftPosition(t,e):this.assignBottomPosition(t,e)},e.assignStartEndPosition=function(t,e){this.vertical?(this.assignTopPosition(t,e),this.assignBottomPosition(t,e)):(this.assignRightPosition(t,e),this.assignLeftPosition(t,e))},e.sizeWithMaxHeight=function(t,e){et(e.element,"border-top-width","0px");var u=this.getPropAsNumber(t,"max-height");this.isTopDependentOnAutoHeight?e.setVerticalPosition(0,u):(this.assignTopPosition(t,e),e.height=u-=e.snapOffsetY,et(e.element,"height",u+"px"))},e.sizeWithMaxWidth=function(t,e){et(e.element,"border-left-width","0px");var u=this.getPropAsNumber(t,"max-width");if(this.isRightDependentOnAutoWidth)e.setHorizontalPosition(0,u);else{this.assignRightPosition(t,e),e.width=u-=e.snapOffsetX;var n=this.getPropAsNumber(t,"right");et(e.element,"right",n+"px"),et(e.element,"width",u+"px")}},e.prepareContainer=function(t,e,u,n,i){this.parentInstance&&this.vertical==this.parentInstance.vertical||et(e.element,"writing-mode",this.vertical?"vertical-rl":"horizontal-tb"),(this.vertical?this.isAutoWidth:this.isAutoHeight)?this.vertical?this.sizeWithMaxWidth(t,e):this.sizeWithMaxHeight(t,e):(this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),(this.vertical?this.isAutoHeight:this.isAutoWidth)?this.vertical?this.sizeWithMaxHeight(t,e):this.sizeWithMaxWidth(t,e):this.assignStartEndPosition(t,e);for(var r=0;r1){var D=this.getPropAsNumber(t,"column-rule-width"),h=this.getProp(t,"column-rule-style"),c=this.getProp(t,"column-rule-color");if(D>0&&h&&h!=Je.none&&c!=Je.transparent)for(var d=this.getPropAsNumber(t,"column-gap"),f=this.vertical?e.height:e.width,p=this.vertical?"border-top":"border-left",E=1;Ea){var c=h[r]=new Xh(l[r],D[r].style,e,s,i,a);g[r]=c.getOuterSize(),A=!0}}})),A&&(F=this.getSizesOfMarginBoxesAlongVariableDimension(h,C.extent),A=!1,[r,o,a].forEach((function(t){F[t]=g[t]||F[t]})));var v={};Object.keys(l).forEach((function(t){var r=t,o=th(s,D[r].style[e?"min-width":"min-height"],u.extent);if(o){var a=o.evaluate(n);if(F[r]0&&r>0){var o=i+r;if(o0&&(n.xSize=u*a/s)}n.xSize>0&&(n.ySize=u-n.xSize)}else i>0?n.xSize=u:r>0&&(n.ySize=u)}else t.hasAutoSize()?n.xSize=Math.max(u-e.getOuterSize(),0):e.hasAutoSize()&&(n.ySize=Math.max(u-t.getOuterSize(),0));else t?t.hasAutoSize()&&(n.xSize=u):e&&e.hasAutoSize()&&(n.ySize=u);return n},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),u.element.setAttribute("data-vivliostyle-page-box",!0)},e}(dh),Gh=function(){function t(t,e,u,n,i){this.container=void 0,this.isHorizontal=void 0,this.clientLayout=void 0,this.hasAutoSize_=void 0,this.size=null,this.container=t,this.isHorizontal=u,this.clientLayout=i;var r=e[u?"width":"height"];this.hasAutoSize_=!r||r===Je.auto||ou(r)}var e=t.prototype;return e.hasAutoSize=function(){return this.hasAutoSize_},e.getSize=function(){return this.size||(this.size=Ya(this.clientLayout,this.container.element,this.isHorizontal?[ja.MAX_CONTENT_WIDTH,ja.MIN_CONTENT_WIDTH]:[ja.MAX_CONTENT_HEIGHT,ja.MIN_CONTENT_HEIGHT])),this.size},e.getOuterMaxContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[ja.MAX_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[ja.MAX_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterMinContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[ja.MIN_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[ja.MIN_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.container.width+this.container.getInsetRight():this.container.getInsetTop()+this.container.height+this.container.getInsetBottom()},t}(),Wh=function(){function t(t){this.params=void 0,this.params=t}var e=t.prototype;return e.hasAutoSize=function(){return this.params.some((function(t){return t.hasAutoSize()}))},e.getOuterMaxContentSize=function(){var t=this.params.map((function(t){return t.getOuterMaxContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterMinContentSize=function(){var t=this.params.map((function(t){return t.getOuterMinContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterSize=function(){var t=this.params.map((function(t){return t.getOuterSize()}));return Math.max.apply(null,t)*t.length},t}(),Xh=function(t){function e(e,u,n,i,r,o){var a;return(a=t.call(this,e,u,n,i,r)||this).fixedSize=void 0,a.fixedSize=o,a}x(e,t);var u=e.prototype;return u.hasAutoSize=function(){return!1},u.getOuterMaxContentSize=function(){return this.getOuterSize()},u.getOuterMinContentSize=function(){return this.getOuterSize()},u.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.fixedSize+this.container.getInsetRight():this.container.getInsetTop()+this.fixedSize+this.container.getInsetBottom()},e}(Gh),jh=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).borderBoxWidth=null,n.borderBoxHeight=null,n.marginTop=null,n.marginRight=null,n.marginBottom=null,n.marginLeft=null,n}x(e,t);var u=e.prototype;return u.applyCascadeAndInit=function(e,u){var n=this.cascaded;for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&(i.match(/^column.*$/)||i.match(/^background-/))&&(n[i]=u[i]);t.prototype.applyCascadeAndInit.call(this,e,u),this.parentInstance.setPageAreaDimension({borderBoxWidth:this.borderBoxWidth,borderBoxHeight:this.borderBoxHeight,marginTop:this.marginTop,marginRight:this.marginRight,marginBottom:this.marginBottom,marginLeft:this.marginLeft})},u.initHorizontal=function(){var t=this.resolvePageBoxDimensions({start:"left",end:"right",extent:"width"});this.borderBoxWidth=t.borderBoxExtent,this.marginLeft=t.marginStart,this.marginRight=t.marginEnd},u.initVertical=function(){var t=this.resolvePageBoxDimensions({start:"top",end:"bottom",extent:"height"});this.borderBoxHeight=t.borderBoxExtent,this.marginTop=t.marginStart,this.marginBottom=t.marginEnd},u.resolvePageBoxDimensions=function(t){var e=this.style,u=this.pageBox.scope,n=t.start,i=t.end,r=t.extent,o=this.pageBox.pageSize[r].toExpr(u,null),a=th(u,e[r],o),s=th(u,e["margin-"+n],o),l=th(u,e["margin-"+i],o),D=eh(u,e["padding-"+n],o),h=eh(u,e["padding-"+i],o),c=nh(u,e["border-"+n+"-width"],e["border-"+n+"-style"],o),d=nh(u,e["border-"+i+"-width"],e["border-"+i+"-style"],o),f=we(u,o,ye(u,ye(u,c,D),ye(u,d,h)));return a?(f=we(u,f,a),s||l?s?l=we(u,f,s):s=we(u,f,l):l=s=Ne(u,f,new Ae(u,.5))):(s||(s=u.zero),l||(l=u.zero),a=we(u,f,ye(u,s,l))),this.hasBorderOrOutline()||s instanceof de&&s.num<0||l instanceof de&&l.num<0?(e[n]=new qe(s),e[i]=new qe(l),e["margin-"+n]=nu,e["margin-"+i]=nu,e["border-"+n+"-width"]=new qe(c),e["border-"+i+"-width"]=new qe(d)):(e[n]=nu,e[i]=nu,e["margin-"+n]=nu,e["margin-"+i]=nu,e["border-"+n+"-width"]=new qe(s),e["border-"+i+"-width"]=new qe(l),e["border-"+n+"-style"]=Je.solid,e["border-"+i+"-style"]=Je.solid,e["border-"+n+"-color"]=Je.transparent,e["border-"+i+"-color"]=Je.transparent,e["background-clip"]=Je.padding_box),e["padding-"+n]=new qe(D),e["padding-"+i]=new qe(h),e[r]=new qe(a),e["max-"+r]=new qe(a),{borderBoxExtent:we(u,o,ye(u,s,l)),marginStart:s,marginEnd:l}},u.hasBorderOrOutline=function(){var t=this,e=function(e){var u,n=null==(u=io(t.cascaded,e))?void 0:u.value;return!!n&&n!==Je.none};return e("border-top-style")||e("border-bottom-style")||e("border-left-style")||e("border-right-style")||e("border-block-start-style")||e("border-block-end-style")||e("border-inline-start-style")||e("border-inline-end-style")||e("outline-style")},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),n.pageAreaElement=u.element,e.pageAreaWidth=parseFloat(n.pageAreaElement.style.width),e.pageAreaHeight=parseFloat(n.pageAreaElement.style.height)},e}(ph),Kh=function(t){function e(e,u){var n;(n=t.call(this,e,u)||this).boxInfo=void 0,n.suppressEmptyBoxGeneration=!0;var i=u.marginBoxName;return n.boxInfo=Lh[i],e.pageMarginBoxInstances[i]=k(n),n}x(e,t);var u=e.prototype;return u.prepareContainer=function(e,u,n,i,r){this.applyVerticalAlign(e,u.element),t.prototype.prepareContainer.call(this,e,u,n,i,r)},u.applyVerticalAlign=function(t,e){et(e,"display","flex"),et(e,"flex-flow",this.vertical?this.rtl?"row-reverse":"row":"column");var u=this.getProp(t,"vertical-align"),n=null;u===Me("middle")?n="center":u===Me("top")?n="flex-start":u===Me("bottom")&&(n="flex-end"),n&&et(e,"justify-content",n);var i=this.getProp(t,"content");if(this.vertical||i instanceof Ge||i instanceof qe&&i.expr instanceof Ee&&i.expr.str.startsWith("running-element-")){var r="center";(this.boxInfo.isInTopRow||this.boxInfo.isInBottomRow)&&(this.boxInfo.isInLeftColumn||this.boxInfo.positionAlongVariableDimension===Ph.END?r=this.vertical||this.rtl?"start":"end":(this.boxInfo.isInRightColumn||this.boxInfo.positionAlongVariableDimension===Ph.START)&&(r=this.vertical||this.rtl?"end":"start")),et(e,"align-items",r)}},u.positionAlongVariableDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.start,r=t.end,o="left"===i,a=o?e.borderBoxWidth:e.borderBoxHeight,s=th(n,u[t.extent],a),l=o?e.marginLeft:e.marginTop;if(this.boxInfo.positionAlongVariableDimension===Ph.START)u[i]=new qe(l);else if(s){var D=eh(n,u["margin-"+i],a),h=eh(n,u["margin-"+r],a),c=eh(n,u["padding-"+i],a),d=eh(n,u["padding-"+r],a),f=nh(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),p=nh(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),E=ye(n,s,ye(n,ye(n,c,d),ye(n,ye(n,f,p),ye(n,D,h))));switch(this.boxInfo.positionAlongVariableDimension){case Ph.CENTER:u[i]=new qe(ye(n,l,be(n,we(n,a,E),new Ae(n,2))));break;case Ph.END:u[i]=new qe(we(n,ye(n,l,a),E))}}},u.positionAndSizeAlongFixedDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.inside,r=t.outside,o=t.extent,a=e["margin"+r.charAt(0).toUpperCase()+r.substring(1)],s=uh(n,u["margin-"+i],a),l=uh(n,u["margin-"+r],a),D=eh(n,u["padding-"+i],a),h=eh(n,u["padding-"+r],a),c=nh(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),d=nh(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),f=th(n,u[o],a),p=null;function E(t){if(p)return p;p={extent:f?f.evaluate(t):null,marginInside:s?s.evaluate(t):null,marginOutside:l?l.evaluate(t):null};var e=a.evaluate(t),u=0;return[c,D,h,d].forEach((function(e){e&&(u+=e.evaluate(t))})),(null===p.marginInside||null===p.marginOutside)&&u+p.extent+p.marginInside+p.marginOutside>e&&(null===p.marginInside&&(p.marginInside=0),null===p.marginOutside&&(p.marginOutside=0)),null!==p.extent&&null!==p.marginInside&&null!==p.marginOutside&&(p.marginOutside=null),null===p.extent&&null!==p.marginInside&&null!==p.marginOutside?p.extent=e-u-p.marginInside-p.marginOutside:null!==p.extent&&null===p.marginInside&&null!==p.marginOutside?p.marginInside=e-u-p.extent-p.marginOutside:null!==p.extent&&null!==p.marginInside&&null===p.marginOutside?p.marginOutside=e-u-p.extent-p.marginInside:null===p.extent?(p.marginInside=p.marginOutside=0,p.extent=e-u):p.marginInside=p.marginOutside=(e-u-p.extent)/2,p}u[o]=new qe(new Ee(n,(function(){var t=E(this).extent;return null===t?0:t}),o)),u["margin-"+i]=new qe(new Ee(n,(function(){var t=E(this).marginInside;return null===t?0:t}),"margin-"+i)),u["margin-"+r]=new qe(new Ee(n,(function(){var t=E(this).marginOutside;return null===t?0:t}),"margin-"+r)),"left"===i?u.left=new qe(ye(n,e.marginLeft,e.borderBoxWidth)):"top"===i&&(u.top=new qe(ye(n,e.marginTop,e.borderBoxHeight)))},u.initHorizontal=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInLeftColumn?this.positionAndSizeAlongFixedDimension({inside:"right",outside:"left",extent:"width"},t):this.boxInfo.isInRightColumn?this.positionAndSizeAlongFixedDimension({inside:"left",outside:"right",extent:"width"},t):this.positionAlongVariableDimension({start:"left",end:"right",extent:"width"},t)},u.initVertical=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInTopRow?this.positionAndSizeAlongFixedDimension({inside:"bottom",outside:"top",extent:"height"},t):this.boxInfo.isInBottomRow?this.positionAndSizeAlongFixedDimension({inside:"top",outside:"bottom",extent:"height"},t):this.positionAlongVariableDimension({start:"top",end:"bottom",extent:"height"},t)},u.finishContainer=function(e,u,n,i,r,o,a){t.prototype.finishContainer.call(this,e,u,n,i,r,o,a);var s=n.marginBoxes,l=this.pageBox.marginBoxName,D=this.boxInfo;D.isInLeftColumn||D.isInRightColumn?D.isInTopRow||D.isInBottomRow||(D.isInLeftColumn?s.left[l]=u:D.isInRightColumn&&(s.right[l]=u)):D.isInTopRow?s.top[l]=u:D.isInBottomRow&&(s.bottom[l]=u)},e}(ph),Yh=function(){function t(t,e,u,n,i){this.cascadeInstance=void 0,this.pageScope=void 0,this.rootPageBoxInstance=void 0,this.context=void 0,this.docElementStyle=void 0,this.pageMasterCache={},this.cascadeInstance=t,this.pageScope=e,this.rootPageBoxInstance=u,this.context=n,this.docElementStyle=i,this.definePageProgression()}var u=t.prototype;return u.definePageProgression=function(){var t=this.pageScope,u=this.context,n=u.isVersoFirstPage,i=new fe(t,"page-number"),r=new oe(t,new ce(t,i,new Ae(t,2)),n?t.one:t.zero);t.defineName("recto-page",new Yt(t,r)),t.defineName("verso-page",r),(u.pageProgression||gh(this.docElementStyle))===e.PageProgression.LTR?(t.defineName("left-page",r),t.defineName("right-page",new Yt(t,r))):(t.defineName("left-page",new Yt(t,r)),t.defineName("right-page",r))},u.getCascadedPageStyle=function(t){var e={};return this.cascadeInstance.pushRule([],t,e),this.cascadeInstance.popRule(),e},u.getPageRulePageMaster=function(t,e){var u=t.pageBox;if(0===Object.keys(e).length)return u.resetScope(),t;var n=this.makeCacheKey(e,u),i=this.pageMasterCache[n];return i||(i=u.pseudoName===hh?this.generatePageRuleMaster(e):this.generateCascadedPageMaster(e,u),this.pageMasterCache[n]=i),i.pageBox.resetScope(),i},u.makeCacheKey=function(t,e){var u=this.makeCascadeValueObjectKey(t);return e.key+"^"+u},u.makeCascadeValueObjectKey=function(t){var e=[];for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var n,i=t[u];n=i instanceof $r?""+i.value:this.makeCascadeValueObjectKey(i),e.push(u+n+(i.priority||""))}return e.sort().join("^")},u.generatePageRuleMaster=function(t){var e=new Uh(this.pageScope,this.rootPageBoxInstance.pageBox,t).createInstance(this.rootPageBoxInstance);return e.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),e.resolveAutoSizing(this.context),e},u.generateCascadedPageMaster=function(t,e){var u=e.clone({pseudoName:_h}),n=u.specified,i=t.size;if(i&&!ou(i.value)){var r=bh(t),o=i.priority;Jr(n,"width",new $r(r.width,o),this.context),Jr(n,"height",new $r(r.height,o),this.context)}["counter-reset","counter-increment"].forEach((function(e){n[e]&&(t[e]=n[e])}));var a=u.createInstance(this.rootPageBoxInstance);return a.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),a.resolveAutoSizing(this.context),a},t}(),qh=function(t){function e(e){var u;return(u=t.call(this)||this).pageType=void 0,u.pageType=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){t.currentPageType===this.pageType&&this.chained.apply(t)},u.getPriority=function(){return 3},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.pagetypes,this.pageType,this.chained),!0},e}(vo),$h=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){1===new fe(this.scope,"page-number").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(vo),Qh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"blank-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(vo),Zh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"left-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),Jh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"right-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),tc=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"recto-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),ec=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"verso-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),uc=function(t){function e(e,u,n){var i;return(i=t.call(this,u,n)||this).scope=void 0,i.a=void 0,i.b=void 0,i.scope=e,i.a=u,i.b=n,i}x(e,t);var u=e.prototype;return u.apply=function(t){var e=t.context,u=e.layoutPositionAtPageStart.page;e.blankPageAtStart&&u--,u&&this.matchANPlusB(u)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(Lo),nc=function(t){function e(e,u){return t.call(this,e,u,null,null,null)||this}return x(e,t),e.prototype.apply=function(t){!function(t,e,u,n,i){ho(t,e,u,n,null,null,null);var r=u[Mh];if(r){var o=ao(e,Mh);for(var a in r)if(r.hasOwnProperty(a)){var s=o[a];s||(o[a]=s={}),ho(t,s,r[a],n,null,null,null)}}}(t.context,t.currentStyle,this.style,this.specificity)},e}(go),ic=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,null==n?void 0:n.condition,n,null,i,!1)||this).pageProps=void 0,o.currentPageSelectors=[],o.currentNamedPageSelector="",o.currentPseudoPageClassSelectors=[],o.pageProps=r,o}x(e,t);var u=e.prototype;return u.startPageRule=function(){this.startSelectorRule()},u.tagSelector=function(t,e){this.currentNamedPageSelector=e,e&&(this.chain.push(new qh(e)),this.specificity+=65536)},u.pseudoclassSelector=function(t,e){if(t=t.toLowerCase(),e)if("nth"===t){var u=e[0],n=e[1];this.currentPseudoPageClassSelectors.push(":"+t+"("+u+"n"+(n<0?n:"+"+n)+")"),this.chain.push(new uc(this.scope,u,n)),this.specificity+=256}else this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t+"("+e.join("")+")");else switch(this.currentPseudoPageClassSelectors.push(":"+t),t){case"first":this.chain.push(new $h(this.scope)),this.specificity+=256;break;case"blank":this.chain.push(new Qh(this.scope)),this.specificity+=256;break;case"left":this.chain.push(new Zh(this.scope)),this.specificity+=1;break;case"right":this.chain.push(new Jh(this.scope)),this.specificity+=1;break;case"recto":this.chain.push(new tc(this.scope)),this.specificity+=1;break;case"verso":this.chain.push(new ec(this.scope)),this.specificity+=1;break;default:this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t)}},u.finishSelector=function(){var t;t=this.currentNamedPageSelector||this.currentPseudoPageClassSelectors.length?[this.currentNamedPageSelector].concat(this.currentPseudoPageClassSelectors.sort()):null,this.currentPageSelectors.push({selectors:t,specificity:this.specificity}),this.currentNamedPageSelector="",this.currentPseudoPageClassSelectors=[]},u.nextSelector=function(){this.finishSelector(),t.prototype.nextSelector.call(this)},u.startRuleBody=function(){this.finishSelector(),t.prototype.startRuleBody.call(this)},u.simpleProperty=function(e,u,n){if("bleed"!==e&&"marks"!==e||this.currentPageSelectors.some((function(t){return null===t.selectors}))){t.prototype.simpleProperty.call(this,e,u,n);var i=io(this.elementStyle,e),r=this.pageProps;if("bleed"===e||"marks"===e)r[""]||(r[""]={}),Object.keys(r).forEach((function(t){ro(r[t],e,i)}));else if("size"===e){var o=r[""];this.currentPageSelectors.forEach((function(t){var u=new $r(i.value,i.priority+t.specificity),n=t.selectors?t.selectors.join(""):"",a=r[n];a?Jr(a,e,u):(ro(a=r[n]={},e,u),o&&["bleed","marks"].forEach((function(t){o[t]&&ro(a,t,o[t])})))}))}}},u.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.pagetypes,"*",t)},u.makeApplyRuleAction=function(t){return new nc(this.elementStyle,t)},u.startPageMarginBoxRule=function(t){var e=ao(this.elementStyle,Mh),u=e[t];u||(e[t]=u={});var n=new rc(this.scope,this.owner,this.validatorSet,u);this.owner.pushHandler(n)},e}(Fa),rc=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,!1)||this).validatorSet=void 0,r.boxStyle=void 0,r.validatorSet=n,r.boxStyle=i,r}x(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity(),i=new $r(e,n);ro(this.boxStyle,t,i)},e}(di),oc=!0,ac=[];function sc(t,e){return t===e||(t.src||e.src?t.src===e.src:t.textContent===e.textContent)}function lc(t){var e=Array.from(t.querySelectorAll("body > :not(script):not(link):not(style) ~ script"));return Array.from(t.querySelectorAll("head > script, body > script")).filter((function(t){return!e.includes(t)}))}function Dc(t,e,u){if(!oc)return Rn(!1);if((null==u||!u.inHead)&&(null==u||!u.atEnd)&&lc(t.ownerDocument).includes(t))return Rn(!1);var n=t.textContent,i=t.src,r="module"===t.type,o=(r||i)&&t.async,a=r&&!o||i&&t.defer,s=!(null!=u&&u.atEnd)&&((null==u?void 0:u.forceDefer)||a||o);if(hc(e)||(e.onload=null),s)return ac.some((function(e){return sc(e,t)}))||ac.push(t),Rn(!0);if(i.includes("/mathjax")){var l,D,h=e.document.head.querySelector("script[src*='MathJax.js']:not([data-vivliostyle-scripting])");if(h)if(i.includes("/mathjax@3"))e.document.head.removeChild(h),null!=(l=e.MathJax)&&null!=(D=l.version)&&D.startsWith("2.")&&delete e.MathJax;else if(i.includes("/MathJax.js"))return Rn(!0)}for(var d,f=O(e.document.head.getElementsByTagName("script"));!(d=f()).done;){var p=d.value;p.hasAttribute("data-vivliostyle-scripting")&&sc(p,t)&&e.document.head.removeChild(p)}var E=e.document.createElement("script");E.textContent=n,i&&(E.src=i),E.async=o,E.defer=a,E.setAttribute("data-vivliostyle-scripting","true");for(var C,F=O(t.attributes);!(C=F()).done;){var A=C.value;["src","async","defer"].includes(A.name)||E.setAttribute(A.name,A.value)}if(c.debug("script:",i),i){var g=ii(E);return e.document.head.appendChild(E),Xn([g])}return e.document.head.appendChild(E),Rn(!0)}function hc(t){return!!oc&&(ac.length>0||!!t.document.head.querySelector("script[data-vivliostyle-scripting]"))}var cc=function(t,e,u){return t.replace(/[uU][rR][lL]\(\s*"((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"\r\n])+)"/gm,(function(t,n){return'url("'+u.transformURL(n,e)+'"'})).replace(/[uU][rR][lL]\(\s*'((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^'\r\n])+)'/gm,(function(t,n){return"url('"+u.transformURL(n,e)+"'"})).replace(/[uU][rR][lL]\(\s*((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"'\r\n\)\s])+)/gm,(function(t,n){return"url("+u.transformURL(n,e)}))},dc={},fc=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;return(f=t.call(this)||this).flowName=void 0,f.context=void 0,f.viewport=void 0,f.styler=void 0,f.regionIds=void 0,f.xmldoc=void 0,f.docFaces=void 0,f.footnoteStyle=void 0,f.stylerProducer=void 0,f.page=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.documentURLTransformer=void 0,f.document=void 0,f.exprContentListener=void 0,f.nodeContext=null,f.viewRoot=null,f.isFootnote=!1,f.sourceNode=null,f.offsetInNode=0,f.viewNode=null,f.flowName=e,f.context=u,f.viewport=n,f.styler=i,f.regionIds=r,f.xmldoc=o,f.docFaces=a,f.footnoteStyle=s,f.stylerProducer=l,f.page=D,f.customRenderer=h,f.fallbackMap=c,f.documentURLTransformer=d,f.document=n.document,f.exprContentListener=i.counterListener.getExprContentListener(),f}x(u,t);var n=u.prototype;return n.clone=function(){return new u(this.flowName,this.context,this.viewport,this.styler,this.regionIds,this.xmldoc,this.docFaces,this.footnoteStyle,this.stylerProducer,this.page,this.customRenderer,this.fallbackMap,this.documentURLTransformer)},n.createPseudoelementShadow=function(t,e,u,n,i,r,o,a){var s=this.getPseudoMap(u,this.regionIds,this.isFootnote,this.nodeContext,r);if(!s)return a;for(var l,D=[],h=$s.createElementNS(W.SHADOW,"root"),c=h,d=O(Qs);!(l=d()).done;){var f=l.value,p=void 0;if(f){if(!s[f])continue;if(!("footnote-marker"!=f||e&&this.isFootnote))continue;if(f.match(/^first-/)){var E=n.display;if(!E||E===Je.inline)continue;var C=t.firstElementChild;if(C&&Fr(C.previousSibling)){var F=i.getStyle(C,!1);if(F){var A=io(F,"display");if(null!=A&&A.value&&A.value!==Je.inline)continue}}}if("before"===f||"after"===f){var g=s[f].content;if(!g||!Mr(g.value))continue}D.push(f),tl(p=$s.createElementNS(W.XHTML,"span"),f)}else p=$s.createElementNS(W.SHADOW,"content");c.appendChild(p),f.match(/^first-/)&&(c=p)}if(!D.length)return a;var v=new el(t,u,i,r,this.exprContentListener);return new Sr(t,h,null,o,a,br.ROOTLESS,v)},n.getPseudoMap=function(t,e,u,n,i){var r=oo(t,"_pseudos");if(!r)return null;var o={},a=function(){var t=o[s]={};ka(t,r[s],i),xa(t,i,r[s]),Ra(r[s],e,u,(function(e,u){ka(t,u,i),Sa(u,(function(e){ka(t,e,i)}))}))};for(var s in r)a();return o},n.createRefShadow=function(t,e,u,n,i){var r=this,o=Pn("createRefShadow");return this.xmldoc.store.load(t).then((function(a){var s=a;if(s){var l=s.getElement(t);if(l){var D=r.stylerProducer.getStylerForDoc(s);i=new Sr(u,l,s,n,i,e,D)}}o.finish(i)})),o.result()},n.createShadows=function(t,e,u,n,i,r,o){var a=this,s=Pn("createShadows"),l=n.template;return(l instanceof Ge?this.createRefShadow(l.url,br.ROOTLESS,t,o,null):Rn(null)).then((function(l){var D=null;if(t.namespaceURI==W.SHADOW&&"include"==t.localName){var h=t.getAttribute("href"),c=null;h?c=o?o.xmldoc:a.xmldoc:o&&(h=o.owner.namespaceURI==W.XHTML?o.owner.getAttribute("href"):o.owner.getAttributeNS(W.XLINK,"href"),c=o.parentShadow?o.parentShadow.xmldoc:a.xmldoc),h&&(h=K(h,c.url),D=a.createRefShadow(h,br.ROOTED,t,o,l))}null==D&&(D=Rn(l));var d=null;D.then((function(e){if(n.display===Je.table_cell){var u=K("user-agent.xml#table-cell",X);d=a.createRefShadow(u,br.ROOTLESS,t,o,e)}else d=Rn(e)})),d.then((function(l){l=a.createPseudoelementShadow(t,e,u,n,i,r,o,l),s.finish(l)}))})),s.result()},n.setViewRoot=function(t,e){this.viewRoot=t,this.isFootnote=e},n.computeStyle=function(t,e,u,n){var i=this,r=this.context,o=Pa(u,r,this.regionIds,this.isFootnote);if(t=Ta(o,r,t),e=Ia(o,r,e),La(o,n,t,e,(function(t,e){var u=e.evaluate(r,t);return"font-family"==t&&(u=i.docFaces.filterFontFamily(u)),u})),Ds(n.position))return n.position=Je.fixed,n.visibility=Je.hidden,t;var a=hs(n.display||Je.inline,n.position,n.float,this.sourceNode===this.xmldoc.root);return["display","position","float"].forEach((function(t){a[t]&&(n[t]=a[t])})),t},n.inheritFromSourceParent=function(t){for(var e=this.nodeContext.sourceNode,u=[],n=null,i=this.nodeContext.shadowContext,r=-1;e&&1==e.nodeType;){var o=i&&i.root==e;if(!o||i.type==br.ROOTLESS){var a=(i?i.styler:this.styler).getStyle(e,!1);u.push(a),n=n||nt(e)}o?(e=i.owner,i=i.parentShadow):(e=e.parentNode,r++)}for(var s=this.context.queryUnitSize("em",0===r),l={"font-size":new $r(new Ue(s,"px"),0)},D=new fo(l,this.context),h=u.length-1;h>=0;--h){var c=u[h],d=[];for(var f in c)no(f)&&d.push(f);d.sort(au);for(var p=void 0,E=void 0,C=0,F=d;C0&&i.modifyElemDimensionWithImageResolution(s,n,h,i.nodeContext.vertical),o.finish(r)})):o.timeSlice().then((function(){o.finish(r)}))}))})),o.result()},n.isInsideNonRootMultiColumn=function(){for(var t=null==(e=this.nodeContext.parent)?void 0:e.viewNode;t;t=t.parentNode){var e,u=1===t.nodeType?t.style:null;if(!u)break;if(!isNaN(parseFloat(u.columnCount))||!isNaN(parseFloat(u.columnWidth)))return!0;if("absolute"===u.position)break}return!1},n.getBreakTypeAt=function(t){for(var e,u,n,i=t;i&&!i.after;i=i.parent){var r;if(Yi(i.breakBefore))return i.breakBefore;if(1===i.fragmentIndex&&!i.parent)return i.sourceNode===i.sourceNode.ownerDocument.documentElement?"page":null;var o=null==(r=i.parent)?void 0:r.viewNode;if(o){var a=this.viewport.window.getComputedStyle(o),s=parseFloat(a.paddingBlockStart),l=parseFloat(a.borderBlockStartWidth);if(s||l)return null;for(var D=null==o?void 0:o.firstChild;D&&(Fr(D,i.parent.whitespace)||gs(D));)D=D.nextSibling;if(D&&D!==i.viewNode)return null}}var h=null==(e=this.context)||null==(u=e.currentLayoutPosition)||null==(n=u.flowPositions[this.flowName])?void 0:n.startBreakType;return Yi(h)?h:"auto"},n.processAfterIfcontinues=function(t,e,u,n){var i=this.getPseudoMap(e,this.regionIds,this.isFootnote,this.nodeContext,n);if(i&&i["after-if-continues"]&&i["after-if-continues"].content){var r=new el(t,e,u,n,this.exprContentListener);this.nodeContext.afterIfContinues=new nl(t,r)}},n.isSVGUrlAttribute=function(t){return u.SVG_URL_ATTRIBUTES.includes(t.toLowerCase())},n.modifyElemDimensionWithImageResolution=function(t,e,u,n){var i=this;t.forEach((function(t){if("load"===t.fetcher.get().get()){var r=t.image,o=r.width/e,a=r.height/e,s=t.element;if(o>0&&a>0)if(u["box-sizing"]===Je.border_box&&(u["border-left-style"]!==Je.none&&(o+=Qe(u["border-left-width"],i.context)),u["border-right-style"]!==Je.none&&(o+=Qe(u["border-right-width"],i.context)),u["border-top-style"]!==Je.none&&(a+=Qe(u["border-top-width"],i.context)),u["border-bottom-style"]!==Je.none&&(a+=Qe(u["border-bottom-width"],i.context))),e>1){var l=u["max-width"]||Je.none,D=u["max-height"]||Je.none;if(l===Je.none&&D===Je.none)et(s,"max-width",o+"px");else if(l!==Je.none&&D===Je.none)et(s,"width",o+"px");else if(l===Je.none&&D!==Je.none)et(s,"height",a+"px");else{l.isNumeric(),D.isNumeric();var h=D;"%"!==l.unit?et(s,"max-width",Math.min(o,Qe(l,i.context))+"px"):"%"!==h.unit?et(s,"max-height",Math.min(a,Qe(h,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}else if(e<1){var c=u["min-width"]||nu,d=u["min-height"]||nu;c.isNumeric(),c.isNumeric();var f=c,p=d;0===f.num&&0===p.num?et(s,"min-width",o+"px"):0!==f.num&&0===p.num?et(s,"width",o+"px"):0===f.num&&0!==p.num?et(s,"height",a+"px"):"%"!==f.unit?et(s,"min-width",Math.max(o,Qe(f,i.context))+"px"):"%"!==p.unit?et(s,"min-height",Math.max(a,Qe(p,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}}))},n.preprocessElementStyle=function(t){var u=this;C(e.HOOKS.PREPROCESS_ELEMENT_STYLE).forEach((function(e){e(u.nodeContext,t)}))},n.findAndProcessRepeatingElements=function(t,e){for(var u=t.firstChild;u;u=u.nextSibling)if(1===u.nodeType){var n={},i=e.getStyle(u,!1);if(this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,i,n),this.processRepeatOnBreak(n)){if(this.nodeContext.formattingContext instanceof Fl&&!this.nodeContext.belongsTo(this.nodeContext.formattingContext))return;var r=this.nodeContext.parent;return this.nodeContext.formattingContext=new Fl(r&&r.formattingContext,this.nodeContext.sourceNode),void this.nodeContext.formattingContext.initializeRepetitiveElements(this.nodeContext.vertical)}}},n.processRepeatOnBreak=function(t){var e=t["repeat-on-break"];return e!==Je.none&&((e===Je.auto||ou(e))&&(e=t.display===Je.table_header_group?Je.header:t.display===Je.table_footer_group?Je.footer:Je.none),e&&e!==Je.none)?e.toString():null},n.createTextNodeView=function(){var t=this,e=Pn("createTextNodeView");return this.preprocessTextContent().then((function(){var u=t.offsetInNode||0,n=ar(t.nodeContext.preprocessedTextContent).substr(u);t.viewNode=document.createTextNode(n),e.finish(!0)})),e.result()},n.preprocessTextContent=function(){var t,u=this;if(null!=this.nodeContext.preprocessedTextContent)return Rn(!0);var n=t=this.sourceNode.textContent,i=Pn("preprocessTextContent"),r=C(e.HOOKS.PREPROCESS_TEXT_CONTENT),a=0;return i.loop((function(){return a>=r.length?Rn(!1):r[a++](u.nodeContext,n).thenAsync((function(t){return n=t,Rn(!0)}))})).then((function(){u.nodeContext.preprocessedTextContent=o.default(t,n,0),i.finish(!0)})),i.result()},n.createNodeView=function(t,e){var u,n=this,i=Pn("createNodeView"),r=!0;return 1==this.sourceNode.nodeType?u=this.createElementView(t,e):8==this.sourceNode.nodeType?(this.viewNode=null,u=Rn(!0)):u=this.createTextNodeView(),u.then((function(t){if(r=t,n.nodeContext.viewNode=n.viewNode,n.viewNode){var e,u=function(t,e){return 1===(null==t?void 0:t.nodeType)&&Js(t)===e},o=n.nodeContext.parent,a=o?u(n.viewNode,"after")&&u(o.viewNode,"first-letter")&&null!=(e=o.viewNode)&&e.hasChildNodes()?o.parent.viewNode:o.viewNode:n.viewRoot;a&&(!n.nodeContext.inline||3===n.viewNode.nodeType&&Fr(n.viewNode)||a.hasChildNodes()||!Gi(a).includes("block-start")||Xi(a,"text-start"),a.appendChild(n.viewNode))}i.finish(r)})),i.result()},n.setCurrent=function(t,e,u){return this.nodeContext=t,t?(this.sourceNode=t.sourceNode,this.offsetInNode=t.offsetInNode):(this.sourceNode=null,this.offsetInNode=-1),this.viewNode=null,this.nodeContext?this.createNodeView(e,!!u):Rn(!0)},n.processShadowContent=function(t){if(null==t.shadowContext||"content"!=t.sourceNode.localName||t.sourceNode.namespaceURI!=W.SHADOW)return t;var e,u,n=t.boxOffset,i=t.shadowContext,r=t.parent,o=i.subShadow||i.parentShadow;i.subShadow?(e=i.root,(u=i.type)==br.ROOTLESS&&(e=e.firstChild)):(e=i.owner.firstChild,u=br.ROOTLESS);var a=t.sourceNode.nextSibling;if(a?(t.sourceNode=a,t.resetView()):t.shadowSibling?t=t.shadowSibling:e?t=null:(t=t.parent.modify()).after=!0,e){var s=new Ir(e,r,n);return s.shadowContext=o,s.shadowType=u,s.shadowSibling=t,s}return t.boxOffset=n,t},n.nextPositionInTree=function(t){var e=t.boxOffset+1;if(t.after){if(!t.parent)return null;if(t.shadowType!=br.ROOTED){var u=t.sourceNode.nextSibling;if(u)return(t=t.modify()).boxOffset=e,t.sourceNode=u,t.resetView(),this.processShadowContent(t)}return t.shadowSibling?((t=t.shadowSibling.modify()).boxOffset=e,t):((t=t.parent.modify()).boxOffset=e,t.after=!0,t)}if(t.nodeShadow){var n=t.nodeShadow.root;if(t.nodeShadow.type==br.ROOTLESS&&(n=n.firstChild),n){var i=new Ir(n,t,e);return i.shadowContext=t.nodeShadow,i.shadowType=t.nodeShadow.type,this.processShadowContent(i)}}var r=t.sourceNode.firstChild;return r?this.processShadowContent(new Ir(r,t,e)):(1!=t.sourceNode.nodeType&&(e+=ar(t.preprocessedTextContent).length-1-t.offsetInNode),(t=t.modify()).boxOffset=e,t.after=!0,t)},n.isTransclusion=function(t,e,u){var n=io(e,"hyperlink-processing");if(!n)return!1;var i=n.evaluate(this.context,"hyperlink-processing");return!!i&&i.toString()==u},n.nextInTree=function(t,e){var u=this,n=this.nextPositionInTree(t);if(!n||n.after)return Rn(n);var i=Pn("nextInTree");return this.setCurrent(n,!0,e).then((function(t){n.viewNode&&t||((n=n.modify()).after=!0,n.viewNode||(n.inline=!0)),u.dispatchEvent({type:"nextInTree",nodeContext:n}),i.finish(n)})),i.result()},n.addImageFetchers=function(t){if(t instanceof Ke)for(var e=t.values,u=0;u=10)return!1;if(void 0===(null==(u=t.style)?void 0:u.zoom))return!1;var s=n/10;return et(t,"font-size","10px"),et(t,"zoom",""+s),!0},n.applyPseudoelementStyle=function(t,e,u){if(!t.after){var n=(t.shadowContext?t.shadowContext.styler:this.styler).getStyle(this.sourceNode,!1),i=oo(n,"_pseudos");if(i&&(n=i[e])){var r={};t.vertical=this.computeStyle(t.vertical,"rtl"===t.direction,n,r);var o=r.content;Mr(o)&&(o.visit(new _r(u,this.context,o,this.exprContentListener)),delete r.content),this.applyComputedStyles(u,r)}}},n.peelOff=function(t,e){var u=this,n=Pn("peelOff"),i=t.firstPseudo,r=t.offsetInNode,o=t.after;if(e>0)t.viewNode.textContent=t.viewNode.textContent.substr(0,e),r+=e;else if(!o&&t.viewNode&&0==r){var a=t.viewNode.parentNode;a&&a.removeChild(t.viewNode)}for(var s=t.boxOffset+e,l=[];t.firstPseudo===i;)l.push(t),t=t.parent;var D=l.pop(),h=D.shadowSibling;return n.loop((function(){for(;l.length>0;){D=l.pop(),t=new Ir(D.sourceNode,t,s),0==l.length&&(t.offsetInNode=r,t.after=o),t.shadowType=D.shadowType,t.shadowContext=D.shadowContext,t.nodeShadow=D.nodeShadow,t.shadowSibling=D.shadowSibling?D.shadowSibling:h,h=null;var e=u.setCurrent(t,!1);if(e.isPending())return e}return Rn(!1)})).then((function(){n.finish(t)})),n.result()},n.createElement=function(t,e){return t==W.XHTML?this.document.createElement(e):this.document.createElementNS(t,e)},n.applyFootnoteStyle=function(t,e,u){var n={},i=oo(this.footnoteStyle,"_pseudos");if(t=this.computeStyle(t,e,this.footnoteStyle,n),i&&i.before){var r={},o=this.createElement(W.XHTML,"span");tl(o,"before"),u.appendChild(o),this.computeStyle(t,e,i.before,r),delete r.content,this.applyComputedStyles(o,r)}return delete n.content,this.applyComputedStyles(u,n),t},n.processFragmentedBlockEdge=function(t){var e,u=!t.inline&&t.after?t.parent:t,n=!1;if(t.inline&&t.after&&!t.shadowContext&&1===(null==(e=t.sourceNode.nextSibling)?void 0:e.nodeType)){var i,r=t.sourceNode.nextSibling,o=null==(i=io(this.styler.getStyle(r,!1),"display"))?void 0:i.value.toString();n=o&&!ds(o)||"true"===r.getAttribute("data-math-typeset")&&/^\s*(\$\$|\\\[)/.test(r.textContent)}for(var a=0,s=u;s;s=s.parent){var l;if(1===(null==(l=s.viewNode)?void 0:l.nodeType)){var D=s.viewNode;if(D.style)if(s.inline){if(Xi(D,"inline-end"),zi(D)){var h=s.vertical?D.offsetWidth:D.offsetHeight;Xi(D,"clone"),(s.vertical?D.offsetWidth:D.offsetHeight)>h&&this.fixClonedBoxDecorationOverflow(D)}}else{if(Xi(D,"block-end"),!a++&&s!==u)if("justify"!==this.viewport.window.getComputedStyle(D).textAlign||n)Xi(D,"text-end");else{var c=this.createChildAnonymousBlockIfNeeded(D);c?c!==D?Wi(c,["block-start","text-start","block-end","text-end","justify"]):(Xi(D,"text-end"),Xi(D,"justify")):Xi(D,"text-end")}zi(D)&&(Xi(D,"clone"),ji(D,"block-end"))}}}},n.fixClonedBoxDecorationOverflow=function(t){var e=this.viewport.window.getComputedStyle(t),u=-(parseFloat(e.paddingInlineEnd)+parseFloat(e.borderInlineEndWidth));isNaN(u)||(t.style.marginInlineEnd=u+"px")},n.createChildAnonymousBlockIfNeeded=function(t){for(var e=this,u=function t(u){var n=e.viewport.window.getComputedStyle(u),i=n.display,r=n.position,o=n.float;if("ruby"===u.localName)return!1;if("br"===u.localName)return!0;if(("inline"===i||"contents"===i)&&u.hasChildNodes()){var a=u.lastElementChild;if(a&&(!a.nextSibling||a.nextSibling===u.lastChild&&Fr(a.nextSibling))){var s=t(a);if(s||null===s)return s}for(var l=null==a?void 0:a.previousElementSibling;l;l=l.previousElementSibling){var D=t(l);if(D||null===D)return null}return!1}if("none"===i||"absolute"===r||"fixed"===r||o&&"none"!==o||u.hasAttribute(pr)){var h=u.previousElementSibling;return!(!h||!(h.nextSibling===u||h.nextSibling===u.previousSibling&&Fr(h.nextSibling)))&&t(h)}return!(!i||ds(i))},n=null,i=t.lastElementChild;i;i=i.previousElementSibling){var r=u(i);if(r){n=i;break}if(null===r)return null}if(!n)return t;if(n===t.lastElementChild&&(!n.nextSibling||n.nextSibling===t.lastChild&&Fr(n.nextSibling)))return null;var o=t.ownerDocument.createElement("span");o.className="viv-anonymous-block";for(var a=n.nextSibling,s=null;a;a=s)s=a.nextSibling,o.appendChild(a);return t.appendChild(o),o},n.convertLengthToPx=function(t,e,u){var n=t.num,i=t.unit;if(function(t){switch(null==t?void 0:t.toLowerCase()){case"em":case"ex":case"rem":case"lh":case"rlh":return!0;default:return!1}}(i)){for(var r=e;r&&1!==r.nodeType;)r=r.parentNode;return po(t,parseFloat(u.getElementComputedStyle(r)["font-size"]),this.context).num}var o=this.context.queryUnitSize(i,!1);return o?n*o:t},n.isSameNodePositionStep=function(t,e){if(t.shadowContext){if(!e.shadowContext)return!1;var u=1===e.node.nodeType?e.node:e.node.parentElement;return t.shadowContext.owner===e.shadowContext.owner&&Js(1===t.node.nodeType?t.node:t.node.parentElement)===Js(u)}return t.node===e.node},n.isSameNodePosition=function(t,e){var u=this;return t.offsetInNode===e.offsetInNode&&t.after==e.after&&t.steps.length===e.steps.length&&t.steps.every((function(t,n){return u.isSameNodePositionStep(t,e.steps[n])}))},n.isPseudoelement=function(t){return!!Js(t)},u}(Et);fc.SVG_URL_ATTRIBUTES=["color-profile","clip-path","cursor","filter","marker","marker-start","marker-end","marker-mid","fill","stroke","mask"];var pc,Ec={"float-min-wrap-block":!0,"float-reference":!0,"flow-into":!0,"flow-linger":!0,"flow-options":!0,"flow-priority":!0,"footnote-policy":!0,"margin-break":!0,page:!0},Cc=function(){function t(t){this.layoutBox=void 0,this.window=void 0,this.scaleRatio=1,this.layoutBox=t.layoutBox,this.window=t.window,t.pixelRatio>0&&CSS.supports("zoom","8")&&(this.scaleRatio=t.pixelRatio/t.window.devicePixelRatio)}var e=t.prototype;return e.scaleRect=function(t){return{left:t.left*this.scaleRatio,top:t.top*this.scaleRatio,right:t.right*this.scaleRatio,bottom:t.bottom*this.scaleRatio,width:t.width*this.scaleRatio,height:t.height*this.scaleRatio}},e.subtractOffsets=function(t,e){var u=e.left,n=e.top;return{left:t.left-u,top:t.top-n,right:t.right-u,bottom:t.bottom-n,width:t.width,height:t.height}},e.getRangeClientRects=function(t){var e=this,u=t.getClientRects(),n=this.layoutBox.getBoundingClientRect();return Array.from(u).map((function(t){return e.scaleRect(e.subtractOffsets(t,n))}))},e.getElementClientRect=function(t){var e=t.getBoundingClientRect();if(0===e.left&&0===e.top&&0===e.right&&0===e.bottom)return e;var u=this.layoutBox.getBoundingClientRect();return this.scaleRect(this.subtractOffsets(e,u))},e.getElementComputedStyle=function(t){return this.window.getComputedStyle(t,null)},t}(),Fc=function(){function t(t,e,u,n,i,r){this.window=void 0,this.fontSize=void 0,this.pixelRatio=void 0,this.document=void 0,this.root=void 0,this.outerZoomBox=void 0,this.contentContainer=void 0,this.layoutBox=void 0,this.width=void 0,this.height=void 0,this.window=t,this.fontSize=e,this.pixelRatio=u,this.document=t.document,this.root=n||this.document.body,u>0&&CSS.supports("zoom","8")&&(et(this.root,"--viv-outputPixelRatio",""+u),et(this.root,"--viv-devicePixelRatio",""+t.devicePixelRatio));var o=this.root.firstElementChild;o||((o=this.document.createElement("div")).setAttribute("data-vivliostyle-outer-zoom-box","true"),this.root.appendChild(o));var a=o.firstElementChild;a||((a=this.document.createElement("div")).setAttribute("data-vivliostyle-spread-container","true"),o.appendChild(a));var s=o.nextElementSibling;s||((s=this.document.createElement("div")).setAttribute("data-vivliostyle-layout-box","true"),this.root.appendChild(s)),this.outerZoomBox=o,this.contentContainer=a,this.layoutBox=s,this.width=i||parseFloat(t.getComputedStyle(this.root).width)||this.root.offsetWidth||t.innerWidth,this.height=r||parseFloat(t.getComputedStyle(this.root).height)||this.root.offsetHeight||t.innerHeight;var l=!t.outerWidth&&!t.outerHeight||/Headless/.test(navigator.userAgent)||navigator.webdriver&&800===t.innerWidth&&600===t.innerHeight;(!this.width||!i&&l)&&(this.width=794),(!this.height||!r&&l)&&(this.height=1056)}var e=t.prototype;return e.resetZoom=function(){et(this.outerZoomBox,"width",""),et(this.outerZoomBox,"height",""),et(this.contentContainer,"width",""),et(this.contentContainer,"height",""),et(this.contentContainer,"transform","")},e.zoom=function(t,e,u){et(this.root,"--viv-outputScale",""+u),et(this.outerZoomBox,"width",t*u+"px"),et(this.outerZoomBox,"height",e*u+"px"),et(this.contentContainer,"width",t+"px"),et(this.contentContainer,"height",e+"px")},e.clear=function(){for(var t=this.root;t.lastChild;)t.removeChild(t.lastChild)},t}(),Ac=function(){function t(t,e,u){this.store=void 0,this.url=void 0,this.document=void 0,this.lang=null,this.totalOffset=-1,this.root=void 0,this.body=void 0,this.head=void 0,this.last=void 0,this.lastOffset=1,this.idMap=void 0,this.store=t,this.url=e,this.document=u,this.root=u.documentElement;var n=null,i=null;if(this.root.namespaceURI==W.XHTML){for(var r=this.root.firstChild;r;r=r.nextSibling)if(1==r.nodeType){var o=r;if(o.namespaceURI==W.XHTML)switch(o.localName){case"head":i=o;break;case"body":n=o}}this.lang=this.root.getAttribute("lang")}this.body=n,this.head=i,this.last=this.root,this.last.setAttribute(M,"0")}var e=t.prototype;return e.doc=function(){return new Bc([this.document])},e.getElementOffset=function(t){var e=t.getAttribute(M);if(e)return parseInt(e,10);for(var u=this.lastOffset,n=this.last;n!=t;){var i=n.firstChild;if(!i)for(;!(i=n.nextSibling);)if(null==(n=n.parentNode))throw new Error("Internal error");n=i,1==i.nodeType?(i.setAttribute(M,u.toString()),++u):u+=i.textContent.length}return this.lastOffset=u,this.last=t,u-1},e.getNodeOffset=function(t,e,u){var n=0,i=t,r=null;if(1==i.nodeType){if(!u)return this.getElementOffset(i)}else{if(n=e,!(r=i.previousSibling))return n+=1,this.getElementOffset(i=i.parentNode)+n;i=r}for(;;){for(;i.lastChild;)i=i.lastChild;if(1==i.nodeType)break;if(n+=i.textContent.length,!(r=i.previousSibling)){i=i.parentNode;break}i=r}return n+=1,this.getElementOffset(i)+n},e.getTotalOffset=function(){return this.totalOffset<0&&(this.totalOffset=this.getNodeOffset(this.root,0,!0)),this.totalOffset},e.getNodeByOffset=function(t){for(var e,u=this,n=this.root,i=function(){if((e=u.getElementOffset(n))>=t)return{v:n};var i=n.children;if(!i)return"break";var r=ct(i.length,(function(e){return u.getElementOffset(i[e])>t}));if(0==r)return"break";n=i[r-1]};;){var r=i();if("break"===r)break;if("object"==typeof r)return r.v}for(var o=e+1,a=n,s=a.firstChild||a.nextSibling,l=null;;){if(s){if(1==s.nodeType)break;if(l=a=s,(o+=s.textContent.length)>t&&!/^\s*$/.test(s.textContent))break}else if(!(a=a.parentNode))break;s=a.nextSibling}return s&&l&&/^\s*$/.test(l.textContent)&&(l=s),l||n},e.buildIdMap=function(t){var e=t.getAttribute("id");e&&!this.idMap[e]&&(this.idMap[e]=t);var u=t.getAttributeNS(W.XML,"id");u&&!this.idMap[u]&&(this.idMap[u]=t);for(var n=t.firstElementChild;n;n=n.nextElementSibling)this.buildIdMap(n)},e.getElement=function(t){var e=t.match(/([^#]*)#(.+)$/);if(!e||e[1]&&e[1]!=this.url)return null;var u=e[2],n=this.document.getElementById(u);return!n&&this.document.getElementsByName&&(n=this.document.getElementsByName(u)[0]),n||(this.idMap||(this.idMap={},this.buildIdMap(this.document.documentElement)),n=this.idMap[u]),n},t}();function gc(t,e,u){var n,i=u||new DOMParser;try{n=i.parseFromString(t,e)}catch(t){}if(!n)return null;var r=n.documentElement,o="parsererror";if(r.localName===o)return null;for(var a=r.firstElementChild;a;a=a.nextElementSibling)if(a.localName===o)return null;return n}function vc(t,e){var u=t.responseXML;if(!u){var n=new DOMParser,i=t.responseText;if(i){var r=function(t){var e=t.contentType;if(e){for(var u=Object.keys(pc),n=0;n0}))},t}())((function(t){return!0})),Bc=function(){function t(t){this.nodes=void 0,this.nodes=t}var e=t.prototype;return e.asArray=function(){return this.nodes},e.size=function(){return this.nodes.length},e.predicate=function(e){for(var u,n=[],i=O(this.nodes);!(u=i()).done;){var r=u.value;e.check(r)&&n.push(r)}return new t(n)},e.forEachNode=function(e){for(var u=[],n=function(t){u.push(t)},i=0;i0&&c>0)return{width:n&&n.spreadView?2*(h+n.pageBorder):h,height:c,fontSize:u}}}}return{width:t,height:e,fontSize:u}},t}(),Nc=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;for(var p in(f=t.call(this,e.rootScope,i.width,i.height,i.fontSize)||this).style=void 0,f.xmldoc=void 0,f.viewport=void 0,f.clientLayout=void 0,f.fontMapper=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.pageNumberOffset=void 0,f.documentURLTransformer=void 0,f.counterStore=void 0,f.lang=void 0,f.primaryFlows={body:!0},f.rootPageBoxInstance=null,f.styler=null,f.stylerMap=null,f.currentLayoutPosition=null,f.layoutPositionAtPageStart=null,f.lookupOffset=0,f.faces=void 0,f.pageBoxInstances={},f.pageManager=null,f.rootPageFloatLayoutContext=void 0,f.pageBreaks={},f.pageProgression=null,f.isVersoFirstPage=!1,f.blankPageAtStart=!1,f.pageSheetSize={},f.pageSheetHeight=0,f.pageSheetWidth=0,f.style=e,f.xmldoc=u,f.viewport=i,f.clientLayout=r,f.fontMapper=o,f.customRenderer=a,f.fallbackMap=s,f.pageNumberOffset=l,f.documentURLTransformer=D,f.counterStore=h,f.lang=u.lang||n,f.faces=new XD(f.style.fontDeobfuscator),f.rootPageFloatLayoutContext=new es(null,null,null,null,null,null,null),f.pageProgression=c||null,f.isVersoFirstPage=!!d,e.flowProps){var E=io(e.flowProps[p],"flow-consume");E&&(E.evaluate(k(f),"flow-consume")==Je.all?f.primaryFlows[p]=!0:delete f.primaryFlows[p])}return f}x(u,t);var n=u.prototype;return n.init=function(){var t=this,e=Pn("StyleInstance.init"),u=this.counterStore.createCounterListener(this.xmldoc.url),n=this.counterStore.createCounterResolver(this.xmldoc.url,this.style.rootScope,this.style.pageScope);this.styler=new cD(this.xmldoc,this.style.cascade,this.style.rootScope,this,this.primaryFlows,this.style.validatorSet,u,n),n.setStyler(this.styler),this.styler.resetFlowChunkStream(this),this.stylerMap={},this.stylerMap[this.xmldoc.url]=this.styler;var i=this.styler.getTopContainerStyle();this.pageProgression||(this.pageProgression=gh(i)),this.matchStartPageSide(this.styler.breakBeforeValues[0])||(0===this.pageNumberOffset?this.isVersoFirstPage=!0:this.blankPageAtStart=!0),this.rootPageBoxInstance=new ch(this.style.rootBox);var r=this.style.cascade.createInstance(this,u,n,this.lang);this.styler.cascade.currentPageType=this.styler.cascade.firstPageType,this.rootPageBoxInstance.applyCascadeAndInit(r,i),this.rootPageBoxInstance.resolveAutoSizing(this),this.pageManager=new Yh(r,this.style.pageScope,this.rootPageBoxInstance,this,i);for(var o,a=[],s=O(this.style.fontFaces);!(o=s()).done;){var l=o.value;if(!l.condition||l.condition.evaluate(this)){var D=GD(l.properties,this),h=new WD(D);a.push(h)}}this.fontMapper.findOrLoadFonts(a,this.faces).then((function(){(function(t,e,u){if(!oc)return Rn(!1);var n=lc(t);if(0===n.length)return Rn(!1);var i=n.some((function(t){return!(t.async||t.defer||"module"===t.type)})),r=i?function(t,e,u){var n,i=null!=(n=e.document.querySelector("[data-vivliostyle-textcontent]"))?n:e.document.createElement("div");return i.style.position="fixed",i.style.fontSize="0",i.setAttribute("data-vivliostyle-textcontent","true"),i.setAttribute("aria-hidden","true"),i.style.fontFamily=function(t,e){for(var u={},n=function t(e){var n,i=null==(n=e["font-family"])?void 0:n.value;if(i)if(i.values)for(var r,o=O(i.values);!(r=o()).done;)u[r.value.stringValue()]=!0;else u[i.stringValue()]=!0;var a=e._marginBoxes;if(a)for(var s=0,l=Object.values(a);s0){var n=u.positions[0].flowChunk;this.getConsumedOffset(u)===n.startOffset&&(u.startBreakType=or(rr(u.startBreakType,u.positions[0].flowChunk.breakBefore)))}}},n.selectPageMaster=function(t){var e=this.currentLayoutPosition,u=this.getPosition(e);if(u==Number.POSITIVE_INFINITY)return null;for(var n,i=this.rootPageBoxInstance.children,r=0;rn}))-1,o=i[r],a=this.layoutPositionAtPageStart.flowPositions[u],s=this.getConsumedOffset(a);return!(on}(s))i.breakLoop();else{var l=(new ns).findByFloat(s),D=l.findPageFloatFragment(s,u);if(!D||!D.hasFloat(s))return u.isForbidden(s)||u.hasPrecedingFloatsDeferredToNext(s)?(u.deferPageFloat(a),void i.breakLoop()):void t.layoutPageFloatInner(a,l,null,D).then((function(t){if(t){var e=u.parent.isInvalidated();e?i.breakLoop():(u.isInvalidated()&&!e&&(r=!0,u.validate()),i.continueLoop())}else i.breakLoop()}));i.continueLoop()}}else i.breakLoop()})).then((function(){r&&u.invalidate(),i.finish(!0)})),i.result()},n.getLastAfterPositionIfDeferredFloatsExists=function(t,e){var u;return t.pageFloatLayoutContext.getPageFloatContinuationsDeferredToNext().length>0&&t.lastAfterPosition?(e?(u=e.clone()).primary=t.lastAfterPosition:u=new Pr(t.lastAfterPosition),u):null},n.layoutColumn=function(t,e){var u=this,n=this.currentLayoutPosition.flowPositions[e];if(!n||!this.matchPageSide(n.startBreakType))return Rn(!0);this.setFormattingContextToColumn(t,e),t.init(),this.primaryFlows[e]&&t.bands.length>0&&(t.forceNonfitting=!1);var i=Pn("layoutColumn");return this.layoutDeferredPageFloats(t).then((function(){if(t.pageFloatLayoutContext.isInvalidated())i.finish(!0);else{var r=[],o=[],a=!0;i.loopWithFrame((function(i){if(t.pageFloatLayoutContext.hasContinuingFloatFragmentsInFlow(e))i.breakLoop();else{for(var s=function(){for(var e=0;o.includes(e);)e++;var s=n.positions[e];if(s.flowChunk.startOffset>u.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(s.flowChunk))return"break";for(var l=e+1;lu.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(D.flowChunk))break;D.flowChunk.isBetter(s.flowChunk)&&(s=D,e=l)}var h=s.flowChunk,c=!0;return t.layout(s.chunkPosition,a,n.breakAfter).then((function(l){if(t.pageFloatLayoutContext.isInvalidated())i.breakLoop();else{if(a=!1,s.flowChunk.repeated&&(null===l||h.exclusive)&&r.push(e),h.exclusive)return o.push(e),void i.breakLoop();var D=!!l||!!t.pageBreakType,d=u.getLastAfterPositionIfDeferredFloatsExists(t,l);t.pageBreakType&&d?(s.chunkPosition=d,n.breakAfter=t.pageBreakType,t.pageBreakType=null):(o.push(e),(l||d)&&(s.chunkPosition=l||d,r.push(e)),n.startBreakType=or(t.pageBreakType)),D?i.breakLoop():(t.forceNonfitting=!1,c?c=!1:i.continueLoop())}})),c?(c=!1,{v:void 0}):void 0};n.positions.length-o.length>0;){var l=s();if("break"===l)break;if("object"==typeof l)return l.v}i.breakLoop()}})).then((function(){if(!t.pageFloatLayoutContext.isInvalidated()){n.positions=n.positions.filter((function(t,e){return r.includes(e)||!o.includes(e)})),"column"===n.breakAfter&&(n.breakAfter=null),t.saveDistanceToBlockEndFloats();var e=t.pageFloatLayoutContext.getMaxReachedAfterEdge();t.updateMaxReachedAfterEdge(e)}i.finish(!0)}))}})),i.result()},n.createLayoutConstraint=function(t){var e=this.counterStore.createLayoutConstraint(this.currentLayoutPosition.page-1);return new ll([e].concat(t.getLayoutConstraints()))},n.createAndLayoutColumn=function(t,e,u,n,i,r,o,a,s,l,D,h,c,d){var f,p=this,E=t.vertical?t.isAutoWidth&&t.isRightDependentOnAutoWidth:t.isAutoHeight&&t.isTopDependentOnAutoHeight,C=i.element,F=new es(a,qa.COLUMN,null,o,null,null,null),A=this.currentLayoutPosition.clone(),g=Pn("createAndLayoutColumn");return g.loopWithFrame((function(t){var g=p.createLayoutConstraint(F);if(s>1){var v=p.viewport.document.createElement("div");if(et(v,"position","absolute"),C.appendChild(v),(f=new hl(v,c,p.clientLayout,g,F)).forceNonfitting=d,f.vertical=i.vertical,f.rtl=i.rtl,f.snapHeight=i.snapHeight,f.snapWidth=i.snapWidth,i.vertical){var m=(i.rtl?s-r-1:r)*(D+l)+i.paddingTop,B=parseFloat(C.style.width);f.setHorizontalPosition(i.paddingLeft+B-i.width,i.width),f.setVerticalPosition(m,D)}else{var y=(i.rtl?s-r-1:r)*(D+l)+i.paddingLeft;f.setVerticalPosition(i.paddingTop,i.height),f.setHorizontalPosition(y,D)}f.originX=e,f.originY=u}else(f=new hl(C,c,p.clientLayout,g,F)).copyFrom(i);f.exclusions=E?[]:n.concat(),f.innerShape=h,F.setContainer(f),f.width>=0?p.layoutColumn(f,o).then((function(){F.isInvalidated()||F.finish(),f.pageFloatLayoutContext.isInvalidated()&&!a.isInvalidated()?(f.pageFloatLayoutContext.validate(),p.currentLayoutPosition=A.clone(),f.element!==C&&C.removeChild(f.element),t.continueLoop()):t.breakLoop()})):(F.finish(),t.breakLoop())})).then((function(){g.finish(f)})),g.result()},n.setPagePageFloatLayoutContextContainer=function(t,e,u){(e instanceof jh||e instanceof dh&&!(e instanceof zh))&&t.setContainer(u)},n.getRegionPageFloatLayoutContext=function(t,e,u,n){var i=e.getProp(this,"writing-mode")||null,r=e.getProp(this,"direction")||null;return new es(t,qa.REGION,u,n,null,i,r)},n.layoutFlowColumnsWithBalancing=function(t,e,u,n,i,r,o,a,s){var l=this,D=this.currentLayoutPosition.clone(),h=this.getRegionPageFloatLayoutContext(r,e,o,a),c=!0,d=function(){return l.currentLayoutPosition=D.clone(),l.layoutFlowColumns(t,e,u,n,i,r,h,o,a,s,c).thenAsync((function(t){return Rn(t?{columns:t,position:l.currentLayoutPosition}:null)}))};return d().thenAsync((function(t){if(!t)return Rn(null);if(s<=1)return Rn(t.columns);var u=e.getProp(l,"column-fill")||Je.balance,n=function(t,e,u,n,i,r,o){if(e===Je.auto)return null;var a=r[r.length-1];return 0===o.positions.length||a&&a.pageBreakType?new iD(u,n,i,t):e===Je.balance_all?new aD(u,n,i):null}(s,u,d,h,o,t.columns,l.currentLayoutPosition.flowPositions[a]);return n?(c=!1,r.lock(),h.lock(),n.balanceColumns(t).thenAsync((function(t){return r.unlock(),r.validate(),h.unlock(),l.currentLayoutPosition=t.position,Rn(t.columns)}))):Rn(t.columns)}))},n.layoutFlowColumns=function(t,e,u,n,i,r,o,a,s,l,D){var h=this,c=Pn("layoutFlowColumns"),d=this.currentLayoutPosition.clone(),f=e.getPropAsNumber(this,"column-gap"),p=l>1?e.getPropAsNumber(this,"column-width"):a.width,E=e.getActiveRegions(this),C=ku(e.getProp(this,"shape-inside"),0,0,a.width,a.height,this),F=new fc(s,this,this.viewport,this.styler,E,this.xmldoc,this.faces,this.style.footnoteProps,this,t,this.customRenderer,this.fallbackMap,this.documentURLTransformer),A=0,g=null,v=[];return c.loopWithFrame((function(t){h.createAndLayoutColumn(e,u,n,i,a,A++,s,o,l,f,p,C,F,D).then((function(e){return r.isInvalidated()?(v=null,void t.breakLoop()):(!(e.pageBreakType&&"column"!==e.pageBreakType)&&A!==l||o.isInvalidated()||o.finish(),o.isInvalidated()?(A=0,h.currentLayoutPosition=d.clone(),o.validate(),void(o.isLocked()?(v=null,t.breakLoop()):t.continueLoop())):(v[A-1]=g=e,g.pageBreakType&&"column"!=g.pageBreakType&&(A=l,"region"!=g.pageBreakType&&(h.pageBreaks[s]=!0)),void(A0){if(!m&&!D){var s=e.getProp(a,"shape-outside"),h=C.getOuterShape(s,a);r.push(h)}}else if(0==e.children.length)return u.removeChild(d),void l.finish(!0);var c=p?0:e.children.length-1;l.loop((function(){for(;c>=0&&c=0;n--){var i=u.positions[n];i.flowChunk.startPage>=0&&i.flowChunk.startPage+i.flowChunk.linger-1<=t&&u.positions.splice(n,1)}},n.initLingering=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var u=this.currentLayoutPosition.flowPositions[e],n=u.positions.length-1;n>=0;n--){var i=u.positions[n];i.flowChunk.startPage<0&&i.flowChunk.startOffset0)return!1}return!0},n.layoutNextPage=function(t,u){var n=this,i=t.container===t.bleedBox;if(this.pageBreaks={},u?(this.currentLayoutPosition=u.clone(),this.styler.replayFlowElementsFromOffset(u.highestSeenOffset)):(this.currentLayoutPosition=new Lr,this.styler.replayFlowElementsFromOffset(-1)),this.lang&&t.bleedBox.setAttribute("lang",this.lang),(u=this.currentLayoutPosition).page>1e4)throw new Error("Too many pages generated (over 10000 pages)");u.page++;var r,o=u.startSideOfFlow("body");u.isBlankPage=$i(o)&&this.matchPageSide(o),t.isBlankPage=u.isBlankPage,null==t.pageType&&(t.pageType=null!=(r=t.isBlankPage?this.styler.cascade.previousPageType:this.styler.cascade.currentPageType)?r:""),this.clearScope(this.style.pageScope),this.layoutPositionAtPageStart=u.clone();var a=i?{}:this.pageManager.getCascadedPageStyle(t.pageType);this.styler.cascade.applyVarFilter([a],this.styler,null),this.styler.cascade.applyCalcFilter(a,this.styler.context);var s=this.selectPageMaster(a);if(!s)return Rn(null);var l=0;if(!i){t.setAutoPageWidth(s.pageBox.specified.width.value===eu),t.setAutoPageHeight(s.pageBox.specified.height.value===uu),this.counterStore.setCurrentPage(t),this.counterStore.updatePageCounters(a,this);var D=Sh(bh(a),this);this.setPageSizeAndBleed(D,t),function(t,e,u,n){var i=!1,r=!1,o=t.marks;if(o){var a=o.value;a instanceof je?a.values.forEach((function(t){t===Je.crop?i=!0:t===Je.cross&&(r=!0)})):a===Je.crop?i=!0:a===Je.cross&&(r=!0)}var s=e.bleed;if(i||r){var l=u.container,D=l.ownerDocument,h=Qe(mh,n),c=Math.max(0,e.bleedOffset-Qe(wh,n)),d=e.bleedOffset-c;i&&Object.keys(Bh).forEach((function(t){var e=function(t,e,u,n,i,r){var o=n;o<=i+2*Mt.mm&&(o=i+n/2);var a=Math.max(n,o),s=i+a+u/2,l=xh(t,s,s),D=[[0,i+n],[n,i+n],[n,i+n-o]],h=D.map((function(t){return[t[1],t[0]]}));e!==Bh.TOP_RIGHT&&e!==Bh.BOTTOM_RIGHT||(D=D.map((function(t){return[i+a-t[0],t[1]]})),h=h.map((function(t){return[i+a-t[0],t[1]]}))),e!==Bh.BOTTOM_LEFT&&e!==Bh.BOTTOM_RIGHT||(D=D.map((function(t){return[t[0],i+a-t[1]]})),h=h.map((function(t){return[t[0],i+a-t[1]]})));var c=Th(t,u);c.setAttribute("points",D.map((function(t){return t.join(",")})).join(" ")),l.appendChild(c);var d=Th(t,u);return d.setAttribute("points",h.map((function(t){return t.join(",")})).join(" ")),l.appendChild(d),e.split(" ").forEach((function(t){l.style[t]=r+"px"})),l}(D,Bh[t],h,d,s,c);l.appendChild(e)})),r&&Object.keys(yh).forEach((function(t){var e=function(t,e,u,n,i){var r,o,a=2*n;e===yh.TOP||e===yh.BOTTOM?(r=a,o=n):(r=n,o=a);var s=xh(t,r,o),l=Th(t,u);l.setAttribute("points","0,"+o/2+" "+r+","+o/2),s.appendChild(l);var D=Th(t,u);D.setAttribute("points",r/2+",0 "+r/2+","+o),s.appendChild(D);var h,c=Th(t,u,"circle");switch(c.setAttribute("cx",r/2),c.setAttribute("cy",o/2),c.setAttribute("r",n/4),s.appendChild(c),e){case yh.TOP:h=yh.BOTTOM;break;case yh.BOTTOM:h=yh.TOP;break;case yh.LEFT:h=yh.RIGHT;break;case yh.RIGHT:h=yh.LEFT}return Object.keys(yh).forEach((function(t){var u=yh[t];u===e?s.style[u]=i+"px":u!==h&&(s.style[u]="0",s.style["margin-"+u]="auto")})),s}(D,yh[t],h,d,c);l.appendChild(e)}))}}(a,D,t,this),l=D.bleedOffset+D.bleed}var h=!i&&s.getProp(this,"writing-mode")||Je.horizontal_tb;this.pageVertical=h!=Je.horizontal_tb;var c=s.getProp(this,"direction")||Je.ltr,d=new es(this.rootPageFloatLayoutContext,qa.PAGE,null,null,null,h,c),f=Pn("layoutNextPage");return f.loopWithFrame((function(e){n.layoutContainer(t,s,t.bleedBox,l,l,[],d).then((function(){d.isInvalidated()||d.finish(),d.isInvalidated()?(n.currentLayoutPosition=n.layoutPositionAtPageStart.clone(),d.validate(),e.continueLoop()):e.breakLoop()}))})).then((function(){if(s.adjustPageLayout(n,t,n.clientLayout),!i){var r=new fe(s.pageBox.scope,"left-page");t.side=r.evaluate(n)?e.PageSide.LEFT:e.PageSide.RIGHT,n.processLinger(),u=n.currentLayoutPosition,Object.keys(u.flowPositions).forEach((function(t){var e=u.flowPositions[t],i=e.breakAfter;!i||"page"!==i&&n.matchPageSide(i)||(e.breakAfter=null)}))}n.currentLayoutPosition=n.layoutPositionAtPageStart=null,u.highestSeenOffset=n.styler.getReachedOffset();var o=n.style.store.getTriggersForDoc(n.xmldoc);t.finish(o,n.clientLayout),n.noMorePrimaryFlows(u)&&(u=null),f.finish(u)})),f.result()},n.setPageSizeAndBleed=function(t,e){this.actualPageWidth=t.pageWidth,this.actualPageHeight=t.pageHeight,this.pageSheetWidth=t.pageWidth+2*t.cropOffset,this.pageSheetHeight=t.pageHeight+2*t.cropOffset,e.container.style.width=this.pageSheetWidth+"px",e.container.style.height=this.pageSheetHeight+"px",e.bleedBox.style.left=t.bleedOffset+"px",e.bleedBox.style.right=t.bleedOffset+"px",e.bleedBox.style.top=t.bleedOffset+"px",e.bleedBox.style.bottom=t.bleedOffset+"px",e.bleedBox.style.padding=t.bleed+"px"},u}(Vt),bc=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e.rootScope,e,u,n,i,e.validatorSet,!n)||this).masterHandler=void 0,r.insideRegion=!1,r.masterHandler=e,r}x(e,t);var u=e.prototype;return u.startPageTemplateRule=function(){},u.startPageMasterRule=function(t,e,u){var n=new QD(this.masterHandler.pageScope,t,e,u,this.masterHandler.rootBox,this.condition,this.owner.getBaseSpecificity());this.masterHandler.pushHandler(new Ah(n.scope,this.masterHandler,n,this.validatorSet))},u.startWhenRule=function(t){var u=t.expr;null!=this.condition&&(u=Be(this.scope,this.condition,u)),this.masterHandler.pushHandler(new e(this.masterHandler,u,this,this.regionId))},u.startDefineRule=function(){this.masterHandler.pushHandler(new wa(this.scope,this.owner))},u.startFontFaceRule=function(){var t={};this.masterHandler.fontFaces.push({properties:t,condition:this.condition}),this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,t,this.masterHandler.validatorSet))},u.startFlowRule=function(t){var e=this.masterHandler.flowProps[t];e||(this.masterHandler.flowProps[t]=e={}),this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startViewportRule=function(){var t={};this.masterHandler.viewportProps.push(t),this.masterHandler.pushHandler(new Na(this.scope,this.owner,this.condition,t,this.masterHandler.validatorSet))},u.startFootnoteRule=function(t){var e=this.masterHandler.footnoteProps;if(t){var u=ao(e,"_pseudos");(e=u[t])||(u[t]=e={})}this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startRegionRule=function(){this.insideRegion=!0,this.startSelectorRule()},u.startPageRule=function(){var t=new ic(this.masterHandler.pageScope,this.masterHandler,this,this.validatorSet,this.masterHandler.pageProps);this.masterHandler.pushHandler(t),t.startPageRule()},u.startRuleBody=function(){if(Fa.prototype.startRuleBody.call(this),this.insideRegion){this.insideRegion=!1;var t="R"+this.masterHandler.regionCount++;this.special("region-id",Me(t)),this.endRule();var u=new e(this.masterHandler,this.condition,this,t);this.masterHandler.pushHandler(u),u.startRuleBody()}},e}(Fa),Sc=function(t){function e(e){var u;return(u=t.call(this)||this).validatorSet=void 0,u.rootScope=void 0,u.pageScope=void 0,u.rootBox=void 0,u.cascadeParserHandler=void 0,u.regionCount=0,u.fontFaces=[],u.footnoteProps={},u.flowProps={},u.viewportProps=[],u.pageProps={},u.validatorSet=e,u.rootScope=new Ot(null),u.pageScope=new Ot(u.rootScope),u.rootBox=new qD(u.rootScope),u.cascadeParserHandler=new bc(k(u),null,null,null),u.slave=u.cascadeParserHandler,u}return x(e,t),e}(hi);function xc(t,e){return e.parseOPSResource(t)}var Tc=function(t){function u(e){var u;return(u=t.call(this,xc,Ln.DOCUMENT)||this).fontDeobfuscator=void 0,u.styleByKey={},u.styleFetcherByKey={},u.styleByDocURL={},u.triggersByDocURL={},u.validatorSet=null,u.styleSheets=[],u.triggerSingleDocumentPreprocessing=!1,u.fontDeobfuscator=e,u}x(u,t);var n=u.prototype;return n.init=function(t,e){var u=this;this.setStyleSheets(t,e);var n=Pn("OPSDocStore.init");return this.validatorSet=VD(),yc.get().then((function(){u.triggerSingleDocumentPreprocessing=!0,n.finish(!0)})),n.result()},n.getStyleForDoc=function(t){return this.styleByDocURL[t.url]},n.getTriggersForDoc=function(t){return this.triggersByDocURL[t.url]},n.setStyleSheets=function(t,e){this.clearStyleSheets(),t&&t.forEach(this.addAuthorStyleSheet,this),e&&e.forEach(this.addUserStyleSheet,this)},n.clearStyleSheets=function(){this.styleSheets.splice(0)},n.addAuthorStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ri.AUTHOR,classes:null,media:null})},n.addUserStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ri.USER,classes:null,media:null})},n.parseOPSResource=function(t){var u=this,n=Pn("OPSDocStore.load"),i=t.url,r=i.endsWith("?viv-toc-box");return vc(t,this).then((function(t){if(t){if(u.triggerSingleDocumentPreprocessing)for(var o=C(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT),a=0;a*>*>*>*>*[style*='display: none']")).forEach((function(t){t.setAttribute("aria-hidden","true"),t.setAttribute("hidden","hidden")})),r.setAutoHeight(t,2),o.finish(a)}))}))})),o.result()},e.hideTOC=function(){this.page&&(this.page.container.style.visibility="hidden",this.page.container.setAttribute("aria-hidden","true"))},e.isTOCVisible=function(){return!!this.page&&"visible"===this.page.container.style.visibility},e.getTOC=function(){if(!this.page)return[];function t(t){if(!t)return[];var u=t.querySelectorAll(":scope > [role=treeitem] > a[href]");return Array.from(u).map(e)}function e(e){return{id:new URL(e.href).hash.match(/^#?(.*)$/)[1],title:e.innerText,children:t(e.parentElement.querySelector("[role=group]"))}}return t(this.page.container.querySelector("[role=tree]"))},t}();function Rc(t){var e=t.target,u=e.textContent==Ic;e.textContent=u?"▾":Ic;var n=e.parentNode;e.setAttribute("aria-expanded",u?"true":"false"),n.setAttribute("aria-expanded",u?"true":"false");for(var i=n.firstChild;i;){if(1===i.nodeType){var r=i,o=r.getAttribute("data-adapt-class");if("toc-container"===o){if(r.setAttribute("aria-hidden",u?"false":"true"),r.firstChild){i=r.firstChild;continue}}else if("toc-node"===o&&(r.style.height=u?"auto":"0px",r.children.length>=2&&(r.children[1].tabIndex=u?0:-1),r.children.length>=3&&(r.children[0].tabIndex=u?0:-1,!u))){var a=r.children[0];if("▾"==a.textContent){a.textContent=Ic,a.setAttribute("aria-expanded","false"),r.setAttribute("aria-expanded","false"),i=r.children[2];continue}}}for(;!i.nextSibling&&i.parentNode!==n;)i=i.parentNode;i=i.nextSibling}t.stopPropagation()}var kc=function(t){function e(){var e;return(e=t.call(this,null)||this).plainXMLStore=void 0,e.jsonStore=void 0,e.opfByURL={},e.primaryOPFByEPubURL={},e.deobfuscators={},e.documents={},e.fontDeobfuscator=e.makeDeobfuscatorFactory(),e.plainXMLStore=new ui(vc,Ln.DOCUMENT),e.jsonStore=new ui(ni,Ln.TEXT),e}x(e,t);var u=e.prototype;return u.makeDeobfuscatorFactory=function(){var t=this;return function(e){return t.deobfuscators[e]}},u.loadAsPlainXML=function(t,e,u){return this.plainXMLStore.load(t,e,u)},u.startLoadingAsPlainXML=function(t){this.plainXMLStore.fetch(t)},u.loadAsJSON=function(t,e,u){return this.jsonStore.load(t,e,u)},u.loadPubDoc=function(t){var e=this,u=Pn("loadPubDoc");return ti(t,null,"HEAD").then((function(n){if(n.status>=400)e.loadEPUBDoc(t).then((function(e){e?u.finish(e):(c.error("Failed to fetch a source document from "+t+" ("+n.status+(n.statusText?" "+n.statusText:"")+")"),u.finish(null))}));else if(n.status||n.responseXML||n.responseText||n.responseBlob||n.contentType||/\/[^/.]+(?:[#?]|$)/.test(t)&&(t=t.replace(/([#?]|$)/,"/$1")),"application/oebps-package+xml"==n.contentType||/\.opf(?:[#?]|$)/.test(t)){var i=t.match(/^((?:.*\/)?)([^/]*)$/);e.loadOPF(i[1],i[2]).thenFinish(u)}else"application/ld+json"==n.contentType||"application/webpub+json"==n.contentType||"application/audiobook+json"==n.contentType||"application/json"==n.contentType||/\.json(?:ld)?(?:[#?]|$)/.test(t)?e.loadAsJSON(t,!0).then((function(n){if(!n)return e.reportLoadError(t),void u.finish(null);var i=new Xc(e,t);i.initWithWebPubManifest(n,void 0,t).then((function(){u.finish(i)}))})):e.loadWebPub(t).then((function(n){n?u.finish(n):e.loadEPUBDoc(t).then((function(e){e?u.finish(e):(c.error("Failed to load "+t+"."),u.finish(null))}))}))})),u.result()},u.loadEPUBDoc=function(t){var e=this,u=Pn("loadEPUBDoc");return t.endsWith("/")||(t+="/"),this.startLoadingAsPlainXML(t+"META-INF/encryption.xml"),this.loadAsPlainXML(t+"META-INF/container.xml").then((function(n){if(n)for(var i,r=O(n.doc().child("container").child("rootfiles").child("rootfile").attribute("full-path"));!(i=r()).done;){var o=i.value;if(o)return void e.loadOPF(t,o).thenFinish(u)}u.finish(null)})),u.result()},u.loadOPF=function(t,e){var u=this,n=t+e,i=this.opfByURL[n];if(i)return Rn(i);var r=Pn("loadOPF");return this.loadAsPlainXML(n,!0,"Failed to fetch EPUB OPF "+n).then((function(e){e?u.loadAsPlainXML(t+"META-INF/encryption.xml").then((function(o){(i=new Xc(u,t)).initWithXMLDoc(e,o).then((function(){u.opfByURL[n]=i,u.primaryOPFByEPubURL[t]=i,r.finish(i)}))})):u.reportLoadError(n)})),r.result()},u.loadWebPub=function(t){var e=this,u=Pn("loadWebPub");return this.load(t).then((function(n){if(n)if(n.document.querySelector("a[href='META-INF/'],a[href$='/META-INF/']"))u.finish(null);else{var i=n.document,r=new Xc(e,t);i.body&&i.body.setAttribute("data-vivliostyle-primary-entry",!0);var o=i.querySelector("link[rel='publication'],link[rel='manifest'][type='application/webpub+json']");if(o){var a=o.getAttribute("href");if(/^#/.test(a)){var s=V(i.getElementById(a.substr(1)).textContent);r.initWithWebPubManifest(s,i).then((function(){u.finish(r)}))}else{var l=K(o.getAttribute("href"),t);e.loadAsJSON(l,!0,"Failed to fetch Publication Manifest "+l).then((function(t){r.initWithWebPubManifest(t,i,l).then((function(){u.finish(r)}))}))}}else r.initWithWebPubManifest({},i).then((function(){r.xhtmlToc&&r.xhtmlToc.src===n.url&&(i.querySelector("[role=doc-toc], [role=directory], nav, .toc, #toc")||(r.xhtmlToc=null)),u.finish(r)}))}else e.reportLoadError(t)})),u.result()},u.addDocument=function(t,e){var u=Pn("EPUBDocStore.load"),n=H(t);return(this.documents[n]=this.parseOPSResource({status:200,statusText:"",url:n,contentType:e.contentType,responseText:null,responseXML:e,responseBlob:null})).thenFinish(u),u.result()},u.reportLoadError=function(t){var e,u=this,n=function(t){return t.replace(/([^:/?#]|^)[/?#].*/,"$1")};t.startsWith("data:")?c.error("Failed to load "+t+". Invalid data."):t.startsWith("http:")&&z.startsWith("https:")?c.error("Failed to load "+t+'. Mixed Content ("http:" content on "https:" context) is not allowed.'):(e=n(t))===n(z)||Object.keys(u.resources).find((function(t){return u.resources[t]&&n(t)===e}))||/\.(xhtml|xht|xml|opf)$/i.test(t)?c.error("Failed to load "+t+". The target resource is invalid."):c.error("Failed to load "+t+". This may be caused by the server not allowing cross-origin resource sharing (CORS).")},u.load=function(e){var u=this,n=H(e),i=this.documents[n];if(i)return i.isPending()?i:Rn(i.get());var r=Pn("EPUBDocStore.load");return(i=t.prototype.load.call(this,n,!0,"Failed to fetch a source document from "+n)).then((function(t){t?r.finish(t):u.reportLoadError(n)})),r.result()},u.processViewportMeta=function(t){var e=t.getAttribute("content");if(!e)return"";for(var u,n={};null!=(u=e.match(/^,?\s*([-A-Za-z_.][-A-Za-z_0-9.]*)\s*=\s*([-+A-Za-z_0-9.]*)\s*/));)e=e.substr(u[0].length),n[u[1]]=u[2];var i=n.width-0,r=n.height-0;return i&&r?"@-epubx-viewport{width:"+i+"px;height:"+r+"px;}"+(Object.values(this.primaryOPFByEPubURL).find((function(t){return t.prePaginated}))?"@page{size:"+i+"px "+r+"px;margin:0;}":"@page{margin:0;}"):""},e}(Tc),Lc=function(){function t(){this.id=null,this.src="",this.mediaType=null,this.title=null,this.itemRefElement=null,this.spineIndex=-1,this.compressedSize=0,this.compressed=null,this.epage=0,this.epageCount=0,this.startPage=null,this.skipPagesBefore=null,this.itemProperties=void 0,this.itemProperties=U}var e=t.prototype;return e.initWithElement=function(t,e){this.id=t.getAttribute("id"),this.src=K(t.getAttribute("href"),e),this.mediaType=t.getAttribute("media-type");var u=t.getAttribute("properties");u&&(this.itemProperties=function(t){for(var e={},u=0;u0&&this.uid)for(var F=function(t){return function(e){var u=Pn("deobfuscator");return function(t,e){var u=Pn("makeDigest"),n=u.suspend();return window.crypto.subtle.digest("SHA-1",(new TextEncoder).encode(e)).then((function(t){n.schedule(new Uint8Array(t))})),u.result()}(0,t).then((function(t){var n=e.slice(0,1040),i=e.slice(1040,e.size);(function(t){var e=Pn("readBlob"),u=new FileReader,n=e.suspend(u);return u.addEventListener("load",(function(){n.schedule(u.result)}),!1),u.readAsArrayBuffer(t),e.result()})(n).then((function(e){for(var n=new DataView(e),r=0;r","text/xml"));return t.forEach((function(t){var e=new Lc;e.initWithParam(t);var i=n.document.createElement("itemref");i.setAttribute("idref",e.id),n.root.appendChild(i),e.itemRefElement=i,u.itemMap[e.id]=e;var r=u.getPathFromURL(t.url);null==r&&(r=t.url),u.itemMapByPath[r]=e,u.items.push(e)})),e?this.store.addDocument(t[0].url,e):Rn(null)},e.initWithWebPubManifest=function(t,e,u){var n,i,r,o,a=this;t.readingProgression&&(this.pageProgression=t.readingProgression),void 0===this.metadata&&(this.metadata={});var s=t.name||(null==(n=t.metadata)?void 0:n.title)||(null==e?void 0:e.title);s&&(this.metadata[Uc.title]=(Array.isArray(s)?s:[s]).map((function(t){var e;return{v:null!=(e=t.value)?e:t}})));var l=t.author||t.creator||(null==(i=t.metadata)?void 0:i.author)||Array.from(null!=(r=null==e?void 0:e.querySelectorAll("meta[name='author'], meta[name='DC.Creator']"))?r:[]).map((function(t){return t.content}));l&&0!==l.length&&(this.metadata[Uc.creator]=(Array.isArray(l)?l:[l]).map((function(t){var e;return{v:null!=(e=t.name)?e:t}})));var D=t.inLanguage||(null==(o=t.metadata)?void 0:o.language)||(null==e?void 0:e.documentElement.lang)||(null==e?void 0:e.documentElement.getAttribute("xml:lang"));D&&(this.metadata[Uc.language]=(Array.isArray(D)?D:[D]).map((function(t){return{v:t}})));var h=this.getPathFromURL(this.pubURL);if(!t.readingOrder&&e&&null!==h){t.readingOrder=[encodeURI(h)];for(var c,d="[role=doc-toc] a[href],[role=directory] a[href],nav li a[href],.toc a[href],#toc a[href]"+(CSS.supports("selector(:has(*))")?",section:has(>:first-child:is(h1,h2,h3,h4,h5,h6):is(.toc,#toc)) a[href]":""),f=O(e.querySelectorAll(d));!(c=f()).done;){var p=c.value.getAttribute("href");if(!/^(https?:)?\/\//.test(p)&&!/\.(jpe?g|png|gif|pdf|svg|mml)([#?]|$)/.test(p)){var E=H(K(p,this.pubURL)),C=this.getPathFromURL(E),F=null!==C?encodeURI(C):E;-1==t.readingOrder.indexOf(F)&&t.readingOrder.push(F)}}}var A=[],g=0,v=-1;[t.readingOrder,t.resources].forEach((function(e){e instanceof Array&&e.forEach((function(e){var n=t.readingOrder.includes(e),i="string"==typeof e?e:e.url||e.href,r="string"==typeof e?"":e.encodingFormat||e.href&&e.type||"";if(n||"text/html"===r||"application/xhtml+xml"===r||!r&&"stylesheet"!==e.rel&&/(^|\/)([^/]+\.(x?html|htm|xht)|[^/.]*)([#?]|$)/.test(i)){var o=u?u.replace(/\/[^/]+$/,"/"):a.pubURL,s={url:K(Y(i),o),index:g++,startPage:null,skipPagesBefore:null};"contents"===e.rel&&-1===v&&(v=s.index),A.push(s)}}))}));var m=Pn("initWithWebPubManifest");return this.initWithChapters(A).then((function(){var t;-1!==v&&(a.xhtmlToc=a.items[v]),a.xhtmlToc||(a.xhtmlToc=u?null==(t=a.items)?void 0:t[0]:a.itemMapByPath[h]),m.finish(!0)})),m.result()},e.getCFI=function(t,e){var u=this.spine[t],n=Pn("getCFI");return this.store.load(u.src).then((function(t){var i=t.getNodeByOffset(e),r=null;if(i){var o=t.getNodeOffset(i,0,!1),a=e-o,s=new bt;s.prependPathFromNode(i,a,!1,null),u.itemRefElement&&s.prependPathFromNode(u.itemRefElement,0,!1,null),r=s.toString()}n.finish(r)})),n.result()},e.resolveFragment=function(t){var e=this;return kn("resolveFragment",(function(u){if(t){var n,i=new bt;if(i.fromString(t),e.opfXML){var r=i.navigate(e.opfXML.document);if(1!=r.node.nodeType||r.after||!r.ref)return void u.finish(null);var o=r.node,a=o.getAttribute("idref");if("itemref"!=o.localName||!a||!e.itemMap[a])return void u.finish(null);n=e.itemMap[a],i=r.ref}else n=e.spine[0];e.store.load(n.src).then((function(t){var e=i.navigate(t.document),r=t.getNodeOffset(e.node,e.offset,e.after);u.finish({spineIndex:n.spineIndex,offsetInItem:r,pageIndex:-1})}))}else u.finish(null)}),(function(e,u){c.warn(u,"Cannot resolve fragment:",t),e.finish(null)}))},e.resolveEPage=function(t){var e=this;return kn("resolveEPage",(function(u){if(t<=0)u.finish({spineIndex:0,offsetInItem:0,pageIndex:-1});else if(e.epageIsRenderedPage){var n=e.spine.findIndex((function(e){return 0==e.epage&&0==e.epageCount||e.epage<=t&&e.epage+e.epageCount>t}));-1==n&&(n=e.spine.length-1);var i=e.spine[n];i&&0!=i.epageCount||(i=e.spine[--n]);var r=Math.floor(t-i.epage);u.finish({spineIndex:n,offsetInItem:-1,pageIndex:r})}else{var o=ct(e.spine.length,(function(u){var n=e.spine[u];return n.epage+n.epageCount>t}));o==e.spine.length&&o--;var a=e.spine[o];e.store.load(a.src).then((function(e){(t-=a.epage)>a.epageCount&&(t=a.epageCount);var n=0;if(t>0){var i=e.getTotalOffset();(n=Math.round(i*t/a.epageCount))==i&&n--}u.finish({spineIndex:o,offsetInItem:n,pageIndex:-1})}))}}),(function(e,u){c.warn(u,"Cannot resolve epage:",t),e.finish(null)}))},e.getEPageFromPosition=function(t){var e=this.spine[t.spineIndex];if(this.epageIsRenderedPage)return Rn(e.epage+t.pageIndex);if(t.offsetInItem<=0)return Rn(e.epage);var u=Pn("getEPage");return this.store.load(e.src).then((function(n){var i=n.getTotalOffset(),r=Math.min(i,t.offsetInItem);u.finish(e.epage+r*e.epageCount/i)})),u.result()},t}(),jc=function(t,e){return{page:t,position:{spineIndex:t.spineIndex,pageIndex:e,offsetInItem:t.offset}}},Kc=function(){function t(t,e,u,n,i){this.opf=void 0,this.viewport=void 0,this.fontMapper=void 0,this.pageSheetSizeReporter=void 0,this.spineItems=[],this.spineItemLoadingContinuations=[],this.pref=void 0,this.clientLayout=void 0,this.counterStore=void 0,this.tocAutohide=!1,this.tocVisible=!1,this.tocView=void 0,this.opf=t,this.viewport=e,this.fontMapper=u,this.pageSheetSizeReporter=i,this.pref=St(n),this.clientLayout=new Cc(e),this.counterStore=new Gu(t.documentURLTransformer)}var u=t.prototype;return u.getPage=function(t){var e=this.spineItems[t.spineIndex];return e?e.pages[t.pageIndex]:null},u.getCurrentPageProgression=function(t){if(this.opf.pageProgression)return this.opf.pageProgression;var e=this.spineItems[t?t.spineIndex:0];return e?e.instance.pageProgression:null},u.finishPageContainer=function(t,e,u){e.container.style.display="none",e.container.style.visibility="visible",e.container.style.position="",e.container.style.top="",e.container.style.left="",e.container.setAttribute("data-vivliostyle-page-side",e.side);var n=t.pages[u];if(e.isFirstPage=0==t.item.spineIndex&&0==u,t.pages[u]=e,this.opf.epageIsRenderedPage){if(0==u&&t.item.spineIndex>0){var i=this.opf.spine[t.item.spineIndex-1];t.item.epage=i.epage+i.epageCount}t.item.epageCount=t.pages.length,this.opf.epageCount=this.opf.spine.reduce((function(t,e){return t+e.epageCount}),0),this.opf.epageCountCallback&&this.opf.epageCountCallback(this.opf.epageCount)}if(n)t.instance.viewport.contentContainer.replaceChild(e.container,n.container),n.dispatchEvent({type:"replaced",target:null,currentTarget:null,preventDefault:null,newPage:e});else{var r=null;if(u>0)r=t.pages[u-1].container.nextElementSibling;else for(var o=t.item.spineIndex+1;oi.length)t.breakLoop();else{var e=i[a-1];e.refs=e.refs.filter((function(t){return!t.isResolved()})),0!==e.refs.length?u.getPageViewItem(e.spineIndex).then((function(n){n?(u.counterStore.pushPageCounters(e.pageCounters),u.counterStore.pushReferencesToSolve(e.refs),u.renderSinglePage(n,n.layoutPositions[e.pageIndex]).then((function(e){u.counterStore.popPageCounters(),u.counterStore.popReferencesToSolve();var n=e.pageAndPosition.position;n.spineIndex===r.spineIndex&&n.pageIndex===o&&(r=e.pageAndPosition.page),t.continueLoop()}))):t.continueLoop()})):t.continueLoop()}})).then((function(){r.container.parentElement||(r=t.pages[o]),r.isLastPage=!e&&t.item.spineIndex===u.opf.spine.length-1,r.isLastPage&&u.counterStore.finishLastPage(u.viewport),r.container.setAttribute("data-vivliostyle-page-index",o),r.container.setAttribute("data-vivliostyle-spine-index",r.spineIndex),n.finish({pageAndPosition:jc(r,o),nextLayoutPosition:e})}))}))})),n.result()},u.normalizeSeekPosition=function(t,e){var u=t.pageIndex,n=-1;if(u<0){n=t.offsetInItem;var i=ct(e.layoutPositions.length,(function(t){return e.instance.getPosition(e.layoutPositions[t],!0)>n}));u=i===e.layoutPositions.length?e.complete?e.layoutPositions.length-1:Number.POSITIVE_INFINITY:i-1}else u===Number.POSITIVE_INFINITY&&-1!==t.offsetInItem&&(n=t.offsetInItem);return{spineIndex:t.spineIndex,pageIndex:u,offsetInItem:n}},u.findPage=function(t,e){var u=this,n=Pn("findPage");return this.getPageViewItem(t.spineIndex).then((function(i){if(i){var r,o=null;n.loopWithFrame((function(a){var s=u.normalizeSeekPosition(t,i);(o=i.pages[r=s.pageIndex])?a.breakLoop():i.complete?(o=i.pages[r=i.layoutPositions.length-1],a.breakLoop()):e?u.renderPage(s).then((function(t){t&&(o=t.page,r=t.position.pageIndex),a.breakLoop()})):n.sleep(100).then((function(){a.continueLoop()}))})).then((function(){n.finish(jc(o,r))}))}else n.finish(null)})),n.result()},u.renderPage=function(t){var e=this,u=Pn("renderPage");return this.getPageViewItem(t.spineIndex).then((function(n){if(n){var i=e.normalizeSeekPosition(t,n),r=i.pageIndex,o=i.offsetInItem,a=n.pages[r];a?u.finish(jc(a,r)):u.loopWithFrame((function(t){if(r=0&&n.instance.getPosition(u)>o)return a=i,r=n.layoutPositions.length-2,void t.breakLoop();t.continueLoop()}else a=i,r=e.pageAndPosition.position.pageIndex,n.complete=!0,t.breakLoop()}))}})).then((function(){var t=n.layoutPositions[r];(a=a||n.pages[r])?u.finish(jc(a,r)):e.renderSinglePage(n,t).then((function(t){t.nextLayoutPosition||(n.complete=!0),u.finish(t.pageAndPosition)}))}))}else u.finish(null)})),u.result()},u.renderAllPages=function(){return this.renderPagesUpto({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},!1)},u.renderPagesUpto=function(t,e){var u=this,n=Pn("renderPagesUpto");t||(t={spineIndex:0,pageIndex:0,offsetInItem:0});var i,r=t.spineIndex,o=t.pageIndex,a=0;return e&&(a=r),n.loopWithFrame((function(e){u.renderPage({spineIndex:a,pageIndex:a===r?o:Number.POSITIVE_INFINITY,offsetInItem:a===r?t.offsetInItem:-1}).then((function(t){i=t,++a>r?e.breakLoop():e.continueLoop()}))})).then((function(){n.finish(i)})),n.result()},u.firstPage=function(t,e){return this.findPage({spineIndex:0,pageIndex:0,offsetInItem:-1},e)},u.lastPage=function(t,e){return this.findPage({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},e)},u.nextPage=function(t,e){var u=this,n=t.spineIndex,i=t.pageIndex,r=Pn("nextPage");return this.getPageViewItem(n).then((function(t){if(t){if(t.complete&&i==t.layoutPositions.length-1){if(n>=u.opf.spine.length-1)return void r.finish(null);n++,i=0;var o=u.spineItems[n],a=o&&o.pages[0],s=t.pages[t.pages.length-1];a&&s&&a.side==s.side&&(o.pages.forEach((function(t){t.container&&t.container.remove()})),u.spineItems[n]=null,u.spineItemLoadingContinuations[n]=null)}else i++;u.findPage({spineIndex:n,pageIndex:i,offsetInItem:-1},e).thenFinish(r)}else r.finish(null)})),r.result()},u.previousPage=function(t,e){var u=t.spineIndex,n=t.pageIndex;if(0==n){if(0==u)return Rn(null);u--,n=Number.POSITIVE_INFINITY}else n--;return this.findPage({spineIndex:u,pageIndex:n,offsetInItem:-1},e)},u.isRectoPage=function(t,u){var n=t.side===e.PageSide.LEFT,i=this.getCurrentPageProgression(u)===e.PageProgression.LTR;return!n&&i||n&&!i},u.getSpread=function(t,u){var n=this,i=this.getPage(t);if(!i)return Rn({left:null,right:null});var r=Pn("getSpread"),o=i.side===e.PageSide.LEFT;return(this.isRectoPage(i,t)?this.previousPage(t,u):this.nextPage(t,u)).then((function(e){var u=n.getPage(t),i=e&&e.page;i&&i.side===u.side&&(i=null),r.finish(o?{left:u,right:i}:{left:i,right:u})})),r.result()},u.nextSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.nextPage(t,e);return i?r:r.thenAsync((function(t){if(t){if(t.page.side===n.side)return r;var i=u.nextPage(t.position,e);return i.thenAsync((function(t){return t?i:r}))}return Rn(null)}))},u.previousSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.previousPage(t,e),o=n.container.previousElementSibling;return i?r.thenAsync((function(t){return t?t.page.side===n.side||t.page.container!==o?r:u.previousPage(t.position,e):Rn(null)})):r},u.navigateToEPage=function(t,e,u){var n=this,i=Pn("navigateToEPage");return this.opf.resolveEPage(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateToFragment=function(t,e,u){var n=this,i=Pn("navigateToCFI");return this.opf.resolveFragment(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateTo=function(t,e,u){var n=this;c.debug("Navigate to",t);var i=this.opf.getPathFromURL(H(t));if(!i){if(this.opf.opfXML&&t.match(/^#epubcfi\(/))i=this.opf.getPathFromURL(this.opf.opfXML.url);else if("#"===t.charAt(0)){var r=this.opf.documentURLTransformer.restoreURL(t);this.opf.opfXML?null==(i=this.opf.getPathFromURL(r[0]))&&(i=r[0]):i=r[0],t=r[0]+(r[1]?"#"+r[1]:"")}if(null==i)return Rn(null)}var o=this.opf.itemMapByPath[i];if(!o){if(this.opf.opfXML&&i==this.opf.getPathFromURL(this.opf.opfXML.url)){var a=t.indexOf("#");if(a>=0)return this.navigateToFragment(t.substr(a+1),e,u)}return Rn(null)}var s=Pn("navigateTo");return this.getPageViewItem(o.spineIndex).then((function(e){if(e){var i=e.xmldoc.getElement(t);n.findPage({spineIndex:o.spineIndex,pageIndex:-1,offsetInItem:i?e.xmldoc.getElementOffset(i):0},u).thenFinish(s)}else s.finish(null)})),s.result()},u.makePage=function(t,u){var n=t.instance.viewport,i=n.document.createElement("div");i.setAttribute("data-vivliostyle-page-container","true"),i.setAttribute("role","region"),i.style.position="absolute",i.style.top="0",i.style.left="0",e.isDebug||(i.style.visibility="hidden"),n.layoutBox.appendChild(i);var r=n.document.createElement("div");r.setAttribute("data-vivliostyle-bleed-box","true"),i.appendChild(r);var o=new fr(i,r);if(o.spineIndex=t.item.spineIndex,o.position=u,o.offset=t.instance.getPosition(u),0===o.offset&&(!t.instance.blankPageAtStart||0!==t.pages.length)){var a=this.opf.documentURLTransformer.transformFragment("",t.item.src);r.setAttribute("id",a),o.registerElementWithId(r,a)}if(n!==this.viewport){var s=It(this.viewport.width,this.viewport.height,n.width,n.height),l=Li(null,new Sn(s,null),"");o.delayedItems.push(new hr(i,"transform",l))}return o},u.makeObjectView=function(t,e,u,n){var i=e.getAttribute("data"),r=null;if(i){i=K(i,t.url);var o=e.getAttribute("media-type");if(!o){var a=this.opf.getPathFromURL(i);if(a){var s=this.opf.itemMapByPath[a];s&&(o=s.mediaType)}}if(o){var l=this.opf.bindings[o];if(l){(r=this.viewport.document.createElement("iframe")).style.border="none";var D=st(i),h=st(o),c=new it;c.append(l),c.append("?src="),c.append(D),c.append("&type="),c.append(h);for(var d=e.firstChild;d;d=d.nextSibling)if(1==d.nodeType){var f=d;if("param"==f.localName&&f.namespaceURI==W.XHTML){var p=f.getAttribute("name"),E=f.getAttribute("value");p&&E&&(c.append("&"),c.append(encodeURIComponent(p)),c.append("="),c.append(encodeURIComponent(E)))}}r.setAttribute("src",c.toString());var C=e.getAttribute("width");C&&r.setAttribute("width",C);var F=e.getAttribute("height");F&&r.setAttribute("height",F)}}}return r||(r=this.viewport.document.createElement("object"),i&&r.setAttribute("data",i),r.setAttribute("data-adapt-process-children","true")),Rn(r)},u.makeMathJaxView=function(t,e,u,n){var i=Hc();if(i){var r=u.ownerDocument,o=r.createElement("span");u.appendChild(o);var a=r.importNode(e,!0);this.resolveURLsInMathML(a,t),o.appendChild(a);var s=i.queue;s.Push(["Typeset",i,o]);var l=Pn("makeMathJaxView"),D=l.suspend();return s.Push((function(){D.schedule(o)})),l.result()}return Rn(null)},u.resolveURLsInMathML=function(t,e){if(null!=t){if(1===t.nodeType&&"mglyph"===t.tagName)for(var u=0,n=Array.from(t.attributes);u=this.opf.spine.length)return Rn(null);var u=this.spineItems[t];if(u)return Rn(u);var n=Pn("getPageViewItem"),i=this.spineItemLoadingContinuations[t];if(i){var r=n.suspend();return i.push(r),n.result()}i=this.spineItemLoadingContinuations[t]=[];var o=this.opf.spine[t],a=this.opf.store;return a.load(o.src).then((function(r){var s,l=o.itemRefElement.getAttribute("properties");l&&r.root.setAttribute("data-vivliostyle-epub-spine-properties",l),o.title=r.document.title;var D=a.getStyleForDoc(r),h=e.makeCustomRenderer(r),c=e.viewport,d=D.sizeViewport(c.width,c.height,c.fontSize,e.pref);d.width==c.width&&d.height==c.height&&d.fontSize==c.fontSize||(c=new Fc(c.window,d.fontSize,c.pixelRatio,c.root,d.width,d.height));var f,p,E=null==(s=e.spineItems[0])?void 0:s.instance.isVersoFirstPage,C=e.spineItems[t-1];if(null!==o.startPage)p=f=o.startPage-1;else{if(!(t>0)||C&&C.complete){f=C?C.instance.pageNumberOffset+C.pages.length:0;var F=e.counterStore.currentPageCounters.page;p=F&&F.length?F[F.length-1]:f}else f=o.epage||t,e.opf.prePaginated||f%2!=(E?1:0)||f++,p=f;null!==o.skipPagesBefore&&(f+=o.skipPagesBefore,p+=o.skipPagesBefore)}e.counterStore.forceSetPageCounter(p);var A=new Nc(D,r,e.opf.lang,c,e.clientLayout,e.fontMapper,h,e.opf.fallbackMap,f,e.opf.documentURLTransformer,e.counterStore,e.opf.pageProgression,E);A.pref=e.pref;var g=e.opf.metadata&&e.opf.metadata[Uc.title];A.pubTitle=g&&g[0]&&g[0].v||"",A.docTitle=o.title||"",A.init().then((function(){e.spineItems[t]=u={item:o,xmldoc:r,instance:A,layoutPositions:[null],pages:[],complete:!1},n.finish(u),i.forEach((function(t){t.schedule(u)}))}))})),n.result()},u.removeRenderedPages=function(){for(var t,e=O(this.spineItems);!(t=e()).done;){var u=t.value;u&&u.pages.splice(0)}this.viewport.clear()},u.hasAutoSizedPages=function(){for(var t,e=O(this.spineItems);!(t=e()).done;){var u=t.value;if(u)for(var n,i=O(u.pages);!(n=i()).done;){var r=n.value;if(r.isAutoPageWidth&&r.isAutoPageHeight)return!0}}return!1},u.hasPages=function(){return this.spineItems.some((function(t){return t&&t.pages.length>0}))},u.showTOC=function(t){var e=this.opf,u=e.xhtmlToc||e.ncxToc;if(this.tocAutohide=t,!u)return Rn(null);if(this.tocVisible=!0,this.tocView&&this.tocView.page)return this.tocView.page.container.style.visibility="visible",this.tocView.page.container.setAttribute("aria-hidden","false"),Rn(this.tocView.page);var n=Pn("showTOC");this.tocView||(this.tocView=new Pc(e.store,u.src,e.lang,this.clientLayout,this.fontMapper,this.pref,this,e.fallbackMap,e.documentURLTransformer,this.counterStore));var i=this.viewport,r=Math.min(350,Math.round(.67*i.width)-16),o=i.height-6,a=i.document.createElement("div");return i.root.appendChild(a),a.style.visibility="hidden",a.style.width=r+10+"px",a.style.maxHeight=o+"px",a.setAttribute("data-vivliostyle-toc-box","true"),a.setAttribute("role","navigation"),this.tocView.showTOC(a,i,r,o,this.viewport.fontSize).then((function(t){a.style.visibility="visible",a.setAttribute("aria-hidden","false"),n.finish(t)})),n.result()},u.hideTOC=function(){this.tocVisible=!1,this.tocView&&this.tocView.hideTOC()},u.isTOCVisible=function(){return this.tocVisible&&!!this.tocView&&this.tocView.isTOCVisible()},t}(),Yc="data-vivliostyle-viewer-status";!function(t){t.SINGLE_PAGE="singlePage",t.SPREAD="spread",t.AUTO_SPREAD="autoSpread"}(zc||(zc={}));var qc,$c=function(){function t(t,u,n,i){var r=this;this.window=void 0,this.viewportElement=void 0,this.instanceId=void 0,this.callbackFn=void 0,this.fontMapper=void 0,this.kick=void 0,this.sendCommand=void 0,this.resizeListener=void 0,this.hyperlinkListener=void 0,this.pageRuleStyleElement=void 0,this.pageSheetSizeAlreadySet=!1,this.renderTask=null,this.actions=void 0,this.readyState=void 0,this.packageURL=void 0,this.opf=void 0,this.touchActive=void 0,this.touchX=void 0,this.touchY=void 0,this.needResize=void 0,this.resized=void 0,this.needRefresh=void 0,this.viewportSize=void 0,this.currentPage=void 0,this.currentSpread=void 0,this.pagePosition=void 0,this.fontSize=void 0,this.zoom=void 0,this.fitToScreen=void 0,this.pageViewMode=void 0,this.waitForLoading=void 0,this.renderAllPages=void 0,this.pref=void 0,this.pageSizes=void 0,this.pixelRatio=void 0,this.pixelRatioLimit=void 0,this.viewport=void 0,this.opfView=void 0,this.window=t,this.viewportElement=u,this.instanceId=n,this.callbackFn=i;var o=u.ownerDocument,a=function(t,e){var u=o.getElementById(t);return u||((u=o.createElement("style")).id=t,e&&(u.textContent=e),o.head.appendChild(u)),u};a("vivliostyle-viewport-screen-css",jn),a("vivliostyle-viewport-css",Kn),a("vivliostyle-polyfill-css",Jn),u.setAttribute("data-vivliostyle-viewer-viewport",!0),e.isDebug&&u.setAttribute("data-vivliostyle-debug",!0),u.setAttribute(Yc,"loading"),this.fontMapper=new jD(o.head,u),this.init(),this.kick=function(){},this.sendCommand=function(){},this.resizeListener=function(){r.needResize=!0,r.resized=!0,r.kick()},this.pageReplacedListener=this.pageReplacedListener.bind(this),this.hyperlinkListener=function(t){},this.pageRuleStyleElement=a("vivliostyle-page-rules"),this.actions={loadPublication:this.loadPublication,loadXML:this.loadXML,configure:this.configure,moveTo:this.moveTo,toc:this.showTOC},this.addLogListeners()}var u=t.prototype;return u.init=function(){this.readyState=e.ReadyState.LOADING,this.packageURL=[],this.opf=null,this.touchActive=!1,this.touchX=0,this.touchY=0,this.needResize=!1,this.resized=!1,this.needRefresh=!1,this.viewportSize=null,this.currentPage=null,this.currentSpread=null,this.pagePosition=null,this.fontSize=16,this.zoom=1,this.fitToScreen=!1,this.pageViewMode=zc.SINGLE_PAGE,this.waitForLoading=!1,this.renderAllPages=!0,this.pref={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},this.pageSizes=[],this.pixelRatioLimit=/Chrome/.test(navigator.userAgent)?16:0,this.pixelRatio=Math.min(8,this.pixelRatioLimit)},u.addLogListeners=function(){var t=this,e=r;c.addListener(e.DEBUG,(function(e){t.callback({t:"debug",content:e})})),c.addListener(e.INFO,(function(e){t.callback({t:"info",content:e})})),c.addListener(e.WARN,(function(e){t.callback({t:"warn",content:e})})),c.addListener(e.ERROR,(function(e){t.callback({t:"error",content:e})}))},u.callback=function(t){t.i=this.instanceId,this.callbackFn(t)},u.setReadyState=function(t){this.readyState!==t&&(this.readyState=t,this.viewportElement.setAttribute(Yc,t),this.callback({t:"readystatechange"}))},u.loadPublication=function(t){var u=this;w.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.fragment,r=t.authorStyleSheet,o=t.userStyleSheet;this.viewport=null;var a=Pn("loadPublication");return this.configure(t).then((function(){var t=new kc;t.init(r,o).then((function(){var e=K(Y(n),u.window.location.href);u.packageURL=[e],t.loadPubDoc(e).then((function(t){t?(u.opf=t,u.render(i).then((function(){a.finish(!0)}))):a.finish(!1)}))}))})),a.result()},u.loadXML=function(t){var u=this;w.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.document,r=t.fragment,o=t.authorStyleSheet,a=t.userStyleSheet;this.viewport=null;var s=Pn("loadXML");return this.configure(t).then((function(){var t=new kc;t.init(o,a).then((function(){var e=n.map((function(t,e){return{url:K(Y(t.url),u.window.location.href),index:e,startPage:t.startPage,skipPagesBefore:t.skipPagesBefore}}));u.packageURL=e.map((function(t){return t.url})),u.opf=new Xc(t,""),u.opf.initWithChapters(e,i).then((function(){u.render(r).then((function(){s.finish(!0)}))}))}))})),s.result()},u.render=function(t){var e=this;return this.cancelRenderingTask(),(t?this.opf.resolveFragment(t).thenAsync((function(t){return e.pagePosition=t,Rn(!0)})):Rn(!0)).thenAsync((function(){return w.registerEndTiming("beforeRender"),e.resize()}))},u.resolveLength=function(t){var e,u=parseFloat(t);if("string"==typeof t&&(e=t.match(/[a-z]+$/))){var n=e[0];if("em"===n||"rem"===n)return u*this.fontSize;if("ex"===n)return u*Mt.ex*this.fontSize/Mt.em;var i=Mt[n];if(i)return u*i}return u},u.configure=function(t){if("boolean"==typeof t.autoresize&&(t.autoresize?(this.viewportSize=null,this.window.addEventListener("resize",this.resizeListener,!1),this.needResize=!0):this.window.removeEventListener("resize",this.resizeListener,!1)),"number"==typeof t.fontSize){var e=t.fontSize;e>=5&&e<=72&&this.fontSize!=e&&(this.fontSize=e,this.needResize=!0)}if("object"==typeof t.viewport&&t.viewport){var u=t.viewport,n={marginLeft:this.resolveLength(u["margin-left"])||0,marginRight:this.resolveLength(u["margin-right"])||0,marginTop:this.resolveLength(u["margin-top"])||0,marginBottom:this.resolveLength(u["margin-bottom"])||0,width:this.resolveLength(u.width)||0,height:this.resolveLength(u.height)||0};(n.width>=200||n.height>=200)&&(this.window.removeEventListener("resize",this.resizeListener,!1),this.viewportSize=n,this.needResize=!0)}if("boolean"==typeof t.hyphenate&&(this.pref.hyphenate=t.hyphenate,this.needResize=!0),"boolean"==typeof t.horizontal&&(this.pref.horizontal=t.horizontal,this.needResize=!0),"boolean"==typeof t.nightMode&&(this.pref.nightMode=t.nightMode,this.needResize=!0),"number"==typeof t.lineHeight&&(this.pref.lineHeight=t.lineHeight,this.needResize=!0),"number"==typeof t.columnWidth&&(this.pref.columnWidth=t.columnWidth,this.needResize=!0),"string"==typeof t.fontFamily&&(this.pref.fontFamily=t.fontFamily,this.needResize=!0),"boolean"==typeof t.load&&(this.waitForLoading=t.load),"boolean"==typeof t.renderAllPages&&(this.renderAllPages=t.renderAllPages),"string"==typeof t.userAgentRootURL&&(G(t.userAgentRootURL.replace(/resources\/?$/,"")),j(t.userAgentRootURL)),"string"==typeof t.rootURL&&(G(t.rootURL),j(z+"resources/")),"string"==typeof t.pageViewMode&&t.pageViewMode!==this.pageViewMode&&(this.pageViewMode=t.pageViewMode,this.needResize=!0),"number"==typeof t.pageBorder&&t.pageBorder!==this.pref.pageBorder&&(this.viewport=null,this.pref.pageBorder=t.pageBorder,this.needResize=!0),"number"==typeof t.zoom&&t.zoom!==this.zoom&&(this.zoom=t.zoom,this.needRefresh=!0),"boolean"==typeof t.fitToScreen&&t.fitToScreen!==this.fitToScreen&&(this.fitToScreen=t.fitToScreen,this.needRefresh=!0),"object"==typeof t.defaultPaperSize&&"number"==typeof t.defaultPaperSize.width&&"number"==typeof t.defaultPaperSize.height&&(this.viewport=null,this.pref.defaultPaperSize=t.defaultPaperSize,this.needResize=!0),"boolean"==typeof t.allowScripts&&t.allowScripts!==oc&&(oc=t.allowScripts,this.needResize=!0),"number"==typeof t.pixelRatio){var i=Math.min(t.pixelRatio,this.pixelRatioLimit);i!==this.pixelRatio&&(this.pixelRatio=i,this.needResize=!0)}return this.configurePlugins(t),Rn(!0)},u.configurePlugins=function(t){var u=this;C(e.HOOKS.CONFIGURATION).forEach((function(e){var n=e(t);u.needResize=n.needResize||u.needResize,u.needRefresh=n.needRefresh||u.needRefresh}))},u.pageReplacedListener=function(t){var e=this.currentPage,u=this.currentSpread,n=t.target;u?u.left!==n&&u.right!==n||this.showCurrent(t.newPage):e===t.target&&this.showCurrent(t.newPage)},u.forCurrentPages=function(t){var e=[];this.currentPage&&e.push(this.currentPage),this.currentSpread&&(e.push(this.currentSpread.left),e.push(this.currentSpread.right)),e.forEach((function(e){e&&t(e)}))},u.removePageListeners=function(){var t=this;this.forCurrentPages((function(e){e.removeEventListener("hyperlink",t.hyperlinkListener,!1),e.removeEventListener("replaced",t.pageReplacedListener,!1)}))},u.hidePages=function(){this.removePageListeners(),this.forCurrentPages((function(t){et(t.container,"display","none")})),this.currentPage=null,this.currentSpread=null},u.showSinglePage=function(t){t.addEventListener("hyperlink",this.hyperlinkListener,!1),t.addEventListener("replaced",this.pageReplacedListener,!1),et(t.container,"visibility","visible"),et(t.container,"display","block")},u.showPage=function(t){this.hidePages(),this.currentPage=t,t.container.style.marginLeft="",t.container.style.marginRight="",this.showSinglePage(t)},u.showSpread=function(t){if(this.hidePages(),this.currentSpread=t,t.left&&t.right){var e=parseFloat(t.left.container.style.width),u=parseFloat(t.right.container.style.width);e&&u&&e!==u&&(e0?Xn(n.fetchers):Rn(!0)).then((function(){t.sendLocationNotification(n,u).thenFinish(e)}))})),e.result()},u.createViewport=function(){var t=this.viewportElement;if(this.viewportSize){var e=this.viewportSize;return t.style.marginLeft=e.marginLeft+"px",t.style.marginRight=e.marginRight+"px",t.style.marginTop=e.marginTop+"px",t.style.marginBottom=e.marginBottom+"px",new Fc(this.window,this.fontSize,this.pixelRatio,t,e.width,e.height)}return new Fc(this.window,this.fontSize,this.pixelRatio,t)},u.resolveSpreadView=function(t,e){switch(this.pageViewMode){case zc.SINGLE_PAGE:return!1;case zc.SPREAD:return!0;default:return(t.width-this.pref.pageBorder)/t.height>=(e?2*e.width/e.height:1.45)&&(!!e||t.width>800)}},u.updateSpreadView=function(t){this.pref.spreadView=t,this.viewportElement.setAttribute("data-vivliostyle-spread-view",t.toString())},u.sizeIsGood=function(){var t,e=this.createViewport(),u=(null==(t=this.opfView)?void 0:t.hasPages())&&!this.opfView.hasAutoSizedPages(),n=this.resolveSpreadView(e,this.resized&&u?this.pageSizes[0]:null);this.resized=!1;var i=this.pref.spreadView!==n;return this.updateSpreadView(n),!(this.pixelRatio&&this.opfView&&this.pixelRatio/this.window.devicePixelRatio!==this.opfView.clientLayout.scaleRatio||this.viewportSize||!this.viewport||this.viewport.fontSize!=this.fontSize||(i||e.width!=this.viewport.width||e.height!=this.viewport.height)&&(i||e.width!=this.viewport.width||e.height==this.viewport.height||!/Android|iPhone|iPad|iPod/.test(navigator.userAgent))&&(!u||(this.viewport.width=e.width,this.viewport.height=e.height,this.needRefresh=!0,0)))},u.setPageSize=function(t,e,u,n){this.pageSizes[n]=t,this.setPageSizePageRules(e,u,n),0!==n||this.pageViewMode!==zc.AUTO_SPREAD||this.opfView.hasAutoSizedPages()||this.updateSpreadView(this.resolveSpreadView(this.viewport,t))},u.setPageSizePageRules=function(t,e,u){var n,i;if(this.pageRuleStyleElement&&(!this.pageSheetSizeAlreadySet||this.pageSizes[u].width!==(null==(n=this.pageSizes[u-1])?void 0:n.width)||this.pageSizes[u].height!==(null==(i=this.pageSizes[u-1])?void 0:i.height))){var r=function(t){return Math.ceil(.75*t)},o=Math.max.apply(Math,this.pageSizes.map((function(t){return t.width}))),a=Math.max.apply(Math,this.pageSizes.map((function(t){return t.height}))),s=r(o),l=r(a);this.pageRuleStyleElement.textContent="@page {size: "+s+"pt "+l+"pt; margin: 0 "+-(s*((this.pixelRatio||1)-1)+2)+"pt "+-(l*((this.pixelRatio||1)-1)+2)+"pt 0;}",this.pageSheetSizeAlreadySet=!0}},u.removePageSizePageRules=function(){this.pageRuleStyleElement&&(this.pageRuleStyleElement.textContent="",this.pageSheetSizeAlreadySet=!1)},u.reset=function(){var t=!1,e=!1;this.opfView&&(t=this.opfView.tocVisible,e=this.opfView.tocAutohide,this.opfView.removeRenderedPages()),this.pageSizes=[],this.removePageSizePageRules(),this.viewport=this.createViewport(),this.viewport.resetZoom(),this.opfView=new Kc(this.opf,this.viewport,this.fontMapper,this.pref,this.setPageSize.bind(this)),t&&this.sendCommand({a:"toc",v:"show",autohide:e})},u.showCurrent=function(t,u){var n=this;return this.needRefresh=!1,this.removePageListeners(),this.pref.spreadView?this.opfView.getSpread(this.pagePosition,u).thenAsync((function(u){return u.left||u.right?(n.showSpread(u),n.setSpreadZoom(u),n.currentPage=t.side===e.PageSide.LEFT?u.left:u.right,Rn(null)):Rn(null)})):(this.showPage(t),this.setPageZoom(t),this.currentPage=t,Rn(null))},u.setPageZoom=function(t){var e=this.getAdjustedZoomFactor(t.dimensions);this.viewport.zoom(t.dimensions.width,t.dimensions.height,e)},u.setSpreadZoom=function(t){var e=this.getSpreadDimensions(t);this.viewport.zoom(e.width,e.height,this.getAdjustedZoomFactor(e))},u.getAdjustedZoomFactor=function(t){return this.fitToScreen?this.calculateZoomFactorToFitInsideViewPort(t):this.zoom},u.getSpreadDimensions=function(t){var e=0,u=0;return t.left&&(e+=t.left.dimensions.width,u=t.left.dimensions.height),t.right&&(e+=t.right.dimensions.width,u=Math.max(u,t.right.dimensions.height)),t.left&&t.right&&(e+=2*this.pref.pageBorder,e+=Math.abs(t.left.dimensions.width-t.right.dimensions.width)),{width:e,height:u}},u.queryZoomFactor=function(t){if(!this.currentPage)throw new Error("no page exists.");var e;if(t===qc.FIT_INSIDE_VIEWPORT)return e=this.pref.spreadView?this.getSpreadDimensions(this.currentSpread):this.currentPage.dimensions,this.calculateZoomFactorToFitInsideViewPort(e);throw new Error("unknown zoom type: "+t)},u.calculateZoomFactorToFitInsideViewPort=function(t){return this.viewport?Math.min(this.viewport.width/t.width,this.viewport.height/t.height):this.zoom},u.cancelRenderingTask=function(){this.renderTask&&this.renderTask.interrupt(new Qc),this.renderTask=null},u.resize=function(){var t=this;if(this.needResize=!1,this.needRefresh=!1,this.sizeIsGood())return Rn(!0);this.setReadyState(e.ReadyState.LOADING),this.cancelRenderingTask();var u=In().getScheduler().run((function(){return kn("resize",(function(n){t.opf?(t.renderTask=u,w.registerStartTiming("render (resize)"),t.reset(),t.pagePosition&&(0==t.pagePosition.pageIndex&&0==t.pagePosition.offsetInItem||(t.pagePosition.pageIndex=-1)),t.opf.setEPageCountMode(t.renderAllPages),t.opfView.renderPagesUpto(t.pagePosition,!t.renderAllPages).then((function(i){i?(t.pagePosition=i.position,t.showCurrent(i.page,!0).then((function(){t.setReadyState(e.ReadyState.INTERACTIVE),t.opf.countEPages((function(e){var u={t:"nav",epageCount:e,first:t.currentPage.isFirstPage,last:t.currentPage.isLastPage,metadata:t.opf.metadata,docTitle:t.opf.spine[t.pagePosition.spineIndex].title};(t.currentPage.isFirstPage||0==t.pagePosition.pageIndex&&t.opf.spine[t.pagePosition.spineIndex].epage)&&(u.epage=t.opf.spine[t.pagePosition.spineIndex].epage),t.callback(u)})).then((function(){t.reportPosition().then((function(i){(t.renderAllPages?t.opfView.renderAllPages():Rn(null)).then((function(){t.renderTask===u&&(t.renderTask=null),w.registerEndTiming("render (resize)"),oc&&hc(t.window)?function(t){if(!oc)return Rn(!1);var e=Pn("loadScripts");return e.loop((function(){return 0===ac.length?Rn(!1):Dc(ac.shift(),t,{atEnd:!0}).thenReturn(ac.length>0)})).then((function(){c.debug("dispatchEvent: DOMContentLoaded (window)"),t.dispatchEvent(new Event("DOMContentLoaded")),c.debug("dispatchEvent: load (window)"),t.dispatchEvent(new Event("load")),e.finish(!0)})),e.result()}(t.window).then((function(){t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i)})):(t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i))}))}))}))}))):n.finish(!1)}))):n.finish(!1)}),(function(t,e){if(!(e instanceof Qc))throw e;w.registerEndTiming("render (resize)"),c.debug(e.message)}))}));return Rn(!0)},u.sendLocationNotification=function(t,e){var u=this,n=Pn("sendLocationNotification"),i={t:"nav",first:t.isFirstPage,last:t.isLastPage,metadata:this.opf.metadata,docTitle:this.opf.spine[t.spineIndex].title};return this.opf.getEPageFromPosition(this.pagePosition).then((function(t){i.epage=t,i.epageCount=u.opf.epageCount,e&&(i.cfi=e),u.callback(i),n.finish(!0)})),n.result()},u.getCurrentPageProgression=function(){return this.opfView?this.opfView.getCurrentPageProgression(this.pagePosition):null},u.moveTo=function(t){var u,n,i=this;if(this.readyState!==e.ReadyState.COMPLETE&&"next"!==t.where&&this.setReadyState(e.ReadyState.LOADING),"string"==typeof t.where){var r;switch(t.where){case"next":r=this.pref.spreadView?this.opfView.nextSpread:this.opfView.nextPage;break;case"previous":r=this.pref.spreadView?this.opfView.previousSpread:this.opfView.previousPage;break;case"last":r=this.opfView.lastPage;break;case"first":r=this.opfView.firstPage;break;default:return Rn(!0)}r&&(n=function(){return r.call(i.opfView,i.pagePosition,!i.renderAllPages)})}else if("number"==typeof t.epage){var o=t.epage;n=function(){return i.opfView.navigateToEPage(o,i.pagePosition,!i.renderAllPages)}}else if("string"==typeof t.url){var a=t.url;n=function(){return i.opfView.navigateTo(a,i.pagePosition,!i.renderAllPages)}}else{if("number"!=typeof(null==(u=t.position)?void 0:u.spineIndex))return Rn(!0);var s=t.position;n=function(){return i.opfView.findPage(s,!i.renderAllPages)}}if(!this.opfView)return Rn(!0);var l=Pn("moveTo");return n.call(this.opfView).then((function(t){var u;if(t){i.pagePosition=t.position;var n=Pn("moveTo.showCurrent");u=n.result(),i.showCurrent(t.page,!i.renderAllPages).then((function(){i.reportPosition().thenFinish(n)}))}else u=Rn(!0);u.then((function(t){i.readyState===e.ReadyState.LOADING&&i.setReadyState(e.ReadyState.INTERACTIVE),l.finish(t)}))})),l.result()},u.showTOC=function(t){var e=this,u=!!t.autohide,n=t.v,i=this.opfView.isTOCVisible(),r=u!=this.opfView.tocAutohide&&"hide"!=n;if(i){if("show"==n&&!r)return Rn(!0)}else if("hide"==n)return Rn(!0);if(i&&"show"!=n)return this.opfView.hideTOC(),Rn(!0);var o=Pn("showTOC");return this.opfView.showTOC(u).then((function(t){t&&(r&&(t.listeners={}),u&&t.addEventListener("hyperlink",(function(){e.opfView.hideTOC()}),!1),t.addEventListener("hyperlink",e.hyperlinkListener,!1)),o.finish(!0)})),o.result()},u.runCommand=function(t){var e=this,u=t.a||"";return kn("runCommand",(function(n){var i=e.actions[u];i?i.call(e,t).then((function(){e.callback({t:"done",a:u}),n.finish(!0)})):(c.error("No such action:",u),n.finish(!0))}),(function(t,e){c.error(e,"Error during action:",u),t.finish(!0)}))},u.initEmbed=function(t){var e,u=this,n=Zc(t),i=null,r=this;e=function(){var t=Pn("commandLoop"),e=In().getScheduler();return r.hyperlinkListener=function(t){var u=t,n="#"===u.href.charAt(0)||r.packageURL.some((function(t){return u.href.substr(0,t.length)==t}));if(n){t.preventDefault();var i={t:"hyperlink",href:u.href,internal:n};e.run((function(){return r.callback(i),Rn(!0)}))}},t.loopWithFrame((function(t){if(r.needResize)r.resize().then((function(){t.continueLoop()}));else if(r.needRefresh)r.currentPage&&r.showCurrent(r.currentPage,!u.renderAllPages).then((function(){t.continueLoop()}));else if(n){var e=n;n=null,r.runCommand(e).then((function(){t.continueLoop()}))}else{var o=Pn("waitForCommand");i=o.suspend(u),o.result().then((function(){t.continueLoop()}))}})).thenFinish(t),t.result()},(xn?xn.getScheduler():Tn||new _n(new On)).run(e,void 0),r.kick=function(){var t=i;t&&(i=null,t.schedule(!0))},r.sendCommand=function(t){return!n&&(n=Zc(t),r.kick(),!0)},this.window.adapt_command=r.sendCommand},t}();(qc||(qc={})).FIT_INSIDE_VIEWPORT="fit inside viewport";var Qc=function(t){function e(){var u;return(u=t.call(this)||this).name="RenderingCanceledError",u.message="Page rendering has been canceled",u.stack=void 0,Object.setPrototypeOf(k(u),e.prototype),u.stack=(new Error).stack,u}return x(e,t),e}(R(Error));function Zc(t){return"string"==typeof t?V(t):t}var Jc=e.PageProgression;function td(t){var e={};return Object.keys(t).forEach((function(u){var n=t[u];switch(u){case"autoResize":e.autoresize=n;break;case"pageBorderWidth":e.pageBorder=n;break;default:e[u]=n}})),e}var ed,ud=function(){function t(t,e){this.settings=void 0,this.initialized=!1,this.adaptViewer_=void 0,this.options=void 0,this.eventTarget=void 0,this.readyState=void 0,this.settings=t,a(t.debug),this.adaptViewer_=new $c(t.window||window,t.viewportElement,"main",this.dispatcher.bind(this)),this.options={autoResize:!0,fontSize:16,pageBorderWidth:1,renderAllPages:!0,pageViewMode:zc.AUTO_SPREAD,zoom:1,fitToScreen:!1,defaultPaperSize:void 0,allowScripts:!0,pixelRatio:8},e&&this.setOptions(e),this.eventTarget=new Et,Object.defineProperty(this,"readyState",{get:function(){return this.adaptViewer_.readyState}})}var u=t.prototype;return u.setOptions=function(t){var e=Object.assign({a:"configure"},td(t));this.adaptViewer_.sendCommand(e),Object.assign(this.options,t)},u.dispatcher=function(t){var e={type:t.t},u=t;Object.keys(u).forEach((function(t){"t"!==t&&(e[t]=u[t])})),this.eventTarget.dispatchEvent(e)},u.addListener=function(t,e){this.eventTarget.addEventListener(t,e,!1)},u.removeListener=function(t,e){this.eventTarget.removeEventListener(t,e,!1)},u.loadDocument=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(t,null,e,u)},u.loadPublication=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(null,t,e,u)},u.loadDocumentOrPublication=function(t,e,u,n){var i=u||{};function r(t){return t?t.map((function(t){return{url:t.url||null,text:t.text||null}})):void 0}var o=r(i.authorStyleSheet),a=r(i.userStyleSheet);n&&Object.assign(this.options,n);var s=Object.assign({a:t?"loadXML":"loadPublication",userAgentRootURL:this.settings.userAgentRootURL,url:nd(t)||e,document:i.documentObject,fragment:i.fragment,authorStyleSheet:o,userStyleSheet:a},td(this.options));this.initialized?this.adaptViewer_.sendCommand(s):(this.initialized=!0,this.adaptViewer_.initEmbed(s))},u.getCurrentPageProgression=function(){return this.adaptViewer_.getCurrentPageProgression()},u.resolveNavigation=function(t){switch(t){case e.Navigation.LEFT:return this.getCurrentPageProgression()===Jc.LTR?e.Navigation.PREVIOUS:e.Navigation.NEXT;case e.Navigation.RIGHT:return this.getCurrentPageProgression()===Jc.LTR?e.Navigation.NEXT:e.Navigation.PREVIOUS;default:return t}},u.navigateToPage=function(t,u){t===e.Navigation.EPAGE?this.adaptViewer_.sendCommand({a:"moveTo",epage:u}):this.adaptViewer_.sendCommand({a:"moveTo",where:this.resolveNavigation(t)})},u.navigateToInternalUrl=function(t){this.adaptViewer_.sendCommand({a:"moveTo",url:t})},u.navigateToPosition=function(t){var e,u;this.adaptViewer_.sendCommand({a:"moveTo",position:{spineIndex:t.spineIndex,pageIndex:null!=(e=t.pageIndex)?e:-1,offsetInItem:null!=(u=t.offsetInItem)?u:-1}})},u.isTOCVisible=function(){return this.adaptViewer_.opfView&&this.adaptViewer_.opfView.opf&&(this.adaptViewer_.opfView.opf.xhtmlToc||this.adaptViewer_.opfView.opf.ncxToc)?!!this.adaptViewer_.opfView.isTOCVisible():null},u.showTOC=function(t,e){this.adaptViewer_.sendCommand({a:"toc",v:null==t?"toggle":t?"show":"hide",autohide:e})},u.queryZoomFactor=function(t){return this.adaptViewer_.queryZoomFactor(t)},u.getPageSizes=function(){return this.adaptViewer_.pageSizes},u.getTOC=function(){var t,e;return null==(t=this.adaptViewer_.opfView)||null==(e=t.tocView)?void 0:e.getTOC()},u.getMetadata=function(){return this.adaptViewer_.opf.getMetadata()},u.getCover=function(){return this.adaptViewer_.opf.cover},t}();function nd(t){function e(t){return"number"==typeof t?t:null}function u(t){return"string"==typeof t?{url:t,startPage:null,skipPagesBefore:null}:{url:t.url,startPage:e(t.startPage),skipPagesBefore:e(t.skipPagesBefore)}}return Array.isArray(t)?t.map(u):t?[u(t)]:null}e.Navigation=void 0,(ed=e.Navigation||(e.Navigation={})).PREVIOUS="previous",ed.NEXT="next",ed.LEFT="left",ed.RIGHT="right",ed.FIRST="first",ed.LAST="last",ed.EPAGE="epage";var id=qc,rd=zc;w.forceRegisterEndTiming("load_vivliostyle");var od=function(){function t(t,e){var u=e.title,n=void 0===u?"":u,i=e.printCallback,r=void 0===i?function(t){return t.print()}:i,o=e.hideIframe,a=void 0===o||o,s=e.removeIframe,l=void 0===s||s;this.htmlDoc=void 0,this.title=void 0,this.printCallback=void 0,this.hideIframe=void 0,this.removeIframe=void 0,this.iframe=void 0,this.iframeWin=void 0,this.window=void 0,this.htmlDoc=t,this.title=n,this.printCallback=r,this.hideIframe=a,this.removeIframe=l}var e=t.prototype;return e.init=function(){this.iframe=document.createElement("iframe"),this.hideIframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this.iframe.style.borderWidth="0"),this.window=window,this.window.printInstance=this,this.iframe.srcdoc="\n \n \n \n \n \n "+this.title+"\n \n \n \n \n
\n \n ",document.body.appendChild(this.iframe)},e.runInIframe=function(t){var e=this;return this.iframeWin=t,this.preparePrint().then((function(){return e.browserPrint()})).then((function(){return e.cleanUp()}))},e.preparePrint=function(){this.iframeWin.document.title=this.title;var t=new Blob([this.htmlDoc],{type:"text/html"}),e=URL.createObjectURL(t),u=new ud({viewportElement:this.iframeWin.document.body.firstElementChild,window:this.iframeWin,debug:!0});return new Promise((function(t){u.addListener("readystatechange",(function(){"complete"===u.readyState&&t()})),u.loadDocument({url:e})}))},e.browserPrint=function(){this.printCallback(this.iframeWin)},e.cleanUp=function(){delete this.window.printInstance,this.removeIframe&&this.iframe.parentElement.removeChild(this.iframe)},t}();e.CoreViewer=ud,e.PageViewMode=rd,e.Profiler=A,e.UserAgentBaseCss=Qn,e.UserAgentPageCss=$n,e.UserAgentTocCss=Zn,e.UserAgentXml=qn,e.ValidationTxt=Yn,e.VivliostylePolyfillCss=Jn,e.VivliostyleViewportCss=Kn,e.VivliostyleViewportScreenCss=jn,e.ZoomType=id,e.getHooksForName=C,e.pageProgressionOf=s,e.plugin=F,e.printHTML=function(t,e){new od(t,e).init()},e.profile=N,e.profiler=w,e.registerHook=p,e.removeHook=E,e.setDebug=a},c(d={exports:{}},d.exports),d.exports);p.isDebug,p.PageProgression,p.PageSide,p.ReadyState,p.HOOKS,p.Navigation,p.CoreViewer,p.PageViewMode,p.Profiler,p.UserAgentBaseCss,p.UserAgentPageCss,p.UserAgentTocCss,p.UserAgentXml,p.ValidationTxt,p.VivliostylePolyfillCss,p.VivliostyleViewportCss,p.VivliostyleViewportScreenCss,p.ZoomType,p.getHooksForName,p.pageProgressionOf,p.plugin;var E=p.printHTML;p.profile,p.profiler,p.registerHook,p.removeHook,p.setDebug,document.getElementById("print").addEventListener("click",(()=>{const t=document.getElementById("html").value,e=document.getElementById("css").value,u=document.getElementById("title").value;E(`\n \n \n \n \n ${u}\n \n \n ${t}\n `,{title:u,printCallback:t=>{t.document.querySelectorAll("[data-vivliostyle-page-container]").length,t.print()},hideIframe:!0,removeIframe:!0})}))}(); +!function(){"use strict";var t=-1;function e(o,a,s,l){if(o===a)return o?[[0,o]]:[];if(null!=s){var h=function(t,e,u){var n="number"==typeof u?{index:u,length:0}:u.oldRange,i="number"==typeof u?null:u.newRange,r=t.length,o=e.length;if(0===n.length&&(null===i||0===i.length)){var a=n.index,s=t.slice(0,a),l=t.slice(a),h=i?i.index:null,c=a+o-r;if((null===h||h===c)&&!(c<0||c>o)){var d=e.slice(0,c);if((E=e.slice(c))===l){var f=Math.min(a,c);if((F=s.slice(0,f))===(g=d.slice(0,f)))return D(F,s.slice(f),d.slice(f),l)}}if(null===h||h===a){var p=a,E=(d=e.slice(0,p),e.slice(p));if(d===s){var C=Math.min(r-p,o-p);if((A=l.slice(l.length-C))===(v=E.slice(E.length-C)))return D(s,l.slice(0,l.length-C),E.slice(0,E.length-C),A)}}}if(n.length>0&&i&&0===i.length){var F=t.slice(0,n.index),A=t.slice(n.index+n.length);if(!(o<(f=F.length)+(C=A.length))){var g=e.slice(0,f),v=e.slice(o-C);if(F===g&&A===v)return D(F,t.slice(f,r-C),e.slice(f,o-C),A)}}return null}(o,a,s);if(h)return h}var c=n(o,a),d=o.substring(0,c);c=i(o=o.substring(c),a=a.substring(c));var f=o.substring(o.length-c),p=function(r,o){var a;if(!r)return[[1,o]];if(!o)return[[t,r]];var s=r.length>o.length?r:o,l=r.length>o.length?o:r,D=s.indexOf(l);if(-1!==D)return a=[[1,s.substring(0,D)],[0,l],[1,s.substring(D+l.length)]],r.length>o.length&&(a[0][0]=a[2][0]=t),a;if(1===l.length)return[[t,r],[1,o]];var h=function(t,e){var u=t.length>e.length?t:e,r=t.length>e.length?e:t;if(u.length<4||2*r.length=t.length?[r,o,a,s,h]:null}var a,s,l,D,h,c=o(u,r,Math.ceil(u.length/4)),d=o(u,r,Math.ceil(u.length/2));if(!c&&!d)return null;a=d?c&&c[4].length>d[4].length?c:d:c;t.length>e.length?(s=a[0],l=a[1],D=a[2],h=a[3]):(D=a[0],h=a[1],s=a[2],l=a[3]);var f=a[4];return[s,l,D,h,f]}(r,o);if(h){var c=h[0],d=h[1],f=h[2],p=h[3],E=h[4],C=e(c,f),F=e(d,p);return C.concat([[0,E]],F)}return function(e,n){for(var i=e.length,r=n.length,o=Math.ceil((i+r)/2),a=o,s=2*o,l=new Array(s),D=new Array(s),h=0;hi)p+=2;else if(v>r)f+=2;else if(d){if((y=a+c-A)>=0&&y=(B=i-D[y]))return u(e,n,N,v)}}for(var m=-F+E;m<=F-C;m+=2){for(var B,y=a+m,w=(B=m===-F||m!==F&&D[y-1]i)C+=2;else if(w>r)E+=2;else if(!d){if((g=a+c-m)>=0&&g=(B=i-B))return u(e,n,N,v)}}}}return[[t,e],[1,n]]}(r,o)}(o=o.substring(0,o.length-c),a=a.substring(0,a.length-c));return d&&p.unshift([0,d]),f&&p.push([0,f]),r(p,l),p}function u(t,u,n,i){var r=t.substring(0,n),o=u.substring(0,i),a=t.substring(n),s=u.substring(i),l=e(r,o),D=e(a,s);return l.concat(D)}function n(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var u=0,n=Math.min(t.length,e.length),i=n,r=0;u=0&&l(e[f][1])){var p=e[f][1].slice(-1);if(e[f][1]=e[f][1].slice(0,-1),c=p+c,d=p+d,!e[f][1]){e.splice(f,1),a--;var E=f-1;e[E]&&1===e[E][0]&&(h++,d=e[E][1]+d,E--),e[E]&&e[E][0]===t&&(D++,c=e[E][1]+c,E--),f=E}}if(s(e[a][1])){p=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=p,d+=p}}if(a0||d.length>0){c.length>0&&d.length>0&&(0!==(o=n(d,c))&&(f>=0?e[f][1]+=d.substring(0,o):(e.splice(0,0,[0,d.substring(0,o)]),a++),d=d.substring(o),c=c.substring(o)),0!==(o=i(d,c))&&(e[a][1]=d.substring(d.length-o)+e[a][1],d=d.substring(0,d.length-o),c=c.substring(0,c.length-o)));var C=h+D;0===c.length&&0===d.length?(e.splice(a-C,C),a-=C):0===c.length?(e.splice(a-C,C,[1,d]),a=a-C+1):0===d.length?(e.splice(a-C,C,[t,c]),a=a-C+1):(e.splice(a-C,C,[t,c],[1,d]),a=a-C+2)}0!==a&&0===e[a-1][0]?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,h=0,D=0,c="",d=""}""===e[e.length-1][1]&&e.pop();var F=!1;for(a=1;a=55296&&t<=56319}function a(t){return t>=56320&&t<=57343}function s(t){return a(t.charCodeAt(0))}function l(t){return o(t.charCodeAt(t.length-1))}function D(e,u,n,i){return l(e)||s(i)?null:function(t){for(var e=[],u=0;u0&&e.push(t[u]);return e}([[0,e],[t,u],[1,n],[0,i]])}function h(t,u,n){return e(t,u,n,!0)}h.INSERT=1,h.DELETE=t,h.EQUAL=0;var c,d,f=h,p=(c=function(t,e){function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n,i,r,o=u(f);function a(t){e.isDebug=t}function s(t){switch(t){case"ltr":return e.PageProgression.LTR;case"rtl":return e.PageProgression.RTL;default:throw new Error("unknown PageProgression: "+t)}}function l(t){var e=Array.from(t),u=null;return e[0]instanceof Error&&(u=e.shift()),{error:u,messages:e}}function D(t){var e=t.error,u=e&&(e.frameTrace||e.stack),n=[].concat(t.messages);return e&&(n.length>0&&(n=n.concat(["\n"])),n=n.concat([e.toString()]),u&&(n=n.concat(["\n"]).concat(u))),n}e.isDebug=!1,e.PageProgression=void 0,function(t){t.LTR="ltr",t.RTL="rtl"}(e.PageProgression||(e.PageProgression={})),e.PageSide=void 0,(n=e.PageSide||(e.PageSide={})).LEFT="left",n.RIGHT="right",e.ReadyState=void 0,(i=e.ReadyState||(e.ReadyState={})).LOADING="loading",i.INTERACTIVE="interactive",i.COMPLETE="complete",function(t){t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR"}(r||(r={}));var h,c=new(function(){function t(t){this.opt_console=void 0,this.listeners={},this.opt_console=t}var e=t.prototype;return e.consoleDebug=function(t){var e,u,n;this.opt_console?this.opt_console.debug?(e=this.opt_console).debug.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).debug.apply(n,t)},e.consoleInfo=function(t){var e,u,n;this.opt_console?this.opt_console.info?(e=this.opt_console).info.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).info.apply(n,t)},e.consoleWarn=function(t){var e,u,n;this.opt_console?this.opt_console.warn?(e=this.opt_console).warn.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).warn.apply(n,t)},e.consoleError=function(t){var e,u,n;this.opt_console?this.opt_console.error?(e=this.opt_console).error.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).error.apply(n,t)},e.triggerListeners=function(t,e){var u=this.listeners[t];u&&u.forEach((function(t){t(e)}))},e.addListener=function(t,e){var u=this.listeners[t];u||(u=this.listeners[t]=[]),u.push(e)},e.debug=function(){var t=l(arguments);this.consoleDebug(D(t)),this.triggerListeners(r.DEBUG,t)},e.info=function(){var t=l(arguments);this.consoleInfo(D(t)),this.triggerListeners(r.INFO,t)},e.warn=function(){var t=l(arguments);this.consoleWarn(D(t)),this.triggerListeners(r.WARN,t)},e.error=function(){var t=l(arguments);this.consoleError(D(t)),this.triggerListeners(r.ERROR,t)},t}());e.HOOKS=void 0,(h=e.HOOKS||(e.HOOKS={})).SIMPLE_PROPERTY="SIMPLE_PROPERTY",h.PREPROCESS_SINGLE_DOCUMENT="PREPROCESS_SINGLE_DOCUMENT",h.PREPROCESS_TEXT_CONTENT="PREPROCESS_TEXT_CONTENT",h.PREPROCESS_ELEMENT_STYLE="PREPROCESS_ELEMENT_STYLE",h.POLYFILLED_INHERITED_PROPS="POLYFILLED_INHERITED_PROPS",h.CONFIGURATION="CONFIGURATION",h.RESOLVE_TEXT_NODE_BREAKER="RESOLVE_TEXT_NODE_BREAKER",h.RESOLVE_FORMATTING_CONTEXT="RESOLVE_FORMATTING_CONTEXT",h.RESOLVE_LAYOUT_PROCESSOR="RESOLVE_LAYOUT_PROCESSOR",h.POST_LAYOUT_BLOCK="POST_LAYOUT_BLOCK";var d={};function p(t,u,n){if(e.HOOKS[t]){var i=d[t];i||(i=d[t]=[]),n?i.unshift(u):i.push(u)}else c.warn(new Error("Skipping unknown plugin hook '"+t+"'."))}function E(t,u){if(e.HOOKS[t]){var n=d[t];if(n){var i=n.indexOf(u);i>=0&&n.splice(i,1)}}else c.warn(new Error("Ignoring unknown plugin hook '"+t+"'."))}function C(t){return d[t]||[]}var F={registerHook:p,removeHook:E},A=function(){function t(t){this.performanceInstance=void 0,this.timestamps={},this.registerTiming=void 0,this.registerStartTiming=void 0,this.registerEndTiming=void 0,this.performanceInstance=t,this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g}var e=t.prototype;return e.forceRegisterStartTiming=function(t,e){v.call(this,t,"start",e)},e.forceRegisterEndTiming=function(t,e){v.call(this,t,"end",e)},e.printTimings=function(){var t=this.timestamps,e="";Object.keys(t).forEach((function(u){for(var n=t[u],i=n.length,r=0;r1&&(e+="("+r+")"),e+=" => start: "+o.start+", end: "+o.end+", duration: "+(o.end-o.start)+"\n"}})),c.info(e)},e.disable=function(){this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g},e.enable=function(){this.registerTiming=v,this.registerStartTiming=this.registerStartTiming=m,this.registerEndTiming=this.registerEndTiming=B},e.isEnabled=function(){return this.registerStartTiming===m},t}();function g(){}function v(t,e,u){u||(u=this.performanceInstance.now());var n,i=this.timestamps[t];i||(i=this.timestamps[t]=[]);for(var r=i.length-1;r>=0&&(!(n=i[r])||n[e]);r--)n=null;n||i.push(n={}),n[e]=u}function m(t,e){this.registerTiming(t,"start",e)}function B(t,e){this.registerTiming(t,"end",e)}var y={now:Date.now},w=new A(window&&window.performance||y);w.forceRegisterStartTiming("load_vivliostyle");var N={profiler:{registerStartTiming:w.registerStartTiming,registerEndTiming:w.registerEndTiming,printTimings:w.printTimings,disable:w.disable,enable:w.enable}};function b(t,e){for(var u=0;ut.length)&&(e=t.length);for(var u=0,n=new Array(e);u=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var _=/^(?:[\t-\r -#%-\*,-\/:;\?@\[-\]_\{\}\xA0\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u0300-\u036F\u037E\u0387\u0483-\u0487\u055A-\u055F\u0589\u058A\u0591-\u05C7\u05F3\u05F4\u0609\u060A\u060C\u060D\u0610-\u061B\u061D-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0700-\u070D\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F7-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0830-\u083E\u0859-\u085B\u085E\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0965\u0970\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FD\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A76\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF0\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C77\u0C81\u0C84\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0DF4\u0E31\u0E34-\u0E3A\u0E47-\u0E4F\u0E5A\u0E5B\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u0FD0-\u0FD4\u0FD9\u0FDA\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u104A-\u104F\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u10FB\u135D-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1712-\u1714\u1732\u1733\u1735\u1736\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D6\u17D8-\u17DA\u17DD\u1800-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1944\u1945\u1A17\u1A18\u1A1B\u1A1E\u1A1F\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B5A-\u1B60\u1B6B-\u1B73\u1B7D\u1B7E\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1BFC-\u1BFF\u1C2C-\u1C33\u1C36\u1C37\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD0-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CEF-\u2CF1\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2D7F\u2DE0-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3000-\u3003\u3008-\u3011\u3014-\u301F\u302A-\u302D\u3030\u303D\u3099\u309A\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA66F\uA673-\uA67E\uA69E\uA69F\uA6F0-\uA6F7\uA802\uA806\uA80B\uA825\uA826\uA82C\uA874-\uA877\uA8C4\uA8C5\uA8CE\uA8CF\uA8E0-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA951\uA95F\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9C1-\uA9CD\uA9DE\uA9DF\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA5C-\uAA5F\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAADE\uAADF\uAAEC\uAAED\uAAF0\uAAF1\uAAF6\uABE5\uABE8\uABEB\uABED\uFB1E\uFD3E\uFD3F\uFE00-\uFE19\uFE20-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFEFF\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDDFD\uDEE0\uDF76-\uDF7A\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDE50-\uDE58\uDE7F\uDEE5\uDEE6\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD24-\uDD27\uDEAB-\uDEAD\uDEFD-\uDEFF\uDF46-\uDF50\uDF55-\uDF59\uDF82-\uDF89]|\uD804[\uDC01\uDC38-\uDC4D\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9-\uDCBC\uDCBE-\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD40-\uDD43\uDD73-\uDD75\uDD80\uDD81\uDDB6-\uDDBE\uDDC5-\uDDCD\uDDCF\uDDDB\uDDDD-\uDDDF\uDE2F-\uDE31\uDE34\uDE36-\uDE3E\uDE41\uDEA9\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDCC6\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF-\uDDD7\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F-\uDE43\uDE60-\uDE6C\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDEB9\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B\uDF3C-\uDF3E]|\uD806[\uDC2F-\uDC37\uDC39-\uDC3B\uDD3B\uDD3C\uDD3E\uDD43-\uDD46\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDDE2\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC41-\uDC45\uDC70\uDC71\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDEF7\uDEF8\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDE6E\uDE6F\uDEF0-\uDEF5\uDF30-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDF4F\uDF8F-\uDF92\uDFE2\uDFE4]|\uD82F[\uDC9D-\uDC9F]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD5E\uDD5F]|\uDB40[\uDD00-\uDDEF])*(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\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\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\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\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\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\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\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\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\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\uABF0-\uABF9\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\uFF10-\uFF19\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\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\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\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\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\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\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]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\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\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\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]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*)*/,M="data-adapt-eloff",U={};function V(t){return JSON.parse(t)}function H(t){var e=t.match(/^([^#]*)/);return e?e[1]:t}var z=window.location.href;function G(t){z=t}var W,X=window.location.href;function j(t){X=t}function K(t,e){if(/^data:/i.test(e))return t||e;if(!e||t.match(/^\w{2,}:/))return t.toLowerCase().match("^javascript:")?"#":(t.match(/^\w{2,}:\/\/[^\/]+$/)&&(t+="/"),t);var u;if(e.match(/^\w{2,}:\/\/[^\/]+$/)&&(e+="/"),t.match(/^\/\//))return(u=e.match(/^(\w{2,}:)\/\//))?u[1]+t:t;if(t.match(/^\//))return(u=e.match(/^(\w{2,}:\/\/[^\/]+)\//))?u[1]+t:t;if(t.match(/^\.(\/|$)/)&&(t=t.substr(2)),e=function(t){var e=t.match(/^([^#?]*)/);return e?e[1]:t}(e),t.match(/^#/))return e+t;var n=e.lastIndexOf("/");if(n<0)return t;var i=e.substr(0,n+1)+t,r="";for((u=i.match(/^([^?#]*)([?#].*)$/))&&(i=u[1],r=u[2]);!((n=i.indexOf("/../"))<=0);){var o=i.lastIndexOf("/",n-1);if(o<=0)break;i=i.substr(0,o)+i.substr(n+3)}return i.replace(/\/(\.\/)+/g,"/")+r}function Y(t){var e;return(e=/^(https?:)\/\/github\.com\/([^/]+\/[^/]+)\/(blob\/|tree\/|raw\/)?(.*)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/"+e[2]+"/"+(e[3]?"":"master/")+e[4]:(e=/^(https?:)\/\/www\.aozora\.gr\.jp\/(cards\/[^/]+\/files\/[^/.]+\.html)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/aozorabunko/aozorabunko/master/"+e[2]:(e=/^(https?:)\/\/gist\.github\.com\/([^/]+\/\w+)(\/|$)(raw(\/|$))?(.*)$/.exec(t))?t=e[1]+"//gist.githubusercontent.com/"+e[2]+"/raw/"+e[6]:(e=/^(https?:)\/\/(?:[^/.]+\.)?jsbin\.com\/(?!(?:blog|help)\b)(\w+)((\/\d+)?).*$/.exec(t))&&(t=e[1]+"//output.jsbin.com/"+e[2]+e[3]+"/"),t}function q(t){return null==t?t:t.toString()}!function(t){t.epub="http://www.idpf.org/2007/ops",t.EV="http://www.w3.org/2001/xml-events",t.MATHML="http://www.w3.org/1998/Math/MathML",t.XML="http://www.w3.org/XML/1998/namespace",t.XHTML="http://www.w3.org/1999/xhtml",t.XLINK="http://www.w3.org/1999/xlink",t.SHADOW="http://www.pyroxy.com/ns/shadow",t.SVG="http://www.w3.org/2000/svg",t.DC="http://purl.org/dc/elements/1.1/",t.NCX="http://www.daisy.org/z3986/2005/ncx/"}(W||(W={}));var $=function(){function t(){this.queue=[null]}var e=t.prototype;return e.length=function(){return this.queue.length-1},e.add=function(t){for(var e=this.queue.length;e>1;){var u=Math.floor(e/2),n=this.queue[u];if(n.compare(t)>0)return void(this.queue[e]=t);this.queue[e]=n,e=u}this.queue[1]=t},e.peek=function(){return this.queue[1]},e.remove=function(){var t=this.queue[1],e=this.queue.pop(),u=this.queue.length;if(u>1){for(var n=1;;){var i=2*n;if(i>=u)break;if(this.queue[i].compare(e)>0)i+10&&i++;else{if(!(i+10))break;i++}this.queue[n]=this.queue[i],n=i}this.queue[n]=e}return t},t}(),Q=["","-webkit-","-moz-"],Z={};function J(t,e){return CSS.supports(t+e,"unset")}function tt(t){var e=Z[t];if(e||null===e)return e;switch(t){case"behavior":case"template":case"ua-list-item-count":case"x-first-pseudo":return Z[t]=null,null;case"text-combine-upright":if(J("-webkit-","text-combine")&&!J("","text-combine-upright"))return Z[t]=["-webkit-text-combine"],["-webkit-text-combine"]}for(var u,n=O(Q);!(u=n()).done;){var i=u.value;if(J(i,t))return Z[t]=e=[i+t],e}return c.warn("Property not supported by the browser: ",t),Z[t]=null,null}function et(t,e,u){var n=null==t?void 0:t.style;if(n)if(e.startsWith("--"))n.setProperty(e,u||" ");else{var i=tt(e);if(i)for(var r,o=O(i);!(r=o()).done;){var a=r.value;switch(a){case"-webkit-text-combine":"all"===u&&(u="horizontal");break;case"text-combine-upright":"all"===u&&n.setProperty("text-indent","0")}n.setProperty(a,u)}}}function ut(t,e,u){try{var n=Z[e];return t.style.getPropertyValue(n?n[0]:e)}catch(t){}return u||""}function nt(t){var e=t.getAttributeNS(W.XML,"lang");return e||t.namespaceURI!=W.XHTML||(e=t.getAttribute("lang")),e}var it=function(){function t(){this.list=[]}var e=t.prototype;return e.append=function(t){return this.list.push(t),this},e.clear=function(){this.list=[]},e.toString=function(){var t=this.list.join("");return this.list=[t],t},t}();function rt(t){return"\\"+t.charCodeAt(0).toString(16)+" "}function ot(t){return t.replace(/[^-_a-zA-Z0-9\u0080-\uFFFF]/g,rt)}function at(t){return t.replace(/[\u0000-\u001F"\\]/g,rt)}function st(t){return t.replace(/[\s+&?=#\u007F-\uFFFF]+/g,encodeURIComponent)}function lt(t){return!!t.match(/^[a-zA-Z\u009E\u009F\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F\u037B-\u037D\u0386\u0388-\u0482\u048A-\u0527]$/)}function Dt(t,e){return t.replace(/[^-a-zA-Z0-9_]/g,(function(t){return function(t,e){return(e="string"==typeof e?e:"\\u")+(65536|t.charCodeAt(0)).toString(16).substr(1)}(t,e)}))}function ht(t){return Dt(t)}function ct(t,e){for(var u=0,n=t;;){if(0==u||e(u-1),n==t||e(n),u==n)return u;var i=u+n>>1;e(i)?n=i:u=i+1}}function dt(t,e){return t-e}function ft(t,e){for(var u,n={},i=O(t);!(u=i()).done;){var r=u.value,o=e(r);o&&!n[o]&&(n[o]=r)}return n}function pt(t,e){for(var u,n={},i=O(t);!(u=i()).done;){var r=u.value,o=e(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}var Et=function(){function t(){this.listeners={}}var e=t.prototype;return e.dispatchEvent=function(t){var e=this.listeners[t.type];if(e){t.target=this,t.currentTarget=this;for(var u=0;u=0&&n.splice(i,1)}}},t}();function Ct(t){if(1==t.nodeType){var e=t.getAttribute("id");if(e)return e}return null}function Ft(t){return"^"+t}function At(t){return t.replace(/[\[\]\(\),=;^]/g,Ft)}function gt(t){return t.substr(1)}function vt(t){return t?t.replace(/\^[\[\]\(\),=;^]/g,gt):t}function mt(t){var e=[];do{var u=t.match(/^(\^,|[^,])*/),n=vt(u[0]);if(!(t=t.substr(u[0].length+1))&&!e.length)return n;e.push(n)}while(t);return e}function Bt(t){for(var e={};t;){var u=t.match(/^;([^;=]+)=(([^;]|\^;)*)/);if(!u)return e;e[u[1]]=mt(u[2]),t=t.substr(u[0].length)}return e}var yt=function(){function t(){}var e=t.prototype;return e.appendTo=function(t){t.append("!")},e.applyTo=function(t){return!1},t}(),wt=function(){function t(t,e,u){this.index=void 0,this.id=void 0,this.sideBias=void 0,this.index=t,this.id=e,this.sideBias=u}var e=t.prototype;return e.appendTo=function(t){t.append("/"),t.append(this.index.toString()),(this.id||this.sideBias)&&(t.append("["),this.id&&t.append(this.id),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},e.applyTo=function(t){if(1!=t.node.nodeType)throw new Error("E_CFI_NOT_ELEMENT");var e,u=t.node,n=u.children,i=n.length,r=Math.floor(this.index/2)-1;if(r<0||0==i)t.node=(e=u.firstChild)||u;else{if(e=n[Math.min(r,i-1)],1&this.index){var o=e.nextSibling;o&&1!=o.nodeType?e=o:t.after=!0}t.node=e}if(this.id&&(t.after||this.id!=Ct(t.node))){var a=u.ownerDocument.getElementById(this.id);a?t.node=a:c.warn("E_CFI_ID_MISMATCH:",this.id)}return t.sideBias=this.sideBias,!0},t}(),Nt=function(){function t(t,e,u,n){this.offset=void 0,this.textBefore=void 0,this.textAfter=void 0,this.sideBias=void 0,this.offset=t,this.textBefore=e,this.textAfter=u,this.sideBias=n}var e=t.prototype;return e.applyTo=function(t){if(this.offset>0&&!t.after){for(var e=this.offset,u=t.node;;){var n=u.nodeType;if(1==n)break;var i=u.nextSibling;if(3<=n&&n<=5){var r=u.textContent.length;if(e<=r)break;if(!i){e=r;break}e-=r}if(!i){e=0;break}u=i}t.node=u,t.offset=e}return t.sideBias=this.sideBias,!0},e.appendTo=function(t){t.append(":"),t.append(this.offset.toString()),(this.textBefore||this.textAfter||this.sideBias)&&(t.append("["),(this.textBefore||this.textAfter)&&(this.textBefore&&t.append(At(this.textBefore)),t.append(","),this.textAfter&&t.append(At(this.textAfter))),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},t}(),bt=function(){function t(){this.steps=null}var e=t.prototype;return e.fromString=function(t){var e=t.match(/^#?epubcfi\((.*)\)$/);if(!e)throw new Error("E_CFI_NOT_CFI");for(var u=decodeURIComponent(e[1]),n=0,i=[];;){var r=void 0;switch(u.charAt(n)){case"/":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[(.*?)(;([^\]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var o=parseInt(e[1],10),a=e[3];r=Bt(e[4]),i.push(new wt(o,a,q(r.s)));break;case":":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[((([^\];,]|\^[\];,])*)(,(([^\];,]|\^[\];,])*))?)(;([^]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var s=parseInt(e[1],10),l=e[4];l&&(l=vt(l));var D=e[7];D&&(D=vt(D)),r=Bt(e[10]),i.push(new Nt(s,l,D,q(r.s)));break;case"!":n++,i.push(new yt);break;case"~":case"@":case"":return void(this.steps=i);default:throw new Error("E_CFI_PARSE_ERROR")}}},e.navigate=function(e){for(var u={node:e.documentElement,offset:0,after:!1,sideBias:null,ref:null},n=0;nl&&(e=l),u=!0,o=s.substr(0,e),a=s.substr(e)),t=t.previousSibling;continue;case 8:t=t.previousSibling;continue}break}for((e>0||o||a)&&(o=this.trim(o,!1),a=this.trim(a,!0),i.push(new Nt(e,o,a,n)),n=null);r&&r&&9!=r.nodeType;){for(var D=u?null:Ct(t),h=u?1:0;t;)1==t.nodeType&&(h+=2),t=t.previousSibling;i.push(new wt(h,D,n)),n=null,t=r,r=r.parentNode,u=!1}i.reverse(),this.steps?(i.push(new yt),this.steps=i.concat(this.steps)):this.steps=i},e.toString=function(){if(!this.steps)return"";var t=new it;t.append("epubcfi(");for(var e=0;er?i:r;case"pvw":return u;case"pvh":return n;case"pvi":return this.pageVertical?n:u;case"pvb":return this.pageVertical?u:n;case"pvmin":return un?u:n}}return"em"==t||"rem"==t?e?this.initialFontSize:this.fontSize():"ex"==t?Mt.ex*(e?this.initialFontSize:this.fontSize())/Mt.em:"lh"==t||"rlh"==t?this.rootLineHeight:Mt[t]},e.evalName=function(t,e){do{var u=t.values[e];if(u)return u;if(t.resolver&&(u=t.resolver.call(this,e,!1)))return u;t=t.parent}while(t);throw new Error("Name '"+e+"' is undefined")},e.evalCall=function(t,e,u,n){do{var i=t.funcs[e];if(i)return i;if(t.resolver&&(i=t.resolver.call(this,e,!0)))return i;var r=t.builtIns[e];if(r){if(n)return t.zero;for(var o=Array(u.length),a=0;a=Number(i);case"max":return r<=Number(i);default:return r==i}else if(null!=r&&null==e)return 0!==r;return!1},e.evalSupportsTest=function(t,e,u){return!1},e.queryVal=function(t,e){var u=t&&this.scopes[t.scopeKey];return u?u[e]:void 0},e.storeVal=function(t,e,u){this.getScopeContext(t)[e]=u},t}(),Ht=function(){function t(t){this.scope=void 0,this.key=void 0,this.scope=t,this.scope=t,this.key="_"+Lt++}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,0),t.toString()},e.appendTo=function(t,e){throw new Error("F_ABSTRACT")},e.evaluateCore=function(t){throw new Error("F_ABSTRACT")},e.expand=function(t,e){return this},e.dependCore=function(t,e,u){return t===this},e.dependOuter=function(t,e,u){var n=u[this.key];if(null!=n)return n!==Tt&&n;u[this.key]=Tt;var i=this.dependCore(t,e,u);return u[this.key]=i,i},e.depend=function(t,e){return this.dependOuter(t,e,{})},e.evaluate=function(t){var e=t.queryVal(this.scope,this.key);return void 0!==e||(e=this.evaluateCore(t),this.scope&&t.storeVal(this.scope,this.key,e)),e},e.isMediaName=function(){return!1},t}(),zt=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}x(e,t);var u=e.prototype;return u.getOp=function(){throw new Error("F_ABSTRACT")},u.evalPrefix=function(t){throw new Error("F_ABSTRACT")},u.evaluateCore=function(t){var e=this.val.evaluate(t);return this.evalPrefix(e)},u.dependCore=function(t,e,u){return t===this||this.val.dependOuter(t,e,u)},u.appendTo=function(t,e){10"},u.evalInfix=function(t,e){return t>e},e}(Xt),re=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return">="},u.evalInfix=function(t,e){return t>=e},e}(Xt),oe=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"=="},u.evalInfix=function(t,e){return t==e},e}(Xt),ae=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"!="},u.evalInfix=function(t,e){return t!=e},e}(Xt),se=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"+"},u.evalInfix=function(t,e){return t+e},e}(jt),le=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return" - "},u.evalInfix=function(t,e){return t-e},e}(jt),De=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"*"},u.evalInfix=function(t,e){return t*e},e}(Kt),he=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"/"},u.evalInfix=function(t,e){return t/e},e}(Kt),ce=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.getOp=function(){return"%"},u.evalInfix=function(t,e){return t%e},e}(Kt),de=function(t){function e(e,u,n){var i,r;return(r=t.call(this,e)||this).num=void 0,r.unit=void 0,r.num=u,r.unit=null!=(i=null==n?void 0:n.toLowerCase())?i:"",r}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.num.toString()),t.append(ot(this.unit))},u.evaluateCore=function(t){return this.num*t.queryUnitSize(this.unit,!1)},e}(Ht),fe=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).qualifiedName=void 0,n.qualifiedName=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName)},u.evaluateCore=function(t){return t.evalName(this.scope,this.qualifiedName).evaluate(t)},u.dependCore=function(t,e,u){return t===this||e.evalName(this.scope,this.qualifiedName).dependOuter(t,e,u)},e}(Ht),pe=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).not=void 0,i.name=void 0,i.not=u,i.name=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.not&&t.append("not "),t.append(ot(this.name))},u.evaluateCore=function(t){return t.evalMediaName(this.name,this.not)},u.isMediaName=function(){return!0},e}(Ht),Ee=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).fn=void 0,i.str=void 0,i.fn=u,i.str=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.str)},u.evaluateCore=function(t){return this.fn.call(t)},e}(Ht),Ce=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).qualifiedName=void 0,i.params=void 0,i.qualifiedName=u,i.params=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName),function(t,e){t.append("(");for(var u=0;u0&&t.append("("),this.cond.appendTo(t,0),t.append("?"),this.ifTrue.appendTo(t,0),t.append(":"),this.ifFalse.appendTo(t,0),e>0&&t.append(")")},u.evaluateCore=function(t){return this.cond.evaluate(t)?this.ifTrue.evaluate(t):this.ifFalse.evaluate(t)},u.dependCore=function(t,e,u){return t===this||this.cond.dependOuter(t,e,u)||this.ifTrue.dependOuter(t,e,u)||this.ifFalse.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.cond.expand(t,u),i=this.ifTrue.expand(t,u),r=this.ifFalse.expand(t,u);return n===this.cond&&i===this.ifTrue&&r===this.ifFalse?this:new e(this.scope,n,i,r)},e}(Ht),Ae=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){switch(typeof this.val){case"number":case"boolean":t.append(this.val.toString());break;case"string":t.append('"'),t.append(at(this.val)),t.append('"');break;default:throw new Error("F_UNEXPECTED_STATE")}},u.evaluateCore=function(t){return this.val},e}(Ht),ge=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).name=void 0,i.value=void 0,i.name=u,i.value=n,i}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("("),t.append(at(this.name.name)),t.append(":"),this.value.appendTo(t,0),t.append(")")},u.evaluateCore=function(t){return t.evalMediaTest(this.name.name,this.value)},u.dependCore=function(t,e,u){return t===this||this.value.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.value.expand(t,u);return n===this.value?this:new e(this.scope,this.name,n)},e}(Ht),ve=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e)||this).name=void 0,r.value=void 0,r.isFunc=void 0,r.name=u,r.value=n,r.isFunc=i,r}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.isFunc&&t.append(this.name),t.append("("),!this.isFunc&&this.name&&(t.append(this.name),t.append(":")),t.append(this.value),t.append(")")},u.evaluateCore=function(t){return t.evalSupportsTest(this.name,this.value,this.isFunc)},e}(Ht),me=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).index=void 0,n.index=u,n}x(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("$"),t.append(this.index.toString())},u.expand=function(t,e){var u=e[this.index];if(!u)throw new Error("Parameter missing: "+this.index);return u},e}(Ht);function Be(t,e,u){return e===t._false||e===t.zero||u==t._false||u==t.zero?t._false:e===t._true||e===t.one?u:u===t._true||u===t.one?e:new Qt(t,e,u)}function ye(t,e,u){return e===t.zero?u:u===t.zero?e:new se(t,e,u)}function we(t,e,u){return e===t.zero?new $t(t,u):u===t.zero?e:new le(t,e,u)}function Ne(t,e,u){return e===t.zero||u===t.zero?t.zero:e===t.one?u:u===t.one?e:new De(t,e,u)}function be(t,e,u){return e===t.zero?t.zero:u===t.one?e:new he(t,e,u)}var Se=function(){function t(){}var e=t.prototype;return e.visitValues=function(t){for(var e=0;e0){var r;null==(r=e[0])||r.appendTo(t,n);for(var o=1;o2&&t.startsWith("--")}var lu=function(t,e,u,n){this.x1=void 0,this.y1=void 0,this.x2=void 0,this.y2=void 0,this.x1=t,this.y1=e,this.x2=u,this.y2=n},Du=function(t,e){this.x=void 0,this.y=void 0,this.x=t,this.y=e},hu=function(t,e,u,n){this.left=void 0,this.top=void 0,this.right=void 0,this.bottom=void 0,this.left=t,this.top=e,this.right=u,this.bottom=n},cu=function(t,e,u,n){this.low=void 0,this.high=void 0,this.winding=void 0,this.shapeId=void 0,this.low=t,this.high=e,this.winding=u,this.shapeId=n},du=function(t,e,u,n){this.y1=void 0,this.y2=void 0,this.x1=void 0,this.x2=void 0,this.left=null,this.right=null,this.y1=t,this.y2=e,this.x1=u,this.x2=n};function fu(t,e){return t.low.y-e.low.y||t.low.x-e.low.x}var pu=function(){function t(t){this.points=void 0,this.points=t}var e=t.prototype;return e.addSegments=function(t,e){for(var u=this.points,n=u.length,i=u[n-1],r=0;r=n?(o=Au(e,n),a=e.winding):(o=e.high.x,a=0),i=0;){var i=n;((n=e[u]).y2-n.y1<1||n.x1==i.x1&&n.x2==i.x2)&&(i.y1=n.y1,e.splice(u,1),n=i),u--}}function bu(t,e){for(var u=0,n=t.length;u=t[i].y2?u=i+1:n=i}return u}function Su(t,e){if(!t.length)return e;var u,n,i=e.y1;for(n=0;ne.y1&&u.x1-.1<=e.x1&&u.x2+.1>=e.x2);n++)i=Math.max(i,u.y2);for(var r=i;n=e.y2||u.x1-.1>e.x1||u.x2+.1=0&&(u=t[n],!(n===t.length-1&&u.y2=e.x2);n--)i=Math.min(i,u.y1);for(var r=Math.min(i,u.y2);n>=0&&!((u=t[n]).y2<=e.y1||u.x1-.1>e.x1||u.x2+.10){var o=[];switch(this.coords.forEach((function(t,e){if("%"==t.unit){var a=e%2==0?u:n;3==e&&"circle"==r.name&&(a=Math.sqrt((u*u+n*n)/2)),o.push(t.num*a/100)}else o.push(t.num*i.queryUnitSize(t.unit,!1))})),this.name){case"polygon":if(o.length%2==0){for(var a=[],s=0;s0?i[c-1]:-1,p=ca)break;if(d>=o){if(s<0&&(s=d,h=-1),l<0)if(d===o)l=d;else{fa||p<0)&&(s=l=D=h=d)}return n[{first:s,start:l,last:D,"first-except":h}[u]]||""},e.setNamedString=function(t,e,u){(this.namedStringValues[t]||(this.namedStringValues[t]={}))[u]=e},e.setRunningElement=function(t,e){(this.runningElements[t]||(this.runningElements[t]={}))[e]=String(e)},t}(),Gu=function(){function t(t){this.documentURLTransformer=void 0,this.countersById={},this.pageCountersById={},this.currentPageCounters={},this.previousPageCounters={},this.currentPageCountersStack=[],this.pageIndicesById={},this.currentPage=null,this.newReferencesOfCurrentPage=[],this.referencesToSolve=[],this.referencesToSolveStack=[],this.unresolvedReferences={},this.resolvedReferences={},this.pagesCounterExprs=[],this.pageCounterExprs=[],this.documentURLTransformer=t,this.currentPageCounters.page=[0]}var e=t.prototype;return e.createCounterListener=function(t){return new Hu(this,t)},e.createCounterResolver=function(t,e,u){return new zu(this,t,e,u)},e.setCurrentPage=function(t){this.currentPage=t},e.definePageCounter=function(t,e){this.currentPageCounters[t]?this.currentPageCounters[t].push(e):this.currentPageCounters[t]=[e]},e.forceSetPageCounter=function(t){var e=this.currentPageCounters.page;e&&e.length?e[e.length-1]=t:this.currentPageCounters.page=[t]},e.updatePageCounters=function(t,e){var u;this.previousPageCounters=Mu(this.currentPageCounters);var n,i=t["counter-reset"];if(i){var r=i.evaluate(e);r&&(u=Ou(r,!0))}if(u)for(var o in u)this.definePageCounter(o,u[o]);var a=t["counter-increment"];if(a){var s=a.evaluate(e);s&&(n=Ou(s,!1))}for(var l in n?"page"in n||(n.page=1):(n={}).page=1,n){this.currentPageCounters[l]||this.definePageCounter(l,0);var D=this.currentPageCounters[l];D[D.length-1]+=n[l]}},e.pushPageCounters=function(t){this.currentPageCountersStack.push(this.currentPageCounters),this.currentPageCounters=Mu(t)},e.popPageCounters=function(){this.currentPageCounters=this.currentPageCountersStack.pop()},e.resolveReference=function(t){var e=this.unresolvedReferences[t],u=this.resolvedReferences[t];u||(u=this.resolvedReferences[t]=[]);for(var n=!1,i=0;i=0&&e.splice(o,1)}u.push(r),n=!0}else i++}n||this.saveReferenceOfCurrentPage(t,!0)},e.saveReferenceOfCurrentPage=function(t,e){if(!this.newReferencesOfCurrentPage.some((function(e){return e.targetId===t}))){var u=new Vu(t,e);this.newReferencesOfCurrentPage.push(u)}},e.finishPage=function(t,e){var u=this,n=Object.keys(this.currentPage.elementsById);if(n.length>0){var i=Mu(this.currentPageCounters);n.forEach((function(n){u.pageCountersById[n]=i;var r=u.pageIndicesById[n];if(r&&r.pageIndex=0,a=!o&&this.pageCounterExprs.findIndex((function(e){return e.expr===t}))>=0;if(o||a){var s=u.createElementNS(W.XHTML,"span");return s.textContent=e,s.setAttribute(o?Wu:Xu,t.key),s}return null},e.fixPageCounterInRunningElement=function(t){for(var e,u=this,n=function(){var t=e.value,n=t.getAttribute(Xu),i=u.pageCounterExprs.find((function(t){return t.expr.key===n})),r=(null==i?void 0:i.expr).str,o=null==r?void 0:r.replace(/^page-counters?-/,""),a=u.currentPageCounters[o];a&&(t.textContent=i.format(a))},i=O(t.querySelectorAll("["+Xu+"]"));!(e=i()).done;)n()},e.finishLastPage=function(t){for(var e,u=this,n=t.root.querySelectorAll("["+Wu+"]"),i=this.currentPageCounters.page[0],r=function(){var t=e.value,n=t.getAttribute(Wu),r=u.pagesCounterExprs.findIndex((function(t){return t.expr.key===n}));t.textContent=u.pagesCounterExprs[r].format([i])},o=O(n);!(e=o()).done;)r()},e.createLayoutConstraint=function(t){return new ju(this,t)},t}(),Wu="data-vivliostyle-pages-counter",Xu="data-vivliostyle-page-counter",ju=function(){function t(t,e){this.counterStore=void 0,this.pageIndex=void 0,this.counterStore=t,this.pageIndex=e}return t.prototype.allowLayout=function(t){if(!t||t.after)return!0;var e=t.viewNode;if(!e||1!==e.nodeType)return!0;var u=e.getAttribute("data-vivliostyle-id")||e.getAttribute("id")||e.getAttribute("name");if(!u)return!0;if(!this.counterStore.resolvedReferences[u]&&!this.counterStore.unresolvedReferences[u])return!0;var n=this.counterStore.pageIndicesById[u];return!n||this.pageIndex>=n.pageIndex},t}();function Ku(t){if((t=t.substr(1)).match(/^[^0-9a-fA-F\n\r]$/))return t;var e=parseInt(t,16);return isNaN(e)?"":0===e||e>=55296&&e<=57343||e>1114111?"�":String.fromCodePoint(e)}function Yu(t){return t.replace(/\\([0-9a-fA-F]{1,6}(\r\n|[ \n\r\t\f])?|[^0-9a-fA-F\n\r])/g,Ku)}!function(t){t[t.EOF=0]="EOF",t[t.IDENT=1]="IDENT",t[t.STR=2]="STR",t[t.NUMERIC=3]="NUMERIC",t[t.NUM=4]="NUM",t[t.INT=5]="INT",t[t.FUNC=6]="FUNC",t[t.HASH=7]="HASH",t[t.URL=8]="URL",t[t.CLASS=9]="CLASS",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.O_BRC=12]="O_BRC",t[t.C_BRC=13]="C_BRC",t[t.O_BRK=14]="O_BRK",t[t.C_BRK=15]="C_BRK",t[t.COMMA=16]="COMMA",t[t.SEMICOL=17]="SEMICOL",t[t.COLON=18]="COLON",t[t.SLASH=19]="SLASH",t[t.AT=20]="AT",t[t.PERCENT=21]="PERCENT",t[t.QMARK=22]="QMARK",t[t.PLUS=23]="PLUS",t[t.MINUS=24]="MINUS",t[t.BAR_BAR=25]="BAR_BAR",t[t.AMP_AMP=26]="AMP_AMP",t[t.URANGE=27]="URANGE",t[t.BANG=31]="BANG",t[t.DOLLAR=32]="DOLLAR",t[t.HAT=33]="HAT",t[t.BAR=34]="BAR",t[t.TILDE=35]="TILDE",t[t.STAR=36]="STAR",t[t.GT=37]="GT",t[t.LT=38]="LT",t[t.EQ=39]="EQ",t[t.BANG_EQ=41]="BANG_EQ",t[t.DOLLAR_EQ=42]="DOLLAR_EQ",t[t.HAT_EQ=43]="HAT_EQ",t[t.BAR_EQ=44]="BAR_EQ",t[t.TILDE_EQ=45]="TILDE_EQ",t[t.STAR_EQ=46]="STAR_EQ",t[t.GT_EQ=47]="GT_EQ",t[t.LT_EQ=48]="LT_EQ",t[t.EQ_EQ=49]="EQ_EQ",t[t.COL_COL=50]="COL_COL",t[t.CDO=51]="CDO",t[t.CDC=52]="CDC",t[t.UNKNOWN=53]="UNKNOWN",t[t.INVALID=54]="INVALID",t[t.LAST=54]="LAST"}(Uu||(Uu={}));var qu,$u=function(){function t(){this.type=void 0,this.precededBySpace=!1,this.num=0,this.text="",this.position=0,this.type=Uu.EOF}return t.prototype.toString=function(){switch(this.type){case Uu.O_PAR:return"(";case Uu.C_PAR:return")";case Uu.O_BRC:return"{";case Uu.C_BRC:return"}";case Uu.O_BRK:return"[";case Uu.C_BRK:return"]";case Uu.COMMA:return",";case Uu.SEMICOL:return";";case Uu.COLON:return":";case Uu.SLASH:return"/";case Uu.PERCENT:return"%";case Uu.QMARK:return"?";case Uu.PLUS:return"+";case Uu.MINUS:return"-";case Uu.BAR_BAR:return"||";case Uu.AMP_AMP:return"&&";case Uu.BANG:return"!";case Uu.DOLLAR:return"$";case Uu.HAT:return"^";case Uu.BAR:return"|";case Uu.TILDE:return"~";case Uu.STAR:return"*";case Uu.GT:return">";case Uu.LT:return"<";case Uu.EQ:return"=";case Uu.BANG_EQ:return"!=";case Uu.DOLLAR_EQ:return"$=";case Uu.HAT_EQ:return"^=";case Uu.BAR_EQ:return"|=";case Uu.TILDE_EQ:return"~=";case Uu.STAR_EQ:return"*=";case Uu.GT_EQ:return">=";case Uu.LT_EQ:return"<=";case Uu.EQ_EQ:return"==";case Uu.COL_COL:return"::";case Uu.CDO:return"\x3c!--";case Uu.CDC:return"--\x3e";case Uu.NUMERIC:return this.num.toString()+this.text;case Uu.NUM:case Uu.INT:return this.num.toString();case Uu.AT:return"@"+this.text;case Uu.HASH:return"#"+this.text;case Uu.FUNC:return this.text+"(";case Uu.CLASS:return"."+this.text;case Uu.EOF:return"/*EOF*/";default:return this.text}},t}();function Qu(t,e){var u,n=Array(128);for(u=0;u<128;u++)n[u]=t;for(n.NaN=t==qu.END?qu.END:qu.INVALID,u=0;u=e?e+=u:e--,e==t)throw new Error("F_CSSTOK_INTERNAL");for(var n=Zu,i=this.input,r=this.position,o=this.buffer,a=Uu.EOF,s=0,l="",D=0,h=!1,c=o[t],d=-9;;){var f=i.charCodeAt(r);switch(n[f]||n[65]){case qu.INVALID:l=i.substring(s,r),a=isNaN(f)?Uu.EOF:Uu.INVALID,n=Zu;break;case qu.SPACE:r++,h=!0;continue;case qu.INT:s=r++,n=nn;continue;case qu.IDENT:a=Uu.IDENT,s=r++,n=Ju;continue;case qu.BANG:s=r++,a=Uu.BANG,n=an;continue;case qu.STR1:a=Uu.STR,s=++r,n=An;continue;case qu.STR2:a=Uu.STR,s=++r,n=gn;continue;case qu.HASH:s=++r,a=Uu.HASH,n=Ju;continue;case qu.DOLLAR:s=r++,a=Uu.DOLLAR,n=an;continue;case qu.PERCENT:s=r++,a=Uu.PERCENT;break;case qu.AMP:s=r++,a=Uu.DOLLAR,n=Dn;continue;case qu.O_PAR:s=r++,a=Uu.O_PAR;break;case qu.C_PAR:s=r++,a=Uu.C_PAR;break;case qu.STAR:s=r++,a=Uu.STAR,n=an;continue;case qu.PLUS:s=r++,a=Uu.PLUS;break;case qu.COMMA:s=r++,a=Uu.COMMA;break;case qu.MINUS:a=Uu.MINUS,s=r++,n=en;continue;case qu.DOT:s=r++,n=tn;continue;case qu.TOCLASS:s=r++,a=Uu.CLASS,n=Ju;continue;case qu.SLASH:s=r++,a=Uu.SLASH,n=hn;continue;case qu.COLON:s=r++,a=Uu.COLON,n=sn;continue;case qu.COL_COL:r++,a=Uu.COL_COL;break;case qu.SEMICOL:s=r++,a=Uu.SEMICOL;break;case qu.LT:s=r++,a=Uu.LT,n=pn;continue;case qu.EQ:s=r++,a=Uu.EQ,n=an;continue;case qu.GT:s=r++,a=Uu.GT,n=an;continue;case qu.QMARK:s=r++,a=Uu.QMARK;break;case qu.AT:s=++r,a=Uu.AT,n=Ju;continue;case qu.O_BRK:s=r++,a=Uu.O_BRK;break;case qu.C_BRK:s=r++,a=Uu.C_BRK;break;case qu.O_BRC:s=r++,a=Uu.O_BRC;break;case qu.C_BRC:s=r++,a=Uu.C_BRC;break;case qu.BSLASH:d=s=r++,a=Uu.IDENT,n=Fn;continue;case qu.HAT:s=r++,a=Uu.HAT,n=an;continue;case qu.BAR:s=r++,a=Uu.BAR,n=ln;continue;case qu.TILDE:s=r++,a=Uu.TILDE,n=an;continue;case qu.END:break;case qu.EQTAIL:r++,a=a+Uu.BANG_EQ-Uu.BANG;break;case qu.ENDINT:a=Uu.INT,D=parseInt(i.substring(s,r),10);break;case qu.ENDNUM:a=Uu.NUM,D=parseFloat(i.substring(s,r));break;case qu.CONT:r++;continue;case qu.UNIT:a=Uu.NUMERIC,D=parseFloat(i.substring(s,r)),s=r++,n=Ju;continue;case qu.PCUNIT:a=Uu.NUMERIC,D=parseFloat(i.substring(s,r)),l="%",s=r++;break;case qu.NUMBER:r++,n=rn;continue;case qu.ENDIDNT:if(l=Yu(i.substring(s,r)),a===Uu.URANGE&&63===f||a===Uu.IDENT&&"u"===l.toLowerCase()&&/^(\bu\+[?0-9a-f]+(-[?0-9a-f]+)?|,|\s+|\/\*([^*]|\*[^/])*\*\/)+[;}]/i.test(i.substring(r-1))){a=Uu.URANGE,r++;continue}break;case qu.IDNTESC:d=r++,n=Fn;continue;case qu.ENDIDES:l=Yu(i.substring(s,r));break;case qu.ENDSTR:l=i.substring(s,r),r++;break;case qu.ENDESTR:l=Yu(i.substring(s,r)),r++;break;case qu.STR1ESC:d=r,r+=2,n=vn;continue;case qu.STR2ESC:d=r,r+=2,n=mn;continue;case qu.BAR_BAR:r++,a=Uu.BAR_BAR;break;case qu.AMP_AMP:r++,a=Uu.AMP_AMP;break;case qu.FUNC:if(l=i.substring(s,r),a==Uu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Uu.FUNC}break;case qu.FUNCES:if(l=Yu(i.substring(s,r)),a==Uu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Uu.FUNC}break;case qu.COMMENT:n=cn,r++;continue;case qu.COMMST:n=dn,r++;continue;case qu.ENDNOTK:n=Zu,r++;continue;case qu.MINMIN:n=fn,">"!==i[++r]&&(a=Uu.IDENT,n=Ju);continue;case qu.CDO:a=Uu.CDO,l=i.substring(s,++r),n=Zu;break;case qu.CDC:a=Uu.CDC,l=i.substring(s,++r),n=Zu;break;case qu.TOINT:a=Uu.INT,n=nn,r++;continue;case qu.TONUM:a=Uu.NUM,n=rn,r++;continue;case qu.TOIDENT:a=Uu.IDENT,n=Ju,r++;continue;case qu.TOIDES:a=Uu.IDENT,n=Fn,d=r++;continue;case qu.KILL1:r--;break;case qu.KILL2:r-=2;break;case qu.URL:s=r++,n=yn;continue;case qu.URL1:s=++r,n=wn;continue;case qu.URL2:s=++r,n=Nn;continue;case qu.ENDURL:a=Uu.URL,l=Yu(i.substring(s,r)),r++;break;case qu.FINURL:r++;break;case qu.LT_BG:n=En,r++;continue;case qu.LT_BG_M:n=Cn,r++;continue;case qu.CHKSP:if(r-d<8&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])|[ \t]$/)){r++;continue}case qu.TERMURL:a=Uu.URL,l=Yu(i.substring(s,r)),r++,n=bn;continue;case qu.CHKPOSN:if(++r-d<9&&i.substring(d+1,r).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])$/))continue;a=Uu.INVALID,l="E_CSS_UNEXPECTED_NEWLINE",n=Zu;break;case qu.CHKPOSS:if(r-d<9&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}[ \t]$/)){r++,n=Ju;continue}l=Yu(i.substring(s,r));break;case qu.URLESC:d=r++;continue;case qu.IDESCH:r++,n=un;continue;default:if(n!==Zu){a=Uu.INVALID,l="E_CSS_UNEXPECTED_STATE";break}s=r,a=Uu.EOF}if(c.type=a,c.precededBySpace=h,c.num=D,c.text=l,c.position=s,++t>=e)break;n=Zu,h=!1,c=o[t&u]}this.position=r,this.tail=t&u},t}(),xn=null,Tn=null;function In(){return xn}function Pn(t){if(!xn)throw new Error("E_TASK_NO_CONTEXT");xn.name||(xn.name=t);var e=xn,u=new zn(e,e.top,t);return e.top=u,u.state=on.ACTIVE,u}function Rn(t){return new Vn(t)}function kn(t,e,u){var n=Pn(t);n.handler=u;try{e(n)}catch(t){n.task.raise(t,n)}return n.result()}!function(t){t[t.INIT=0]="INIT",t[t.ACTIVE=1]="ACTIVE",t[t.FINISHED=2]="FINISHED",t[t.DEAD=3]="DEAD"}(on||(on={}));var Ln,On=function(){function t(){}var e=t.prototype;return e.currentTime=function(){return(new Date).valueOf()},e.setTimeout=function(t){function e(e,u){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setTimeout(t,e)})),e.clearTimeout=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){clearTimeout(t)})),t}(),_n=function(){function t(t){this.timer=void 0,this.timeout=1,this.slice=25,this.sliceOverTime=0,this.queue=void 0,this.wakeupTime=null,this.timeoutToken=null,this.inTimeSlice=!1,this.order=0,this.timer=t,this.queue=new $,Tn||(Tn=this)}var e=t.prototype;return e.setSlice=function(t){this.slice=t},e.setTimeout=function(t){this.timeout=t},e.isTimeSliceOver=function(){return this.timer.currentTime()>=this.sliceOverTime},e.arm=function(){var t=this;if(!this.inTimeSlice){var e=this.queue.peek().scheduledTime,u=this.timer.currentTime();if(null!=this.timeoutToken){if(u+this.timeout>this.wakeupTime)return;this.timer.clearTimeout(this.timeoutToken)}var n=e-u;n<=this.timeout&&(n=this.timeout),this.wakeupTime=u+n,this.timeoutToken=this.timer.setTimeout((function(){t.timeoutToken=null,t.doTimeSlice()}),n)}},e.schedule=function(t,e){var u=t,n=this.timer.currentTime();u.order=this.order++,u.scheduledTime=n+(e||0),this.queue.add(u),this.arm()},e.doTimeSlice=function(){null!=this.timeoutToken&&(this.timer.clearTimeout(this.timeoutToken),this.timeoutToken=null),this.inTimeSlice=!0;try{var t=this.timer.currentTime();for(this.sliceOverTime=t+this.slice;this.queue.length();){var e=this.queue.peek();if(e.scheduledTime>t)break;if(this.queue.remove(),e.canceled||e.resumeInternal(),(t=this.timer.currentTime())>=this.sliceOverTime)break}}catch(t){c.error(t)}this.inTimeSlice=!1,this.queue.length()&&this.arm()},e.run=function(t,e){var u=new Un(this,e||"");u.top=new zn(u,null,"bootstrap"),u.top.state=on.ACTIVE,u.top.then((function(){var e=function(){u.running=!1;for(var t,e=O(u.callbacks);!(t=e()).done;){var n=t.value;try{n()}catch(t){c.error(t)}}};try{t().then((function(t){u.result=t,e()}))}catch(t){u.raise(t),e()}}));var n=xn;return xn=u,this.schedule(u.top.suspend("bootstrap")),xn=n,u},t}(),Mn=function(){function t(t){this.task=void 0,this.scheduledTime=0,this.order=0,this.result=null,this.canceled=!1,this.task=t}var e=t.prototype;return e.compare=function(t){return t.scheduledTime-this.scheduledTime||t.order-this.order},e.getTask=function(){return this.task},e.schedule=function(t,e){this.result=t,this.task.scheduler.schedule(this,e)},e.resumeInternal=function(){var t=this.task;if(this.task=null,t&&t.continuation==this){t.continuation=null;var e=xn;return xn=t,t.top.finish(this.result),xn=e,!0}return!1},e.cancel=function(){this.canceled=!0},t}(),Un=function(){function t(t,e){this.scheduler=void 0,this.name=void 0,this.callbacks=[],this.exception=null,this.running=!0,this.result=null,this.waitTarget=null,this.top=null,this.continuation=null,this.scheduler=t,this.name=e}var e=t.prototype;return e.getName=function(){return this.name},e.interrupt=function(t){if(this.raise(t||new Error("E_TASK_INTERRUPT")),this!==xn&&this.continuation){this.continuation.cancel();var e=new Mn(this);this.waitTarget="interrupt",this.continuation=e,this.scheduler.schedule(e)}},e.getScheduler=function(){return this.scheduler},e.isRunning=function(){return this.running},e.whenDone=function(t){this.callbacks.push(t)},e.join=function(){var t=this,e=Pn("Task.join");if(this.running){var u=e.suspend(this);this.whenDone((function(){u.schedule(t.result)}))}else e.finish(this.result);return e.result()},e.unwind=function(){for(;this.top&&!this.top.handler;)this.top=this.top.parent;if(this.top&&this.top.handler&&this.exception){var t=this.exception;this.exception=null,this.top.handler(this.top,t)}else this.exception&&c.error(this.exception,"Unhandled exception in task",this.name)},e.raise=function(t,e){if(this.fillStack(t),e){for(var u=this.top;u&&u!=e;)u=u.parent;u==e&&(this.top=u)}this.exception=t,this.unwind()},e.fillStack=function(t){var e=t.frameTrace;if(!e){e=t.stack?t.stack+"\n\t---- async ---\n":"";for(var u=this.top;u;u=u.parent)e+="\t",e+=u.getName(),e+="\n";t.frameTrace=e}},t}(),Vn=function(){function t(t){this.value=void 0,this.value=t}var e=t.prototype;return e.then=function(t){t(this.value)},e.thenAsync=function(t){return t(this.value)},e.thenReturn=function(e){return new t(e)},e.thenFinish=function(t){t.finish(this.value)},e.isPending=function(){return!1},e.get=function(){return this.value},t}(),Hn=function(){function t(t){this.frame=void 0,this.frame=t}var e=t.prototype;return e.then=function(t){this.frame.then(t)},e.thenAsync=function(t){if(this.isPending()){var e=new zn(this.frame.task,this.frame.parent,"AsyncResult.thenAsync");return e.state=on.ACTIVE,this.frame.parent=e,this.frame.then((function(u){t(u).then((function(t){e.finish(t)}))})),e.result()}return t(this.frame.res)},e.thenReturn=function(t){return this.isPending()?this.thenAsync((function(){return new Vn(t)})):new Vn(t)},e.thenFinish=function(t){this.isPending()?this.then((function(e){t.finish(e)})):t.finish(this.frame.res)},e.isPending=function(){return this.frame.state==on.ACTIVE},e.get=function(){if(this.isPending())throw new Error("Result is pending");return this.frame.res},t}(),zn=function(){function t(t,e,u){this.task=void 0,this.parent=void 0,this.name=void 0,this.res=null,this.state=void 0,this.callback=null,this.handler=null,this.task=t,this.parent=e,this.name=u,this.state=on.INIT}var e=t.prototype;return e.checkEnvironment=function(){if(!xn)throw new Error("F_TASK_NO_CONTEXT");if(this!==xn.top)throw new Error("F_TASK_NOT_TOP_FRAME")},e.result=function(){return new Hn(this)},e.finish=function(t){this.checkEnvironment(),xn&&!xn.exception&&(this.res=t),this.state=on.FINISHED;var e=this.parent;if(xn&&(xn.top=e),this.callback){try{this.callback(t)}catch(t){this.task.raise(t,e)}this.state=on.DEAD}},e.getTask=function(){return this.task},e.getName=function(){return this.name},e.getScheduler=function(){return this.task.scheduler},e.then=function(t){switch(this.state){case on.ACTIVE:if(this.callback)throw new Error("F_TASK_FRAME_ALREADY_HAS_CALLBACK");this.callback=t;break;case on.FINISHED:var e=this.task,u=this.parent;try{t(this.res),this.state=on.DEAD}catch(t){this.state=on.DEAD,e.raise(t,u)}break;case on.DEAD:throw new Error("F_TASK_DEAD_FRAME");default:throw new Error("F_TASK_UNEXPECTED_FRAME_STATE "+this.state)}},e.timeSlice=function(){var t=Pn("Frame.timeSlice");return t.getScheduler().isTimeSliceOver()?(c.debug("-- time slice --"),t.suspend().schedule(!0)):t.finish(!0),t.result()},e.sleep=function(t){var e=Pn("Frame.sleep");return e.suspend().schedule(!0,t),e.result()},e.loop=function(t){var e=Pn("Frame.loop");return function u(n){try{for(;n;){var i=t();if(i.isPending())return void i.then(u);i.then((function(t){n=t}))}e.finish(!0)}catch(t){e.task.raise(t,e)}}(!0),e.result()},e.loopWithFrame=function(t){var e=xn;if(!e)throw new Error("E_TASK_NO_CONTEXT");return this.loop((function(){var u;do{var n=new Gn(e,e.top);e.top=n,n.state=on.ACTIVE,t(n),u=n.result()}while(!u.isPending()&&u.get());return u}))},e.suspend=function(t){if(this.checkEnvironment(),this.task.continuation)throw new Error("E_TASK_ALREADY_SUSPENDED");var e=new Mn(this.task);return this.task.continuation=e,xn=null,this.task.waitTarget=t||null,e},t}(),Gn=function(t){function e(e,u){return t.call(this,e,u,"loop")||this}x(e,t);var u=e.prototype;return u.continueLoop=function(){this.finish(!0)},u.breakLoop=function(){this.finish(!1)},e}(zn),Wn=function(){function t(t,e){this.fetch=void 0,this.name=void 0,this.arrived=!1,this.resource=null,this.task=null,this.piggybacks=[],this.fetch=t,this.name=e}var e=t.prototype;return e.start=function(){var t=this;this.task||(this.task=In().getScheduler().run((function(){var e=Pn("Fetcher.run");return t.fetch().then((function(u){var n=t.piggybacks;if(t.arrived=!0,t.resource=u,t.task=null,t.piggybacks=[],n)for(var i=0;i=400&&e)throw new Error((u||"Failed to fetch required resource: "+t)+" ("+s.status+(s.statusText?" "+s.statusText:"")+")");r?(t+="?viv-toc-box",s.url+="?viv-toc-box"):a&&(s.url=t=o),n.parser(s,n).then((function(e){delete n.fetchers[t],n.resources[t]=e,i.finish(e)}))})),i.result()},e.fetch=function(t,e,u){var n=this;if(t=H(t),this.resources[t])return null;var i=this.fetchers[t];return i||(i=new Wn((function(){return n.fetchInner(t,e,u)}),"Fetch "+t),this.fetchers[t]=i,i.start()),i},e.get=function(t){return this.resources[H(t)]},e.delete=function(t){delete this.resources[H(t)]},t}();function ni(t,e){var u=t.responseText;return Rn(u?V(u):null)}function ii(t,e){var u=new Wn((function(){var u=Pn("loadElement"),n=u.suspend(t),i=!1,r=function(t){i||(i=!0,n.schedule(t?t.type:"timeout"))};return t.addEventListener("load",r,!1),t.addEventListener("error",r,!1),t.addEventListener("abort",r,!1),t.namespaceURI==W.SVG?(e&&t.setAttributeNS(W.XLINK,"xlink:href",e),setTimeout(r,300)):"script"===t.localName?setTimeout(r,3e3):e&&(t.src=e),u.result()}),"loadElement "+(e||t.localName));return u.start(),u}var ri,oi=33554432,ai=50331648,si=67108864;!function(t){t.USER_AGENT="UA",t.USER="User",t.AUTHOR="Author"}(ri||(ri={}));var li,Di=function(){function t(t){this.scope=void 0,this.flavor=void 0,this.scope=t,this.flavor=ri.AUTHOR}var e=t.prototype;return e.getCurrentToken=function(){return null},e.getScope=function(){return this.scope},e.error=function(t,e){},e.startStylesheet=function(t){this.flavor=t},e.tagSelector=function(t,e){},e.classSelector=function(t){},e.pseudoclassSelector=function(t,e){},e.pseudoelementSelector=function(t,e){},e.idSelector=function(t){},e.attributeSelector=function(t,e,u,n){},e.descendantSelector=function(){},e.childSelector=function(){},e.adjacentSiblingSelector=function(){},e.followingSiblingSelector=function(){},e.nextSelector=function(){},e.startSelectorRule=function(){},e.startFontFaceRule=function(){},e.startFootnoteRule=function(t){},e.startViewportRule=function(){},e.startDefineRule=function(){},e.startRegionRule=function(){},e.startPageRule=function(){},e.startPageMarginBoxRule=function(t){},e.startWhenRule=function(t){},e.startMediaRule=function(t){this.startWhenRule(t)},e.startFlowRule=function(t){},e.startPageTemplateRule=function(){},e.startPageMasterRule=function(t,e,u){},e.startPartitionRule=function(t,e,u){},e.startPartitionGroupRule=function(t,e,u){},e.startRuleBody=function(){},e.property=function(t,e,u){},e.endRule=function(){},e.startFuncWithSelector=function(t){},e.endFuncWithSelector=function(){},e.pushSelectorText=function(t){},e.getImportantSpecificity=function(){switch(this.flavor){case ri.USER_AGENT:return 0;case ri.USER:return 100663296;default:return 83886080}},e.getBaseSpecificity=function(){switch(this.flavor){case ri.USER_AGENT:return 0;case ri.USER:return 16777216;default:return oi}},t}(),hi=function(t){function e(){var e;return(e=t.call(this,null)||this).stack=[],e.tokenizer=null,e.slave=null,e}x(e,t);var u=e.prototype;return u.pushHandler=function(t){this.stack.push(this.slave),this.slave=t},u.popHandler=function(){this.slave=this.stack.pop()},u.getCurrentToken=function(){return this.tokenizer?this.tokenizer.token():null},u.getScope=function(){return this.slave.getScope()},u.error=function(t,e){this.slave.error(t,e)},u.errorMsg=function(t,e){var u;c.warn(t,null!=(u=null==e?void 0:e.toString())?u:"")},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.stack.length>0&&(this.slave=this.stack[0],this.stack=[]),this.slave.startStylesheet(e)},u.tagSelector=function(t,e){this.slave.tagSelector(t,e)},u.classSelector=function(t){this.slave.classSelector(t)},u.pseudoclassSelector=function(t,e){this.slave.pseudoclassSelector(t,e)},u.pseudoelementSelector=function(t,e){this.slave.pseudoelementSelector(t,e)},u.idSelector=function(t){this.slave.idSelector(t)},u.attributeSelector=function(t,e,u,n){this.slave.attributeSelector(t,e,u,n)},u.descendantSelector=function(){this.slave.descendantSelector()},u.childSelector=function(){this.slave.childSelector()},u.adjacentSiblingSelector=function(){this.slave.adjacentSiblingSelector()},u.followingSiblingSelector=function(){this.slave.followingSiblingSelector()},u.nextSelector=function(){this.slave.nextSelector()},u.startSelectorRule=function(){this.slave.startSelectorRule()},u.startFontFaceRule=function(){this.slave.startFontFaceRule()},u.startFootnoteRule=function(t){this.slave.startFootnoteRule(t)},u.startViewportRule=function(){this.slave.startViewportRule()},u.startDefineRule=function(){this.slave.startDefineRule()},u.startRegionRule=function(){this.slave.startRegionRule()},u.startPageRule=function(){this.slave.startPageRule()},u.startPageMarginBoxRule=function(t){this.slave.startPageMarginBoxRule(t)},u.startWhenRule=function(t){this.slave.startWhenRule(t)},u.startFlowRule=function(t){this.slave.startFlowRule(t)},u.startPageTemplateRule=function(){this.slave.startPageTemplateRule()},u.startPageMasterRule=function(t,e,u){this.slave.startPageMasterRule(t,e,u)},u.startPartitionRule=function(t,e,u){this.slave.startPartitionRule(t,e,u)},u.startPartitionGroupRule=function(t,e,u){this.slave.startPartitionGroupRule(t,e,u)},u.startRuleBody=function(){this.slave.startRuleBody()},u.property=function(t,e,u){this.slave.property(t,e,u)},u.endRule=function(){this.slave.endRule()},u.startFuncWithSelector=function(t){this.slave.startFuncWithSelector(t)},u.endFuncWithSelector=function(){this.slave.endFuncWithSelector()},u.pushSelectorText=function(t){this.slave.pushSelectorText(t)},e}(Di),ci=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).owner=void 0,i.topLevel=void 0,i.depth=0,i.owner=u,i.topLevel=n,u&&(i.flavor=u.flavor),i}x(e,t);var u=e.prototype;return u.getCurrentToken=function(){return this.owner.getCurrentToken()},u.error=function(t,e){this.owner.errorMsg(t,e)},u.startRuleBody=function(){this.depth++},u.endRule=function(){0!=--this.depth||this.topLevel||this.owner.popHandler()},e}(Di),di=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.report=function(t){this.error(t,this.getCurrentToken())},u.reportAndSkip=function(t){this.report(t),this.owner.pushHandler(new ci(this.scope,this.owner,!1))},u.startSelectorRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR")},u.startFontFaceRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_FONT_FACE")},u.startFootnoteRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FOOTNOTE")},u.startViewportRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_VIEWPORT")},u.startDefineRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_DEFINE")},u.startRegionRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_REGION")},u.startPageRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE")},u.startWhenRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_WHEN")},u.startFlowRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FLOW")},u.startPageTemplateRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_TEMPLATE")},u.startPageMasterRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_MASTER")},u.startPartitionRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION")},u.startPartitionGroupRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION_GROUP")},u.startFuncWithSelector=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR_FUNC")},u.endFuncWithSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_END_SELECTOR_FUNC")},u.property=function(t,e,u){this.error("E_CSS_UNEXPECTED_PROPERTY",this.getCurrentToken())},e}(ci),fi=[],pi=[],Ei=[],Ci=[],Fi=[],Ai=[],gi=[],vi=[],mi=[],Bi=[],yi=[],wi=[],Ni=[];!function(t){t[t.SELECTOR_NAME_1=1]="SELECTOR_NAME_1",t[t.SELECTOR_NAME=2]="SELECTOR_NAME",t[t.SELECTOR_ANY_1=3]="SELECTOR_ANY_1",t[t.SELECTOR_ANY=4]="SELECTOR_ANY",t[t.SELECTOR_ID_1=5]="SELECTOR_ID_1",t[t.SELECTOR_ID=6]="SELECTOR_ID",t[t.SELECTOR_CLASS_1=7]="SELECTOR_CLASS_1",t[t.SELECTOR_CLASS=8]="SELECTOR_CLASS",t[t.SELECTOR_ATTR_1=9]="SELECTOR_ATTR_1",t[t.SELECTOR_ATTR=10]="SELECTOR_ATTR",t[t.SELECTOR_CHILD=11]="SELECTOR_CHILD",t[t.SELECTOR_SIBLING=12]="SELECTOR_SIBLING",t[t.SELECTOR_BODY=13]="SELECTOR_BODY",t[t.SELECTOR_PSEUDOCLASS=14]="SELECTOR_PSEUDOCLASS",t[t.VAL_IDENT=15]="VAL_IDENT",t[t.VAL_HASH=16]="VAL_HASH",t[t.VAL_NUM=17]="VAL_NUM",t[t.VAL_INT=18]="VAL_INT",t[t.VAL_NUMERIC=19]="VAL_NUMERIC",t[t.VAL_STR=20]="VAL_STR",t[t.VAL_URL=21]="VAL_URL",t[t.VAL_COMMA=22]="VAL_COMMA",t[t.VAL_SLASH=23]="VAL_SLASH",t[t.VAL_FUNC=24]="VAL_FUNC",t[t.VAL_C_PAR=25]="VAL_C_PAR",t[t.VAL_END=26]="VAL_END",t[t.RULE_END=27]="RULE_END",t[t.IDENT=28]="IDENT",t[t.SELECTOR_START=29]="SELECTOR_START",t[t.AT=30]="AT",t[t.EXPR_IDENT=31]="EXPR_IDENT",t[t.EXPR_NUM=32]="EXPR_NUM",t[t.EXPR_NUMERIC=33]="EXPR_NUMERIC",t[t.EXPR_STR=34]="EXPR_STR",t[t.EXPR_PARAM=35]="EXPR_PARAM",t[t.EXPR_PREFIX=36]="EXPR_PREFIX",t[t.EXPR_INFIX=37]="EXPR_INFIX",t[t.EXPR_FUNC=38]="EXPR_FUNC",t[t.EXPR_C_PAR=39]="EXPR_C_PAR",t[t.EXPR_O_PAR=40]="EXPR_O_PAR",t[t.SELECTOR_NEXT=41]="SELECTOR_NEXT",t[t.SELECTOR_PSEUDOELEM=42]="SELECTOR_PSEUDOELEM",t[t.EXPR_O_BRC=43]="EXPR_O_BRC",t[t.VAL_FINISH=44]="VAL_FINISH",t[t.EXPR_INFIX_NAME=45]="EXPR_INFIX_NAME",t[t.PROP=46]="PROP",t[t.VAL_BANG=47]="VAL_BANG",t[t.VAL_BRC=48]="VAL_BRC",t[t.EXPR_SEMICOL=49]="EXPR_SEMICOL",t[t.ERROR_PUSH=50]="ERROR_PUSH",t[t.ERROR_POP=51]="ERROR_POP",t[t.ERROR_POP_DECL=52]="ERROR_POP_DECL",t[t.ERROR_SEMICOL=53]="ERROR_SEMICOL",t[t.VAL_PLUS=54]="VAL_PLUS",t[t.SELECTOR_PSEUDOCLASS_1=55]="SELECTOR_PSEUDOCLASS_1",t[t.SELECTOR_FOLLOWING_SIBLING=56]="SELECTOR_FOLLOWING_SIBLING",t[t.VAL_URANGE=57]="VAL_URANGE",t[t.SELECTOR_PSEUDOELEM_1=58]="SELECTOR_PSEUDOELEM_1",t[t.DONE=200]="DONE"}(li||(li={}));var bi,Si=Uu.LAST+1,xi=Uu.LAST+2,Ti=Uu.LAST+3;fi[Uu.IDENT]=li.IDENT,fi[Uu.STAR]=li.SELECTOR_START,fi[Uu.HASH]=li.SELECTOR_START,fi[Uu.CLASS]=li.SELECTOR_START,fi[Uu.O_BRK]=li.SELECTOR_START,fi[Uu.COLON]=li.SELECTOR_START,fi[Uu.COL_COL]=li.SELECTOR_START,fi[Uu.AT]=li.AT,fi[Uu.C_BRC]=li.RULE_END,fi[Uu.EOF]=li.DONE,pi[Uu.IDENT]=li.PROP,pi[Uu.EOF]=li.DONE,Ai[Uu.IDENT]=li.SELECTOR_NAME,Ai[Uu.STAR]=li.SELECTOR_ANY,Ai[Uu.HASH]=li.SELECTOR_ID,Ai[Uu.CLASS]=li.SELECTOR_CLASS,Ai[Uu.O_BRK]=li.SELECTOR_ATTR,Ai[Uu.COLON]=li.SELECTOR_PSEUDOCLASS,Ai[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM,Ei[Uu.GT]=li.SELECTOR_CHILD,Ei[Uu.PLUS]=li.SELECTOR_SIBLING,Ei[Uu.TILDE]=li.SELECTOR_FOLLOWING_SIBLING,Ei[Uu.IDENT]=li.SELECTOR_NAME_1,Ei[Uu.STAR]=li.SELECTOR_ANY_1,Ei[Uu.HASH]=li.SELECTOR_ID_1,Ei[Uu.CLASS]=li.SELECTOR_CLASS_1,Ei[Uu.O_BRK]=li.SELECTOR_ATTR_1,Ei[Uu.O_BRC]=li.SELECTOR_BODY,Ei[Uu.COLON]=li.SELECTOR_PSEUDOCLASS_1,Ei[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM_1,Ei[Uu.COMMA]=li.SELECTOR_NEXT,Ci[Uu.GT]=li.SELECTOR_CHILD,Ci[Uu.PLUS]=li.SELECTOR_SIBLING,Ci[Uu.TILDE]=li.SELECTOR_FOLLOWING_SIBLING,Ci[Uu.IDENT]=li.SELECTOR_NAME_1,Ci[Uu.STAR]=li.SELECTOR_ANY_1,Ci[Uu.HASH]=li.SELECTOR_ID_1,Ci[Uu.CLASS]=li.SELECTOR_CLASS_1,Ci[Uu.O_BRK]=li.SELECTOR_ATTR_1,Ci[Uu.COLON]=li.SELECTOR_PSEUDOCLASS_1,Fi[Uu.IDENT]=li.SELECTOR_NAME,Fi[Uu.STAR]=li.SELECTOR_ANY,Fi[Uu.HASH]=li.SELECTOR_ID,Fi[Uu.CLASS]=li.SELECTOR_CLASS,Fi[Uu.COLON]=li.SELECTOR_PSEUDOCLASS,Fi[Uu.COL_COL]=li.SELECTOR_PSEUDOELEM,Fi[Uu.O_BRK]=li.SELECTOR_ATTR,Fi[Uu.O_BRC]=li.SELECTOR_BODY,gi[Uu.IDENT]=li.VAL_IDENT,gi[Uu.HASH]=li.VAL_HASH,gi[Uu.NUM]=li.VAL_NUM,gi[Uu.INT]=li.VAL_INT,gi[Uu.NUMERIC]=li.VAL_NUMERIC,gi[Uu.STR]=li.VAL_STR,gi[Uu.URL]=li.VAL_URL,gi[Uu.URANGE]=li.VAL_URANGE,gi[Uu.COMMA]=li.VAL_COMMA,gi[Uu.SLASH]=li.VAL_SLASH,gi[Uu.FUNC]=li.VAL_FUNC,gi[Uu.C_PAR]=li.VAL_C_PAR,gi[Uu.SEMICOL]=li.VAL_END,gi[Uu.C_BRC]=li.VAL_BRC,gi[Uu.BANG]=li.VAL_BANG,gi[Uu.PLUS]=li.VAL_PLUS,gi[Uu.EOF]=li.VAL_FINISH,vi[Uu.IDENT]=li.EXPR_IDENT,vi[Uu.NUM]=li.EXPR_NUM,vi[Uu.INT]=li.EXPR_NUM,vi[Uu.NUMERIC]=li.EXPR_NUMERIC,vi[Uu.STR]=li.EXPR_STR,vi[Uu.O_PAR]=li.EXPR_O_PAR,vi[Uu.FUNC]=li.EXPR_FUNC,vi[Uu.BANG]=li.EXPR_PREFIX,vi[Uu.MINUS]=li.EXPR_PREFIX,vi[Uu.DOLLAR]=li.EXPR_PARAM,mi[Uu.IDENT]=li.EXPR_INFIX_NAME,mi[Uu.COMMA]=li.EXPR_INFIX,mi[Uu.GT]=li.EXPR_INFIX,mi[Uu.LT]=li.EXPR_INFIX,mi[Uu.GT_EQ]=li.EXPR_INFIX,mi[Uu.LT_EQ]=li.EXPR_INFIX,mi[Uu.EQ]=li.EXPR_INFIX,mi[Uu.EQ_EQ]=li.EXPR_INFIX,mi[Uu.BANG_EQ]=li.EXPR_INFIX,mi[Uu.AMP_AMP]=li.EXPR_INFIX,mi[Uu.BAR_BAR]=li.EXPR_INFIX,mi[Uu.PLUS]=li.EXPR_INFIX,mi[Uu.MINUS]=li.EXPR_INFIX,mi[Uu.SLASH]=li.EXPR_INFIX,mi[Uu.PERCENT]=li.EXPR_INFIX,mi[Uu.STAR]=li.EXPR_INFIX,mi[Uu.COLON]=li.EXPR_INFIX,mi[Uu.QMARK]=li.EXPR_INFIX,mi[Uu.C_PAR]=li.EXPR_C_PAR,mi[Uu.O_BRC]=li.EXPR_O_BRC,mi[Uu.SEMICOL]=li.EXPR_SEMICOL,Bi[Uu.EOF]=li.DONE,Bi[Uu.O_BRC]=li.ERROR_PUSH,Bi[Uu.C_BRC]=li.ERROR_POP,Bi[Uu.O_BRK]=li.ERROR_PUSH,Bi[Uu.C_BRK]=li.ERROR_POP,Bi[Uu.O_PAR]=li.ERROR_PUSH,Bi[Uu.C_PAR]=li.ERROR_POP,Bi[Uu.SEMICOL]=li.ERROR_SEMICOL,yi[Uu.EOF]=li.DONE,yi[Uu.O_BRC]=li.ERROR_PUSH,yi[Uu.C_BRC]=li.ERROR_POP_DECL,yi[Uu.O_BRK]=li.ERROR_PUSH,yi[Uu.C_BRK]=li.ERROR_POP,yi[Uu.O_PAR]=li.ERROR_PUSH,yi[Uu.C_PAR]=li.ERROR_POP,yi[Uu.SEMICOL]=li.ERROR_SEMICOL,wi[Uu.EOF]=li.DONE,wi[Uu.O_BRC]=li.ERROR_PUSH,wi[Uu.C_BRC]=li.ERROR_POP,wi[Uu.O_BRK]=li.ERROR_PUSH,wi[Uu.C_BRK]=li.ERROR_POP,wi[Uu.O_PAR]=li.ERROR_PUSH,wi[Uu.C_PAR]=li.ERROR_POP,Ni[Uu.C_PAR]=0,Ni[Uu.COMMA]=0,Ni[Uu.QMARK]=1,Ni[Uu.COLON]=1,Ni[Uu.AMP_AMP]=2,Ni[Uu.BAR_BAR]=2,Ni[Uu.LT]=3,Ni[Uu.GT]=3,Ni[Uu.LT_EQ]=3,Ni[Uu.GT_EQ]=3,Ni[Uu.EQ]=3,Ni[Uu.EQ_EQ]=3,Ni[Uu.BANG_EQ]=3,Ni[Uu.PLUS]=4,Ni[Uu.MINUS]=4,Ni[Uu.STAR]=5,Ni[Uu.SLASH]=5,Ni[Uu.PERCENT]=5,Ni[Uu.EOF]=6,Ni[Si]=2,Ni[xi]=2,function(t){t[t.PROP=0]="PROP",t[t.WHEN=1]="WHEN",t[t.MEDIA=2]="MEDIA",t[t.IMPORT=3]="IMPORT",t[t.SUPPORTS=4]="SUPPORTS"}(bi||(bi={}));var Ii=function(){function t(t,e,u,n){this.actions=void 0,this.tokenizer=void 0,this.handler=void 0,this.baseURL=void 0,this.valStack=[],this.namespacePrefixToURI={},this.defaultNamespaceURI=null,this.propName=null,this.propImportant=!1,this.exprContext=void 0,this.result=null,this.importReady=!1,this.importURL=null,this.importCondition=null,this.errorBrackets=[],this.ruleStack=[],this.regionRule=!1,this.pageRule=!1,this.inStyleDeclaration=!1,this.actions=t,this.tokenizer=e,this.handler=u,this.baseURL=n,this.exprContext=bi.MEDIA}var e=t.prototype;return e.extractVals=function(t,e){for(var u=[],n=this.valStack;e1&&n.splice(i+1,o,new je(n.slice(i+1,n.length))),","==t)return null;i++;do{u=n[--i]}while(void 0!==u&&("string"!=typeof u||","==u));if(o=n.length-(i+1),"("==u){")"!=t&&e.type!==Uu.EOF&&(this.handler.error("E_CSS_MISMATCHED_C_PAR",e),this.actions=yi);var a=new Ye(n[i-1],this.extractVals(",",i+1));if(n.splice(i-1,o+2,a),"var"===a.name){var s=a.values[0]instanceof _e&&a.values[0].name;su(s)&&s!==this.propName||(this.handler.error("E_CSS_INVALID_VAR "+a.toString(),e),this.actions=yi)}return a}if(";"!=t||i>=0)return this.handler.error("E_CSS_UNEXPECTED_VAL_END",e),this.actions=yi,null;if(o>1)return new Ke(this.extractVals(",",i+1));var l=n[0];return l instanceof Te?l:l?new $e(l.toString()):Pe},e.exprError=function(t,e){this.actions=this.propName?yi:Bi,c.warn(t,e.toString())},e.exprStackReduce=function(t,e){for(var u,n=this.valStack,i=this.handler,r=n.pop();;){var o=n.pop();if(t==Uu.C_PAR){for(var a=[r];o==Uu.COMMA;)a.unshift(n.pop()),o=n.pop();if("string"==typeof o){if("{"==o){for(;a.length>=2;){var s=a.shift(),l=a.shift(),D=new te(i.getScope(),s,l);a.unshift(D)}return n.push(new qe(a[0])),!0}if("("==o){var h=n.pop(),c=n.pop();r=new Ce(i.getScope(),kt(c,h),a),t=Uu.EOF;continue}}if(o==Uu.O_PAR){r.isMediaName()&&(r=new ge(i.getScope(),r,null)),t=Uu.EOF;continue}}else if("string"==typeof o){n.push(o);break}if(o<0)if(o==-Uu.BANG)r=new Yt(i.getScope(),r);else if(o==-Uu.MINUS)r=new $t(i.getScope(),r);else{if(o!=-Ti)return this.exprError("F_UNEXPECTED_STATE",e),!1;r=new qt(i.getScope(),r)}else{if(Ni[t]>Ni[o]){n.push(o);break}switch(u=n.pop(),o){case Uu.AMP_AMP:r=new Qt(i.getScope(),u,r);break;case Si:r=new Zt(i.getScope(),u,r);break;case xi:r=new ee(i.getScope(),u,r);break;case Uu.BAR_BAR:r=new Jt(i.getScope(),u,r);break;case Uu.LT:r=new ue(i.getScope(),u,r);break;case Uu.GT:r=new ie(i.getScope(),u,r);break;case Uu.LT_EQ:r=new ne(i.getScope(),u,r);break;case Uu.GT_EQ:r=new re(i.getScope(),u,r);break;case Uu.EQ:case Uu.EQ_EQ:r=new oe(i.getScope(),u,r);break;case Uu.BANG_EQ:r=new ae(i.getScope(),u,r);break;case Uu.PLUS:r=new se(i.getScope(),u,r);break;case Uu.MINUS:r=new le(i.getScope(),u,r);break;case Uu.STAR:r=new De(i.getScope(),u,r);break;case Uu.SLASH:r=new he(i.getScope(),u,r);break;case Uu.PERCENT:r=new ce(i.getScope(),u,r);break;case Uu.COLON:if(!(n.length>1))return this.exprError("E_CSS_EXPR_COND",e),!1;switch(n[n.length-1]){case Uu.QMARK:n.pop(),r=new Fe(i.getScope(),n.pop(),u,r);break;case Uu.O_PAR:if(!u.isMediaName())return this.exprError("E_CSS_MEDIA_TEST",e),!1;r=new ge(i.getScope(),u,r)}break;case Uu.QMARK:if(t!=Uu.COLON)return this.exprError("E_CSS_EXPR_COND",e),!1;case Uu.O_PAR:return n.push(u),n.push(o),n.push(r),!1;default:return this.exprError("F_UNEXPECTED_STATE",e),!1}}}return n.push(r),!1},e.readSupportsTest=function(t){var e,u,n=t.type===Uu.FUNC,i=this.tokenizer;if(n)e=t.position+(u=t.text).length+1;else{if(t.type!==Uu.O_PAR)return null;var r=i.nthToken(1),o=i.nthToken(2);if(r.type===Uu.IDENT&&o.type===Uu.COLON)i.consume(),i.consume(),u=r.text,e=o.position+1;else{if(r.type===Uu.O_PAR||r.type===Uu.FUNC||r.type===Uu.IDENT&&"not"===r.text.toLowerCase()&&(o.type===Uu.O_PAR||o.type===Uu.FUNC))return null;e=t.position+1}}for(var a,s=0,l=0;s>=0;)switch(i.consume(),(a=i.token()).type){case Uu.C_PAR:s--;break;case Uu.O_PAR:case Uu.FUNC:s++;break;case Uu.COMMA:0===s&&l++;break;case Uu.EOF:return this.exprError("E_CSS_UNEXPECTED_EOF",a),null}i.consume();var D=n&&"selector"===u&&l>0?"":i.input.substring(e,a.position).trim();return new ve(this.handler.getScope(),u,D,n)},e.readPseudoParams=function(){for(var t=[];;){var e=this.tokenizer.token();switch(e.type){case Uu.IDENT:t.push(e.text);break;case Uu.PLUS:t.push("+");break;case Uu.NUM:case Uu.INT:t.push(e.num);break;default:return t}this.tokenizer.consume()}},e.readNthPseudoParams=function(){var t=!1,e=this.tokenizer.token();if(e.type===Uu.PLUS)t=!0,this.tokenizer.consume(),e=this.tokenizer.token();else if(e.type===Uu.IDENT&&("even"===e.text||"odd"===e.text))return this.tokenizer.consume(),[2,"odd"===e.text?1:0];switch(e.type){case Uu.NUMERIC:if(t&&e.num<0)return null;case Uu.IDENT:if(t&&"-"===e.text.charAt(0))return null;if("n"===e.text||"-n"===e.text){if(t&&e.precededBySpace)return null;var u="-n"===e.text?-1:1;e.type===Uu.NUMERIC&&(u=e.num);var n=0;this.tokenizer.consume();var i=(e=this.tokenizer.token()).type===Uu.MINUS,r=e.type===Uu.PLUS||i;if(r&&(this.tokenizer.consume(),e=this.tokenizer.token()),e.type===Uu.INT){if(1/(n=e.num)==-1/0){if(n=0,r)return null}else if(n<0){if(r)return null}else if(n>=0&&!r)return null;this.tokenizer.consume()}else if(r)return null;return[u,i&&n>0?-n:n]}if("n-"===e.text||"-n-"===e.text){if(t&&e.precededBySpace)return null;var o="-n-"===e.text?-1:1;if(e.type===Uu.NUMERIC&&(o=e.num),this.tokenizer.consume(),(e=this.tokenizer.token()).type===Uu.INT)return e.num<0||1/e.num==-1/0?null:(this.tokenizer.consume(),[o,e.num])}else{var a=e.text.match(/^n(-[0-9]+)$/);if(a)return t&&e.precededBySpace?null:(this.tokenizer.consume(),[e.type===Uu.NUMERIC?e.num:1,parseInt(a[1],10)]);if(a=e.text.match(/^-n(-[0-9]+)$/))return this.tokenizer.consume(),[-1,parseInt(a[1],10)]}return null;case Uu.INT:return t&&(e.precededBySpace||e.num<0)?null:(this.tokenizer.consume(),[0,e.num])}return null},e.makeCondition=function(t,e){var u=this.handler.getScope();if(!u)return null;if(e=e||u._true,t)for(var n,i=O(t.split(/\s+/));!(n=i()).done;)switch(n.value){case"vertical":e=Be(u,e,new Yt(u,new fe(u,"pref-horizontal")));break;case"horizontal":e=Be(u,e,new fe(u,"pref-horizontal"));break;case"day":e=Be(u,e,new Yt(u,new fe(u,"pref-night-mode")));break;case"night":e=Be(u,e,new fe(u,"pref-night-mode"));break;default:e=u._false}return e===u._true?null:new qe(e)},e.isInsidePropertyOnlyRule=function(){switch(this.ruleStack[this.ruleStack.length-1]){case"[selector]":case"font-face":case"-epubx-flow":case"-epubx-viewport":case"-epubx-define":case"-adapt-footnote-area":return!0}return!1},e.runParser=function(t,e,u,n,i,r){var o,a,s,l,D,h,c,d=this.handler,f=this.tokenizer,p=this.valStack,E=null;for(u&&(this.inStyleDeclaration=!0),n&&(this.exprContext=bi.MEDIA,this.valStack.push("{"));t>0;--t)if(o=f.token(),i&&null===E&&"("===f.input[E=o.position-1]&&E++,this.actions===gi&&this.errorBrackets.length>0&&(o.type===this.errorBrackets[this.errorBrackets.length-1]||o.type===Uu.SEMICOL||o.type===Uu.BANG)){if(o.type===this.errorBrackets[this.errorBrackets.length-1]&&(this.errorBrackets.pop(),o.type===Uu.C_PAR&&this.valStackReduce(")",o))){f.consume();continue}p.push(new $e(o.toString())),f.consume()}else switch(this.actions[o.type]){case li.IDENT:if(!this.inStyleDeclaration||f.nthToken(1).type!=Uu.COLON){this.isInsidePropertyOnlyRule()?(d.error("E_CSS_COLON_EXPECTED",f.nthToken(1)),this.actions=yi):(this.actions=Ai,d.startSelectorRule());continue}this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gi,p.splice(0,p.length);continue;case li.PROP:if(f.nthToken(1).type!=Uu.COLON){this.actions=yi,d.error("E_CSS_COLON_EXPECTED",f.nthToken(1));continue}this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gi,p.splice(0,p.length);continue;case li.SELECTOR_START:this.actions=Ai,d.startSelectorRule();continue;case li.SELECTOR_NAME_1:if(!o.precededBySpace){this.actions=wi,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case li.SELECTOR_NAME:if(f.nthToken(1).type==Uu.BAR)if(f.consume(),f.consume(),null!=(s=this.namespacePrefixToURI[o.text]))switch((o=f.token()).type){case Uu.IDENT:d.tagSelector(s,o.text),this.actions=i?Ci:Ei,f.consume();break;case Uu.STAR:d.tagSelector(s,null),this.actions=i?Ci:Ei,f.consume();break;default:this.actions=Bi,d.error("E_CSS_NAMESPACE",o)}else this.actions=Bi,d.error("E_CSS_UNDECLARED_PREFIX",o);else d.tagSelector(this.defaultNamespaceURI,o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_ANY_1:if(!o.precededBySpace){this.actions=wi,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case li.SELECTOR_ANY:if(f.nthToken(1).type==Uu.BAR)switch(f.consume(),f.consume(),(o=f.token()).type){case Uu.IDENT:d.tagSelector(null,o.text),this.actions=i?Ci:Ei,f.consume();break;case Uu.STAR:d.tagSelector(null,null),this.actions=i?Ci:Ei,f.consume();break;default:this.actions=Bi,d.error("E_CSS_NAMESPACE",o)}else d.tagSelector(this.defaultNamespaceURI,null),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_ID_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_ID:if(!o.text){d.error("E_CSS_SYNTAX",o),f.consume();continue}d.idSelector(o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_CLASS_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_CLASS:d.classSelector(o.text),this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_PSEUDOCLASS_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_PSEUDOCLASS:f.consume();t:switch((o=f.token()).type){case Uu.IDENT:d.pseudoclassSelector(o.text,null),f.consume(),this.actions=i?Ci:Ei;continue;case Uu.FUNC:switch(l=o.text,f.consume(),l){case"is":case"not":case"where":case"has":this.actions=Ai,d.startFuncWithSelector(l),this.actions=this.runParser(Number.POSITIVE_INFINITY,!1,!1,!1,!0,"has"===l)?Ei:wi;continue;case"lang":case"href-epub-type":if((o=f.token()).type===Uu.IDENT){c=[o.text],f.consume();break}break t;case"nth-child":case"nth-of-type":case"nth-last-child":case"nth-last-of-type":case"nth":if(c=this.readNthPseudoParams())break;break t;default:c=this.readPseudoParams()}if((o=f.token()).type==Uu.C_PAR){d.pseudoclassSelector(l,c),f.consume(),this.actions=i?Ci:Ei;continue}}d.error("E_CSS_PSEUDOCLASS_SYNTAX",o),this.actions=Bi;continue;case li.SELECTOR_PSEUDOELEM_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_PSEUDOELEM:switch(f.consume(),(o=f.token()).type){case Uu.IDENT:d.pseudoelementSelector(o.text,null),this.actions=i?Ci:Ei,f.consume();continue;case Uu.FUNC:if(l=o.text,f.consume(),"nth-fragment"==l){if(null===(c=this.readNthPseudoParams()))break}else c=this.readPseudoParams();if((o=f.token()).type==Uu.C_PAR){d.pseudoelementSelector(l,c),this.actions=i?Ci:Ei,f.consume();continue}}d.error("E_CSS_PSEUDOELEM_SYNTAX",o),this.actions=Bi;continue;case li.SELECTOR_ATTR_1:o.precededBySpace&&d.descendantSelector();case li.SELECTOR_ATTR:if(f.consume(),(o=f.token()).type==Uu.IDENT)l=o.text,f.consume();else if(o.type==Uu.STAR)l=null,f.consume();else{if(o.type!=Uu.BAR){this.actions=wi,d.error("E_CSS_ATTR",o),f.consume();continue}l=""}if((o=f.token()).type==Uu.BAR){if(null==(s=l?this.namespacePrefixToURI[l]:l)){this.actions=wi,d.error("E_CSS_UNDECLARED_PREFIX",o),f.consume();continue}if(f.consume(),(o=f.token()).type!=Uu.IDENT){this.actions=wi,d.error("E_CSS_ATTR_NAME_EXPECTED",o);continue}l=o.text,f.consume(),o=f.token()}else s="";switch(o.type){case Uu.EQ:case Uu.TILDE_EQ:case Uu.BAR_EQ:case Uu.HAT_EQ:case Uu.DOLLAR_EQ:case Uu.STAR_EQ:case Uu.COL_COL:D=o.type,f.consume(),o=f.token();break;case Uu.C_BRK:d.attributeSelector(s,l,Uu.EOF,null),this.actions=i?Ci:Ei,f.consume();continue;default:this.actions=wi,d.error("E_CSS_ATTR_OP_EXPECTED",o);continue}switch(o.type){case Uu.IDENT:case Uu.STR:d.attributeSelector(s,l,D,o.text),f.consume(),o=f.token();break;default:this.actions=wi,d.error("E_CSS_ATTR_VAL_EXPECTED",o);continue}if(o.type!=Uu.C_BRK){this.actions=wi,d.error("E_CSS_ATTR",o);continue}this.actions=i?Ci:Ei,f.consume();continue;case li.SELECTOR_CHILD:d.childSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_SIBLING:d.adjacentSiblingSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_FOLLOWING_SIBLING:d.followingSiblingSelector(),this.actions=Fi,f.consume();continue;case li.SELECTOR_BODY:this.regionRule?(this.ruleStack.push("-epubx-region"),this.regionRule=!1):this.pageRule?(this.ruleStack.push("page"),this.pageRule=!1,this.inStyleDeclaration=!0):(this.ruleStack.push("[selector]"),this.inStyleDeclaration=!0),d.startRuleBody(),this.actions=fi,f.consume();continue;case li.SELECTOR_NEXT:d.nextSelector(),this.actions=Ai,f.consume();continue;case li.VAL_IDENT:p.push(Me(o.text)),f.consume();continue;case li.VAL_HASH:D=parseInt(o.text,16),p.push(new ze(o.text)),f.consume();continue;case li.VAL_NUM:p.push(new Ve(o.num)),f.consume();continue;case li.VAL_INT:p.push(new He(o.num)),f.consume();continue;case li.VAL_NUMERIC:p.push(new Ue(o.num,o.text)),f.consume();continue;case li.VAL_STR:p.push(new Le(o.text)),f.consume();continue;case li.VAL_URL:p.push(new Ge(K(o.text,this.baseURL))),f.consume();continue;case li.VAL_URANGE:p.push(new We(o.text)),f.consume();continue;case li.VAL_COMMA:this.valStackReduce(",",o),p.push(","),f.consume();continue;case li.VAL_SLASH:p.push(ke),f.consume();continue;case li.VAL_FUNC:"-epubx-expr"==(l=o.text.toLowerCase())||"env"==l?(this.actions=vi,this.exprContext=bi.PROP,p.push("{")):(p.push(l),p.push("("),this.errorBrackets.length>0&&this.errorBrackets.push(Uu.C_PAR)),f.consume();continue;case li.VAL_C_PAR:this.valStackReduce(")",o),f.consume();continue;case li.VAL_BANG:if(f.consume(),o=f.token(),a=f.nthToken(1),o.type==Uu.IDENT&&"important"==o.text.toLowerCase()&&(a.type==Uu.SEMICOL||a.type==Uu.EOF||a.type==Uu.C_BRC)){f.consume(),this.propImportant=!0;continue}this.exprError("E_CSS_SYNTAX",o);continue;case li.VAL_PLUS:switch((a=f.nthToken(1)).type){case Uu.NUM:case Uu.NUMERIC:case Uu.INT:if(!a.precededBySpace){f.consume();continue}}p.push(new $e("+")),f.consume();continue;case li.VAL_END:f.consume();case li.VAL_BRC:(h=this.valStackReduce(";",o))&&this.propName&&d.property(this.propName,h,this.propImportant),this.actions=u?pi:fi;continue;case li.VAL_FINISH:for(f.consume();p.length>0;){var C=p.length;if(!(h=this.valStackReduce(";",o))||p.length===C)break}return e?(this.result=h,!0):(this.propName&&h&&d.property(this.propName,h,this.propImportant),!0);case li.EXPR_IDENT:if((a=f.nthToken(1)).type==Uu.CLASS)f.nthToken(2).type!=Uu.O_PAR||f.nthToken(2).precededBySpace?(p.push(new fe(d.getScope(),kt(o.text,a.text))),this.actions=mi):(p.push(o.text,a.text,"("),f.consume()),f.consume();else{if(this.exprContext==bi.MEDIA||this.exprContext==bi.IMPORT)"not"==o.text.toLowerCase()?(f.consume(),p.push(new pe(d.getScope(),!0,a.text))):("only"==o.text.toLowerCase()&&(f.consume(),o=a),p.push(new pe(d.getScope(),!1,o.text)));else{if(this.exprContext===bi.SUPPORTS&&"not"===o.text.toLowerCase()&&p[p.length-1]!==Si&&p[p.length-1]!==xi&&(a.type===Uu.O_PAR||a.type===Uu.FUNC)){p.push(-Ti),f.consume();continue}p.push(new fe(d.getScope(),o.text))}this.actions=mi}f.consume();continue;case li.EXPR_FUNC:if(this.exprContext===bi.SUPPORTS){p.push(this.readSupportsTest(o)),this.actions=mi;continue}p.push(null,o.text,"("),f.consume();continue;case li.EXPR_NUM:p.push(new Ae(d.getScope(),o.num)),f.consume(),this.actions=mi;continue;case li.EXPR_NUMERIC:"%"==(l=o.text)&&(l=this.propName&&this.propName.match(/height|^(top|bottom)$/)?"vh":"vw"),p.push(new de(d.getScope(),o.num,l)),f.consume(),this.actions=mi;continue;case li.EXPR_STR:p.push(new Ae(d.getScope(),o.text)),f.consume(),this.actions=mi;continue;case li.EXPR_PARAM:f.consume(),(o=f.token()).type!=Uu.INT||o.precededBySpace?this.exprError("E_CSS_SYNTAX",o):(p.push(new me(d.getScope(),o.num)),f.consume(),this.actions=mi);continue;case li.EXPR_PREFIX:p.push(-o.type),f.consume();continue;case li.EXPR_INFIX:this.actions=vi,this.exprStackReduce(o.type,o),p.push(o.type),f.consume();continue;case li.EXPR_INFIX_NAME:"and"===o.text.toLowerCase()&&p[p.length-2]!==xi&&p[p.length-2]!==-Ti?(this.actions=vi,this.exprStackReduce(Si,o),p.push(Si),f.consume()):"or"===o.text.toLowerCase()&&p[p.length-2]!==Si&&p[p.length-2]!==-Ti?(this.actions=vi,this.exprStackReduce(xi,o),p.push(xi),f.consume()):this.exprError("E_CSS_SYNTAX",o);continue;case li.EXPR_C_PAR:this.exprStackReduce(o.type,o)&&(this.actions=gi),f.consume();continue;case li.EXPR_O_BRC:this.exprStackReduce(Uu.C_PAR,o)&&(this.propName||this.exprContext==bi.IMPORT?this.exprError("E_CSS_UNEXPECTED_BRC",o):(this.exprContext==bi.WHEN?d.startWhenRule(p.pop()):d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=fi)),f.consume();continue;case li.EXPR_SEMICOL:if(this.exprStackReduce(Uu.C_PAR,o))return this.propName||this.exprContext!=bi.IMPORT?(this.exprError("E_CSS_UNEXPECTED_SEMICOL",o),this.actions=fi,f.consume(),!1):(this.importCondition=p.pop(),this.importReady=!0,this.actions=fi,f.consume(),!1);f.consume();continue;case li.EXPR_O_PAR:if(this.exprContext===bi.SUPPORTS){var F=this.readSupportsTest(o);if(F){p.push(F),this.actions=mi;continue}}p.push(o.type),f.consume();continue;case li.RULE_END:if(this.actions=fi,f.consume(),d.endRule(),this.inStyleDeclaration=!1,this.ruleStack.length)switch(this.ruleStack.pop(),this.ruleStack[this.ruleStack.length-1]){case"page":case"-epubx-page-master":case"-epubx-partition-group":this.inStyleDeclaration=!0}continue;case li.AT:switch(l=o.text.toLowerCase()){case"import":if(f.consume(),(o=f.token()).type==Uu.STR||o.type==Uu.URL){if(this.importURL=o.text,f.consume(),(o=f.token()).type==Uu.SEMICOL||o.type==Uu.EOF)return this.importReady=!0,f.consume(),!1;this.propName=null,this.exprContext=bi.IMPORT,this.actions=vi,p.push("{");continue}d.error("E_CSS_IMPORT_SYNTAX",o),this.actions=Bi;continue;case"namespace":switch(f.consume(),(o=f.token()).type){case Uu.IDENT:if(l=o.text,f.consume(),((o=f.token()).type==Uu.STR||o.type==Uu.URL)&&f.nthToken(1).type==Uu.SEMICOL){this.namespacePrefixToURI[l]=o.text,f.consume(),f.consume();continue}break;case Uu.STR:case Uu.URL:if(f.nthToken(1).type==Uu.SEMICOL){this.defaultNamespaceURI=o.text,f.consume(),f.consume();continue}}d.error("E_CSS_NAMESPACE_SYNTAX",o),this.actions=Bi;continue;case"charset":if(f.consume(),(o=f.token()).type==Uu.STR&&f.nthToken(1).type==Uu.SEMICOL){"utf-8"!=(l=o.text.toLowerCase())&&"utf-16"!=l&&d.error("E_CSS_UNEXPECTED_CHARSET "+l,o),f.consume(),f.consume();continue}d.error("E_CSS_CHARSET_SYNTAX",o),this.actions=Bi;continue;case"font-face":case"-epubx-page-template":case"-epubx-define":case"-epubx-viewport":if(f.nthToken(1).type==Uu.O_BRC){switch(f.consume(),f.consume(),l){case"font-face":d.startFontFaceRule(),this.inStyleDeclaration=!0;break;case"-epubx-page-template":d.startPageTemplateRule();break;case"-epubx-define":d.startDefineRule(),this.inStyleDeclaration=!0;break;case"-epubx-viewport":d.startViewportRule(),this.inStyleDeclaration=!0}this.ruleStack.push(l),d.startRuleBody();continue}break;case"-adapt-footnote-area":switch(f.consume(),(o=f.token()).type){case Uu.O_BRC:f.consume(),d.startFootnoteRule(null),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue;case Uu.COL_COL:if(f.consume(),(o=f.token()).type==Uu.IDENT&&f.nthToken(1).type==Uu.O_BRC){l=o.text,f.consume(),f.consume(),d.startFootnoteRule(l),this.ruleStack.push("-adapt-footnote-area"),d.startRuleBody(),this.inStyleDeclaration=!0;continue}}break;case"-epubx-region":f.consume(),d.startRegionRule(),this.regionRule=!0,this.actions=Ai;continue;case"page":f.consume(),d.startPageRule(),this.pageRule=!0,this.actions=Fi;continue;case"top-left-corner":case"top-left":case"top-center":case"top-right":case"top-right-corner":case"right-top":case"right-middle":case"right-bottom":case"bottom-right-corner":case"bottom-right":case"bottom-center":case"bottom-left":case"bottom-left-corner":case"left-bottom":case"left-middle":case"left-top":if(f.consume(),(o=f.token()).type==Uu.O_BRC){f.consume(),d.startPageMarginBoxRule(l),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"-epubx-when":f.consume(),this.propName=null,this.exprContext=bi.WHEN,this.actions=vi,p.push("{");continue;case"media":f.consume(),this.propName=null,this.exprContext=bi.MEDIA,this.actions=vi,p.push("{");continue;case"supports":f.consume(),this.propName=null,this.exprContext=bi.SUPPORTS,this.actions=vi,p.push("{");continue;case"-epubx-flow":if(f.nthToken(1).type==Uu.IDENT&&f.nthToken(2).type==Uu.O_BRC){d.startFlowRule(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"-epubx-page-master":case"-epubx-partition":case"-epubx-partition-group":f.consume();var A=null,g=null,v=[];for((o=f.token()).type==Uu.IDENT&&(A=o.text,f.consume(),o=f.token()),o.type==Uu.COLON&&f.nthToken(1).type==Uu.IDENT&&(g=f.nthToken(1).text,f.consume(),f.consume(),o=f.token());o.type==Uu.FUNC&&"class"==o.text.toLowerCase()&&f.nthToken(1).type==Uu.IDENT&&f.nthToken(2).type==Uu.C_PAR;)v.push(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),o=f.token();if(o.type==Uu.O_BRC){switch(f.consume(),l){case"-epubx-page-master":d.startPageMasterRule(A,g,v);break;case"-epubx-partition":d.startPartitionRule(A,g,v);break;case"-epubx-partition-group":d.startPartitionGroupRule(A,g,v)}this.ruleStack.push(l),d.startRuleBody(),this.inStyleDeclaration=!0;continue}break;case"":d.error("E_CSS_UNEXPECTED_AT"+l,o),this.actions=wi;continue;default:d.error("E_CSS_AT_UNKNOWN "+l,o),this.actions=Bi;continue}d.error("E_CSS_AT_SYNTAX "+l,o),this.actions=Bi;continue;case li.ERROR_PUSH:this.errorBrackets.push(o.type+1),f.consume();continue;case li.ERROR_POP_DECL:if(0==this.errorBrackets.length){this.actions=fi;continue}case li.ERROR_POP:if(i&&0==this.errorBrackets.length&&o.type==Uu.C_PAR)return f.consume(),d.endFuncWithSelector(),!0;this.errorBrackets.length>0&&this.errorBrackets[this.errorBrackets.length-1]==o.type&&this.errorBrackets.pop(),0==this.errorBrackets.length&&o.type==Uu.C_BRC&&(this.actions=fi),f.consume();continue;case li.ERROR_SEMICOL:0==this.errorBrackets.length&&(this.actions=fi),f.consume();continue;case li.DONE:return!0;default:if(n)return!!this.exprStackReduce(Uu.C_PAR,o)&&(this.result=p.pop(),!0);if(i){switch(o.type){case Uu.COMMA:case Uu.C_PAR:if(this.actions===Ai)d.error("E_CSS_SYNTAX",o);else{var m=f.input.substring(E,o.position);d.pushSelectorText(m),E=o.position+1}if(o.type===Uu.COMMA){d.nextSelector(),this.actions=Ai,f.consume();continue}return d.endFuncWithSelector(),f.consume(),!0;case Uu.GT:case Uu.PLUS:case Uu.TILDE:if(r){this.actions=Ei;continue}break;case Uu.O_BRC:case Uu.O_BRK:case Uu.O_PAR:this.errorBrackets.push(o.type+1)}d.error("E_CSS_SYNTAX",o),f.consume(),this.actions=wi;continue}if(this.actions!==Bi&&this.actions!==wi&&this.actions!==yi){if(o.type==Uu.INVALID)d.error("E_CSS_SYNTAX",o);else{if(this.actions===gi){switch(o.type){case Uu.O_PAR:case Uu.O_BRC:case Uu.O_BRK:this.errorBrackets.push(o.type+1)}p.push(new $e(o.toString())),f.consume();continue}if(o.type===Uu.O_BRC&&this.actions==vi&&p.length>0){d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=fi,f.consume();continue}if(o.type===Uu.SEMICOL&&this.actions==vi)return this.actions=fi,f.consume(),!1;d.error("E_CSS_SYNTAX",o)}this.actions=this.isInsidePropertyOnlyRule()?yi:wi;continue}f.consume();continue}return!1},t}(),Pi=function(t){function e(e){var u;return(u=t.call(this,null)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.error=function(t,e){c.warn(t,e.toString())},u.getScope=function(){return this.scope},e}(Di);function Ri(t,e,u,n,i){return kn("parseStylesheetFromText",(function(r){(function(t,e,u,n,i){var r=Pn("parseStylesheet"),o=new Ii(fi,t,e,u),a=null;return i&&(a=function(t,e,u){var n=new Ii(vi,t,e,u);return n.runParser(Number.POSITIVE_INFINITY,!1,!1,!0,!1),n.result}(new Sn(i,e),e,u)),(a=o.makeCondition(n,a&&a.toExpr()))&&(e.startMediaRule(a),e.startRuleBody()),r.loop((function(){for(var t=function(){if(o.importReady){var t=K(o.importURL,u);o.importCondition&&(e.startMediaRule(o.importCondition),e.startRuleBody());var n=Pn("parseStylesheet.import");return ki(t,e,null,null).then((function(){o.importCondition&&e.endRule(),o.importReady=!1,o.importURL=null,o.importCondition=null,n.finish(!0)})),{v:n.result()}}var i=r.timeSlice();if(i.isPending)return{v:i}};!o.runParser(100,!1,!1,!1,!1);){var n=t();if("object"==typeof n)return n.v}return Rn(!1)})).then((function(){a&&e.endRule(),r.finish(!0)})),r.result()})(new Sn(t,e),e,u,n,i).thenFinish(r)}),(function(e,u){c.warn(u,"Failed to parse stylesheet text: "+t),e.finish(!1)}))}function ki(t,e,u,n){return kn("parseStylesheetFromURL",(function(i){ti(t).then((function(r){r.responseText?Ri(r.responseText,e,t,u,n).then((function(e){e||c.warn("Failed to parse stylesheet from "+t),i.finish(!0)})):i.finish(!0)}))}),(function(e,u){c.warn(u,"Exception while fetching and parsing:",t),e.finish(!0)}))}function Li(t,e,u){var n=new Ii(gi,e,new Pi(t),u);return n.runParser(Number.POSITIVE_INFINITY,!0,!1,!1,!1),n.result}var Oi={"z-index":!0,"column-count":!0,"flow-linger":!0,opacity:!0,page:!0,"flow-priority":!0,utilization:!0};function _i(t,e,u){return t-=u,0===e?0===t:t%e==0&&t/e>=0}var Mi=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.some((function(t){return t.matches()}))},t}(),Ui=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.every((function(t){return t.matches()}))},t}(),Vi=function(){function t(t,e,u){this.elementOffset=void 0,this.a=void 0,this.b=void 0,this.elementOffset=t,this.a=e,this.b=u}return t.registerFragmentIndex=function(e,u,n){var i=t.fragmentIndices;(!i[e]||i[e].priority<=n)&&(i[e]={fragmentIndex:u,priority:n})},t.clearFragmentIndices=function(){t.fragmentIndices={}},t.prototype.matches=function(){var e=t.fragmentIndices[this.elementOffset];return null!=e&&null!=e.fragmentIndex&&_i(e.fragmentIndex,this.a,this.b)},t}();Vi.fragmentIndices={};var Hi=function(){function t(){}return t.buildViewConditionMatcher=function(t,e){var u=e.split("_");return"NFS"==u[0]?new Vi(t,parseInt(u[1],10),parseInt(u[2],10)):null},t.buildAllMatcher=function(t){return new Ui(t)},t.buildAnyMatcher=function(t){return new Mi(t)},t}();function zi(t){var e,u;return"clone"===(null==t||null==(e=t.style)?void 0:e["box-decoration-break"])||"clone"===(null==t||null==(u=t.style)?void 0:u["-webkit-box-decoration-break"])}function Gi(t){var e=t.getAttribute("data-viv-box-break");return e?e.split(" "):[]}function Wi(t,e){t.setAttribute("data-viv-box-break",e.join(" "))}function Xi(t,e){var u=Gi(t);u.includes(e)||(u.push(e),Wi(t,u))}function ji(t,e){var u=function(t){var e=t.getAttribute("data-viv-margin-discard");return e?e.split(" "):[]}(t);u.includes(e)||(u.push(e),function(t,e){t.setAttribute("data-viv-margin-discard",e.join(" "))}(t,u))}var Ki={page:!0,left:!0,right:!0,recto:!0,verso:!0,column:!0,region:!0};function Yi(t){return!!Ki[t]}var qi={left:!0,right:!0,recto:!0,verso:!0};function $i(t){return!!qi[t]}var Qi,Zi,Ji,tr,er,ur,nr={avoid:!0,"avoid-page":!0,"avoid-column":!0,"avoid-region":!0};function ir(t){return!!nr[t]}function rr(t,e){if(!t)return e;if(!e)return t;if($i(e))return e;if($i(t))return t;var u=Yi(t),n=Yi(e);if(!u||!n)return n?e:u?t:ir(e)?e:ir(t)?t:e;switch(e){case"column":return t;case"region":return"column"===t?e:t;default:return e}}function or(t){return Yi(t)?t:"auto"}function ar(t){return t.reduce((function(t,e){return e[0]===o.default.DELETE?t:t+e[1]}),"")}function sr(t,e,u){var n=0,i=0;return t.some((function(t){for(var r=0;re)return!0}return!1})),Math.max(Math.min(e,i-1)+n,0)}p("SIMPLE_PROPERTY",(function(t){var e=t.name,u=t.value;switch(e){case"page-break-before":case"page-break-after":case"page-break-inside":return{name:e.replace(/^page-/,""),value:u===Je.always?Je.page:u,important:t.important};default:return t}})),function(t){t.isInstanceOfBlockFormattingContext=function(t){return t&&"Block"===t.formattingContextType}}(Qi||(Qi={})),function(t){!function(t){t.INLINE="inline",t.COLUMN="column",t.REGION="region",t.PAGE="page"}(t.FloatReference||(t.FloatReference={}))}(Zi||(Zi={})),function(t){t.isInstanceOfAfterIfContinuesLayoutConstraint=function(t){return t&&"AfterIfContinue"==t.flagmentLayoutConstraintType}}(Ji||(Ji={})),function(t){t.isInstanceOfRepetitiveElementsOwnerFormattingContext=function(t){return!!t&&("RepetitiveElementsOwner"===t.formattingContextType||er.isInstanceOfTableFormattingContext(t))},t.isInstanceOfRepetitiveElementsOwnerLayoutConstraint=function(t){return!!t&&("RepetitiveElementsOwner"===t.flagmentLayoutConstraintType||er.isInstanceOfTableRowLayoutConstraint(t))}}(tr||(tr={})),function(t){t.isInstanceOfTableFormattingContext=function(t){return t&&"Table"===t.formattingContextType},t.isInstanceOfTableRowLayoutConstraint=function(t){return t&&"TableRow"===t.flagmentLayoutConstraintType}}(er||(er={})),function(t){!function(t){t[t.IGNORE=0]="IGNORE",t[t.NEWLINE=1]="NEWLINE",t[t.PRESERVE=2]="PRESERVE"}(t.Whitespace||(t.Whitespace={})),function(t){t[t.NONE=0]="NONE",t[t.CONTENT=1]="CONTENT",t[t.ROOTLESS=2]="ROOTLESS",t[t.ROOTED=3]="ROOTED"}(t.ShadowType||(t.ShadowType={}))}(ur||(ur={}));var lr={transform:!0,"transform-origin":!0},Dr={top:!0,bottom:!0,left:!0,right:!0},hr=function(t,e,u){this.target=void 0,this.name=void 0,this.value=void 0,this.target=t,this.name=e,this.value=u},cr={show:function(t){t.style.visibility="visible"},hide:function(t){t.style.visibility="hidden"},play:function(t){t.currentTime=0,t.play()},pause:function(t){t.pause()},resume:function(t){t.play()},mute:function(t){t.muted=!0},unmute:function(t){t.muted=!1}};function dr(t,e){var u=cr[e];return u?function(){for(var e=0;et.priority||this.last)},t}();function vr(t,e){return t.top-e.top}function mr(t,e){return e.right-t.right}function Br(t,e){var u,n;return t===e||!(!t||!e)&&(t.node===e.node||!!t.shadowContext&&!!e.shadowContext&&t.shadowType===ur.ShadowType.ROOTLESS&&e.shadowType===ur.ShadowType.ROOTLESS&&(null==(u=t.node)?void 0:u.outerHTML)===(null==(n=e.node)?void 0:n.outerHTML))&&t.shadowType===e.shadowType&&xr(t.shadowContext,e.shadowContext)&&xr(t.nodeShadow,e.nodeShadow)&&Br(t.shadowSibling,e.shadowSibling)}function yr(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.offsetInNode!==e.offsetInNode||t.after!==e.after||t.steps.length!==e.steps.length)return!1;for(var u=0;u0&&this.positions[0].flowChunk.startOffset<=t},t}(),Lr=function(){function t(){this.page=0,this.flows={},this.flowPositions={},this.isBlankPage=!1,this.highestSeenOffset=0,this.highestSeenNode=void 0,this.lookupPositionOffset=void 0}var e=t.prototype;return e.clone=function(){var e=new t;for(var u in e.page=this.page,e.isBlankPage=this.isBlankPage,e.highestSeenNode=this.highestSeenNode,e.highestSeenOffset=this.highestSeenOffset,e.lookupPositionOffset=this.lookupPositionOffset,e.flows=this.flows,this.flowPositions)e.flowPositions[u]=this.flowPositions[u].clone();return e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.page!==t.page)return!1;var e=Object.keys(this.flowPositions),u=Object.keys(t.flowPositions);if(e.length!==u.length)return!1;for(var n=0,i=e;n=e.priority)&&u.isEnabled(t)?u.getBaseValue():e}function Jr(t,e,u,n){if(u){var i=t[e];(!i||u.priority>=i.priority)&&(n?u.isEnabled(n)&&(t[e]=u.getBaseValue()):t[e]=u)}else delete t[e]}var to={"region-id":!0,"fragment-selector-id":!0};function eo(t){return"_"===t.charAt(0)&&"_viewConditionalStyles"!==t}function uo(t){return"_"!==t.charAt(0)&&!to[t]}function no(t){return!!Ur[t]||su(t)}function io(t,e){return t[e]}function ro(t,e,u){u?t[e]=u:delete t[e]}function oo(t,e){return t[e]}function ao(t,e){var u=t[e];return u||(t[e]=u={}),u}var so=function(t){var e=t._viewConditionalStyles;return e||(t._viewConditionalStyles=e=[]),e};function lo(t,e){return t[e]}function Do(t,e){var u=t[e];return u||(t[e]=u=[]),u}function ho(t,e,u,n,i,r,o){for(var a in[{id:i,styleKey:"_pseudos"},{id:r,styleKey:"_regions"}].forEach((function(t){if(t.id){var u=ao(e,t.styleKey);(e=u[t.id])||(u[t.id]=e={})}})),o&&so(e).push({styles:e={},matcher:o}),u)if(!eo(a))if(to[a]){var s=lo(u,a),l=Do(e,a);Array.prototype.push.apply(l,s)}else{var D,h,c=io(u,a).increaseSpecificity(n);Jr(e,a,c,t);var d=null==(D=t.style)||null==(h=D.validatorSet.shorthands[a])?void 0:h.propList;if(d)for(var f,p=O(d);!(f=p()).done;){var E=f.value,C=new $r(Pe,c.priority);Jr(e,E,C,t)}}}function co(t,e){if(t.length>0){t.sort((function(t,e){return e.getPriority()-t.getPriority()}));for(var u=null,n=t.length-1;n>=0;n--)(u=t[n]).chained=e,e=u;return u}return e}var fo=function(t){function e(e,u){var n;return(n=t.call(this)||this).props=void 0,n.context=void 0,n.propName="",n.props=e,n.context=u,n}x(e,t);var u=e.prototype;return u.setPropName=function(t){this.propName=t},u.getFontSize=function(){var t=io(this.props,"font-size");if(!t.value.isNumeric())return Mt.em;var e=t.value;if(!function(t){switch(null==t?void 0:t.toLowerCase()){case"px":case"in":case"pt":case"pc":case"cm":case"mm":case"q":return!0;default:return!1}}(e.unit))throw new Error("Unexpected state");return e.num*Mt[e.unit]},u.visitNumeric=function(t){return"font-size"===this.propName?Eo(t,this.getFontSize(),this.context):"em"===t.unit||"ex"===t.unit||"rem"===t.unit||"lh"===t.unit||"rlh"===t.unit?po(t,this.getFontSize(),this.context):t},u.visitExpr=function(t){return"font-size"==this.propName?Ma(this.context,t,this.propName).visit(this):t},e}(xe);function po(t,e,u){var n=t.unit,i=t.num;return"em"===n||"ex"===n?new Ue(i*(Mt[n]/Mt.em)*e,"px"):"rem"===n?new Ue(i*u.fontSize(),"px"):"rlh"===n?new Ue(i*u.rootLineHeight,"px"):t}function Eo(t,e,u){var n=(t=po(t,e,u)).unit,i=t.num;return"px"===n?t:new Ue("%"===n?i/100*e:i*u.queryUnitSize(n,!1),"px")}var Co=function(){function t(){}var e=t.prototype;return e.apply=function(t){},e.mergeWith=function(t){return new Ao([this,t])},e.clone=function(){return this},t}(),Fo=function(t){function e(e){var u;return(u=t.call(this)||this).conditionItem=void 0,u.conditionItem=e,u}return x(e,t),e.prototype.apply=function(t){t.pushConditionItem(this.conditionItem.fresh(t))},e}(Co),Ao=function(t){function e(e){var u;return(u=t.call(this)||this).list=void 0,u.list=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e=0;e0)return}e=e.nextSibling}this.chained.apply(t)},u.getPriority=function(){return 4},e}(vo),Ho=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){!1===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),zo=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){!0===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),Go=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.apply=function(t){var e=t.currentElement;!0!==e.selected&&!0!==e.checked||this.chained.apply(t)},u.getPriority=function(){return 5},e}(vo),Wo=function(t){function e(e){var u;return(u=t.call(this)||this).condition=void 0,u.condition=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){if(t.conditions[this.condition])try{t.dependentConditions.push(this.condition),this.chained.apply(t)}finally{t.dependentConditions.pop()}},u.getPriority=function(){return 5},e}(vo),Xo=function(t){function e(){var e;return(e=t.call(this)||this).applied=!1,e}x(e,t);var u=e.prototype;return u.apply=function(t){this.applied=!0},u.clone=function(){var t=new e;return t.applied=this.applied,t},e}(Co),jo=function(t){function e(e){var u;(u=t.call(this)||this).checkAppliedAction=void 0,u.firstActions=[],u.checkAppliedAction=new Xo;for(var n,i=O(e);!(n=i()).done;)u.firstActions.push(co(n.value,u.checkAppliedAction));return u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e,u=O(this.firstActions);!(e=u()).done&&(e.value.apply(t),!this.checkAppliedAction.applied););this.checkAppliedAction.applied===this.positive()&&this.chained.apply(t),this.checkAppliedAction.applied=!1},u.getPriority=function(){return Math.max.apply(Math,this.firstActions.map((function(t){return t instanceof vo?t.getPriority():0})))},u.positive=function(){return!0},u.relational=function(){return!1},e}(vo),Ko=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.positive=function(){return!1},e}(jo),Yo=function(t){function e(e){var u;return(u=t.call(this,[])||this).selectorTexts=void 0,u.selectorTexts=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){for(var e,u=O(this.selectorTexts);!(e=u()).done;){var n=e.value,i=void 0,r=void 0;/^\s*[+~]/.test(n)?(r=t.currentElement.parentElement,i=":scope > :nth-child("+(Array.from(r.children).indexOf(t.currentElement)+1)+") "+n):(r=t.currentElement,i=":scope "+n);try{if(r.querySelector(i)){this.checkAppliedAction.apply(t);break}}catch(t){}}this.checkAppliedAction.applied&&this.chained.apply(t),this.checkAppliedAction.applied=!1},u.relational=function(){return!0},e}(jo),qo=function(){function t(t,e,u){this.condition=void 0,this.viewConditionId=void 0,this.viewCondition=void 0,this.condition=t,this.viewConditionId=e,this.viewCondition=u}var e=t.prototype;return e.increment=function(t){t.increment(this.condition,this.viewCondition)},e.decrement=function(t){t.decrement(this.condition,this.viewCondition)},e.buildViewConditionMatcher=function(t){return t.buildViewConditionMatcher(this.viewConditionId)},t}(),$o=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e&&this.increment(t),!1},u.pop=function(t,e){return 0==e&&(this.decrement(t),!0)},e}(qo),Qo=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e?this.increment(t):1==e&&this.decrement(t),!1},u.pop=function(t,e){return 0==e?(this.decrement(t),!0):(1==e&&this.increment(t),!1)},e}(qo),Zo=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return!!this.fired&&(this.decrement(t),!0)},u.pop=function(t,e){return this.fired?(this.decrement(t),!0):(0==e&&(this.fired=!0,this.increment(t)),!1)},e}(qo),Jo=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}x(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return this.fired&&(-1==e?this.increment(t):0==e&&this.decrement(t)),!1},u.pop=function(t,e){if(this.fired){if(-1==e)return this.decrement(t),!0;0==e&&this.increment(t)}else 0==e&&(this.fired=!0,this.increment(t));return!1},e}(qo),ta=function(){function t(t,e){this.afterprop=void 0,this.element=void 0,this.afterprop=t,this.element=e}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.processPseudoelementProps(this.afterprop,this.element),!0)},t}(),ea=function(){function t(t){this.lang=void 0,this.lang=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.lang=this.lang,!0)},t}(),ua=function(){function t(t){this.oldQuotes=void 0,this.oldQuotes=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.quotes=this.oldQuotes,!0)},t}(),na=function(t){function e(e){var u;return(u=t.call(this)||this).element=void 0,u.element=e,u}x(e,t);var u=e.prototype;return u.createValueFromString=function(t,e){return"url"===e?new Ge(t||"about:invalid"):new Le(t||"")},u.visitFunc=function(e){if("attr"!==e.name)return t.prototype.visitFunc.call(this,e);var u,n="string",i=null;if(e.values[0]instanceof je){var r=e.values[0].values;r.length>=2&&(n=r[1].stringValue()),i=r[0].stringValue()}else i=e.values[0].stringValue();return u=this.createValueFromString(e.values.length>1?e.values[1].stringValue():null,n),this.element&&this.element.hasAttribute(i)?this.createValueFromString(this.element.getAttribute(i),n):u},e}(xe);function ia(t){if(Mr(t)){if(t instanceof Le)return t.stringValue();if(t instanceof je)return t.values.map((function(t){return ia(t)})).join("")}return""}var ra=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).cascade=void 0,i.element=void 0,i.counterResolver=void 0,i.cascade=e,i.element=u,i.counterResolver=n,i}x(e,t);var u=e.prototype;return u.visitIdent=function(t){var e=this.cascade,u=e.quotes,n=Math.floor(u.length/2)-1;switch(t.name){case"open-quote":var i=u[2*Math.min(n,e.quoteDepth)];return e.quoteDepth++,i;case"close-quote":return e.quoteDepth>0&&e.quoteDepth--,u[2*Math.min(n,e.quoteDepth)+1];case"no-open-quote":return e.quoteDepth++,new Le("");case"no-close-quote":return e.quoteDepth>0&&e.quoteDepth--,new Le("")}return t},u.format=function(t,e){var u,n=!1,i=!1;null!=(u=e.match(/^upper-(.*)/))?(n=!0,e=u[1]):null!=(u=e.match(/^lower-(.*)/))&&(i=!0,e=u[1]);var r="";return oa[e]?r=function(t,e){if(e>t[0]||e<=0||e!=Math.round(e))return"";for(var u="",n=1;n20)return"";for(e-=r*i;r>0;)u+=t[n+1],r--}return u}(oa[e],t):aa[e]?r=function(t,e){if(e<=0||e!=Math.round(e))return"";var u=function(t){for(var e=[],u=0;u0);return n}(aa[e],t):null!=sa[e]?r=sa[e]:"decimal-leading-zero"==e?1==(r=""+t).length&&(r="0"+r):r="cjk-ideographic"==e||"trad-chinese-informal"==e?function(t,e){if(t>9999||t<-9999)return""+t;if(0==t)return e.digits.charAt(0);var u=new it;if(t<0&&(u.append(e.negative),t=-t),t<10)u.append(e.digits.charAt(t));else if(!e.formal&&t<=19)u.append(e.markers.charAt(0)),0!=t&&u.append(e.digits.charAt(t-10));else{var n=Math.floor(t/1e3);n&&(u.append(e.digits.charAt(n)),u.append(e.markers.charAt(2)));var i=Math.floor(t/100)%10;i&&(u.append(e.digits.charAt(i)),u.append(e.markers.charAt(1)));var r=Math.floor(t/10)%10;r&&(u.append(e.digits.charAt(r)),u.append(e.markers.charAt(0)));var o=t%10;o&&u.append(e.digits.charAt(o))}return u.toString()}(t,la):""+t,n?r.toUpperCase():i?r.toLowerCase():r},u.visitFuncCounter=function(t){var e=this,u=t[0].toString(),n=t.length>1?t[1].stringValue():"decimal",i=this.cascade.counters[u];if(i&&i.length)return new Le(this.format(i&&i.length&&i[i.length-1]||0,n));var r=new qe(this.counterResolver.getPageCounterVal(u,(function(t){return e.format(t||0,n)})));return new je([r])},u.visitFuncCounters=function(t){var e=this,u=t[0].toString(),n=t[1].stringValue(),i=t.length>2?t[2].stringValue():"decimal",r=this.cascade.counters[u],o=new it;if(r&&r.length)for(var a=0;a0&&o.append(n),o.append(this.format(r[a],i));var s=new qe(this.counterResolver.getPageCountersVal(u,(function(t){var u=[];if(t.length)for(var r=0;r2?t[2].stringValue():"decimal",o=new qe(this.counterResolver.getTargetCounterVal(e,i,(function(t){return u.format(t||0,r)})));return new je([o])},u.visitFuncTargetCounters=function(t){var e,u=this,n=t[0];e=n instanceof Ge?n.url:n.stringValue();var i=t[1].toString(),r=t[2].stringValue(),o=t.length>3?t[3].stringValue():"decimal",a=new qe(this.counterResolver.getTargetCountersVal(e,i,(function(t){var e=t.map((function(t){return u.format(t,o)}));return e.length?e.join(r):u.format(0,o)})));return new je([a])},u.visitFuncString=function(t){var e=t.length>0?t[0].stringValue():"",u=t.length>1?t[1].stringValue():"first";return new qe(this.counterResolver.getNamedStringVal(e,u))},u.visitFuncElement=function(t){var e=t.length>0?t[0].stringValue():"",u=t.length>1?t[1].stringValue():"first";return new qe(this.counterResolver.getRunningElementVal(e,u))},u.visitFuncContent=function(t){var e=t.length>0?t[0].stringValue():"text",u="";switch(e){case"text":u=this.element.textContent;break;case"before":case"after":var n,i,r=oo(this.cascade.currentStyle,"_pseudos");u=ia(null==r||null==(n=r[e])||null==(i=n.content)?void 0:i.value);break;case"first-letter":var o,a,s,l,D=oo(this.cascade.currentStyle,"_pseudos"),h=(ia(null==D||null==(o=D.before)||null==(a=o.content)?void 0:a.value)||this.element.textContent||ia(null==D||null==(s=D.after)||null==(l=s.content)?void 0:l.value)).match(_);u=h?h[0]:""}return new Le(u)},u.visitFuncLeader=function(t){var e="";if(t[0]instanceof _e)switch(t[0].stringValue()){case"dotted":e=".";break;case"solid":e="_";break;case"space":e=" "}else t[0]instanceof Le&&(e=t[0].stringValue());return 0==e.length?new Le(""):new qe(new Ee(null,(function(){return e}),"viv-leader"))},u.visitFunc=function(t){switch(t.name){case"counter":if(t.values.length<=2)return this.visitFuncCounter(t.values);break;case"counters":if(t.values.length<=3)return this.visitFuncCounters(t.values);break;case"target-counter":if(t.values.length<=3)return this.visitFuncTargetCounter(t.values);break;case"target-counters":if(t.values.length<=4)return this.visitFuncTargetCounters(t.values);break;case"string":if(t.values.length<=2)return this.visitFuncString(t.values);break;case"element":if(t.values.length<=2)return this.visitFuncElement(t.values);break;case"content":if(t.values.length<=1)return this.visitFuncContent(t.values);break;case"leader":if(t.values.length<=1)return this.visitFuncLeader(t.values)}return t},e}(xe);p(e.HOOKS.POST_LAYOUT_BLOCK,(function(t,e,u){for(var n,i=function(){for(var t=n.value,e=t.parent;e&&e.inline;)e=e.parent;var i=t.viewNode,r=i.parentElement,o=i.getAttribute("data-viv-leader-value"),a=i.textContent||o,s=u.clientLayout.getElementComputedStyle(r),l=s.writingMode,D=s.direction,h=s.marginInlineEnd;function c(t){if("rtl"===D){var e="‏";i.textContent=(t.startsWith(e)?"":e)+t+(t.endsWith(e)?"":e)}else i.textContent=t}i.style.marginInlineStart="1px",c(o),r.style.display="inline-block",r.style.textIndent="0";var d=u.clientLayout.getElementClientRect(e.viewNode),f=u.clientLayout.getElementClientRect(r),p=u.parseComputedLength(h);function E(){var t=u.clientLayout.getElementClientRect(r);return d.left>t.left||d.rightt.top||d.bottom0?1===u.length?u[0]:Hi.buildAnyMatcher([].concat(u)):null})).filter((function(t){return t}));return n.length<=0?u:null===u?1===n.length?n[0]:Hi.buildAllMatcher(n):Hi.buildAllMatcher([u].concat(n))},e.applyAction=function(t,e){var u=t[e];u&&u.apply(this)},e.pushRule=function(t,e,u){this.currentElement=null,this.currentElementOffset=null,this.currentStyle=u,this.currentNamespace="",this.currentLocalName="",this.currentId="",this.currentXmlId="",this.currentClassNames=t,this.currentNSTag="",this.currentEpubTypes=pa,this.currentPageType=e,this.applyActions()},e.defineCounter=function(t,e){this.counters[t]?this.counters[t].push(e):this.counters[t]=[e];var u=this.counterScoping[this.counterScoping.length-1];u||(this.counterScoping[this.counterScoping.length-1]=u={}),u[t]=!0},e.pushCounters=function(t){var e,u=Je.inline,n=t.display;n&&(u=n.evaluate(this.context));var i=Je.inline,r=t.float;r&&(i=r.evaluate(this.context));var o=null,a=null,s=null,l=t["counter-reset"];if(l){var D=l.evaluate(this.context);D&&(o=Ou(D,!0))}var h=t["counter-set"];if(h){var c=h.evaluate(this.context);c&&(s=Ou(c,!1))}var d,f,p,E,C=t["counter-increment"];if(C){var F=C.evaluate(this.context);F&&(a=Ou(F,!1))}if("ol"!=this.currentLocalName&&"ul"!=this.currentLocalName||this.currentNamespace!=W.XHTML||(o||(o={}),o["ua-list-item"]=(null!=(d=null==(f=this.currentElement)?void 0:f.start)?d:1)-1),u===Je.list_item&&(a||(a={}),a["ua-list-item"]=1,/^\s*[-+]?\d/.test(null!=(p=null==(E=this.currentElement)?void 0:E.getAttribute("value"))?p:"")&&(o||(o={}),o["ua-list-item"]=this.currentElement.value-1)),(null==(e=this.currentElement)?void 0:e.parentNode.nodeType)===Node.DOCUMENT_NODE&&(o||(o={}),void 0===o.footnote&&(o.footnote=0)),i===Je.footnote&&(a||(a={}),void 0===a.footnote)){var A,g=null==(A=this.currentStyle["counter-increment"])?void 0:A.value;g&&(g===Je.footnote||g instanceof je&&g.values.includes(Je.footnote))||(a.footnote=1)}if(o)for(var v in o)this.defineCounter(v,o[v]);if(s)for(var m in s)if(this.counters[m]){var B=this.counters[m];B[B.length-1]=s[m]}else this.defineCounter(m,s[m]);if(a)for(var y in a){this.counters[y]||this.defineCounter(y,0);var w=this.counters[y];w[w.length-1]+=a[y]}if(u===Je.list_item){var N=this.counters["ua-list-item"];t["ua-list-item-count"]=new $r(new Ve(N[N.length-1]),0)}this.counterScoping.push(null)},e.popCounters=function(){var t=this.counterScoping.pop();if(t)for(var e in t){var u=this.counters[e];u&&(1==u.length?delete this.counters[e]:u.pop())}},e.setNamedStrings=function(t){var e=t["string-set"];if(e){for(var u,n=O((e=e.filterValue(new ra(this,this.currentElement,this.counterResolver))).value instanceof Ke?e.value.values:[e.value]);!(u=n()).done;){var i=u.value;if(i instanceof je){var r=i.values[0].stringValue(),o=i.values.slice(1).map((function(t){return ia(t)})).join("");this.counterResolver.setNamedString(r,o,this.currentElementOffset)}}delete t["string-set"]}},e.setRunningElement=function(t){var e=t.position;if((null==e?void 0:e.value)instanceof Ye&&"running"===e.value.name){var u=e.value.values[0].stringValue();this.counterResolver.setRunningElement(u,this.currentElementOffset)}},e.processPseudoelementProps=function(t,e){this.pushCounters(t);var u=t.content;u&&(t.content=u.filterValue(new ra(this,e,this.counterResolver))),this.popCounters()},e.pushElement=function(t,e,u,n){var i=this;this.currentPageType=null,this.currentElement=e,this.currentElementOffset=n,this.currentStyle=u,this.currentNamespace=e.namespaceURI,this.currentLocalName=e.localName;var r=this.code.nsPrefix[this.currentNamespace];this.currentNSTag=r?r+this.currentLocalName:"",this.currentId=e.getAttribute("id"),this.currentXmlId=e.getAttributeNS(W.XML,"id");var o=e.getAttribute("class");this.currentClassNames=o?o.split(/\s+/):pa;var a=e.getAttributeNS(W.epub,"type");this.currentEpubTypes=a?a.split(/\s+/):pa;var s=nt(e);s&&(this.stack[this.stack.length-1].push(new ea(this.lang)),this.lang=s.toLowerCase());var l=this.isRoot,D=this.siblingOrderStack;this.currentSiblingOrder=++D[D.length-1],D.push(0);var h=this.siblingTypeCountsStack,c=this.currentSiblingTypeCounts=h[h.length-1],d=c[this.currentNamespace];d||(d=c[this.currentNamespace]={}),d[this.currentLocalName]=(d[this.currentLocalName]||0)+1,h.push({});var f=this.followingSiblingOrderStack;this.currentFollowingSiblingOrder=null!==f[f.length-1]?--f[f.length-1]:null,f.push(null);var p=this.followingSiblingTypeCountsStack,E=this.currentFollowingSiblingTypeCounts=p[p.length-1];E&&E[this.currentNamespace]&&E[this.currentNamespace][this.currentLocalName]--,p.push({}),this.applyActions(),this.applyVarFilter([this.currentStyle],t,e),this.applyCalcFilter(this.currentStyle,this.context),this.applyAttrFilter(e);var C=u.quotes,F=null;if(C){var A=C.evaluate(this.context);A&&(F=new ua(this.quotes),A===Je.none?this.quotes=[new Le(""),new Le("")]:A===Je.auto||A===Je.initial?this.quotes=[new Le("“"),new Le("”"),new Le("‘"),new Le("’")]:A instanceof je&&(this.quotes=A.values))}this.pushCounters(this.currentStyle);var g=this.currentId||this.currentXmlId||e.getAttribute("name")||"";if(l||g){var v={};Object.keys(this.counters).forEach((function(t){v[t]=Array.from(i.counters[t])})),this.counterListener.countersOfId(g,v)}var m=oo(this.currentStyle,"_pseudos");if(m)for(var B,y=!0,w=O(Ea);!(B=w()).done;){var N=B.value;N||(y=!1);var b,S,x=m[N];x&&(("before"!==N&&"after"!==N||Mr(null==(b=x.content)?void 0:b.value))&&("footnote-call"!==N&&"footnote-marker"!==N||(null==(S=io(this.currentStyle,"float"))?void 0:S.value)===Je.footnote)?y?this.processPseudoelementProps(x,e):this.stack[this.stack.length-2].push(new ta(x,e)):delete m[N])}this.setNamedStrings(this.currentStyle),this.setRunningElement(this.currentStyle),F&&this.stack[this.stack.length-2].push(F)},e.applyAttrFilterInner=function(t,e){for(var u in e)uo(u)&&!su(u)&&(e[u]=e[u].filterValue(t))},e.applyAttrFilter=function(t){var e=new na(t),u=this.currentStyle,n=oo(u,"_pseudos");for(var i in n)this.applyAttrFilterInner(e,n[i]);this.applyAttrFilterInner(e,u)},e.applyVarFilter=function(t,e,u){var n=t[0],i=new Oa(t,e,u),r={};for(var o in n)if(eo(o)){var a=oo(n,o);for(var s in a)this.applyVarFilter([a[s]].concat(t),e,u)}else if(uo(o)){for(var l=io(n,o),D=l.value,h=0;;h++){if(h>=32){D=Pe;break}var c=D.visit(i);if(i.error){D=Pe,i.error=!1;break}if(c===D)break;D=c}if(D!==l.value){var d,f=e.validatorSet,p=null==f||null==(d=f.shorthands[o])?void 0:d.clone();if(p)if(ou(D)){for(var E,C=O(p.propList);!(E=C()).done;){var F=E.value,A=new $r(D,l.priority),g=io(n,F);ro(r,F,Zr(this.context,g,A))}delete n[o]}else{var v=Li(e.scope,new Sn(D.toString(),null),"");if(v&&(v.visit(p),!p.error)){for(var m,B=O(p.propList);!(m=B()).done;){var y,w,N=m.value,b=new $r(null!=(y=null!=(w=p.values[N])?w:f.defaultValues[N])?y:Je.initial,l.priority),S=io(n,N);ro(r,N,Zr(this.context,S,b))}delete n[o]}}else n[o]=new $r(D,l.priority)}if(r[o]){var x=io(n,o);x&&x.value!==Pe&&Jr(r,o,x,this.context)}}for(var T in r)n[T]=r[T]},e.applyCalcFilter=function(t,e){var u=new _a(e);for(var n in t)if(eo(n)){var i=oo(t,n);for(var r in i)this.applyCalcFilter(i[r],e)}else if(uo(n)&&!su(n)){var o=io(t,n),a=o.value.visit(u);a!==o.value&&(t[n]=new $r(a,o.priority))}},e.applyActions=function(){var t;for(t=0;t=-1;--e){var u=this.stack[this.stack.length-e-2];for(t=0;t=-1;--t)for(var e=this.stack[this.stack.length-t-2],u=0;u0&&u==e[0]){if(this.pseudoelement)return void this.invalidSelector("Double pseudo-element ::"+this.pseudoelement+"::"+t);this.pseudoelement="first-"+u+"-lines";break}}this.chain.push(new Wo(""));break;case"nth-fragment":e&&2==e.length?this.viewConditionId="NFS_"+e[0]+"_"+e[1]:this.chain.push(new Wo(""));break;default:return void this.invalidSelector("Unknown pseudo-element ::"+t)}this.specificity+=1},u.idSelector=function(t){this.specificity+=65536,this.chain.push(new Bo(t))},u.attributeSelector=function(t,e,u,n){var i;switch(this.specificity+=256,e=e.toLowerCase(),n=n||"",u){case Uu.EOF:i=new So(t,e);break;case Uu.EQ:i=new xo(t,e,n);break;case Uu.TILDE_EQ:i=!n||n.match(/\s/)?new Wo(""):new Io(t,e,new RegExp("(^|\\s)"+ht(n)+"($|\\s)"));break;case Uu.BAR_EQ:i=new Io(t,e,new RegExp("^"+ht(n)+"($|-)"));break;case Uu.HAT_EQ:i=n?new Io(t,e,new RegExp("^"+ht(n))):new Wo("");break;case Uu.DOLLAR_EQ:i=n?new Io(t,e,new RegExp(ht(n)+"$")):new Wo("");break;case Uu.STAR_EQ:i=n?new Io(t,e,new RegExp(ht(n))):new Wo("");break;case Uu.COL_COL:if("supported"!=n)return void this.invalidSelector("Unsupported :: attr selector op: "+n);i=new To(t,e);break;default:return void this.invalidSelector("Unsupported attr selector: "+u)}this.chain.push(i)},u.descendantSelector=function(){var t="d"+ga++;this.processChain(new Fo(new $o(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.childSelector=function(){var t="c"+ga++;this.processChain(new Fo(new Qo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.adjacentSiblingSelector=function(){var t="a"+ga++;this.processChain(new Fo(new Zo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.followingSiblingSelector=function(){var t="f"+ga++;this.processChain(new Fo(new Jo(t,this.viewConditionId,null))),this.chain=[new Wo(t)],this.viewConditionId=null},u.nextSelector=function(){this.finishChain(),this.pseudoelement=null,this.footnoteContent=!1,this.specificity=0,this.chain=[]},u.startSelectorRule=function(){this.isInsideSelectorRule("E_CSS_UNEXPECTED_SELECTOR")||(this.state=ca.SELECTOR,this.elementStyle={},this.pseudoelement=null,this.specificity=0,this.footnoteContent=!1,this.chain=[],this.invalid=!1)},u.error=function(e,u){t.prototype.error.call(this,e,u),this.state==ca.SELECTOR&&(this.state=ca.TOP),this.setInvalid()},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.state=ca.TOP},u.startRuleBody=function(){this.finishChain(),t.prototype.startRuleBody.call(this),this.state==ca.SELECTOR&&(this.state=ca.TOP)},u.endRule=function(){t.prototype.endRule.call(this),this.insideSelectorRule=ca.TOP},u.finishChain=function(){this.chain&&(this.processChain(this.makeApplyRuleAction(this.specificity)),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0)},u.makeApplyRuleAction=function(t){var e=this.regionId;return this.footnoteContent&&(e=e?"xxx-bogus-xxx":"footnote"),new go(this.elementStyle,t,this.pseudoelement,e,this.viewConditionId)},u.special=function(t,e){var u;u=this.condition?new Qr(e,0,this.condition):new $r(e,0),Do(this.elementStyle,t).push(u)},u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){"display"!=t||e!==Je.oeb_page_head&&e!==Je.oeb_page_foot||(this.simpleProperty("flow-options",new je([Je.exclusive,Je._static]),u),this.simpleProperty("flow-into",e,u),e=Je.block),C("SIMPLE_PROPERTY").forEach((function(n){var i=n({name:t,value:e,important:u});t=i.name,e=i.value,u=i.important}));var n=(u?this.getImportantSpecificity():this.getBaseSpecificity())+this.cascade.nextOrder(),i=this.condition?new Qr(e,n,this.condition):new $r(e,n);Jr(this.elementStyle,t,i)},u.finish=function(){return this.cascade},u.startFuncWithSelector=function(t){var e;switch(t){case"is":e=new va(this);break;case"not":e=new ma(this);break;case"where":e=new Ba(this);break;case"has":e=new ya(this)}e&&(e.startSelectorRule(),this.owner.pushHandler(e))},e}(di),Aa={"nth-child":Oo,"nth-of-type":_o,"nth-last-child":Mo,"nth-last-of-type":Uo},ga=0,va=function(t){function e(e){var u;return(u=t.call(this,e.scope,e.owner,e.condition,e,e.regionId,e.validatorSet,!1)||this).parent=void 0,u.parentChain=void 0,u.chains=[],u.maxSpecificity=0,u.selectorTexts=[],u.parent=e,u.parentChain=e.chain,u}x(e,t);var u=e.prototype;return u.nextSelector=function(){this.chain&&this.chains.push(this.chain),this.maxSpecificity=Math.max(this.maxSpecificity,this.specificity),this.chain=[],this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0},u.endFuncWithSelector=function(){this.chain&&this.chains.push(this.chain),this.chains.length>0?(this.maxSpecificity=Math.max(this.maxSpecificity,this.specificity),this.parentChain.push(this.relational()?new Yo(this.selectorTexts):this.positive()?new jo(this.chains):new Ko(this.chains)),this.increasingSpecificity()&&(this.parent.specificity+=this.maxSpecificity)):this.parentChain.push(new Wo("")),this.owner.popHandler()},u.startRuleBody=function(){this.reportAndSkip("E_CSS_UNEXPECTED_RULE_BODY")},u.error=function(u,n){t.prototype.error.call(this,u,n),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0;for(var i=!1,r=this;r instanceof e;r=r.parent)if(r.forgiving()){i=!0;break}i||this.owner.popHandler()},u.pushSelectorText=function(t){this.chain&&this.relational()&&this.selectorTexts.push(t)},u.positive=function(){return!0},u.increasingSpecificity=function(){return!0},u.forgiving=function(){return!0},u.relational=function(){return!1},e}(Fa),ma=function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var u=e.prototype;return u.positive=function(){return!1},u.forgiving=function(){return!1},e}(va),Ba=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.increasingSpecificity=function(){return!1},e}(va),ya=function(t){function e(){return t.apply(this,arguments)||this}return x(e,t),e.prototype.relational=function(){return!0},e}(va),wa=function(t){function e(e,u){return t.call(this,e,u,!1)||this}return x(e,t),e.prototype.property=function(t,e,u){if(this.scope.values[t])this.error("E_CSS_NAME_REDEFINED "+t,this.getCurrentToken());else{var n=t.match(/height|^(top|bottom)$/)?"vh":"vw",i=new de(this.scope,100,n);this.scope.defineName(t,e.toExpr(this.scope,i))}},e}(di),Na=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,!1)||this).condition=void 0,o.elementStyle=void 0,o.validatorSet=void 0,o.order=void 0,o.condition=n,o.elementStyle=i,o.validatorSet=r,o.order=0,o}x(e,t);var u=e.prototype;return u.property=function(t,e,u){u?c.warn("E_IMPORTANT_NOT_ALLOWED"):this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity();n+=this.order,this.order+=Da;var i=this.condition?new Qr(e,n,this.condition):new $r(e,n);Jr(this.elementStyle,t,i)},e}(di),ba=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).validatorSet=void 0,n.elementStyle={},n.order=0,n.validatorSet=u,n}x(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?si:ai;n+=this.order,this.order+=Da;var i=new $r(e,n);Jr(this.elementStyle,t,i)},e}(Pi);function Sa(t,e){var u=so(t);u&&u.forEach((function(t){t.matcher.matches()&&e(t.styles)}))}function xa(t,e,u){Sa(u,(function(u){ka(t,u,e)}))}function Ta(t,e,u){var n=t["writing-mode"];if(n){var i=n.evaluate(e,"writing-mode");if(i&&i!==Je.inherit&&i!==Je.revert&&i!==Je.unset)return i===Je.vertical_rl}return u}function Ia(t,e,u){var n=t.direction;if(n){var i=n.evaluate(e,"direction");if(i&&i!==Je.inherit&&i!==Je.revert&&i!==Je.unset)return i===Je.rtl}return u}function Pa(t,e,u,n,i){var r={};for(var o in t)uo(o)&&(r[o]=io(t,o));return xa(r,e,t),Ra(t,u,n,(function(t,u){ka(r,u,e),xa(r,e,u)})),r}function Ra(t,e,u,n){var i=oo(t,"_regions");if((e||u)&&i){if(u){var r=["footnote"];e=e?e.concat(r):r}for(var o,a=O(e);!(o=a()).done;){var s=o.value,l=i[s];l&&n(s,l)}}}function ka(t,e,u){for(var n in e)if(uo(n)){var i=io(e,n);t[n]=Zr(u,t[n],i)}}var La=function(t,e,u,n,i){var r=u?n?Yr:jr:n?qr:Kr;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(!a)continue;var s=r[o],l=void 0;if(s){var D=t[s];if(D&&D.priority>a.priority)continue;l=Wr[s]?s:o}else l=o;e[l]=i(o,a)}},Oa=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).elementStyles=void 0,i.styler=void 0,i.element=void 0,i.elementStyles=e,i.styler=u,i.element=n,i}x(e,t);var u=e.prototype;return u.getVarValue=function(t){var e,u,n=null!=(e=this.element)?e:this.styler.root;if(null!=(u=this.elementStyles)&&u.length){for(var i,r=O(this.elementStyles);!(i=r()).done;){var o,a=null==(o=i.value[t])?void 0:o.value;if(a)return a}this.element&&(n=this.element.parentElement)}for(;n;n=n.parentElement){var s,l,D=null==(s=this.styler.getStyle(n,!1))||null==(l=s[t])?void 0:l.value;if(D)return D}return null},u.visitFunc=function(e){if("var"!==e.name)return t.prototype.visitFunc.call(this,e);var u=e.values[0]instanceof _e&&e.values[0].name;return u&&su(u)?this.getVarValue(u)||(e.values.length<2?(this.error=!0,Pe):2===e.values.length?e.values[1]:new Ke(e.values.slice(1))):(this.error=!0,Pe)},e}(xe),_a=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).context=void 0,i.resolveViewportUnit=void 0,i.percentRef=void 0,i.context=e,i.resolveViewportUnit=u,i.percentRef=n,i}x(e,t);var u=e.prototype;return u.visitFunc=function(e){var u=t.prototype.visitFunc.call(this,e);if("calc"!==e.name)return u;var n=u.toString().replace(/^calc\b/,"-epubx-expr");if(/\d(%|em|ex|cap|ch|ic|lh|p?v[whbi]|p?vmin|p?vmax)\W|\Wvar\(\s*--/i.test(n))return u;var i=Li(this.context.rootScope,new Sn(n,null),"");if(i instanceof qe)try{var r=i.expr.evaluate(this.context);"number"==typeof r&&(u=new Ue(r,"px"))}catch(t){c.warn(t)}return u},u.visitNumeric=function(t){return this.resolveViewportUnit&&(_t(t.unit)||function(t){switch(null==t?void 0:t.toLowerCase()){case"rem":case"rlh":return!0;default:return!1}}(t.unit))?new Ue(t.num*this.context.queryUnitSize(t.unit,!1),"px"):"number"==typeof this.percentRef&&"%"===t.unit?new Ue(t.num*this.percentRef/100,"px"):t},e}(xe);function Ma(t,e,u,n){try{if(e instanceof qe)return e.expr instanceof Ee&&(e.expr.str.startsWith("named-string-")||e.expr.str.startsWith("running-element-"))?e:function(t,e,u){var n=e.evaluate(t);switch(typeof n){case"number":return function(t){return!!Oi[t]}(u)?n==Math.round(n)?new He(n):new Ve(n):new Ue(n,"px");case"string":return n?Li(e.scope,new Sn(n,null),""):Pe;case"boolean":return n?Je._true:Je._false;case"undefined":return Pe}throw new Error("E_UNEXPECTED")}(t,e.expr,u);if(e instanceof Ue||e instanceof Ye||e instanceof je||e instanceof Ke)return e.visit(new _a(t,!0,n))}catch(t){return c.warn(t),Pe}return e}function Ua(t,e){var u={};return Object.keys(t).forEach((function(n){var i=u[n]={},r=t[n];Object.keys(r).forEach((function(t){i[t]=r[t].map((function(t){var u=e?t.physical:t.logical;return{regexp:new RegExp("(-?)"+(e?t.logical:t.physical)+"(-?)"),to:"$1"+u+"$2"}}))}))})),u}function Va(t,e,u,n){var i=n[e];if(!i)throw new Error("unknown writing-mode: "+e);var r=i[u||"ltr"];if(!r)throw new Error("unknown direction: "+u);for(var o,a=O(r);!(o=a()).done;){var s=o.value,l=t.replace(s.regexp,s.to);if(l!==t)return l}return t}var Ha={"horizontal-tb":{ltr:[{logical:"inline-start",physical:"left"},{logical:"inline-end",physical:"right"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}],rtl:[{logical:"inline-start",physical:"right"},{logical:"inline-end",physical:"left"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}]},"vertical-rl":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]},"vertical-lr":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]}},za=Ua(Ha,!0);function Ga(t,e,u){return Va(t,e,u||null,za)}var Wa=Ua(Ha,!1);function Xa(t,e,u){return Va(t,e,u||null,Wa)}var ja,Ka={"horizontal-tb":[{logical:"line-left",physical:"left"},{logical:"line-right",physical:"right"},{logical:"over",physical:"top"},{logical:"under",physical:"bottom"}],"vertical-rl":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}],"vertical-lr":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}]};function Ya(t,e,u){var n={display:e.style.display,position:e.style.position,width:e.style.width,maxWidth:e.style.maxWidth,minWidth:e.style.minWidth,height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight},i=e.parentNode,r=e.ownerDocument.createElement("div");function o(u){return t.getElementComputedStyle(e).getPropertyValue(u)}et(r,"position",n.position),i.insertBefore(r,e),r.appendChild(e),et(e,"width","auto"),et(e,"max-width","none"),et(e,"min-width","0"),et(e,"height","auto"),et(e,"max-height","none"),et(e,"min-height","0");var a=tt("writing-mode"),s=(a?o(a[0]):null)||o("writing-mode"),l="vertical-rl"===s||"tb-rl"===s||"vertical-lr"===s||"tb-lr"===s,D=l?"height":"width",h=l?"width":"height";function c(){return et(e,"display","block"),et(e,"position","static"),o(D)}function d(){et(e,"display","inline-block"),et(r,D,"99999999px");var t=o(D);return et(r,D,""),t}function f(){et(e,"display","inline-block"),et(r,D,"0");var t=o(D);return et(r,D,""),t}function p(){var t=c(),e=f(),u=parseFloat(t);if(u<=parseFloat(e))return e;var n=d();return u<=parseFloat(n)?t:n}function E(){return o(h)}function C(){throw new Error("Getting fill-available block size is not implemented")}var F={};return u.forEach((function(t){var u,i;switch(t){case ja.FILL_AVAILABLE_INLINE_SIZE:i=c();break;case ja.MAX_CONTENT_INLINE_SIZE:i=d();break;case ja.MIN_CONTENT_INLINE_SIZE:i=f();break;case ja.FIT_CONTENT_INLINE_SIZE:i=p();break;case ja.FILL_AVAILABLE_BLOCK_SIZE:i=C();break;case ja.MAX_CONTENT_BLOCK_SIZE:case ja.MIN_CONTENT_BLOCK_SIZE:case ja.FIT_CONTENT_BLOCK_SIZE:i=E();break;case ja.FILL_AVAILABLE_WIDTH:i=l?C():c();break;case ja.FILL_AVAILABLE_HEIGHT:i=l?c():C();break;case ja.MAX_CONTENT_WIDTH:i=l?E():d();break;case ja.MAX_CONTENT_HEIGHT:i=l?d():E();break;case ja.MIN_CONTENT_WIDTH:i=l?E():f();break;case ja.MIN_CONTENT_HEIGHT:i=l?f():E();break;case ja.FIT_CONTENT_WIDTH:i=l?E():p();break;case ja.FIT_CONTENT_HEIGHT:i=l?p():E()}"0px"!==i||1!==e.childNodes.length||"img"!==(null==(u=e.firstElementChild)?void 0:u.localName)||e.firstElementChild.complete||(i="1px"),F[t]=parseFloat(i),et(e,"position",n.position),et(e,"display",n.display)})),et(e,"width",n.width),et(e,"max-width",n.maxWidth),et(e,"min-width",n.minWidth),et(e,"height",n.height),et(e,"max-height",n.maxHeight),et(e,"min-height",n.minHeight),i.insertBefore(e,r),i.removeChild(r),F}!function(t){t.FILL_AVAILABLE_INLINE_SIZE="fill-available inline size",t.FILL_AVAILABLE_BLOCK_SIZE="fill-available block size",t.FILL_AVAILABLE_WIDTH="fill-available width",t.FILL_AVAILABLE_HEIGHT="fill-available height",t.MAX_CONTENT_INLINE_SIZE="max-content inline size",t.MAX_CONTENT_BLOCK_SIZE="max-content block size",t.MAX_CONTENT_WIDTH="max-content width",t.MAX_CONTENT_HEIGHT="max-content height",t.MIN_CONTENT_INLINE_SIZE="min-content inline size",t.MIN_CONTENT_BLOCK_SIZE="min-content block size",t.MIN_CONTENT_WIDTH="min-content width",t.MIN_CONTENT_HEIGHT="min-content height",t.FIT_CONTENT_INLINE_SIZE="fit-content inline size",t.FIT_CONTENT_BLOCK_SIZE="fit-content block size",t.FIT_CONTENT_WIDTH="fit-content width",t.FIT_CONTENT_HEIGHT="fit-content height"}(ja||(ja={}));var qa=Zi.FloatReference;function $a(t){switch(t){case qa.INLINE:return!1;case qa.COLUMN:case qa.REGION:case qa.PAGE:return!0;default:throw new Error("Unknown float-reference: "+t)}}var Qa=function(){function t(t,e,u,n,i,r){this.nodePosition=void 0,this.floatReference=void 0,this.floatSide=void 0,this.clearSide=void 0,this.flowName=void 0,this.floatMinWrapBlock=void 0,this.order=null,this.id=null,this.nodePosition=t,this.floatReference=e,this.floatSide=u,this.clearSide=n,this.flowName=i,this.floatMinWrapBlock=r}var e=t.prototype;return e.getOrder=function(){if(null===this.order)throw new Error("The page float is not yet added");return this.order},e.getId=function(){if(!this.id)throw new Error("The page float is not yet added");return this.id},e.isAllowedOnContext=function(t){return t.isAnchorAlreadyAppeared(this.getId())},e.isAllowedToPrecede=function(t){return!1},t}(),Za=function(){function t(){this.floats=[],this.nextPageFloatIndex=0}var e=t.prototype;return e.nextOrder=function(){return this.nextPageFloatIndex++},e.createPageFloatId=function(t){return"pf"+t},e.addPageFloat=function(t){if(this.floats.findIndex((function(e){return yr(e.nodePosition,t.nodePosition)}))>=0)throw new Error("A page float with the same source node is already registered");var e=t.order=this.nextOrder();t.id=this.createPageFloatId(e),this.floats.push(t)},e.findPageFloatByNodePosition=function(t){var e=this.floats.findIndex((function(e){return yr(e.nodePosition,t)}));return e>=0?this.floats[e]:null},e.findPageFloatById=function(t){var e=this.floats.findIndex((function(e){return e.id===t}));return e>=0?this.floats[e]:null},t}(),Ja=function(){function t(t,e,u,n,i){this.floatReference=void 0,this.floatSide=void 0,this.continuations=void 0,this.area=void 0,this.continues=void 0,this.floatReference=t,this.floatSide=e,this.continuations=u,this.area=n,this.continues=i}var e=t.prototype;return e.hasFloat=function(t){return this.continuations.some((function(e){return e.float===t}))},e.findNotAllowedFloat=function(t){for(var e=this.continuations.length-1;e>=0;e--){var u=this.continuations[e].float;if(!u.isAllowedOnContext(t))return u}return null},e.getOuterShape=function(){return this.area.getOuterShape(null,null)},e.getOuterRect=function(){return this.area.getOuterRect()},e.getOrder=function(){var t=this.continuations.map((function(t){return t.float}));return Math.min.apply(null,t.map((function(t){return t.getOrder()})))},e.shouldBeStashedBefore=function(t){return this.getOrder()=0;r--){var o=this.children[r];if(o.floatReference===e&&o.flowName===u&&yr(o.generatingNodePosition,n))return o;if(o=o.getPreviousSiblingOf(null,e,u,n))return o}return null},e.getPreviousSibling=function(){for(var t,e=this,u=this.parent;u;){if(t=u.getPreviousSiblingOf(e,this.floatReference,this.flowName,this.generatingNodePosition))return t;e=u,u=u.parent}return null},e.getContainer=function(t){return t&&t!==this.floatReference?this.getParent(t).getContainer(t):this.container},e.setContainer=function(t){this.container=t,this.reattachFloatFragments()},e.addPageFloat=function(t){this.floatStore.addPageFloat(t)},e.getPageFloatLayoutContext=function(t){return t===this.floatReference?this:this.getParent(t).getPageFloatLayoutContext(t)},e.findPageFloatByNodePosition=function(t){return this.floatStore.findPageFloatByNodePosition(t)},e.forbid=function(t){var e=t.getId(),u=t.floatReference;u===this.floatReference?this.forbiddenFloats.includes(e)||(this.forbiddenFloats.push(e),(new ns).findByFloat(t).forbid(t,this)):this.getParent(u).forbid(t)},e.isForbidden=function(t){var e=t.getId(),u=t.floatReference;return u===this.floatReference?this.forbiddenFloats.includes(e):this.getParent(u).isForbidden(t)},e.addPageFloatFragment=function(t,e){var u=t.floatReference;u!==this.floatReference?this.getParent(u).addPageFloatFragment(t,e):this.floatFragments.includes(t)||(this.floatFragments.push(t),this.floatFragments.sort((function(t,e){return t.getOrder()-e.getOrder()}))),e||this.invalidate()},e.removePageFloatFragment=function(t,e){var u=t.floatReference;if(u!==this.floatReference)this.getParent(u).removePageFloatFragment(t,e);else{var n=this.floatFragments.indexOf(t);if(n>=0){var i=this.floatFragments.splice(n,1)[0],r=i.area&&i.area.element;r&&r.parentNode&&r.parentNode.removeChild(r),e||this.invalidate()}}},e.findPageFloatFragment=function(t){if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).findPageFloatFragment(t);var e=this.floatFragments.findIndex((function(e){return e.hasFloat(t)}));return e>=0?this.floatFragments[e]:null},e.hasFloatFragments=function(t){return!(!(this.floatFragments.length>0)||t&&!this.floatFragments.some(t))||!!this.parent&&this.parent.hasFloatFragments(t)},e.hasContinuingFloatFragmentsInFlow=function(t){return this.hasFloatFragments((function(e){return e.continues&&e.getFlowName()===t}))},e.registerPageFloatAnchor=function(t,e){this.floatAnchors[t.getId()]=e},e.collectPageFloatAnchors=function(){var t=Object.assign({},this.floatAnchors);return this.children.reduce((function(t,e){return Object.assign(t,e.collectPageFloatAnchors())}),t)},e.isAnchorAlreadyAppeared=function(t){if(this.getDeferredPageFloatContinuations().some((function(e){return e.float.getId()===t})))return!0;var e=this.collectPageFloatAnchors()[t];return!!e&&!(!this.container||!this.container.element)&&this.container.element.contains(e)},e.deferPageFloat=function(t){var e=t.float;if(e.floatReference===this.floatReference){var u=this.floatsDeferredToNext.findIndex((function(t){return t.float===e}));u>=0?this.floatsDeferredToNext.splice(u,1,t):this.floatsDeferredToNext.push(t)}else this.getParent(e.floatReference).deferPageFloat(t)},e.hasPrecedingFloatsDeferredToNext=function(t,e){if(!e&&t.floatReference!==this.floatReference)return this.getParent(t.floatReference).hasPrecedingFloatsDeferredToNext(t,!1);var u=t.getOrder();return!!this.floatsDeferredToNext.some((function(e){return e.float.getOrder()e&&(!u||i>u.getOrder())&&(u=n)}))})),this.parent){var n=this.parent.getLastFollowingFloatInFragments(t);n&&(!u||n.getOrder()>u.getOrder())&&(u=n)}return u},e.getDeferredPageFloatContinuations=function(t){t=t||this.flowName;var e=this.floatsDeferredFromPrevious.filter((function(e){return!t||e.float.flowName===t}));return this.parent&&(e=this.parent.getDeferredPageFloatContinuations(t).concat(e)),e.sort((function(t,e){return t.float.getOrder()-e.float.getOrder()}))},e.getPageFloatContinuationsDeferredToNext=function(t){t=t||this.flowName;var e=this.floatsDeferredToNext.filter((function(e){return!t||e.float.flowName===t}));return this.parent?this.parent.getPageFloatContinuationsDeferredToNext(t).concat(e):e},e.getFloatsDeferredToNextInChildContexts=function(){for(var t=[],e=[],u=this.children.length-1;u>=0;u--){var n=this.children[u];e.includes(n.flowName)||(e.push(n.flowName),t=(t=t.concat(n.floatsDeferredToNext.map((function(t){return t.float})))).concat(n.getFloatsDeferredToNextInChildContexts()))}return t},e.checkAndForbidNotAllowedFloat=function(){if(this.checkAndForbidFloatFollowingDeferredFloat())return!0;for(var t=this.floatFragments.length-1;t>=0;t--){var e=this.floatFragments[t],u=e.findNotAllowedFloat(this);if(u)return this.locked?this.invalidate():(this.removePageFloatFragment(e),this.forbid(u),this.removeEndFloatFragments(e.floatSide)),!0}return!(this.floatReference!==qa.REGION||!this.parent.locked)&&this.parent.checkAndForbidNotAllowedFloat()},e.checkAndForbidFloatFollowingDeferredFloat=function(){var t=this,e=this.getFloatsDeferredToNextInChildContexts(),u=this.floatFragments.reduce((function(t,e){return t.concat(e.continuations.map((function(t){return t.float})))}),[]);u.sort((function(t,e){return e.getOrder()-t.getOrder()}));for(var n,i=function(){var u=n.value,i=u.getOrder();if(e.some((function(t){return!u.isAllowedToPrecede(t)&&i>t.getOrder()}))){if(t.locked)t.invalidate();else{t.forbid(u);var r=t.findPageFloatFragment(u);t.removePageFloatFragment(r)}return{v:!0}}},r=O(u);!(n=r()).done;){var o=i();if("object"==typeof o)return o.v}return!1},e.finish=function(){var t=this;if(!this.checkAndForbidNotAllowedFloat()){for(var e=this.floatsDeferredToNext.length-1;e>=0;e--)if(!this.floatsDeferredToNext[e].float.isAllowedOnContext(this)){if(this.locked)return void this.invalidate();this.floatsDeferredToNext.splice(e,1)}this.floatsDeferredFromPrevious.forEach((function(e){t.floatsDeferredToNext.findIndex((function(t){return e.equals(t)}))>=0||t.floatFragments.some((function(t){return t.hasFloat(e.float)}))||t.floatsDeferredToNext.push(e)}))}},e.hasSameContainerAs=function(t){return!!this.container&&!!t.container&&this.container.element===t.container.element},e.invalidate=function(){var t=this;this.invalidated=!0,this.locked||(this.container&&(this.children.forEach((function(e){t.hasSameContainerAs(e)&&e.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),this.container.clear()),this.children.forEach((function(t){t.layoutConstraints.splice(0)})),this.children.splice(0),Object.keys(this.floatAnchors).forEach((function(e){delete t.floatAnchors[e]})))},e.detachChildren=function(){var t=this.children.splice(0);return t.forEach((function(t){t.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),t},e.attachChildren=function(t){var e=this;t.forEach((function(t){e.children.push(t),t.reattachFloatFragments()}))},e.isInvalidated=function(){return this.invalidated||!!this.parent&&this.parent.isInvalidated()},e.validate=function(){this.invalidated=!1},e.toLogical=function(t){return Xa(t,this.writingMode.toString(),this.direction.toString())},e.toPhysical=function(t){return Ga(t,this.writingMode.toString(),this.direction.toString())},e.removeEndFloatFragments=function(t){var e=this.toLogical(t);if("block-end"===e||"inline-end"===e)for(var u=0;u0&&(a=l.reduce((function(t,e){if(u&&!u(e,n))return t;var i=n.toLogical(e.floatSide),r=e.area,a=e.continuations[0].float.floatMinWrapBlock,l=t.top,D=t.left,h=t.bottom,c=t.right,d=t.floatMinWrapBlockStart,f=t.floatMinWrapBlockEnd;switch(i){case"inline-start":r.vertical?l=Math.max(l,r.top+r.height):D=Math.max(D,r.left+r.width);break;case"block-start":r.vertical?(a&&r.leftl&&(d=s(a,r.rootViewNodes[0],o.y2-o.y1)),l=Math.max(l,r.top+r.height));break;case"inline-end":r.vertical?h=Math.min(h,r.top):c=Math.min(c,r.left);break;case"block-end":r.vertical?(a&&r.left+r.width>D&&(f=s(a,r.rootViewNodes[0],o.x2-o.x1)),D=Math.max(D,r.left+r.width)):(a&&r.topi.left&&(i.left=r.left,i.floatMinWrapBlockEnd=r.floatMinWrapBlockEnd)):(r.top>i.top&&(i.top=r.top,i.floatMinWrapBlockStart=r.floatMinWrapBlockStart),r.bottom=0;e--){var u=us[e];if(u.appliesToNodeContext(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},e.findByFloat=function(t){for(var e=us.length-1;e>=0;e--){var u=us[e];if(u.appliesToFloat(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},t}();ns.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return $a(t.floatReference)},e.appliesToFloat=function(t){return!0},e.createPageFloat=function(t,e,u){var n=t.floatReference,i=t.floatSide,r=t.toNodePosition();return u.resolveFloatReferenceFromColumnSpan(n,t.columnSpan,t).thenAsync((function(u){var o=new Qa(r,n=u,i,t.clearSide,e.flowName,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)}))},e.createPageFloatFragment=function(t,e,u,n){return new Ja(t[0].float.floatReference,e,t,u,n)},e.findPageFloatFragment=function(t,e){return e.findPageFloatFragment(t)},e.adjustPageFloatArea=function(t,e,u){},e.forbid=function(t,e){},t}()));var is=Ja,rs=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,"block-end",null,n,r)||this).footnotePolicy=void 0,o.footnotePolicy=i,o}return x(e,t),e.prototype.isAllowedToPrecede=function(t){return!(t instanceof e)},e}(Qa),os=function(t){function e(e,u,n,i){return t.call(this,e,"block-end",u,n,i)||this}x(e,t);var u=e.prototype;return u.getOrder=function(){return 1/0},u.shouldBeStashedBefore=function(t){return t instanceof rs||this.getOrder()=s.left&&s.bottom>=s.top)return t.after?n?s.left:s.bottom:n?s.right:s.top}return NaN}var l=i.ownerDocument.createRange(),D=i.textContent.length;if(!D)return NaN;t.after&&(u+=D),u>=D&&(u=D-1),l.setStart(i,u),l.setEnd(i,u+1);var h=e.getRangeClientRects(l);return(h=h.filter((function(t){return t.right>t.left&&t.bottom>t.top}))).length?n?Math.min.apply(null,h.map((function(t){return t.left}))):Math.max.apply(null,h.map((function(t){return t.bottom}))):NaN}function Es(t,e,u){var n=e.clientLayout.getElementClientRect(t),i=e.getComputedMargin(t);return u?n.width+i.left+i.right:n.height+i.top+i.bottom}function Cs(t){for(;t;){if(t.parentNode===t.ownerDocument)return!1;t=t.parentNode}return!0}function Fs(t,e){if(t)for(var u;(u=t.lastChild)!=e;)t.removeChild(u)}function As(t){return!!t.getAttribute(pr)}function gs(t){var e;if(1!==(null==t?void 0:t.nodeType))return!1;var u=t;if(As(u))return!0;var n=null==(e=u.style)?void 0:e.position;return"absolute"===n||"fixed"===n}function vs(t){var e=null==t?void 0:t.viewNode;return 1===(null==e?void 0:e.nodeType)&&As(e)}function ms(t){for(var e=t.parent;e;e=e.parent)if("inline"!==e.display&&ds(e.display))return e;return null}ns.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return"footnote"===t.floatSide},e.appliesToFloat=function(t){return t instanceof rs},e.createPageFloat=function(t,e,u){var n=qa.REGION,i=e.getPageFloatLayoutContext(n);e.getPageFloatLayoutContext(qa.PAGE).hasSameContainerAs(i)&&(n=qa.PAGE);var r=t.toNodePosition(),o=new rs(r,n,e.flowName,t.footnotePolicy,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)},e.createPageFloatFragment=function(t,e,u,n){return new os(t[0].float.floatReference,t,u,n)},e.findPageFloatFragment=function(t,e){return e.getPageFloatLayoutContext(t.floatReference).floatFragments.filter((function(t){return t instanceof os}))[0]||null},e.adjustPageFloatArea=function(t,e,u){t.isFootnote=!0,t.adjustContentRelativeSize=!1;var n=t.element;t.vertical=u.layoutContext.applyFootnoteStyle(e.vertical,u.layoutContext.nodeContext&&"rtl"===u.layoutContext.nodeContext.direction,n),t.convertPercentageSizesToPx(n),u.setComputedInsets(n,t),u.setComputedWidthAndHeight(n,t)},e.forbid=function(t,e){var u=t;if(u.footnotePolicy===Je.line){var n=new as(u);e.addLayoutConstraint(n,u.floatReference)}},t}()));var Bs=function(){function t(){}var e=t.prototype;return e.calculateOffset=function(t){return ys(this.getNodeContext(),t.collectElementsOffset())},e.breakPositionChosen=function(t){},e.getNodeContext=function(){return null},t}();function ys(t,e){return{current:e.reduce((function(e,u){return e+u.calculateOffset(t)}),0),minimum:e.reduce((function(e,u){return e+u.calculateMinimumOffset(t)}),0)}}var ws=function(t){function e(e,u,n,i){var r;return(r=t.call(this)||this).position=void 0,r.breakOnEdge=void 0,r.overflows=void 0,r.computedBlockSize=void 0,r.overflowIfRepetitiveElementsDropped=void 0,r.isEdgeUpdated=!1,r.edge=0,r.position=e,r.breakOnEdge=u,r.overflows=n,r.computedBlockSize=i,r.overflowIfRepetitiveElementsDropped=n,r}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return this.updateOverflows(t),e1){for(var r=i.length-1,o=0;o=0;w--){var N,b=e[w];if(c(b)){m=!0;break}if(!b.display&&b.viewNode.nodeType===Node.TEXT_NODE&&b.viewNode.textContent.length>0){F=b.viewNode;break}if(b.display&&!/^(inline|ruby)\b/.test(b.display)||1===(null==(N=b.viewNode)?void 0:N.nodeType)&&("br"===b.viewNode.localName||Ys[b.viewNode.localName]))break;0===w&&(g=!0,n&&(v=!0,m=!0))}for(var S=a+1;S0){A=T.viewNode;break}if(T.display&&!/^(inline|ruby)\b/.test(T.display)||1===(null==(x=T.viewNode)?void 0:x.nodeType)&&("br"===T.viewNode.localName||Ys[T.viewNode.localName])){S===e.length-1&&r(T.viewNode)&&(y=!0);break}if(S===e.length-1){B=!0,y=!0;for(var I=T.viewNode.nextSibling;I;I=I.nextSibling)if(!r(I)){y=!1;break}}}u.processTextSpacing(o.viewNode,g,v,m,B,y,F,A,p,E,C,f,o.vertical)}},a=0;ai.left+i.width-u.width/10:u.lefti.top+i.height-u.height/10||u.top+u.heightu.top+e.width||e.left>u.left+u.width-e.width/10||e.left+e.widthu.left+e.height||e.top+e.heightu.top+u.height-e.height/10)}var g,v=!1,m=!1,B=!1,y=!1;if(u&&D.first&&/^["'\(\[\{\xAB\xBB\u0F3A\u0F3C\u169B\u2018-\u201F\u2039\u203A\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E22\u2E24\u2E26\u2E28\u2E42\u2E55\u2E57\u2E59\u2E5B\u3000\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-open",v=!0,m=!0):r&&D.last&&/^["'\)\]\}\xAB\xBB\u0F3B\u0F3D\u169C\u2018\u2019\u201B-\u201D\u201F\u2039\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-close",v=!0,B=!0):D.end&&/^[\u3001\u3002\uFF0C\uFF0E\uFF61\uFF64](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-close",v=!0,y=!0):(l.trimStart||l.trimAdjacent)&&/^[\u2018\u201C\u2329\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFF08\uFF3B\uFF5B\uFF5F](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)?(g="viv-ts-open",v=!0):(l.trimEnd||l.trimAdjacent)&&(/^[\u2019\u201D\u232A\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFF09\uFF3D\uFF5D\uFF60](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)||"zh-hans"===h&&/^[\uFF1A\uFF1B](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)||"zh-hant"!==h&&/^[\u3001\u3002\uFF0C\uFF0E](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E))&&(g="viv-ts-close",v=!0),v){var w=function(){return c?N.offsetLeft:N.offsetTop};if("viv-ts-inner"===t.parentElement.localName)return;var N=C.createElement(g),b=C.createElement("viv-ts-inner");N.appendChild(b),t.parentNode.insertBefore(N,t),b.appendChild(t);var S=.7*parseFloat(C.defaultView.getComputedStyle(N).fontSize),x=(c?b.offsetHeight:b.offsetWidth)>S;if(x||m||B||y)if("viv-ts-open"===g){if(m)N.className="viv-hang-first";else if(u||n)N.className=l.trimStart&&!l.spaceFirst?"viv-ts-trim":"viv-ts-space";else if(!l.trimStart&&F())N.className="viv-ts-space";else if(l.trimAdjacent&&o&&/[\(\)\[\]\{\}\xAB\xB7\xBB\u0F3A-\u0F3D\u169B\u169C\u2018-\u201F\u2027\u2039\u203A\u2045\u2046\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E29\u2E42\u2E55-\u2E5C\u3000-\u3002\u3008-\u3011\u3014-\u301B\u301D-\u301F\u30FB\uFD3E\uFD3F\uFE17\uFE18\uFE35-\uFE44\uFE47\uFE48\uFE59-\uFE5E\uFF08\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3B\uFF3D\uFF5B\uFF5D\uFF5F\uFF60\uFF62\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)&&(!/[\)\]\}\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)||"viv-ts-inner"===o.parentElement.localName&&(c?o.parentElement.offsetHeight:o.parentElement.offsetWidth)>S))N.className="viv-ts-trim";else if(l.trimStart&&F()){var T=w();N.className="viv-ts-auto",T!==w()||F()||(N.className="viv-ts-trim")}}else if("viv-ts-close"===g)if(B)N.className=x?"viv-hang-last":"viv-hang-last viv-hang-hw";else if(r||i)if(y){var I=N.offsetLeft,P=N.offsetTop;N.className=x?"viv-hang-end":"viv-hang-end viv-hang-hw",N.offsetLeft===I&&N.offsetTop===P&&(N.className="")}else N.className=l.trimEnd?"viv-ts-trim":"viv-ts-space";else if(a&&/^[\)\]\}\xB7\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u2027\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3000-\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\u30FB\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3D\uFF5D\uFF60\uFF63]/.test(a.textContent))x&&l.trimAdjacent&&(N.className="viv-ts-trim");else if(y){var R=A(),k=R&&D.allowEnd;k||(N.className=x?"viv-hang-end":"viv-hang-end viv-hang-hw"),x?k&&l.trimEnd&&!l.allowEnd?N.className="viv-ts-auto":k||A()?!R&&D.allowEnd&&(!l.trimEnd||l.allowEnd?(N.className="viv-ts-space",A()||(l.trimEnd?(N.className="viv-ts-auto",A()||(N.className="viv-hang-end")):N.className="viv-hang-end")):(N.className="viv-ts-auto",A()||(N.className="viv-hang-end"))):N.className="":R||A()||(N.className="")}else if(l.trimEnd)if(A())N.className=l.allowEnd?"viv-ts-space":"viv-ts-auto";else{var L=w();N.className="viv-ts-auto",L===w()&&(N.className="")}}function O(t){var e,u=null==t||null==(e=t.ownerDocument.defaultView)?void 0:e.getComputedStyle(t);return!!u&&("upright"===u.textOrientation||"all"===u.textCombineUpright||"horizontal"===u["-webkit-text-combine"])}function _(t,e){if(1===t.nodeType){var u=C.defaultView.getComputedStyle(t);if(parseFloat(u.marginInlineEnd)||parseFloat(u.borderInlineEndWidth)||parseFloat(u.paddingInlineEnd))return!0}var n=t.parentElement;if(n&&!n.contains(e))return _(n,e);if(1===e.nodeType){var i=C.defaultView.getComputedStyle(e);if(parseFloat(i.marginInlineStart)||parseFloat(i.borderInlineStartWidth)||parseFloat(i.paddingInlineStart))return!0}var r=e.parentElement;return!(!r||r.contains(t))&&_(t,r)}(s.ideographAlpha||s.ideographNumeric)&&(!(o&&/^(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/.test(E)&&(s.ideographAlpha&&/(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF]))(?:[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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)||s.ideographNumeric&&/(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(o.textContent)))||c&&O(o.parentElement)||_(o,t)||t.parentNode.insertBefore(C.createElement("viv-ts-thin-sp"),t),!(a&&/(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(E)&&(s.ideographAlpha&&/^(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF]))(?:[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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/.test(a.textContent)||s.ideographNumeric&&/^(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])/.test(a.textContent)))||c&&O(a.parentElement)||_(t,a)||t.parentNode.insertBefore(C.createElement("viv-ts-thin-sp"),t.nextSibling))},u.registerHooks=function(){p(e.HOOKS.POLYFILLED_INHERITED_PROPS,this.getPolyfilledInheritedProps.bind(this)),p(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT,this.preprocessSingleDocument.bind(this)),p(e.HOOKS.POST_LAYOUT_BLOCK,this.postLayoutBlock.bind(this),!0)},t}());qs.registerHooks();var $s=(new DOMParser).parseFromString('',"text/xml"),Qs=["footnote-marker","first-5-lines","first-4-lines","first-3-lines","first-2-lines","first-line","first-letter","before","","after"],Zs="data-adapt-pseudo";function Js(t){return t.getAttribute(Zs)||""}function tl(t,e){t.setAttribute(Zs,e)}var el=function(){function t(t,e,u,n,i){this.element=void 0,this.style=void 0,this.styler=void 0,this.context=void 0,this.exprContentListener=void 0,this.contentProcessed={},this.element=t,this.style=e,this.styler=u,this.context=n,this.exprContentListener=i}var e=t.prototype;return e.getStyle=function(t,e){var u=Js(t);this.styler&&u&&u.match(/after$/)&&(this.style=this.styler.getStyle(this.element,!0),this.styler=null);var n=oo(this.style,"_pseudos")[u]||{};if(u.match(/^first-/)&&!n["x-first-pseudo"]){var i,r=1;"first-letter"==u?r=0:null!=(i=u.match(/^first-([0-9]+)-lines$/))&&(r=i[1]-0),n["x-first-pseudo"]=new $r(new He(r),0)}return n},e.processContent=function(t,e,u){var n=Js(t);if(!this.contentProcessed[n]){this.contentProcessed[n]=!0;var i=e.content;i&&Mr(i)&&(i.visit(new _r(t,this.context,i,this.exprContentListener)),function(t){qs.preprocessForTextSpacing(t)}(t))}},t}(),ul=Vi.registerFragmentIndex,nl=function(){function t(t,e){this.sourceNode=void 0,this.styler=void 0,this.sourceNode=t,this.styler=e}var e=t.prototype;return e.createElement=function(t,e){var u=this,n=e.viewNode.ownerDocument.createElement("div"),i=new cl(t,n,e),r=i.getColumn().pageBreakType;return i.getColumn().pageBreakType=null,i.layout(this.createNodePositionForPseudoElement(),!0).thenAsync((function(){u.styler.contentProcessed["after-if-continues"]=!1,i.getColumn().pageBreakType=r;var t=n.firstChild;return et(t,"display","block"),Rn(t)}))},e.createNodePositionForPseudoElement=function(){var t=$s.createElementNS(W.XHTML,"div");tl(t,"after-if-continues");var e=this.createShadowContext(t);return new Pr({steps:[{node:t,shadowType:e.type,shadowContext:e,nodeShadow:null,shadowSibling:null}],offsetInNode:0,after:!1,preprocessedTextContent:null})},e.createShadowContext=function(t){return new Sr(this.sourceNode,t,null,null,null,ur.ShadowType.ROOTED,this.styler)},t}(),il=function(){function t(t,e,u){this.nodeContext=void 0,this.afterIfContinues=void 0,this.pseudoElementHeight=void 0,this.flagmentLayoutConstraintType="AfterIfContinue",this.nodeContext=t,this.afterIfContinues=e,this.pseudoElementHeight=u}var e=t.prototype;return e.allowLayout=function(t,e,u){return!(e&&!t||t&&t.overflow)},e.nextCandidate=function(t){return!1},e.postLayout=function(t,e,u,n){},e.finishBreak=function(t,e){var u=this;return this.getRepetitiveElements().affectTo(t)?this.afterIfContinues.createElement(e,this.nodeContext).thenAsync((function(t){return u.nodeContext.viewNode.appendChild(t),Rn(!0)})):Rn(!0)},e.getRepetitiveElements=function(){return new rl(this.nodeContext,this.pseudoElementHeight)},e.equalsTo=function(e){return e instanceof t&&this.afterIfContinues==e.afterIfContinues},e.getPriorityOfFinishBreak=function(){return 9},t}(),rl=function(){function t(t,e){this.nodeContext=void 0,this.pseudoElementHeight=void 0,this.nodeContext=t,this.pseudoElementHeight=e}var e=t.prototype;return e.calculateOffset=function(t){return this.affectTo(t)?this.pseudoElementHeight:0},e.calculateMinimumOffset=function(t){return this.calculateOffset(t)},e.affectTo=function(t){if(!t)return!1;var e=t.shadowContext?t.shadowContext.owner:t.sourceNode;if(e===this.nodeContext.sourceNode)return!!t.after;for(var u=e.parentNode;u;u=u.parentNode)if(u===this.nodeContext.sourceNode)return!0;return!1},t}();function ol(t,e){if(!t||!t.afterIfContinues||t.after||e.isFloatNodeContext(t))return Rn(t);var u=t.afterIfContinues;return u.createElement(e,t).thenAsync((function(n){var i=function(t,e,u){var n=t.viewNode;n.appendChild(u);var i=Es(u,e,t.vertical);return n.removeChild(u),i}(t,e,n);return e.fragmentLayoutConstraints.push(new il(t,u,i)),Rn(t)}))}function al(t,e){return t.thenAsync((function(t){return ol(t,e)}))}var sl={img:!0,svg:!0,audio:!0,video:!0},ll=function(){function t(t){this.constraints=void 0,this.constraints=t}return t.prototype.allowLayout=function(t){return this.constraints.every((function(e){return e.allowLayout(t)}))},t}(),Dl=function(t){function e(e,u){var n;return(n=t.call(this)||this).checkPoints=void 0,n.penalty=void 0,n.alreadyEvaluated=!1,n.breakNodeContext=null,n.checkPoints=e,n.penalty=u,n}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return e0),this.alreadyEvaluated=!0),this.breakNodeContext)},u.getMinBreakPenalty=function(){return this.penalty},u.getNodeContext=function(){return this.alreadyEvaluated?this.breakNodeContext:this.checkPoints[this.checkPoints.length-1]},e}(Bs),hl=function(t){function u(e,u,n,i,r){var o;return(o=t.call(this,e)||this).layoutContext=void 0,o.clientLayout=void 0,o.layoutConstraint=void 0,o.pageFloatLayoutContext=void 0,o.last=void 0,o.viewDocument=void 0,o.flowRootFormattingContext=null,o.isFloat=!1,o.isFootnote=!1,o.startEdge=0,o.endEdge=0,o.beforeEdge=0,o.afterEdge=0,o.footnoteEdge=0,o.box=null,o.chunkPositions=null,o.bands=null,o.overflown=!1,o.breakPositions=null,o.pageBreakType=null,o.forceNonfitting=!0,o.leftFloatEdge=0,o.rightFloatEdge=0,o.bottommostFloatTop=0,o.stopAtOverflow=!0,o.lastAfterPosition=null,o.fragmentLayoutConstraints=[],o.pseudoParent=null,o.nodeContextOverflowingDueToRepetitiveElements=null,o.blockDistanceToBlockEndFloats=NaN,o.breakAtTheEdgeBeforeFloat=null,o.layoutContext=u,o.clientLayout=n,o.layoutConstraint=i,o.pageFloatLayoutContext=r,o.last=e.lastChild,o.viewDocument=e.ownerDocument,r.setContainer(k(o)),o}x(u,t);var n=u.prototype;return n.getTopEdge=function(){return this.vertical?this.rtl?this.endEdge:this.startEdge:this.beforeEdge},n.getBottomEdge=function(){return this.vertical?this.rtl?this.startEdge:this.endEdge:this.afterEdge},n.getLeftEdge=function(){return this.vertical?this.afterEdge:this.rtl?this.endEdge:this.startEdge},n.getRightEdge=function(){return this.vertical?this.beforeEdge:this.rtl?this.startEdge:this.endEdge},n.isFloatNodeContext=function(t){return!(!t.floatSide||this.isFloat&&!t.parent)},n.stopByOverflow=function(t){return this.stopAtOverflow&&!!t&&t.overflow},n.isOverflown=function(t){return this.vertical?tthis.footnoteEdge},n.getExclusions=function(){var t=this.pageFloatLayoutContext.getFloatFragmentExclusions();return this.exclusions.concat(t)},n.openAllViews=function(t){var e=this,u=Pn("openAllViews"),n=t.steps;this.layoutContext.setViewRoot(this.element,this.isFootnote);var i=n.length-1,r=null;return u.loop((function(){for(;i>=0&&(r=Nr(n[i],r),i!==n.length-1||r.formattingContext||(r.formattingContext=e.flowRootFormattingContext),0!=i||(r.offsetInNode=e.calculateOffsetInNodeForNodeContext(t),r.after=t.after,r.preprocessedTextContent=t.preprocessedTextContent,!r.after));){var u=e.layoutContext.setCurrent(r,0==i&&0==r.offsetInNode);if(i--,u.isPending())return u}return Rn(!1)})).then((function(){u.finish(r)})),u.result()},n.calculateOffsetInNodeForNodeContext=function(t){return t.preprocessedTextContent?sr(t.preprocessedTextContent,t.offsetInNode,1):t.offsetInNode},n.maybePeelOff=function(t,e){if(t.firstPseudo&&t.inline&&!t.after&&0==t.firstPseudo.count&&1!=t.viewNode.nodeType){var u,n,i=t.viewNode.textContent,r=i.match(_),o=r?r[0].length:0;if(!r&&3===(null==(u=t.sourceNode)?void 0:u.nodeType)&&3===(null==(n=t.sourceNode.nextSibling)?void 0:n.nodeType)&&i===t.sourceNode.textContent){var a=i+t.sourceNode.nextSibling.textContent,s=a.match(_);if(s){var l=s[0];o=l.length,t.sourceNode.textContent=l,t.viewNode.textContent=l,t.sourceNode.nextSibling.textContent=a.substr(o)}}return this.layoutContext.peelOff(t,o)}return Rn(t)},n.buildViewToNextBlockEdge=function(t,e){var u=this,n=!1,i=Pn("buildViewToNextBlockEdge");return i.loopWithFrame((function(i){t.viewNode&&!vs(t)&&e.push(t.copy()),u.maybePeelOff(t,0).then((function(r){r!==t&&(vs(t=r)||e.push(t.copy())),u.nextInTree(t).then((function(e){(t=e)?(!n&&u.layoutConstraint.allowLayout(t)||(n=!0,(t=t.modify()).overflow=!0),u.isFloatNodeContext(t)&&($a(t.floatReference)||"footnote"===t.floatSide)?u.layoutFloatOrFootnote(t).then((function(e){t=e,u.pageFloatLayoutContext.isInvalidated()&&(t=null),t?i.continueLoop():i.breakLoop()})):t.inline?i.continueLoop():i.breakLoop()):i.breakLoop()}))}))})).then((function(){i.finish(t)})),i.result()},n.nextInTree=function(t,e){return al(this.layoutContext.nextInTree(t,e),this)},n.buildDeepElementView=function(t){var e=this;if(!t.viewNode)return Rn(t);var u=[],n=t.sourceNode,i=Pn("buildDeepElementView");return i.loopWithFrame((function(i){t.viewNode&&t.inline&&!vs(t)?u.push(t.copy()):(u.length>0&&e.postLayoutBlock(t,u),u=[]),e.maybePeelOff(t,0).then((function(r){var o=r;if(o!==t){for(var a=o;a&&a.sourceNode!=n;)a=a.parent;if(null==a)return t=o,void i.breakLoop();vs(o)||u.push(o.copy())}e.nextInTree(o).then((function(u){(t=u)&&t.sourceNode!=n?e.layoutConstraint.allowLayout(t)?i.continueLoop():((t=t.modify()).overflow=!0,e.stopAtOverflow?i.breakLoop():i.continueLoop()):i.breakLoop()}))}))})).then((function(){u.length>0&&e.postLayoutBlock(t,u),i.finish(t)})),i.result()},n.createFloat=function(t,e,u,n){var i=this.viewDocument.createElement("div");return this.vertical?(n>=this.height&&(n-=.1),et(i,"height",u+"px"),et(i,"width",n+"px")):(u>=this.width&&(u-=.1),et(i,"width",u+"px"),et(i,"height",n+"px")),et(i,"float",e),et(i,"clear",e),this.element.insertBefore(i,t),i},n.killFloats=function(){for(var t=this.element.firstChild;t;){var e=t.nextSibling;if(1==t.nodeType){var u=t,n=u.style.cssFloat;if("left"!=n&&"right"!=n&&"none"!==n)break;this.element.removeChild(u)}t=e}},n.createFloats=function(){for(var t,e=this.element.firstChild,u=this.bands,n=this.vertical?this.getTopEdge():this.getLeftEdge(),i=this.vertical?this.getBottomEdge():this.getRightEdge(),r=!1,o=O(u);!(t=o()).done;){var a=t.value,s=a.y2-a.y1;a.left=this.createFloat(e,"left",a.x1-n,s),a.right=this.createFloat(e,"right",i-a.x2,s),r||(a.x1>=i||a.x2<=n?et(a.right,"float","none"):r=!0)}},n.calculateEdge=function(t,e,u,n){var i;if(t&&Cs(t.viewNode))return NaN;if(t&&t.after&&!t.inline&&(i=ps(t,this.clientLayout,0,this.vertical),!isNaN(i)))return i;for(var r=n-(t=e[u]).boxOffset;;){if(i=ps(t,this.clientLayout,r,this.vertical),!isNaN(i))return i;if(r>0)r--;else{if(--u<0)return this.beforeEdge;1!=(t=e[u]).viewNode.nodeType&&(r=t.viewNode.textContent.length)}}},n.parseComputedLength=function(t){if("number"==typeof t)return t;var e=t.match(/^(-?[0-9]*(\.[0-9]*)?)px$/);return e?parseFloat(e[0]):0},n.getComputedMargin=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.marginLeft),u.top=this.parseComputedLength(e.marginTop),u.right=this.parseComputedLength(e.marginRight),u.bottom=this.parseComputedLength(e.marginBottom)),u},n.getComputedPaddingBorder=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)),u},n.getComputedInsets=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new hu(0,0,0,0);if(e){if("border-box"==e.boxSizing)return this.getComputedMargin(t);u.left=this.parseComputedLength(e.marginLeft)+this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.marginTop)+this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.marginRight)+this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.marginBottom)+this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)}return u},n.setComputedInsets=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.marginLeft=this.parseComputedLength(u.marginLeft),e.borderLeft=this.parseComputedLength(u.borderLeftWidth),e.paddingLeft=this.parseComputedLength(u.paddingLeft),e.marginTop=this.parseComputedLength(u.marginTop),e.borderTop=this.parseComputedLength(u.borderTopWidth),e.paddingTop=this.parseComputedLength(u.paddingTop),e.marginRight=this.parseComputedLength(u.marginRight),e.borderRight=this.parseComputedLength(u.borderRightWidth),e.paddingRight=this.parseComputedLength(u.paddingRight),e.marginBottom=this.parseComputedLength(u.marginBottom),e.borderBottom=this.parseComputedLength(u.borderBottomWidth),e.paddingBottom=this.parseComputedLength(u.paddingBottom))},n.setComputedWidthAndHeight=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.width=this.parseComputedLength(u.width),e.height=this.parseComputedLength(u.height))},n.layoutUnbreakable=function(t){return this.buildDeepElementView(t)},n.layoutFloat=function(t){var e=this,u=Pn("layoutFloat"),n=t.viewNode,i=function(t,e,u){var n=e?"vertical-rl":"horizontal-tb";if("top"!==t&&"bottom"!==t||(t=Xa(t,n,u)),"block-start"===t&&(t="inline-start"),"block-end"===t&&(t="inline-end"),"inline-start"===t||"inline-end"===t){var i=function(t,e){var u=Ka[e];if(!u)throw new Error("unknown writing-mode: "+e);for(var n=0;nt.y2)return!1;for(var l=t.x1,D=t.x2,h=a;hl&&(l=c.x1),c.x2=e.length)return"left"==n?(u.x1=l,u.x2=l+r):(u.x1=D-r,u.x2=D),u.y2+=i-u.y1,u.y1=i,!0;i=e[a].y2,a++}}(p,e.bands,E,i),e.vertical&&(s=yu(E));var A,g=e.getComputedInsets(n);et(n,"width",s.x2-s.x1-g.left-g.right+"px"),et(n,"height",s.y2-s.y1-g.top-g.bottom+"px"),et(n,"position","absolute"),et(n,"display",t.display);var v=null;if(h&&(v=h.containingBlockForAbsolute?h:h.getContainingBlockForAbsolute()),v){var m=v.viewNode.ownerDocument.createElement("div");m.style.position="absolute",v.vertical?m.style.right="0":m.style.left="0",m.style.top="0",v.viewNode.appendChild(m),A=e.clientLayout.getElementClientRect(m),v.viewNode.removeChild(m)}else A={left:e.getLeftEdge()-e.paddingLeft,right:e.getRightEdge()+e.paddingRight,top:e.getTopEdge()-e.paddingTop};(v?v.vertical:e.vertical)?et(n,"right",A.right-s.x2+"px"):et(n,"left",s.x1-A.left+"px"),et(n,"top",s.y1-A.top+"px"),t.clearSpacer&&(t.clearSpacer.parentNode.removeChild(t.clearSpacer),t.clearSpacer=null);var B=e.vertical?s.x1:s.y2,y=e.vertical?s.x2:s.y1;e.isOverflown(B)&&0!=e.breakPositions.length?((t=t.modify()).overflow=!0,u.finish(t)):(e.killFloats(),p=new lu(e.getLeftEdge(),e.getTopEdge(),e.getRightEdge(),e.getBottomEdge()),e.vertical&&(p=Bu(p)),function(t,e,u,n,i){for(n||(n=[new du(u.y1,u.y2,u.x1,u.x2)]);n.length>0&&n[0].y2<=t.y1;)n.shift();if(0!=n.length){var r;n[0].y1D.y2&&(e.splice(s,0,new du(D.y2,r.y2,r.x1,r.x2)),r.y2=D.y2),D.x1!=D.x2&&("left"==i?r.x1=Math.min(D.x2,t.x2):r.x2=Math.max(D.x1,t.x1)),r.y2!=D.y2););}Nu(t,e)}}(p,e.bands,E,null,i),e.createFloats(),"left"==i?e.leftFloatEdge=B:e.rightFloatEdge=B,e.bottommostFloatTop=y,e.updateMaxReachedAfterEdge(B),u.finish(r))})),u.result()},n.setupFloatArea=function(t,e,u,n,i,r){var o=this.pageFloatLayoutContext,a=o.getContainer(e),s=t.element;a.element.parentNode.appendChild(s),t.isFloat=!0,t.originX=a.originX,t.originY=a.originY,t.vertical=a.vertical,t.rtl=a.rtl,t.marginLeft=t.marginRight=t.marginTop=t.marginBottom=0,t.borderLeft=t.borderRight=t.borderTop=t.borderBottom=0,t.paddingLeft=t.paddingRight=t.paddingTop=t.paddingBottom=0,t.exclusions=(a.exclusions||[]).concat(),t.forceNonfitting=!o.hasFloatFragments(),t.innerShape=null;var l=a.getPaddingRect();t.setHorizontalPosition(l.x1-a.originX,l.x2-l.x1),t.setVerticalPosition(l.y1-a.originY,l.y2-l.y1),i.adjustPageFloatArea(t,a,this),t.init();var D=!!o.setFloatAreaDimensions(t,e,u,n,!0,!o.hasFloatFragments(),r);return D?(t.killFloats(),t.init()):a.element.parentNode.removeChild(s),D},n.createPageFloatArea=function(t,e,u,n,i){var r=this.element.ownerDocument.createElement("div");et(r,"position","absolute");var o=this.pageFloatLayoutContext.getPageFloatLayoutContext(t.floatReference),a=new es(null,qa.COLUMN,null,this.pageFloatLayoutContext.flowName,t.nodePosition,null,null),s=o.getContainer(),l=new Cl(e,r,this.layoutContext.clone(),this.clientLayout,this.layoutConstraint,a,s);return a.setContainer(l),this.setupFloatArea(l,t.floatReference,e,u,n,i)?l:null},n.layoutSinglePageFloatFragment=function(t,e,u,n,i,r,o){var a=this.pageFloatLayoutContext,s=(t=(o?o.continuations:[]).concat(t))[0].float,l=a.getPageFloatPlacementCondition(s,e,u),D=this.createPageFloatArea(s,e,r,i,l),h={floatArea:D,pageFloatFragment:null,newPosition:null};if(!D)return Rn(h);var c=Pn("layoutSinglePageFloatFragment"),d=!1,f=0;return c.loopWithFrame((function(e){if(f>=t.length)e.breakLoop();else{var u=new Pr(t[f].nodePosition);D.layout(u,!0).then((function(t){h.newPosition=t,!t||n?(f++,e.continueLoop()):(d=!0,e.breakLoop())}))}})).then((function(){if(!d){var u=a.setFloatAreaDimensions(D,s.floatReference,e,r,!1,n,l);if(u){var o=i.createPageFloatFragment(t,u,D,!!h.newPosition);a.addPageFloatFragment(o,!0),h.pageFloatFragment=o}else d=!0}c.finish(h)})),c.result()},n.layoutPageFloatInner=function(t,e,u,n){var i=this,r=this.pageFloatLayoutContext,o=t.float;function a(e,u){u?r.removePageFloatFragment(u,!0):e&&e.element.parentNode.removeChild(e.element),r.restoreStashedFragments(o.floatReference),r.deferPageFloat(t)}r.stashEndFloatFragments(o);var s=Pn("layoutPageFloatInner");return this.layoutSinglePageFloatFragment([t],o.floatSide,o.clearSide,!r.hasFloatFragments(),e,u,n).then((function(t){var e=t.floatArea,u=t.pageFloatFragment,l=t.newPosition;u?i.layoutStashedPageFloats(o.floatReference,[n]).then((function(t){if(t){if(r.addPageFloatFragment(u),r.discardStashedFragments(o.floatReference),l){var n=new ts(o,l.primary);r.deferPageFloat(n)}s.finish(!0)}else a(e,u),s.finish(!1)})):(a(e,u),s.finish(!1))})),s.result()},n.layoutStashedPageFloats=function(t,e){var u=this,n=this.pageFloatLayoutContext,i=n.getStashedFloatFragments(t),r=[],o=[],a=!1,s=Pn("layoutStashedPageFloats"),l=0;return s.loopWithFrame((function(t){if(l>=i.length)t.breakLoop();else{var n=i[l];if(e.includes(n))return l++,void t.continueLoop();var s=(new ns).findByFloat(n.continuations[0].float);u.layoutSinglePageFloatFragment(n.continuations,n.floatSide,null,!1,s,null).then((function(e){var u=e.floatArea;u&&r.push(u);var n=e.pageFloatFragment;n?(o.push(n),l++,t.continueLoop()):(a=!0,t.breakLoop())}))}})).then((function(){a?(o.forEach((function(t){n.removePageFloatFragment(t,!0)})),r.forEach((function(t){var e=t.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))):i.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)})),s.finish(!a)})),s.result()},n.setFloatAnchorViewNode=function(t){var e=t.viewNode.parentNode,u=e.ownerDocument.createElement("span");u.setAttribute(pr,"1"),"footnote"===t.floatSide&&this.layoutContext.applyPseudoelementStyle(t,"footnote-call",u),e.appendChild(u),e.removeChild(t.viewNode);var n=t.modify();return n.after=!0,n.viewNode=u,n},n.resolveFloatReferenceFromColumnSpan=function(t,e,u){var n=this,i=Pn("resolveFloatReferenceFromColumnSpan"),r=this.pageFloatLayoutContext,o=r.getPageFloatLayoutContext(qa.REGION);return r.getContainer().widthn.width?qa.REGION:t)})):i.finish(e===Je.all?qa.REGION:t):i.finish(t),i.result()},n.layoutPageFloat=function(t){var e=this,u=this.pageFloatLayoutContext,n=(new ns).findByNodeContext(t),i=u.findPageFloatByNodePosition(t.toNodePosition());return(i?Rn(i):n.createPageFloat(t,u,this)).thenAsync((function(i){var r=wr(t,0),o=e.setFloatAnchorViewNode(t),a=n.findPageFloatFragment(i,u),s=new ts(i,r);if(a&&a.hasFloat(i))return u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(u.isForbidden(i)||u.hasPrecedingFloatsDeferredToNext(i))return u.deferPageFloat(s),u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(e.nodeContextOverflowingDueToRepetitiveElements)return Rn(null);var l=ps(o,e.clientLayout,0,e.vertical);return e.isOverflown(l)?Rn(o):e.layoutPageFloatInner(s,n,l,a).thenAsync((function(t){return t?Rn(null):(u.registerPageFloatAnchor(i,o.viewNode),Rn(o))}))}))},n.processLineStyling=function(t,e,u){var n=this,i=Pn("processLineStyling"),r=u.concat([]);u.splice(0,u.length);var o=0,a=t.firstPseudo;return 0==a.count&&(a=a.outer),i.loopWithFrame((function(u){if(a){var i=n.findLinePositions(r),s=a.count-o;if(i.length<=s)u.breakLoop();else{var l=n.findAcceptableBreakInside(r,i[s-1],!0);null!=l?n.finishBreak(l,!1,!1).then((function(){o+=s,n.layoutContext.peelOff(l,0).then((function(i){a=(t=i).firstPseudo,n.buildViewToNextBlockEdge(t,r=[]).then((function(t){e=t,u.continueLoop()}))}))})):u.breakLoop()}}else u.breakLoop()})).then((function(){Array.prototype.push.apply(u,r),i.finish(e)})),i.result()},n.isLoneImage=function(t){return!(2!=t.length&&this.breakPositions.length>0)&&t[0].sourceNode==t[1].sourceNode&&sl[t[0].sourceNode.localName]},n.getTrailingMarginEdgeAdjustment=function(t){for(var e=0,u=0,n=t.length-1;n>=0;n--){var i=t[n];if(!i.after||!i.viewNode||1!=i.viewNode.nodeType)break;var r=this.getComputedMargin(i.viewNode),o=this.vertical?-r.left:r.bottom;o>0?e=Math.max(e,o):u=Math.min(u,o)}return e+u},n.layoutBreakableBlock=function(t){var e=this,u=Pn("layoutBreakableBlock"),n=[];return this.buildViewToNextBlockEdge(t,n).then((function(i){var r=n.length-1;if(r<0)u.finish(i);else{e.postLayoutBlock(i,n);var o=e.calculateEdge(i,n,r,n[r].boxOffset),a=!1;if(!i||!Cs(i.viewNode)){var s=ys(i,e.collectElementsOffset());a=e.isOverflown(o+(e.vertical?-1:1)*s.minimum),e.isOverflown(o+(e.vertical?-1:1)*s.current)&&!e.nodeContextOverflowingDueToRepetitiveElements&&(e.nodeContextOverflowingDueToRepetitiveElements=i)}null==i&&(o+=e.getTrailingMarginEdgeAdjustment(n)),e.updateMaxReachedAfterEdge(o),(t.firstPseudo?e.processLineStyling(t,i,n):Rn(i)).then((function(t){n.length>0&&(e.saveBoxBreakPosition(n),a&&!e.isLoneImage(n)&&t&&((t=t.modify()).overflow=!0)),u.finish(t)}))}})),u.result()},n.postLayoutBlock=function(t,u){var n=this;C(e.HOOKS.POST_LAYOUT_BLOCK).forEach((function(e){e(t,u,n)}))},n.findEndOfLine=function(t,e,u){for(var n,i=this.vertical?t-1:t+1,r=0,o=e[0].boxOffset,a=r,s=e.length-1,l=e[s].boxOffset;on?D=h-1:a=h}var c=this.calculateEdge(null,e,a,n);if(this.vertical?c<=i:c>=i){for(l=n-1;e[a].boxOffset==n;)a--;s=a}else u&&this.updateMaxReachedAfterEdge(c),o=n,r=a}return{nodeContext:e[a],index:o,checkPointIndex:a}},n.findAcceptableBreakInside=function(t,e,u){var n,i=this.findEndOfLine(e,t,!0),r=i.nodeContext,o=r.viewNode;if(1!=o.nodeType&&"viv-ts-inner"!==(null==(n=o.parentElement)?void 0:n.localName)){var a=o;r=this.resolveTextNodeBreaker(r).breakTextNode(a,r,i.index,t,i.checkPointIndex,u)}else{var s=ms(r);if(s){var l;if((null==(l=this.breakPositions)?void 0:l[0])instanceof Dl&&null!=s&&s.viewNode.contains(this.breakPositions[0].checkPoints[0].viewNode))return null;r=s}}return this.clearOverflownViewNodes(r,!1),r},n.resolveTextNodeBreaker=function(t){return C(e.HOOKS.RESOLVE_TEXT_NODE_BREAKER).reduce((function(e,u){return u(t)||e}),dl.instance)},n.getRangeBoxes=function(t,e){for(var u,n=[],i=t.ownerDocument.createRange(),r=!1,o=t,a=null,s=!1,l=!0;l;){var D=!0;do{var h=null;o==e&&(l=1===e.nodeType&&!(!e.firstChild||r));var c=1===o.nodeType?o:null;c?r?r=!1:As(c)?D=!s:/^r(uby|[bt]c?)$/.test(c.localName)||"inline"!==(u=this.clientLayout.getElementComputedStyle(c).display)&&(ds(u)||fs(u))?((D=!s)&&("ruby"===c.localName&&o.firstChild&&(o=o.firstChild),i.setStartBefore(o),s=!0,a=o),o.contains(e)&&(l=!1)):h=o.firstChild:(s||(null==o.parentNode?l=!1:(i.setStartBefore(o),s=!0)),a=o),h||(h=o.nextSibling)||(r=!0,h=o.parentNode),o=h}while(D&&l);if(s){i.setEndAfter(a);for(var d=this.clientLayout.getRangeClientRects(i),f=0;f0){var h=Math.max(this.getBoxSize(l),1);D=s*this.getBeforeEdge(l)s*i?s*(i-this.getBeforeEdge(l))/h:1}if(0==o||D>=.6||D>=.2&&this.getStartEdge(l)>=r-1){r=this.getEndEdge(l),this.vertical?(n=0==o?l.right:Math.max(n,l.right),i=0==o?l.left:Math.min(i,l.left)):(n=0==o?l.top:Math.min(n,l.top),i=0==o?l.bottom:Math.max(i,l.bottom)),o++,a++;continue}}if(o>0&&(e.push(i),o=0),a>=u.length)break}return e.sort(dt),this.vertical&&e.reverse(),e},n.calculateClonedPaddingBorder=function(t){for(var e=0,u=t;u;u=u.parent)if(!u.inline&&zi(u.viewNode)){var n=this.getComputedPaddingBorder(u.viewNode);e+=u.vertical?-n.left:n.bottom,"table"===u.display&&(e+=(u.vertical?-1:1)*u.blockBorderSpacing)}return e},n.getOffsetByRepetitiveElements=function(t){return(t?t.calculateOffset(this):ys(null,this.collectElementsOffset())).current},n.findBoxBreakPosition=function(t,e){var u,n=this,i=this.element.parentNode,r=this.element.nextSibling;i.removeChild(this.element),i.insertBefore(this.element,r);for(var o,a,s=t.checkPoints,l=s[0];l.parent&&l.inline;)l=l.parent;e?(o=1,a=1):(o=Math.max((l.inheritedProps.widows||2)-0,1),a=Math.max((l.inheritedProps.orphans||2)-0,1));var D=this.calculateClonedPaddingBorder(l),h=this.findLinePositions(s),c=this.footnoteEdge-D,d=this.getBoxDir(),f=this.getOffsetByRepetitiveElements(t);c-=d*f;var p=this.findFirstOverflowingEdgeAndCheckPoint(s);isNaN(p.edge)&&(p.edge=1/0*d);var E=ct(h.length,(function(t){var e=h[t];return n.vertical?ec||e>=p.edge})),C=E<=0;C&&(E=ct(h.length,(function(t){return n.vertical?h[t]c})));var F,A=s[s.length-1].viewNode;if("viv-ts-inner"===(null==(u=A)?void 0:u.parentElement.localName)&&(A=A.parentElement.parentElement),(E===h.length&&A.nextSibling||E>=h.length-1&&A.parentElement.querySelector(".MJXc-display"))&&(o=0),(E=Math.min(h.length-o,E))=0&&!e;--i){e=(t=this.breakPositions[i]).findAcceptableBreak(this,u);var r=t.getMinBreakPenalty();r>u&&(n=Math.min(n,r))}}while(n>u&&!e&&this.forceNonfitting);return{breakPosition:e?t:null,nodeContext:e}},n.doFinishBreak=function(t,e,u,n){var i=this;if(this.pageFloatLayoutContext.isInvalidated()||this.pageBreakType||!e)return Rn(t);var r=Pn("doFinishBreak"),o=!1;if(!t){if(this.forceNonfitting)return c.warn("Could not find any page breaks?!!"),this.skipTailEdges(e).then((function(t){t?((t=t.modify()).overflow=!1,i.finishBreak(t,o,!0).then((function(){r.finish(t)}))):r.finish(t)})),r.result();t=u,o=!0,this.computedBlockSize=n}return this.finishBreak(t,o,!0).then((function(){r.finish(t)})),r.result()},n.isBreakable=function(t){return!!t.after||t.sourceNode.namespaceURI!==W.SVG&&!t.flexContainer},n.zeroIndent=function(t){var e=t.toString();return""==e||"auto"==e||!!e.match(/^0+(.0*)?[^0-9]/)},n.checkOverflowAndSaveEdge=function(t,e){if(!t)return!1;if(Cs(t.viewNode))return!1;var u=ps(t,this.clientLayout,0,this.vertical),n=ys(t,this.collectElementsOffset()),i=this.isOverflown(u+(this.vertical?-1:1)*n.minimum);if(this.isOverflown(u+(this.vertical?-1:1)*n.current)&&!this.nodeContextOverflowingDueToRepetitiveElements)this.nodeContextOverflowingDueToRepetitiveElements=t;else if(e){var r=u+this.getTrailingMarginEdgeAdjustment(e),o=this.footnoteEdge-this.getBoxDir()*n.current;u=this.vertical?Math.min(u,Math.max(r,o)):Math.max(u,Math.min(r,o))}return this.updateMaxReachedAfterEdge(u),i},n.checkOverflowAndSaveEdgeAndBreakPosition=function(t,e,u,n){if(!t)return!1;if(Cs(t.viewNode))return!1;var i=this.checkOverflowAndSaveEdge(t,e);return!u&&i||this.saveEdgeBreakPosition(t,n,i),i},n.applyClearance=function(t){if(!t.viewNode.parentNode)return!1;var e=this.getComputedMargin(t.viewNode),u=t.viewNode.ownerDocument.createElement("div");this.vertical?(u.style.bottom="0px",u.style.width="1px",u.style.marginRight=e.right+"px"):(u.style.right="0px",u.style.height="1px",u.style.marginTop=e.top+"px"),t.viewNode.parentNode.insertBefore(u,t.viewNode);var n=this.clientLayout.getElementClientRect(u),i=this.getBeforeEdge(n),r=this.getBoxDir(),o=t.clearSide,a=1/0*-this.getBoxDir();switch("all"===o&&(a=this.pageFloatLayoutContext.getPageFloatClearEdge(o,this)),o){case"left":a=r*Math.max(a*r,this.leftFloatEdge*r);break;case"right":a=r*Math.max(a*r,this.rightFloatEdge*r);break;default:a=r*Math.max(a*r,Math.max(this.rightFloatEdge*r,this.leftFloatEdge*r))}if(i*r>=a*r)return t.viewNode.parentNode.removeChild(u),!1;var s=Math.max(1,(a-i)*r);this.vertical?u.style.width=s+"px":u.style.height=s+"px",n=this.clientLayout.getElementClientRect(u);var l=this.getAfterEdge(n);if(!t.floatSide)if(this.vertical){var D=l+e.right-a;D>0==e.right>=0&&(D+=e.right),u.style.marginLeft=D+"px"}else{var h=a-(l+e.top);h>0==e.top>=0&&(h+=e.top),u.style.marginBottom=h+"px"}return t.clearSpacer=u,!0},n.isBFC=function(t){return!!Ts(t)||!!tr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t)},n.skipEdges=function(t,e,u){var n,i=this,r=t.after?null==(n=t.parent)?void 0:n.formattingContext:t.formattingContext;if(r&&!this.isBFC(r))return Rn(t);var o=Pn("skipEdges"),a=!u&&e&&t&&t.after,s=u,l=null,D=[],h=[],c=!1;function d(){return!!u||!e&&Yi(s)&&!function(){if(!l)return!1;for(var t=l;null!=(e=t)&&e.parent;t=t.parent){for(var e,u,n=t.after?t.viewNode:null==(u=t.viewNode)?void 0:u.previousSibling;n&&(Fr(n,t.parent.whitespace)||gs(n));)n=n.previousSibling;if(n)return!1}return!0}()}var f=function(){(t=D[0]||t).viewNode.parentNode.removeChild(t.viewNode),i.pageBreakType=s};return o.loopWithFrame((function(u){for(;t;){var n=(new Ns).find(t.formattingContext);do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(Fr(t.viewNode,t.whitespace))break;if(!t.after)return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)?(t=(i.stopAtOverflow&&l||t).modify()).overflow=!0:(t=t.modify()).breakBefore=s,void u.breakLoop()}if(!t.after){if(t.floatSide&&(i.breakAtTheEdgeBeforeFloat=ir(s)?s:null),n&&n.startNonInlineElementNode(t))break;if(t.clearSide&&i.applyClearance(t)&&e&&0===i.breakPositions.length&&i.saveEdgeBreakPosition(t.copy(),s,!1),!t.inline&&(l?ms(l):i.breakPositions[i.breakPositions.length-1]instanceof Dl)&&i.saveEdgeBreakPosition(t.copy(),s,!1),!i.isBFC(t.formattingContext)||tr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t.formattingContext)||i.isFloatNodeContext(t)||t.flexContainer||!t.nodeShadow&&!t.sourceNode.firstElementChild&&Fr(t.sourceNode.firstChild,t.whitespace))return D.push(t.copy()),s=rr(s,t.breakBefore),d()?f():!i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&i.layoutConstraint.allowLayout(t)||((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop()}if(1!=t.viewNode.nodeType)break;var r=t.viewNode.style;if(t.after){var o;t.floatSide&&(s=null!=(o=s)?o:i.breakAtTheEdgeBeforeFloat,i.breakAtTheEdgeBeforeFloat=null);var p=t.sourceNode;if("svg"===p.localName||"math"===p.localName||"true"===p.getAttribute("data-math-typeset")){c=!1,l=t.copy(),h.push(l),s=rr(null,t.breakAfter),i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s);break}if(t.inline)break;if(n&&n.afterNonInlineElementNode(t,i.stopAtOverflow))break;if(c){if(d())return f(),void u.breakLoop();D=[],e=!1,a=!1,s=null}c=!1,l=t.copy(),h.push(l),s=rr(s,t.breakAfter),!r||i.zeroIndent(r.paddingBottom)&&i.zeroIndent(r.borderBottomWidth)||(h=[l])}else{var E;if(D.push(t.copy()),s=rr(s,t.breakBefore),!(t.pageType==(null==(E=t.parent)?void 0:E.pageType)&&Yi(s)||i.layoutConstraint.allowLayout(t))&&(i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s),(t=t.modify()).overflow=!0,i.stopAtOverflow))return void u.breakLoop();if(sl[t.viewNode.localName])return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop();!r||i.zeroIndent(r.paddingTop)&&i.zeroIndent(r.borderTopWidth)||(a=!1,h=[]),c=!0}}while(0);var C=i.nextInTree(t,a);if(C.isPending())return void C.then((function(e){t=e,u.continueLoop()}));t=C.get()}i.checkOverflowAndSaveEdgeAndBreakPosition(l,h,!i.stopAtOverflow,s)?l&&i.stopAtOverflow&&((t=l.modify()).overflow=!0):Yi(s)&&(i.pageBreakType=s),u.breakLoop()})).then((function(){l&&(i.lastAfterPosition=l.toNodePosition()),o.finish(t)})),o.result()},n.skipTailEdges=function(t){var e=this,u=t.copy(),n=Pn("skipEdges"),i=null,r=!1;return n.loopWithFrame((function(n){for(;t;){do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(Fr(t.viewNode,t.whitespace))break;if(!t.after)return Yi(i)&&(e.pageBreakType=i),void n.breakLoop()}if(!t.after&&(e.isFloatNodeContext(t)||t.flexContainer))return Yi(i=rr(i,t.breakBefore))&&(e.pageBreakType=i),void n.breakLoop();if(1!=t.viewNode.nodeType)break;var o=t.viewNode.style;if(t.after){if(r){if(Yi(i))return e.pageBreakType=i,void n.breakLoop();i=null}r=!1,i=rr(i,t.breakAfter)}else{if(i=rr(i,t.breakBefore),sl[t.viewNode.localName])return Yi(i)&&(e.pageBreakType=i),void n.breakLoop();if(o&&(!e.zeroIndent(o.paddingTop)||!e.zeroIndent(o.borderTopWidth)))return void n.breakLoop()}r=!0}while(0);var a=e.layoutContext.nextInTree(t);if(a.isPending())return void a.then((function(e){t=e,n.continueLoop()}));t=a.get()}u=null,n.breakLoop()})).then((function(){n.finish(u)})),n.result()},n.layoutFloatOrFootnote=function(t){return $a(t.floatReference)||"footnote"===t.floatSide?this.layoutPageFloat(t):this.layoutFloat(t)},n.layoutNext=function(t,e,u){var n=this,i=Pn("layoutNext");return this.skipEdges(t,e,u||null).then((function(u){if(!(t=u)||n.pageBreakType||n.stopByOverflow(t))i.finish(t);else{var r=t.formattingContext;(new Ns).find(r).layout(t,n,e).thenFinish(i)}})),i.result()},n.clearOverflownViewNodes=function(t,e){if(t)for(var u=t.parent;t;t=u,u=u?u.parent:null){var n=(u||t).formattingContext;(new Ns).find(n).clearOverflownViewNodes(this,u,t,e),e=!1}},n.initGeom=function(){var t=this.element.ownerDocument.createElement("div");t.style.position="absolute",t.style.top=this.paddingTop+"px",t.style.right=this.paddingRight+"px",t.style.bottom=this.paddingBottom+"px",t.style.left=this.paddingLeft+"px",this.element.appendChild(t);var e=this.clientLayout.getElementClientRect(t);this.element.removeChild(t);var u=this.originX+this.left+this.getInsetLeft(),n=this.originY+this.top+this.getInsetTop();this.box=new lu(u,n,u+this.width,n+this.height),this.startEdge=e?this.vertical?this.rtl?e.bottom:e.top:this.rtl?e.right:e.left:0,this.endEdge=e?this.vertical?this.rtl?e.top:e.bottom:this.rtl?e.left:e.right:0,this.beforeEdge=e?this.vertical?e.right:e.top:0,this.afterEdge=e?this.vertical?e.left:e.bottom:0,this.leftFloatEdge=this.beforeEdge,this.rightFloatEdge=this.beforeEdge,this.bottommostFloatTop=this.beforeEdge,this.footnoteEdge=this.afterEdge,this.bands=function(t,e,u,n,i,r){r&&(t=Bu(t),e=e.map((function(t){return wu(t)})),u=u.map((function(t){return wu(t)})));var o,a,s,l=e.length,D=u?u.length:0,h=[],c=[];for(o=0;o=l;)f++;var p=c[f].low.y;p>t.y1&&h.push(new du(t.y1,p,t.x2,t.x2));for(var E,C,F=0,A=[];Fp&&A.push(s),F++;for(;F0;){var g=t.y2,v=Math.min((E=Math.ceil(p+8),(C=i)?Math.ceil(E/C)*C:E),t.y2);for(a=0;av;a++)(s=A[a]).low.x==s.high.x?s.high.yt.y2&&(g=t.y2);Fw&&(w=S,N=b)}h.push(0==w?new du(p,g,t.x2,t.x2):new du(p,g,Math.max(N,t.x1),Math.min(N+w,t.x2)))}if(g==t.y2)break;for(p=g,a=A.length-1;a>=0;a--)A[a].high.y<=g&&A.splice(a,1)}return Nu(t,h),h}(this.box,[this.getInnerShape()],this.getExclusions(),0,this.snapHeight,this.vertical),this.createFloats()},n.init=function(){this.chunkPositions=[],et(this.element,"width",this.width+"px"),et(this.element,"height",this.height+"px"),this.initGeom(),this.computedBlockSize=0,this.overflown=!1,this.pageBreakType=null,this.lastAfterPosition=null},n.saveEdgeBreakPosition=function(t,e,u){var n=t.copy(),i=(new Ns).find(t.formattingContext),r=this.calculateClonedPaddingBorder(n),o=i.createEdgeBreakPosition(n,e,u,this.computedBlockSize+r);this.breakPositions.push(o)},n.saveBoxBreakPosition=function(t){var e=t[0].breakPenalty;if(e){for(var u=t[0];u.parent&&u.inline;)u=u.parent;e=u.breakPenalty}var n=new Dl(t,e);this.breakPositions.push(n)},n.updateMaxReachedAfterEdge=function(t){if(!isNaN(t)){var e=this.getBoxDir()*(t-this.beforeEdge);this.computedBlockSize=Math.max(e,this.computedBlockSize)}},n.layout=function(t,e,u){var n=this;if(this.chunkPositions.push(t),t.primary.after&&(this.lastAfterPosition=t.primary),this.stopAtOverflow&&this.overflown)return Rn(t);if(this.isFullWithPageFloats())return Rn(t.primary.after&&1===t.primary.steps.length?null:t);var i=Pn("layout");return this.openAllViews(t.primary).then((function(t){var r=null;t.viewNode?r=t.copy():n.layoutContext.addEventListener("nextInTree",(function t(e){e.nodeContext.viewNode&&(r=e.nodeContext,n.layoutContext.removeEventListener("nextInTree",t))}));var o=new pl(e,u);o.layout(t,n).then((function(t){n.doFinishBreak(t,o.context.overflownNodeContext,r,o.initialComputedBlockSize).then((function(t){(n.pseudoParent?Rn(null):n.doFinishBreakOfFragmentLayoutConstraints(t)).then((function(){if(n.pageFloatLayoutContext.isInvalidated())i.finish(null);else if(t){n.overflown=!0;var e=new Pr(t.toNodePosition());i.finish(e)}else i.finish(null)}))}))}))})),i.result()},n.isFullWithPageFloats=function(){return this.pageFloatLayoutContext.isColumnFullWithPageFloats(this)},n.getMaxBlockSizeOfPageFloats=function(){return this.pageFloatLayoutContext.getMaxBlockSizeOfPageFloats()},n.doFinishBreakOfFragmentLayoutConstraints=function(t){var e=this,u=Pn("doFinishBreakOfFragmentLayoutConstraints"),n=[].concat(this.fragmentLayoutConstraints);n.sort((function(t,e){return t.getPriorityOfFinishBreak()-e.getPriorityOfFinishBreak()}));var i=0;return u.loop((function(){return i0&&isFinite(t)&&(this.blockDistanceToBlockEndFloats=this.getBoxDir()*(t-this.beforeEdge-this.computedBlockSize))},n.collectElementsOffset=function(){for(var t=this,e=[],u=this;u;u=u.pseudoParent)u.fragmentLayoutConstraints.forEach((function(u){if(tr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(u)){var n=u.getRepetitiveElements();e.push(n)}if(Ji.isInstanceOfAfterIfContinuesLayoutConstraint(u)){var i=u.getRepetitiveElements();e.push(i)}er.isInstanceOfTableRowLayoutConstraint(u)&&u.getElementsOffsetsForTableCell(t).forEach((function(t){e.push(t)}))}));return e},u}(Or),cl=function(){function t(t,e,u){this.startNodeContexts=[],this.column=void 0,this.column=Object.create(t),this.column.element=e,this.column.layoutContext=t.layoutContext.clone(),this.column.stopAtOverflow=!1,this.column.flowRootFormattingContext=u.formattingContext,this.column.pseudoParent=t;var n=this.column.calculateClonedPaddingBorder(u);this.column.footnoteEdge=this.column.footnoteEdge-n;var i=this;this.column.openAllViews=function(t){return hl.prototype.openAllViews.call(this,t).thenAsync((function(t){return i.startNodeContexts.push(t.copy()),Rn(t)}))}}var e=t.prototype;return e.layout=function(t,e){return this.column.layout(t,e)},e.findAcceptableBreakPosition=function(t){var e=this.column.findAcceptableBreakPosition();if(t){var u=this.startNodeContexts[0].copy(),n=new ws(u,null,u.overflow,0);if(n.findAcceptableBreak(this.column,0),!e.nodeContext)return{breakPosition:n,nodeContext:u}}return e},e.finishBreak=function(t,e,u){return this.column.finishBreak(t,e,u)},e.doFinishBreakOfFragmentLayoutConstraints=function(t){this.column.doFinishBreakOfFragmentLayoutConstraints(t)},e.isStartNodeContext=function(t){var e=this.startNodeContexts[0];return e.viewNode===t.viewNode&&e.after===t.after&&e.offsetInNode===t.offsetInNode},e.isLastAfterNodeContext=function(t){return yr(t.toNodePosition(),this.column.lastAfterPosition)},e.getColumnElement=function(){return this.column.element},e.getColumn=function(){return this.column},t}(),dl=function(){function t(){}var e=t.prototype;return e.breakTextNode=function(t,e,u,n,i,r){if(e.after)e.offsetInNode=t.length;else{var o=u-e.boxOffset,a=t.data;(o=173==a.charCodeAt(o)?this.breakAfterSoftHyphen(t,a,o,e):this.breakAfterOtherCharacter(t,a,o,e))>0&&(e=this.updateNodeContext(e,o,t))}return e},e.breakAfterSoftHyphen=function(t,e,u,n){return t.replaceData(u,e.length-u,n.breakWord?"":fl(n)),u+1},e.breakAfterOtherCharacter=function(t,e,u,n){var i=e.charAt(u);u++;var r=e.charAt(u);return t.replaceData(u,e.length-u,!n.breakWord&<(i)&<(r)?fl(n):""),u},e.updateNodeContext=function(t,e,u){return(t=t.modify()).offsetInNode+=e,t.breakBefore=null,t},t}();function fl(t){return t.hyphenateCharacter||t.parent&&t.parent.hyphenateCharacter||"-"}dl.instance=void 0,dl.instance=new dl;var pl=function(t){function e(e,u){var n;return(n=t.call(this)||this).leadingEdge=void 0,n.breakAfter=void 0,n.initialPageBreakType=null,n.initialComputedBlockSize=0,n.initialOverflown=!1,n.context={overflownNodeContext:null},n.leadingEdge=e,n.breakAfter=u||null,n}x(e,t);var u=e.prototype;return u.resolveLayoutMode=function(t){return new El(this.leadingEdge,this.breakAfter,this.context)},u.prepareLayout=function(t,e){e.fragmentLayoutConstraints=[],e.pseudoParent||(Ls=[])},u.clearNodes=function(e){t.prototype.clearNodes.call(this,e);for(var u=e;u;){var n=u.viewNode;n&&Fs(n.parentNode,n),u=u.parent}},u.saveState=function(e,u){t.prototype.saveState.call(this,e,u),this.initialPageBreakType=u.pageBreakType,this.initialComputedBlockSize=u.computedBlockSize,this.initialOverflown=u.overflown},u.restoreState=function(e,u){t.prototype.restoreState.call(this,e,u),u.pageBreakType=this.initialPageBreakType,u.computedBlockSize=this.initialComputedBlockSize,u.overflown=this.initialOverflown},e}(Is),El=function(){function t(t,e,u){this.leadingEdge=void 0,this.breakAfter=void 0,this.context=void 0,this.leadingEdge=t,this.breakAfter=e,this.context=u}var e=t.prototype;return e.doLayout=function(t,e){var u=this,n=Pn("DefaultLayoutMode.doLayout");return function(t,e){var u=Pn("processAfterIfContinuesOfAncestors"),n=t;return u.loop((function(){if(null!==n){var t=ol(n,e);return n=n.parent,t.thenReturn(!0)}return Rn(!1)})).then((function(){u.finish(!0)})),u.result()}(t,e).then((function(){e.doLayout(t,u.leadingEdge,u.breakAfter).then((function(t){u.context.overflownNodeContext=t.overflownNodeContext,n.finish(t.nodeContext)}))})),n.result()},e.accept=function(t,e){var u=this;return!(!e.pageFloatLayoutContext.isInvalidated()&&!e.pageBreakType)||e.fragmentLayoutConstraints.length<=0||e.fragmentLayoutConstraints.every((function(n){return n.allowLayout(t,u.context.overflownNodeContext,e)}))},e.postLayout=function(t,e,u,n){if(!n){var i=u.fragmentLayoutConstraints.some((function(e){return e.nextCandidate(t)}));n=!i}return u.fragmentLayoutConstraints.forEach((function(i){i.postLayout(n,t,e,u)})),n},t}(),Cl=function(t){function e(e,u,n,i,r,o,a){var s;return(s=t.call(this,u,n,i,r,o)||this).floatSide=void 0,s.parentContainer=void 0,s.rootViewNodes=[],s.floatMargins=[],s.adjustContentRelativeSize=!0,s.floatSide=e,s.parentContainer=a,s}x(e,t);var u=e.prototype;return u.openAllViews=function(e){var u=this;return t.prototype.openAllViews.call(this,e).thenAsync((function(t){return t&&u.fixFloatSizeAndPosition(t),Rn(t)}))},u.convertPercentageSizesToPx=function(t){var e=this.parentContainer.getPaddingRect(),u=e.x2-e.x1,n=e.y2-e.y1;function i(e,u){e.forEach((function(e){var n=ut(t,e);if(n&&"%"===n.charAt(n.length-1)){var i=parseFloat(n);et(t,e,u*i/100+"px")}}))}i(["width","max-width","min-width"],u),i(["height","max-height","min-height"],n),i(["margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left"],this.vertical?n:u),["margin-top","margin-right","margin-bottom","margin-left"].forEach((function(e){"auto"===ut(t,e)&&et(t,e,"0")}))},u.fixFloatSizeAndPosition=function(t){for(;t.parent;)t=t.parent;var e=t.viewNode;if(this.rootViewNodes.push(e),this.adjustContentRelativeSize&&this.convertPercentageSizesToPx(e),this.floatMargins.push(this.getComputedMargin(e)),this.adjustContentRelativeSize){var u=this.floatSide;if(this.parentContainer.vertical){if("block-end"===u||"left"===u){var n=ut(e,"height");""!==n&&"auto"!==n&&et(e,"margin-top","auto")}}else if("block-end"===u||"bottom"===u){var i=ut(e,"width");""!==i&&"auto"!==i&&et(e,"margin-left","auto")}}},u.getContentInlineSize=function(){var t=this;return Math.max.apply(null,this.rootViewNodes.map((function(e,u){var n=t.clientLayout.getElementClientRect(e),i=t.floatMargins[u];return t.vertical?i.top+n.height+i.bottom:i.left+n.width+i.right})))},e}(hl),Fl=function(){function t(t,e){this.parent=void 0,this.rootSourceNode=void 0,this.formattingContextType="RepetitiveElementsOwner",this.isRoot=!1,this.repetitiveElements=null,this.parent=t,this.rootSourceNode=e}var e=t.prototype;return e.getName=function(){return"Repetitive elements owner formatting context (RepetitiveElementsOwnerFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.getRepetitiveElements=function(){return this.repetitiveElements},e.getRootViewNode=function(t){var e=this.getRootNodeContext(t);return e?e.viewNode:null},e.getRootNodeContext=function(t){do{if(!t.belongsTo(this)&&t.sourceNode===this.rootSourceNode)return t}while(t=t.parent);return null},e.initializeRepetitiveElements=function(t){var e=this;this.repetitiveElements||Ls.some((function(t){return t.root===e.rootSourceNode&&(e.repetitiveElements=t.elements,!0)}))||(this.repetitiveElements=new Al(t,this.rootSourceNode),Ls.push({root:this.rootSourceNode,elements:this.repetitiveElements}))},e.saveState=function(){},e.restoreState=function(t){},t}(),Al=function(){function t(t,e){this.vertical=void 0,this.ownerSourceNode=void 0,this.headerSourceNode=null,this.footerSourceNode=null,this.headerViewNode=null,this.footerViewNode=null,this.headerNodePosition=null,this.footerNodePosition=null,this.headerHeight=0,this.footerHeight=0,this.isSkipHeader=!1,this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0,this.doneInitialLayout=!1,this.firstContentSourceNode=null,this.lastContentSourceNode=null,this.affectedNodeCache=[],this.afterLastContentNodeCache=[],this.allowInsert=!1,this.allowInsertRepeatitiveElements=void 0,this.vertical=t,this.ownerSourceNode=e}var e=t.prototype;return e.setHeaderNodeContext=function(t){this.headerNodePosition||(this.headerNodePosition=wr(t,0),this.headerSourceNode=t.sourceNode,this.headerViewNode=t.viewNode)},e.setFooterNodeContext=function(t){this.footerNodePosition||(this.footerNodePosition=wr(t,0),this.footerSourceNode=t.sourceNode,this.footerViewNode=t.viewNode)},e.updateHeight=function(t){this.headerViewNode&&(this.headerHeight=Es(this.headerViewNode,t,this.vertical),this.headerViewNode=null),this.footerViewNode&&(this.footerHeight=Es(this.footerViewNode,t,this.vertical),this.footerViewNode=null)},e.prepareLayoutFragment=function(){this.isSkipHeader=this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0},e.appendHeaderToFragment=function(t,e,u){return!this.headerNodePosition||this.isSkipHeader?Rn(!0):this.appendElementToFragment(this.headerNodePosition,t,e,u)},e.appendFooterToFragment=function(t,e,u){return!this.footerNodePosition||this.isSkipFooter?Rn(!0):this.appendElementToFragment(this.footerNodePosition,t,e,u)},e.appendElementToFragment=function(t,e,u,n){var i=this,r=e.viewNode,o=e.viewNode.ownerDocument.createElement("div");r.appendChild(o);var a=new cl(n,o,e),s=a.getColumn().pageBreakType;return a.getColumn().pageBreakType=null,this.allowInsertRepeatitiveElements=!0,a.layout(new Pr(t),!0).thenAsync((function(){return i.allowInsertRepeatitiveElements=!1,r.removeChild(o),i.moveChildren(o,r,u),a.getColumn().pageBreakType=s,Rn(!0)}))},e.moveChildren=function(t,e,u){if(e)for(;t.firstChild;){var n=t.firstChild;t.removeChild(n),n.setAttribute(pr,"1"),u?e.insertBefore(n,u):e.appendChild(n)}},e.calculateOffset=function(t){var e=0;return t&&!this.affectTo(t)||((!this.isSkipFooter||t&&this.isAfterLastContent(t))&&(e+=this.footerHeight),this.isSkipHeader||(e+=this.headerHeight)),e},e.calculateMinimumOffset=function(t){var e=0;return t&&!this.affectTo(t)||(t&&this.isAfterLastContent(t)&&(e+=this.footerHeight),this.enableSkippingHeader||(e+=this.headerHeight)),e},e.isAfterLastContent=function(t){var e=this;return this.findResultFromCache(t,this.afterLastContentNodeCache,(function(u){return e.isAfterNodeContextOf(e.lastContentSourceNode,t,!1)}))},e.affectTo=function(t){var e=this;return this.findResultFromCache(t,this.affectedNodeCache,(function(u){return e.isAfterNodeContextOf(e.ownerSourceNode,t,!0)}))},e.findResultFromCache=function(t,e,u){var n=e.filter((function(e){return e.nodeContext.sourceNode===t.sourceNode&&e.nodeContext.after===t.after}));if(n.length>0)return n[0].result;var i=u(t);return e.push({nodeContext:t,result:i}),i},e.isAfterNodeContextOf=function(t,e,u){for(var n=[],i=t;i;i=i.parentNode){if(e.sourceNode===i)return e.after;n.push(i)}for(var r=e.sourceNode;r;r=r.parentNode){var o=n.indexOf(r);if(o>=0)return!!u&&0===o;for(var a=r;a;a=a.previousElementSibling)if(n.includes(a))return!0}return e.after},e.isFirstContentNode=function(t){return t&&this.firstContentSourceNode===t.sourceNode},e.isEnableToUpdateState=function(){return!!(!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition||!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition)},e.updateState=function(){!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition?this.isSkipFooter=!0:!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition&&(this.isSkipHeader=!0)},e.preventSkippingHeader=function(){this.isSkipHeader=!1,this.enableSkippingHeader=!1},e.preventSkippingFooter=function(){this.isSkipFooter=!1,this.enableSkippingFooter=!1},e.isHeaderRegistered=function(){return!!this.headerNodePosition},e.isFooterRegistered=function(){return!!this.footerNodePosition},e.isHeaderSourceNode=function(t){return this.headerSourceNode===t},e.isFooterSourceNode=function(t){return this.footerSourceNode===t},t}(),gl=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!!t},e.postLayout=function(t,e,u,n){var i=this.formattingContext.getRepetitiveElements();return i&&(i.doneInitialLayout||(i.updateHeight(u),i.doneInitialLayout=!0)),n},t}(),vl=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!0},e.postLayout=function(t,e,u,n){return n},t}(),ml=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}x(e,t);var u=e.prototype;return u.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},u.accept=function(t,e){return!1},e}(gl),Bl=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}return x(e,t),e.prototype.doLayout=function(t,e){return t.belongsTo(this.formattingContext)||t.after||e.fragmentLayoutConstraints.unshift(new yl(t)),this.processor.doLayout(t,e)},e}(vl),yl=function(){function t(t){this.flagmentLayoutConstraintType="RepetitiveElementsOwner",this.nodeContext=void 0,this.nodeContext=t.formattingContext.getRootNodeContext(t)}var e=t.prototype;return e.allowLayout=function(t,e,u){var n=this.getRepetitiveElements();return!(n&&!Cs(this.nodeContext.viewNode)&&n.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},e.nextCandidate=function(t){var e=this.getRepetitiveElements();return!!e&&!!e.isEnableToUpdateState()&&(e.updateState(),!0)},e.postLayout=function(t,e,u,n){var i=this.getRepetitiveElements();i&&t&&n.stopAtOverflow&&(null==e||i.isAfterLastContent(e))&&i.preventSkippingFooter()},e.finishBreak=function(t,e){var u=this.nodeContext.formattingContext,n=this.getRepetitiveElements();if(!n)return Rn(!0);var i=this.nodeContext;return function(t,e,u){var n=t.getRepetitiveElements();if(n){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendHeaderToFragment(i,i.viewNode.firstChild,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return function(t,e,u){var n=t.getRepetitiveElements();if(n&&!n.isSkipFooter){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendFooterToFragment(i,null,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return n.prepareLayoutFragment(),Rn(!0)}))}))},e.getRepetitiveElements=function(){return this.nodeContext.formattingContext.getRepetitiveElements()},e.equalsTo=function(e){return e instanceof t&&this.nodeContext.formattingContext===e.nodeContext.formattingContext},e.getPriorityOfFinishBreak=function(){return 10},t}(),wl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.processor=void 0,n.formattingContext=e,n.processor=u,n}return x(e,t),e.prototype.resolveLayoutMode=function(t){var e=this.formattingContext.getRepetitiveElements();return t.belongsTo(this.formattingContext)||e.doneInitialLayout?(t.belongsTo(this.formattingContext)||t.after||e&&e.preventSkippingHeader(),new Bl(this.formattingContext,this.processor)):new ml(this.formattingContext,this.processor)},e}(Is),Nl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.formattingContext=e,n.column=u,n}x(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext,n=e.getRepetitiveElements();if(u.parent&&e.rootSourceNode===u.parent.sourceNode){switch(u.repeatOnBreak){case"header":if(!n.isHeaderRegistered())return n.setHeaderNodeContext(u),Rn(!0);u.repeatOnBreak="none";break;case"footer":if(!n.isFooterRegistered())return n.setFooterNodeContext(u),Rn(!0);u.repeatOnBreak="none"}n.firstContentSourceNode||(n.firstContentSourceNode=u.sourceNode)}return ks.prototype.startNonInlineElementNode.call(this,t)},u.afterNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext;return u.sourceNode===e.rootSourceNode&&(e.getRepetitiveElements().lastContentSourceNode=t.lastAfterNodeContext&&t.lastAfterNodeContext.sourceNode,t.break=!0),"header"===u.repeatOnBreak||"footer"===u.repeatOnBreak?Rn(!0):ks.prototype.afterNonInlineElementNode.call(this,t)},e}(ks);function bl(t,e){t&&function(t,e){for(var u=t;u;u=u.parent){var n=u.formattingContext;n&&n instanceof Fl&&!u.belongsTo(n)&&e(n,u)}}(t.after?t.parent:t,(function(t,u){er.isInstanceOfTableFormattingContext(t)||e.fragmentLayoutConstraints.push(new yl(u))}))}var Sl=new(function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var u=e.prototype;return u.layout=function(t,e,u){if(e.isFloatNodeContext(t))return e.layoutFloatOrFootnote(t);var n=t.formattingContext;return n.getRootViewNode(t)?(u&&bl(t.parent,e),t.belongsTo(n)?bs.prototype.layout.call(this,t,e,u):new wl(n,this).layout(t,e)):e.buildDeepElementView(t)},u.startNonInlineElementNode=function(t){var e=function(t){var e=t.formattingContext;return e&&e instanceof Fl?e:null}(t),u=e.getRepetitiveElements();return!!u&&(u.allowInsertRepeatitiveElements||!u.isHeaderSourceNode(t.sourceNode)&&!u.isFooterSourceNode(t.sourceNode)||t.viewNode.parentNode.removeChild(t.viewNode),!1)},u.doInitialLayout=function(t,e){var u=Pn("BlockLayoutProcessor.doInitialLayout");return this.layoutEntireBlock(t,e).thenFinish(u),u.result()},u.layoutEntireBlock=function(t,e){var u=new Nl(t.formattingContext,e);return new Rs(u,e.layoutContext).iterate(t)},u.doLayout=function(t,e){var u=t.formattingContext,n=Pn("doLayout");return al(e.layoutContext.nextInTree(t,!1),e).then((function(t){var i=t;n.loopWithFrame((function(t){for(var n=function(){var n=!0;if(e.layoutNext(i,!1).then((function(r){i=r,e.pageFloatLayoutContext.isInvalidated()||e.pageBreakType||i&&e.stopByOverflow(i)||i&&i.after&&i.sourceNode==u.rootSourceNode?t.breakLoop():n?n=!1:t.continueLoop()})),n)return n=!1,{v:void 0}};i;){var r=n();if("object"==typeof r)return r.v}t.breakLoop()})).then((function(){n.finish(i)}))})),n.result()},u.finishBreak=function(t,e,u,n){return bs.prototype.finishBreak.call(this,t,e,u,n)},u.clearOverflownViewNodes=function(t,e,u,n){bs.prototype.clearOverflownViewNodes(t,e,u,n)},e}(bs));p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof Fl&&!er.isInstanceOfTableFormattingContext(t)?Sl:null}));var xl=function(){function t(t,e){this.rowIndex=void 0,this.sourceNode=void 0,this.cells=[],this.rowIndex=t,this.sourceNode=e}var e=t.prototype;return e.addCell=function(t){this.cells.push(t)},e.getMinimumHeight=function(){return Math.min.apply(null,this.cells.map((function(t){return t.height})))},t}(),Tl=function(){function t(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.viewElement=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.height=0,this.anchorSlot=null,this.rowIndex=t,this.columnIndex=e,this.viewElement=u,this.colSpan=u.colSpan||1,this.rowSpan=u.rowSpan||1}var e=t.prototype;return e.setHeight=function(t){this.height=t},e.setAnchorSlot=function(t){this.anchorSlot=t},t}(),Il=function(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.cell=void 0,this.rowIndex=t,this.columnIndex=e,this.cell=u},Pl=function(){function t(t,e,u){this.column=void 0,this.cellNodeContext=void 0,this.pseudoColumn=void 0,this.empty=!1,this.column=t,this.cellNodeContext=u,this.pseudoColumn=new cl(t,e,u)}return t.prototype.findAcceptableBreakPosition=function(){var t=this.cellNodeContext.viewNode,e=this.cellNodeContext.verticalAlign;"middle"!==e&&"bottom"!==e||et(t,"vertical-align","top");var u=this.pseudoColumn.findAcceptableBreakPosition(!0);return et(t,"vertical-align",e),u},t}(),Rl=function(t,e){this.viewNode=void 0,this.side=void 0,this.viewNode=t,this.side=e},kl=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,n,i)||this).formattingContext=void 0,r.acceptableCellBreakPositions=null,r.rowIndex=null,r.formattingContext=e.formattingContext,r}x(e,t);var u=e.prototype;return u.findAcceptableBreak=function(e,u){var n=t.prototype.findAcceptableBreak.call(this,e,u);return ut}))},u.getCellFragmentOfCell=function(t){return this.cellFragments[t.rowIndex]&&this.cellFragments[t.rowIndex][t.columnIndex]},u.isFreelyFragmentableRow=function(t){return t.getMinimumHeight()>this.tableWidth/2},u.getColumnCount=function(){return this.columnCount<0&&(this.columnCount=Math.max.apply(null,this.rows.map((function(t){return t.cells.reduce((function(t,e){return t+e.colSpan}),0)})))),this.columnCount},u.updateCellSizes=function(t){var e=this;this.rows.forEach((function(u){u.cells.forEach((function(u){var n=t.getElementClientRect(u.viewElement);u.viewElement=null,u.setHeight(e.vertical?n.width:n.height)}))}))},u.findCellFromColumn=function(t){if(!t)return null;var e=null,u=0,n=0;t:for(u=0;u=t.rowIndex)return n;var o=i[t.columnIndex]&&e.getCellFragmentOfCell(i[t.columnIndex].cell);return!o||u.includes(o)||(e.collectElementsOffsetFromColumn(o.pseudoColumn.getColumn(),n),u.push(o)),n}),[])},u.collectElementsOffsetOfHighestColumn=function(){var t=this,e=[];return this.rows.forEach((function(u){u.cells.forEach((function(u,n){e[n]||(e[n]={collected:[],elements:[]});var i=e[n],r=t.getCellFragmentOfCell(u);r&&!i.collected.includes(r)&&(t.collectElementsOffsetFromColumn(r.pseudoColumn.getColumn(),i.elements),i.collected.push(r))}))})),[new _l(e.map((function(t){return t.elements})))]},u.collectElementsOffsetFromColumn=function(t,e){t.fragmentLayoutConstraints.forEach((function(t){if(tr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(t)){var u=t.getRepetitiveElements();e.push(u)}er.isInstanceOfTableRowLayoutConstraint(t)&&t.getElementsOffsetsForTableCell(null).forEach((function(t){e.push(t)}))}))},u.saveState=function(){return[].concat(this.cellBreakPositions)},u.restoreState=function(t){this.cellBreakPositions=t},e}(Fl),_l=function(){function t(t){this.repeatitiveElementsInColumns=void 0,this.repeatitiveElementsInColumns=t}var e=t.prototype;return e.calculateOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.current}))},e.calculateMinimumOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.minimum}))},e.calculateMaxOffsetOfColumn=function(t,e){var u=0;return this.repeatitiveElementsInColumns.forEach((function(n){var i=ys(t,n);u=Math.max(u,e(i))})),u},t}();function Ml(t){return function(t){return"table-row-group"===t||"table-header-group"===t||"table-footer-group"===t}(t)||function(t){return"table"===t||"inline-table"===t}(t)}function Ul(t,e,u){var n=t.nodeContext,i=n.display,r=n.parent?n.parent.display:null,o=!1;if("inline-table"===r&&!(n.formattingContext instanceof Ol))for(var a=n.parent;a;a=a.parent)if(a.formattingContext instanceof Ol){o=a.formattingContext===e;break}return o||"table-row"===i&&!Ml(r)||"table-cell"===i&&"table-row"!==r&&!Ml(r)||n.formattingContext instanceof Ol&&n.formattingContext!==e?u.buildDeepElementView(n).thenAsync((function(e){return t.nodeContext=e,Rn(!0)})):null}var Vl=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.rowIndex=-1,n.columnIndex=0,n.inRow=!1,n.checkPoints=[],n.inHeaderOrFooter=!1,n.formattingContext=e,n.column=u,n}x(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(e){var u=this.formattingContext,n=Ul(e,u,this.column);if(n)return n;this.postLayoutBlockContents(e);var i=e.nodeContext,r=i.display,o=u.getRepetitiveElements();switch(r){case"table":u.inlineBorderSpacing=i.inlineBorderSpacing;break;case"table-caption":var a=new Rl(i.viewNode,i.captionSide);u.captions.push(a);break;case"table-header-group":return o.isHeaderRegistered()||(this.inHeaderOrFooter=!0,o.setHeaderNodeContext(i)),Rn(!0);case"table-footer-group":return o.isFooterRegistered()||(this.inHeaderOrFooter=!0,o.setFooterNodeContext(i)),Rn(!0);case"table-row":this.inHeaderOrFooter||(this.inRow=!0,this.rowIndex++,this.columnIndex=0,u.addRow(this.rowIndex,new xl(this.rowIndex,i.sourceNode)),o.firstContentSourceNode||(o.firstContentSourceNode=i.sourceNode))}return t.prototype.startNonInlineElementNode.call(this,e)},u.afterNonInlineElementNode=function(e){var u=this.formattingContext,n=e.nodeContext,i=n.display,r=this.column.clientLayout;if(this.postLayoutBlockContents(e),n.sourceNode===u.tableSourceNode){var o=r.getElementComputedStyle(u.getRootViewNode(n));u.tableWidth=parseFloat(o[u.vertical?"height":"width"]),u.getRepetitiveElements().lastContentSourceNode=e.lastAfterNodeContext&&e.lastAfterNodeContext.sourceNode,e.break=!0}else switch(i){case"table-header-group":case"table-footer-group":if(this.inHeaderOrFooter)return this.inHeaderOrFooter=!1,Rn(!0);break;case"table-row":this.inHeaderOrFooter||(u.lastRowViewNode=n.viewNode,this.inRow=!1);break;case"table-cell":this.inHeaderOrFooter||(this.inRow||(this.rowIndex++,this.columnIndex=0,this.inRow=!0),u.addCell(this.rowIndex,new Tl(this.rowIndex,this.columnIndex,n.viewNode)),this.columnIndex++)}return t.prototype.afterNonInlineElementNode.call(this,e)},u.startNonElementNode=function(t){this.registerCheckPoint(t)},u.afterNonElementNode=function(t){this.registerCheckPoint(t)},u.startInlineElementNode=function(t){this.registerCheckPoint(t)},u.afterInlineElementNode=function(t){this.registerCheckPoint(t)},u.registerCheckPoint=function(t){var e=t.nodeContext;e&&e.viewNode&&!vs(e)&&this.checkPoints.push(e.clone())},u.postLayoutBlockContents=function(t){this.checkPoints.length>0&&this.column.postLayoutBlock(t.nodeContext,this.checkPoints),this.checkPoints=[]},e}(ks),Hl=function(t){function e(e,u){var n;return(n=t.call(this,!0)||this).formattingContext=void 0,n.column=void 0,n.inRow=!1,n.currentRowIndex=-1,n.currentColumnIndex=0,n.originalStopAtOverflow=void 0,n.inHeader=void 0,n.inFooter=void 0,n.formattingContext=e,n.column=u,n.originalStopAtOverflow=u.stopAtOverflow,u.stopAtOverflow=!1,n}x(e,t);var u=e.prototype;return u.resetColumn=function(){this.column.stopAtOverflow=this.originalStopAtOverflow},u.getColSpanningCellWidth=function(t){for(var e=this.formattingContext.colWidths,u=0,n=0;n1&&(et(r,"box-sizing","border-box"),et(r,this.formattingContext.vertical?"height":"width",this.getColSpanningCellWidth(t)+"px"));var o=r.ownerDocument.createElement("div");r.appendChild(o);var a=new Pl(this.column,o,e);return this.formattingContext.addCellFragment(n,i,a),1===u.primary.steps.length&&u.primary.after&&(a.empty=!0),a.pseudoColumn.layout(u,!0).thenReturn(!0)},u.hasBrokenCellAtSlot=function(t){var e=this.formattingContext.cellBreakPositions[0];return!!e&&e.cell.anchorSlot.columnIndex===t},u.extractRowSpanningCellBreakPositions=function(){var t=this.formattingContext.cellBreakPositions;if(0===t.length)return[];var e=[],u=0;do{var n=t[u],i=n.cell.rowIndex;if(i1;){var r=n.cloneNode(!0);t.insertBefore(r,n),e.push(r)}e.push(n)}n=n.nextElementSibling}for(;u-- >0;)n=t.ownerDocument.createElement("col"),t.appendChild(n),e.push(n)})),e},e.addMissingColElements=function(t,e,u,n){if(t.length0){var a=t.colWidths=this.getColumnWidths(i,o,n,u.clientLayout),s=this.getColGroupElements(e),l=this.normalizeAndGetColElements(s);this.addMissingColElements(l,s,o,e),l.forEach((function(t,e){et(t,n?"height":"width",a[e]+"px")})),s.forEach((function(t){r.appendChild(t.cloneNode(!0))})),t.colGroups=r}else t.colGroups=r}},e.doInitialLayout=function(t,e){var u=this,n=t.formattingContext;n.vertical=t.vertical,n.initializeRepetitiveElements(t.vertical);var i,r,o,a=(i=t.sourceNode,r=zl.findIndex((function(t){return t.root===i})),(o=zl[r])?o.tableLayoutOption:null);!function(t){var e=zl.findIndex((function(e){return e.root===t}));e>=0&&zl.splice(e,1)}(t.sourceNode);var s=Pn("TableLayoutProcessor.doInitialLayout"),l=t.copy();return this.layoutEntireTable(t,e).then((function(i){var r=i.viewNode,o=e.clientLayout.getElementClientRect(r),D=e.vertical?o.left:o.bottom;if(D+=(e.vertical?-1:1)*ys(t,e.collectElementsOffset()).current,!(e.isOverflown(D)||a&&a.calculateBreakPositionsInside))return e.breakPositions.push(new jl(l)),void s.finish(i);u.normalizeColGroups(n,r,e),n.updateCellSizes(e.clientLayout),s.finish(null)})),s.result()},e.addCaptions=function(t,e,u){var n=t.captions;n.forEach((function(t,i){t&&(e.insertBefore(t.viewNode,u),"top"===t.side&&(n[i]=null))}))},e.addColGroups=function(t,e,u){t.colGroups&&0===this.getColGroupElements(e).length&&e.insertBefore(t.colGroups.cloneNode(!0),u)},e.removeColGroups=function(t,e){if(t.colGroups&&e){var u=this.getColGroupElements(e);u&&u.forEach((function(t){e.removeChild(t)}))}},e.doLayout=function(t,e){var u=t.formattingContext,n=u.getRootViewNode(t),i=n.firstChild;this.addCaptions(u,n,i),this.addColGroups(u,n,i);var r=new Hl(u,e),o=new Rs(r,e.layoutContext),a=Pn("TableFormattingContext.doLayout");return o.iterate(t).thenFinish(a),a.result()},e.layout=function(t,e,u){var n=t.formattingContext;return n.getRootViewNode(t)?(u&&bl(t.parent,e),new Wl(n,this).layout(t,e)):e.buildDeepElementView(t)},e.createEdgeBreakPosition=function(t,e,u,n){return new kl(t,e,u,n)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.finishBreak=function(t,e,u,n){var i=e.formattingContext;if("table-row"===e.display){var r,o=i.findRowIndexBySourceNode(e.sourceNode);if(i.cellBreakPositions=[],(r=e.after?i.getRowSpanningCellsOverflowingTheRow(o):i.getCellsFallingOnRow(o)).length){var a=Pn("TableLayoutProcessor.finishBreak"),s=0;return a.loopWithFrame((function(t){if(s!==r.length){var e=r[s++],u=i.getCellFragmentOfCell(e),n=u.findAcceptableBreakPosition().nodeContext,a=u.cellNodeContext,l=a.toNodePosition(),D=new Pr(n.toNodePosition());i.cellBreakPositions.push({cellNodePosition:l,breakChunkPosition:D,cell:e});var h=a.viewNode;u.column.layoutContext.processFragmentedBlockEdge(u.cellNodeContext),o=u.penalty)return!1;var n=e.layoutResult.columns;return Math.max.apply(null,n.map((function(t){return t.computedBlockSize})))>Math.max.apply(null,n.map((function(t){return t.getMaxBlockSizeOfPageFloats()})))+1}function nD(t,e){var u=Math.max.apply(null,t[t.length-1].layoutResult.columns.map((function(t){return isNaN(t.blockDistanceToBlockEndFloats)?t.computedBlockSize:t.computedBlockSize-t.blockDistanceToBlockEndFloats+1})))-1;ut.computedBlockSize}))}var oD,aD=function(t){function e(e,u,n){return t.call(this,n,e,u)||this}x(e,t);var u=e.prototype;return u.calculatePenalty=function(t){if(t.columns.every((function(t){return 0===t.computedBlockSize})))return 1/0;var e,u,n=t.columns.filter((function(t){return!t.pageBreakType})).map((function(t){return t.computedBlockSize}));return u=Ql(e=n),Ql(e.map((function(t){var e=t-u;return e*e})))},u.hasNextCandidate=function(t){return uD(t)},u.updateCondition=function(t){nD(t,this.layoutContainer)},e}(eD),sD=function(t,e,u){this.endStuckFixed=void 0,this.endFixed=void 0,this.endSlipped=void 0,this.endStuckFixed=t,this.endFixed=e,this.endSlipped=u},lD=function(){function t(){this.map=[]}var e=t.prototype;return e.getMaxFixed=function(){return 0==this.map.length?0:this.map[this.map.length-1].endFixed},e.getMaxSlipped=function(){return 0==this.map.length?0:this.map[this.map.length-1].endSlipped},e.addStuckRange=function(t){if(0==this.map.length)this.map.push(new sD(t,t,t));else{var e=this.map[this.map.length-1],u=e.endSlipped+t-e.endFixed;e.endFixed==e.endStuckFixed?(e.endFixed=t,e.endStuckFixed=t,e.endSlipped=u):this.map.push(new sD(t,t,u))}},e.addSlippedRange=function(t){0==this.map.length?this.map.push(new sD(t,0,0)):this.map[this.map.length-1].endFixed=t},e.slippedByFixed=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endFixed})),n=this.map[u];return n.endSlipped-Math.max(0,n.endStuckFixed-t)},e.fixedBySlipped=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endSlipped})),n=this.map[u];return n.endStuckFixed-(n.endSlipped-t)},t}(),DD=function(){function t(e,u,n,i,r,o,a,s){if(this.context=void 0,this.style=void 0,this.offset=void 0,this.isRoot=void 0,this.flowChunk=void 0,this.atBlockStart=void 0,this.atFlowStart=void 0,this.isParentBoxDisplayed=void 0,this.flowName=void 0,this.isBlockValue=null,this.hasBoxValue=null,this.styleValues={},this.beforeBox=null,this.afterBox=null,this.breakBefore=null,this.context=e,this.style=u,this.offset=n,this.isRoot=i,this.flowChunk=r,this.atBlockStart=o,this.atFlowStart=a,this.isParentBoxDisplayed=s,this.flowName=r.flowName,this.hasBox()){var l=u._pseudos;if(l&&l.before){var D=new t(e,l.before,n,!1,r,this.isBlock(),a,!0);Mr(D.styleValue("content"))&&(this.beforeBox=D,this.breakBefore=D.breakBefore)}}this.breakBefore=rr(this.getBreakValue("before"),this.breakBefore),this.atFlowStart&&Yi(this.breakBefore)&&(r.breakBefore=rr(r.breakBefore,this.breakBefore))}var e=t.prototype;return e.buildAfterPseudoElementBox=function(e,u,n){if(this.hasBox()){var i=this.style._pseudos;if(i&&i.after){var r=new t(this.context,i.after,e,!1,this.flowChunk,u,n,!0);Mr(r.styleValue("content"))&&(this.afterBox=r)}}},e.styleValue=function(t,e){if(!(t in this.styleValues)){var u=this.style[t];this.styleValues[t]=u?u.evaluate(this.context,t):e||null}return this.styleValues[t]},e.displayValue=function(){return this.styleValue("display",Je.inline)},e.isBlock=function(){if(null===this.isBlockValue){var t=this.displayValue(),e=this.styleValue("position"),u=this.styleValue("float");this.isBlockValue=cs(t,e,u,this.isRoot)}return this.isBlockValue},e.hasBox=function(){return null===this.hasBoxValue&&(this.hasBoxValue=this.isParentBoxDisplayed&&this.displayValue()!==Je.none),this.hasBoxValue},e.getBreakValue=function(t){var e=null;if(this.isBlock()){var u=this.styleValue("break-"+t);u&&(e=u.toString())}return e},t}(),hD=function(){function t(t){this.context=void 0,this.stack=[],this.atBlockStart=!0,this.atFlowStart=!0,this.atStartStack=[],this.context=t}var e=t.prototype;return e.empty=function(){return 0===this.stack.length},e.lastBox=function(){return this.stack[this.stack.length-1]},e.lastFlowName=function(){var t=this.lastBox();return t?t.flowChunk.flowName:null},e.isCurrentBoxDisplayed=function(){return this.stack.every((function(t){return t.displayValue()!==Je.none}))},e.push=function(t,e,u,n){var i=this.lastBox();n&&i&&n.flowName!==i.flowName&&this.atStartStack.push({atBlockStart:this.atBlockStart,atFlowStart:this.atFlowStart});var r=n||i.flowChunk,o=this.atFlowStart||!!n,a=this.isCurrentBoxDisplayed(),s=new DD(this.context,t,e,u,r,o||this.atBlockStart,o,a);return this.stack.push(s),this.atBlockStart=s.hasBox()?!s.beforeBox&&s.isBlock():this.atBlockStart,this.atFlowStart=s.hasBox()?!s.beforeBox&&o:this.atFlowStart,s},e.encounteredTextNode=function(t){var e=this.lastBox();if((t.nodeType===Node.TEXT_NODE||t.nodeType===Node.CDATA_SECTION_NODE)&&(this.atBlockStart||this.atFlowStart)&&e.hasBox()){var u=Cr(e.styleValue("white-space",Je.normal).toString());u&&!Fr(t,u)&&(this.atBlockStart=!1,this.atFlowStart=!1)}},e.pop=function(t){var e=this.stack.pop();if(e.buildAfterPseudoElementBox(t,this.atBlockStart,this.atFlowStart),this.atFlowStart&&e.afterBox){var u=e.afterBox.getBreakValue("before");e.flowChunk.breakBefore=rr(e.flowChunk.breakBefore,u)}var n=this.lastBox();if(n)if(n.flowName===e.flowName)e.hasBox()&&(this.atBlockStart=this.atFlowStart=!1);else{var i=this.atStartStack.pop();this.atBlockStart=i.atBlockStart,this.atFlowStart=i.atFlowStart}return e},e.nearestBlockStartOffset=function(t){if(!t.atBlockStart)return t.offset;var e=this.stack.length-1,u=this.stack[e];for(u===t&&(e--,u=this.stack[e]);e>=0;){if(u.flowName!==t.flowName)return t.offset;if(!u.atBlockStart)return u.offset;if(u.isRoot)return u.offset;t=u,u=this.stack[--e]}throw new Error("No block start offset found!")},t}(),cD=function(){function t(t,e,u,n,i,r,o,a){this.xmldoc=void 0,this.scope=void 0,this.context=void 0,this.primaryFlows=void 0,this.validatorSet=void 0,this.counterListener=void 0,this.root=void 0,this.cascadeHolder=void 0,this.last=void 0,this.rootStyle={},this.styleMap={},this.flows={},this.flowChunks=[],this.flowListener=null,this.flowToReach=null,this.idToReach=null,this.cascade=void 0,this.offsetMap=void 0,this.primary=!0,this.primaryStack=[],this.rootBackgroundAssigned=!1,this.rootLayoutAssigned=!1,this.lastOffset=void 0,this.breakBeforeValues={},this.boxStack=void 0,this.bodyReached=!0,this.xmldoc=t,this.scope=u,this.context=n,this.primaryFlows=i,this.validatorSet=r,this.counterListener=o,this.root=t.root,this.cascadeHolder=e,this.last=this.root,this.cascade=e.createInstance(n,o,a,t.lang),this.offsetMap=new lD;var s=t.getElementOffset(this.root);this.lastOffset=s,this.boxStack=new hD(n),this.offsetMap.addStuckRange(s);var l=this.getAttrStyle(this.root);this.cascade.pushElement(this,this.root,l,s),this.postprocessTopStyle(l,!1),this.root.namespaceURI===W.XHTML&&(this.bodyReached=!1),this.primaryStack.push(!0),this.styleMap={},this.styleMap["e"+s]=l,this.lastOffset++,this.replayFlowElementsFromOffset(-1)}var e=t.prototype;return e.hasProp=function(t,e,u){var n=t[u];return n&&n.evaluate(this.context)!==e[u]},e.transferPropsToRoot=function(t,e){for(var u in e){var n=t[u];if(n)this.rootStyle[u]=n,delete t[u];else{var i=e[u];i&&(this.rootStyle[u]=new $r(i,oi))}}},e.postprocessTopStyle=function(t,e){if(e)for(var u=0,n=["writing-mode","direction"];u=this.lastOffset)){var e=this.context,u=this.xmldoc.getElementOffset(this.root);if(t=this.lastOffset))for(;;){if(1!=a.nodeType)s+=a.textContent.length;else{var l=a,D=this.getStyle(l,!1),h=D["flow-into"];if(h){var c=h.evaluate(e,"flow-into").toString();this.encounteredFlowElement(c,D,l,s)}s++}if(s>=this.lastOffset)break;var d=a.firstChild;if(null==d)for(;!(d=a.nextSibling);)if((a=a.parentNode)===this.root)return;a=d}}},e.resetFlowChunkStream=function(t){this.flowListener=t;for(var e=0;e0&&this.code%2!=0},e.markAsEndAlternate=function(t){this.code=2*t+2},e.isEndAlternate=function(){return this.code>0&&this.code%2==0},e.getAlternate=function(){return Math.floor((this.code-1)/2)},t}(),pD=function(t,e){this.where=void 0,this.success=void 0,this.what=-1,this.where=t,this.success=e};!function(t){t[t.FOLLOW=1]="FOLLOW",t[t.OPTIONAL=2]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.ALTERNATE=4]="ALTERNATE"}(oD||(oD={}));var ED=function(){function t(){this.nodes=[],this.connections=[],this.match=[],this.nomatch=[],this.error=[],this.emptyHead=!0}var e=t.prototype;return e.connect=function(t,e){for(var u=0;u=0?e?i.markAsStartAlternate(u):i.markAsEndAlternate(u):e?i.markAsStartGroup():i.markAsEndGroup(),this.nodes.push(i),this.connect(t,n);var r=new pD(n,!0),o=new pD(n,!1);t.push(this.connections.length),this.connections.push(o),t.push(this.connections.length),this.connections.push(r)},e.endSpecialGroup=function(){for(var t=[this.match,this.nomatch,this.error],e=0;e=0&&(o.what+=u),this.connections.push(o)}for(var a=0;a=t.length)i=i.failure;else{var s=t[r],l=s;if(i.isSpecial()){var D=!0;i.isStartGroup()?(o?o.push(a):o=[a],a=[]):i.isEndGroup()?a=o.length>0?o.pop():null:i.isEndAlternate()?a[i.getAlternate()]="taken":D=null==a[i.getAlternate()],i=D?i.success:i.failure}else{if(0==r&&!e&&i.validator instanceof yD&&this instanceof yD){if(l=new je(t).visit(i.validator)){r=t.length,i=i.success;continue}}else if(0==r&&!e&&i.validator instanceof wD&&this instanceof yD){if(l=new Ke(t).visit(i.validator)){r=t.length,i=i.success;continue}}else l=s.visit(i.validator);if(!l){i=i.failure;continue}if(l!==s&&t===n){n=[];for(var h=0;h0:r==t.length)?n:null},u.validateSingle=function(t){for(var e=null,u=this.first;u!==this.successTerminal&&u!==this.failureTerminal;)t?u.isSpecial()?u=u.success:(e=t.visit(u.validator))?(t=null,u=u.success):u=u.failure:u=u.failure;return u===this.successTerminal?e:null},u.visitEmpty=function(t){return this.validateSingle(t)},u.visitSlash=function(t){return this.validateSingle(t)},u.visitStr=function(t){return this.validateSingle(t)},u.visitIdent=function(t){return this.validateSingle(t)},u.visitNumeric=function(t){return this.validateSingle(t)},u.visitNum=function(t){return this.validateSingle(t)},u.visitInt=function(t){return this.validateSingle(t)},u.visitHexColor=function(t){return this.validateSingle(t)},u.visitURL=function(t){return this.validateSingle(t)},u.visitURange=function(t){return this.validateSingle(t)},u.visitSpaceList=function(t){return null},u.visitCommaList=function(t){return null},u.visitFunc=function(t){return this.validateSingle(t)},u.visitExpr=function(t){return null},e}(AD),yD=function(t){function e(e){return t.call(this,e)||this}x(e,t);var u=e.prototype;return u.visitSpaceList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new je(e):null},u.visitCommaList=function(t){for(var e=this.first,u=!1;e;){if(e.validator instanceof wD){u=!0;break}e=e.failure}if(u){var n=this.validateList(t.values,!1,0);return n===t.values?t:n?new Ke(n):null}return null},u.validateForShorthand=function(t,e){return this.validateList(t,!0,e)},e}(BD),wD=function(t){function e(e){return t.call(this,e)||this}x(e,t);var u=e.prototype;return u.visitSpaceList=function(t){return this.validateSingle(t)},u.visitCommaList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Ke(e):null},u.validateForShorthand=function(t,e){for(var u,n=this.first;n!==this.failureTerminal;){if(u=n.validator.validateForShorthand(t,e))return u;n=n.failure}return null},e}(BD),ND=function(t){function e(e,u){var n;return(n=t.call(this,u)||this).name=void 0,n.name=e,n}x(e,t);var u=e.prototype;return u.validateSingle=function(t){return null},u.visitFunc=function(t){if(t.name.toLowerCase()!=this.name)return null;var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Ye(t.name,e):null},e}(BD),bD=function(){function t(){}var e=t.prototype;return e.tryParse=function(t,e,u){return e},e.success=function(t,e){},t}(),SD=function(t){function e(e,u){var n;return(n=t.call(this)||this).name=void 0,n.validator=void 0,n.name=u,n.validator=e.validators[n.name],n}x(e,t);var u=e.prototype;return u.tryParse=function(t,e,u){if(u.values[this.name])return e;var n=this.validator.validateForShorthand(t,e);if(n){var i=n.length,r=i>1?new je(n):n[0];return this.success(r,u),e+i}return e},u.success=function(t,e){e.values[this.name]=t},e}(bD),xD=function(t){function e(e,u){var n;return(n=t.call(this,e,u[0])||this).names=void 0,n.names=u,n}return x(e,t),e.prototype.success=function(t,e){for(var u=0;ue)e=n,u=0;else if(++u==this.syntax.length){this.error=!0;break}}return e},e}(ID),RD=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.validateList=function(t){if(t.length>this.syntax.length||0==t.length)return this.error=!0,0;for(var e=0;e=t.length;)u=1==u?0:u-2;if(this.syntax[e].tryParse(t,u,this)!=u+1)return this.error=!0,0}return t.length},u.createSyntaxNode=function(){return new xD(this.validatorSet,this.propList)},e}(ID),kD=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.validateList=function(t){for(var e=t.length,u=0;uthis.syntax.length||0==t.length)return this.error=!0,0;for(var n=0;n=e;)i=1==i?0:i-2;var r=void 0;if(e+1=t.length;)r-=r==e+2?1:2;else r=i;if(2!=this.syntax[n].tryParse([t[i],t[r]],0,this))return this.error=!0,0}return t.length},e}(ID),LD=function(t){function e(){return t.call(this)||this}x(e,t);var u=e.prototype;return u.mergeIn=function(t,e){for(var u,n=O(this.propList);!(u=n()).done;){var i,r,o=u.value,a=null!=(i=null!=(r=e[o])?r:this.validatorSet.defaultValues[o])?i:Je.initial,s=t[o];s||(t[o]=s=[]),s.push(a)}},u.visitCommaList=function(t){for(var e={},u=0;ue.length)return this.error=!0,u;this.error=!1;var r=this.validatorSet.validators;if(!e[u].visit(r["font-size"]))return this.error=!0,u;if(this.values["font-size"]=e[u++],e[u]===ke){if(2+ ++u>e.length)return this.error=!0,u;if(!e[u].visit(r["line-height"]))return this.error=!0,u;this.values["line-height"]=e[u++]}var o=u==e.length-1?e[u]:new je(e.slice(u,e.length));return o.visit(r["font-family"])?(this.values["font-family"]=o,e.length):(this.error=!0,u)},u.visitCommaList=function(t){if(t.values[0].visit(this),this.error)return null;for(var e=[this.values["font-family"]],u=1;u expected");var C=h.num,F=C;if(t.consume(),(h=t.token()).type==Uu.COMMA){if(t.consume(),(h=t.token()).type!=Uu.INT)throw new Error(" expected");F=h.num,t.consume(),h=t.token()}if(h.type!=Uu.C_BRC)throw new Error("'}' expected");i.push(e.addCounts(i.pop(),C,F));break;case Uu.SEMICOL:if(D=s(),r.length>0)throw new Error("unclosed '"+r.pop().b+"'");break;default:throw new Error("unexpected token")}}t.consume(),e.isBuiltIn(u)?e.namedValidators[u]=D:e.validators[u]=D.isSimple()?D.nodes[0].validator:new yD(D)};;){var n=u();if("object"==typeof n)return n.v}},e.parseDefaults=function(t){for(;;){var e=this.readNameAndPrefixes(t,2);if(!e)return;for(var u=[];;){t.consume();var n=t.token();if(n.type==Uu.SEMICOL){t.consume();break}switch(n.type){case Uu.IDENT:u.push(Me(n.text));break;case Uu.NUM:u.push(new Ve(n.num));break;case Uu.INT:u.push(new He(n.num));break;case Uu.NUMERIC:u.push(new Ue(n.num,n.text));break;default:throw new Error("unexpected token")}}this.defaultValues[e]=u.length>1?new je(u):u[0]}},e.parseShorthands=function(t){for(;;){var e=this.readNameAndPrefixes(t,3);if(!e)return;var u=t.nthToken(1),n=void 0;u.type==Uu.IDENT&&MD[u.text]?(n=new MD[u.text],t.consume()):n=new PD,n.setOwner(this);for(var i=!1,r=[],o=!1,a=[],s=[];!i;)switch(t.consume(),(u=t.token()).type){case Uu.IDENT:if(this.validators[u.text])r.push(n.syntaxNodeForProperty(u.text)),u.text.includes("_")||s.push(u.text);else{if(!(this.shorthands[u.text]instanceof RD))throw new Error("'"+u.text+"' is neither a simple property nor an inset shorthand");var l=this.shorthands[u.text];r.push(l.createSyntaxNode()),s.push.apply(s,l.propList)}break;case Uu.SLASH:if(r.length>0||o)throw new Error("unexpected slash");o=!0;break;case Uu.O_BRK:a.push({slash:o,syntax:r}),r=[],o=!1;break;case Uu.C_BRK:var D=new TD(r,o),h=a.pop();o=h.slash,(r=h.syntax).push(D);break;case Uu.SEMICOL:i=!0,t.consume();break;default:throw new Error("unexpected token")}n.init(r,s),this.shorthands[e]=n}},e.parse=function(t){var e=new Sn(t,null);this.parseValidators(e),this.parseDefaults(e),this.parseShorthands(e),this.backgroundProps=this.makePropSet(["background"]),this.layoutProps=this.makePropSet(["margin","border","padding","columns","column-gap","column-rule","column-fill"])},e.makePropSet=function(t){for(var e,u={},n=O(t);!(e=n()).done;)for(var i,r=e.value,o=this.shorthands[r],a=O(o?o.propList:[r]);!(i=a()).done;){var s,l=i.value;u[l]=null!=(s=this.defaultValues[l])?s:Je.initial}return u},e.validatePropertyAndHandleShorthand=function(t,e,u,n){if(su(t))n.simpleProperty(t,e,u);else if(i=e,r=new HD,i.visit(r),r.varFound)n.simpleProperty(t,e,u);else{var i,r,o="",a=t,s=(t=t.toLowerCase()).match(/^-([a-z]+)-([-a-z0-9]+)$/);s&&(o=s[1],t=s[2]);var l=this.prefixes[t];if(l&&l[o]){var D=this.validators[t];if(D){var h=ou(e)||e.isExpr()?e:e.visit(D);if(h)n.simpleProperty(t,h,u);else{if(!o&&CSS.supports(t,e.toString()))return void n.simpleProperty(t,e,u);n.invalidPropertyValue(a,e)}}else{var c=this.shorthands[t].clone();ou(e)?c.propagateDefaultingValue(e,u,n):(e.visit(c),c.finish(u,n)||n.invalidPropertyValue(a,e))}}else CSS.supports(t,e.toString())?n.simpleProperty(a,e,u):n.unknownProperty(a,e)}},t}();function VD(){var t=new UD;return t.initBuiltInValidators(),t.parse(Yn),t}var HD=function(t){function e(){for(var e,u=arguments.length,n=new Array(u),i=0;i0){var a=u+e.getInsetRight(),s=a-Math.floor(a/n)*n;s>0&&(e.snapOffsetX=n-s,r+=e.snapOffsetX)}e.paddingRight=r,e.snapWidth=n},e.assignTopPosition=function(t,e){var u=this.getPropAsNumber(t,"snap-height"),n=this.getPropAsNumber(t,"top"),i=this.getPropAsNumber(t,"margin-top"),r=this.getPropAsNumber(t,"padding-top"),o=this.getPropAsNumber(t,"border-top-width");if(e.top=n,e.marginTop=i,e.borderTop=o,e.snapHeight=u,!this.vertical&&u>0){var a=n+e.getInsetTop(),s=a-Math.floor(a/u)*u;s>0&&(e.snapOffsetY=u-s,r+=e.snapOffsetY)}e.paddingTop=r,et(e.element,"top",n+"px"),et(e.element,"margin-top",i+"px"),et(e.element,"padding-top",r+"px"),et(e.element,"border-top-width",o+"px")},e.assignBottomPosition=function(t,e){var u=this.getPropAsNumber(t,"margin-bottom"),n=this.getPropAsNumber(t,"padding-bottom"),i=this.getPropAsNumber(t,"border-bottom-width"),r=this.getPropAsNumber(t,"height")-e.snapOffsetY;et(e.element,"height",r+"px"),et(e.element,"margin-bottom",u+"px"),et(e.element,"padding-bottom",n+"px"),et(e.element,"border-bottom-width",i+"px"),e.height=r-e.snapOffsetY,e.marginBottom=u,e.borderBottom=i,e.paddingBottom=n},e.assignBeforePosition=function(t,e){this.vertical?this.assignRightPosition(t,e):this.assignTopPosition(t,e)},e.assignAfterPosition=function(t,e){this.vertical?this.assignLeftPosition(t,e):this.assignBottomPosition(t,e)},e.assignStartEndPosition=function(t,e){this.vertical?(this.assignTopPosition(t,e),this.assignBottomPosition(t,e)):(this.assignRightPosition(t,e),this.assignLeftPosition(t,e))},e.sizeWithMaxHeight=function(t,e){et(e.element,"border-top-width","0px");var u=this.getPropAsNumber(t,"max-height");this.isTopDependentOnAutoHeight?e.setVerticalPosition(0,u):(this.assignTopPosition(t,e),e.height=u-=e.snapOffsetY,et(e.element,"height",u+"px"))},e.sizeWithMaxWidth=function(t,e){et(e.element,"border-left-width","0px");var u=this.getPropAsNumber(t,"max-width");if(this.isRightDependentOnAutoWidth)e.setHorizontalPosition(0,u);else{this.assignRightPosition(t,e),e.width=u-=e.snapOffsetX;var n=this.getPropAsNumber(t,"right");et(e.element,"right",n+"px"),et(e.element,"width",u+"px")}},e.prepareContainer=function(t,e,u,n,i){this.parentInstance&&this.vertical==this.parentInstance.vertical||et(e.element,"writing-mode",this.vertical?"vertical-rl":"horizontal-tb"),(this.vertical?this.isAutoWidth:this.isAutoHeight)?this.vertical?this.sizeWithMaxWidth(t,e):this.sizeWithMaxHeight(t,e):(this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),(this.vertical?this.isAutoHeight:this.isAutoWidth)?this.vertical?this.sizeWithMaxHeight(t,e):this.sizeWithMaxWidth(t,e):this.assignStartEndPosition(t,e);for(var r=0;r1){var D=this.getPropAsNumber(t,"column-rule-width"),h=this.getProp(t,"column-rule-style"),c=this.getProp(t,"column-rule-color");if(D>0&&h&&h!=Je.none&&c!=Je.transparent)for(var d=this.getPropAsNumber(t,"column-gap"),f=this.vertical?e.height:e.width,p=this.vertical?"border-top":"border-left",E=1;Ea){var c=h[r]=new Xh(l[r],D[r].style,e,s,i,a);g[r]=c.getOuterSize(),A=!0}}})),A&&(F=this.getSizesOfMarginBoxesAlongVariableDimension(h,C.extent),A=!1,[r,o,a].forEach((function(t){F[t]=g[t]||F[t]})));var v={};Object.keys(l).forEach((function(t){var r=t,o=th(s,D[r].style[e?"min-width":"min-height"],u.extent);if(o){var a=o.evaluate(n);if(F[r]0&&r>0){var o=i+r;if(o0&&(n.xSize=u*a/s)}n.xSize>0&&(n.ySize=u-n.xSize)}else i>0?n.xSize=u:r>0&&(n.ySize=u)}else t.hasAutoSize()?n.xSize=Math.max(u-e.getOuterSize(),0):e.hasAutoSize()&&(n.ySize=Math.max(u-t.getOuterSize(),0));else t?t.hasAutoSize()&&(n.xSize=u):e&&e.hasAutoSize()&&(n.ySize=u);return n},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),u.element.setAttribute("data-vivliostyle-page-box",!0)},e}(dh),Gh=function(){function t(t,e,u,n,i){this.container=void 0,this.isHorizontal=void 0,this.clientLayout=void 0,this.hasAutoSize_=void 0,this.size=null,this.container=t,this.isHorizontal=u,this.clientLayout=i;var r=e[u?"width":"height"];this.hasAutoSize_=!r||r===Je.auto||ou(r)}var e=t.prototype;return e.hasAutoSize=function(){return this.hasAutoSize_},e.getSize=function(){return this.size||(this.size=Ya(this.clientLayout,this.container.element,this.isHorizontal?[ja.MAX_CONTENT_WIDTH,ja.MIN_CONTENT_WIDTH]:[ja.MAX_CONTENT_HEIGHT,ja.MIN_CONTENT_HEIGHT])),this.size},e.getOuterMaxContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[ja.MAX_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[ja.MAX_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterMinContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[ja.MIN_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[ja.MIN_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.container.width+this.container.getInsetRight():this.container.getInsetTop()+this.container.height+this.container.getInsetBottom()},t}(),Wh=function(){function t(t){this.params=void 0,this.params=t}var e=t.prototype;return e.hasAutoSize=function(){return this.params.some((function(t){return t.hasAutoSize()}))},e.getOuterMaxContentSize=function(){var t=this.params.map((function(t){return t.getOuterMaxContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterMinContentSize=function(){var t=this.params.map((function(t){return t.getOuterMinContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterSize=function(){var t=this.params.map((function(t){return t.getOuterSize()}));return Math.max.apply(null,t)*t.length},t}(),Xh=function(t){function e(e,u,n,i,r,o){var a;return(a=t.call(this,e,u,n,i,r)||this).fixedSize=void 0,a.fixedSize=o,a}x(e,t);var u=e.prototype;return u.hasAutoSize=function(){return!1},u.getOuterMaxContentSize=function(){return this.getOuterSize()},u.getOuterMinContentSize=function(){return this.getOuterSize()},u.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.fixedSize+this.container.getInsetRight():this.container.getInsetTop()+this.fixedSize+this.container.getInsetBottom()},e}(Gh),jh=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).borderBoxWidth=null,n.borderBoxHeight=null,n.marginTop=null,n.marginRight=null,n.marginBottom=null,n.marginLeft=null,n}x(e,t);var u=e.prototype;return u.applyCascadeAndInit=function(e,u){var n=this.cascaded;for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&(i.match(/^column.*$/)||i.match(/^background-/))&&(n[i]=u[i]);t.prototype.applyCascadeAndInit.call(this,e,u),this.parentInstance.setPageAreaDimension({borderBoxWidth:this.borderBoxWidth,borderBoxHeight:this.borderBoxHeight,marginTop:this.marginTop,marginRight:this.marginRight,marginBottom:this.marginBottom,marginLeft:this.marginLeft})},u.initHorizontal=function(){var t=this.resolvePageBoxDimensions({start:"left",end:"right",extent:"width"});this.borderBoxWidth=t.borderBoxExtent,this.marginLeft=t.marginStart,this.marginRight=t.marginEnd},u.initVertical=function(){var t=this.resolvePageBoxDimensions({start:"top",end:"bottom",extent:"height"});this.borderBoxHeight=t.borderBoxExtent,this.marginTop=t.marginStart,this.marginBottom=t.marginEnd},u.resolvePageBoxDimensions=function(t){var e=this.style,u=this.pageBox.scope,n=t.start,i=t.end,r=t.extent,o=this.pageBox.pageSize[r].toExpr(u,null),a=th(u,e[r],o),s=th(u,e["margin-"+n],o),l=th(u,e["margin-"+i],o),D=eh(u,e["padding-"+n],o),h=eh(u,e["padding-"+i],o),c=nh(u,e["border-"+n+"-width"],e["border-"+n+"-style"],o),d=nh(u,e["border-"+i+"-width"],e["border-"+i+"-style"],o),f=we(u,o,ye(u,ye(u,c,D),ye(u,d,h)));return a?(f=we(u,f,a),s||l?s?l=we(u,f,s):s=we(u,f,l):l=s=Ne(u,f,new Ae(u,.5))):(s||(s=u.zero),l||(l=u.zero),a=we(u,f,ye(u,s,l))),this.hasBorderOrOutline()||s instanceof de&&s.num<0||l instanceof de&&l.num<0?(e[n]=new qe(s),e[i]=new qe(l),e["margin-"+n]=nu,e["margin-"+i]=nu,e["border-"+n+"-width"]=new qe(c),e["border-"+i+"-width"]=new qe(d)):(e[n]=nu,e[i]=nu,e["margin-"+n]=nu,e["margin-"+i]=nu,e["border-"+n+"-width"]=new qe(s),e["border-"+i+"-width"]=new qe(l),e["border-"+n+"-style"]=Je.solid,e["border-"+i+"-style"]=Je.solid,e["border-"+n+"-color"]=Je.transparent,e["border-"+i+"-color"]=Je.transparent,e["background-clip"]=Je.padding_box),e["padding-"+n]=new qe(D),e["padding-"+i]=new qe(h),e[r]=new qe(a),e["max-"+r]=new qe(a),{borderBoxExtent:we(u,o,ye(u,s,l)),marginStart:s,marginEnd:l}},u.hasBorderOrOutline=function(){var t=this,e=function(e){var u,n=null==(u=io(t.cascaded,e))?void 0:u.value;return!!n&&n!==Je.none};return e("border-top-style")||e("border-bottom-style")||e("border-left-style")||e("border-right-style")||e("border-block-start-style")||e("border-block-end-style")||e("border-inline-start-style")||e("border-inline-end-style")||e("outline-style")},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),n.pageAreaElement=u.element,e.pageAreaWidth=parseFloat(n.pageAreaElement.style.width),e.pageAreaHeight=parseFloat(n.pageAreaElement.style.height)},e}(ph),Kh=function(t){function e(e,u){var n;(n=t.call(this,e,u)||this).boxInfo=void 0,n.suppressEmptyBoxGeneration=!0;var i=u.marginBoxName;return n.boxInfo=Lh[i],e.pageMarginBoxInstances[i]=k(n),n}x(e,t);var u=e.prototype;return u.prepareContainer=function(e,u,n,i,r){this.applyVerticalAlign(e,u.element),t.prototype.prepareContainer.call(this,e,u,n,i,r)},u.applyVerticalAlign=function(t,e){et(e,"display","flex"),et(e,"flex-flow",this.vertical?this.rtl?"row-reverse":"row":"column");var u=this.getProp(t,"vertical-align"),n=null;u===Me("middle")?n="center":u===Me("top")?n="flex-start":u===Me("bottom")&&(n="flex-end"),n&&et(e,"justify-content",n);var i=this.getProp(t,"content");if(this.vertical||i instanceof Ge||i instanceof qe&&i.expr instanceof Ee&&i.expr.str.startsWith("running-element-")){var r="center";(this.boxInfo.isInTopRow||this.boxInfo.isInBottomRow)&&(this.boxInfo.isInLeftColumn||this.boxInfo.positionAlongVariableDimension===Ph.END?r=this.vertical||this.rtl?"start":"end":(this.boxInfo.isInRightColumn||this.boxInfo.positionAlongVariableDimension===Ph.START)&&(r=this.vertical||this.rtl?"end":"start")),et(e,"align-items",r)}},u.positionAlongVariableDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.start,r=t.end,o="left"===i,a=o?e.borderBoxWidth:e.borderBoxHeight,s=th(n,u[t.extent],a),l=o?e.marginLeft:e.marginTop;if(this.boxInfo.positionAlongVariableDimension===Ph.START)u[i]=new qe(l);else if(s){var D=eh(n,u["margin-"+i],a),h=eh(n,u["margin-"+r],a),c=eh(n,u["padding-"+i],a),d=eh(n,u["padding-"+r],a),f=nh(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),p=nh(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),E=ye(n,s,ye(n,ye(n,c,d),ye(n,ye(n,f,p),ye(n,D,h))));switch(this.boxInfo.positionAlongVariableDimension){case Ph.CENTER:u[i]=new qe(ye(n,l,be(n,we(n,a,E),new Ae(n,2))));break;case Ph.END:u[i]=new qe(we(n,ye(n,l,a),E))}}},u.positionAndSizeAlongFixedDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.inside,r=t.outside,o=t.extent,a=e["margin"+r.charAt(0).toUpperCase()+r.substring(1)],s=uh(n,u["margin-"+i],a),l=uh(n,u["margin-"+r],a),D=eh(n,u["padding-"+i],a),h=eh(n,u["padding-"+r],a),c=nh(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),d=nh(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),f=th(n,u[o],a),p=null;function E(t){if(p)return p;p={extent:f?f.evaluate(t):null,marginInside:s?s.evaluate(t):null,marginOutside:l?l.evaluate(t):null};var e=a.evaluate(t),u=0;return[c,D,h,d].forEach((function(e){e&&(u+=e.evaluate(t))})),(null===p.marginInside||null===p.marginOutside)&&u+p.extent+p.marginInside+p.marginOutside>e&&(null===p.marginInside&&(p.marginInside=0),null===p.marginOutside&&(p.marginOutside=0)),null!==p.extent&&null!==p.marginInside&&null!==p.marginOutside&&(p.marginOutside=null),null===p.extent&&null!==p.marginInside&&null!==p.marginOutside?p.extent=e-u-p.marginInside-p.marginOutside:null!==p.extent&&null===p.marginInside&&null!==p.marginOutside?p.marginInside=e-u-p.extent-p.marginOutside:null!==p.extent&&null!==p.marginInside&&null===p.marginOutside?p.marginOutside=e-u-p.extent-p.marginInside:null===p.extent?(p.marginInside=p.marginOutside=0,p.extent=e-u):p.marginInside=p.marginOutside=(e-u-p.extent)/2,p}u[o]=new qe(new Ee(n,(function(){var t=E(this).extent;return null===t?0:t}),o)),u["margin-"+i]=new qe(new Ee(n,(function(){var t=E(this).marginInside;return null===t?0:t}),"margin-"+i)),u["margin-"+r]=new qe(new Ee(n,(function(){var t=E(this).marginOutside;return null===t?0:t}),"margin-"+r)),"left"===i?u.left=new qe(ye(n,e.marginLeft,e.borderBoxWidth)):"top"===i&&(u.top=new qe(ye(n,e.marginTop,e.borderBoxHeight)))},u.initHorizontal=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInLeftColumn?this.positionAndSizeAlongFixedDimension({inside:"right",outside:"left",extent:"width"},t):this.boxInfo.isInRightColumn?this.positionAndSizeAlongFixedDimension({inside:"left",outside:"right",extent:"width"},t):this.positionAlongVariableDimension({start:"left",end:"right",extent:"width"},t)},u.initVertical=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInTopRow?this.positionAndSizeAlongFixedDimension({inside:"bottom",outside:"top",extent:"height"},t):this.boxInfo.isInBottomRow?this.positionAndSizeAlongFixedDimension({inside:"top",outside:"bottom",extent:"height"},t):this.positionAlongVariableDimension({start:"top",end:"bottom",extent:"height"},t)},u.finishContainer=function(e,u,n,i,r,o,a){t.prototype.finishContainer.call(this,e,u,n,i,r,o,a);var s=n.marginBoxes,l=this.pageBox.marginBoxName,D=this.boxInfo;D.isInLeftColumn||D.isInRightColumn?D.isInTopRow||D.isInBottomRow||(D.isInLeftColumn?s.left[l]=u:D.isInRightColumn&&(s.right[l]=u)):D.isInTopRow?s.top[l]=u:D.isInBottomRow&&(s.bottom[l]=u)},e}(ph),Yh=function(){function t(t,e,u,n,i){this.cascadeInstance=void 0,this.pageScope=void 0,this.rootPageBoxInstance=void 0,this.context=void 0,this.docElementStyle=void 0,this.pageMasterCache={},this.cascadeInstance=t,this.pageScope=e,this.rootPageBoxInstance=u,this.context=n,this.docElementStyle=i,this.definePageProgression()}var u=t.prototype;return u.definePageProgression=function(){var t=this.pageScope,u=this.context,n=u.isVersoFirstPage,i=new fe(t,"page-number"),r=new oe(t,new ce(t,i,new Ae(t,2)),n?t.one:t.zero);t.defineName("recto-page",new Yt(t,r)),t.defineName("verso-page",r),(u.pageProgression||gh(this.docElementStyle))===e.PageProgression.LTR?(t.defineName("left-page",r),t.defineName("right-page",new Yt(t,r))):(t.defineName("left-page",new Yt(t,r)),t.defineName("right-page",r))},u.getCascadedPageStyle=function(t){var e={};return this.cascadeInstance.pushRule([],t,e),this.cascadeInstance.popRule(),e},u.getPageRulePageMaster=function(t,e){var u=t.pageBox;if(0===Object.keys(e).length)return u.resetScope(),t;var n=this.makeCacheKey(e,u),i=this.pageMasterCache[n];return i||(i=u.pseudoName===hh?this.generatePageRuleMaster(e):this.generateCascadedPageMaster(e,u),this.pageMasterCache[n]=i),i.pageBox.resetScope(),i},u.makeCacheKey=function(t,e){var u=this.makeCascadeValueObjectKey(t);return e.key+"^"+u},u.makeCascadeValueObjectKey=function(t){var e=[];for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var n,i=t[u];n=i instanceof $r?""+i.value:this.makeCascadeValueObjectKey(i),e.push(u+n+(i.priority||""))}return e.sort().join("^")},u.generatePageRuleMaster=function(t){var e=new Uh(this.pageScope,this.rootPageBoxInstance.pageBox,t).createInstance(this.rootPageBoxInstance);return e.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),e.resolveAutoSizing(this.context),e},u.generateCascadedPageMaster=function(t,e){var u=e.clone({pseudoName:_h}),n=u.specified,i=t.size;if(i&&!ou(i.value)){var r=bh(t),o=i.priority;Jr(n,"width",new $r(r.width,o),this.context),Jr(n,"height",new $r(r.height,o),this.context)}["counter-reset","counter-increment"].forEach((function(e){n[e]&&(t[e]=n[e])}));var a=u.createInstance(this.rootPageBoxInstance);return a.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),a.resolveAutoSizing(this.context),a},t}(),qh=function(t){function e(e){var u;return(u=t.call(this)||this).pageType=void 0,u.pageType=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){t.currentPageType===this.pageType&&this.chained.apply(t)},u.getPriority=function(){return 3},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.pagetypes,this.pageType,this.chained),!0},e}(vo),$h=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){1===new fe(this.scope,"page-number").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(vo),Qh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"blank-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(vo),Zh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"left-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),Jh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"right-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),tc=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"recto-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),ec=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}x(e,t);var u=e.prototype;return u.apply=function(t){new fe(this.scope,"verso-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(vo),uc=function(t){function e(e,u,n){var i;return(i=t.call(this,u,n)||this).scope=void 0,i.a=void 0,i.b=void 0,i.scope=e,i.a=u,i.b=n,i}x(e,t);var u=e.prototype;return u.apply=function(t){var e=t.context,u=e.layoutPositionAtPageStart.page;e.blankPageAtStart&&u--,u&&this.matchANPlusB(u)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(Lo),nc=function(t){function e(e,u){return t.call(this,e,u,null,null,null)||this}return x(e,t),e.prototype.apply=function(t){!function(t,e,u,n,i){ho(t,e,u,n,null,null,null);var r=u[Mh];if(r){var o=ao(e,Mh);for(var a in r)if(r.hasOwnProperty(a)){var s=o[a];s||(o[a]=s={}),ho(t,s,r[a],n,null,null,null)}}}(t.context,t.currentStyle,this.style,this.specificity)},e}(go),ic=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,null==n?void 0:n.condition,n,null,i,!1)||this).pageProps=void 0,o.currentPageSelectors=[],o.currentNamedPageSelector="",o.currentPseudoPageClassSelectors=[],o.pageProps=r,o}x(e,t);var u=e.prototype;return u.startPageRule=function(){this.startSelectorRule()},u.tagSelector=function(t,e){this.currentNamedPageSelector=e,e&&(this.chain.push(new qh(e)),this.specificity+=65536)},u.pseudoclassSelector=function(t,e){if(t=t.toLowerCase(),e)if("nth"===t){var u=e[0],n=e[1];this.currentPseudoPageClassSelectors.push(":"+t+"("+u+"n"+(n<0?n:"+"+n)+")"),this.chain.push(new uc(this.scope,u,n)),this.specificity+=256}else this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t+"("+e.join("")+")");else switch(this.currentPseudoPageClassSelectors.push(":"+t),t){case"first":this.chain.push(new $h(this.scope)),this.specificity+=256;break;case"blank":this.chain.push(new Qh(this.scope)),this.specificity+=256;break;case"left":this.chain.push(new Zh(this.scope)),this.specificity+=1;break;case"right":this.chain.push(new Jh(this.scope)),this.specificity+=1;break;case"recto":this.chain.push(new tc(this.scope)),this.specificity+=1;break;case"verso":this.chain.push(new ec(this.scope)),this.specificity+=1;break;default:this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t)}},u.finishSelector=function(){var t;t=this.currentNamedPageSelector||this.currentPseudoPageClassSelectors.length?[this.currentNamedPageSelector].concat(this.currentPseudoPageClassSelectors.sort()):null,this.currentPageSelectors.push({selectors:t,specificity:this.specificity}),this.currentNamedPageSelector="",this.currentPseudoPageClassSelectors=[]},u.nextSelector=function(){this.finishSelector(),t.prototype.nextSelector.call(this)},u.startRuleBody=function(){this.finishSelector(),t.prototype.startRuleBody.call(this)},u.simpleProperty=function(e,u,n){if("bleed"!==e&&"marks"!==e||this.currentPageSelectors.some((function(t){return null===t.selectors}))){t.prototype.simpleProperty.call(this,e,u,n);var i=io(this.elementStyle,e),r=this.pageProps;if("bleed"===e||"marks"===e)r[""]||(r[""]={}),Object.keys(r).forEach((function(t){ro(r[t],e,i)}));else if("size"===e){var o=r[""];this.currentPageSelectors.forEach((function(t){var u=new $r(i.value,i.priority+t.specificity),n=t.selectors?t.selectors.join(""):"",a=r[n];a?Jr(a,e,u):(ro(a=r[n]={},e,u),o&&["bleed","marks"].forEach((function(t){o[t]&&ro(a,t,o[t])})))}))}}},u.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.pagetypes,"*",t)},u.makeApplyRuleAction=function(t){return new nc(this.elementStyle,t)},u.startPageMarginBoxRule=function(t){var e=ao(this.elementStyle,Mh),u=e[t];u||(e[t]=u={});var n=new rc(this.scope,this.owner,this.validatorSet,u);this.owner.pushHandler(n)},e}(Fa),rc=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,!1)||this).validatorSet=void 0,r.boxStyle=void 0,r.validatorSet=n,r.boxStyle=i,r}x(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity(),i=new $r(e,n);ro(this.boxStyle,t,i)},e}(di),oc=!0,ac=[];function sc(t,e){return t===e||(t.src||e.src?t.src===e.src:t.textContent===e.textContent)}function lc(t){var e=Array.from(t.querySelectorAll("body > :not(script):not(link):not(style) ~ script"));return Array.from(t.querySelectorAll("head > script, body > script")).filter((function(t){return!e.includes(t)}))}function Dc(t,e,u){if(!oc)return Rn(!1);if((null==u||!u.inHead)&&(null==u||!u.atEnd)&&lc(t.ownerDocument).includes(t))return Rn(!1);var n=t.textContent,i=t.src,r="module"===t.type,o=(r||i)&&t.async,a=r&&!o||i&&t.defer,s=!(null!=u&&u.atEnd)&&((null==u?void 0:u.forceDefer)||a||o);if(hc(e)||(e.onload=null),s)return ac.some((function(e){return sc(e,t)}))||ac.push(t),Rn(!0);if(i.includes("/mathjax")){var l,D,h=e.document.head.querySelector("script[src*='MathJax.js']:not([data-vivliostyle-scripting])");if(h)if(i.includes("/mathjax@3"))e.document.head.removeChild(h),null!=(l=e.MathJax)&&null!=(D=l.version)&&D.startsWith("2.")&&delete e.MathJax;else if(i.includes("/MathJax.js"))return Rn(!0)}for(var d,f=O(e.document.head.getElementsByTagName("script"));!(d=f()).done;){var p=d.value;p.hasAttribute("data-vivliostyle-scripting")&&sc(p,t)&&e.document.head.removeChild(p)}var E=e.document.createElement("script");E.textContent=n,i&&(E.src=i),E.async=o,E.defer=a,E.setAttribute("data-vivliostyle-scripting","true");for(var C,F=O(t.attributes);!(C=F()).done;){var A=C.value;["src","async","defer"].includes(A.name)||E.setAttribute(A.name,A.value)}if(c.debug("script:",i),i){var g=ii(E);return e.document.head.appendChild(E),Xn([g])}return e.document.head.appendChild(E),Rn(!0)}function hc(t){return!!oc&&(ac.length>0||!!t.document.head.querySelector("script[data-vivliostyle-scripting]"))}var cc=function(t,e,u){return t.replace(/[uU][rR][lL]\(\s*"((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"\r\n])+)"/gm,(function(t,n){return'url("'+u.transformURL(n,e)+'"'})).replace(/[uU][rR][lL]\(\s*'((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^'\r\n])+)'/gm,(function(t,n){return"url('"+u.transformURL(n,e)+"'"})).replace(/[uU][rR][lL]\(\s*((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"'\r\n\)\s])+)/gm,(function(t,n){return"url("+u.transformURL(n,e)}))},dc={},fc=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;return(f=t.call(this)||this).flowName=void 0,f.context=void 0,f.viewport=void 0,f.styler=void 0,f.regionIds=void 0,f.xmldoc=void 0,f.docFaces=void 0,f.footnoteStyle=void 0,f.stylerProducer=void 0,f.page=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.documentURLTransformer=void 0,f.document=void 0,f.exprContentListener=void 0,f.nodeContext=null,f.viewRoot=null,f.isFootnote=!1,f.sourceNode=null,f.offsetInNode=0,f.viewNode=null,f.flowName=e,f.context=u,f.viewport=n,f.styler=i,f.regionIds=r,f.xmldoc=o,f.docFaces=a,f.footnoteStyle=s,f.stylerProducer=l,f.page=D,f.customRenderer=h,f.fallbackMap=c,f.documentURLTransformer=d,f.document=n.document,f.exprContentListener=i.counterListener.getExprContentListener(),f}x(u,t);var n=u.prototype;return n.clone=function(){return new u(this.flowName,this.context,this.viewport,this.styler,this.regionIds,this.xmldoc,this.docFaces,this.footnoteStyle,this.stylerProducer,this.page,this.customRenderer,this.fallbackMap,this.documentURLTransformer)},n.createPseudoelementShadow=function(t,e,u,n,i,r,o,a){var s=this.getPseudoMap(u,this.regionIds,this.isFootnote,this.nodeContext,r);if(!s)return a;for(var l,D=[],h=$s.createElementNS(W.SHADOW,"root"),c=h,d=O(Qs);!(l=d()).done;){var f=l.value,p=void 0;if(f){if(!s[f])continue;if(!("footnote-marker"!=f||e&&this.isFootnote))continue;if(f.match(/^first-/)){var E=n.display;if(!E||E===Je.inline)continue;var C=t.firstElementChild;if(C&&Fr(C.previousSibling)){var F=i.getStyle(C,!1);if(F){var A=io(F,"display");if(null!=A&&A.value&&A.value!==Je.inline)continue}}}if("before"===f||"after"===f){var g=s[f].content;if(!g||!Mr(g.value))continue}D.push(f),tl(p=$s.createElementNS(W.XHTML,"span"),f)}else p=$s.createElementNS(W.SHADOW,"content");c.appendChild(p),f.match(/^first-/)&&(c=p)}if(!D.length)return a;var v=new el(t,u,i,r,this.exprContentListener);return new Sr(t,h,null,o,a,br.ROOTLESS,v)},n.getPseudoMap=function(t,e,u,n,i){var r=oo(t,"_pseudos");if(!r)return null;var o={},a=function(){var t=o[s]={};ka(t,r[s],i),xa(t,i,r[s]),Ra(r[s],e,u,(function(e,u){ka(t,u,i),Sa(u,(function(e){ka(t,e,i)}))}))};for(var s in r)a();return o},n.createRefShadow=function(t,e,u,n,i){var r=this,o=Pn("createRefShadow");return this.xmldoc.store.load(t).then((function(a){var s=a;if(s){var l=s.getElement(t);if(l){var D=r.stylerProducer.getStylerForDoc(s);i=new Sr(u,l,s,n,i,e,D)}}o.finish(i)})),o.result()},n.createShadows=function(t,e,u,n,i,r,o){var a=this,s=Pn("createShadows"),l=n.template;return(l instanceof Ge?this.createRefShadow(l.url,br.ROOTLESS,t,o,null):Rn(null)).then((function(l){var D=null;if(t.namespaceURI==W.SHADOW&&"include"==t.localName){var h=t.getAttribute("href"),c=null;h?c=o?o.xmldoc:a.xmldoc:o&&(h=o.owner.namespaceURI==W.XHTML?o.owner.getAttribute("href"):o.owner.getAttributeNS(W.XLINK,"href"),c=o.parentShadow?o.parentShadow.xmldoc:a.xmldoc),h&&(h=K(h,c.url),D=a.createRefShadow(h,br.ROOTED,t,o,l))}null==D&&(D=Rn(l));var d=null;D.then((function(e){if(n.display===Je.table_cell){var u=K("user-agent.xml#table-cell",X);d=a.createRefShadow(u,br.ROOTLESS,t,o,e)}else d=Rn(e)})),d.then((function(l){l=a.createPseudoelementShadow(t,e,u,n,i,r,o,l),s.finish(l)}))})),s.result()},n.setViewRoot=function(t,e){this.viewRoot=t,this.isFootnote=e},n.computeStyle=function(t,e,u,n){var i=this,r=this.context,o=Pa(u,r,this.regionIds,this.isFootnote);if(t=Ta(o,r,t),e=Ia(o,r,e),La(o,n,t,e,(function(t,e){var u=e.evaluate(r,t);return"font-family"==t&&(u=i.docFaces.filterFontFamily(u)),u})),Ds(n.position))return n.position=Je.fixed,n.visibility=Je.hidden,t;var a=hs(n.display||Je.inline,n.position,n.float,this.sourceNode===this.xmldoc.root);return["display","position","float"].forEach((function(t){a[t]&&(n[t]=a[t])})),t},n.inheritFromSourceParent=function(t){for(var e=this.nodeContext.sourceNode,u=[],n=null,i=this.nodeContext.shadowContext,r=-1;e&&1==e.nodeType;){var o=i&&i.root==e;if(!o||i.type==br.ROOTLESS){var a=(i?i.styler:this.styler).getStyle(e,!1);u.push(a),n=n||nt(e)}o?(e=i.owner,i=i.parentShadow):(e=e.parentNode,r++)}for(var s=this.context.queryUnitSize("em",0===r),l={"font-size":new $r(new Ue(s,"px"),0)},D=new fo(l,this.context),h=u.length-1;h>=0;--h){var c=u[h],d=[];for(var f in c)no(f)&&d.push(f);d.sort(au);for(var p=void 0,E=void 0,C=0,F=d;C0&&i.modifyElemDimensionWithImageResolution(s,n,h,i.nodeContext.vertical),o.finish(r)})):o.timeSlice().then((function(){o.finish(r)}))}))})),o.result()},n.isInsideNonRootMultiColumn=function(){for(var t=null==(e=this.nodeContext.parent)?void 0:e.viewNode;t;t=t.parentNode){var e,u=1===t.nodeType?t.style:null;if(!u)break;if(!isNaN(parseFloat(u.columnCount))||!isNaN(parseFloat(u.columnWidth)))return!0;if("absolute"===u.position)break}return!1},n.getBreakTypeAt=function(t){for(var e,u,n,i=t;i&&!i.after;i=i.parent){var r;if(Yi(i.breakBefore))return i.breakBefore;if(1===i.fragmentIndex&&!i.parent)return i.sourceNode===i.sourceNode.ownerDocument.documentElement?"page":null;var o=null==(r=i.parent)?void 0:r.viewNode;if(o){var a=this.viewport.window.getComputedStyle(o),s=parseFloat(a.paddingBlockStart),l=parseFloat(a.borderBlockStartWidth);if(s||l)return null;for(var D=null==o?void 0:o.firstChild;D&&(Fr(D,i.parent.whitespace)||gs(D));)D=D.nextSibling;if(D&&D!==i.viewNode)return null}}var h=null==(e=this.context)||null==(u=e.currentLayoutPosition)||null==(n=u.flowPositions[this.flowName])?void 0:n.startBreakType;return Yi(h)?h:"auto"},n.processAfterIfcontinues=function(t,e,u,n){var i=this.getPseudoMap(e,this.regionIds,this.isFootnote,this.nodeContext,n);if(i&&i["after-if-continues"]&&i["after-if-continues"].content){var r=new el(t,e,u,n,this.exprContentListener);this.nodeContext.afterIfContinues=new nl(t,r)}},n.isSVGUrlAttribute=function(t){return u.SVG_URL_ATTRIBUTES.includes(t.toLowerCase())},n.modifyElemDimensionWithImageResolution=function(t,e,u,n){var i=this;t.forEach((function(t){if("load"===t.fetcher.get().get()){var r=t.image,o=r.width/e,a=r.height/e,s=t.element;if(o>0&&a>0)if(u["box-sizing"]===Je.border_box&&(u["border-left-style"]!==Je.none&&(o+=Qe(u["border-left-width"],i.context)),u["border-right-style"]!==Je.none&&(o+=Qe(u["border-right-width"],i.context)),u["border-top-style"]!==Je.none&&(a+=Qe(u["border-top-width"],i.context)),u["border-bottom-style"]!==Je.none&&(a+=Qe(u["border-bottom-width"],i.context))),e>1){var l=u["max-width"]||Je.none,D=u["max-height"]||Je.none;if(l===Je.none&&D===Je.none)et(s,"max-width",o+"px");else if(l!==Je.none&&D===Je.none)et(s,"width",o+"px");else if(l===Je.none&&D!==Je.none)et(s,"height",a+"px");else{l.isNumeric(),D.isNumeric();var h=D;"%"!==l.unit?et(s,"max-width",Math.min(o,Qe(l,i.context))+"px"):"%"!==h.unit?et(s,"max-height",Math.min(a,Qe(h,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}else if(e<1){var c=u["min-width"]||nu,d=u["min-height"]||nu;c.isNumeric(),c.isNumeric();var f=c,p=d;0===f.num&&0===p.num?et(s,"min-width",o+"px"):0!==f.num&&0===p.num?et(s,"width",o+"px"):0===f.num&&0!==p.num?et(s,"height",a+"px"):"%"!==f.unit?et(s,"min-width",Math.max(o,Qe(f,i.context))+"px"):"%"!==p.unit?et(s,"min-height",Math.max(a,Qe(p,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}}))},n.preprocessElementStyle=function(t){var u=this;C(e.HOOKS.PREPROCESS_ELEMENT_STYLE).forEach((function(e){e(u.nodeContext,t)}))},n.findAndProcessRepeatingElements=function(t,e){for(var u=t.firstChild;u;u=u.nextSibling)if(1===u.nodeType){var n={},i=e.getStyle(u,!1);if(this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,i,n),this.processRepeatOnBreak(n)){if(this.nodeContext.formattingContext instanceof Fl&&!this.nodeContext.belongsTo(this.nodeContext.formattingContext))return;var r=this.nodeContext.parent;return this.nodeContext.formattingContext=new Fl(r&&r.formattingContext,this.nodeContext.sourceNode),void this.nodeContext.formattingContext.initializeRepetitiveElements(this.nodeContext.vertical)}}},n.processRepeatOnBreak=function(t){var e=t["repeat-on-break"];return e!==Je.none&&((e===Je.auto||ou(e))&&(e=t.display===Je.table_header_group?Je.header:t.display===Je.table_footer_group?Je.footer:Je.none),e&&e!==Je.none)?e.toString():null},n.createTextNodeView=function(){var t=this,e=Pn("createTextNodeView");return this.preprocessTextContent().then((function(){var u=t.offsetInNode||0,n=ar(t.nodeContext.preprocessedTextContent).substr(u);t.viewNode=document.createTextNode(n),e.finish(!0)})),e.result()},n.preprocessTextContent=function(){var t,u=this;if(null!=this.nodeContext.preprocessedTextContent)return Rn(!0);var n=t=this.sourceNode.textContent,i=Pn("preprocessTextContent"),r=C(e.HOOKS.PREPROCESS_TEXT_CONTENT),a=0;return i.loop((function(){return a>=r.length?Rn(!1):r[a++](u.nodeContext,n).thenAsync((function(t){return n=t,Rn(!0)}))})).then((function(){u.nodeContext.preprocessedTextContent=o.default(t,n,0),i.finish(!0)})),i.result()},n.createNodeView=function(t,e){var u,n=this,i=Pn("createNodeView"),r=!0;return 1==this.sourceNode.nodeType?u=this.createElementView(t,e):8==this.sourceNode.nodeType?(this.viewNode=null,u=Rn(!0)):u=this.createTextNodeView(),u.then((function(t){if(r=t,n.nodeContext.viewNode=n.viewNode,n.viewNode){var e,u=function(t,e){return 1===(null==t?void 0:t.nodeType)&&Js(t)===e},o=n.nodeContext.parent,a=o?u(n.viewNode,"after")&&u(o.viewNode,"first-letter")&&null!=(e=o.viewNode)&&e.hasChildNodes()?o.parent.viewNode:o.viewNode:n.viewRoot;a&&(!n.nodeContext.inline||3===n.viewNode.nodeType&&Fr(n.viewNode)||a.hasChildNodes()||!Gi(a).includes("block-start")||Xi(a,"text-start"),a.appendChild(n.viewNode))}i.finish(r)})),i.result()},n.setCurrent=function(t,e,u){return this.nodeContext=t,t?(this.sourceNode=t.sourceNode,this.offsetInNode=t.offsetInNode):(this.sourceNode=null,this.offsetInNode=-1),this.viewNode=null,this.nodeContext?this.createNodeView(e,!!u):Rn(!0)},n.processShadowContent=function(t){if(null==t.shadowContext||"content"!=t.sourceNode.localName||t.sourceNode.namespaceURI!=W.SHADOW)return t;var e,u,n=t.boxOffset,i=t.shadowContext,r=t.parent,o=i.subShadow||i.parentShadow;i.subShadow?(e=i.root,(u=i.type)==br.ROOTLESS&&(e=e.firstChild)):(e=i.owner.firstChild,u=br.ROOTLESS);var a=t.sourceNode.nextSibling;if(a?(t.sourceNode=a,t.resetView()):t.shadowSibling?t=t.shadowSibling:e?t=null:(t=t.parent.modify()).after=!0,e){var s=new Ir(e,r,n);return s.shadowContext=o,s.shadowType=u,s.shadowSibling=t,s}return t.boxOffset=n,t},n.nextPositionInTree=function(t){var e=t.boxOffset+1;if(t.after){if(!t.parent)return null;if(t.shadowType!=br.ROOTED){var u=t.sourceNode.nextSibling;if(u)return(t=t.modify()).boxOffset=e,t.sourceNode=u,t.resetView(),this.processShadowContent(t)}return t.shadowSibling?((t=t.shadowSibling.modify()).boxOffset=e,t):((t=t.parent.modify()).boxOffset=e,t.after=!0,t)}if(t.nodeShadow){var n=t.nodeShadow.root;if(t.nodeShadow.type==br.ROOTLESS&&(n=n.firstChild),n){var i=new Ir(n,t,e);return i.shadowContext=t.nodeShadow,i.shadowType=t.nodeShadow.type,this.processShadowContent(i)}}var r=t.sourceNode.firstChild;return r?this.processShadowContent(new Ir(r,t,e)):(1!=t.sourceNode.nodeType&&(e+=ar(t.preprocessedTextContent).length-1-t.offsetInNode),(t=t.modify()).boxOffset=e,t.after=!0,t)},n.isTransclusion=function(t,e,u){var n=io(e,"hyperlink-processing");if(!n)return!1;var i=n.evaluate(this.context,"hyperlink-processing");return!!i&&i.toString()==u},n.nextInTree=function(t,e){var u=this,n=this.nextPositionInTree(t);if(!n||n.after)return Rn(n);var i=Pn("nextInTree");return this.setCurrent(n,!0,e).then((function(t){n.viewNode&&t||((n=n.modify()).after=!0,n.viewNode||(n.inline=!0)),u.dispatchEvent({type:"nextInTree",nodeContext:n}),i.finish(n)})),i.result()},n.addImageFetchers=function(t){if(t instanceof Ke)for(var e=t.values,u=0;u=10)return!1;if(void 0===(null==(u=t.style)?void 0:u.zoom))return!1;var s=n/10;return et(t,"font-size","10px"),et(t,"zoom",""+s),!0},n.applyPseudoelementStyle=function(t,e,u){if(!t.after){var n=(t.shadowContext?t.shadowContext.styler:this.styler).getStyle(this.sourceNode,!1),i=oo(n,"_pseudos");if(i&&(n=i[e])){var r={};t.vertical=this.computeStyle(t.vertical,"rtl"===t.direction,n,r);var o=r.content;Mr(o)&&(o.visit(new _r(u,this.context,o,this.exprContentListener)),delete r.content),this.applyComputedStyles(u,r)}}},n.peelOff=function(t,e){var u=this,n=Pn("peelOff"),i=t.firstPseudo,r=t.offsetInNode,o=t.after;if(e>0)t.viewNode.textContent=t.viewNode.textContent.substr(0,e),r+=e;else if(!o&&t.viewNode&&0==r){var a=t.viewNode.parentNode;a&&a.removeChild(t.viewNode)}for(var s=t.boxOffset+e,l=[];t.firstPseudo===i;)l.push(t),t=t.parent;var D=l.pop(),h=D.shadowSibling;return n.loop((function(){for(;l.length>0;){D=l.pop(),t=new Ir(D.sourceNode,t,s),0==l.length&&(t.offsetInNode=r,t.after=o),t.shadowType=D.shadowType,t.shadowContext=D.shadowContext,t.nodeShadow=D.nodeShadow,t.shadowSibling=D.shadowSibling?D.shadowSibling:h,h=null;var e=u.setCurrent(t,!1);if(e.isPending())return e}return Rn(!1)})).then((function(){n.finish(t)})),n.result()},n.createElement=function(t,e){return t==W.XHTML?this.document.createElement(e):this.document.createElementNS(t,e)},n.applyFootnoteStyle=function(t,e,u){var n={},i=oo(this.footnoteStyle,"_pseudos");if(t=this.computeStyle(t,e,this.footnoteStyle,n),i&&i.before){var r={},o=this.createElement(W.XHTML,"span");tl(o,"before"),u.appendChild(o),this.computeStyle(t,e,i.before,r),delete r.content,this.applyComputedStyles(o,r)}return delete n.content,this.applyComputedStyles(u,n),t},n.processFragmentedBlockEdge=function(t){var e,u=!t.inline&&t.after?t.parent:t,n=!1;if(t.inline&&t.after&&!t.shadowContext&&1===(null==(e=t.sourceNode.nextSibling)?void 0:e.nodeType)){var i,r=t.sourceNode.nextSibling,o=null==(i=io(this.styler.getStyle(r,!1),"display"))?void 0:i.value.toString();n=o&&!ds(o)||"true"===r.getAttribute("data-math-typeset")&&/^\s*(\$\$|\\\[)/.test(r.textContent)}for(var a=0,s=u;s;s=s.parent){var l;if(1===(null==(l=s.viewNode)?void 0:l.nodeType)){var D=s.viewNode;if(D.style)if(s.inline){if(Xi(D,"inline-end"),zi(D)){var h=s.vertical?D.offsetWidth:D.offsetHeight;Xi(D,"clone"),(s.vertical?D.offsetWidth:D.offsetHeight)>h&&this.fixClonedBoxDecorationOverflow(D)}}else{if(Xi(D,"block-end"),!a++&&s!==u)if("justify"!==this.viewport.window.getComputedStyle(D).textAlign||n)Xi(D,"text-end");else{var c=this.createChildAnonymousBlockIfNeeded(D);c?c!==D?Wi(c,["block-start","text-start","block-end","text-end","justify"]):(Xi(D,"text-end"),Xi(D,"justify")):Xi(D,"text-end")}zi(D)&&(Xi(D,"clone"),ji(D,"block-end"))}}}},n.fixClonedBoxDecorationOverflow=function(t){var e=this.viewport.window.getComputedStyle(t),u=-(parseFloat(e.paddingInlineEnd)+parseFloat(e.borderInlineEndWidth));isNaN(u)||(t.style.marginInlineEnd=u+"px")},n.createChildAnonymousBlockIfNeeded=function(t){for(var e=this,u=function t(u){var n=e.viewport.window.getComputedStyle(u),i=n.display,r=n.position,o=n.float;if("ruby"===u.localName)return!1;if("br"===u.localName)return!0;if(("inline"===i||"contents"===i)&&u.hasChildNodes()){var a=u.lastElementChild;if(a&&(!a.nextSibling||a.nextSibling===u.lastChild&&Fr(a.nextSibling))){var s=t(a);if(s||null===s)return s}for(var l=null==a?void 0:a.previousElementSibling;l;l=l.previousElementSibling){var D=t(l);if(D||null===D)return null}return!1}if("none"===i||"absolute"===r||"fixed"===r||o&&"none"!==o||u.hasAttribute(pr)){var h=u.previousElementSibling;return!(!h||!(h.nextSibling===u||h.nextSibling===u.previousSibling&&Fr(h.nextSibling)))&&t(h)}return!(!i||ds(i))},n=null,i=t.lastElementChild;i;i=i.previousElementSibling){var r=u(i);if(r){n=i;break}if(null===r)return null}if(!n)return t;if(n===t.lastElementChild&&(!n.nextSibling||n.nextSibling===t.lastChild&&Fr(n.nextSibling)))return null;var o=t.ownerDocument.createElement("span");o.className="viv-anonymous-block";for(var a=n.nextSibling,s=null;a;a=s)s=a.nextSibling,o.appendChild(a);return t.appendChild(o),o},n.convertLengthToPx=function(t,e,u){var n=t.num,i=t.unit;if(function(t){switch(null==t?void 0:t.toLowerCase()){case"em":case"ex":case"rem":case"lh":case"rlh":return!0;default:return!1}}(i)){for(var r=e;r&&1!==r.nodeType;)r=r.parentNode;return po(t,parseFloat(u.getElementComputedStyle(r)["font-size"]),this.context).num}var o=this.context.queryUnitSize(i,!1);return o?n*o:t},n.isSameNodePositionStep=function(t,e){if(t.shadowContext){if(!e.shadowContext)return!1;var u=1===e.node.nodeType?e.node:e.node.parentElement;return t.shadowContext.owner===e.shadowContext.owner&&Js(1===t.node.nodeType?t.node:t.node.parentElement)===Js(u)}return t.node===e.node},n.isSameNodePosition=function(t,e){var u=this;return t.offsetInNode===e.offsetInNode&&t.after==e.after&&t.steps.length===e.steps.length&&t.steps.every((function(t,n){return u.isSameNodePositionStep(t,e.steps[n])}))},n.isPseudoelement=function(t){return!!Js(t)},u}(Et);fc.SVG_URL_ATTRIBUTES=["color-profile","clip-path","cursor","filter","marker","marker-start","marker-end","marker-mid","fill","stroke","mask"];var pc,Ec={"float-min-wrap-block":!0,"float-reference":!0,"flow-into":!0,"flow-linger":!0,"flow-options":!0,"flow-priority":!0,"footnote-policy":!0,"margin-break":!0,page:!0},Cc=function(){function t(t){this.layoutBox=void 0,this.window=void 0,this.scaleRatio=1,this.layoutBox=t.layoutBox,this.window=t.window,t.pixelRatio>0&&CSS.supports("zoom","8")&&(this.scaleRatio=t.pixelRatio/t.window.devicePixelRatio)}var e=t.prototype;return e.scaleRect=function(t){return{left:t.left*this.scaleRatio,top:t.top*this.scaleRatio,right:t.right*this.scaleRatio,bottom:t.bottom*this.scaleRatio,width:t.width*this.scaleRatio,height:t.height*this.scaleRatio}},e.subtractOffsets=function(t,e){var u=e.left,n=e.top;return{left:t.left-u,top:t.top-n,right:t.right-u,bottom:t.bottom-n,width:t.width,height:t.height}},e.getRangeClientRects=function(t){var e=this,u=t.getClientRects(),n=this.layoutBox.getBoundingClientRect();return Array.from(u).map((function(t){return e.scaleRect(e.subtractOffsets(t,n))}))},e.getElementClientRect=function(t){var e=t.getBoundingClientRect();if(0===e.left&&0===e.top&&0===e.right&&0===e.bottom)return e;var u=this.layoutBox.getBoundingClientRect();return this.scaleRect(this.subtractOffsets(e,u))},e.getElementComputedStyle=function(t){return this.window.getComputedStyle(t,null)},t}(),Fc=function(){function t(t,e,u,n,i,r){this.window=void 0,this.fontSize=void 0,this.pixelRatio=void 0,this.document=void 0,this.root=void 0,this.outerZoomBox=void 0,this.contentContainer=void 0,this.layoutBox=void 0,this.width=void 0,this.height=void 0,this.window=t,this.fontSize=e,this.pixelRatio=u,this.document=t.document,this.root=n||this.document.body,u>0&&CSS.supports("zoom","8")&&(et(this.root,"--viv-outputPixelRatio",""+u),et(this.root,"--viv-devicePixelRatio",""+t.devicePixelRatio));var o=this.root.firstElementChild;o||((o=this.document.createElement("div")).setAttribute("data-vivliostyle-outer-zoom-box","true"),this.root.appendChild(o));var a=o.firstElementChild;a||((a=this.document.createElement("div")).setAttribute("data-vivliostyle-spread-container","true"),o.appendChild(a));var s=o.nextElementSibling;s||((s=this.document.createElement("div")).setAttribute("data-vivliostyle-layout-box","true"),this.root.appendChild(s)),this.outerZoomBox=o,this.contentContainer=a,this.layoutBox=s,this.width=i||parseFloat(t.getComputedStyle(this.root).width)||this.root.offsetWidth||t.innerWidth,this.height=r||parseFloat(t.getComputedStyle(this.root).height)||this.root.offsetHeight||t.innerHeight;var l=!t.outerWidth&&!t.outerHeight||/Headless/.test(navigator.userAgent)||navigator.webdriver&&800===t.innerWidth&&600===t.innerHeight;(!this.width||!i&&l)&&(this.width=794),(!this.height||!r&&l)&&(this.height=1056)}var e=t.prototype;return e.resetZoom=function(){et(this.outerZoomBox,"width",""),et(this.outerZoomBox,"height",""),et(this.contentContainer,"width",""),et(this.contentContainer,"height",""),et(this.contentContainer,"transform","")},e.zoom=function(t,e,u){et(this.root,"--viv-outputScale",""+u),et(this.outerZoomBox,"width",t*u+"px"),et(this.outerZoomBox,"height",e*u+"px"),et(this.contentContainer,"width",t+"px"),et(this.contentContainer,"height",e+"px")},e.clear=function(){for(var t=this.root;t.lastChild;)t.removeChild(t.lastChild)},t}(),Ac=function(){function t(t,e,u){this.store=void 0,this.url=void 0,this.document=void 0,this.lang=null,this.totalOffset=-1,this.root=void 0,this.body=void 0,this.head=void 0,this.last=void 0,this.lastOffset=1,this.idMap=void 0,this.store=t,this.url=e,this.document=u,this.root=u.documentElement;var n=null,i=null;if(this.root.namespaceURI==W.XHTML){for(var r=this.root.firstChild;r;r=r.nextSibling)if(1==r.nodeType){var o=r;if(o.namespaceURI==W.XHTML)switch(o.localName){case"head":i=o;break;case"body":n=o}}this.lang=this.root.getAttribute("lang")}this.body=n,this.head=i,this.last=this.root,this.last.setAttribute(M,"0")}var e=t.prototype;return e.doc=function(){return new Bc([this.document])},e.getElementOffset=function(t){var e=t.getAttribute(M);if(e)return parseInt(e,10);for(var u=this.lastOffset,n=this.last;n!=t;){var i=n.firstChild;if(!i)for(;!(i=n.nextSibling);)if(null==(n=n.parentNode))throw new Error("Internal error");n=i,1==i.nodeType?(i.setAttribute(M,u.toString()),++u):u+=i.textContent.length}return this.lastOffset=u,this.last=t,u-1},e.getNodeOffset=function(t,e,u){var n=0,i=t,r=null;if(1==i.nodeType){if(!u)return this.getElementOffset(i)}else{if(n=e,!(r=i.previousSibling))return n+=1,this.getElementOffset(i=i.parentNode)+n;i=r}for(;;){for(;i.lastChild;)i=i.lastChild;if(1==i.nodeType)break;if(n+=i.textContent.length,!(r=i.previousSibling)){i=i.parentNode;break}i=r}return n+=1,this.getElementOffset(i)+n},e.getTotalOffset=function(){return this.totalOffset<0&&(this.totalOffset=this.getNodeOffset(this.root,0,!0)),this.totalOffset},e.getNodeByOffset=function(t){for(var e,u=this,n=this.root,i=function(){if((e=u.getElementOffset(n))>=t)return{v:n};var i=n.children;if(!i)return"break";var r=ct(i.length,(function(e){return u.getElementOffset(i[e])>t}));if(0==r)return"break";n=i[r-1]};;){var r=i();if("break"===r)break;if("object"==typeof r)return r.v}for(var o=e+1,a=n,s=a.firstChild||a.nextSibling,l=null;;){if(s){if(1==s.nodeType)break;if(l=a=s,(o+=s.textContent.length)>t&&!/^\s*$/.test(s.textContent))break}else if(!(a=a.parentNode))break;s=a.nextSibling}return s&&l&&/^\s*$/.test(l.textContent)&&(l=s),l||n},e.buildIdMap=function(t){var e=t.getAttribute("id");e&&!this.idMap[e]&&(this.idMap[e]=t);var u=t.getAttributeNS(W.XML,"id");u&&!this.idMap[u]&&(this.idMap[u]=t);for(var n=t.firstElementChild;n;n=n.nextElementSibling)this.buildIdMap(n)},e.getElement=function(t){var e=t.match(/([^#]*)#(.+)$/);if(!e||e[1]&&e[1]!=this.url)return null;var u=e[2],n=this.document.getElementById(u);return!n&&this.document.getElementsByName&&(n=this.document.getElementsByName(u)[0]),n||(this.idMap||(this.idMap={},this.buildIdMap(this.document.documentElement)),n=this.idMap[u]),n},t}();function gc(t,e,u){var n,i=u||new DOMParser;try{n=i.parseFromString(t,e)}catch(t){}if(!n)return null;var r=n.documentElement,o="parsererror";if(r.localName===o)return null;for(var a=r.firstElementChild;a;a=a.nextElementSibling)if(a.localName===o)return null;return n}function vc(t,e){var u=t.responseXML;if(!u){var n=new DOMParser,i=t.responseText;if(i){var r=function(t){var e=t.contentType;if(e){for(var u=Object.keys(pc),n=0;n0}))},t}())((function(t){return!0})),Bc=function(){function t(t){this.nodes=void 0,this.nodes=t}var e=t.prototype;return e.asArray=function(){return this.nodes},e.size=function(){return this.nodes.length},e.predicate=function(e){for(var u,n=[],i=O(this.nodes);!(u=i()).done;){var r=u.value;e.check(r)&&n.push(r)}return new t(n)},e.forEachNode=function(e){for(var u=[],n=function(t){u.push(t)},i=0;i0&&c>0)return{width:n&&n.spreadView?2*(h+n.pageBorder):h,height:c,fontSize:u}}}}return{width:t,height:e,fontSize:u}},t}(),Nc=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;for(var p in(f=t.call(this,e.rootScope,i.width,i.height,i.fontSize)||this).style=void 0,f.xmldoc=void 0,f.viewport=void 0,f.clientLayout=void 0,f.fontMapper=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.pageNumberOffset=void 0,f.documentURLTransformer=void 0,f.counterStore=void 0,f.lang=void 0,f.primaryFlows={body:!0},f.rootPageBoxInstance=null,f.styler=null,f.stylerMap=null,f.currentLayoutPosition=null,f.layoutPositionAtPageStart=null,f.lookupOffset=0,f.faces=void 0,f.pageBoxInstances={},f.pageManager=null,f.rootPageFloatLayoutContext=void 0,f.pageBreaks={},f.pageProgression=null,f.isVersoFirstPage=!1,f.blankPageAtStart=!1,f.pageSheetSize={},f.pageSheetHeight=0,f.pageSheetWidth=0,f.style=e,f.xmldoc=u,f.viewport=i,f.clientLayout=r,f.fontMapper=o,f.customRenderer=a,f.fallbackMap=s,f.pageNumberOffset=l,f.documentURLTransformer=D,f.counterStore=h,f.lang=u.lang||n,f.faces=new XD(f.style.fontDeobfuscator),f.rootPageFloatLayoutContext=new es(null,null,null,null,null,null,null),f.pageProgression=c||null,f.isVersoFirstPage=!!d,e.flowProps){var E=io(e.flowProps[p],"flow-consume");E&&(E.evaluate(k(f),"flow-consume")==Je.all?f.primaryFlows[p]=!0:delete f.primaryFlows[p])}return f}x(u,t);var n=u.prototype;return n.init=function(){var t=this,e=Pn("StyleInstance.init"),u=this.counterStore.createCounterListener(this.xmldoc.url),n=this.counterStore.createCounterResolver(this.xmldoc.url,this.style.rootScope,this.style.pageScope);this.styler=new cD(this.xmldoc,this.style.cascade,this.style.rootScope,this,this.primaryFlows,this.style.validatorSet,u,n),n.setStyler(this.styler),this.styler.resetFlowChunkStream(this),this.stylerMap={},this.stylerMap[this.xmldoc.url]=this.styler;var i=this.styler.getTopContainerStyle();this.pageProgression||(this.pageProgression=gh(i)),this.matchStartPageSide(this.styler.breakBeforeValues[0])||(0===this.pageNumberOffset?this.isVersoFirstPage=!0:this.blankPageAtStart=!0),this.rootPageBoxInstance=new ch(this.style.rootBox);var r=this.style.cascade.createInstance(this,u,n,this.lang);this.styler.cascade.currentPageType=this.styler.cascade.firstPageType,this.rootPageBoxInstance.applyCascadeAndInit(r,i),this.rootPageBoxInstance.resolveAutoSizing(this),this.pageManager=new Yh(r,this.style.pageScope,this.rootPageBoxInstance,this,i);for(var o,a=[],s=O(this.style.fontFaces);!(o=s()).done;){var l=o.value;if(!l.condition||l.condition.evaluate(this)){var D=GD(l.properties,this),h=new WD(D);a.push(h)}}this.fontMapper.findOrLoadFonts(a,this.faces).then((function(){(function(t,e,u){if(!oc)return Rn(!1);var n=lc(t);if(0===n.length)return Rn(!1);var i=n.some((function(t){return!(t.async||t.defer||"module"===t.type)})),r=i?function(t,e,u){var n,i=null!=(n=e.document.querySelector("[data-vivliostyle-textcontent]"))?n:e.document.createElement("div");return i.style.position="fixed",i.style.fontSize="0",i.setAttribute("data-vivliostyle-textcontent","true"),i.setAttribute("aria-hidden","true"),i.style.fontFamily=function(t,e){for(var u={},n=function t(e){var n,i=null==(n=e["font-family"])?void 0:n.value;if(i)if(i.values)for(var r,o=O(i.values);!(r=o()).done;)u[r.value.stringValue()]=!0;else u[i.stringValue()]=!0;var a=e._marginBoxes;if(a)for(var s=0,l=Object.values(a);s0){var n=u.positions[0].flowChunk;this.getConsumedOffset(u)===n.startOffset&&(u.startBreakType=or(rr(u.startBreakType,u.positions[0].flowChunk.breakBefore)))}}},n.selectPageMaster=function(t){var e=this.currentLayoutPosition,u=this.getPosition(e);if(u==Number.POSITIVE_INFINITY)return null;for(var n,i=this.rootPageBoxInstance.children,r=0;rn}))-1,o=i[r],a=this.layoutPositionAtPageStart.flowPositions[u],s=this.getConsumedOffset(a);return!(on}(s))i.breakLoop();else{var l=(new ns).findByFloat(s),D=l.findPageFloatFragment(s,u);if(!D||!D.hasFloat(s))return u.isForbidden(s)||u.hasPrecedingFloatsDeferredToNext(s)?(u.deferPageFloat(a),void i.breakLoop()):void t.layoutPageFloatInner(a,l,null,D).then((function(t){if(t){var e=u.parent.isInvalidated();e?i.breakLoop():(u.isInvalidated()&&!e&&(r=!0,u.validate()),i.continueLoop())}else i.breakLoop()}));i.continueLoop()}}else i.breakLoop()})).then((function(){r&&u.invalidate(),i.finish(!0)})),i.result()},n.getLastAfterPositionIfDeferredFloatsExists=function(t,e){var u;return t.pageFloatLayoutContext.getPageFloatContinuationsDeferredToNext().length>0&&t.lastAfterPosition?(e?(u=e.clone()).primary=t.lastAfterPosition:u=new Pr(t.lastAfterPosition),u):null},n.layoutColumn=function(t,e){var u=this,n=this.currentLayoutPosition.flowPositions[e];if(!n||!this.matchPageSide(n.startBreakType))return Rn(!0);this.setFormattingContextToColumn(t,e),t.init(),this.primaryFlows[e]&&t.bands.length>0&&(t.forceNonfitting=!1);var i=Pn("layoutColumn");return this.layoutDeferredPageFloats(t).then((function(){if(t.pageFloatLayoutContext.isInvalidated())i.finish(!0);else{var r=[],o=[],a=!0;i.loopWithFrame((function(i){if(t.pageFloatLayoutContext.hasContinuingFloatFragmentsInFlow(e))i.breakLoop();else{for(var s=function(){for(var e=0;o.includes(e);)e++;var s=n.positions[e];if(s.flowChunk.startOffset>u.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(s.flowChunk))return"break";for(var l=e+1;lu.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(D.flowChunk))break;D.flowChunk.isBetter(s.flowChunk)&&(s=D,e=l)}var h=s.flowChunk,c=!0;return t.layout(s.chunkPosition,a,n.breakAfter).then((function(l){if(t.pageFloatLayoutContext.isInvalidated())i.breakLoop();else{if(a=!1,s.flowChunk.repeated&&(null===l||h.exclusive)&&r.push(e),h.exclusive)return o.push(e),void i.breakLoop();var D=!!l||!!t.pageBreakType,d=u.getLastAfterPositionIfDeferredFloatsExists(t,l);t.pageBreakType&&d?(s.chunkPosition=d,n.breakAfter=t.pageBreakType,t.pageBreakType=null):(o.push(e),(l||d)&&(s.chunkPosition=l||d,r.push(e)),n.startBreakType=or(t.pageBreakType)),D?i.breakLoop():(t.forceNonfitting=!1,c?c=!1:i.continueLoop())}})),c?(c=!1,{v:void 0}):void 0};n.positions.length-o.length>0;){var l=s();if("break"===l)break;if("object"==typeof l)return l.v}i.breakLoop()}})).then((function(){if(!t.pageFloatLayoutContext.isInvalidated()){n.positions=n.positions.filter((function(t,e){return r.includes(e)||!o.includes(e)})),"column"===n.breakAfter&&(n.breakAfter=null),t.saveDistanceToBlockEndFloats();var e=t.pageFloatLayoutContext.getMaxReachedAfterEdge();t.updateMaxReachedAfterEdge(e)}i.finish(!0)}))}})),i.result()},n.createLayoutConstraint=function(t){var e=this.counterStore.createLayoutConstraint(this.currentLayoutPosition.page-1);return new ll([e].concat(t.getLayoutConstraints()))},n.createAndLayoutColumn=function(t,e,u,n,i,r,o,a,s,l,D,h,c,d){var f,p=this,E=t.vertical?t.isAutoWidth&&t.isRightDependentOnAutoWidth:t.isAutoHeight&&t.isTopDependentOnAutoHeight,C=i.element,F=new es(a,qa.COLUMN,null,o,null,null,null),A=this.currentLayoutPosition.clone(),g=Pn("createAndLayoutColumn");return g.loopWithFrame((function(t){var g=p.createLayoutConstraint(F);if(s>1){var v=p.viewport.document.createElement("div");if(et(v,"position","absolute"),C.appendChild(v),(f=new hl(v,c,p.clientLayout,g,F)).forceNonfitting=d,f.vertical=i.vertical,f.rtl=i.rtl,f.snapHeight=i.snapHeight,f.snapWidth=i.snapWidth,i.vertical){var m=(i.rtl?s-r-1:r)*(D+l)+i.paddingTop,B=parseFloat(C.style.width);f.setHorizontalPosition(i.paddingLeft+B-i.width,i.width),f.setVerticalPosition(m,D)}else{var y=(i.rtl?s-r-1:r)*(D+l)+i.paddingLeft;f.setVerticalPosition(i.paddingTop,i.height),f.setHorizontalPosition(y,D)}f.originX=e,f.originY=u}else(f=new hl(C,c,p.clientLayout,g,F)).copyFrom(i);f.exclusions=E?[]:n.concat(),f.innerShape=h,F.setContainer(f),f.width>=0?p.layoutColumn(f,o).then((function(){F.isInvalidated()||F.finish(),f.pageFloatLayoutContext.isInvalidated()&&!a.isInvalidated()?(f.pageFloatLayoutContext.validate(),p.currentLayoutPosition=A.clone(),f.element!==C&&C.removeChild(f.element),t.continueLoop()):t.breakLoop()})):(F.finish(),t.breakLoop())})).then((function(){g.finish(f)})),g.result()},n.setPagePageFloatLayoutContextContainer=function(t,e,u){(e instanceof jh||e instanceof dh&&!(e instanceof zh))&&t.setContainer(u)},n.getRegionPageFloatLayoutContext=function(t,e,u,n){var i=e.getProp(this,"writing-mode")||null,r=e.getProp(this,"direction")||null;return new es(t,qa.REGION,u,n,null,i,r)},n.layoutFlowColumnsWithBalancing=function(t,e,u,n,i,r,o,a,s){var l=this,D=this.currentLayoutPosition.clone(),h=this.getRegionPageFloatLayoutContext(r,e,o,a),c=!0,d=function(){return l.currentLayoutPosition=D.clone(),l.layoutFlowColumns(t,e,u,n,i,r,h,o,a,s,c).thenAsync((function(t){return Rn(t?{columns:t,position:l.currentLayoutPosition}:null)}))};return d().thenAsync((function(t){if(!t)return Rn(null);if(s<=1)return Rn(t.columns);var u=e.getProp(l,"column-fill")||Je.balance,n=function(t,e,u,n,i,r,o){if(e===Je.auto)return null;var a=r[r.length-1];return 0===o.positions.length||a&&a.pageBreakType?new iD(u,n,i,t):e===Je.balance_all?new aD(u,n,i):null}(s,u,d,h,o,t.columns,l.currentLayoutPosition.flowPositions[a]);return n?(c=!1,r.lock(),h.lock(),n.balanceColumns(t).thenAsync((function(t){return r.unlock(),r.validate(),h.unlock(),l.currentLayoutPosition=t.position,Rn(t.columns)}))):Rn(t.columns)}))},n.layoutFlowColumns=function(t,e,u,n,i,r,o,a,s,l,D){var h=this,c=Pn("layoutFlowColumns"),d=this.currentLayoutPosition.clone(),f=e.getPropAsNumber(this,"column-gap"),p=l>1?e.getPropAsNumber(this,"column-width"):a.width,E=e.getActiveRegions(this),C=ku(e.getProp(this,"shape-inside"),0,0,a.width,a.height,this),F=new fc(s,this,this.viewport,this.styler,E,this.xmldoc,this.faces,this.style.footnoteProps,this,t,this.customRenderer,this.fallbackMap,this.documentURLTransformer),A=0,g=null,v=[];return c.loopWithFrame((function(t){h.createAndLayoutColumn(e,u,n,i,a,A++,s,o,l,f,p,C,F,D).then((function(e){return r.isInvalidated()?(v=null,void t.breakLoop()):(!(e.pageBreakType&&"column"!==e.pageBreakType)&&A!==l||o.isInvalidated()||o.finish(),o.isInvalidated()?(A=0,h.currentLayoutPosition=d.clone(),o.validate(),void(o.isLocked()?(v=null,t.breakLoop()):t.continueLoop())):(v[A-1]=g=e,g.pageBreakType&&"column"!=g.pageBreakType&&(A=l,"region"!=g.pageBreakType&&(h.pageBreaks[s]=!0)),void(A0){if(!m&&!D){var s=e.getProp(a,"shape-outside"),h=C.getOuterShape(s,a);r.push(h)}}else if(0==e.children.length)return u.removeChild(d),void l.finish(!0);var c=p?0:e.children.length-1;l.loop((function(){for(;c>=0&&c=0;n--){var i=u.positions[n];i.flowChunk.startPage>=0&&i.flowChunk.startPage+i.flowChunk.linger-1<=t&&u.positions.splice(n,1)}},n.initLingering=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var u=this.currentLayoutPosition.flowPositions[e],n=u.positions.length-1;n>=0;n--){var i=u.positions[n];i.flowChunk.startPage<0&&i.flowChunk.startOffset0)return!1}return!0},n.layoutNextPage=function(t,u){var n=this,i=t.container===t.bleedBox;if(this.pageBreaks={},u?(this.currentLayoutPosition=u.clone(),this.styler.replayFlowElementsFromOffset(u.highestSeenOffset)):(this.currentLayoutPosition=new Lr,this.styler.replayFlowElementsFromOffset(-1)),this.lang&&t.bleedBox.setAttribute("lang",this.lang),(u=this.currentLayoutPosition).page>1e4)throw new Error("Too many pages generated (over 10000 pages)");u.page++;var r,o=u.startSideOfFlow("body");u.isBlankPage=$i(o)&&this.matchPageSide(o),t.isBlankPage=u.isBlankPage,null==t.pageType&&(t.pageType=null!=(r=t.isBlankPage?this.styler.cascade.previousPageType:this.styler.cascade.currentPageType)?r:""),this.clearScope(this.style.pageScope),this.layoutPositionAtPageStart=u.clone();var a=i?{}:this.pageManager.getCascadedPageStyle(t.pageType);this.styler.cascade.applyVarFilter([a],this.styler,null),this.styler.cascade.applyCalcFilter(a,this.styler.context);var s=this.selectPageMaster(a);if(!s)return Rn(null);var l=0;if(!i){t.setAutoPageWidth(s.pageBox.specified.width.value===eu),t.setAutoPageHeight(s.pageBox.specified.height.value===uu),this.counterStore.setCurrentPage(t),this.counterStore.updatePageCounters(a,this);var D=Sh(bh(a),this);this.setPageSizeAndBleed(D,t),function(t,e,u,n){var i=!1,r=!1,o=t.marks;if(o){var a=o.value;a instanceof je?a.values.forEach((function(t){t===Je.crop?i=!0:t===Je.cross&&(r=!0)})):a===Je.crop?i=!0:a===Je.cross&&(r=!0)}var s=e.bleed;if(i||r){var l=u.container,D=l.ownerDocument,h=Qe(mh,n),c=Math.max(0,e.bleedOffset-Qe(wh,n)),d=e.bleedOffset-c;i&&Object.keys(Bh).forEach((function(t){var e=function(t,e,u,n,i,r){var o=n;o<=i+2*Mt.mm&&(o=i+n/2);var a=Math.max(n,o),s=i+a+u/2,l=xh(t,s,s),D=[[0,i+n],[n,i+n],[n,i+n-o]],h=D.map((function(t){return[t[1],t[0]]}));e!==Bh.TOP_RIGHT&&e!==Bh.BOTTOM_RIGHT||(D=D.map((function(t){return[i+a-t[0],t[1]]})),h=h.map((function(t){return[i+a-t[0],t[1]]}))),e!==Bh.BOTTOM_LEFT&&e!==Bh.BOTTOM_RIGHT||(D=D.map((function(t){return[t[0],i+a-t[1]]})),h=h.map((function(t){return[t[0],i+a-t[1]]})));var c=Th(t,u);c.setAttribute("points",D.map((function(t){return t.join(",")})).join(" ")),l.appendChild(c);var d=Th(t,u);return d.setAttribute("points",h.map((function(t){return t.join(",")})).join(" ")),l.appendChild(d),e.split(" ").forEach((function(t){l.style[t]=r+"px"})),l}(D,Bh[t],h,d,s,c);l.appendChild(e)})),r&&Object.keys(yh).forEach((function(t){var e=function(t,e,u,n,i){var r,o,a=2*n;e===yh.TOP||e===yh.BOTTOM?(r=a,o=n):(r=n,o=a);var s=xh(t,r,o),l=Th(t,u);l.setAttribute("points","0,"+o/2+" "+r+","+o/2),s.appendChild(l);var D=Th(t,u);D.setAttribute("points",r/2+",0 "+r/2+","+o),s.appendChild(D);var h,c=Th(t,u,"circle");switch(c.setAttribute("cx",r/2),c.setAttribute("cy",o/2),c.setAttribute("r",n/4),s.appendChild(c),e){case yh.TOP:h=yh.BOTTOM;break;case yh.BOTTOM:h=yh.TOP;break;case yh.LEFT:h=yh.RIGHT;break;case yh.RIGHT:h=yh.LEFT}return Object.keys(yh).forEach((function(t){var u=yh[t];u===e?s.style[u]=i+"px":u!==h&&(s.style[u]="0",s.style["margin-"+u]="auto")})),s}(D,yh[t],h,d,c);l.appendChild(e)}))}}(a,D,t,this),l=D.bleedOffset+D.bleed}var h=!i&&s.getProp(this,"writing-mode")||Je.horizontal_tb;this.pageVertical=h!=Je.horizontal_tb;var c=s.getProp(this,"direction")||Je.ltr,d=new es(this.rootPageFloatLayoutContext,qa.PAGE,null,null,null,h,c),f=Pn("layoutNextPage");return f.loopWithFrame((function(e){n.layoutContainer(t,s,t.bleedBox,l,l,[],d).then((function(){d.isInvalidated()||d.finish(),d.isInvalidated()?(n.currentLayoutPosition=n.layoutPositionAtPageStart.clone(),d.validate(),e.continueLoop()):e.breakLoop()}))})).then((function(){if(s.adjustPageLayout(n,t,n.clientLayout),!i){var r=new fe(s.pageBox.scope,"left-page");t.side=r.evaluate(n)?e.PageSide.LEFT:e.PageSide.RIGHT,n.processLinger(),u=n.currentLayoutPosition,Object.keys(u.flowPositions).forEach((function(t){var e=u.flowPositions[t],i=e.breakAfter;!i||"page"!==i&&n.matchPageSide(i)||(e.breakAfter=null)}))}n.currentLayoutPosition=n.layoutPositionAtPageStart=null,u.highestSeenOffset=n.styler.getReachedOffset();var o=n.style.store.getTriggersForDoc(n.xmldoc);t.finish(o,n.clientLayout),n.noMorePrimaryFlows(u)&&(u=null),f.finish(u)})),f.result()},n.setPageSizeAndBleed=function(t,e){this.actualPageWidth=t.pageWidth,this.actualPageHeight=t.pageHeight,this.pageSheetWidth=t.pageWidth+2*t.cropOffset,this.pageSheetHeight=t.pageHeight+2*t.cropOffset,e.container.style.width=this.pageSheetWidth+"px",e.container.style.height=this.pageSheetHeight+"px",e.bleedBox.style.left=t.bleedOffset+"px",e.bleedBox.style.right=t.bleedOffset+"px",e.bleedBox.style.top=t.bleedOffset+"px",e.bleedBox.style.bottom=t.bleedOffset+"px",e.bleedBox.style.padding=t.bleed+"px"},u}(Vt),bc=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e.rootScope,e,u,n,i,e.validatorSet,!n)||this).masterHandler=void 0,r.insideRegion=!1,r.masterHandler=e,r}x(e,t);var u=e.prototype;return u.startPageTemplateRule=function(){},u.startPageMasterRule=function(t,e,u){var n=new QD(this.masterHandler.pageScope,t,e,u,this.masterHandler.rootBox,this.condition,this.owner.getBaseSpecificity());this.masterHandler.pushHandler(new Ah(n.scope,this.masterHandler,n,this.validatorSet))},u.startWhenRule=function(t){var u=t.expr;null!=this.condition&&(u=Be(this.scope,this.condition,u)),this.masterHandler.pushHandler(new e(this.masterHandler,u,this,this.regionId))},u.startDefineRule=function(){this.masterHandler.pushHandler(new wa(this.scope,this.owner))},u.startFontFaceRule=function(){var t={};this.masterHandler.fontFaces.push({properties:t,condition:this.condition}),this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,t,this.masterHandler.validatorSet))},u.startFlowRule=function(t){var e=this.masterHandler.flowProps[t];e||(this.masterHandler.flowProps[t]=e={}),this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startViewportRule=function(){var t={};this.masterHandler.viewportProps.push(t),this.masterHandler.pushHandler(new Na(this.scope,this.owner,this.condition,t,this.masterHandler.validatorSet))},u.startFootnoteRule=function(t){var e=this.masterHandler.footnoteProps;if(t){var u=ao(e,"_pseudos");(e=u[t])||(u[t]=e={})}this.masterHandler.pushHandler(new Na(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startRegionRule=function(){this.insideRegion=!0,this.startSelectorRule()},u.startPageRule=function(){var t=new ic(this.masterHandler.pageScope,this.masterHandler,this,this.validatorSet,this.masterHandler.pageProps);this.masterHandler.pushHandler(t),t.startPageRule()},u.startRuleBody=function(){if(Fa.prototype.startRuleBody.call(this),this.insideRegion){this.insideRegion=!1;var t="R"+this.masterHandler.regionCount++;this.special("region-id",Me(t)),this.endRule();var u=new e(this.masterHandler,this.condition,this,t);this.masterHandler.pushHandler(u),u.startRuleBody()}},e}(Fa),Sc=function(t){function e(e){var u;return(u=t.call(this)||this).validatorSet=void 0,u.rootScope=void 0,u.pageScope=void 0,u.rootBox=void 0,u.cascadeParserHandler=void 0,u.regionCount=0,u.fontFaces=[],u.footnoteProps={},u.flowProps={},u.viewportProps=[],u.pageProps={},u.validatorSet=e,u.rootScope=new Ot(null),u.pageScope=new Ot(u.rootScope),u.rootBox=new qD(u.rootScope),u.cascadeParserHandler=new bc(k(u),null,null,null),u.slave=u.cascadeParserHandler,u}return x(e,t),e}(hi);function xc(t,e){return e.parseOPSResource(t)}var Tc=function(t){function u(e){var u;return(u=t.call(this,xc,Ln.DOCUMENT)||this).fontDeobfuscator=void 0,u.styleByKey={},u.styleFetcherByKey={},u.styleByDocURL={},u.triggersByDocURL={},u.validatorSet=null,u.styleSheets=[],u.triggerSingleDocumentPreprocessing=!1,u.fontDeobfuscator=e,u}x(u,t);var n=u.prototype;return n.init=function(t,e){var u=this;this.setStyleSheets(t,e);var n=Pn("OPSDocStore.init");return this.validatorSet=VD(),yc.get().then((function(){u.triggerSingleDocumentPreprocessing=!0,n.finish(!0)})),n.result()},n.getStyleForDoc=function(t){return this.styleByDocURL[t.url]},n.getTriggersForDoc=function(t){return this.triggersByDocURL[t.url]},n.setStyleSheets=function(t,e){this.clearStyleSheets(),t&&t.forEach(this.addAuthorStyleSheet,this),e&&e.forEach(this.addUserStyleSheet,this)},n.clearStyleSheets=function(){this.styleSheets.splice(0)},n.addAuthorStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ri.AUTHOR,classes:null,media:null})},n.addUserStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ri.USER,classes:null,media:null})},n.parseOPSResource=function(t){var u=this,n=Pn("OPSDocStore.load"),i=t.url,r=i.endsWith("?viv-toc-box");return vc(t,this).then((function(t){if(t){if(u.triggerSingleDocumentPreprocessing)for(var o=C(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT),a=0;a*>*>*>*>*[style*='display: none']")).forEach((function(t){t.setAttribute("aria-hidden","true"),t.setAttribute("hidden","hidden")})),r.setAutoHeight(t,2),o.finish(a)}))}))})),o.result()},e.hideTOC=function(){this.page&&(this.page.container.style.visibility="hidden",this.page.container.setAttribute("aria-hidden","true"))},e.isTOCVisible=function(){return!!this.page&&"visible"===this.page.container.style.visibility},e.getTOC=function(){if(!this.page)return[];function t(t){if(!t)return[];var u=t.querySelectorAll(":scope > [role=treeitem] > a[href]");return Array.from(u).map(e)}function e(e){return{id:new URL(e.href).hash.match(/^#?(.*)$/)[1],title:e.innerText,children:t(e.parentElement.querySelector("[role=group]"))}}return t(this.page.container.querySelector("[role=tree]"))},t}();function Rc(t){var e=t.target,u=e.textContent==Ic;e.textContent=u?"▾":Ic;var n=e.parentNode;e.setAttribute("aria-expanded",u?"true":"false"),n.setAttribute("aria-expanded",u?"true":"false");for(var i=n.firstChild;i;){if(1===i.nodeType){var r=i,o=r.getAttribute("data-adapt-class");if("toc-container"===o){if(r.setAttribute("aria-hidden",u?"false":"true"),r.firstChild){i=r.firstChild;continue}}else if("toc-node"===o&&(r.style.height=u?"auto":"0px",r.children.length>=2&&(r.children[1].tabIndex=u?0:-1),r.children.length>=3&&(r.children[0].tabIndex=u?0:-1,!u))){var a=r.children[0];if("▾"==a.textContent){a.textContent=Ic,a.setAttribute("aria-expanded","false"),r.setAttribute("aria-expanded","false"),i=r.children[2];continue}}}for(;!i.nextSibling&&i.parentNode!==n;)i=i.parentNode;i=i.nextSibling}t.stopPropagation()}var kc=function(t){function e(){var e;return(e=t.call(this,null)||this).plainXMLStore=void 0,e.jsonStore=void 0,e.opfByURL={},e.primaryOPFByEPubURL={},e.deobfuscators={},e.documents={},e.fontDeobfuscator=e.makeDeobfuscatorFactory(),e.plainXMLStore=new ui(vc,Ln.DOCUMENT),e.jsonStore=new ui(ni,Ln.TEXT),e}x(e,t);var u=e.prototype;return u.makeDeobfuscatorFactory=function(){var t=this;return function(e){return t.deobfuscators[e]}},u.loadAsPlainXML=function(t,e,u){return this.plainXMLStore.load(t,e,u)},u.startLoadingAsPlainXML=function(t){this.plainXMLStore.fetch(t)},u.loadAsJSON=function(t,e,u){return this.jsonStore.load(t,e,u)},u.loadPubDoc=function(t){var e=this,u=Pn("loadPubDoc");return ti(t,null,"HEAD").then((function(n){if(n.status>=400)e.loadEPUBDoc(t).then((function(e){e?u.finish(e):(c.error("Failed to fetch a source document from "+t+" ("+n.status+(n.statusText?" "+n.statusText:"")+")"),u.finish(null))}));else if(n.status||n.responseXML||n.responseText||n.responseBlob||n.contentType||/\/[^/.]+(?:[#?]|$)/.test(t)&&(t=t.replace(/([#?]|$)/,"/$1")),"application/oebps-package+xml"==n.contentType||/\.opf(?:[#?]|$)/.test(t)){var i=t.match(/^((?:.*\/)?)([^/]*)$/);e.loadOPF(i[1],i[2]).thenFinish(u)}else"application/ld+json"==n.contentType||"application/webpub+json"==n.contentType||"application/audiobook+json"==n.contentType||"application/json"==n.contentType||/\.json(?:ld)?(?:[#?]|$)/.test(t)?e.loadAsJSON(t,!0).then((function(n){if(!n)return e.reportLoadError(t),void u.finish(null);var i=new Xc(e,t);i.initWithWebPubManifest(n,void 0,t).then((function(){u.finish(i)}))})):e.loadWebPub(t).then((function(n){n?u.finish(n):e.loadEPUBDoc(t).then((function(e){e?u.finish(e):(c.error("Failed to load "+t+"."),u.finish(null))}))}))})),u.result()},u.loadEPUBDoc=function(t){var e=this,u=Pn("loadEPUBDoc");return t.endsWith("/")||(t+="/"),this.startLoadingAsPlainXML(t+"META-INF/encryption.xml"),this.loadAsPlainXML(t+"META-INF/container.xml").then((function(n){if(n)for(var i,r=O(n.doc().child("container").child("rootfiles").child("rootfile").attribute("full-path"));!(i=r()).done;){var o=i.value;if(o)return void e.loadOPF(t,o).thenFinish(u)}u.finish(null)})),u.result()},u.loadOPF=function(t,e){var u=this,n=t+e,i=this.opfByURL[n];if(i)return Rn(i);var r=Pn("loadOPF");return this.loadAsPlainXML(n,!0,"Failed to fetch EPUB OPF "+n).then((function(e){e?u.loadAsPlainXML(t+"META-INF/encryption.xml").then((function(o){(i=new Xc(u,t)).initWithXMLDoc(e,o).then((function(){u.opfByURL[n]=i,u.primaryOPFByEPubURL[t]=i,r.finish(i)}))})):u.reportLoadError(n)})),r.result()},u.loadWebPub=function(t){var e=this,u=Pn("loadWebPub");return this.load(t).then((function(n){if(n)if(n.document.querySelector("a[href='META-INF/'],a[href$='/META-INF/']"))u.finish(null);else{var i=n.document,r=new Xc(e,t);i.body&&i.body.setAttribute("data-vivliostyle-primary-entry",!0);var o=i.querySelector("link[rel='publication'],link[rel='manifest'][type='application/webpub+json']");if(o){var a=o.getAttribute("href");if(/^#/.test(a)){var s=V(i.getElementById(a.substr(1)).textContent);r.initWithWebPubManifest(s,i).then((function(){u.finish(r)}))}else{var l=K(o.getAttribute("href"),t);e.loadAsJSON(l,!0,"Failed to fetch Publication Manifest "+l).then((function(t){r.initWithWebPubManifest(t,i,l).then((function(){u.finish(r)}))}))}}else r.initWithWebPubManifest({},i).then((function(){r.xhtmlToc&&r.xhtmlToc.src===n.url&&(i.querySelector("[role=doc-toc], [role=directory], nav, .toc, #toc")||(r.xhtmlToc=null)),u.finish(r)}))}else e.reportLoadError(t)})),u.result()},u.addDocument=function(t,e){var u=Pn("EPUBDocStore.load"),n=H(t);return(this.documents[n]=this.parseOPSResource({status:200,statusText:"",url:n,contentType:e.contentType,responseText:null,responseXML:e,responseBlob:null})).thenFinish(u),u.result()},u.reportLoadError=function(t){var e,u=this,n=function(t){return t.replace(/([^:/?#]|^)[/?#].*/,"$1")};t.startsWith("data:")?c.error("Failed to load "+t+". Invalid data."):t.startsWith("http:")&&z.startsWith("https:")?c.error("Failed to load "+t+'. Mixed Content ("http:" content on "https:" context) is not allowed.'):(e=n(t))===n(z)||Object.keys(u.resources).find((function(t){return u.resources[t]&&n(t)===e}))||/\.(xhtml|xht|xml|opf)$/i.test(t)?c.error("Failed to load "+t+". The target resource is invalid."):c.error("Failed to load "+t+". This may be caused by the server not allowing cross-origin resource sharing (CORS).")},u.load=function(e){var u=this,n=H(e),i=this.documents[n];if(i)return i.isPending()?i:Rn(i.get());var r=Pn("EPUBDocStore.load");return(i=t.prototype.load.call(this,n,!0,"Failed to fetch a source document from "+n)).then((function(t){t?r.finish(t):u.reportLoadError(n)})),r.result()},u.processViewportMeta=function(t){var e=t.getAttribute("content");if(!e)return"";for(var u,n={};null!=(u=e.match(/^,?\s*([-A-Za-z_.][-A-Za-z_0-9.]*)\s*=\s*([-+A-Za-z_0-9.]*)\s*/));)e=e.substr(u[0].length),n[u[1]]=u[2];var i=n.width-0,r=n.height-0;return i&&r?"@-epubx-viewport{width:"+i+"px;height:"+r+"px;}"+(Object.values(this.primaryOPFByEPubURL).find((function(t){return t.prePaginated}))?"@page{size:"+i+"px "+r+"px;margin:0;}":"@page{margin:0;}"):""},e}(Tc),Lc=function(){function t(){this.id=null,this.src="",this.mediaType=null,this.title=null,this.itemRefElement=null,this.spineIndex=-1,this.compressedSize=0,this.compressed=null,this.epage=0,this.epageCount=0,this.startPage=null,this.skipPagesBefore=null,this.itemProperties=void 0,this.itemProperties=U}var e=t.prototype;return e.initWithElement=function(t,e){this.id=t.getAttribute("id"),this.src=K(t.getAttribute("href"),e),this.mediaType=t.getAttribute("media-type");var u=t.getAttribute("properties");u&&(this.itemProperties=function(t){for(var e={},u=0;u0&&this.uid)for(var F=function(t){return function(e){var u=Pn("deobfuscator");return function(t,e){var u=Pn("makeDigest"),n=u.suspend();return window.crypto.subtle.digest("SHA-1",(new TextEncoder).encode(e)).then((function(t){n.schedule(new Uint8Array(t))})),u.result()}(0,t).then((function(t){var n=e.slice(0,1040),i=e.slice(1040,e.size);(function(t){var e=Pn("readBlob"),u=new FileReader,n=e.suspend(u);return u.addEventListener("load",(function(){n.schedule(u.result)}),!1),u.readAsArrayBuffer(t),e.result()})(n).then((function(e){for(var n=new DataView(e),r=0;r","text/xml"));return t.forEach((function(t){var e=new Lc;e.initWithParam(t);var i=n.document.createElement("itemref");i.setAttribute("idref",e.id),n.root.appendChild(i),e.itemRefElement=i,u.itemMap[e.id]=e;var r=u.getPathFromURL(t.url);null==r&&(r=t.url),u.itemMapByPath[r]=e,u.items.push(e)})),e?this.store.addDocument(t[0].url,e):Rn(null)},e.initWithWebPubManifest=function(t,e,u){var n,i,r,o,a=this;t.readingProgression&&(this.pageProgression=t.readingProgression),void 0===this.metadata&&(this.metadata={});var s=t.name||(null==(n=t.metadata)?void 0:n.title)||(null==e?void 0:e.title);s&&(this.metadata[Uc.title]=(Array.isArray(s)?s:[s]).map((function(t){var e;return{v:null!=(e=t.value)?e:t}})));var l=t.author||t.creator||(null==(i=t.metadata)?void 0:i.author)||Array.from(null!=(r=null==e?void 0:e.querySelectorAll("meta[name='author'], meta[name='DC.Creator']"))?r:[]).map((function(t){return t.content}));l&&0!==l.length&&(this.metadata[Uc.creator]=(Array.isArray(l)?l:[l]).map((function(t){var e;return{v:null!=(e=t.name)?e:t}})));var D=t.inLanguage||(null==(o=t.metadata)?void 0:o.language)||(null==e?void 0:e.documentElement.lang)||(null==e?void 0:e.documentElement.getAttribute("xml:lang"));D&&(this.metadata[Uc.language]=(Array.isArray(D)?D:[D]).map((function(t){return{v:t}})));var h=this.getPathFromURL(this.pubURL);if(!t.readingOrder&&e&&null!==h){t.readingOrder=[encodeURI(h)];for(var c,d="[role=doc-toc] a[href],[role=directory] a[href],nav li a[href],.toc a[href],#toc a[href]"+(CSS.supports("selector(:has(*))")?",section:has(>:first-child:is(h1,h2,h3,h4,h5,h6):is(.toc,#toc)) a[href]":""),f=O(e.querySelectorAll(d));!(c=f()).done;){var p=c.value.getAttribute("href");if(!/^(https?:)?\/\//.test(p)&&!/\.(jpe?g|png|gif|pdf|svg|mml)([#?]|$)/.test(p)){var E=H(K(p,this.pubURL)),C=this.getPathFromURL(E),F=null!==C?encodeURI(C):E;-1==t.readingOrder.indexOf(F)&&t.readingOrder.push(F)}}}var A=[],g=0,v=-1;[t.readingOrder,t.resources].forEach((function(e){e instanceof Array&&e.forEach((function(e){var n=t.readingOrder.includes(e),i="string"==typeof e?e:e.url||e.href,r="string"==typeof e?"":e.encodingFormat||e.href&&e.type||"";if(n||"text/html"===r||"application/xhtml+xml"===r||!r&&"stylesheet"!==e.rel&&/(^|\/)([^/]+\.(x?html|htm|xht)|[^/.]*)([#?]|$)/.test(i)){var o=u?u.replace(/\/[^/]+$/,"/"):a.pubURL,s={url:K(Y(i),o),index:g++,startPage:null,skipPagesBefore:null};"contents"===e.rel&&-1===v&&(v=s.index),A.push(s)}}))}));var m=Pn("initWithWebPubManifest");return this.initWithChapters(A).then((function(){var t;-1!==v&&(a.xhtmlToc=a.items[v]),a.xhtmlToc||(a.xhtmlToc=u?null==(t=a.items)?void 0:t[0]:a.itemMapByPath[h]),m.finish(!0)})),m.result()},e.getCFI=function(t,e){var u=this.spine[t],n=Pn("getCFI");return this.store.load(u.src).then((function(t){var i=t.getNodeByOffset(e),r=null;if(i){var o=t.getNodeOffset(i,0,!1),a=e-o,s=new bt;s.prependPathFromNode(i,a,!1,null),u.itemRefElement&&s.prependPathFromNode(u.itemRefElement,0,!1,null),r=s.toString()}n.finish(r)})),n.result()},e.resolveFragment=function(t){var e=this;return kn("resolveFragment",(function(u){if(t){var n,i=new bt;if(i.fromString(t),e.opfXML){var r=i.navigate(e.opfXML.document);if(1!=r.node.nodeType||r.after||!r.ref)return void u.finish(null);var o=r.node,a=o.getAttribute("idref");if("itemref"!=o.localName||!a||!e.itemMap[a])return void u.finish(null);n=e.itemMap[a],i=r.ref}else n=e.spine[0];e.store.load(n.src).then((function(t){var e=i.navigate(t.document),r=t.getNodeOffset(e.node,e.offset,e.after);u.finish({spineIndex:n.spineIndex,offsetInItem:r,pageIndex:-1})}))}else u.finish(null)}),(function(e,u){c.warn(u,"Cannot resolve fragment:",t),e.finish(null)}))},e.resolveEPage=function(t){var e=this;return kn("resolveEPage",(function(u){if(t<=0)u.finish({spineIndex:0,offsetInItem:0,pageIndex:-1});else if(e.epageIsRenderedPage){var n=e.spine.findIndex((function(e){return 0==e.epage&&0==e.epageCount||e.epage<=t&&e.epage+e.epageCount>t}));-1==n&&(n=e.spine.length-1);var i=e.spine[n];i&&0!=i.epageCount||(i=e.spine[--n]);var r=Math.floor(t-i.epage);u.finish({spineIndex:n,offsetInItem:-1,pageIndex:r})}else{var o=ct(e.spine.length,(function(u){var n=e.spine[u];return n.epage+n.epageCount>t}));o==e.spine.length&&o--;var a=e.spine[o];e.store.load(a.src).then((function(e){(t-=a.epage)>a.epageCount&&(t=a.epageCount);var n=0;if(t>0){var i=e.getTotalOffset();(n=Math.round(i*t/a.epageCount))==i&&n--}u.finish({spineIndex:o,offsetInItem:n,pageIndex:-1})}))}}),(function(e,u){c.warn(u,"Cannot resolve epage:",t),e.finish(null)}))},e.getEPageFromPosition=function(t){var e=this.spine[t.spineIndex];if(this.epageIsRenderedPage)return Rn(e.epage+t.pageIndex);if(t.offsetInItem<=0)return Rn(e.epage);var u=Pn("getEPage");return this.store.load(e.src).then((function(n){var i=n.getTotalOffset(),r=Math.min(i,t.offsetInItem);u.finish(e.epage+r*e.epageCount/i)})),u.result()},t}(),jc=function(t,e){return{page:t,position:{spineIndex:t.spineIndex,pageIndex:e,offsetInItem:t.offset}}},Kc=function(){function t(t,e,u,n,i){this.opf=void 0,this.viewport=void 0,this.fontMapper=void 0,this.pageSheetSizeReporter=void 0,this.spineItems=[],this.spineItemLoadingContinuations=[],this.pref=void 0,this.clientLayout=void 0,this.counterStore=void 0,this.tocAutohide=!1,this.tocVisible=!1,this.tocView=void 0,this.opf=t,this.viewport=e,this.fontMapper=u,this.pageSheetSizeReporter=i,this.pref=St(n),this.clientLayout=new Cc(e),this.counterStore=new Gu(t.documentURLTransformer)}var u=t.prototype;return u.getPage=function(t){var e=this.spineItems[t.spineIndex];return e?e.pages[t.pageIndex]:null},u.getCurrentPageProgression=function(t){if(this.opf.pageProgression)return this.opf.pageProgression;var e=this.spineItems[t?t.spineIndex:0];return e?e.instance.pageProgression:null},u.finishPageContainer=function(t,e,u){e.container.style.display="none",e.container.style.visibility="visible",e.container.style.position="",e.container.style.top="",e.container.style.left="",e.container.setAttribute("data-vivliostyle-page-side",e.side);var n=t.pages[u];if(e.isFirstPage=0==t.item.spineIndex&&0==u,t.pages[u]=e,this.opf.epageIsRenderedPage){if(0==u&&t.item.spineIndex>0){var i=this.opf.spine[t.item.spineIndex-1];t.item.epage=i.epage+i.epageCount}t.item.epageCount=t.pages.length,this.opf.epageCount=this.opf.spine.reduce((function(t,e){return t+e.epageCount}),0),this.opf.epageCountCallback&&this.opf.epageCountCallback(this.opf.epageCount)}if(n)t.instance.viewport.contentContainer.replaceChild(e.container,n.container),n.dispatchEvent({type:"replaced",target:null,currentTarget:null,preventDefault:null,newPage:e});else{var r=null;if(u>0)r=t.pages[u-1].container.nextElementSibling;else for(var o=t.item.spineIndex+1;oi.length)t.breakLoop();else{var e=i[a-1];e.refs=e.refs.filter((function(t){return!t.isResolved()})),0!==e.refs.length?u.getPageViewItem(e.spineIndex).then((function(n){n?(u.counterStore.pushPageCounters(e.pageCounters),u.counterStore.pushReferencesToSolve(e.refs),u.renderSinglePage(n,n.layoutPositions[e.pageIndex]).then((function(e){u.counterStore.popPageCounters(),u.counterStore.popReferencesToSolve();var n=e.pageAndPosition.position;n.spineIndex===r.spineIndex&&n.pageIndex===o&&(r=e.pageAndPosition.page),t.continueLoop()}))):t.continueLoop()})):t.continueLoop()}})).then((function(){r.container.parentElement||(r=t.pages[o]),r.isLastPage=!e&&t.item.spineIndex===u.opf.spine.length-1,r.isLastPage&&u.counterStore.finishLastPage(u.viewport),r.container.setAttribute("data-vivliostyle-page-index",o),r.container.setAttribute("data-vivliostyle-spine-index",r.spineIndex),n.finish({pageAndPosition:jc(r,o),nextLayoutPosition:e})}))}))})),n.result()},u.normalizeSeekPosition=function(t,e){var u=t.pageIndex,n=-1;if(u<0){n=t.offsetInItem;var i=ct(e.layoutPositions.length,(function(t){return e.instance.getPosition(e.layoutPositions[t],!0)>n}));u=i===e.layoutPositions.length?e.complete?e.layoutPositions.length-1:Number.POSITIVE_INFINITY:i-1}else u===Number.POSITIVE_INFINITY&&-1!==t.offsetInItem&&(n=t.offsetInItem);return{spineIndex:t.spineIndex,pageIndex:u,offsetInItem:n}},u.findPage=function(t,e){var u=this,n=Pn("findPage");return this.getPageViewItem(t.spineIndex).then((function(i){if(i){var r,o=null;n.loopWithFrame((function(a){var s=u.normalizeSeekPosition(t,i);(o=i.pages[r=s.pageIndex])?a.breakLoop():i.complete?(o=i.pages[r=i.layoutPositions.length-1],a.breakLoop()):e?u.renderPage(s).then((function(t){t&&(o=t.page,r=t.position.pageIndex),a.breakLoop()})):n.sleep(100).then((function(){a.continueLoop()}))})).then((function(){n.finish(jc(o,r))}))}else n.finish(null)})),n.result()},u.renderPage=function(t){var e=this,u=Pn("renderPage");return this.getPageViewItem(t.spineIndex).then((function(n){if(n){var i=e.normalizeSeekPosition(t,n),r=i.pageIndex,o=i.offsetInItem,a=n.pages[r];a?u.finish(jc(a,r)):u.loopWithFrame((function(t){if(r=0&&n.instance.getPosition(u)>o)return a=i,r=n.layoutPositions.length-2,void t.breakLoop();t.continueLoop()}else a=i,r=e.pageAndPosition.position.pageIndex,n.complete=!0,t.breakLoop()}))}})).then((function(){var t=n.layoutPositions[r];(a=a||n.pages[r])?u.finish(jc(a,r)):e.renderSinglePage(n,t).then((function(t){t.nextLayoutPosition||(n.complete=!0),u.finish(t.pageAndPosition)}))}))}else u.finish(null)})),u.result()},u.renderAllPages=function(){return this.renderPagesUpto({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},!1)},u.renderPagesUpto=function(t,e){var u=this,n=Pn("renderPagesUpto");t||(t={spineIndex:0,pageIndex:0,offsetInItem:0});var i,r=t.spineIndex,o=t.pageIndex,a=0;return e&&(a=r),n.loopWithFrame((function(e){u.renderPage({spineIndex:a,pageIndex:a===r?o:Number.POSITIVE_INFINITY,offsetInItem:a===r?t.offsetInItem:-1}).then((function(t){i=t,++a>r?e.breakLoop():e.continueLoop()}))})).then((function(){n.finish(i)})),n.result()},u.firstPage=function(t,e){return this.findPage({spineIndex:0,pageIndex:0,offsetInItem:-1},e)},u.lastPage=function(t,e){return this.findPage({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},e)},u.nextPage=function(t,e){var u=this,n=t.spineIndex,i=t.pageIndex,r=Pn("nextPage");return this.getPageViewItem(n).then((function(t){if(t){if(t.complete&&i==t.layoutPositions.length-1){if(n>=u.opf.spine.length-1)return void r.finish(null);n++,i=0;var o=u.spineItems[n],a=o&&o.pages[0],s=t.pages[t.pages.length-1];a&&s&&a.side==s.side&&(o.pages.forEach((function(t){t.container&&t.container.remove()})),u.spineItems[n]=null,u.spineItemLoadingContinuations[n]=null)}else i++;u.findPage({spineIndex:n,pageIndex:i,offsetInItem:-1},e).thenFinish(r)}else r.finish(null)})),r.result()},u.previousPage=function(t,e){var u=t.spineIndex,n=t.pageIndex;if(0==n){if(0==u)return Rn(null);u--,n=Number.POSITIVE_INFINITY}else n--;return this.findPage({spineIndex:u,pageIndex:n,offsetInItem:-1},e)},u.isRectoPage=function(t,u){var n=t.side===e.PageSide.LEFT,i=this.getCurrentPageProgression(u)===e.PageProgression.LTR;return!n&&i||n&&!i},u.getSpread=function(t,u){var n=this,i=this.getPage(t);if(!i)return Rn({left:null,right:null});var r=Pn("getSpread"),o=i.side===e.PageSide.LEFT;return(this.isRectoPage(i,t)?this.previousPage(t,u):this.nextPage(t,u)).then((function(e){var u=n.getPage(t),i=e&&e.page;i&&i.side===u.side&&(i=null),r.finish(o?{left:u,right:i}:{left:i,right:u})})),r.result()},u.nextSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.nextPage(t,e);return i?r:r.thenAsync((function(t){if(t){if(t.page.side===n.side)return r;var i=u.nextPage(t.position,e);return i.thenAsync((function(t){return t?i:r}))}return Rn(null)}))},u.previousSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.previousPage(t,e),o=n.container.previousElementSibling;return i?r.thenAsync((function(t){return t?t.page.side===n.side||t.page.container!==o?r:u.previousPage(t.position,e):Rn(null)})):r},u.navigateToEPage=function(t,e,u){var n=this,i=Pn("navigateToEPage");return this.opf.resolveEPage(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateToFragment=function(t,e,u){var n=this,i=Pn("navigateToCFI");return this.opf.resolveFragment(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateTo=function(t,e,u){var n=this;c.debug("Navigate to",t);var i=this.opf.getPathFromURL(H(t));if(!i){if(this.opf.opfXML&&t.match(/^#epubcfi\(/))i=this.opf.getPathFromURL(this.opf.opfXML.url);else if("#"===t.charAt(0)){var r=this.opf.documentURLTransformer.restoreURL(t);this.opf.opfXML?null==(i=this.opf.getPathFromURL(r[0]))&&(i=r[0]):i=r[0],t=r[0]+(r[1]?"#"+r[1]:"")}if(null==i)return Rn(null)}var o=this.opf.itemMapByPath[i];if(!o){if(this.opf.opfXML&&i==this.opf.getPathFromURL(this.opf.opfXML.url)){var a=t.indexOf("#");if(a>=0)return this.navigateToFragment(t.substr(a+1),e,u)}return Rn(null)}var s=Pn("navigateTo");return this.getPageViewItem(o.spineIndex).then((function(e){if(e){var i=e.xmldoc.getElement(t);n.findPage({spineIndex:o.spineIndex,pageIndex:-1,offsetInItem:i?e.xmldoc.getElementOffset(i):0},u).thenFinish(s)}else s.finish(null)})),s.result()},u.makePage=function(t,u){var n=t.instance.viewport,i=n.document.createElement("div");i.setAttribute("data-vivliostyle-page-container","true"),i.setAttribute("role","region"),i.style.position="absolute",i.style.top="0",i.style.left="0",e.isDebug||(i.style.visibility="hidden"),n.layoutBox.appendChild(i);var r=n.document.createElement("div");r.setAttribute("data-vivliostyle-bleed-box","true"),i.appendChild(r);var o=new fr(i,r);if(o.spineIndex=t.item.spineIndex,o.position=u,o.offset=t.instance.getPosition(u),0===o.offset&&(!t.instance.blankPageAtStart||0!==t.pages.length)){var a=this.opf.documentURLTransformer.transformFragment("",t.item.src);r.setAttribute("id",a),o.registerElementWithId(r,a)}if(n!==this.viewport){var s=It(this.viewport.width,this.viewport.height,n.width,n.height),l=Li(null,new Sn(s,null),"");o.delayedItems.push(new hr(i,"transform",l))}return o},u.makeObjectView=function(t,e,u,n){var i=e.getAttribute("data"),r=null;if(i){i=K(i,t.url);var o=e.getAttribute("media-type");if(!o){var a=this.opf.getPathFromURL(i);if(a){var s=this.opf.itemMapByPath[a];s&&(o=s.mediaType)}}if(o){var l=this.opf.bindings[o];if(l){(r=this.viewport.document.createElement("iframe")).style.border="none";var D=st(i),h=st(o),c=new it;c.append(l),c.append("?src="),c.append(D),c.append("&type="),c.append(h);for(var d=e.firstChild;d;d=d.nextSibling)if(1==d.nodeType){var f=d;if("param"==f.localName&&f.namespaceURI==W.XHTML){var p=f.getAttribute("name"),E=f.getAttribute("value");p&&E&&(c.append("&"),c.append(encodeURIComponent(p)),c.append("="),c.append(encodeURIComponent(E)))}}r.setAttribute("src",c.toString());var C=e.getAttribute("width");C&&r.setAttribute("width",C);var F=e.getAttribute("height");F&&r.setAttribute("height",F)}}}return r||(r=this.viewport.document.createElement("object"),i&&r.setAttribute("data",i),r.setAttribute("data-adapt-process-children","true")),Rn(r)},u.makeMathJaxView=function(t,e,u,n){var i=Hc();if(i){var r=u.ownerDocument,o=r.createElement("span");u.appendChild(o);var a=r.importNode(e,!0);this.resolveURLsInMathML(a,t),o.appendChild(a);var s=i.queue;s.Push(["Typeset",i,o]);var l=Pn("makeMathJaxView"),D=l.suspend();return s.Push((function(){D.schedule(o)})),l.result()}return Rn(null)},u.resolveURLsInMathML=function(t,e){if(null!=t){if(1===t.nodeType&&"mglyph"===t.tagName)for(var u=0,n=Array.from(t.attributes);u=this.opf.spine.length)return Rn(null);var u=this.spineItems[t];if(u)return Rn(u);var n=Pn("getPageViewItem"),i=this.spineItemLoadingContinuations[t];if(i){var r=n.suspend();return i.push(r),n.result()}i=this.spineItemLoadingContinuations[t]=[];var o=this.opf.spine[t],a=this.opf.store;return a.load(o.src).then((function(r){var s,l=o.itemRefElement.getAttribute("properties");l&&r.root.setAttribute("data-vivliostyle-epub-spine-properties",l),o.title=r.document.title;var D=a.getStyleForDoc(r),h=e.makeCustomRenderer(r),c=e.viewport,d=D.sizeViewport(c.width,c.height,c.fontSize,e.pref);d.width==c.width&&d.height==c.height&&d.fontSize==c.fontSize||(c=new Fc(c.window,d.fontSize,c.pixelRatio,c.root,d.width,d.height));var f,p,E=null==(s=e.spineItems[0])?void 0:s.instance.isVersoFirstPage,C=e.spineItems[t-1];if(null!==o.startPage)p=f=o.startPage-1;else{if(!(t>0)||C&&C.complete){f=C?C.instance.pageNumberOffset+C.pages.length:0;var F=e.counterStore.currentPageCounters.page;p=F&&F.length?F[F.length-1]:f}else f=o.epage||t,e.opf.prePaginated||f%2!=(E?1:0)||f++,p=f;null!==o.skipPagesBefore&&(f+=o.skipPagesBefore,p+=o.skipPagesBefore)}e.counterStore.forceSetPageCounter(p);var A=new Nc(D,r,e.opf.lang,c,e.clientLayout,e.fontMapper,h,e.opf.fallbackMap,f,e.opf.documentURLTransformer,e.counterStore,e.opf.pageProgression,E);A.pref=e.pref;var g=e.opf.metadata&&e.opf.metadata[Uc.title];A.pubTitle=g&&g[0]&&g[0].v||"",A.docTitle=o.title||"",A.init().then((function(){e.spineItems[t]=u={item:o,xmldoc:r,instance:A,layoutPositions:[null],pages:[],complete:!1},n.finish(u),i.forEach((function(t){t.schedule(u)}))}))})),n.result()},u.removeRenderedPages=function(){for(var t,e=O(this.spineItems);!(t=e()).done;){var u=t.value;u&&u.pages.splice(0)}this.viewport.clear()},u.hasAutoSizedPages=function(){for(var t,e=O(this.spineItems);!(t=e()).done;){var u=t.value;if(u)for(var n,i=O(u.pages);!(n=i()).done;){var r=n.value;if(r.isAutoPageWidth&&r.isAutoPageHeight)return!0}}return!1},u.hasPages=function(){return this.spineItems.some((function(t){return t&&t.pages.length>0}))},u.showTOC=function(t){var e=this.opf,u=e.xhtmlToc||e.ncxToc;if(this.tocAutohide=t,!u)return Rn(null);if(this.tocVisible=!0,this.tocView&&this.tocView.page)return this.tocView.page.container.style.visibility="visible",this.tocView.page.container.setAttribute("aria-hidden","false"),Rn(this.tocView.page);var n=Pn("showTOC");this.tocView||(this.tocView=new Pc(e.store,u.src,e.lang,this.clientLayout,this.fontMapper,this.pref,this,e.fallbackMap,e.documentURLTransformer,this.counterStore));var i=this.viewport,r=Math.min(350,Math.round(.67*i.width)-16),o=i.height-6,a=i.document.createElement("div");return i.root.appendChild(a),a.style.visibility="hidden",a.style.width=r+10+"px",a.style.maxHeight=o+"px",a.setAttribute("data-vivliostyle-toc-box","true"),a.setAttribute("role","navigation"),this.tocView.showTOC(a,i,r,o,this.viewport.fontSize).then((function(t){a.style.visibility="visible",a.setAttribute("aria-hidden","false"),n.finish(t)})),n.result()},u.hideTOC=function(){this.tocVisible=!1,this.tocView&&this.tocView.hideTOC()},u.isTOCVisible=function(){return this.tocVisible&&!!this.tocView&&this.tocView.isTOCVisible()},t}(),Yc="data-vivliostyle-viewer-status";!function(t){t.SINGLE_PAGE="singlePage",t.SPREAD="spread",t.AUTO_SPREAD="autoSpread"}(zc||(zc={}));var qc,$c=function(){function t(t,u,n,i){var r=this;this.window=void 0,this.viewportElement=void 0,this.instanceId=void 0,this.callbackFn=void 0,this.fontMapper=void 0,this.kick=void 0,this.sendCommand=void 0,this.resizeListener=void 0,this.hyperlinkListener=void 0,this.pageRuleStyleElement=void 0,this.pageSheetSizeAlreadySet=!1,this.renderTask=null,this.actions=void 0,this.readyState=void 0,this.packageURL=void 0,this.opf=void 0,this.touchActive=void 0,this.touchX=void 0,this.touchY=void 0,this.needResize=void 0,this.resized=void 0,this.needRefresh=void 0,this.viewportSize=void 0,this.currentPage=void 0,this.currentSpread=void 0,this.pagePosition=void 0,this.fontSize=void 0,this.zoom=void 0,this.fitToScreen=void 0,this.pageViewMode=void 0,this.waitForLoading=void 0,this.renderAllPages=void 0,this.pref=void 0,this.pageSizes=void 0,this.pixelRatio=void 0,this.pixelRatioLimit=void 0,this.viewport=void 0,this.opfView=void 0,this.window=t,this.viewportElement=u,this.instanceId=n,this.callbackFn=i;var o=u.ownerDocument,a=function(t,e){var u=o.getElementById(t);return u||((u=o.createElement("style")).id=t,e&&(u.textContent=e),o.head.appendChild(u)),u};a("vivliostyle-viewport-screen-css",jn),a("vivliostyle-viewport-css",Kn),a("vivliostyle-polyfill-css",Jn),u.setAttribute("data-vivliostyle-viewer-viewport",!0),e.isDebug&&u.setAttribute("data-vivliostyle-debug",!0),u.setAttribute(Yc,"loading"),this.fontMapper=new jD(o.head,u),this.init(),this.kick=function(){},this.sendCommand=function(){},this.resizeListener=function(){r.needResize=!0,r.resized=!0,r.kick()},this.pageReplacedListener=this.pageReplacedListener.bind(this),this.hyperlinkListener=function(t){},this.pageRuleStyleElement=a("vivliostyle-page-rules"),this.actions={loadPublication:this.loadPublication,loadXML:this.loadXML,configure:this.configure,moveTo:this.moveTo,toc:this.showTOC},this.addLogListeners()}var u=t.prototype;return u.init=function(){this.readyState=e.ReadyState.LOADING,this.packageURL=[],this.opf=null,this.touchActive=!1,this.touchX=0,this.touchY=0,this.needResize=!1,this.resized=!1,this.needRefresh=!1,this.viewportSize=null,this.currentPage=null,this.currentSpread=null,this.pagePosition=null,this.fontSize=16,this.zoom=1,this.fitToScreen=!1,this.pageViewMode=zc.SINGLE_PAGE,this.waitForLoading=!1,this.renderAllPages=!0,this.pref={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},this.pageSizes=[],this.pixelRatioLimit=/Chrome/.test(navigator.userAgent)?16:0,this.pixelRatio=Math.min(8,this.pixelRatioLimit)},u.addLogListeners=function(){var t=this,e=r;c.addListener(e.DEBUG,(function(e){t.callback({t:"debug",content:e})})),c.addListener(e.INFO,(function(e){t.callback({t:"info",content:e})})),c.addListener(e.WARN,(function(e){t.callback({t:"warn",content:e})})),c.addListener(e.ERROR,(function(e){t.callback({t:"error",content:e})}))},u.callback=function(t){t.i=this.instanceId,this.callbackFn(t)},u.setReadyState=function(t){this.readyState!==t&&(this.readyState=t,this.viewportElement.setAttribute(Yc,t),this.callback({t:"readystatechange"}))},u.loadPublication=function(t){var u=this;w.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.fragment,r=t.authorStyleSheet,o=t.userStyleSheet;this.viewport=null;var a=Pn("loadPublication");return this.configure(t).then((function(){var t=new kc;t.init(r,o).then((function(){var e=K(Y(n),u.window.location.href);u.packageURL=[e],t.loadPubDoc(e).then((function(t){t?(u.opf=t,u.render(i).then((function(){a.finish(!0)}))):a.finish(!1)}))}))})),a.result()},u.loadXML=function(t){var u=this;w.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.document,r=t.fragment,o=t.authorStyleSheet,a=t.userStyleSheet;this.viewport=null;var s=Pn("loadXML");return this.configure(t).then((function(){var t=new kc;t.init(o,a).then((function(){var e=n.map((function(t,e){return{url:K(Y(t.url),u.window.location.href),index:e,startPage:t.startPage,skipPagesBefore:t.skipPagesBefore}}));u.packageURL=e.map((function(t){return t.url})),u.opf=new Xc(t,""),u.opf.initWithChapters(e,i).then((function(){u.render(r).then((function(){s.finish(!0)}))}))}))})),s.result()},u.render=function(t){var e=this;return this.cancelRenderingTask(),(t?this.opf.resolveFragment(t).thenAsync((function(t){return e.pagePosition=t,Rn(!0)})):Rn(!0)).thenAsync((function(){return w.registerEndTiming("beforeRender"),e.resize()}))},u.resolveLength=function(t){var e,u=parseFloat(t);if("string"==typeof t&&(e=t.match(/[a-z]+$/))){var n=e[0];if("em"===n||"rem"===n)return u*this.fontSize;if("ex"===n)return u*Mt.ex*this.fontSize/Mt.em;var i=Mt[n];if(i)return u*i}return u},u.configure=function(t){if("boolean"==typeof t.autoresize&&(t.autoresize?(this.viewportSize=null,this.window.addEventListener("resize",this.resizeListener,!1),this.needResize=!0):this.window.removeEventListener("resize",this.resizeListener,!1)),"number"==typeof t.fontSize){var e=t.fontSize;e>=5&&e<=72&&this.fontSize!=e&&(this.fontSize=e,this.needResize=!0)}if("object"==typeof t.viewport&&t.viewport){var u=t.viewport,n={marginLeft:this.resolveLength(u["margin-left"])||0,marginRight:this.resolveLength(u["margin-right"])||0,marginTop:this.resolveLength(u["margin-top"])||0,marginBottom:this.resolveLength(u["margin-bottom"])||0,width:this.resolveLength(u.width)||0,height:this.resolveLength(u.height)||0};(n.width>=200||n.height>=200)&&(this.window.removeEventListener("resize",this.resizeListener,!1),this.viewportSize=n,this.needResize=!0)}if("boolean"==typeof t.hyphenate&&(this.pref.hyphenate=t.hyphenate,this.needResize=!0),"boolean"==typeof t.horizontal&&(this.pref.horizontal=t.horizontal,this.needResize=!0),"boolean"==typeof t.nightMode&&(this.pref.nightMode=t.nightMode,this.needResize=!0),"number"==typeof t.lineHeight&&(this.pref.lineHeight=t.lineHeight,this.needResize=!0),"number"==typeof t.columnWidth&&(this.pref.columnWidth=t.columnWidth,this.needResize=!0),"string"==typeof t.fontFamily&&(this.pref.fontFamily=t.fontFamily,this.needResize=!0),"boolean"==typeof t.load&&(this.waitForLoading=t.load),"boolean"==typeof t.renderAllPages&&(this.renderAllPages=t.renderAllPages),"string"==typeof t.userAgentRootURL&&(G(t.userAgentRootURL.replace(/resources\/?$/,"")),j(t.userAgentRootURL)),"string"==typeof t.rootURL&&(G(t.rootURL),j(z+"resources/")),"string"==typeof t.pageViewMode&&t.pageViewMode!==this.pageViewMode&&(this.pageViewMode=t.pageViewMode,this.needResize=!0),"number"==typeof t.pageBorder&&t.pageBorder!==this.pref.pageBorder&&(this.viewport=null,this.pref.pageBorder=t.pageBorder,this.needResize=!0),"number"==typeof t.zoom&&t.zoom!==this.zoom&&(this.zoom=t.zoom,this.needRefresh=!0),"boolean"==typeof t.fitToScreen&&t.fitToScreen!==this.fitToScreen&&(this.fitToScreen=t.fitToScreen,this.needRefresh=!0),"object"==typeof t.defaultPaperSize&&"number"==typeof t.defaultPaperSize.width&&"number"==typeof t.defaultPaperSize.height&&(this.viewport=null,this.pref.defaultPaperSize=t.defaultPaperSize,this.needResize=!0),"boolean"==typeof t.allowScripts&&t.allowScripts!==oc&&(oc=t.allowScripts,this.needResize=!0),"number"==typeof t.pixelRatio){var i=Math.min(t.pixelRatio,this.pixelRatioLimit);i!==this.pixelRatio&&(this.pixelRatio=i,this.needResize=!0)}return this.configurePlugins(t),Rn(!0)},u.configurePlugins=function(t){var u=this;C(e.HOOKS.CONFIGURATION).forEach((function(e){var n=e(t);u.needResize=n.needResize||u.needResize,u.needRefresh=n.needRefresh||u.needRefresh}))},u.pageReplacedListener=function(t){var e=this.currentPage,u=this.currentSpread,n=t.target;u?u.left!==n&&u.right!==n||this.showCurrent(t.newPage):e===t.target&&this.showCurrent(t.newPage)},u.forCurrentPages=function(t){var e=[];this.currentPage&&e.push(this.currentPage),this.currentSpread&&(e.push(this.currentSpread.left),e.push(this.currentSpread.right)),e.forEach((function(e){e&&t(e)}))},u.removePageListeners=function(){var t=this;this.forCurrentPages((function(e){e.removeEventListener("hyperlink",t.hyperlinkListener,!1),e.removeEventListener("replaced",t.pageReplacedListener,!1)}))},u.hidePages=function(){this.removePageListeners(),this.forCurrentPages((function(t){et(t.container,"display","none")})),this.currentPage=null,this.currentSpread=null},u.showSinglePage=function(t){t.addEventListener("hyperlink",this.hyperlinkListener,!1),t.addEventListener("replaced",this.pageReplacedListener,!1),et(t.container,"visibility","visible"),et(t.container,"display","block")},u.showPage=function(t){this.hidePages(),this.currentPage=t,t.container.style.marginLeft="",t.container.style.marginRight="",this.showSinglePage(t)},u.showSpread=function(t){if(this.hidePages(),this.currentSpread=t,t.left&&t.right){var e=parseFloat(t.left.container.style.width),u=parseFloat(t.right.container.style.width);e&&u&&e!==u&&(e0?Xn(n.fetchers):Rn(!0)).then((function(){t.sendLocationNotification(n,u).thenFinish(e)}))})),e.result()},u.createViewport=function(){var t=this.viewportElement;if(this.viewportSize){var e=this.viewportSize;return t.style.marginLeft=e.marginLeft+"px",t.style.marginRight=e.marginRight+"px",t.style.marginTop=e.marginTop+"px",t.style.marginBottom=e.marginBottom+"px",new Fc(this.window,this.fontSize,this.pixelRatio,t,e.width,e.height)}return new Fc(this.window,this.fontSize,this.pixelRatio,t)},u.resolveSpreadView=function(t,e){switch(this.pageViewMode){case zc.SINGLE_PAGE:return!1;case zc.SPREAD:return!0;default:return(t.width-this.pref.pageBorder)/t.height>=(e?2*e.width/e.height:1.45)&&(!!e||t.width>800)}},u.updateSpreadView=function(t){this.pref.spreadView=t,this.viewportElement.setAttribute("data-vivliostyle-spread-view",t.toString())},u.sizeIsGood=function(){var t,e=this.createViewport(),u=(null==(t=this.opfView)?void 0:t.hasPages())&&!this.opfView.hasAutoSizedPages(),n=this.resolveSpreadView(e,this.resized&&u?this.pageSizes[0]:null);this.resized=!1;var i=this.pref.spreadView!==n;return this.updateSpreadView(n),!(this.pixelRatio&&this.opfView&&this.pixelRatio/this.window.devicePixelRatio!==this.opfView.clientLayout.scaleRatio||this.viewportSize||!this.viewport||this.viewport.fontSize!=this.fontSize||(i||e.width!=this.viewport.width||e.height!=this.viewport.height)&&(i||e.width!=this.viewport.width||e.height==this.viewport.height||!/Android|iPhone|iPad|iPod/.test(navigator.userAgent))&&(!u||(this.viewport.width=e.width,this.viewport.height=e.height,this.needRefresh=!0,0)))},u.setPageSize=function(t,e,u,n){this.pageSizes[n]=t,this.setPageSizePageRules(e,u,n),0!==n||this.pageViewMode!==zc.AUTO_SPREAD||this.opfView.hasAutoSizedPages()||this.updateSpreadView(this.resolveSpreadView(this.viewport,t))},u.setPageSizePageRules=function(t,e,u){var n,i;if(this.pageRuleStyleElement&&(!this.pageSheetSizeAlreadySet||this.pageSizes[u].width!==(null==(n=this.pageSizes[u-1])?void 0:n.width)||this.pageSizes[u].height!==(null==(i=this.pageSizes[u-1])?void 0:i.height))){var r=function(t){return Math.ceil(.75*t)},o=Math.max.apply(Math,this.pageSizes.map((function(t){return t.width}))),a=Math.max.apply(Math,this.pageSizes.map((function(t){return t.height}))),s=r(o),l=r(a);this.pageRuleStyleElement.textContent="@page {size: "+s+"pt "+l+"pt; margin: 0 "+-(s*((this.pixelRatio||1)-1)+2)+"pt "+-(l*((this.pixelRatio||1)-1)+2)+"pt 0;}",this.pageSheetSizeAlreadySet=!0}},u.removePageSizePageRules=function(){this.pageRuleStyleElement&&(this.pageRuleStyleElement.textContent="",this.pageSheetSizeAlreadySet=!1)},u.reset=function(){var t=!1,e=!1;this.opfView&&(t=this.opfView.tocVisible,e=this.opfView.tocAutohide,this.opfView.removeRenderedPages()),this.pageSizes=[],this.removePageSizePageRules(),this.viewport=this.createViewport(),this.viewport.resetZoom(),this.opfView=new Kc(this.opf,this.viewport,this.fontMapper,this.pref,this.setPageSize.bind(this)),t&&this.sendCommand({a:"toc",v:"show",autohide:e})},u.showCurrent=function(t,u){var n=this;return this.needRefresh=!1,this.removePageListeners(),this.pref.spreadView?this.opfView.getSpread(this.pagePosition,u).thenAsync((function(u){return u.left||u.right?(n.showSpread(u),n.setSpreadZoom(u),n.currentPage=t.side===e.PageSide.LEFT?u.left:u.right,Rn(null)):Rn(null)})):(this.showPage(t),this.setPageZoom(t),this.currentPage=t,Rn(null))},u.setPageZoom=function(t){var e=this.getAdjustedZoomFactor(t.dimensions);this.viewport.zoom(t.dimensions.width,t.dimensions.height,e)},u.setSpreadZoom=function(t){var e=this.getSpreadDimensions(t);this.viewport.zoom(e.width,e.height,this.getAdjustedZoomFactor(e))},u.getAdjustedZoomFactor=function(t){return this.fitToScreen?this.calculateZoomFactorToFitInsideViewPort(t):this.zoom},u.getSpreadDimensions=function(t){var e=0,u=0;return t.left&&(e+=t.left.dimensions.width,u=t.left.dimensions.height),t.right&&(e+=t.right.dimensions.width,u=Math.max(u,t.right.dimensions.height)),t.left&&t.right&&(e+=2*this.pref.pageBorder,e+=Math.abs(t.left.dimensions.width-t.right.dimensions.width)),{width:e,height:u}},u.queryZoomFactor=function(t){if(!this.currentPage)throw new Error("no page exists.");var e;if(t===qc.FIT_INSIDE_VIEWPORT)return e=this.pref.spreadView?this.getSpreadDimensions(this.currentSpread):this.currentPage.dimensions,this.calculateZoomFactorToFitInsideViewPort(e);throw new Error("unknown zoom type: "+t)},u.calculateZoomFactorToFitInsideViewPort=function(t){return this.viewport?Math.min(this.viewport.width/t.width,this.viewport.height/t.height):this.zoom},u.cancelRenderingTask=function(){this.renderTask&&this.renderTask.interrupt(new Qc),this.renderTask=null},u.resize=function(){var t=this;if(this.needResize=!1,this.needRefresh=!1,this.sizeIsGood())return Rn(!0);this.setReadyState(e.ReadyState.LOADING),this.cancelRenderingTask();var u=In().getScheduler().run((function(){return kn("resize",(function(n){t.opf?(t.renderTask=u,w.registerStartTiming("render (resize)"),t.reset(),t.pagePosition&&(0==t.pagePosition.pageIndex&&0==t.pagePosition.offsetInItem||(t.pagePosition.pageIndex=-1)),t.opf.setEPageCountMode(t.renderAllPages),t.opfView.renderPagesUpto(t.pagePosition,!t.renderAllPages).then((function(i){i?(t.pagePosition=i.position,t.showCurrent(i.page,!0).then((function(){t.setReadyState(e.ReadyState.INTERACTIVE),t.opf.countEPages((function(e){var u={t:"nav",epageCount:e,first:t.currentPage.isFirstPage,last:t.currentPage.isLastPage,metadata:t.opf.metadata,docTitle:t.opf.spine[t.pagePosition.spineIndex].title};(t.currentPage.isFirstPage||0==t.pagePosition.pageIndex&&t.opf.spine[t.pagePosition.spineIndex].epage)&&(u.epage=t.opf.spine[t.pagePosition.spineIndex].epage),t.callback(u)})).then((function(){t.reportPosition().then((function(i){(t.renderAllPages?t.opfView.renderAllPages():Rn(null)).then((function(){t.renderTask===u&&(t.renderTask=null),w.registerEndTiming("render (resize)"),oc&&hc(t.window)?function(t){if(!oc)return Rn(!1);var e=Pn("loadScripts");return e.loop((function(){return 0===ac.length?Rn(!1):Dc(ac.shift(),t,{atEnd:!0}).thenReturn(ac.length>0)})).then((function(){c.debug("dispatchEvent: DOMContentLoaded (window)"),t.dispatchEvent(new Event("DOMContentLoaded")),c.debug("dispatchEvent: load (window)"),t.dispatchEvent(new Event("load")),e.finish(!0)})),e.result()}(t.window).then((function(){t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i)})):(t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i))}))}))}))}))):n.finish(!1)}))):n.finish(!1)}),(function(t,e){if(!(e instanceof Qc))throw e;w.registerEndTiming("render (resize)"),c.debug(e.message)}))}));return Rn(!0)},u.sendLocationNotification=function(t,e){var u=this,n=Pn("sendLocationNotification"),i={t:"nav",first:t.isFirstPage,last:t.isLastPage,metadata:this.opf.metadata,docTitle:this.opf.spine[t.spineIndex].title};return this.opf.getEPageFromPosition(this.pagePosition).then((function(t){i.epage=t,i.epageCount=u.opf.epageCount,e&&(i.cfi=e),u.callback(i),n.finish(!0)})),n.result()},u.getCurrentPageProgression=function(){return this.opfView?this.opfView.getCurrentPageProgression(this.pagePosition):null},u.moveTo=function(t){var u,n,i=this;if(this.readyState!==e.ReadyState.COMPLETE&&"next"!==t.where&&this.setReadyState(e.ReadyState.LOADING),"string"==typeof t.where){var r;switch(t.where){case"next":r=this.pref.spreadView?this.opfView.nextSpread:this.opfView.nextPage;break;case"previous":r=this.pref.spreadView?this.opfView.previousSpread:this.opfView.previousPage;break;case"last":r=this.opfView.lastPage;break;case"first":r=this.opfView.firstPage;break;default:return Rn(!0)}r&&(n=function(){return r.call(i.opfView,i.pagePosition,!i.renderAllPages)})}else if("number"==typeof t.epage){var o=t.epage;n=function(){return i.opfView.navigateToEPage(o,i.pagePosition,!i.renderAllPages)}}else if("string"==typeof t.url){var a=t.url;n=function(){return i.opfView.navigateTo(a,i.pagePosition,!i.renderAllPages)}}else{if("number"!=typeof(null==(u=t.position)?void 0:u.spineIndex))return Rn(!0);var s=t.position;n=function(){return i.opfView.findPage(s,!i.renderAllPages)}}if(!this.opfView)return Rn(!0);var l=Pn("moveTo");return n.call(this.opfView).then((function(t){var u;if(t){i.pagePosition=t.position;var n=Pn("moveTo.showCurrent");u=n.result(),i.showCurrent(t.page,!i.renderAllPages).then((function(){i.reportPosition().thenFinish(n)}))}else u=Rn(!0);u.then((function(t){i.readyState===e.ReadyState.LOADING&&i.setReadyState(e.ReadyState.INTERACTIVE),l.finish(t)}))})),l.result()},u.showTOC=function(t){var e=this,u=!!t.autohide,n=t.v,i=this.opfView.isTOCVisible(),r=u!=this.opfView.tocAutohide&&"hide"!=n;if(i){if("show"==n&&!r)return Rn(!0)}else if("hide"==n)return Rn(!0);if(i&&"show"!=n)return this.opfView.hideTOC(),Rn(!0);var o=Pn("showTOC");return this.opfView.showTOC(u).then((function(t){t&&(r&&(t.listeners={}),u&&t.addEventListener("hyperlink",(function(){e.opfView.hideTOC()}),!1),t.addEventListener("hyperlink",e.hyperlinkListener,!1)),o.finish(!0)})),o.result()},u.runCommand=function(t){var e=this,u=t.a||"";return kn("runCommand",(function(n){var i=e.actions[u];i?i.call(e,t).then((function(){e.callback({t:"done",a:u}),n.finish(!0)})):(c.error("No such action:",u),n.finish(!0))}),(function(t,e){c.error(e,"Error during action:",u),t.finish(!0)}))},u.initEmbed=function(t){var e,u=this,n=Zc(t),i=null,r=this;e=function(){var t=Pn("commandLoop"),e=In().getScheduler();return r.hyperlinkListener=function(t){var u=t,n="#"===u.href.charAt(0)||r.packageURL.some((function(t){return u.href.substr(0,t.length)==t}));if(n){t.preventDefault();var i={t:"hyperlink",href:u.href,internal:n};e.run((function(){return r.callback(i),Rn(!0)}))}},t.loopWithFrame((function(t){if(r.needResize)r.resize().then((function(){t.continueLoop()}));else if(r.needRefresh)r.currentPage&&r.showCurrent(r.currentPage,!u.renderAllPages).then((function(){t.continueLoop()}));else if(n){var e=n;n=null,r.runCommand(e).then((function(){t.continueLoop()}))}else{var o=Pn("waitForCommand");i=o.suspend(u),o.result().then((function(){t.continueLoop()}))}})).thenFinish(t),t.result()},(xn?xn.getScheduler():Tn||new _n(new On)).run(e,void 0),r.kick=function(){var t=i;t&&(i=null,t.schedule(!0))},r.sendCommand=function(t){return!n&&(n=Zc(t),r.kick(),!0)},this.window.adapt_command=r.sendCommand},t}();(qc||(qc={})).FIT_INSIDE_VIEWPORT="fit inside viewport";var Qc=function(t){function e(){var u;return(u=t.call(this)||this).name="RenderingCanceledError",u.message="Page rendering has been canceled",u.stack=void 0,Object.setPrototypeOf(k(u),e.prototype),u.stack=(new Error).stack,u}return x(e,t),e}(R(Error));function Zc(t){return"string"==typeof t?V(t):t}var Jc=e.PageProgression;function td(t){var e={};return Object.keys(t).forEach((function(u){var n=t[u];switch(u){case"autoResize":e.autoresize=n;break;case"pageBorderWidth":e.pageBorder=n;break;default:e[u]=n}})),e}var ed,ud=function(){function t(t,e){this.settings=void 0,this.initialized=!1,this.adaptViewer_=void 0,this.options=void 0,this.eventTarget=void 0,this.readyState=void 0,this.settings=t,a(t.debug),this.adaptViewer_=new $c(t.window||window,t.viewportElement,"main",this.dispatcher.bind(this)),this.options={autoResize:!0,fontSize:16,pageBorderWidth:1,renderAllPages:!0,pageViewMode:zc.AUTO_SPREAD,zoom:1,fitToScreen:!1,defaultPaperSize:void 0,allowScripts:!0,pixelRatio:8},e&&this.setOptions(e),this.eventTarget=new Et,Object.defineProperty(this,"readyState",{get:function(){return this.adaptViewer_.readyState}})}var u=t.prototype;return u.setOptions=function(t){var e=Object.assign({a:"configure"},td(t));this.adaptViewer_.sendCommand(e),Object.assign(this.options,t)},u.dispatcher=function(t){var e={type:t.t},u=t;Object.keys(u).forEach((function(t){"t"!==t&&(e[t]=u[t])})),this.eventTarget.dispatchEvent(e)},u.addListener=function(t,e){this.eventTarget.addEventListener(t,e,!1)},u.removeListener=function(t,e){this.eventTarget.removeEventListener(t,e,!1)},u.loadDocument=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(t,null,e,u)},u.loadPublication=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(null,t,e,u)},u.loadDocumentOrPublication=function(t,e,u,n){var i=u||{};function r(t){return t?t.map((function(t){return{url:t.url||null,text:t.text||null}})):void 0}var o=r(i.authorStyleSheet),a=r(i.userStyleSheet);n&&Object.assign(this.options,n);var s=Object.assign({a:t?"loadXML":"loadPublication",userAgentRootURL:this.settings.userAgentRootURL,url:nd(t)||e,document:i.documentObject,fragment:i.fragment,authorStyleSheet:o,userStyleSheet:a},td(this.options));this.initialized?this.adaptViewer_.sendCommand(s):(this.initialized=!0,this.adaptViewer_.initEmbed(s))},u.getCurrentPageProgression=function(){return this.adaptViewer_.getCurrentPageProgression()},u.resolveNavigation=function(t){switch(t){case e.Navigation.LEFT:return this.getCurrentPageProgression()===Jc.LTR?e.Navigation.PREVIOUS:e.Navigation.NEXT;case e.Navigation.RIGHT:return this.getCurrentPageProgression()===Jc.LTR?e.Navigation.NEXT:e.Navigation.PREVIOUS;default:return t}},u.navigateToPage=function(t,u){t===e.Navigation.EPAGE?this.adaptViewer_.sendCommand({a:"moveTo",epage:u}):this.adaptViewer_.sendCommand({a:"moveTo",where:this.resolveNavigation(t)})},u.navigateToInternalUrl=function(t){this.adaptViewer_.sendCommand({a:"moveTo",url:t})},u.navigateToPosition=function(t){var e,u;this.adaptViewer_.sendCommand({a:"moveTo",position:{spineIndex:t.spineIndex,pageIndex:null!=(e=t.pageIndex)?e:-1,offsetInItem:null!=(u=t.offsetInItem)?u:-1}})},u.isTOCVisible=function(){return this.adaptViewer_.opfView&&this.adaptViewer_.opfView.opf&&(this.adaptViewer_.opfView.opf.xhtmlToc||this.adaptViewer_.opfView.opf.ncxToc)?!!this.adaptViewer_.opfView.isTOCVisible():null},u.showTOC=function(t,e){this.adaptViewer_.sendCommand({a:"toc",v:null==t?"toggle":t?"show":"hide",autohide:e})},u.queryZoomFactor=function(t){return this.adaptViewer_.queryZoomFactor(t)},u.getPageSizes=function(){return this.adaptViewer_.pageSizes},u.getTOC=function(){var t,e;return null==(t=this.adaptViewer_.opfView)||null==(e=t.tocView)?void 0:e.getTOC()},u.getMetadata=function(){return this.adaptViewer_.opf.getMetadata()},u.getCover=function(){return this.adaptViewer_.opf.cover},t}();function nd(t){function e(t){return"number"==typeof t?t:null}function u(t){return"string"==typeof t?{url:t,startPage:null,skipPagesBefore:null}:{url:t.url,startPage:e(t.startPage),skipPagesBefore:e(t.skipPagesBefore)}}return Array.isArray(t)?t.map(u):t?[u(t)]:null}e.Navigation=void 0,(ed=e.Navigation||(e.Navigation={})).PREVIOUS="previous",ed.NEXT="next",ed.LEFT="left",ed.RIGHT="right",ed.FIRST="first",ed.LAST="last",ed.EPAGE="epage";var id=qc,rd=zc;w.forceRegisterEndTiming("load_vivliostyle");var od=function(){function t(t,e){var u=e.title,n=void 0===u?"":u,i=e.printCallback,r=void 0===i?function(t){return t.print()}:i,o=e.hideIframe,a=void 0===o||o,s=e.removeIframe,l=void 0===s||s;this.htmlDoc=void 0,this.title=void 0,this.printCallback=void 0,this.hideIframe=void 0,this.removeIframe=void 0,this.iframe=void 0,this.iframeWin=void 0,this.window=void 0,this.htmlDoc=t,this.title=n,this.printCallback=r,this.hideIframe=a,this.removeIframe=l}var e=t.prototype;return e.init=function(){this.iframe=document.createElement("iframe"),this.hideIframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this.iframe.style.borderWidth="0"),this.window=window,this.window.printInstance=this,this.iframe.srcdoc="\n \n \n \n \n \n "+this.title+"\n \n \n \n \n
\n \n ",document.body.appendChild(this.iframe)},e.runInIframe=function(t){var e=this;return this.iframeWin=t,this.preparePrint().then((function(){return e.browserPrint()})).then((function(){return e.cleanUp()}))},e.preparePrint=function(){this.iframeWin.document.title=this.title;var t=new Blob([this.htmlDoc],{type:"text/html"}),e=URL.createObjectURL(t),u=new ud({viewportElement:this.iframeWin.document.body.firstElementChild,window:this.iframeWin,debug:!0});return new Promise((function(t){u.addListener("readystatechange",(function(){"complete"===u.readyState&&t()})),u.loadDocument({url:e})}))},e.browserPrint=function(){this.printCallback(this.iframeWin)},e.cleanUp=function(){delete this.window.printInstance,this.removeIframe&&this.iframe.parentElement.removeChild(this.iframe)},t}();e.CoreViewer=ud,e.PageViewMode=rd,e.Profiler=A,e.UserAgentBaseCss=Qn,e.UserAgentPageCss=$n,e.UserAgentTocCss=Zn,e.UserAgentXml=qn,e.ValidationTxt=Yn,e.VivliostylePolyfillCss=Jn,e.VivliostyleViewportCss=Kn,e.VivliostyleViewportScreenCss=jn,e.ZoomType=id,e.getHooksForName=C,e.pageProgressionOf=s,e.plugin=F,e.printHTML=function(t,e){new od(t,e).init()},e.profile=N,e.profiler=w,e.registerHook=p,e.removeHook=E,e.setDebug=a},c(d={exports:{}},d.exports),d.exports);p.isDebug,p.PageProgression,p.PageSide,p.ReadyState,p.HOOKS,p.Navigation,p.CoreViewer,p.PageViewMode,p.Profiler,p.UserAgentBaseCss,p.UserAgentPageCss,p.UserAgentTocCss,p.UserAgentXml,p.ValidationTxt,p.VivliostylePolyfillCss,p.VivliostyleViewportCss,p.VivliostyleViewportScreenCss,p.ZoomType,p.getHooksForName,p.pageProgressionOf,p.plugin;var E=p.printHTML;p.profile,p.profiler,p.registerHook,p.removeHook,p.setDebug,document.getElementById("print").addEventListener("click",(()=>{const t=document.getElementById("html").value,e=document.getElementById("css").value,u=document.getElementById("title").value;E(`\n \n \n \n \n ${u}\n \n \n ${t}\n `,{title:u,printCallback:t=>{t.document.querySelectorAll("[data-vivliostyle-page-container]").length,t.print()},hideIframe:!0,removeIframe:!0})}))}(); //# sourceMappingURL=bundle.js.map diff --git a/bundle.js.map b/bundle.js.map index ff66c94..5f2ef52 100644 --- a/bundle.js.map +++ b/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["../node_modules/fast-diff/diff.js","index.js"],"sourcesContent":["/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","import {\n printHTML\n} from \"../src\"\n\n\ndocument.getElementById('print').addEventListener('click', () => {\n const html = document.getElementById('html').value,\n css = document.getElementById('css').value,\n title = document.getElementById('title').value,\n htmlDoc = `\n \n \n \n \n ${title}\n \n \n ${html}\n `,\n printCallback = iframeWin => {\n const pageCount = iframeWin.document.querySelectorAll('[data-vivliostyle-page-container]').length\n console.log(`page count: ${pageCount}`)\n iframeWin.print()\n }\n\n printHTML(htmlDoc, {\n title,\n printCallback,\n hideIframe: true, // Whether to use a hidden iframe (default: true)\n removeIframe: true // Whether to remove the iframe after use (default: true)\n })\n})\n"],"names":["DIFF_DELETE","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","index","length","newRange","oldLength","newLength","oldCursor","oldBefore","slice","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","Math","min","oldPrefix","newPrefix","make_edit_splice","cursor","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","i","indexOf","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","floor","j","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","concat","text1_length","text2_length","max_d","v_offset","v_length","v1","Array","v2","x","delta","front","k1start","k1end","k2start","k2end","d","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","unshift","push","diff_cleanupMerge","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","splice","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","n","pop","changes","charCode","str","before","oldMiddle","newMiddle","after","tuples","ret","remove_empty_tuples","diff","INSERT","DELETE","EQUAL","diff_1","document","getElementById","addEventListener","html","value","css","title","printHTML","printCallback","iframeWin","querySelectorAll","print","hideIframe","removeIframe"],"mappings":"yBA+BA,IAAIA,GAAe,EAanB,SAASC,EAAUC,EAAOC,EAAOC,EAAYC,GAE3C,GAAIH,IAAUC,EACZ,OAAID,EACK,CAAC,CAfG,EAeUA,IAEhB,GAGT,GAAkB,MAAdE,EAAoB,CACtB,IAAIE,EA6mBR,SAA+BC,EAASC,EAASJ,GAE/C,IAAIK,EAAiC,iBAAfL,EACpB,CAAEM,MAAON,EAAYO,OAAQ,GAAMP,EAAWK,SAC5CG,EAAiC,iBAAfR,EACpB,KAAOA,EAAWQ,SAKhBC,EAAYN,EAAQI,OACpBG,EAAYN,EAAQG,OACxB,GAAwB,IAApBF,EAASE,SAA8B,OAAbC,GAAyC,IAApBA,EAASD,QAAe,CAEzE,IAAII,EAAYN,EAASC,MACrBM,EAAYT,EAAQU,MAAM,EAAGF,GAC7BG,EAAWX,EAAQU,MAAMF,GACzBI,EAAiBP,EAAWA,EAASF,MAAQ,KAG3CU,EAAYL,EAAYD,EAAYD,EACxC,IAAuB,OAAnBM,GAA2BA,IAAmBC,MAG9CA,EAAY,GAAKA,EAAYN,GAAjC,CAGA,IAAIO,EAAYb,EAAQS,MAAM,EAAGG,GAEjC,IADIE,EAAWd,EAAQS,MAAMG,MACZF,EAAjB,CAGA,IAAIK,EAAeC,KAAKC,IAAIV,EAAWK,GAGvC,IAFIM,EAAYV,EAAUC,MAAM,EAAGM,OAC/BI,EAAYN,EAAUJ,MAAM,EAAGM,IAMnC,OAAOK,EAAiBF,EAFRV,EAAUC,MAAMM,GAChBF,EAAUJ,MAAMM,GACyBL,EATxD,CALA,CAkBD,GAAuB,OAAnBC,GAA2BA,IAAmBJ,EAAlD,CAGA,IAAIc,EAASd,EAETO,GADAD,EAAYb,EAAQS,MAAM,EAAGY,GAClBrB,EAAQS,MAAMY,IAC7B,GAAIR,IAAcL,EAAlB,CAGA,IAAIc,EAAeN,KAAKC,IAAIZ,EAAYgB,EAAQf,EAAYe,GAG5D,IAFIE,EAAYb,EAASD,MAAMC,EAASP,OAASmB,OAC7CE,EAAYV,EAASL,MAAMK,EAASX,OAASmB,IAMjD,OAAOF,EAAiBZ,EAFRE,EAASD,MAAM,EAAGC,EAASP,OAASmB,GACpCR,EAASL,MAAM,EAAGK,EAASX,OAASmB,GACKC,EATxD,CANA,CAiBJ,CACD,GAAItB,EAASE,OAAS,GAAKC,GAAgC,IAApBA,EAASD,OAAc,CAG1D,IAAIe,EAAYnB,EAAQU,MAAM,EAAGR,EAASC,OACtCqB,EAAYxB,EAAQU,MAAMR,EAASC,MAAQD,EAASE,QAGxD,KAAIG,GAFAS,EAAeG,EAAUf,SACzBmB,EAAeC,EAAUpB,SAC7B,CAGA,IAAIgB,EAAYnB,EAAQS,MAAM,EAAGM,GAC7BS,EAAYxB,EAAQS,MAAMH,EAAYgB,GAC1C,GAAIJ,IAAcC,GAAaI,IAAcC,EAK7C,OAAOJ,EAAiBF,EAFRnB,EAAQU,MAAMM,EAAcV,EAAYiB,GACxCtB,EAAQS,MAAMM,EAAcT,EAAYgB,GACCC,EARxD,CAUJ,CAED,OAAO,IACR,CAnsBkBE,CAAsB/B,EAAOC,EAAOC,GACnD,GAAIE,EACF,OAAOA,CAZ8C,CAiBzD,IAAI4B,EAAeC,EAAkBjC,EAAOC,GACxCiC,EAAelC,EAAMmC,UAAU,EAAGH,GAKtCA,EAAeI,EAJfpC,EAAQA,EAAMmC,UAAUH,GACxB/B,EAAQA,EAAMkC,UAAUH,IAIxB,IAAIK,EAAerC,EAAMmC,UAAUnC,EAAMS,OAASuB,GAK9CM,EAqBN,SAAuBtC,EAAOC,GAC5B,IAAIqC,EAEJ,IAAKtC,EAEH,MAAO,CAAC,CAnEM,EAmEQC,IAGxB,IAAKA,EAEH,MAAO,CAAC,CAACH,EAAaE,IAGxB,IAAIuC,EAAWvC,EAAMS,OAASR,EAAMQ,OAAST,EAAQC,EACjDuC,EAAYxC,EAAMS,OAASR,EAAMQ,OAASR,EAAQD,EAClDyC,EAAIF,EAASG,QAAQF,GACzB,IAAW,IAAPC,EAWF,OATAH,EAAQ,CACN,CAjFY,EAiFEC,EAASJ,UAAU,EAAGM,IACpC,CAjFW,EAiFED,GACb,CAnFY,EAmFED,EAASJ,UAAUM,EAAID,EAAU/B,UAG7CT,EAAMS,OAASR,EAAMQ,SACvB6B,EAAM,GAAG,GAAKA,EAAM,GAAG,GAAKxC,GAEvBwC,EAGT,GAAyB,IAArBE,EAAU/B,OAGZ,MAAO,CAAC,CAACX,EAAaE,GAAQ,CA/FhB,EA+F8BC,IAI9C,IAAI0C,EAwPN,SAAyB3C,EAAOC,GAC9B,IAAIsC,EAAWvC,EAAMS,OAASR,EAAMQ,OAAST,EAAQC,EACjDuC,EAAYxC,EAAMS,OAASR,EAAMQ,OAASR,EAAQD,EACtD,GAAIuC,EAAS9B,OAAS,GAAwB,EAAnB+B,EAAU/B,OAAa8B,EAAS9B,OACzD,OAAO,KAeT,SAASmC,EAAiBL,EAAUC,EAAWC,GAM7C,IAJA,IAGII,EAAiBC,EAAiBC,EAAkBC,EAHpDC,EAAOV,EAASJ,UAAUM,EAAGA,EAAInB,KAAK4B,MAAMX,EAAS9B,OAAS,IAC9D0C,GAAK,EACLC,EAAc,IAE+B,KAAzCD,EAAIX,EAAUE,QAAQO,EAAME,EAAI,KAAY,CAClD,IAAI9B,EAAeY,EACjBM,EAASJ,UAAUM,GAAID,EAAUL,UAAUgB,IACzCvB,EAAeQ,EACjBG,EAASJ,UAAU,EAAGM,GAAID,EAAUL,UAAU,EAAGgB,IAC/CC,EAAY3C,OAASmB,EAAeP,IACtC+B,EAAcZ,EAAUL,UACtBgB,EAAIvB,EAAcuB,GAAKX,EAAUL,UAAUgB,EAAGA,EAAI9B,GACpDwB,EAAkBN,EAASJ,UAAU,EAAGM,EAAIb,GAC5CkB,EAAkBP,EAASJ,UAAUM,EAAIpB,GACzC0B,EAAmBP,EAAUL,UAAU,EAAGgB,EAAIvB,GAC9CoB,EAAmBR,EAAUL,UAAUgB,EAAI9B,GAE9C,CACD,OAAyB,EAArB+B,EAAY3C,QAAc8B,EAAS9B,OAC9B,CACLoC,EAAiBC,EACjBC,EAAkBC,EAAkBI,GAG/B,IA7C0B,CAkDrC,IAGIT,EAaAU,EAASC,EAASC,EAASC,EAhB3BC,EAAMb,EAAiBL,EAAUC,EAAWlB,KAAKoC,KAAKnB,EAAS9B,OAAS,IAExEkD,EAAMf,EAAiBL,EAAUC,EAAWlB,KAAKoC,KAAKnB,EAAS9B,OAAS,IAE5E,IAAKgD,IAAQE,EACX,OAAO,KAOPhB,EANUgB,EAEAF,GAILA,EAAI,GAAGhD,OAASkD,EAAI,GAAGlD,OAASgD,EAHhCE,EAFAF,EAUHzD,EAAMS,OAASR,EAAMQ,QACvB4C,EAAUV,EAAG,GACbW,EAAUX,EAAG,GACbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,KAEbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,GACbU,EAAUV,EAAG,GACbW,EAAUX,EAAG,IAEf,IAAIiB,EAAajB,EAAG,GACpB,MAAO,CAACU,EAASC,EAASC,EAASC,EAASI,EAC7C,CAxUUC,CAAgB7D,EAAOC,GAChC,GAAI0C,EAAI,CAEN,IAAIU,EAAUV,EAAG,GACbW,EAAUX,EAAG,GACbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,GACbiB,EAAajB,EAAG,GAEhBmB,EAAU/D,EAAUsD,EAASE,GAC7BQ,EAAUhE,EAAUuD,EAASE,GAEjC,OAAOM,EAAQE,OAAO,CAAC,CA9GV,EA8GuBJ,IAAcG,EACnD,CAED,OAaF,SAAsB/D,EAAOC,GAW3B,IATA,IAAIgE,EAAejE,EAAMS,OACrByD,EAAejE,EAAMQ,OACrB0D,EAAQ7C,KAAKoC,MAAMO,EAAeC,GAAgB,GAClDE,EAAWD,EACXE,EAAW,EAAIF,EACfG,EAAK,IAAIC,MAAMF,GACfG,EAAK,IAAID,MAAMF,GAGVI,EAAI,EAAGA,EAAIJ,EAAUI,IAC5BH,EAAGG,IAAM,EACTD,EAAGC,IAAM,EAEXH,EAAGF,EAAW,GAAK,EACnBI,EAAGJ,EAAW,GAAK,EAWnB,IAVA,IAAIM,EAAQT,EAAeC,EAGvBS,EAASD,EAAQ,GAAM,EAGvBE,EAAU,EACVC,EAAQ,EACRC,EAAU,EACVC,EAAQ,EACHC,EAAI,EAAGA,EAAIb,EAAOa,IAAK,CAE9B,IAAK,IAAIC,GAAMD,EAAIJ,EAASK,GAAMD,EAAIH,EAAOI,GAAM,EAAG,CASpD,IARA,IAAIC,EAAYd,EAAWa,EAOvBE,GAJFC,EADEH,KAAQD,GAAMC,IAAOD,GAAKV,EAAGY,EAAY,GAAKZ,EAAGY,EAAY,GAC1DZ,EAAGY,EAAY,GAEfZ,EAAGY,EAAY,GAAK,GAEbD,EAEZG,EAAKnB,GAAgBkB,EAAKjB,GAC1BlE,EAAMqF,OAAOD,KAAQnF,EAAMoF,OAAOF,IAElCC,IACAD,IAGF,GADAb,EAAGY,GAAaE,EACZA,EAAKnB,EAEPY,GAAS,OACJ,GAAIM,EAAKjB,EAEdU,GAAW,OACN,GAAID,EAAO,CAEhB,IADIW,EAAYlB,EAAWM,EAAQO,IAClB,GAAKK,EAAYjB,IAA+B,IAAnBG,EAAGc,GAG/C,GAAIF,IADAG,EAAKtB,EAAeO,EAAGc,IAGzB,OAAOE,EAAkBxF,EAAOC,EAAOmF,EAAID,EAGhD,CAnC2B,CAuC9B,IAAK,IAAIM,GAAMT,EAAIF,EAASW,GAAMT,EAAID,EAAOU,GAAM,EAAG,CASpD,IARA,IACIF,EADAD,EAAYlB,EAAWqB,EAOvBC,GAJFH,EADEE,KAAQT,GAAMS,IAAOT,GAAKR,EAAGc,EAAY,GAAKd,EAAGc,EAAY,GAC1Dd,EAAGc,EAAY,GAEfd,EAAGc,EAAY,GAAK,GAEbG,EAEZF,EAAKtB,GAAgByB,EAAKxB,GAC1BlE,EAAMqF,OAAOpB,EAAesB,EAAK,KAAOtF,EAAMoF,OAAOnB,EAAewB,EAAK,IAEzEH,IACAG,IAGF,GADAlB,EAAGc,GAAaC,EACZA,EAAKtB,EAEPc,GAAS,OACJ,GAAIW,EAAKxB,EAEdY,GAAW,OACN,IAAKH,EAAO,CAEjB,IADIO,EAAYd,EAAWM,EAAQe,IAClB,GAAKP,EAAYb,IAA+B,IAAnBC,EAAGY,GAAmB,CAClE,IAAIE,EACAD,EAAKf,GADLgB,EAAKd,EAAGY,IACaA,EAGzB,GAAIE,IADJG,EAAKtB,EAAesB,GAGlB,OAAOC,EAAkBxF,EAAOC,EAAOmF,EAAID,EAE9C,CACF,CACF,CAtG+B,CA0GlC,MAAO,CAAC,CAACrF,EAAaE,GAAQ,CAzOd,EAyO4BC,GAC7C,CAxHQ0F,CAAa3F,EAAOC,EAC5B,CA1Ea2F,CAJZ5F,EAAQA,EAAMmC,UAAU,EAAGnC,EAAMS,OAASuB,GAC1C/B,EAAQA,EAAMkC,UAAU,EAAGlC,EAAMQ,OAASuB,IAa1C,OAPIE,GACFI,EAAMuD,QAAQ,CA5CD,EA4Cc3D,IAEzBG,GACFC,EAAMwD,KAAK,CA/CE,EA+CWzD,IAE1B0D,EAAkBzD,EAAOnC,GAClBmC,CACR,CAkMD,SAASkD,EAAkBxF,EAAOC,EAAOwE,EAAGuB,GAC1C,IAAIC,EAASjG,EAAMmC,UAAU,EAAGsC,GAC5ByB,EAASjG,EAAMkC,UAAU,EAAG6D,GAC5BG,EAASnG,EAAMmC,UAAUsC,GACzB2B,EAASnG,EAAMkC,UAAU6D,GAGzB1D,EAAQvC,EAAUkG,EAAQC,GAC1BG,EAAStG,EAAUoG,EAAQC,GAE/B,OAAO9D,EAAM0B,OAAOqC,EACrB,CAUD,SAASpE,EAAkBjC,EAAOC,GAEhC,IAAKD,IAAUC,GAASD,EAAMqF,OAAO,KAAOpF,EAAMoF,OAAO,GACvD,OAAO,EAQT,IAJA,IAAIiB,EAAa,EACbC,EAAajF,KAAKC,IAAIvB,EAAMS,OAAQR,EAAMQ,QAC1C+F,EAAaD,EACbE,EAAe,EACZH,EAAaE,GAEhBxG,EAAMmC,UAAUsE,EAAcD,IAC9BvG,EAAMkC,UAAUsE,EAAcD,GAG9BC,EADAH,EAAaE,EAGbD,EAAaC,EAEfA,EAAalF,KAAK4B,OAAOqD,EAAaD,GAAc,EAAIA,GAO1D,OAJII,EAAwB1G,EAAM2G,WAAWH,EAAa,KACxDA,IAGKA,CACR,CASD,SAASpE,EAAkBpC,EAAOC,GAEhC,IAAKD,IAAUC,GAASD,EAAMe,OAAO,KAAOd,EAAMc,OAAO,GACvD,OAAO,EAQT,IAJA,IAAIuF,EAAa,EACbC,EAAajF,KAAKC,IAAIvB,EAAMS,OAAQR,EAAMQ,QAC1C+F,EAAaD,EACbK,EAAa,EACVN,EAAaE,GAEhBxG,EAAMmC,UAAUnC,EAAMS,OAAS+F,EAAYxG,EAAMS,OAASmG,IAC1D3G,EAAMkC,UAAUlC,EAAMQ,OAAS+F,EAAYvG,EAAMQ,OAASmG,GAG1DA,EADAN,EAAaE,EAGbD,EAAaC,EAEfA,EAAalF,KAAK4B,OAAOqD,EAAaD,GAAc,EAAIA,GAO1D,OAJIO,EAAsB7G,EAAM2G,WAAW3G,EAAMS,OAAS+F,KACxDA,IAGKA,CACR,CAsGD,SAAST,EAAkBzD,EAAOwE,GAChCxE,EAAMwD,KAAK,CApbI,EAobS,KAOxB,IANA,IAKI9D,EALA+E,EAAU,EACVC,EAAe,EACfC,EAAe,EACfC,EAAc,GACdC,EAAc,GAEXJ,EAAUzE,EAAM7B,QACrB,GAAIsG,EAAUzE,EAAM7B,OAAS,IAAM6B,EAAMyE,GAAS,GAChDzE,EAAM8E,OAAOL,EAAS,QAGxB,OAAQzE,EAAMyE,GAAS,IACrB,KAlcY,EAocVE,IACAE,GAAe7E,EAAMyE,GAAS,GAC9BA,IACA,MACF,KAAKjH,EACHkH,IACAE,GAAe5E,EAAMyE,GAAS,GAC9BA,IACA,MACF,KA5cW,EA6cT,IAAIM,EAAoBN,EAAUE,EAAeD,EAAe,EAChE,GAAIF,EAAa,CAWf,GAAIO,GAAqB,GAAKC,EAAqBhF,EAAM+E,GAAmB,IAAK,CAC/E,IAAIE,EAAQjF,EAAM+E,GAAmB,GAAGtG,OAAO,GAI/C,GAHAuB,EAAM+E,GAAmB,GAAK/E,EAAM+E,GAAmB,GAAGtG,MAAM,GAAI,GACpEmG,EAAcK,EAAQL,EACtBC,EAAcI,EAAQJ,GACjB7E,EAAM+E,GAAmB,GAAI,CAEhC/E,EAAM8E,OAAOC,EAAmB,GAChCN,IACA,IAAIS,EAAIH,EAAoB,EACxB/E,EAAMkF,IApeN,IAoeYlF,EAAMkF,GAAG,KACvBP,IACAE,EAAc7E,EAAMkF,GAAG,GAAKL,EAC5BK,KAEElF,EAAMkF,IAAMlF,EAAMkF,GAAG,KAAO1H,IAC9BkH,IACAE,EAAc5E,EAAMkF,GAAG,GAAKN,EAC5BM,KAEFH,EAAoBG,CACrB,CACF,CACD,GAAIC,EAAqBnF,EAAMyE,GAAS,IAAK,CACvCQ,EAAQjF,EAAMyE,GAAS,GAAG1B,OAAO,GACrC/C,EAAMyE,GAAS,GAAKzE,EAAMyE,GAAS,GAAGhG,MAAM,GAC5CmG,GAAeK,EACfJ,GAAeI,CAChB,CACF,CACD,GAAIR,EAAUzE,EAAM7B,OAAS,IAAM6B,EAAMyE,GAAS,GAAI,CAEpDzE,EAAM8E,OAAOL,EAAS,GACtB,KACD,CACD,GAAIG,EAAYzG,OAAS,GAAK0G,EAAY1G,OAAS,EAAG,CAEhDyG,EAAYzG,OAAS,GAAK0G,EAAY1G,OAAS,IAG5B,KADrBuB,EAAeC,EAAkBkF,EAAaD,MAExCG,GAAqB,EACvB/E,EAAM+E,GAAmB,IAAMF,EAAYhF,UAAU,EAAGH,IAExDM,EAAM8E,OAAO,EAAG,EAAG,CArgBlB,EAqgB+BD,EAAYhF,UAAU,EAAGH,KACzD+E,KAEFI,EAAcA,EAAYhF,UAAUH,GACpCkF,EAAcA,EAAY/E,UAAUH,IAIjB,KADrBA,EAAeI,EAAkB+E,EAAaD,MAE5C5E,EAAMyE,GAAS,GACbI,EAAYhF,UAAUgF,EAAY1G,OAASuB,GAAgBM,EAAMyE,GAAS,GAC5EI,EAAcA,EAAYhF,UAAU,EAAGgF,EAAY1G,OAASuB,GAC5DkF,EAAcA,EAAY/E,UAAU,EAAG+E,EAAYzG,OAASuB,KAIhE,IAAI0F,EAAIT,EAAeD,EACI,IAAvBE,EAAYzG,QAAuC,IAAvB0G,EAAY1G,QAC1C6B,EAAM8E,OAAOL,EAAUW,EAAGA,GAC1BX,GAAoBW,GACY,IAAvBR,EAAYzG,QACrB6B,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CA3hBvB,EA2hBqCP,IAC3CJ,EAAUA,EAAUW,EAAI,GACQ,IAAvBP,EAAY1G,QACrB6B,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CAAC5H,EAAaoH,IAC3CH,EAAUA,EAAUW,EAAI,IAExBpF,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CAAC5H,EAAaoH,GAAc,CAjiBnD,EAiiBiEC,IACvEJ,EAAUA,EAAUW,EAAI,EAE3B,CACe,IAAZX,GApiBK,IAoiBYzE,EAAMyE,EAAU,GAAG,IAEtCzE,EAAMyE,EAAU,GAAG,IAAMzE,EAAMyE,GAAS,GACxCzE,EAAM8E,OAAOL,EAAS,IAEtBA,IAEFE,EAAe,EACfD,EAAe,EACfE,EAAc,GACdC,EAAc,GAIe,KAA/B7E,EAAMA,EAAM7B,OAAS,GAAG,IAC1B6B,EAAMqF,MAMR,IAAIC,GAAU,EAGd,IAFAb,EAAU,EAEHA,EAAUzE,EAAM7B,OAAS,GA5jBjB,IA6jBT6B,EAAMyE,EAAU,GAAG,IA7jBV,IA8jBXzE,EAAMyE,EAAU,GAAG,KAEfzE,EAAMyE,GAAS,GAAG5E,UAAUG,EAAMyE,GAAS,GAAGtG,OAChD6B,EAAMyE,EAAU,GAAG,GAAGtG,UAAY6B,EAAMyE,EAAU,GAAG,IAErDzE,EAAMyE,GAAS,GAAKzE,EAAMyE,EAAU,GAAG,GACrCzE,EAAMyE,GAAS,GAAG5E,UAAU,EAAGG,EAAMyE,GAAS,GAAGtG,OAC/C6B,EAAMyE,EAAU,GAAG,GAAGtG,QAC1B6B,EAAMyE,EAAU,GAAG,GAAKzE,EAAMyE,EAAU,GAAG,GAAKzE,EAAMyE,EAAU,GAAG,GACnEzE,EAAM8E,OAAOL,EAAU,EAAG,GAC1Ba,GAAU,GACDtF,EAAMyE,GAAS,GAAG5E,UAAU,EAAGG,EAAMyE,EAAU,GAAG,GAAGtG,SAC9D6B,EAAMyE,EAAU,GAAG,KAEnBzE,EAAMyE,EAAU,GAAG,IAAMzE,EAAMyE,EAAU,GAAG,GAC5CzE,EAAMyE,GAAS,GACbzE,EAAMyE,GAAS,GAAG5E,UAAUG,EAAMyE,EAAU,GAAG,GAAGtG,QAClD6B,EAAMyE,EAAU,GAAG,GACrBzE,EAAM8E,OAAOL,EAAU,EAAG,GAC1Ba,GAAU,IAGdb,IAGEa,GACF7B,EAAkBzD,EAAOwE,EAE5B,CAED,SAASJ,EAAwBmB,GAC/B,OAAOA,GAAY,OAAUA,GAAY,KAC1C,CAED,SAAShB,EAAsBgB,GAC7B,OAAOA,GAAY,OAAUA,GAAY,KAC1C,CAED,SAASJ,EAAqBK,GAC5B,OAAOjB,EAAsBiB,EAAInB,WAAW,GAC7C,CAED,SAASW,EAAqBQ,GAC5B,OAAOpB,EAAwBoB,EAAInB,WAAWmB,EAAIrH,OAAS,GAC5D,CAYD,SAASiB,EAAiBqG,EAAQC,EAAWC,EAAWC,GACtD,OAAIZ,EAAqBS,IAAWN,EAAqBS,GAChD,KAZX,SAA6BC,GAE3B,IADA,IAAIC,EAAM,GACD3F,EAAI,EAAGA,EAAI0F,EAAO1H,OAAQgC,IAC7B0F,EAAO1F,GAAG,GAAGhC,OAAS,GACxB2H,EAAItC,KAAKqC,EAAO1F,IAGpB,OAAO2F,CACR,CAMQC,CAAoB,CACzB,CA3nBa,EA2nBAN,GACb,CAACjI,EAAakI,GACd,CA9nBc,EA8nBAC,GACd,CA9nBa,EA8nBAC,IAEhB,CA0FD,SAASI,EAAKtI,EAAOC,EAAOC,GAG1B,OAAOH,EAAUC,EAAOC,EAAOC,GAAY,EAC5C,CAEDoI,EAAKC,OAjuBa,EAkuBlBD,EAAKE,OAAS1I,EACdwI,EAAKG,MAluBY,EAouBjB,QAAAC,EAAiBJ,mx7vBChwBjBK,SAASC,eAAe,SAASC,iBAAiB,SAAS,KACvD,MAAMC,EAAOH,SAASC,eAAe,QAAQG,MACzCC,EAAML,SAASC,eAAe,OAAOG,MACrCE,EAAQN,SAASC,eAAe,SAASG,MAiB7CG,EAhBe,iIAKMD,qCACAD,oDAELF,4BAQG,CACfG,QACAE,cARgBC,IACMA,EAAUT,SAASU,iBAAiB,qCAAqC5I,OAE3F2I,EAAUE,OAAV,EAMJC,YAAY,EACZC,cAAc,GAJlB"} \ No newline at end of file +{"version":3,"file":"bundle.js","sources":["../node_modules/fast-diff/diff.js","index.js"],"sourcesContent":["/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","import {\n printHTML\n} from \"../src\"\n\n\ndocument.getElementById('print').addEventListener('click', () => {\n const html = document.getElementById('html').value,\n css = document.getElementById('css').value,\n title = document.getElementById('title').value,\n htmlDoc = `\n \n \n \n \n ${title}\n \n \n ${html}\n `,\n printCallback = iframeWin => {\n const pageCount = iframeWin.document.querySelectorAll('[data-vivliostyle-page-container]').length\n console.log(`page count: ${pageCount}`)\n iframeWin.print()\n }\n\n printHTML(htmlDoc, {\n title,\n printCallback,\n hideIframe: true, // Whether to use a hidden iframe (default: true)\n removeIframe: true // Whether to remove the iframe after use (default: true)\n })\n})\n"],"names":["DIFF_DELETE","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","index","length","newRange","oldLength","newLength","oldCursor","oldBefore","slice","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","Math","min","oldPrefix","newPrefix","make_edit_splice","cursor","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","i","indexOf","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","floor","j","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","concat","text1_length","text2_length","max_d","v_offset","v_length","v1","Array","v2","x","delta","front","k1start","k1end","k2start","k2end","d","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","unshift","push","diff_cleanupMerge","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","splice","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","n","pop","changes","charCode","str","before","oldMiddle","newMiddle","after","tuples","ret","remove_empty_tuples","diff","INSERT","DELETE","EQUAL","diff_1","document","getElementById","addEventListener","html","value","css","title","printHTML","printCallback","iframeWin","querySelectorAll","print","hideIframe","removeIframe"],"mappings":"yBA+BA,IAAIA,GAAe,EAanB,SAASC,EAAUC,EAAOC,EAAOC,EAAYC,GAE3C,GAAIH,IAAUC,EACZ,OAAID,EACK,CAAC,CAfG,EAeUA,IAEhB,GAGT,GAAkB,MAAdE,EAAoB,CACtB,IAAIE,EA6mBR,SAA+BC,EAASC,EAASJ,GAE/C,IAAIK,EAAiC,iBAAfL,EACpB,CAAEM,MAAON,EAAYO,OAAQ,GAAMP,EAAWK,SAC5CG,EAAiC,iBAAfR,EACpB,KAAOA,EAAWQ,SAKhBC,EAAYN,EAAQI,OACpBG,EAAYN,EAAQG,OACxB,GAAwB,IAApBF,EAASE,SAA8B,OAAbC,GAAyC,IAApBA,EAASD,QAAe,CAEzE,IAAII,EAAYN,EAASC,MACrBM,EAAYT,EAAQU,MAAM,EAAGF,GAC7BG,EAAWX,EAAQU,MAAMF,GACzBI,EAAiBP,EAAWA,EAASF,MAAQ,KAG3CU,EAAYL,EAAYD,EAAYD,EACxC,IAAuB,OAAnBM,GAA2BA,IAAmBC,MAG9CA,EAAY,GAAKA,EAAYN,GAAjC,CAGA,IAAIO,EAAYb,EAAQS,MAAM,EAAGG,GAEjC,IADIE,EAAWd,EAAQS,MAAMG,MACZF,EAAjB,CAGA,IAAIK,EAAeC,KAAKC,IAAIV,EAAWK,GAGvC,IAFIM,EAAYV,EAAUC,MAAM,EAAGM,OAC/BI,EAAYN,EAAUJ,MAAM,EAAGM,IAMnC,OAAOK,EAAiBF,EAFRV,EAAUC,MAAMM,GAChBF,EAAUJ,MAAMM,GACyBL,EATxD,CALA,CAkBD,GAAuB,OAAnBC,GAA2BA,IAAmBJ,EAAlD,CAGA,IAAIc,EAASd,EAETO,GADAD,EAAYb,EAAQS,MAAM,EAAGY,GAClBrB,EAAQS,MAAMY,IAC7B,GAAIR,IAAcL,EAAlB,CAGA,IAAIc,EAAeN,KAAKC,IAAIZ,EAAYgB,EAAQf,EAAYe,GAG5D,IAFIE,EAAYb,EAASD,MAAMC,EAASP,OAASmB,OAC7CE,EAAYV,EAASL,MAAMK,EAASX,OAASmB,IAMjD,OAAOF,EAAiBZ,EAFRE,EAASD,MAAM,EAAGC,EAASP,OAASmB,GACpCR,EAASL,MAAM,EAAGK,EAASX,OAASmB,GACKC,EATxD,CANA,CAiBJ,CACD,GAAItB,EAASE,OAAS,GAAKC,GAAgC,IAApBA,EAASD,OAAc,CAG1D,IAAIe,EAAYnB,EAAQU,MAAM,EAAGR,EAASC,OACtCqB,EAAYxB,EAAQU,MAAMR,EAASC,MAAQD,EAASE,QAGxD,KAAIG,GAFAS,EAAeG,EAAUf,SACzBmB,EAAeC,EAAUpB,SAC7B,CAGA,IAAIgB,EAAYnB,EAAQS,MAAM,EAAGM,GAC7BS,EAAYxB,EAAQS,MAAMH,EAAYgB,GAC1C,GAAIJ,IAAcC,GAAaI,IAAcC,EAK7C,OAAOJ,EAAiBF,EAFRnB,EAAQU,MAAMM,EAAcV,EAAYiB,GACxCtB,EAAQS,MAAMM,EAAcT,EAAYgB,GACCC,EARxD,CAUJ,CAED,OAAO,IACR,CAnsBkBE,CAAsB/B,EAAOC,EAAOC,GACnD,GAAIE,EACF,OAAOA,CAZ8C,CAiBzD,IAAI4B,EAAeC,EAAkBjC,EAAOC,GACxCiC,EAAelC,EAAMmC,UAAU,EAAGH,GAKtCA,EAAeI,EAJfpC,EAAQA,EAAMmC,UAAUH,GACxB/B,EAAQA,EAAMkC,UAAUH,IAIxB,IAAIK,EAAerC,EAAMmC,UAAUnC,EAAMS,OAASuB,GAK9CM,EAqBN,SAAuBtC,EAAOC,GAC5B,IAAIqC,EAEJ,IAAKtC,EAEH,MAAO,CAAC,CAnEM,EAmEQC,IAGxB,IAAKA,EAEH,MAAO,CAAC,CAACH,EAAaE,IAGxB,IAAIuC,EAAWvC,EAAMS,OAASR,EAAMQ,OAAST,EAAQC,EACjDuC,EAAYxC,EAAMS,OAASR,EAAMQ,OAASR,EAAQD,EAClDyC,EAAIF,EAASG,QAAQF,GACzB,IAAW,IAAPC,EAWF,OATAH,EAAQ,CACN,CAjFY,EAiFEC,EAASJ,UAAU,EAAGM,IACpC,CAjFW,EAiFED,GACb,CAnFY,EAmFED,EAASJ,UAAUM,EAAID,EAAU/B,UAG7CT,EAAMS,OAASR,EAAMQ,SACvB6B,EAAM,GAAG,GAAKA,EAAM,GAAG,GAAKxC,GAEvBwC,EAGT,GAAyB,IAArBE,EAAU/B,OAGZ,MAAO,CAAC,CAACX,EAAaE,GAAQ,CA/FhB,EA+F8BC,IAI9C,IAAI0C,EAwPN,SAAyB3C,EAAOC,GAC9B,IAAIsC,EAAWvC,EAAMS,OAASR,EAAMQ,OAAST,EAAQC,EACjDuC,EAAYxC,EAAMS,OAASR,EAAMQ,OAASR,EAAQD,EACtD,GAAIuC,EAAS9B,OAAS,GAAwB,EAAnB+B,EAAU/B,OAAa8B,EAAS9B,OACzD,OAAO,KAeT,SAASmC,EAAiBL,EAAUC,EAAWC,GAM7C,IAJA,IAGII,EAAiBC,EAAiBC,EAAkBC,EAHpDC,EAAOV,EAASJ,UAAUM,EAAGA,EAAInB,KAAK4B,MAAMX,EAAS9B,OAAS,IAC9D0C,GAAK,EACLC,EAAc,IAE+B,KAAzCD,EAAIX,EAAUE,QAAQO,EAAME,EAAI,KAAY,CAClD,IAAI9B,EAAeY,EACjBM,EAASJ,UAAUM,GAAID,EAAUL,UAAUgB,IACzCvB,EAAeQ,EACjBG,EAASJ,UAAU,EAAGM,GAAID,EAAUL,UAAU,EAAGgB,IAC/CC,EAAY3C,OAASmB,EAAeP,IACtC+B,EAAcZ,EAAUL,UACtBgB,EAAIvB,EAAcuB,GAAKX,EAAUL,UAAUgB,EAAGA,EAAI9B,GACpDwB,EAAkBN,EAASJ,UAAU,EAAGM,EAAIb,GAC5CkB,EAAkBP,EAASJ,UAAUM,EAAIpB,GACzC0B,EAAmBP,EAAUL,UAAU,EAAGgB,EAAIvB,GAC9CoB,EAAmBR,EAAUL,UAAUgB,EAAI9B,GAE9C,CACD,OAAyB,EAArB+B,EAAY3C,QAAc8B,EAAS9B,OAC9B,CACLoC,EAAiBC,EACjBC,EAAkBC,EAAkBI,GAG/B,IA7C0B,CAkDrC,IAGIT,EAaAU,EAASC,EAASC,EAASC,EAhB3BC,EAAMb,EAAiBL,EAAUC,EAAWlB,KAAKoC,KAAKnB,EAAS9B,OAAS,IAExEkD,EAAMf,EAAiBL,EAAUC,EAAWlB,KAAKoC,KAAKnB,EAAS9B,OAAS,IAE5E,IAAKgD,IAAQE,EACX,OAAO,KAOPhB,EANUgB,EAEAF,GAILA,EAAI,GAAGhD,OAASkD,EAAI,GAAGlD,OAASgD,EAHhCE,EAFAF,EAUHzD,EAAMS,OAASR,EAAMQ,QACvB4C,EAAUV,EAAG,GACbW,EAAUX,EAAG,GACbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,KAEbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,GACbU,EAAUV,EAAG,GACbW,EAAUX,EAAG,IAEf,IAAIiB,EAAajB,EAAG,GACpB,MAAO,CAACU,EAASC,EAASC,EAASC,EAASI,EAC7C,CAxUUC,CAAgB7D,EAAOC,GAChC,GAAI0C,EAAI,CAEN,IAAIU,EAAUV,EAAG,GACbW,EAAUX,EAAG,GACbY,EAAUZ,EAAG,GACba,EAAUb,EAAG,GACbiB,EAAajB,EAAG,GAEhBmB,EAAU/D,EAAUsD,EAASE,GAC7BQ,EAAUhE,EAAUuD,EAASE,GAEjC,OAAOM,EAAQE,OAAO,CAAC,CA9GV,EA8GuBJ,IAAcG,EACnD,CAED,OAaF,SAAsB/D,EAAOC,GAW3B,IATA,IAAIgE,EAAejE,EAAMS,OACrByD,EAAejE,EAAMQ,OACrB0D,EAAQ7C,KAAKoC,MAAMO,EAAeC,GAAgB,GAClDE,EAAWD,EACXE,EAAW,EAAIF,EACfG,EAAK,IAAIC,MAAMF,GACfG,EAAK,IAAID,MAAMF,GAGVI,EAAI,EAAGA,EAAIJ,EAAUI,IAC5BH,EAAGG,IAAM,EACTD,EAAGC,IAAM,EAEXH,EAAGF,EAAW,GAAK,EACnBI,EAAGJ,EAAW,GAAK,EAWnB,IAVA,IAAIM,EAAQT,EAAeC,EAGvBS,EAASD,EAAQ,GAAM,EAGvBE,EAAU,EACVC,EAAQ,EACRC,EAAU,EACVC,EAAQ,EACHC,EAAI,EAAGA,EAAIb,EAAOa,IAAK,CAE9B,IAAK,IAAIC,GAAMD,EAAIJ,EAASK,GAAMD,EAAIH,EAAOI,GAAM,EAAG,CASpD,IARA,IAAIC,EAAYd,EAAWa,EAOvBE,GAJFC,EADEH,KAAQD,GAAMC,IAAOD,GAAKV,EAAGY,EAAY,GAAKZ,EAAGY,EAAY,GAC1DZ,EAAGY,EAAY,GAEfZ,EAAGY,EAAY,GAAK,GAEbD,EAEZG,EAAKnB,GAAgBkB,EAAKjB,GAC1BlE,EAAMqF,OAAOD,KAAQnF,EAAMoF,OAAOF,IAElCC,IACAD,IAGF,GADAb,EAAGY,GAAaE,EACZA,EAAKnB,EAEPY,GAAS,OACJ,GAAIM,EAAKjB,EAEdU,GAAW,OACN,GAAID,EAAO,CAEhB,IADIW,EAAYlB,EAAWM,EAAQO,IAClB,GAAKK,EAAYjB,IAA+B,IAAnBG,EAAGc,GAG/C,GAAIF,IADAG,EAAKtB,EAAeO,EAAGc,IAGzB,OAAOE,EAAkBxF,EAAOC,EAAOmF,EAAID,EAGhD,CAnC2B,CAuC9B,IAAK,IAAIM,GAAMT,EAAIF,EAASW,GAAMT,EAAID,EAAOU,GAAM,EAAG,CASpD,IARA,IACIF,EADAD,EAAYlB,EAAWqB,EAOvBC,GAJFH,EADEE,KAAQT,GAAMS,IAAOT,GAAKR,EAAGc,EAAY,GAAKd,EAAGc,EAAY,GAC1Dd,EAAGc,EAAY,GAEfd,EAAGc,EAAY,GAAK,GAEbG,EAEZF,EAAKtB,GAAgByB,EAAKxB,GAC1BlE,EAAMqF,OAAOpB,EAAesB,EAAK,KAAOtF,EAAMoF,OAAOnB,EAAewB,EAAK,IAEzEH,IACAG,IAGF,GADAlB,EAAGc,GAAaC,EACZA,EAAKtB,EAEPc,GAAS,OACJ,GAAIW,EAAKxB,EAEdY,GAAW,OACN,IAAKH,EAAO,CAEjB,IADIO,EAAYd,EAAWM,EAAQe,IAClB,GAAKP,EAAYb,IAA+B,IAAnBC,EAAGY,GAAmB,CAClE,IAAIE,EACAD,EAAKf,GADLgB,EAAKd,EAAGY,IACaA,EAGzB,GAAIE,IADJG,EAAKtB,EAAesB,GAGlB,OAAOC,EAAkBxF,EAAOC,EAAOmF,EAAID,EAE9C,CACF,CACF,CAtG+B,CA0GlC,MAAO,CAAC,CAACrF,EAAaE,GAAQ,CAzOd,EAyO4BC,GAC7C,CAxHQ0F,CAAa3F,EAAOC,EAC5B,CA1Ea2F,CAJZ5F,EAAQA,EAAMmC,UAAU,EAAGnC,EAAMS,OAASuB,GAC1C/B,EAAQA,EAAMkC,UAAU,EAAGlC,EAAMQ,OAASuB,IAa1C,OAPIE,GACFI,EAAMuD,QAAQ,CA5CD,EA4Cc3D,IAEzBG,GACFC,EAAMwD,KAAK,CA/CE,EA+CWzD,IAE1B0D,EAAkBzD,EAAOnC,GAClBmC,CACR,CAkMD,SAASkD,EAAkBxF,EAAOC,EAAOwE,EAAGuB,GAC1C,IAAIC,EAASjG,EAAMmC,UAAU,EAAGsC,GAC5ByB,EAASjG,EAAMkC,UAAU,EAAG6D,GAC5BG,EAASnG,EAAMmC,UAAUsC,GACzB2B,EAASnG,EAAMkC,UAAU6D,GAGzB1D,EAAQvC,EAAUkG,EAAQC,GAC1BG,EAAStG,EAAUoG,EAAQC,GAE/B,OAAO9D,EAAM0B,OAAOqC,EACrB,CAUD,SAASpE,EAAkBjC,EAAOC,GAEhC,IAAKD,IAAUC,GAASD,EAAMqF,OAAO,KAAOpF,EAAMoF,OAAO,GACvD,OAAO,EAQT,IAJA,IAAIiB,EAAa,EACbC,EAAajF,KAAKC,IAAIvB,EAAMS,OAAQR,EAAMQ,QAC1C+F,EAAaD,EACbE,EAAe,EACZH,EAAaE,GAEhBxG,EAAMmC,UAAUsE,EAAcD,IAC9BvG,EAAMkC,UAAUsE,EAAcD,GAG9BC,EADAH,EAAaE,EAGbD,EAAaC,EAEfA,EAAalF,KAAK4B,OAAOqD,EAAaD,GAAc,EAAIA,GAO1D,OAJII,EAAwB1G,EAAM2G,WAAWH,EAAa,KACxDA,IAGKA,CACR,CASD,SAASpE,EAAkBpC,EAAOC,GAEhC,IAAKD,IAAUC,GAASD,EAAMe,OAAO,KAAOd,EAAMc,OAAO,GACvD,OAAO,EAQT,IAJA,IAAIuF,EAAa,EACbC,EAAajF,KAAKC,IAAIvB,EAAMS,OAAQR,EAAMQ,QAC1C+F,EAAaD,EACbK,EAAa,EACVN,EAAaE,GAEhBxG,EAAMmC,UAAUnC,EAAMS,OAAS+F,EAAYxG,EAAMS,OAASmG,IAC1D3G,EAAMkC,UAAUlC,EAAMQ,OAAS+F,EAAYvG,EAAMQ,OAASmG,GAG1DA,EADAN,EAAaE,EAGbD,EAAaC,EAEfA,EAAalF,KAAK4B,OAAOqD,EAAaD,GAAc,EAAIA,GAO1D,OAJIO,EAAsB7G,EAAM2G,WAAW3G,EAAMS,OAAS+F,KACxDA,IAGKA,CACR,CAsGD,SAAST,EAAkBzD,EAAOwE,GAChCxE,EAAMwD,KAAK,CApbI,EAobS,KAOxB,IANA,IAKI9D,EALA+E,EAAU,EACVC,EAAe,EACfC,EAAe,EACfC,EAAc,GACdC,EAAc,GAEXJ,EAAUzE,EAAM7B,QACrB,GAAIsG,EAAUzE,EAAM7B,OAAS,IAAM6B,EAAMyE,GAAS,GAChDzE,EAAM8E,OAAOL,EAAS,QAGxB,OAAQzE,EAAMyE,GAAS,IACrB,KAlcY,EAocVE,IACAE,GAAe7E,EAAMyE,GAAS,GAC9BA,IACA,MACF,KAAKjH,EACHkH,IACAE,GAAe5E,EAAMyE,GAAS,GAC9BA,IACA,MACF,KA5cW,EA6cT,IAAIM,EAAoBN,EAAUE,EAAeD,EAAe,EAChE,GAAIF,EAAa,CAWf,GAAIO,GAAqB,GAAKC,EAAqBhF,EAAM+E,GAAmB,IAAK,CAC/E,IAAIE,EAAQjF,EAAM+E,GAAmB,GAAGtG,OAAO,GAI/C,GAHAuB,EAAM+E,GAAmB,GAAK/E,EAAM+E,GAAmB,GAAGtG,MAAM,GAAI,GACpEmG,EAAcK,EAAQL,EACtBC,EAAcI,EAAQJ,GACjB7E,EAAM+E,GAAmB,GAAI,CAEhC/E,EAAM8E,OAAOC,EAAmB,GAChCN,IACA,IAAIS,EAAIH,EAAoB,EACxB/E,EAAMkF,IApeN,IAoeYlF,EAAMkF,GAAG,KACvBP,IACAE,EAAc7E,EAAMkF,GAAG,GAAKL,EAC5BK,KAEElF,EAAMkF,IAAMlF,EAAMkF,GAAG,KAAO1H,IAC9BkH,IACAE,EAAc5E,EAAMkF,GAAG,GAAKN,EAC5BM,KAEFH,EAAoBG,CACrB,CACF,CACD,GAAIC,EAAqBnF,EAAMyE,GAAS,IAAK,CACvCQ,EAAQjF,EAAMyE,GAAS,GAAG1B,OAAO,GACrC/C,EAAMyE,GAAS,GAAKzE,EAAMyE,GAAS,GAAGhG,MAAM,GAC5CmG,GAAeK,EACfJ,GAAeI,CAChB,CACF,CACD,GAAIR,EAAUzE,EAAM7B,OAAS,IAAM6B,EAAMyE,GAAS,GAAI,CAEpDzE,EAAM8E,OAAOL,EAAS,GACtB,KACD,CACD,GAAIG,EAAYzG,OAAS,GAAK0G,EAAY1G,OAAS,EAAG,CAEhDyG,EAAYzG,OAAS,GAAK0G,EAAY1G,OAAS,IAG5B,KADrBuB,EAAeC,EAAkBkF,EAAaD,MAExCG,GAAqB,EACvB/E,EAAM+E,GAAmB,IAAMF,EAAYhF,UAAU,EAAGH,IAExDM,EAAM8E,OAAO,EAAG,EAAG,CArgBlB,EAqgB+BD,EAAYhF,UAAU,EAAGH,KACzD+E,KAEFI,EAAcA,EAAYhF,UAAUH,GACpCkF,EAAcA,EAAY/E,UAAUH,IAIjB,KADrBA,EAAeI,EAAkB+E,EAAaD,MAE5C5E,EAAMyE,GAAS,GACbI,EAAYhF,UAAUgF,EAAY1G,OAASuB,GAAgBM,EAAMyE,GAAS,GAC5EI,EAAcA,EAAYhF,UAAU,EAAGgF,EAAY1G,OAASuB,GAC5DkF,EAAcA,EAAY/E,UAAU,EAAG+E,EAAYzG,OAASuB,KAIhE,IAAI0F,EAAIT,EAAeD,EACI,IAAvBE,EAAYzG,QAAuC,IAAvB0G,EAAY1G,QAC1C6B,EAAM8E,OAAOL,EAAUW,EAAGA,GAC1BX,GAAoBW,GACY,IAAvBR,EAAYzG,QACrB6B,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CA3hBvB,EA2hBqCP,IAC3CJ,EAAUA,EAAUW,EAAI,GACQ,IAAvBP,EAAY1G,QACrB6B,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CAAC5H,EAAaoH,IAC3CH,EAAUA,EAAUW,EAAI,IAExBpF,EAAM8E,OAAOL,EAAUW,EAAGA,EAAG,CAAC5H,EAAaoH,GAAc,CAjiBnD,EAiiBiEC,IACvEJ,EAAUA,EAAUW,EAAI,EAE3B,CACe,IAAZX,GApiBK,IAoiBYzE,EAAMyE,EAAU,GAAG,IAEtCzE,EAAMyE,EAAU,GAAG,IAAMzE,EAAMyE,GAAS,GACxCzE,EAAM8E,OAAOL,EAAS,IAEtBA,IAEFE,EAAe,EACfD,EAAe,EACfE,EAAc,GACdC,EAAc,GAIe,KAA/B7E,EAAMA,EAAM7B,OAAS,GAAG,IAC1B6B,EAAMqF,MAMR,IAAIC,GAAU,EAGd,IAFAb,EAAU,EAEHA,EAAUzE,EAAM7B,OAAS,GA5jBjB,IA6jBT6B,EAAMyE,EAAU,GAAG,IA7jBV,IA8jBXzE,EAAMyE,EAAU,GAAG,KAEfzE,EAAMyE,GAAS,GAAG5E,UAAUG,EAAMyE,GAAS,GAAGtG,OAChD6B,EAAMyE,EAAU,GAAG,GAAGtG,UAAY6B,EAAMyE,EAAU,GAAG,IAErDzE,EAAMyE,GAAS,GAAKzE,EAAMyE,EAAU,GAAG,GACrCzE,EAAMyE,GAAS,GAAG5E,UAAU,EAAGG,EAAMyE,GAAS,GAAGtG,OAC/C6B,EAAMyE,EAAU,GAAG,GAAGtG,QAC1B6B,EAAMyE,EAAU,GAAG,GAAKzE,EAAMyE,EAAU,GAAG,GAAKzE,EAAMyE,EAAU,GAAG,GACnEzE,EAAM8E,OAAOL,EAAU,EAAG,GAC1Ba,GAAU,GACDtF,EAAMyE,GAAS,GAAG5E,UAAU,EAAGG,EAAMyE,EAAU,GAAG,GAAGtG,SAC9D6B,EAAMyE,EAAU,GAAG,KAEnBzE,EAAMyE,EAAU,GAAG,IAAMzE,EAAMyE,EAAU,GAAG,GAC5CzE,EAAMyE,GAAS,GACbzE,EAAMyE,GAAS,GAAG5E,UAAUG,EAAMyE,EAAU,GAAG,GAAGtG,QAClD6B,EAAMyE,EAAU,GAAG,GACrBzE,EAAM8E,OAAOL,EAAU,EAAG,GAC1Ba,GAAU,IAGdb,IAGEa,GACF7B,EAAkBzD,EAAOwE,EAE5B,CAED,SAASJ,EAAwBmB,GAC/B,OAAOA,GAAY,OAAUA,GAAY,KAC1C,CAED,SAAShB,EAAsBgB,GAC7B,OAAOA,GAAY,OAAUA,GAAY,KAC1C,CAED,SAASJ,EAAqBK,GAC5B,OAAOjB,EAAsBiB,EAAInB,WAAW,GAC7C,CAED,SAASW,EAAqBQ,GAC5B,OAAOpB,EAAwBoB,EAAInB,WAAWmB,EAAIrH,OAAS,GAC5D,CAYD,SAASiB,EAAiBqG,EAAQC,EAAWC,EAAWC,GACtD,OAAIZ,EAAqBS,IAAWN,EAAqBS,GAChD,KAZX,SAA6BC,GAE3B,IADA,IAAIC,EAAM,GACD3F,EAAI,EAAGA,EAAI0F,EAAO1H,OAAQgC,IAC7B0F,EAAO1F,GAAG,GAAGhC,OAAS,GACxB2H,EAAItC,KAAKqC,EAAO1F,IAGpB,OAAO2F,CACR,CAMQC,CAAoB,CACzB,CA3nBa,EA2nBAN,GACb,CAACjI,EAAakI,GACd,CA9nBc,EA8nBAC,GACd,CA9nBa,EA8nBAC,IAEhB,CA0FD,SAASI,EAAKtI,EAAOC,EAAOC,GAG1B,OAAOH,EAAUC,EAAOC,EAAOC,GAAY,EAC5C,CAEDoI,EAAKC,OAjuBa,EAkuBlBD,EAAKE,OAAS1I,EACdwI,EAAKG,MAluBY,EAouBjB,QAAAC,EAAiBJ,+27vBChwBjBK,SAASC,eAAe,SAASC,iBAAiB,SAAS,KACvD,MAAMC,EAAOH,SAASC,eAAe,QAAQG,MACzCC,EAAML,SAASC,eAAe,OAAOG,MACrCE,EAAQN,SAASC,eAAe,SAASG,MAiB7CG,EAhBe,iIAKMD,qCACAD,oDAELF,4BAQG,CACfG,QACAE,cARgBC,IACMA,EAAUT,SAASU,iBAAiB,qCAAqC5I,OAE3F2I,EAAUE,OAAV,EAMJC,YAAY,EACZC,cAAc,GAJlB"} \ No newline at end of file