@internetarchive/bookreader 5.0.0-118 → 5.0.0-119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BookReader/474.js.map +1 -1
- package/BookReader/BookReader.css +1 -1
- package/BookReader/ia-bookreader.js +1886 -0
- package/BookReader/{BookReader.js.LICENSE.txt → ia-bookreader.js.LICENSE.txt} +6 -0
- package/BookReader/ia-bookreader.js.map +1 -0
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +2 -2
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.experiments.js +1 -1
- package/BookReader/plugins/plugin.experiments.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js +1 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.iiif.js +1 -1
- package/BookReader/plugins/plugin.iiif.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +1 -63
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.translate.js +1 -197
- package/BookReader/plugins/plugin.translate.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/plugins/translator-worker.js.map +1 -1
- package/BookReader/webcomponents-bundle.js.map +1 -1
- package/dist/esm/ia-bookreader.js +3 -0
- package/{BookReader/ia-bookreader-bundle.js.LICENSE.txt → dist/esm/ia-bookreader.js.LICENSE.txt} +1 -3
- package/dist/esm/ia-bookreader.js.map +1 -0
- package/dist/esm/plugins/plugin.archive_analytics.js +2 -0
- package/dist/esm/plugins/plugin.archive_analytics.js.map +1 -0
- package/dist/esm/plugins/plugin.autoplay.js +2 -0
- package/dist/esm/plugins/plugin.autoplay.js.map +1 -0
- package/dist/esm/plugins/plugin.chapters.js +2 -0
- package/dist/esm/plugins/plugin.chapters.js.map +1 -0
- package/dist/esm/plugins/plugin.experiments.js +2 -0
- package/dist/esm/plugins/plugin.experiments.js.map +1 -0
- package/dist/esm/plugins/plugin.iframe.js +2 -0
- package/dist/esm/plugins/plugin.iframe.js.map +1 -0
- package/dist/esm/plugins/plugin.iiif.js +2 -0
- package/dist/esm/plugins/plugin.iiif.js.map +1 -0
- package/dist/esm/plugins/plugin.resume.js +2 -0
- package/dist/esm/plugins/plugin.resume.js.map +1 -0
- package/dist/esm/plugins/plugin.search.js +2 -0
- package/dist/esm/plugins/plugin.search.js.map +1 -0
- package/dist/esm/plugins/plugin.text_selection.js +2 -0
- package/dist/esm/plugins/plugin.text_selection.js.map +1 -0
- package/dist/esm/plugins/plugin.translate.js +2 -0
- package/dist/esm/plugins/plugin.translate.js.map +1 -0
- package/dist/esm/plugins/plugin.tts.js +2 -0
- package/dist/esm/plugins/plugin.tts.js.map +1 -0
- package/dist/esm/plugins/plugin.url.js +2 -0
- package/dist/esm/plugins/plugin.url.js.map +1 -0
- package/dist/esm/plugins/plugin.vendor-fullscreen.js +2 -0
- package/dist/esm/plugins/plugin.vendor-fullscreen.js.map +1 -0
- package/package.json +19 -13
- package/src/BookReader/options.js +1 -1
- package/src/BookReader/utils/SelectionObserver.js +19 -2
- package/src/ia-bookreader/ia-bookreader.js +12 -3
- package/src/plugins/search/view.js +1 -1
- package/src/plugins/translate/plugin.translate.js +3 -2
- package/BookReader/BookReader.js +0 -3
- package/BookReader/BookReader.js.map +0 -1
- package/BookReader/ia-bookreader-bundle.js +0 -1886
- package/BookReader/ia-bookreader-bundle.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[479],{1743:function(t,e,r){var n=r(4576);t.exports=function(t,e){var r=n[t],o=r&&r.prototype;return o&&o[e]}},6098:function(t,e,r){var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),c=Math.floor,h=String.fromCharCode,f=n("".charCodeAt),p=n([].join),d=n([].push),m=n("".replace),g=n("".split),y=n("".toLowerCase),v=function(t){return t+22+75*(t<26)},b=function(t,e,r){var n=0;for(t=r?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=f(t,r++);if(o>=55296&&o<=56319&&r<n){var i=f(t,r++);56320==(64512&i)?d(e,((1023&o)<<10)+(1023&i)+65536):(d(e,o),r--)}else d(e,o)}return e}(t);var r,n,i=t.length,a=128,l=0,m=72;for(r=0;r<t.length;r++)(n=t[r])<128&&d(e,h(n));var g=e.length,y=g;for(g&&d(e,"-");y<i;){var w=o;for(r=0;r<t.length;r++)(n=t[r])>=a&&n<w&&(w=n);var P=y+1;if(w-a>c((o-l)/P))throw new u(s);for(l+=(w-a)*P,a=w,r=0;r<t.length;r++){if((n=t[r])<a&&++l>o)throw new u(s);if(n===a){for(var S=l,k=36;;){var R=k<=m?1:k>=m+26?26:k-m;if(S<R)break;var U=S-R,B=36-R;d(e,h(v(R+U%B))),S=c(U/B),k+=36}d(e,h(v(S))),m=b(l,P,y===g),l=0,y++}}l++,a++}return p(e,"")};t.exports=function(t){var e,r,n=[],o=g(m(y(t),a,"."),".");for(e=0;e<o.length;e++)r=o[e],d(n,l(i,r)?"xn--"+w(r):r);return p(n,".")}},706:function(t,e,r){var n=r(350).PROPER,o=r(9039),i=r(7452);t.exports=function(t){return o(function(){return!!i[t]()||"
"!=="
"[t]()||n&&i[t].name!==t})}},3921:function(t,e,r){var n=r(6518),o=r(2652),i=r(4659);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,function(t,r){i(e,t,r)},{AS_ENTRIES:!0}),e}})},2762:function(t,e,r){var n=r(6518),o=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},5806:function(t,e,r){r(7764);var n,o=r(6518),i=r(3724),a=r(7416),s=r(4576),u=r(6080),l=r(9504),c=r(6840),h=r(2106),f=r(679),p=r(9297),d=r(4213),m=r(7916),g=r(7680),y=r(8183).codeAt,v=r(6098),b=r(918),w=r(655),P=r(687),S=r(2812),k=r(8406),R=r(1181),U=R.set,B=R.getterFor("URL"),H=k.URLSearchParams,O=k.getState,L=b.decode,j=b.encode,I=s.URL,q=s.TypeError,A=s.parseInt,T=Math.floor,F=Math.pow,C=String.fromCharCode,_=l("".charAt),E=l(/./.exec),M=l([].join),x=l(1.1.toString),$=l([].pop),z=l([].push),N=l("".replace),D=l([].shift),J=l("".split),W=l("".indexOf),Q=l("".slice),G=l("".toLowerCase),K=l([].unshift),V="Invalid scheme",X="Invalid host",Y="Invalid port",Z=/[a-z]/i,tt=/[\d+\-.a-z]/i,et=/\d/,rt=/^0x/i,nt=/^[0-7]+$/,ot=/^\d+$/,it=/^[\da-f]+$/i,at=/[\u0000-\u0020#%/:<>?@[\\\]^|\u007F]/,st=/[\0\t\n\r #/:<>?@[\\\]^|]/,ut=/^[\u0000-\u0020]+/,lt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ct=/[\t\n\r]/g,ht=/[^\u0000-\u007F]/,ft=function(t){return 173===t||847===t||8203===t||12644===t||65279===t||65440===t||t>=4447&&t<=4448||t>=6068&&t<=6069||t>=6155&&t<=6159||t>=8288&&t<=8292||t>=8298&&t<=8303||t>=65024&&t<=65039||t>=917760&&t<=917999},pt=function(t){return 65533===t||t>=55296&&t<=57343||t>=128&&t<=159||t>=8206&&t<=8207||t>=8232&&t<=8233||t>=8234&&t<=8238||t>=8293&&t<=8297||t>=64976&&t<=65007||!(65534&~t)||t>=57344&&t<=63743||t>=983040&&t<=1114109},dt=function(t){return t>=65281&&t<=65374?t-65248:160===t||5760===t||8239===t||8287===t||12288===t||t>=8192&&t<=8202||t<=65535&&W("¨¯´¸˘˙˚˛˜˝ͺ΄΅᾽᾿῀῁῍῎῏῝῞῟῭΅´῾‗‾⁇⁈⁉℀℁℅℆⩴゛゜ﱞﱟﱠﱡﱢﱣﷺﷻ︓︖﹇﹈﹉﹊﹋﹌﹕﹖﹟﹤﹥﹨﹪﹫ﹰﹲﹴﹶﹸﹺﹼﹾ ̄",C(t))>-1?32:t},mt=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)K(e,t%256),t=T(t/256);return M(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=x(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},gt={},yt=d({},gt,{" ":1,'"':1,"#":1,"<":1,">":1}),vt=d({},yt,{"'":1}),bt=d({},gt,{" ":1,'"':1,"<":1,">":1,"`":1}),wt=d({},bt,{"#":1,"?":1,"{":1,"}":1,"^":1}),Pt=d({},wt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),St=function(t,e){var r=y(t,0);return r>=32&&r<127&&!p(e,t)?t:"'"===t&&p(e,t)?"%27":j(t)},kt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Rt=function(t,e){var r;return 2===t.length&&E(Z,_(t,0))&&(":"===(r=_(t,1))||!e&&"|"===r)},Ut=function(t){var e;return t.length>1&&Rt(Q(t,0,2))&&(2===t.length||"/"===(e=_(t,2))||"\\"===e||"?"===e||"#"===e)},Bt=function(t){return"."===t||"%2e"===G(t)},Ht=function(t){return".."===(t=G(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},Ot={},Lt={},jt={},It={},qt={},At={},Tt={},Ft={},Ct={},_t={},Et={},Mt={},xt={},$t={},zt={},Nt={},Dt={},Jt={},Wt={},Qt={},Gt={},Kt=function(t,e,r){var n,o,i,a=w(t);if(e){if(o=this.parse(a))throw new q(o);this.searchParams=null}else{if(void 0!==r&&(n=new Kt(r,!0)),o=this.parse(a,null,n))throw new q(o);(i=O(new H)).bindURL(this),this.searchParams=i}};Kt.prototype={type:"URL",parse:function(t,e,r){var o,i,a,s,u=this,l=e||Ot,c=0,h="",f=!1,d=!1,y=!1;for(t=w(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=N(t,ut,""),t=N(t,lt,"$1")),t=N(t,ct,""),o=m(t);c<=o.length;){switch(i=o[c],l){case Ot:if(!i||!E(Z,i)){if(e)return V;l=jt;continue}h+=G(i),l=Lt;break;case Lt:if(i&&E(tt,i))h+=G(i);else{if(":"!==i){if(e)return V;h="",l=jt,c=0;continue}if(e&&(u.isSpecial()!==p(kt,h)||"file"===h&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&""===u.host))return;if(u.scheme=h,e)return void(u.isSpecial()&&kt[u.scheme]===u.port&&(u.port=null));h="","file"===u.scheme?l=$t:u.isSpecial()&&r&&r.scheme===u.scheme?l=It:u.isSpecial()?l=Ft:"/"===o[c+1]?(l=qt,c++):(u.cannotBeABaseURL=!0,z(u.path,""),l=Wt)}break;case jt:if(!r||r.cannotBeABaseURL&&"#"!==i)return V;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=g(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Gt;break}l="file"===r.scheme?$t:At;continue;case It:if("/"!==i||"/"!==o[c+1]){l=At;continue}l=Ct,c++;break;case qt:if("/"===i){l=_t;break}l=Jt;continue;case At:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())l=Tt;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query="",l=Qt;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.path.length&&u.path.length--,l=Jt;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=g(r.path),u.query=r.query,u.fragment="",l=Gt}break;case Tt:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Jt;continue}l=_t}else l=Ct;break;case Ft:if(l=Ct,"/"!==i||"/"!==o[c+1])continue;c++;break;case Ct:if("/"!==i&&"\\"!==i){l=_t;continue}break;case _t:if("@"===i){f&&(h="%40"+h),f=!0,a=m(h);for(var v=0;v<a.length;v++){var b=a[v];if(":"!==b||y){var P=St(b,Pt);y?u.password+=P:u.username+=P}else y=!0}h=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(f&&""===h)return"Invalid authority";c-=m(h).length+1,h="",l=Et}else h+=i;break;case Et:case Mt:if(e&&"file"===u.scheme){l=Nt;continue}if(":"!==i||d){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===h)return X;if(e&&""===h&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(h))return s;if(h="",l=Dt,e)return;continue}"["===i?d=!0:"]"===i&&(d=!1),h+=i}else{if(""===h)return X;if(e===Mt)return;if(s=u.parseHost(h))return s;h="",l=xt}break;case xt:if(!E(et,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||e){if(""!==h){var S=A(h,10);if(S>65535)return Y;u.port=u.isSpecial()&&S===kt[u.scheme]?null:S,h=""}if(e)return;l=Dt;continue}return Y}h+=i;break;case $t:if(u.scheme="file",u.host="","/"===i||"\\"===i)l=zt;else{if(!r||"file"!==r.scheme){l=Jt;continue}switch(i){case n:u.host=r.host,u.path=g(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=g(r.path),u.query="",l=Qt;break;case"#":u.host=r.host,u.path=g(r.path),u.query=r.query,u.fragment="",l=Gt;break;default:u.host=r.host,Ut(M(g(o,c),""))||(u.path=g(r.path),u.shortenPath()),l=Jt;continue}}break;case zt:if("/"===i||"\\"===i){l=Nt;break}r&&"file"===r.scheme&&(u.host=r.host,!Ut(M(g(o,c),""))&&Rt(r.path[0],!0)&&z(u.path,r.path[0])),l=Jt;continue;case Nt:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!e&&Rt(h))l=Jt;else if(""===h){if(u.host="",e)return;l=Dt}else{if(s=u.parseHost(h))return s;if("localhost"===u.host&&(u.host=""),e)return;h="",l=Dt}continue}h+=i;break;case Dt:if(u.isSpecial()){if(l=Jt,"/"!==i&&"\\"!==i)continue}else if(e||"?"!==i)if(e||"#"!==i){if(i!==n&&(l=Jt,"/"!==i))continue}else u.fragment="",l=Gt;else u.query="",l=Qt;break;case Jt:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!e&&("?"===i||"#"===i)){if(Ht(h)?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||z(u.path,"")):Bt(h)?"/"===i||"\\"===i&&u.isSpecial()||z(u.path,""):("file"===u.scheme&&!u.path.length&&Rt(h)&&(null!==u.host&&""!==u.host&&(u.host=""),h=_(h,0)+":"),z(u.path,h)),h="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)D(u.path);"?"===i?(u.query="",l=Qt):"#"===i&&(u.fragment="",l=Gt)}else h+=St(i,wt);break;case Wt:"?"===i?(u.query="",l=Qt):"#"===i?(u.fragment="",l=Gt):i!==n&&(u.path[0]+=" "===i?"?"===o[c+1]||"#"===o[c+1]?"%20":" ":St(i,gt));break;case Qt:e||"#"!==i?i!==n&&(u.query+=St(i,u.isSpecial()?vt:yt)):(u.fragment="",l=Gt);break;case Gt:i!==n&&(u.fragment+=St(i,bt))}c++}},parseHost:function(t){var e,r,n;if("["===_(t,0)){if("]"!==_(t,t.length-1))return X;if(e=function(t){var e,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return _(t,h)};if(":"===f()){if(":"!==_(t,1))return;h+=2,c=++l}for(;f();){if(8===l)return;if(":"!==f()){for(e=r=0;r<4&&E(it,f());)e=16*e+A(f(),16),h++,r++;if("."===f()){if(0===r)return;if(h-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."===f()&&n<4))return;h++}if(!E(et,f()))return;for(;E(et,f());){if(i=A(f(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;h++}u[l]=256*u[l]+o,2!==++n&&4!==n||l++}if(4!==n)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[l++]=e}else{if(null!==c)return;h++,c=++l}}if(null!==c)for(a=l-c,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!==l)return;return u}(Q(t,1,-1)),!e)return X;this.host=e}else if(this.isSpecial()){if(t=function(t){if(!E(ht,t))return""===t?null:v(t);var e,r,n,o=m(t),i="";for(e=0;e<o.length;e++){if(r=y(o[e],0),pt(r))return null;ft(r)||(i+=(n=dt(r))===r?o[e]:C(n))}return""===i?null:v(i)}(L(t)),null===t||E(at,t))return X;if(function(t){var e,r,n=J(t,".");if(""===n[n.length-1]){if(1===n.length)return!1;n.length--}return e=n[n.length-1],!!E(ot,e)||!!E(rt,e)&&(""===(r=Q(e,2))||!!E(it,r))}(t)){if(e=function(t){var e,r,n,o,i,a,s,u=J(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return null;for(r=[],n=0;n<e;n++){if(""===(o=u[n]))return null;if(i=10,o.length>1&&"0"===_(o,0)&&(i=E(rt,o)?16:8,o=Q(o,8===i?1:2)),""===o)a=0;else{if(!E(10===i?ot:8===i?nt:it,o))return null;a=A(o,i)}z(r,a)}for(n=0;n<e;n++)if(a=r[n],n===e-1){if(a>=F(256,5-e))return null}else if(a>255)return null;for(s=$(r),n=0;n<r.length;n++)s+=r[n]*F(256,3-n);return s}(t),null===e)return X;this.host=e}else this.host=t}else{if(E(st,t))return X;for(e="",r=m(t),n=0;n<r.length;n++)e+=St(r[n],gt);this.host=e}},cannotHaveUsernamePasswordPort:function(){return null===this.host||""===this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(kt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&&Rt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=mt(o),null!==i&&(l+=":"+i)):"file"===e&&(l+="//"),null===o&&!t.cannotBeABaseURL&&a.length>1&&""===a[0]&&(l+="/."),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+M(a,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw new q(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Vt(this.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+mt(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(w(t)+":",Ot)},getUsername:function(){return this.username},setUsername:function(t){var e=m(w(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=St(e[r],Pt)}},getPassword:function(){return this.password},setPassword:function(t){var e=m(w(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=St(e[r],Pt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?mt(t):mt(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Et)},getHostname:function(){var t=this.host;return null===t?"":mt(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Mt)},getPort:function(){var t=this.port;return null===t?"":w(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=w(t))?this.port=null:this.parse(t,xt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+M(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Dt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=w(t))?this.query=null:("?"===_(t,0)&&(t=Q(t,1)),this.query="",this.parse(t,Qt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=w(t))?("#"===_(t,0)&&(t=Q(t,1)),this.fragment="",this.parse(t,Gt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Vt=function(t){var e=f(this,Xt),r=S(arguments.length,1)>1?arguments[1]:void 0,n=U(e,new Kt(t,!1,r));i||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Xt=Vt.prototype,Yt=function(t,e){return{get:function(){return B(this)[t]()},set:e&&function(t){return B(this)[e](t)},configurable:!0,enumerable:!0}};if(i&&(h(Xt,"href",Yt("serialize","setHref")),h(Xt,"origin",Yt("getOrigin")),h(Xt,"protocol",Yt("getProtocol","setProtocol")),h(Xt,"username",Yt("getUsername","setUsername")),h(Xt,"password",Yt("getPassword","setPassword")),h(Xt,"host",Yt("getHost","setHost")),h(Xt,"hostname",Yt("getHostname","setHostname")),h(Xt,"port",Yt("getPort","setPort")),h(Xt,"pathname",Yt("getPathname","setPathname")),h(Xt,"search",Yt("getSearch","setSearch")),h(Xt,"searchParams",Yt("getSearchParams")),h(Xt,"hash",Yt("getHash","setHash"))),c(Xt,"toJSON",function(){return B(this).serialize()},{enumerable:!0}),c(Xt,"toString",function(){return B(this).serialize()},{enumerable:!0}),I){var Zt=I.createObjectURL,te=I.revokeObjectURL;Zt&&c(Vt,"createObjectURL",u(Zt,I)),te&&c(Vt,"revokeObjectURL",u(te,I))}P(Vt,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Vt})},3296:function(t,e,r){r(5806)},7208:function(t,e,r){var n=r(6518),o=r(9565),i=r(1743)("URL","toString");n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(i,this)}})},5857:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}r(2675),r(9463),r(2259),r(5700),r(8706),r(3418),r(3792),r(2712),r(4782),r(9572),r(2010),r(2892),r(3851),r(875),r(6099),r(825),r(888),r(7495),r(8781),r(7764),r(5440),r(2953),r(8408),r(2008),r(113),r(8598),r(2062),r(5506),r(3921),r(9432),r(1761),r(5746),r(2762),r(3500),r(3296),r(7208);var u,l=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bookReaderOptions=e,this.urlSchema=[{name:"page",position:"path",default:"n0"},{name:"mode",position:"path",default:"2up"},{name:"search",position:"path",deprecated_for:"q"},{name:"q",position:"query_param"},{name:"sort",position:"query_param"},{name:"view",position:"query_param"},{name:"admin",position:"query_param"},{name:"focus",position:"query_param",readOnly:!0}],this.urlState={},this.urlMode=this.bookReaderOptions.urlMode||"hash",this.urlHistoryBasePath=this.bookReaderOptions.urlHistoryBasePath||"/",this.urlLocationPollId=null,this.oldLocationHash=null,this.oldUserHash=null},e=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach(function(o){var i,a,s,u,l,c=e.urlSchema.find(function(t){return t.name===o});null!==(i=c)&&void 0!==i&&i.deprecated_for&&(c=e.urlSchema.find(function(t){return t.name===c.deprecated_for})),null!==(a=c)&&void 0!==a&&a.readOnly||("path"==(null===(s=c)||void 0===s?void 0:s.position)?n[null===(u=c)||void 0===u?void 0:u.name]=t[o]:r.append((null===(l=c)||void 0===l?void 0:l.name)||o,t[o]))});var o=this.urlSchema.filter(function(t){return"path"==t.position}).map(function(t){return n[t.name]?"".concat(t.name,"/").concat(encodeURIComponent(n[t.name])):""}).join("/"),i="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),a="".concat(i,"?").concat(r.toString());return r.toString()?a:"".concat(i)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),n=Object.fromEntries(r.searchParams.entries()),i=r.pathname.match(/[^\\/]+\/[^\\/]+/g),a=i?Object.fromEntries(i.map(function(t){return t.split("/")})):{},s=function(t,e){return Object.keys(t).some(function(t){return t==e})};return this.urlSchema.filter(function(t){return"path"==t.position}).forEach(function(t){var r=s(a,t.name),n=s(t,"deprecated_for")&&r;if(r||n){var o=n?t.deprecated_for:t.name;e[o]=decodeURIComponent(a[t.name])}}),Object.entries(n).forEach(function(t){var r=o(t,2),n=r[0],i=r[1];e[n]=i}),e}},{key:"setUrlParam",value:function(t,e){this.urlState[t]=e,this.pushToAddressBar()}},{key:"removeUrlParam",value:function(t){delete this.urlState[t],this.pushToAddressBar()}},{key:"getUrlParam",value:function(t){return this.urlState[t]}},{key:"pushToAddressBar",value:function(){var t=this.urlStateToUrlString(this.urlState),e="/"!==t?t:"";if("history"==this.urlMode)if(window.history&&window.history.replaceState){var r="".concat(this.urlHistoryBasePath).concat(e).trim().replace(/(\/+)/g,"/");try{window.history.replaceState({},null,r)}catch(t){this.urlMode="hash"}}else this.options.urlMode="hash";if("hash"==this.urlMode){var n=o(window.location.href.split("#"),1)[0];window.location.replace("".concat(n,"#").concat(e))}this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=this.getHash(),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval(function(){var e=t.getHash();e!=t.oldLocationHash&&(t.urlState=t.urlStringToUrlState(e))},500)}},{key:"pullFromAddressBar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,e="history"===this.urlMode?t.pathname.substr(this.urlHistoryBasePath.length)+t.search:t.hash.substr(1);this.urlState=this.urlStringToUrlState(e)}},{key:"getHash",value:function(){return window.location.hash.slice(1)}}],e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=m(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},d.apply(null,arguments)}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}r(1669).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view","text"],urlTrackIndex0:!1}),BookReader.prototype.setup=(u=BookReader.prototype.setup,function(t){u.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,function(){var t=e.options,r=t.updateWindowTitle,n=t.urlMode;r&&(document.title=e.shortTitle(e.bookTitle,50)),"hash"===n&&e.urlStartLocationPolling()}),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollId),this.locationPollId=null),this.locationPollId=setInterval(function(){var e=t.urlReadFragment();if(e!=t.oldLocationHash&&e!=t.oldUserHash){var r,n=t.paramsFromFragment(e),o=function(){return t.updateFromParams(n)};t.trigger(BookReader.eventNames.stop),t.animating?(null===(r=t.plugins.autoplay)||void 0===r||r.stop(),t.animationFinishedCallback=o):o(),t.oldUserHash=e}},500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlTrackIndex0,n=e.urlTrackedParams;r||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var o,i,a=n.reduce(function(e,r){return r in t&&(e[r]=t[r]),e},{}),s=this.fragmentFromParams(a,this.options.urlMode),u=""===s?"":"/".concat(s),l=this.urlReadFragment(),c=this.getLocationSearch(),h=this.queryStringFromParams(a,c,this.options.urlMode);if(l!==s||c!==h){if("history"===this.options.urlMode)if(window.history&&window.history.replaceState){var f=this.options.urlHistoryBasePath.replace(/\/+$/,""),p="".concat(f).concat(u).concat(h);try{window.history.replaceState({},null,p),this.oldLocationHash=s+h}catch(i){this.options.urlMode="hash"}}else this.options.urlMode="hash";if("hash"===this.options.urlMode){var d=this.urlParamsFiltersOnlySearch(this.readQueryString()),m=(o=window.location.href.split("#"),i=1,function(t){if(Array.isArray(t))return t}(o)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(o,i)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];window.location.replace("".concat(m,"#").concat(s).concat(d)),this.oldLocationHash=s+d}}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var e=new URLSearchParams(t);return e.has("q")?"?".concat(new URLSearchParams({q:e.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,e=t.urlMode,r=t.urlHistoryBasePath;return"history"===e?window.location.pathname.substr(r.length):this.urlPlugin.getHash()},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var v=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=m(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,p()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}(this,t,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(t,BookReader),e=t,r=[{key:"init",value:function(){var e,r,n,o=this;this.options.enableUrlPlugin&&(this.urlPlugin=new l(this.options),this.on(BookReader.eventNames.PostInit,function(){"hash"===o.options.urlMode&&o.urlPlugin.listenForHashChanges()})),(e=t,r=this,"function"==typeof(n=d(m(1&3?e.prototype:e),"init",r))?function(t){return n.apply(r,t)}:n)([])}}],r&&h(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();window.BookReader=v}},function(t){t(t.s=5857)}]);
|
|
1
|
+
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[479],{1743:function(t,e,r){var n=r(4576);t.exports=function(t,e){var r=n[t],o=r&&r.prototype;return o&&o[e]}},6098:function(t,e,r){var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),c=Math.floor,h=String.fromCharCode,f=n("".charCodeAt),p=n([].join),d=n([].push),m=n("".replace),g=n("".split),y=n("".toLowerCase),v=function(t){return t+22+75*(t<26)},b=function(t,e,r){var n=0;for(t=r?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=f(t,r++);if(o>=55296&&o<=56319&&r<n){var i=f(t,r++);56320==(64512&i)?d(e,((1023&o)<<10)+(1023&i)+65536):(d(e,o),r--)}else d(e,o)}return e}(t);var r,n,i=t.length,a=128,l=0,m=72;for(r=0;r<t.length;r++)(n=t[r])<128&&d(e,h(n));var g=e.length,y=g;for(g&&d(e,"-");y<i;){var w=o;for(r=0;r<t.length;r++)(n=t[r])>=a&&n<w&&(w=n);var P=y+1;if(w-a>c((o-l)/P))throw new u(s);for(l+=(w-a)*P,a=w,r=0;r<t.length;r++){if((n=t[r])<a&&++l>o)throw new u(s);if(n===a){for(var S=l,k=36;;){var R=k<=m?1:k>=m+26?26:k-m;if(S<R)break;var U=S-R,B=36-R;d(e,h(v(R+U%B))),S=c(U/B),k+=36}d(e,h(v(S))),m=b(l,P,y===g),l=0,y++}}l++,a++}return p(e,"")};t.exports=function(t){var e,r,n=[],o=g(m(y(t),a,"."),".");for(e=0;e<o.length;e++)r=o[e],d(n,l(i,r)?"xn--"+w(r):r);return p(n,".")}},706:function(t,e,r){var n=r(350).PROPER,o=r(9039),i=r(7452);t.exports=function(t){return o(function(){return!!i[t]()||"
"!=="
"[t]()||n&&i[t].name!==t})}},3921:function(t,e,r){var n=r(6518),o=r(2652),i=r(4659);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,function(t,r){i(e,t,r)},{AS_ENTRIES:!0}),e}})},2762:function(t,e,r){var n=r(6518),o=r(3802).Bq;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},9912:function(t,e,r){var n=function(){return r(6518)},o=function(){return r(7764)},i=r.cw(function(t,e){o();var i,a=n(),s=r(3724),u=r(7416),l=r(4576),c=r(6080),h=r(9504),f=r(6840),p=r(2106),d=r(679),m=r(9297),g=r(4213),y=r(7916),v=r(7680),b=r(8183).L,w=r(6098),P=r(918),S=r(655),k=r(687),R=r(2812),U=r(8406),B=r(1181),H=B.set,O=B.getterFor("URL"),L=U.URLSearchParams,j=U.getState,I=P.decode,q=P.encode,A=l.URL,T=l.TypeError,F=l.parseInt,C=Math.floor,_=Math.pow,E=String.fromCharCode,M=h("".charAt),x=h(/./.exec),$=h([].join),z=h(1.1.toString),N=h([].pop),D=h([].push),J=h("".replace),W=h([].shift),Q=h("".split),G=h("".indexOf),K=h("".slice),V=h("".toLowerCase),X=h([].unshift),Y="Invalid scheme",Z="Invalid host",tt="Invalid port",et=/[a-z]/i,rt=/[\d+\-.a-z]/i,nt=/\d/,ot=/^0x/i,it=/^[0-7]+$/,at=/^\d+$/,st=/^[\da-f]+$/i,ut=/[\u0000-\u0020#%/:<>?@[\\\]^|\u007F]/,lt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ct=/^[\u0000-\u0020]+/,ht=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ft=/[\t\n\r]/g,pt=/[^\u0000-\u007F]/,dt=function(t){return 173===t||847===t||8203===t||12644===t||65279===t||65440===t||t>=4447&&t<=4448||t>=6068&&t<=6069||t>=6155&&t<=6159||t>=8288&&t<=8292||t>=8298&&t<=8303||t>=65024&&t<=65039||t>=917760&&t<=917999},mt=function(t){return 65533===t||t>=55296&&t<=57343||t>=128&&t<=159||t>=8206&&t<=8207||t>=8232&&t<=8233||t>=8234&&t<=8238||t>=8293&&t<=8297||t>=64976&&t<=65007||!(65534&~t)||t>=57344&&t<=63743||t>=983040&&t<=1114109},gt=function(t){return t>=65281&&t<=65374?t-65248:160===t||5760===t||8239===t||8287===t||12288===t||t>=8192&&t<=8202||t<=65535&&G("¨¯´¸˘˙˚˛˜˝ͺ΄΅᾽᾿῀῁῍῎῏῝῞῟῭΅´῾‗‾⁇⁈⁉℀℁℅℆⩴゛゜ﱞﱟﱠﱡﱢﱣﷺﷻ︓︖﹇﹈﹉﹊﹋﹌﹕﹖﹟﹤﹥﹨﹪﹫ﹰﹲﹴﹶﹸﹺﹼﹾ ̄",E(t))>-1?32:t},yt=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)X(e,t%256),t=C(t/256);return $(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=z(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},vt={},bt=g({},vt,{" ":1,'"':1,"#":1,"<":1,">":1}),wt=g({},bt,{"'":1}),Pt=g({},vt,{" ":1,'"':1,"<":1,">":1,"`":1}),St=g({},Pt,{"#":1,"?":1,"{":1,"}":1,"^":1}),kt=g({},St,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Rt=function(t,e){var r=b(t,0);return r>=32&&r<127&&!m(e,t)?t:"'"===t&&m(e,t)?"%27":q(t)},Ut={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Bt=function(t,e){var r;return 2===t.length&&x(et,M(t,0))&&(":"===(r=M(t,1))||!e&&"|"===r)},Ht=function(t){var e;return t.length>1&&Bt(K(t,0,2))&&(2===t.length||"/"===(e=M(t,2))||"\\"===e||"?"===e||"#"===e)},Ot=function(t){return"."===t||"%2e"===V(t)},Lt=function(t){return".."===(t=V(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},jt={},It={},qt={},At={},Tt={},Ft={},Ct={},_t={},Et={},Mt={},xt={},$t={},zt={},Nt={},Dt={},Jt={},Wt={},Qt={},Gt={},Kt={},Vt={},Xt=function(t,e,r){var n,o,i,a=S(t);if(e){if(o=this.parse(a))throw new T(o);this.searchParams=null}else{if(void 0!==r&&(n=new Xt(r,!0)),o=this.parse(a,null,n))throw new T(o);(i=j(new L)).bindURL(this),this.searchParams=i}};Xt.prototype={type:"URL",parse:function(t,e,r){var n,o,a,s,u=this,l=e||jt,c=0,h="",f=!1,p=!1,d=!1;for(t=S(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=J(t,ct,""),t=J(t,ht,"$1")),t=J(t,ft,""),n=y(t);c<=n.length;){switch(o=n[c],l){case jt:if(!o||!x(et,o)){if(e)return Y;l=qt;continue}h+=V(o),l=It;break;case It:if(o&&x(rt,o))h+=V(o);else{if(":"!==o){if(e)return Y;h="",l=qt,c=0;continue}if(e&&(u.isSpecial()!==m(Ut,h)||"file"===h&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&""===u.host))return;if(u.scheme=h,e)return void(u.isSpecial()&&Ut[u.scheme]===u.port&&(u.port=null));h="","file"===u.scheme?l=Nt:u.isSpecial()&&r&&r.scheme===u.scheme?l=At:u.isSpecial()?l=_t:"/"===n[c+1]?(l=Tt,c++):(u.cannotBeABaseURL=!0,D(u.path,""),l=Gt)}break;case qt:if(!r||r.cannotBeABaseURL&&"#"!==o)return Y;if(r.cannotBeABaseURL&&"#"===o){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Vt;break}l="file"===r.scheme?Nt:Ft;continue;case At:if("/"!==o||"/"!==n[c+1]){l=Ft;continue}l=Et,c++;break;case Tt:if("/"===o){l=Mt;break}l=Qt;continue;case Ft:if(u.scheme=r.scheme,o===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"===o||"\\"===o&&u.isSpecial())l=Ct;else if("?"===o)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",l=Kt;else{if("#"!==o){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length&&u.path.length--,l=Qt;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",l=Vt}break;case Ct:if(!u.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Qt;continue}l=Mt}else l=Et;break;case _t:if(l=Et,"/"!==o||"/"!==n[c+1])continue;c++;break;case Et:if("/"!==o&&"\\"!==o){l=Mt;continue}break;case Mt:if("@"===o){f&&(h="%40"+h),f=!0,a=y(h);for(var g=0;g<a.length;g++){var b=a[g];if(":"!==b||d){var w=Rt(b,kt);d?u.password+=w:u.username+=w}else d=!0}h=""}else if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()){if(f&&""===h)return"Invalid authority";c-=y(h).length+1,h="",l=xt}else h+=o;break;case xt:case $t:if(e&&"file"===u.scheme){l=Jt;continue}if(":"!==o||p){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()){if(u.isSpecial()&&""===h)return Z;if(e&&""===h&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(h))return s;if(h="",l=Wt,e)return;continue}"["===o?p=!0:"]"===o&&(p=!1),h+=o}else{if(""===h)return Z;if(e===$t)return;if(s=u.parseHost(h))return s;h="",l=zt}break;case zt:if(!x(nt,o)){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()||e){if(""!==h){var P=F(h,10);if(P>65535)return tt;u.port=u.isSpecial()&&P===Ut[u.scheme]?null:P,h=""}if(e)return;l=Wt;continue}return tt}h+=o;break;case Nt:if(u.scheme="file",u.host="","/"===o||"\\"===o)l=Dt;else{if(!r||"file"!==r.scheme){l=Qt;continue}switch(o){case i:u.host=r.host,u.path=v(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=v(r.path),u.query="",l=Kt;break;case"#":u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",l=Vt;break;default:u.host=r.host,Ht($(v(n,c),""))||(u.path=v(r.path),u.shortenPath()),l=Qt;continue}}break;case Dt:if("/"===o||"\\"===o){l=Jt;break}r&&"file"===r.scheme&&(u.host=r.host,!Ht($(v(n,c),""))&&Bt(r.path[0],!0)&&D(u.path,r.path[0])),l=Qt;continue;case Jt:if(o===i||"/"===o||"\\"===o||"?"===o||"#"===o){if(!e&&Bt(h))l=Qt;else if(""===h){if(u.host="",e)return;l=Wt}else{if(s=u.parseHost(h))return s;if("localhost"===u.host&&(u.host=""),e)return;h="",l=Wt}continue}h+=o;break;case Wt:if(u.isSpecial()){if(l=Qt,"/"!==o&&"\\"!==o)continue}else if(e||"?"!==o)if(e||"#"!==o){if(o!==i&&(l=Qt,"/"!==o))continue}else u.fragment="",l=Vt;else u.query="",l=Kt;break;case Qt:if(o===i||"/"===o||"\\"===o&&u.isSpecial()||!e&&("?"===o||"#"===o)){if(Lt(h)?(u.shortenPath(),"/"===o||"\\"===o&&u.isSpecial()||D(u.path,"")):Ot(h)?"/"===o||"\\"===o&&u.isSpecial()||D(u.path,""):("file"===u.scheme&&!u.path.length&&Bt(h)&&(null!==u.host&&""!==u.host&&(u.host=""),h=M(h,0)+":"),D(u.path,h)),h="","file"===u.scheme&&(o===i||"?"===o||"#"===o))for(;u.path.length>1&&""===u.path[0];)W(u.path);"?"===o?(u.query="",l=Kt):"#"===o&&(u.fragment="",l=Vt)}else h+=Rt(o,St);break;case Gt:"?"===o?(u.query="",l=Kt):"#"===o?(u.fragment="",l=Vt):o!==i&&(u.path[0]+=" "===o?"?"===n[c+1]||"#"===n[c+1]?"%20":" ":Rt(o,vt));break;case Kt:e||"#"!==o?o!==i&&(u.query+=Rt(o,u.isSpecial()?wt:bt)):(u.fragment="",l=Vt);break;case Vt:o!==i&&(u.fragment+=Rt(o,Pt))}c++}},parseHost:function(t){var e,r,n;if("["===M(t,0)){if("]"!==M(t,t.length-1))return Z;if(e=function(t){var e,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return M(t,h)};if(":"===f()){if(":"!==M(t,1))return;h+=2,c=++l}for(;f();){if(8===l)return;if(":"!==f()){for(e=r=0;r<4&&x(st,f());)e=16*e+F(f(),16),h++,r++;if("."===f()){if(0===r)return;if(h-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."===f()&&n<4))return;h++}if(!x(nt,f()))return;for(;x(nt,f());){if(i=F(f(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;h++}u[l]=256*u[l]+o,2!==++n&&4!==n||l++}if(4!==n)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[l++]=e}else{if(null!==c)return;h++,c=++l}}if(null!==c)for(a=l-c,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!==l)return;return u}(K(t,1,-1)),!e)return Z;this.host=e}else if(this.isSpecial()){if(t=function(t){if(!x(pt,t))return""===t?null:w(t);var e,r,n,o=y(t),i="";for(e=0;e<o.length;e++){if(r=b(o[e],0),mt(r))return null;dt(r)||(i+=(n=gt(r))===r?o[e]:E(n))}return""===i?null:w(i)}(I(t)),null===t||x(ut,t))return Z;if(function(t){var e,r,n=Q(t,".");if(""===n[n.length-1]){if(1===n.length)return!1;n.length--}return e=n[n.length-1],!!x(at,e)||!!x(ot,e)&&(""===(r=K(e,2))||!!x(st,r))}(t)){if(e=function(t){var e,r,n,o,i,a,s,u=Q(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return null;for(r=[],n=0;n<e;n++){if(""===(o=u[n]))return null;if(i=10,o.length>1&&"0"===M(o,0)&&(i=x(ot,o)?16:8,o=K(o,8===i?1:2)),""===o)a=0;else{if(!x(10===i?at:8===i?it:st,o))return null;a=F(o,i)}D(r,a)}for(n=0;n<e;n++)if(a=r[n],n===e-1){if(a>=_(256,5-e))return null}else if(a>255)return null;for(s=N(r),n=0;n<r.length;n++)s+=r[n]*_(256,3-n);return s}(t),null===e)return Z;this.host=e}else this.host=t}else{if(x(lt,t))return Z;for(e="",r=y(t),n=0;n<r.length;n++)e+=Rt(r[n],vt);this.host=e}},cannotHaveUsernamePasswordPort:function(){return null===this.host||""===this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return m(Ut,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&&Bt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=yt(o),null!==i&&(l+=":"+i)):"file"===e&&(l+="//"),null===o&&!t.cannotBeABaseURL&&a.length>1&&""===a[0]&&(l+="/."),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+$(a,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw new T(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Yt(this.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+yt(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(S(t)+":",jt)},getUsername:function(){return this.username},setUsername:function(t){var e=y(S(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=Rt(e[r],kt)}},getPassword:function(){return this.password},setPassword:function(t){var e=y(S(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=Rt(e[r],kt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?yt(t):yt(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,xt)},getHostname:function(){var t=this.host;return null===t?"":yt(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,$t)},getPort:function(){var t=this.port;return null===t?"":S(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=S(t))?this.port=null:this.parse(t,zt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+$(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Wt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=S(t))?this.query=null:("?"===M(t,0)&&(t=K(t,1)),this.query="",this.parse(t,Kt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=S(t))?("#"===M(t,0)&&(t=K(t,1)),this.fragment="",this.parse(t,Vt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Yt=function(t){var e=d(this,Zt),r=R(arguments.length,1)>1?arguments[1]:void 0,n=H(e,new Xt(t,!1,r));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Zt=Yt.prototype,te=function(t,e){return{get:function(){return O(this)[t]()},set:e&&function(t){return O(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(p(Zt,"href",te("serialize","setHref")),p(Zt,"origin",te("getOrigin")),p(Zt,"protocol",te("getProtocol","setProtocol")),p(Zt,"username",te("getUsername","setUsername")),p(Zt,"password",te("getPassword","setPassword")),p(Zt,"host",te("getHost","setHost")),p(Zt,"hostname",te("getHostname","setHostname")),p(Zt,"port",te("getPort","setPort")),p(Zt,"pathname",te("getPathname","setPathname")),p(Zt,"search",te("getSearch","setSearch")),p(Zt,"searchParams",te("getSearchParams")),p(Zt,"hash",te("getHash","setHash"))),f(Zt,"toJSON",function(){return O(this).serialize()},{enumerable:!0}),f(Zt,"toString",function(){return O(this).serialize()},{enumerable:!0}),A){var ee=A.createObjectURL,re=A.revokeObjectURL;ee&&f(Yt,"createObjectURL",c(ee,A)),re&&f(Yt,"revokeObjectURL",c(re,A))}k(Yt,"URL"),a({global:!0,constructor:!0,forced:!u,sham:!s},{URL:Yt})}),a=r.cw(function(t,e){i()}),s=r.cw(function(t,e){var o=n(),i=r(9565),a=r(1743)("URL","toString");o({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(a,this)}})});function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}r(2675),r(9463),r(2259),r(5700),r(8706),r(3418),r(3792),r(2712),r(4782),r(9572),r(2010),r(2892),r(3851),r(875),r(6099),r(825),r(888),r(7495),r(8781),o(),r(5440),r(2953),r(8408),r(2008),r(113),r(8598),r(2062),r(5506),r(3921),r(9432),r(1761),r(5746),r(2762),r(3500),a(),s();var p,d=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bookReaderOptions=e,this.urlSchema=[{name:"page",position:"path",default:"n0"},{name:"mode",position:"path",default:"2up"},{name:"search",position:"path",deprecated_for:"q"},{name:"q",position:"query_param"},{name:"sort",position:"query_param"},{name:"view",position:"query_param"},{name:"admin",position:"query_param"},{name:"focus",position:"query_param",readOnly:!0}],this.urlState={},this.urlMode=this.bookReaderOptions.urlMode||"hash",this.urlHistoryBasePath=this.bookReaderOptions.urlHistoryBasePath||"/",this.urlLocationPollId=null,this.oldLocationHash=null,this.oldUserHash=null},e=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach(function(o){var i,a,s,u,l,c=e.urlSchema.find(function(t){return t.name===o});null!==(i=c)&&void 0!==i&&i.deprecated_for&&(c=e.urlSchema.find(function(t){return t.name===c.deprecated_for})),null!==(a=c)&&void 0!==a&&a.readOnly||("path"==(null===(s=c)||void 0===s?void 0:s.position)?n[null===(u=c)||void 0===u?void 0:u.name]=t[o]:r.append((null===(l=c)||void 0===l?void 0:l.name)||o,t[o]))});var o=this.urlSchema.filter(function(t){return"path"==t.position}).map(function(t){return n[t.name]?"".concat(t.name,"/").concat(encodeURIComponent(n[t.name])):""}).join("/"),i="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),a="".concat(i,"?").concat(r.toString());return r.toString()?a:"".concat(i)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),n=Object.fromEntries(r.searchParams.entries()),o=r.pathname.match(/[^\\/]+\/[^\\/]+/g),i=o?Object.fromEntries(o.map(function(t){return t.split("/")})):{},a=function(t,e){return Object.keys(t).some(function(t){return t==e})};return this.urlSchema.filter(function(t){return"path"==t.position}).forEach(function(t){var r=a(i,t.name),n=a(t,"deprecated_for")&&r;if(r||n){var o=n?t.deprecated_for:t.name;e[o]=decodeURIComponent(i[t.name])}}),Object.entries(n).forEach(function(t){var r=l(t,2),n=r[0],o=r[1];e[n]=o}),e}},{key:"setUrlParam",value:function(t,e){this.urlState[t]=e,this.pushToAddressBar()}},{key:"removeUrlParam",value:function(t){delete this.urlState[t],this.pushToAddressBar()}},{key:"getUrlParam",value:function(t){return this.urlState[t]}},{key:"pushToAddressBar",value:function(){var t=this.urlStateToUrlString(this.urlState),e="/"!==t?t:"";if("history"==this.urlMode)if(window.history&&window.history.replaceState){var r="".concat(this.urlHistoryBasePath).concat(e).trim().replace(/(\/+)/g,"/");try{window.history.replaceState({},null,r)}catch(t){this.urlMode="hash"}}else this.options.urlMode="hash";if("hash"==this.urlMode){var n=l(window.location.href.split("#"),1)[0];window.location.replace("".concat(n,"#").concat(e))}this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=this.getHash(),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval(function(){var e=t.getHash();e!=t.oldLocationHash&&(t.urlState=t.urlStringToUrlState(e))},500)}},{key:"pullFromAddressBar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,e="history"===this.urlMode?t.pathname.substr(this.urlHistoryBasePath.length)+t.search:t.hash.substr(1);this.urlState=this.urlStringToUrlState(e)}},{key:"getHash",value:function(){return window.location.hash.slice(1)}}],e&&h(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function y(t){var e=function(t){if("object"!=m(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==m(e)?e:e+""}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=w(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},b.apply(null,arguments)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},P(t,e)}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}r(1669).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view","text"],urlTrackIndex0:!1}),BookReader.prototype.setup=(p=BookReader.prototype.setup,function(t){p.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,function(){var t=e.options,r=t.updateWindowTitle,n=t.urlMode;r&&(document.title=e.shortTitle(e.bookTitle,50)),"hash"===n&&e.urlStartLocationPolling()}),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollId),this.locationPollId=null),this.locationPollId=setInterval(function(){var e=t.urlReadFragment();if(e!=t.oldLocationHash&&e!=t.oldUserHash){var r,n=t.paramsFromFragment(e),o=function(){return t.updateFromParams(n)};t.trigger(BookReader.eventNames.stop),t.animating?(null===(r=t.plugins.autoplay)||void 0===r||r.stop(),t.animationFinishedCallback=o):o(),t.oldUserHash=e}},500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlTrackIndex0,n=e.urlTrackedParams;r||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var o,i,a=n.reduce(function(e,r){return r in t&&(e[r]=t[r]),e},{}),s=this.fragmentFromParams(a,this.options.urlMode),u=""===s?"":"/".concat(s),l=this.urlReadFragment(),c=this.getLocationSearch(),h=this.queryStringFromParams(a,c,this.options.urlMode);if(l!==s||c!==h){if("history"===this.options.urlMode)if(window.history&&window.history.replaceState){var f=this.options.urlHistoryBasePath.replace(/\/+$/,""),p="".concat(f).concat(u).concat(h);try{window.history.replaceState({},null,p),this.oldLocationHash=s+h}catch(i){this.options.urlMode="hash"}}else this.options.urlMode="hash";if("hash"===this.options.urlMode){var d=this.urlParamsFiltersOnlySearch(this.readQueryString()),m=(o=window.location.href.split("#"),i=1,function(t){if(Array.isArray(t))return t}(o)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(o,i)||function(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];window.location.replace("".concat(m,"#").concat(s).concat(d)),this.oldLocationHash=s+d}}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var e=new URLSearchParams(t);return e.has("q")?"?".concat(new URLSearchParams({q:e.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,e=t.urlMode,r=t.urlHistoryBasePath;return"history"===e?window.location.pathname.substr(r.length):this.urlPlugin.getHash()},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var k=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=w(e),function(t,e){if(e&&("object"==m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,r||[],w(t).constructor):e.apply(t,r))}(this,t,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&P(t,e)}(t,BookReader),e=t,r=[{key:"init",value:function(){var e,r,n,o=this;this.options.enableUrlPlugin&&(this.urlPlugin=new d(this.options),this.on(BookReader.eventNames.PostInit,function(){"hash"===o.options.urlMode&&o.urlPlugin.listenForHashChanges()})),(e=t,r=this,"function"==typeof(n=b(w(1&3?e.prototype:e),"init",r))?function(t){return n.apply(r,t)}:n)([])}}],r&&g(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();window.BookReader=k}},function(t){t(9912)}]);
|
|
2
2
|
//# sourceMappingURL=plugin.url.js.map
|