@fluid-topics/ft-reader-context 0.3.47 → 0.3.49
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,r,i){function n(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function o(t){return!!t&&!!t[q]}function s(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===V}(t)||Array.isArray(t)||!!t[W]||!!t.constructor[W]||h(t)||d(t))}function u(t,e,r){void 0===r&&(r=!1),0===a(t)?(r?Object.keys:z)(t).forEach((function(i){r&&"symbol"==typeof i||e(i,t[i],t)})):t.forEach((function(r,i){return e(i,r,t)}))}function a(t){var e=t[q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:h(t)?2:d(t)?3:0}function c(t,e){return 2===a(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function f(t,e,r){var i=a(t);2===i?t.set(e,r):3===i?(t.delete(e),t.add(r)):t[e]=r}function l(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function h(t){return L&&t instanceof Map}function d(t){return $&&t instanceof Set}function v(t){return t.o||t.t}function p(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=J(t);delete e[q];for(var r=z(e),i=0;i<r.length;i++){var n=r[i],o=e[n];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function b(t,e){return void 0===e&&(e=!1),g(t)||o(t)||!s(t)||(a(t)>1&&(t.set=t.add=t.clear=t.delete=y),Object.freeze(t),e&&u(t,(function(t,e){return b(e,!0)}),!0)),t}function y(){n(2)}function g(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function m(t){var e=X[t];return e||n(18,t),e}function w(){return k}function I(t,e){e&&(m("Patches"),t.u=[],t.s=[],t.v=e)}function j(t){O(t),t.p.forEach(A),t.p=null}function O(t){t===k&&(k=t.l)}function T(t){return k={p:[],l:k,h:t,m:!0,_:0}}function A(t){var e=t[q];0===e.i||1===e.i?e.j():e.O=!0}function P(t,e){e._=e.p.length;var r=e.p[0],i=void 0!==t&&t!==r;return e.h.g||m("ES5").S(e,t,i),i?(r[q].P&&(j(e),n(4)),s(t)&&(t=S(e,t),e.l||M(e,t)),e.u&&m("Patches").M(r[q].t,t,e.u,e.s)):t=S(e,r,[]),j(e),e.u&&e.v(e.u,e.s),t!==K?t:void 0}function S(t,e,r){if(g(e))return e;var i=e[q];if(!i)return u(e,(function(n,o){return E(t,i,e,n,o,r)}),!0),e;if(i.A!==t)return e;if(!i.P)return M(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=4===i.i||5===i.i?i.o=p(i.k):i.o;u(3===i.i?new Set(n):n,(function(e,o){return E(t,i,n,e,o,r)})),M(t,n,!1),r&&t.u&&m("Patches").R(i,r,t.u,t.s)}return i.o}function E(t,e,r,i,n,u){if(o(n)){var a=S(t,n,u&&e&&3!==e.i&&!c(e.D,i)?u.concat(i):void 0);if(f(r,i,a),!o(a))return;t.m=!1}if(s(n)&&!g(n)){if(!t.h.F&&t._<1)return;S(t,n),e&&e.A.l||M(t,n)}}function M(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&b(e,r)}function R(t,e){var r=t[q];return(r?v(r):t)[e]}function C(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Object.getPrototypeOf(r)}}function x(t){t.P||(t.P=!0,t.l&&x(t.l))}function N(t){t.o||(t.o=p(t.t))}function U(t,e,r){var i=h(e)?m("MapSet").N(e,r):d(e)?m("MapSet").T(e,r):t.g?function(t,e){var r=Array.isArray(t),i={i:r?1:0,A:e?e.A:w(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},n=i,o=Y;r&&(n=[i],o=H);var s=Proxy.revocable(n,o),u=s.revoke,a=s.proxy;return i.k=a,i.j=u,a}(e,r):m("ES5").J(e,r);return(r?r.A:w()).p.push(i),i}function _(t){return o(t)||n(22,t),function t(e){if(!s(e))return e;var r,i=e[q],n=a(e);if(i){if(!i.P&&(i.i<4||!m("ES5").K(i)))return i.t;i.I=!0,r=B(e,n),i.I=!1}else r=B(e,n);return u(r,(function(e,n){i&&function(t,e){return 2===a(t)?t.get(e):t[e]}(i.t,e)===n||f(r,e,t(n))})),3===n?new Set(r):r}(t)}function B(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return p(t)}var D,k,F="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),L="undefined"!=typeof Map,$="undefined"!=typeof Set,G="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,K=F?Symbol.for("immer-nothing"):((D={})["immer-nothing"]=!0,D),W=F?Symbol.for("immer-draftable"):"__$immer_draftable",q=F?Symbol.for("immer-state"):"__$immer_state",V=""+Object.prototype.constructor,z="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,J=Object.getOwnPropertyDescriptors||function(t){var e={};return z(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},X={},Y={get:function(t,e){if(e===q)return t;var r=v(t);if(!c(r,e))return function(t,e,r){var i,n=C(e,r);return n?"value"in n?n.value:null===(i=n.get)||void 0===i?void 0:i.call(t.k):void 0}(t,r,e);var i=r[e];return t.I||!s(i)?i:i===R(t.t,e)?(N(t),t.o[e]=U(t.A.h,i,t)):i},has:function(t,e){return e in v(t)},ownKeys:function(t){return Reflect.ownKeys(v(t))},set:function(t,e,r){var i=C(v(t),e);if(null==i?void 0:i.set)return i.set.call(t.k,r),!0;if(!t.P){var n=R(v(t),e),o=null==n?void 0:n[q];if(o&&o.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(l(r,n)&&(void 0!==r||c(t.t,e)))return!0;N(t),x(t)}return t.o[e]===r&&"number"!=typeof r&&(void 0!==r||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==R(t.t,e)||e in t.t?(t.D[e]=!1,N(t),x(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=v(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:i.enumerable,value:r[e]}:i},defineProperty:function(){n(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){n(12)}},H={};u(Y,(function(t,e){H[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),H.deleteProperty=function(t,e){return H.set.call(this,t,e,void 0)},H.set=function(t,e,r){return Y.set.call(this,t[0],e,r,t[0])};var Q=function(){function t(t){var e=this;this.g=G,this.F=!0,this.produce=function(t,r,i){if("function"==typeof t&&"function"!=typeof r){var o=r;r=t;var u=e;return function(t){var e=this;void 0===t&&(t=o);for(var i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return u.produce(t,(function(t){var i;return(i=r).call.apply(i,[e,t].concat(n))}))}}var a;if("function"!=typeof r&&n(6),void 0!==i&&"function"!=typeof i&&n(7),s(t)){var c=T(e),f=U(e,t,void 0),l=!0;try{a=r(f),l=!1}finally{l?j(c):O(c)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return I(c,i),P(t,c)}),(function(t){throw j(c),t})):(I(c,i),P(a,c))}if(!t||"object"!=typeof t){if(void 0===(a=r(t))&&(a=t),a===K&&(a=void 0),e.F&&b(a,!0),i){var h=[],d=[];m("Patches").M(t,a,h,d),i(h,d)}return a}n(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(n))}))};var i,n,o=e.produce(t,r,(function(t,e){i=t,n=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,i,n]})):[o,i,n]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){s(t)||n(8),o(t)&&(t=_(t));var e=T(this),r=U(this,t,void 0);return r[q].C=!0,O(e),r},e.finishDraft=function(t,e){var r=(t&&t[q]).A;return I(r,e),P(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!G&&n(20),this.g=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var i=e[r];if(0===i.path.length&&"replace"===i.op){t=i.value;break}}r>-1&&(e=e.slice(r+1));var n=m("Patches").$;return o(t)?n(t,e):this.produce(t,(function(t){return n(t,e)}))},t}(),Z=new Q,tt=Z.produce;Z.produceWithPatches.bind(Z),Z.setAutoFreeze.bind(Z),Z.setUseProxies.bind(Z),Z.applyPatches.bind(Z),Z.createDraft.bind(Z),Z.finishDraft.bind(Z);var et,rt=tt,it=(et=function(t,e){return et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},et(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}et(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nt=function(t,e){for(var r=0,i=e.length,n=t.length;r<i;r++,n++)t[n]=e[r];return t},ot=Object.defineProperty,st=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=function(t,e,r){return e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ft=function(t,e){for(var r in e||(e={}))ut.call(e,r)&&ct(t,r,e[r]);if(st)for(var i=0,n=st(e);i<n.length;i++){r=n[i];at.call(e,r)&&ct(t,r,e[r])}return t};function lt(t){return s(t)?rt(t,(function(){})):t}function ht(t,e){function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e){var n=e.apply(void 0,r);if(!n)throw new Error("prepareAction did not return an object");return ft(ft({type:t,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:t,payload:r[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(e){return e.type===t},r}function dt(t){var e,r={},i=[],n={addCase:function(t,e){var i="string"==typeof t?t:t.type;if(i in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[i]=e,n},addMatcher:function(t,e){return i.push({matcher:t,reducer:e}),n},addDefaultCase:function(t){return e=t,n}};return t(n),[r,i,e]}function vt(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var r,i="function"==typeof t.initialState?t.initialState:lt(t.initialState),n=t.reducers||{},u=Object.keys(n),a={},c={},f={};function l(){var e="function"==typeof t.extraReducers?dt(t.extraReducers):[t.extraReducers],r=e[0],n=void 0===r?{}:r,u=e[1],a=void 0===u?[]:u,f=e[2],l=void 0===f?void 0:f,h=ft(ft({},n),c);return function(t,e,r,i){void 0===r&&(r=[]);var n,u="function"==typeof e?dt(e):[e,r,i],a=u[0],c=u[1],f=u[2];if(function(t){return"function"==typeof t}(t))n=function(){return lt(t())};else{var l=lt(t);n=function(){return l}}function h(t,e){void 0===t&&(t=n());var r=nt([a[e.type]],c.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===r.filter((function(t){return!!t})).length&&(r=[f]),r.reduce((function(t,r){if(r){var i;if(o(t))return void 0===(i=r(t,e))?t:i;if(s(t))return rt(t,(function(t){return r(t,e)}));if(void 0===(i=r(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return t}),t)}return h.getInitialState=n,h}(i,h,a,l)}return u.forEach((function(t){var r,i,o=n[t],s=e+"/"+t;"reducer"in o?(r=o.reducer,i=o.prepare):r=o,a[t]=r,c[s]=r,f[t]=i?ht(s,i):ht(s)})),{name:e,reducer:function(t,e){return r||(r=l()),r(t,e)},actions:f,caseReducers:a,getInitialState:function(){return r||(r=l()),r.getInitialState()}}}!function(t){function e(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var n=t.apply(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}it(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,nt([void 0],t[0].concat(this)))):new(e.bind.apply(e,nt([void 0],t.concat(this))))}}(Array);var pt="listenerMiddleware";ht(pt+"/add"),ht(pt+"/removeAll"),ht(pt+"/remove"),function(){function t(t,e){var r=n[t];return r?r.enumerable=e:n[t]=r={configurable:!0,enumerable:e,get:function(){var e=this[q];return Y.get(e,t)},set:function(e){var r=this[q];Y.set(r,t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var n=t[e][q];if(!n.P)switch(n.i){case 5:i(n)&&x(n);break;case 4:r(n)&&x(n)}}}function r(t){for(var e=t.t,r=t.k,i=z(r),n=i.length-1;n>=0;n--){var o=i[n];if(o!==q){var s=e[o];if(void 0===s&&!c(e,o))return!0;var u=r[o],a=u&&u[q];if(a?a.t!==s:!l(u,s))return!0}}var f=!!e[q];return i.length!==z(e).length+(f?0:1)}function i(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);if(r&&!r.get)return!0;for(var i=0;i<e.length;i++)if(!e.hasOwnProperty(i))return!0;return!1}var n={};!function(t,e){X[t]||(X[t]=e)}("ES5",{J:function(e,r){var i=Array.isArray(e),n=function(e,r){if(e){for(var i=Array(r.length),n=0;n<r.length;n++)Object.defineProperty(i,""+n,t(n,!0));return i}var o=J(r);delete o[q];for(var s=z(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,e||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(i,e),o={i:i?5:4,A:r?r.A:w(),P:!1,I:!1,D:{},l:r,t:e,k:n,o:null,O:!1,C:!1};return Object.defineProperty(n,q,{value:o,writable:!0}),n},S:function(t,r,n){n?o(r)&&r[q].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[q];if(r){var n=r.t,o=r.k,s=r.D,a=r.i;if(4===a)u(o,(function(e){e!==q&&(void 0!==n[e]||c(n,e)?s[e]||t(o[e]):(s[e]=!0,x(r)))})),u(n,(function(t){void 0!==o[t]||c(o,t)||(s[t]=!1,x(r))}));else if(5===a){if(i(r)&&(x(r),s.length=!0),o.length<n.length)for(var f=o.length;f<n.length;f++)s[f]=!1;else for(var l=n.length;l<o.length;l++)s[l]=!0;for(var h=Math.min(o.length,n.length),d=0;d<h;d++)o.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&t(o[d])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):i(t)}})}();const bt={setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setMapId:(t,e)=>{t.mapId=e.payload},setTocId:(t,e)=>{t.tocId=e.payload},setMap:(t,e)=>{t.map=e.payload},setToc:(t,e)=>{t.toc=e.payload},setPagesToc:(t,e)=>{t.pagesToc=e.payload},setCurrentPage:(t,e)=>{t.currentPage=e.payload},setScrollTarget:(t,e)=>{t.scrollTarget=e.payload},setVisibleTopics:(t,e)=>{t.visibleTopics=e.payload},setRenderBeforeFirst:(t,e)=>{t.renderBeforeFirst=e.payload},setRenderAfterLast:(t,e)=>{t.renderAfterLast=e.payload},setLabels:(t,e)=>{t.labels=e.payload}},yt={topicMissingAdvice:"Sorry, this topic is missing",somethingWentWrong:"Oops, something went wrong"};class gt{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,r){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,r)),null==t.tocId?this.extractPagesToc(t.children,e,r):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,r){return t.flatMap((t=>{var i,n,o;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let s=null===(n=t.prettyUrl)||void 0===n?void 0:n.replace(/^\//,"");const u={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:s,depth:e,parentTocId:r,children:[]};this.register(u);const a=this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,u.tocId);return u.children=[...a,...c],[u]}))}convertSectionNodes(t,e,r){return t.flatMap((t=>{var i;let n=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const o={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:n,depth:e,parentTocId:r,children:[]};return this.register(o),o.children=this.convertSectionNodes(t.children,e+1,t.tocId),[o]}))}buildPage(t,e){var r,i,n,o,s,u;const a={number:this.pages.length+1,title:null!==(r=t.title)&&void 0!==r?r:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(n=t.pageToc)&&void 0!==n?n:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?a.topics:a.hiddenTopics).push(t),f=null!==(s=null===(o=t.pageConfiguration)||void 0===o?void 0:o.parentsVisibility)&&void 0!==s?s:[];return a.breadcrumb.forEach(((t,e)=>{c(t,f[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),a.topics.push(...this.tocIds(null!==(u=t.pageToc)&&void 0!==u?u:[])),a}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class mt{convertPaginatedToc(t){return new gt(t).build()}}class wt{constructor(t,r,i,n){this.converter=t,this.api=r,this.baseUrl=i,this.mapId=n,this.topics={},this.topicContents={},this.labelResolver=new e.ParametrizedLabelResolver(yt,{}),i.endsWith("/")||(this.baseUrl=i+"/")}static build(t,e,r){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");return new wt(new mt,new window.fluidtopics.FluidTopicsApi(t,e,!0),t,r)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={},this.ratingSummary=void 0}getMap(){return this.loadIfNeeded((()=>this.map),(t=>this.map=t),(()=>this.api.getMap(this.mapId)))}getEnrichedToc(){return this.loadIfNeeded((()=>this.enrichedToc),(t=>this.enrichedToc=t),(()=>this.api.getPages(this.mapId).then((t=>this.converter.convertPaginatedToc(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;if(!("boolean"==typeof this.enrichedToc||this.enrichedToc instanceof Error))return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(e=>this.topics[t]=e),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(e=>this.topicContents[t]=e),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,e,r){const i=this.getNavigationData(t,e,r),n="r/"+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),o=new URL(n,this.baseUrl);return null!=i.page&&o.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&o.searchParams.set("tocId",i.tocId),null!=i.section&&o.searchParams.set("section",i.section),o.href}getNavigationData(t,e,r){var i,n;t=t||"root";const o="object"==typeof this.enrichedToc?this.enrichedToc:void 0,s=null==o?void 0:o.pageByTocId[t],u=null==o?void 0:o.nodeByTocId[t],a=null==u?void 0:u.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(i=null==u?void 0:u.title)&&void 0!==i?i:"",page:e&&s&&s.number!==e?e:void 0,prettyUrl:null!=a?a.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(n=null==o?void 0:o.duplicatedPrettyUrls.has(null!=a?a:""))&&void 0!==n&&n,section:r}}async getAccurateNavigationData(t,e,r){return await this.getEnrichedToc(),this.getNavigationData(t,e,r)}async loadIfNeeded(t,r,i){for(void 0===t()&&(r(!0),r(await i().catch((t=>t))));!0===t();)await e.delay(10);const n=t();if(n instanceof Error)throw n;return n}set labels(t){this.labelResolver=new e.ParametrizedLabelResolver(yt,t)}resolveLabel(t,...e){return this.labelResolver.resolve(t,e)}getRatingSummary(){return this.loadIfNeeded((()=>this.ratingSummary),(t=>this.ratingSummary=t),(()=>this.api.getMapRating(this.mapId)))}getMapRating(){return this.getRatingSummary().then((t=>t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var r;return{type:e.topics.type,rating:null===(r=e.topics)||void 0===r?void 0:r.ratings.find((e=>e.tocId===t))}}))}rateMap(t,e){return this.api.rateMap(this.mapId,t,e).then((()=>this.ratingSummary=void 0))}unrateMap(){return this.api.unrateMap(this.mapId).then((()=>this.ratingSummary=void 0))}sendMapFeedback(t){return this.api.sendMapFeedback(this.mapId,t)}rateTopic(t,e,r){return this.api.rateTopic(this.mapId,t,e,r).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}sendTopicFeedback(t,e){return this.api.sendTopicFeedback(this.mapId,t,e)}fontsStylesheet(){return this.api.endpoints.stylesheets.fonts}themeStylesheet(){return this.api.endpoints.stylesheets.theme}}class It{constructor(t,r){this.store=t,this.slice=r,this.reloadDebouncer=new e.Debouncer(10)}static build(t){const r=(t=>vt({name:"ft-reader-"+t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:"ft-reader",mapId:void 0,visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:bt}))(t.trim()||"context");return new It(e.getStore(r),r)}setBaseUrl(t){this.setRequiredStateField("baseUrl","setBaseUrl",t)}setApiIntegrationIdentifier(t){this.setRequiredStateField("apiIntegrationIdentifier","setApiIntegrationIdentifier",t)}setMapId(t){this.setRequiredStateField("mapId","setMapId",t)}setRenderBeforeFirst(t){this.dispatch(this.slice.actions.setRenderBeforeFirst(t))}setRenderAfterLast(t){this.dispatch(this.slice.actions.setRenderAfterLast(t))}setVisibleTopics(t){this.dispatch(this.slice.actions.setVisibleTopics(t))}setLabels(t){this.dispatch(this.slice.actions.setLabels(t)),this.service&&(this.service.labels=t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,r){const i=await this.awaitService();let n=await(null!=r?i.getPage(r):i.getPageByTocId(t));this.dispatch(this.slice.actions.setCurrentPage(n),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){const e=await this.awaitService();let r=await e.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(r))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,r){this.store.getState()[t]!==r&&(this.dispatch(this.slice.actions[e](r)),this.reload())}reload(){const t=this.store.getState();return t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=wt.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setPagesToc(void 0),this.slice.actions.setCurrentPage(void 0)),this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,e,r;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getMap().then((t=>this.dispatch(this.slice.actions.setMap(t)))),null===(e=this.service)||void 0===e?void 0:e.getToc().then((t=>this.dispatch(this.slice.actions.setToc(t)))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.dispatch(this.slice.actions.setPagesToc(t))))])}catch(t){this.errorHandler&&this.errorHandler(t)}}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const jt=r.css`
|
|
1
|
+
!function(t,e,r,i){function n(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function o(t){return!!t&&!!t[q]}function s(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===V}(t)||Array.isArray(t)||!!t[W]||!!t.constructor[W]||h(t)||d(t))}function u(t,e,r){void 0===r&&(r=!1),0===a(t)?(r?Object.keys:z)(t).forEach((function(i){r&&"symbol"==typeof i||e(i,t[i],t)})):t.forEach((function(r,i){return e(i,r,t)}))}function a(t){var e=t[q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:h(t)?2:d(t)?3:0}function c(t,e){return 2===a(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function f(t,e,r){var i=a(t);2===i?t.set(e,r):3===i?(t.delete(e),t.add(r)):t[e]=r}function l(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function h(t){return L&&t instanceof Map}function d(t){return $&&t instanceof Set}function v(t){return t.o||t.t}function p(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=J(t);delete e[q];for(var r=z(e),i=0;i<r.length;i++){var n=r[i],o=e[n];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function b(t,e){return void 0===e&&(e=!1),g(t)||o(t)||!s(t)||(a(t)>1&&(t.set=t.add=t.clear=t.delete=y),Object.freeze(t),e&&u(t,(function(t,e){return b(e,!0)}),!0)),t}function y(){n(2)}function g(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function m(t){var e=X[t];return e||n(18,t),e}function w(){return k}function I(t,e){e&&(m("Patches"),t.u=[],t.s=[],t.v=e)}function j(t){O(t),t.p.forEach(A),t.p=null}function O(t){t===k&&(k=t.l)}function T(t){return k={p:[],l:k,h:t,m:!0,_:0}}function A(t){var e=t[q];0===e.i||1===e.i?e.j():e.O=!0}function P(t,e){e._=e.p.length;var r=e.p[0],i=void 0!==t&&t!==r;return e.h.g||m("ES5").S(e,t,i),i?(r[q].P&&(j(e),n(4)),s(t)&&(t=S(e,t),e.l||M(e,t)),e.u&&m("Patches").M(r[q].t,t,e.u,e.s)):t=S(e,r,[]),j(e),e.u&&e.v(e.u,e.s),t!==K?t:void 0}function S(t,e,r){if(g(e))return e;var i=e[q];if(!i)return u(e,(function(n,o){return E(t,i,e,n,o,r)}),!0),e;if(i.A!==t)return e;if(!i.P)return M(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=4===i.i||5===i.i?i.o=p(i.k):i.o;u(3===i.i?new Set(n):n,(function(e,o){return E(t,i,n,e,o,r)})),M(t,n,!1),r&&t.u&&m("Patches").R(i,r,t.u,t.s)}return i.o}function E(t,e,r,i,n,u){if(o(n)){var a=S(t,n,u&&e&&3!==e.i&&!c(e.D,i)?u.concat(i):void 0);if(f(r,i,a),!o(a))return;t.m=!1}if(s(n)&&!g(n)){if(!t.h.F&&t._<1)return;S(t,n),e&&e.A.l||M(t,n)}}function M(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&b(e,r)}function R(t,e){var r=t[q];return(r?v(r):t)[e]}function C(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Object.getPrototypeOf(r)}}function x(t){t.P||(t.P=!0,t.l&&x(t.l))}function N(t){t.o||(t.o=p(t.t))}function U(t,e,r){var i=h(e)?m("MapSet").N(e,r):d(e)?m("MapSet").T(e,r):t.g?function(t,e){var r=Array.isArray(t),i={i:r?1:0,A:e?e.A:w(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},n=i,o=Y;r&&(n=[i],o=H);var s=Proxy.revocable(n,o),u=s.revoke,a=s.proxy;return i.k=a,i.j=u,a}(e,r):m("ES5").J(e,r);return(r?r.A:w()).p.push(i),i}function _(t){return o(t)||n(22,t),function t(e){if(!s(e))return e;var r,i=e[q],n=a(e);if(i){if(!i.P&&(i.i<4||!m("ES5").K(i)))return i.t;i.I=!0,r=B(e,n),i.I=!1}else r=B(e,n);return u(r,(function(e,n){i&&function(t,e){return 2===a(t)?t.get(e):t[e]}(i.t,e)===n||f(r,e,t(n))})),3===n?new Set(r):r}(t)}function B(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return p(t)}var D,k,F="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),L="undefined"!=typeof Map,$="undefined"!=typeof Set,G="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,K=F?Symbol.for("immer-nothing"):((D={})["immer-nothing"]=!0,D),W=F?Symbol.for("immer-draftable"):"__$immer_draftable",q=F?Symbol.for("immer-state"):"__$immer_state",V=""+Object.prototype.constructor,z="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,J=Object.getOwnPropertyDescriptors||function(t){var e={};return z(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},X={},Y={get:function(t,e){if(e===q)return t;var r=v(t);if(!c(r,e))return function(t,e,r){var i,n=C(e,r);return n?"value"in n?n.value:null===(i=n.get)||void 0===i?void 0:i.call(t.k):void 0}(t,r,e);var i=r[e];return t.I||!s(i)?i:i===R(t.t,e)?(N(t),t.o[e]=U(t.A.h,i,t)):i},has:function(t,e){return e in v(t)},ownKeys:function(t){return Reflect.ownKeys(v(t))},set:function(t,e,r){var i=C(v(t),e);if(null==i?void 0:i.set)return i.set.call(t.k,r),!0;if(!t.P){var n=R(v(t),e),o=null==n?void 0:n[q];if(o&&o.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(l(r,n)&&(void 0!==r||c(t.t,e)))return!0;N(t),x(t)}return t.o[e]===r&&"number"!=typeof r&&(void 0!==r||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==R(t.t,e)||e in t.t?(t.D[e]=!1,N(t),x(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=v(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:i.enumerable,value:r[e]}:i},defineProperty:function(){n(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){n(12)}},H={};u(Y,(function(t,e){H[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),H.deleteProperty=function(t,e){return H.set.call(this,t,e,void 0)},H.set=function(t,e,r){return Y.set.call(this,t[0],e,r,t[0])};var Q=function(){function t(t){var e=this;this.g=G,this.F=!0,this.produce=function(t,r,i){if("function"==typeof t&&"function"!=typeof r){var o=r;r=t;var u=e;return function(t){var e=this;void 0===t&&(t=o);for(var i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return u.produce(t,(function(t){var i;return(i=r).call.apply(i,[e,t].concat(n))}))}}var a;if("function"!=typeof r&&n(6),void 0!==i&&"function"!=typeof i&&n(7),s(t)){var c=T(e),f=U(e,t,void 0),l=!0;try{a=r(f),l=!1}finally{l?j(c):O(c)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return I(c,i),P(t,c)}),(function(t){throw j(c),t})):(I(c,i),P(a,c))}if(!t||"object"!=typeof t){if(void 0===(a=r(t))&&(a=t),a===K&&(a=void 0),e.F&&b(a,!0),i){var h=[],d=[];m("Patches").M(t,a,h,d),i(h,d)}return a}n(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(n))}))};var i,n,o=e.produce(t,r,(function(t,e){i=t,n=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,i,n]})):[o,i,n]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){s(t)||n(8),o(t)&&(t=_(t));var e=T(this),r=U(this,t,void 0);return r[q].C=!0,O(e),r},e.finishDraft=function(t,e){var r=(t&&t[q]).A;return I(r,e),P(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!G&&n(20),this.g=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var i=e[r];if(0===i.path.length&&"replace"===i.op){t=i.value;break}}r>-1&&(e=e.slice(r+1));var n=m("Patches").$;return o(t)?n(t,e):this.produce(t,(function(t){return n(t,e)}))},t}(),Z=new Q,tt=Z.produce;Z.produceWithPatches.bind(Z),Z.setAutoFreeze.bind(Z),Z.setUseProxies.bind(Z),Z.applyPatches.bind(Z),Z.createDraft.bind(Z),Z.finishDraft.bind(Z);var et,rt=tt,it=(et=function(t,e){return et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},et(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}et(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nt=function(t,e){for(var r=0,i=e.length,n=t.length;r<i;r++,n++)t[n]=e[r];return t},ot=Object.defineProperty,st=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=function(t,e,r){return e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ft=function(t,e){for(var r in e||(e={}))ut.call(e,r)&&ct(t,r,e[r]);if(st)for(var i=0,n=st(e);i<n.length;i++){r=n[i];at.call(e,r)&&ct(t,r,e[r])}return t};function lt(t){return s(t)?rt(t,(function(){})):t}function ht(t,e){function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e){var n=e.apply(void 0,r);if(!n)throw new Error("prepareAction did not return an object");return ft(ft({type:t,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:t,payload:r[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(e){return e.type===t},r}function dt(t){var e,r={},i=[],n={addCase:function(t,e){var i="string"==typeof t?t:t.type;if(i in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[i]=e,n},addMatcher:function(t,e){return i.push({matcher:t,reducer:e}),n},addDefaultCase:function(t){return e=t,n}};return t(n),[r,i,e]}function vt(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var r,i="function"==typeof t.initialState?t.initialState:lt(t.initialState),n=t.reducers||{},u=Object.keys(n),a={},c={},f={};function l(){var e="function"==typeof t.extraReducers?dt(t.extraReducers):[t.extraReducers],r=e[0],n=void 0===r?{}:r,u=e[1],a=void 0===u?[]:u,f=e[2],l=void 0===f?void 0:f,h=ft(ft({},n),c);return function(t,e,r,i){void 0===r&&(r=[]);var n,u="function"==typeof e?dt(e):[e,r,i],a=u[0],c=u[1],f=u[2];if(function(t){return"function"==typeof t}(t))n=function(){return lt(t())};else{var l=lt(t);n=function(){return l}}function h(t,e){void 0===t&&(t=n());var r=nt([a[e.type]],c.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===r.filter((function(t){return!!t})).length&&(r=[f]),r.reduce((function(t,r){if(r){var i;if(o(t))return void 0===(i=r(t,e))?t:i;if(s(t))return rt(t,(function(t){return r(t,e)}));if(void 0===(i=r(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return t}),t)}return h.getInitialState=n,h}(i,h,a,l)}return u.forEach((function(t){var r,i,o=n[t],s=e+"/"+t;"reducer"in o?(r=o.reducer,i=o.prepare):r=o,a[t]=r,c[s]=r,f[t]=i?ht(s,i):ht(s)})),{name:e,reducer:function(t,e){return r||(r=l()),r(t,e)},actions:f,caseReducers:a,getInitialState:function(){return r||(r=l()),r.getInitialState()}}}!function(t){function e(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var n=t.apply(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}it(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,nt([void 0],t[0].concat(this)))):new(e.bind.apply(e,nt([void 0],t.concat(this))))}}(Array);var pt="listenerMiddleware";ht(pt+"/add"),ht(pt+"/removeAll"),ht(pt+"/remove"),function(){function t(t,e){var r=n[t];return r?r.enumerable=e:n[t]=r={configurable:!0,enumerable:e,get:function(){var e=this[q];return Y.get(e,t)},set:function(e){var r=this[q];Y.set(r,t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var n=t[e][q];if(!n.P)switch(n.i){case 5:i(n)&&x(n);break;case 4:r(n)&&x(n)}}}function r(t){for(var e=t.t,r=t.k,i=z(r),n=i.length-1;n>=0;n--){var o=i[n];if(o!==q){var s=e[o];if(void 0===s&&!c(e,o))return!0;var u=r[o],a=u&&u[q];if(a?a.t!==s:!l(u,s))return!0}}var f=!!e[q];return i.length!==z(e).length+(f?0:1)}function i(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);if(r&&!r.get)return!0;for(var i=0;i<e.length;i++)if(!e.hasOwnProperty(i))return!0;return!1}var n={};!function(t,e){X[t]||(X[t]=e)}("ES5",{J:function(e,r){var i=Array.isArray(e),n=function(e,r){if(e){for(var i=Array(r.length),n=0;n<r.length;n++)Object.defineProperty(i,""+n,t(n,!0));return i}var o=J(r);delete o[q];for(var s=z(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,e||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(i,e),o={i:i?5:4,A:r?r.A:w(),P:!1,I:!1,D:{},l:r,t:e,k:n,o:null,O:!1,C:!1};return Object.defineProperty(n,q,{value:o,writable:!0}),n},S:function(t,r,n){n?o(r)&&r[q].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[q];if(r){var n=r.t,o=r.k,s=r.D,a=r.i;if(4===a)u(o,(function(e){e!==q&&(void 0!==n[e]||c(n,e)?s[e]||t(o[e]):(s[e]=!0,x(r)))})),u(n,(function(t){void 0!==o[t]||c(o,t)||(s[t]=!1,x(r))}));else if(5===a){if(i(r)&&(x(r),s.length=!0),o.length<n.length)for(var f=o.length;f<n.length;f++)s[f]=!1;else for(var l=n.length;l<o.length;l++)s[l]=!0;for(var h=Math.min(o.length,n.length),d=0;d<h;d++)o.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&t(o[d])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):i(t)}})}();const bt={setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setMapId:(t,e)=>{t.mapId=e.payload},setTocId:(t,e)=>{t.tocId=e.payload},setMap:(t,e)=>{t.map=e.payload},setToc:(t,e)=>{t.toc=e.payload},setPagesToc:(t,e)=>{t.pagesToc=e.payload},setCurrentPage:(t,e)=>{t.currentPage=e.payload},setScrollTarget:(t,e)=>{t.scrollTarget=e.payload},setVisibleTopics:(t,e)=>{t.visibleTopics=e.payload},setRenderBeforeFirst:(t,e)=>{t.renderBeforeFirst=e.payload},setRenderAfterLast:(t,e)=>{t.renderAfterLast=e.payload},setLabels:(t,e)=>{t.labels=e.payload}},yt={topicMissingAdvice:"Sorry, this topic is missing",somethingWentWrong:"Oops, something went wrong"};class gt{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,r){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,r)),null==t.tocId?this.extractPagesToc(t.children,e,r):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,r){return t.flatMap((t=>{var i,n,o;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let s=null===(n=t.prettyUrl)||void 0===n?void 0:n.replace(/^\//,"");const u={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:s,depth:e,parentTocId:r,children:[]};this.register(u);const a=this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,u.tocId);return u.children=[...a,...c],[u]}))}convertSectionNodes(t,e,r){return t.flatMap((t=>{var i;let n=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const o={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:n,depth:e,parentTocId:r,children:[]};return this.register(o),o.children=this.convertSectionNodes(t.children,e+1,t.tocId),[o]}))}buildPage(t,e){var r,i,n,o,s,u;const a={number:this.pages.length+1,title:null!==(r=t.title)&&void 0!==r?r:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(n=t.pageToc)&&void 0!==n?n:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?a.topics:a.hiddenTopics).push(t),f=null!==(s=null===(o=t.pageConfiguration)||void 0===o?void 0:o.parentsVisibility)&&void 0!==s?s:[];return a.breadcrumb.forEach(((t,e)=>{c(t,f[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),a.topics.push(...this.tocIds(null!==(u=t.pageToc)&&void 0!==u?u:[])),a}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class mt{convertPaginatedToc(t){return new gt(t).build()}}class wt{constructor(t,r,i,n){this.converter=t,this.api=r,this.baseUrl=i,this.mapId=n,this.topics={},this.topicContents={},this.labelResolver=new e.ParametrizedLabelResolver(yt,{}),i.endsWith("/")||(this.baseUrl=i+"/")}static build(t,e,r){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");return new wt(new mt,new window.fluidtopics.FluidTopicsApi(t,e,!0),t,r)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={},this.ratingSummary=void 0}getMap(){return this.loadIfNeeded((()=>this.map),(t=>this.map=t),(()=>this.api.getMap(this.mapId)))}getEnrichedToc(){return this.loadIfNeeded((()=>this.enrichedToc),(t=>this.enrichedToc=t),(()=>this.api.getPages(this.mapId).then((t=>this.converter.convertPaginatedToc(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;if(!("boolean"==typeof this.enrichedToc||this.enrichedToc instanceof Error))return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(e=>this.topics[t]=e),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(e=>this.topicContents[t]=e),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,e,r){const i=this.getNavigationData(t,e,r),n="r/"+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),o=new URL(n,this.baseUrl);return null!=i.page&&o.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&o.searchParams.set("tocId",i.tocId),null!=i.section&&o.searchParams.set("section",i.section),o.href}getNavigationData(t,e,r){var i,n;t=t||"root";const o="object"==typeof this.enrichedToc?this.enrichedToc:void 0,s=null==o?void 0:o.pageByTocId[t],u=null==o?void 0:o.nodeByTocId[t],a=null==u?void 0:u.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(i=null==u?void 0:u.title)&&void 0!==i?i:"",page:e&&s&&s.number!==e?e:void 0,prettyUrl:null!=a?a.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(n=null==o?void 0:o.duplicatedPrettyUrls.has(null!=a?a:""))&&void 0!==n&&n,section:r}}async getAccurateNavigationData(t,e,r){return await this.getEnrichedToc(),this.getNavigationData(t,e,r)}async loadIfNeeded(t,r,i){for(void 0===t()&&(r(!0),r(await i().catch((t=>t))));!0===t();)await e.delay(10);const n=t();if(n instanceof Error)throw n;return n}set labels(t){this.labelResolver=new e.ParametrizedLabelResolver(yt,t)}resolveLabel(t,...e){return this.labelResolver.resolve(t,e)}getRatingSummary(){return this.loadIfNeeded((()=>this.ratingSummary),(t=>this.ratingSummary=t),(()=>this.api.getMapRating(this.mapId)))}getMapRating(){return this.getRatingSummary().then((t=>t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var r;return{type:e.topics.type,rating:null===(r=e.topics)||void 0===r?void 0:r.ratings.find((e=>e.tocId===t))}}))}rateMap(t,e){return this.api.rateMap(this.mapId,t,e).then((()=>this.ratingSummary=void 0))}unrateMap(){return this.api.unrateMap(this.mapId).then((()=>this.ratingSummary=void 0))}sendMapFeedback(t){return this.api.sendMapFeedback(this.mapId,t)}rateTopic(t,e,r){return this.api.rateTopic(this.mapId,t,e,r).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}sendTopicFeedback(t,e){return this.api.sendTopicFeedback(this.mapId,t,e)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}}class It{constructor(t,r){this.store=t,this.slice=r,this.reloadDebouncer=new e.Debouncer(10)}static build(t){const r=(t=>vt({name:"ft-reader-"+t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:"ft-reader",mapId:void 0,visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:bt}))(t.trim()||"context");return new It(e.getStore(r),r)}setBaseUrl(t){this.setRequiredStateField("baseUrl","setBaseUrl",t)}setApiIntegrationIdentifier(t){this.setRequiredStateField("apiIntegrationIdentifier","setApiIntegrationIdentifier",t)}setMapId(t){this.setRequiredStateField("mapId","setMapId",t)}setRenderBeforeFirst(t){this.dispatch(this.slice.actions.setRenderBeforeFirst(t))}setRenderAfterLast(t){this.dispatch(this.slice.actions.setRenderAfterLast(t))}setVisibleTopics(t){this.dispatch(this.slice.actions.setVisibleTopics(t))}setLabels(t){this.dispatch(this.slice.actions.setLabels(t)),this.service&&(this.service.labels=t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,r){const i=await this.awaitService();let n=await(null!=r?i.getPage(r):i.getPageByTocId(t));this.dispatch(this.slice.actions.setCurrentPage(n),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){const e=await this.awaitService();let r=await e.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(r))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,r){this.store.getState()[t]!==r&&(this.dispatch(this.slice.actions[e](r)),this.reload())}reload(){const t=this.store.getState();return t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=wt.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setPagesToc(void 0),this.slice.actions.setCurrentPage(void 0)),this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,e,r;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getMap().then((t=>this.dispatch(this.slice.actions.setMap(t)))),null===(e=this.service)||void 0===e?void 0:e.getToc().then((t=>this.dispatch(this.slice.actions.setToc(t)))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.dispatch(this.slice.actions.setPagesToc(t))))])}catch(t){this.errorHandler&&this.errorHandler(t)}}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const jt=r.css`
|
|
2
2
|
`;var Ot=function(t,e,r,i){for(var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i,u=t.length-1;u>=0;u--)(n=t[u])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};class Tt extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class At extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Pt extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class St extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class Et extends Event{constructor(){super("ft-reader-map-not-found")}}class Mt extends Event{constructor(){super("ft-reader-map-unauthorized")}}const Rt=t=>e=>+(null!=e?e:"NaN")>0?+e:t;class Ct extends e.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-reader",this.renderBeforeFirst=2,this.renderAfterLast=3,this.labels={},this.visibleTopics=[],this.navigationDebouncer=new e.Debouncer(5)}render(){return r.html`
|
|
3
3
|
${this.importStyleIfNeeded()}
|
|
4
4
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
@@ -78,7 +78,7 @@ function(t){return class extends t{createRenderRoot(){const t=this.constructor,{
|
|
|
78
78
|
-webkit-hyphens: auto;
|
|
79
79
|
hyphens: auto
|
|
80
80
|
}
|
|
81
|
-
`;class dt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,r;let n=null!==(r=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==r?r:"";return e.forEach(((t,e)=>n=n.replace(new RegExp(`\\{${e}\\}`,"g"),t))),n}}function vt(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(i.length?" "+i.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function pt(t){return!!t&&!!t[ee]}function bt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===ie}(t)||Array.isArray(t)||!!t[te]||!!t.constructor[te]||Ot(t)||Et(t))}function wt(t,e,i){void 0===i&&(i=!1),0===yt(t)?(i?Object.keys:re)(t).forEach((function(r){i&&"symbol"==typeof r||e(r,t[r],t)})):t.forEach((function(i,r){return e(r,i,t)}))}function yt(t){var e=t[ee];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Ot(t)?2:Et(t)?3:0}function mt(t,e){return 2===yt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function gt(t,e,i){var r=yt(t);2===r?t.set(e,i):3===r?(t.delete(e),t.add(i)):t[e]=i}function xt(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Ot(t){return Xt&&t instanceof Map}function Et(t){return Gt&&t instanceof Set}function jt(t){return t.o||t.t}function Nt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=ne(t);delete e[ee];for(var i=re(e),r=0;r<i.length;r++){var n=i[r],o=e[n];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function St(t,e){return void 0===e&&(e=!1),Ct(t)||pt(t)||!bt(t)||(yt(t)>1&&(t.set=t.add=t.clear=t.delete=Rt),Object.freeze(t),e&&wt(t,(function(t,e){return St(e,!0)}),!0)),t}function Rt(){vt(2)}function Ct(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function Mt(t){var e=oe[t];return e||vt(18,t),e}function At(){return Zt}function Tt(t,e){e&&(Mt("Patches"),t.u=[],t.s=[],t.v=e)}function It(t){Ut(t),t.p.forEach(kt),t.p=null}function Ut(t){t===Zt&&(Zt=t.l)}function $t(t){return Zt={p:[],l:Zt,h:t,m:!0,_:0}}function kt(t){var e=t[ee];0===e.i||1===e.i?e.j():e.O=!0}function Ft(t,e){e._=e.p.length;var i=e.p[0],r=void 0!==t&&t!==i;return e.h.g||Mt("ES5").S(e,t,r),r?(i[ee].P&&(It(e),vt(4)),bt(t)&&(t=Pt(e,t),e.l||Bt(e,t)),e.u&&Mt("Patches").M(i[ee].t,t,e.u,e.s)):t=Pt(e,i,[]),It(e),e.u&&e.v(e.u,e.s),t!==Qt?t:void 0}function Pt(t,e,i){if(Ct(e))return e;var r=e[ee];if(!r)return wt(e,(function(n,o){return Lt(t,r,e,n,o,i)}),!0),e;if(r.A!==t)return e;if(!r.P)return Bt(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var n=4===r.i||5===r.i?r.o=Nt(r.k):r.o;wt(3===r.i?new Set(n):n,(function(e,o){return Lt(t,r,n,e,o,i)})),Bt(t,n,!1),i&&t.u&&Mt("Patches").R(r,i,t.u,t.s)}return r.o}function Lt(t,e,i,r,n,o){if(pt(n)){var s=Pt(t,n,o&&e&&3!==e.i&&!mt(e.D,r)?o.concat(r):void 0);if(gt(i,r,s),!pt(s))return;t.m=!1}if(bt(n)&&!Ct(n)){if(!t.h.F&&t._<1)return;Pt(t,n),e&&e.A.l||Bt(t,n)}}function Bt(t,e,i){void 0===i&&(i=!1),t.h.F&&t.m&&St(e,i)}function _t(t,e){var i=t[ee];return(i?jt(i):t)[e]}function Wt(t,e){if(e in t)for(var i=Object.getPrototypeOf(t);i;){var r=Object.getOwnPropertyDescriptor(i,e);if(r)return r;i=Object.getPrototypeOf(i)}}function Dt(t){t.P||(t.P=!0,t.l&&Dt(t.l))}function Kt(t){t.o||(t.o=Nt(t.t))}function Ht(t,e,i){var r=Ot(e)?Mt("MapSet").N(e,i):Et(e)?Mt("MapSet").T(e,i):t.g?function(t,e){var i=Array.isArray(t),r={i:i?1:0,A:e?e.A:At(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},n=r,o=se;i&&(n=[r],o=ae);var s=Proxy.revocable(n,o),a=s.revoke,u=s.proxy;return r.k=u,r.j=a,u}(e,i):Mt("ES5").J(e,i);return(i?i.A:At()).p.push(r),r}function zt(t){return pt(t)||vt(22,t),function t(e){if(!bt(e))return e;var i,r=e[ee],n=yt(e);if(r){if(!r.P&&(r.i<4||!Mt("ES5").K(r)))return r.t;r.I=!0,i=Jt(e,n),r.I=!1}else i=Jt(e,n);return wt(i,(function(e,n){r&&function(t,e){return 2===yt(t)?t.get(e):t[e]}(r.t,e)===n||gt(i,e,t(n))})),3===n?new Set(i):i}(t)}function Jt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Nt(t)}var Vt,Zt,qt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Xt="undefined"!=typeof Map,Gt="undefined"!=typeof Set,Yt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Qt=qt?Symbol.for("immer-nothing"):((Vt={})["immer-nothing"]=!0,Vt),te=qt?Symbol.for("immer-draftable"):"__$immer_draftable",ee=qt?Symbol.for("immer-state"):"__$immer_state",ie=""+Object.prototype.constructor,re="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ne=Object.getOwnPropertyDescriptors||function(t){var e={};return re(t).forEach((function(i){e[i]=Object.getOwnPropertyDescriptor(t,i)})),e},oe={},se={get:function(t,e){if(e===ee)return t;var i=jt(t);if(!mt(i,e))return function(t,e,i){var r,n=Wt(e,i);return n?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(t.k):void 0}(t,i,e);var r=i[e];return t.I||!bt(r)?r:r===_t(t.t,e)?(Kt(t),t.o[e]=Ht(t.A.h,r,t)):r},has:function(t,e){return e in jt(t)},ownKeys:function(t){return Reflect.ownKeys(jt(t))},set:function(t,e,i){var r=Wt(jt(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,i),!0;if(!t.P){var n=_t(jt(t),e),o=null==n?void 0:n[ee];if(o&&o.t===i)return t.o[e]=i,t.D[e]=!1,!0;if(xt(i,n)&&(void 0!==i||mt(t.t,e)))return!0;Kt(t),Dt(t)}return t.o[e]===i&&"number"!=typeof i&&(void 0!==i||e in t.o)||(t.o[e]=i,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==_t(t.t,e)||e in t.t?(t.D[e]=!1,Kt(t),Dt(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var i=jt(t),r=Reflect.getOwnPropertyDescriptor(i,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:i[e]}:r},defineProperty:function(){vt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){vt(12)}},ae={};wt(se,(function(t,e){ae[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),ae.deleteProperty=function(t,e){return ae.set.call(this,t,e,void 0)},ae.set=function(t,e,i){return se.set.call(this,t[0],e,i,t[0])};var ue=function(){function t(t){var e=this;this.g=Yt,this.F=!0,this.produce=function(t,i,r){if("function"==typeof t&&"function"!=typeof i){var n=i;i=t;var o=e;return function(t){var e=this;void 0===t&&(t=n);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return o.produce(t,(function(t){var r;return(r=i).call.apply(r,[e,t].concat(s))}))}}var s;if("function"!=typeof i&&vt(6),void 0!==r&&"function"!=typeof r&&vt(7),bt(t)){var a=$t(e),u=Ht(e,t,void 0),c=!0;try{s=i(u),c=!1}finally{c?It(a):Ut(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Tt(a,r),Ft(t,a)}),(function(t){throw It(a),t})):(Tt(a,r),Ft(s,a))}if(!t||"object"!=typeof t){if(void 0===(s=i(t))&&(s=t),s===Qt&&(s=void 0),e.F&&St(s,!0),r){var l=[],h=[];Mt("Patches").M(t,s,l,h),r(l,h)}return s}vt(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e.produceWithPatches(i,(function(e){return t.apply(void 0,[e].concat(n))}))};var r,n,o=e.produce(t,i,(function(t,e){r=t,n=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,r,n]})):[o,r,n]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){bt(t)||vt(8),pt(t)&&(t=zt(t));var e=$t(this),i=Ht(this,t,void 0);return i[ee].C=!0,Ut(e),i},e.finishDraft=function(t,e){var i=(t&&t[ee]).A;return Tt(i,e),Ft(void 0,i)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!Yt&&vt(20),this.g=t},e.applyPatches=function(t,e){var i;for(i=e.length-1;i>=0;i--){var r=e[i];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}i>-1&&(e=e.slice(i+1));var n=Mt("Patches").$;return pt(t)?n(t,e):this.produce(t,(function(t){return n(t,e)}))},t}(),ce=new ue,le=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseProxies.bind(ce),ce.applyPatches.bind(ce),ce.createDraft.bind(ce),ce.finishDraft.bind(ce);var he=le;function fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function de(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function ve(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?de(Object(i),!0).forEach((function(e){fe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function pe(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var be="function"==typeof Symbol&&Symbol.observable||"@@observable",we=function(){return Math.random().toString(36).substring(7).split("").join(".")},ye={INIT:"@@redux/INIT"+we(),REPLACE:"@@redux/REPLACE"+we(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+we()}};function me(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ge(t,e,i){var r;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(pe(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(pe(1));return i(ge)(t,e)}if("function"!=typeof t)throw new Error(pe(2));var n=t,o=e,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error(pe(3));return o}function h(t){if("function"!=typeof t)throw new Error(pe(4));if(u)throw new Error(pe(5));var e=!0;return c(),a.push(t),function(){if(e){if(u)throw new Error(pe(6));e=!1,c();var i=a.indexOf(t);a.splice(i,1),s=null}}}function f(t){if(!me(t))throw new Error(pe(7));if(void 0===t.type)throw new Error(pe(8));if(u)throw new Error(pe(9));try{u=!0,o=n(o,t)}finally{u=!1}for(var e=s=a,i=0;i<e.length;i++){(0,e[i])()}return t}function d(t){if("function"!=typeof t)throw new Error(pe(10));n=t,f({type:ye.REPLACE})}function v(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(pe(11));function i(){t.next&&t.next(l())}return i(),{unsubscribe:e(i)}}})[be]=function(){return this},t}return f({type:ye.INIT}),(r={dispatch:f,subscribe:h,getState:l,replaceReducer:d})[be]=v,r}function xe(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++){var n=e[r];"function"==typeof t[n]&&(i[n]=t[n])}var o,s=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ye.INIT}))throw new Error(pe(12));if(void 0===i(void 0,{type:ye.PROBE_UNKNOWN_ACTION()}))throw new Error(pe(13))}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var r=!1,n={},a=0;a<s.length;a++){var u=s[a],c=i[u],l=t[u],h=c(l,e);if(void 0===h)throw e&&e.type,new Error(pe(14));n[u]=h,r=r||h!==l}return(r=r||s.length!==Object.keys(t).length)?n:t}}function Oe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Ee(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),r=function(){throw new Error(pe(15))},n={getState:i.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(n)}));return r=Oe.apply(void 0,o)(i.dispatch),ve(ve({},i),{},{dispatch:r})}}}function je(t){return function(e){var i=e.dispatch,r=e.getState;return function(e){return function(n){return"function"==typeof n?n(i,r,t):e(n)}}}}var Ne=je();Ne.withExtraArgument=je;var Se,Re=Ne,Ce=(Se=function(t,e){return Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},Se(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Se(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Me=function(t,e){for(var i=0,r=e.length,n=t.length;i<r;i++,n++)t[n]=e[i];return t},Ae=Object.defineProperty,Te=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,$e=function(t,e,i){return e in t?Ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},ke=function(t,e){for(var i in e||(e={}))Ie.call(e,i)&&$e(t,i,e[i]);if(Te)for(var r=0,n=Te(e);r<n.length;r++){i=n[r];Ue.call(e,i)&&$e(t,i,e[i])}return t},Fe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Oe:Oe.apply(null,arguments)};var Pe=function(t){function e(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var n=t.apply(this,i)||this;return Object.setPrototypeOf(n,e.prototype),n}return Ce(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,Me([void 0],t[0].concat(this)))):new(e.bind.apply(e,Me([void 0],t.concat(this))))},e}(Array);function Le(t){return bt(t)?he(t,(function(){})):t}function Be(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,i=void 0===e||e;t.immutableCheck,t.serializableCheck;var r=new Pe;i&&(!function(t){return"boolean"==typeof t}(i)?r.push(Re.withExtraArgument(i.extraArgument)):r.push(Re));return r}(t)}}function _e(t){var e,i=Be(),r=t||{},n=r.reducer,o=void 0===n?void 0:n,s=r.middleware,a=void 0===s?i():s,u=r.devTools,c=void 0===u||u,l=r.preloadedState,h=void 0===l?void 0:l,f=r.enhancers,d=void 0===f?void 0:f;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var i=e;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return e===i}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=xe(o)}var v=a;"function"==typeof v&&(v=v(i));var p=Ee.apply(void 0,v),b=Oe;c&&(b=Fe(ke({trace:!1},"object"==typeof c&&c)));var w=[p];return Array.isArray(d)?w=Me([p],d):"function"==typeof d&&(w=d(w)),ge(e,h,b.apply(void 0,w))}function We(t,e){function i(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e){var n=e.apply(void 0,i);if(!n)throw new Error("prepareAction did not return an object");return ke(ke({type:t,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(e){return e.type===t},i}function De(t){var e,i={},r=[],n={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[r]=e,n},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),n},addDefaultCase:function(t){return e=t,n}};return t(n),[i,r,e]}function Ke(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var i,r="function"==typeof t.initialState?t.initialState:Le(t.initialState),n=t.reducers||{},o=Object.keys(n),s={},a={},u={};function c(){var e="function"==typeof t.extraReducers?De(t.extraReducers):[t.extraReducers],i=e[0],n=void 0===i?{}:i,o=e[1],s=void 0===o?[]:o,u=e[2],c=void 0===u?void 0:u,l=ke(ke({},n),a);return function(t,e,i,r){void 0===i&&(i=[]);var n,o="function"==typeof e?De(e):[e,i,r],s=o[0],a=o[1],u=o[2];if(function(t){return"function"==typeof t}(t))n=function(){return Le(t())};else{var c=Le(t);n=function(){return c}}function l(t,e){void 0===t&&(t=n());var i=Me([s[e.type]],a.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[u]),i.reduce((function(t,i){if(i){var r;if(pt(t))return void 0===(r=i(t,e))?t:r;if(bt(t))return he(t,(function(t){return i(t,e)}));if(void 0===(r=i(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return l.getInitialState=n,l}(r,l,s,c)}return o.forEach((function(t){var i,r,o=n[t],c=e+"/"+t;"reducer"in o?(i=o.reducer,r=o.prepare):i=o,s[t]=i,a[c]=i,u[t]=r?We(c,r):We(c)})),{name:e,reducer:function(t,e){return i||(i=c()),i(t,e)},actions:u,caseReducers:s,getInitialState:function(){return i||(i=c()),i.getInitialState()}}}var He="listenerMiddleware";We(He+"/add"),We(He+"/removeAll"),We(He+"/remove"),function(){function t(t,e){var i=n[t];return i?i.enumerable=e:n[t]=i={configurable:!0,enumerable:e,get:function(){var e=this[ee];return se.get(e,t)},set:function(e){var i=this[ee];se.set(i,t,e)}},i}function e(t){for(var e=t.length-1;e>=0;e--){var n=t[e][ee];if(!n.P)switch(n.i){case 5:r(n)&&Dt(n);break;case 4:i(n)&&Dt(n)}}}function i(t){for(var e=t.t,i=t.k,r=re(i),n=r.length-1;n>=0;n--){var o=r[n];if(o!==ee){var s=e[o];if(void 0===s&&!mt(e,o))return!0;var a=i[o],u=a&&a[ee];if(u?u.t!==s:!xt(a,s))return!0}}var c=!!e[ee];return r.length!==re(e).length+(c?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(e,e.length-1);if(i&&!i.get)return!0;for(var r=0;r<e.length;r++)if(!e.hasOwnProperty(r))return!0;return!1}var n={};!function(t,e){oe[t]||(oe[t]=e)}("ES5",{J:function(e,i){var r=Array.isArray(e),n=function(e,i){if(e){for(var r=Array(i.length),n=0;n<i.length;n++)Object.defineProperty(r,""+n,t(n,!0));return r}var o=ne(i);delete o[ee];for(var s=re(o),a=0;a<s.length;a++){var u=s[a];o[u]=t(u,e||!!o[u].enumerable)}return Object.create(Object.getPrototypeOf(i),o)}(r,e),o={i:r?5:4,A:i?i.A:At(),P:!1,I:!1,D:{},l:i,t:e,k:n,o:null,O:!1,C:!1};return Object.defineProperty(n,ee,{value:o,writable:!0}),n},S:function(t,i,n){n?pt(i)&&i[ee].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var i=e[ee];if(i){var n=i.t,o=i.k,s=i.D,a=i.i;if(4===a)wt(o,(function(e){e!==ee&&(void 0!==n[e]||mt(n,e)?s[e]||t(o[e]):(s[e]=!0,Dt(i)))})),wt(n,(function(t){void 0!==o[t]||mt(o,t)||(s[t]=!1,Dt(i))}));else if(5===a){if(r(i)&&(Dt(i),s.length=!0),o.length<n.length)for(var u=o.length;u<n.length;u++)s[u]=!1;else for(var c=n.length;c<o.length;c++)s[c]=!0;for(var l=Math.min(o.length,n.length),h=0;h<l;h++)o.hasOwnProperty(h)||(s[h]=!0),void 0===s[h]&&t(o[h])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?i(t):r(t)}})}();const ze=(t,e)=>(i,r)=>{i.constructor.createProperty(r,{attribute:!1,hasChanged:null!=e?e:(t,e)=>!s(t,e)});const n=i;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(r,null!=t?t:t=>t[r])};class Je extends ft{get store(){return this.internalStore}set store(t){this.internalStore=t,this.store&&this.setupStore()}updateFromStore(){const t=this.store.getState();this.reduxProperties&&this.reduxProperties.forEach(((e,i)=>{this[i]=e(t,this)}))}setupStore(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.updateFromStore(),this.unsubscribeFromStore=this.store.subscribe((()=>{this.updateFromStore()})),this.onStoreAvailable(),this.requestUpdate()}onStoreAvailable(){}connectedCallback(){super.connectedCallback(),this.store&&this.setupStore()}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),super.disconnectedCallback()}}var Ve,Ze;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ze=null===(Ve=window.safari)||void 0===Ve?void 0:Ve.pushNotification)||void 0===Ze||Ze.toString());const qe={setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setMapId:(t,e)=>{t.mapId=e.payload},setTocId:(t,e)=>{t.tocId=e.payload},setMap:(t,e)=>{t.map=e.payload},setToc:(t,e)=>{t.toc=e.payload},setPagesToc:(t,e)=>{t.pagesToc=e.payload},setCurrentPage:(t,e)=>{t.currentPage=e.payload},setScrollTarget:(t,e)=>{t.scrollTarget=e.payload},setVisibleTopics:(t,e)=>{t.visibleTopics=e.payload},setRenderBeforeFirst:(t,e)=>{t.renderBeforeFirst=e.payload},setRenderAfterLast:(t,e)=>{t.renderAfterLast=e.payload},setLabels:(t,e)=>{t.labels=e.payload}},Xe={topicMissingAdvice:"Sorry, this topic is missing",somethingWentWrong:"Oops, something went wrong"};class Ge{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var r,n,o;if(null==t.tocId)return[...this.convertSectionNodes(null!==(r=t.pageToc)&&void 0!==r?r:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let s=null===(n=t.prettyUrl)||void 0===n?void 0:n.replace(/^\//,"");const a={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:s,depth:e,parentTocId:i,children:[]};this.register(a);const u=this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,a.tocId);return a.children=[...u,...c],[a]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var r;let n=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const o={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:n,depth:e,parentTocId:i,children:[]};return this.register(o),o.children=this.convertSectionNodes(t.children,e+1,t.tocId),[o]}))}buildPage(t,e){var i,r,n,o,s,a;const u={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(r=t.tocId)&&void 0!==r?r:"root",toc:(null!==(n=t.pageToc)&&void 0!==n?n:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?u.topics:u.hiddenTopics).push(t),l=null!==(s=null===(o=t.pageConfiguration)||void 0===o?void 0:o.parentsVisibility)&&void 0!==s?s:[];return u.breadcrumb.forEach(((t,e)=>{c(t,l[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),u.topics.push(...this.tocIds(null!==(a=t.pageToc)&&void 0!==a?a:[])),u}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class Ye{convertPaginatedToc(t){return new Ge(t).build()}}class Qe{constructor(t,e,i,r){this.converter=t,this.api=e,this.baseUrl=i,this.mapId=r,this.topics={},this.topicContents={},this.labelResolver=new dt(Xe,{}),i.endsWith("/")||(this.baseUrl=i+"/")}static build(t,e,i){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");return new Qe(new Ye,new window.fluidtopics.FluidTopicsApi(t,e,!0),t,i)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={},this.ratingSummary=void 0}getMap(){return this.loadIfNeeded((()=>this.map),(t=>this.map=t),(()=>this.api.getMap(this.mapId)))}getEnrichedToc(){return this.loadIfNeeded((()=>this.enrichedToc),(t=>this.enrichedToc=t),(()=>this.api.getPages(this.mapId).then((t=>this.converter.convertPaginatedToc(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;if(!("boolean"==typeof this.enrichedToc||this.enrichedToc instanceof Error))return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(e=>this.topics[t]=e),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(e=>this.topicContents[t]=e),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,e,i){const r=this.getNavigationData(t,e,i),n="r/"+(r.prettyUrl?r.prettyUrl:`${r.mapId}/${r.tocId}`),o=new URL(n,this.baseUrl);return null!=r.page&&o.searchParams.set("page",`${r.page}`),r.prettyUrlDuplicated&&o.searchParams.set("tocId",r.tocId),null!=r.section&&o.searchParams.set("section",r.section),o.href}getNavigationData(t,e,i){var r,n;t=t||"root";const o="object"==typeof this.enrichedToc?this.enrichedToc:void 0,s=null==o?void 0:o.pageByTocId[t],a=null==o?void 0:o.nodeByTocId[t],u=null==a?void 0:a.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(r=null==a?void 0:a.title)&&void 0!==r?r:"",page:e&&s&&s.number!==e?e:void 0,prettyUrl:null!=u?u.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(n=null==o?void 0:o.duplicatedPrettyUrls.has(null!=u?u:""))&&void 0!==n&&n,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}async loadIfNeeded(t,e,i){for(void 0===t()&&(e(!0),e(await i().catch((t=>t))));!0===t();)await a(10);const r=t();if(r instanceof Error)throw r;return r}set labels(t){this.labelResolver=new dt(Xe,t)}resolveLabel(t,...e){return this.labelResolver.resolve(t,e)}getRatingSummary(){return this.loadIfNeeded((()=>this.ratingSummary),(t=>this.ratingSummary=t),(()=>this.api.getMapRating(this.mapId)))}getMapRating(){return this.getRatingSummary().then((t=>t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}}))}rateMap(t,e){return this.api.rateMap(this.mapId,t,e).then((()=>this.ratingSummary=void 0))}unrateMap(){return this.api.unrateMap(this.mapId).then((()=>this.ratingSummary=void 0))}sendMapFeedback(t){return this.api.sendMapFeedback(this.mapId,t)}rateTopic(t,e,i){return this.api.rateTopic(this.mapId,t,e,i).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}sendTopicFeedback(t,e){return this.api.sendTopicFeedback(this.mapId,t,e)}fontsStylesheet(){return this.api.endpoints.stylesheets.fonts}themeStylesheet(){return this.api.endpoints.stylesheets.theme}}class ti{constructor(t,i){this.store=t,this.slice=i,this.reloadDebouncer=new e(10)}static build(t){const e=(t=>Ke({name:"ft-reader-"+t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:"ft-reader",mapId:void 0,visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:qe}))(t.trim()||"context");return new ti(function(t,e,i){window.ftReduxStores||(window.ftReduxStores={});const r=e||t.name;return window.ftReduxStores[r]||(window.ftReduxStores[r]=_e({reducer:t.reducer})),window.ftReduxStores[r]}(e),e)}setBaseUrl(t){this.setRequiredStateField("baseUrl","setBaseUrl",t)}setApiIntegrationIdentifier(t){this.setRequiredStateField("apiIntegrationIdentifier","setApiIntegrationIdentifier",t)}setMapId(t){this.setRequiredStateField("mapId","setMapId",t)}setRenderBeforeFirst(t){this.dispatch(this.slice.actions.setRenderBeforeFirst(t))}setRenderAfterLast(t){this.dispatch(this.slice.actions.setRenderAfterLast(t))}setVisibleTopics(t){this.dispatch(this.slice.actions.setVisibleTopics(t))}setLabels(t){this.dispatch(this.slice.actions.setLabels(t)),this.service&&(this.service.labels=t)}async awaitService(){for(;null==this.service;)await a(5);return this.service}async navigateToTopic(t,e,i){const r=await this.awaitService();let n=await(null!=i?r.getPage(i):r.getPageByTocId(t));this.dispatch(this.slice.actions.setCurrentPage(n),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(i))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,i){this.store.getState()[t]!==i&&(this.dispatch(this.slice.actions[e](i)),this.reload())}reload(){const t=this.store.getState();return t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=Qe.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setPagesToc(void 0),this.slice.actions.setCurrentPage(void 0)),this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,e,i;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getMap().then((t=>this.dispatch(this.slice.actions.setMap(t)))),null===(e=this.service)||void 0===e?void 0:e.getToc().then((t=>this.dispatch(this.slice.actions.setToc(t)))),null===(i=this.service)||void 0===i?void 0:i.getPagesToc().then((t=>this.dispatch(this.slice.actions.setPagesToc(t))))])}catch(t){this.errorHandler&&this.errorHandler(t)}}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const ei=v`
|
|
81
|
+
`;class dt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,r;let n=null!==(r=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==r?r:"";return e.forEach(((t,e)=>n=n.replace(new RegExp(`\\{${e}\\}`,"g"),t))),n}}function vt(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(i.length?" "+i.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function pt(t){return!!t&&!!t[ee]}function bt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===ie}(t)||Array.isArray(t)||!!t[te]||!!t.constructor[te]||Ot(t)||Et(t))}function wt(t,e,i){void 0===i&&(i=!1),0===yt(t)?(i?Object.keys:re)(t).forEach((function(r){i&&"symbol"==typeof r||e(r,t[r],t)})):t.forEach((function(i,r){return e(r,i,t)}))}function yt(t){var e=t[ee];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Ot(t)?2:Et(t)?3:0}function mt(t,e){return 2===yt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function gt(t,e,i){var r=yt(t);2===r?t.set(e,i):3===r?(t.delete(e),t.add(i)):t[e]=i}function xt(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Ot(t){return Xt&&t instanceof Map}function Et(t){return Gt&&t instanceof Set}function jt(t){return t.o||t.t}function Nt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=ne(t);delete e[ee];for(var i=re(e),r=0;r<i.length;r++){var n=i[r],o=e[n];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[n]})}return Object.create(Object.getPrototypeOf(t),e)}function St(t,e){return void 0===e&&(e=!1),Ct(t)||pt(t)||!bt(t)||(yt(t)>1&&(t.set=t.add=t.clear=t.delete=Rt),Object.freeze(t),e&&wt(t,(function(t,e){return St(e,!0)}),!0)),t}function Rt(){vt(2)}function Ct(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function Mt(t){var e=oe[t];return e||vt(18,t),e}function At(){return Zt}function Tt(t,e){e&&(Mt("Patches"),t.u=[],t.s=[],t.v=e)}function It(t){Ut(t),t.p.forEach(kt),t.p=null}function Ut(t){t===Zt&&(Zt=t.l)}function $t(t){return Zt={p:[],l:Zt,h:t,m:!0,_:0}}function kt(t){var e=t[ee];0===e.i||1===e.i?e.j():e.O=!0}function Ft(t,e){e._=e.p.length;var i=e.p[0],r=void 0!==t&&t!==i;return e.h.g||Mt("ES5").S(e,t,r),r?(i[ee].P&&(It(e),vt(4)),bt(t)&&(t=Pt(e,t),e.l||Bt(e,t)),e.u&&Mt("Patches").M(i[ee].t,t,e.u,e.s)):t=Pt(e,i,[]),It(e),e.u&&e.v(e.u,e.s),t!==Qt?t:void 0}function Pt(t,e,i){if(Ct(e))return e;var r=e[ee];if(!r)return wt(e,(function(n,o){return Lt(t,r,e,n,o,i)}),!0),e;if(r.A!==t)return e;if(!r.P)return Bt(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var n=4===r.i||5===r.i?r.o=Nt(r.k):r.o;wt(3===r.i?new Set(n):n,(function(e,o){return Lt(t,r,n,e,o,i)})),Bt(t,n,!1),i&&t.u&&Mt("Patches").R(r,i,t.u,t.s)}return r.o}function Lt(t,e,i,r,n,o){if(pt(n)){var s=Pt(t,n,o&&e&&3!==e.i&&!mt(e.D,r)?o.concat(r):void 0);if(gt(i,r,s),!pt(s))return;t.m=!1}if(bt(n)&&!Ct(n)){if(!t.h.F&&t._<1)return;Pt(t,n),e&&e.A.l||Bt(t,n)}}function Bt(t,e,i){void 0===i&&(i=!1),t.h.F&&t.m&&St(e,i)}function _t(t,e){var i=t[ee];return(i?jt(i):t)[e]}function Wt(t,e){if(e in t)for(var i=Object.getPrototypeOf(t);i;){var r=Object.getOwnPropertyDescriptor(i,e);if(r)return r;i=Object.getPrototypeOf(i)}}function Dt(t){t.P||(t.P=!0,t.l&&Dt(t.l))}function Kt(t){t.o||(t.o=Nt(t.t))}function Ht(t,e,i){var r=Ot(e)?Mt("MapSet").N(e,i):Et(e)?Mt("MapSet").T(e,i):t.g?function(t,e){var i=Array.isArray(t),r={i:i?1:0,A:e?e.A:At(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},n=r,o=se;i&&(n=[r],o=ae);var s=Proxy.revocable(n,o),a=s.revoke,u=s.proxy;return r.k=u,r.j=a,u}(e,i):Mt("ES5").J(e,i);return(i?i.A:At()).p.push(r),r}function zt(t){return pt(t)||vt(22,t),function t(e){if(!bt(e))return e;var i,r=e[ee],n=yt(e);if(r){if(!r.P&&(r.i<4||!Mt("ES5").K(r)))return r.t;r.I=!0,i=Jt(e,n),r.I=!1}else i=Jt(e,n);return wt(i,(function(e,n){r&&function(t,e){return 2===yt(t)?t.get(e):t[e]}(r.t,e)===n||gt(i,e,t(n))})),3===n?new Set(i):i}(t)}function Jt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Nt(t)}var Vt,Zt,qt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Xt="undefined"!=typeof Map,Gt="undefined"!=typeof Set,Yt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Qt=qt?Symbol.for("immer-nothing"):((Vt={})["immer-nothing"]=!0,Vt),te=qt?Symbol.for("immer-draftable"):"__$immer_draftable",ee=qt?Symbol.for("immer-state"):"__$immer_state",ie=""+Object.prototype.constructor,re="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ne=Object.getOwnPropertyDescriptors||function(t){var e={};return re(t).forEach((function(i){e[i]=Object.getOwnPropertyDescriptor(t,i)})),e},oe={},se={get:function(t,e){if(e===ee)return t;var i=jt(t);if(!mt(i,e))return function(t,e,i){var r,n=Wt(e,i);return n?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(t.k):void 0}(t,i,e);var r=i[e];return t.I||!bt(r)?r:r===_t(t.t,e)?(Kt(t),t.o[e]=Ht(t.A.h,r,t)):r},has:function(t,e){return e in jt(t)},ownKeys:function(t){return Reflect.ownKeys(jt(t))},set:function(t,e,i){var r=Wt(jt(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,i),!0;if(!t.P){var n=_t(jt(t),e),o=null==n?void 0:n[ee];if(o&&o.t===i)return t.o[e]=i,t.D[e]=!1,!0;if(xt(i,n)&&(void 0!==i||mt(t.t,e)))return!0;Kt(t),Dt(t)}return t.o[e]===i&&"number"!=typeof i&&(void 0!==i||e in t.o)||(t.o[e]=i,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==_t(t.t,e)||e in t.t?(t.D[e]=!1,Kt(t),Dt(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var i=jt(t),r=Reflect.getOwnPropertyDescriptor(i,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:i[e]}:r},defineProperty:function(){vt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){vt(12)}},ae={};wt(se,(function(t,e){ae[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),ae.deleteProperty=function(t,e){return ae.set.call(this,t,e,void 0)},ae.set=function(t,e,i){return se.set.call(this,t[0],e,i,t[0])};var ue=function(){function t(t){var e=this;this.g=Yt,this.F=!0,this.produce=function(t,i,r){if("function"==typeof t&&"function"!=typeof i){var n=i;i=t;var o=e;return function(t){var e=this;void 0===t&&(t=n);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return o.produce(t,(function(t){var r;return(r=i).call.apply(r,[e,t].concat(s))}))}}var s;if("function"!=typeof i&&vt(6),void 0!==r&&"function"!=typeof r&&vt(7),bt(t)){var a=$t(e),u=Ht(e,t,void 0),c=!0;try{s=i(u),c=!1}finally{c?It(a):Ut(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Tt(a,r),Ft(t,a)}),(function(t){throw It(a),t})):(Tt(a,r),Ft(s,a))}if(!t||"object"!=typeof t){if(void 0===(s=i(t))&&(s=t),s===Qt&&(s=void 0),e.F&&St(s,!0),r){var l=[],h=[];Mt("Patches").M(t,s,l,h),r(l,h)}return s}vt(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e.produceWithPatches(i,(function(e){return t.apply(void 0,[e].concat(n))}))};var r,n,o=e.produce(t,i,(function(t,e){r=t,n=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,r,n]})):[o,r,n]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){bt(t)||vt(8),pt(t)&&(t=zt(t));var e=$t(this),i=Ht(this,t,void 0);return i[ee].C=!0,Ut(e),i},e.finishDraft=function(t,e){var i=(t&&t[ee]).A;return Tt(i,e),Ft(void 0,i)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!Yt&&vt(20),this.g=t},e.applyPatches=function(t,e){var i;for(i=e.length-1;i>=0;i--){var r=e[i];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}i>-1&&(e=e.slice(i+1));var n=Mt("Patches").$;return pt(t)?n(t,e):this.produce(t,(function(t){return n(t,e)}))},t}(),ce=new ue,le=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseProxies.bind(ce),ce.applyPatches.bind(ce),ce.createDraft.bind(ce),ce.finishDraft.bind(ce);var he=le;function fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function de(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function ve(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?de(Object(i),!0).forEach((function(e){fe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function pe(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var be="function"==typeof Symbol&&Symbol.observable||"@@observable",we=function(){return Math.random().toString(36).substring(7).split("").join(".")},ye={INIT:"@@redux/INIT"+we(),REPLACE:"@@redux/REPLACE"+we(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+we()}};function me(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ge(t,e,i){var r;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(pe(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(pe(1));return i(ge)(t,e)}if("function"!=typeof t)throw new Error(pe(2));var n=t,o=e,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error(pe(3));return o}function h(t){if("function"!=typeof t)throw new Error(pe(4));if(u)throw new Error(pe(5));var e=!0;return c(),a.push(t),function(){if(e){if(u)throw new Error(pe(6));e=!1,c();var i=a.indexOf(t);a.splice(i,1),s=null}}}function f(t){if(!me(t))throw new Error(pe(7));if(void 0===t.type)throw new Error(pe(8));if(u)throw new Error(pe(9));try{u=!0,o=n(o,t)}finally{u=!1}for(var e=s=a,i=0;i<e.length;i++){(0,e[i])()}return t}function d(t){if("function"!=typeof t)throw new Error(pe(10));n=t,f({type:ye.REPLACE})}function v(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(pe(11));function i(){t.next&&t.next(l())}return i(),{unsubscribe:e(i)}}})[be]=function(){return this},t}return f({type:ye.INIT}),(r={dispatch:f,subscribe:h,getState:l,replaceReducer:d})[be]=v,r}function xe(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++){var n=e[r];"function"==typeof t[n]&&(i[n]=t[n])}var o,s=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ye.INIT}))throw new Error(pe(12));if(void 0===i(void 0,{type:ye.PROBE_UNKNOWN_ACTION()}))throw new Error(pe(13))}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var r=!1,n={},a=0;a<s.length;a++){var u=s[a],c=i[u],l=t[u],h=c(l,e);if(void 0===h)throw e&&e.type,new Error(pe(14));n[u]=h,r=r||h!==l}return(r=r||s.length!==Object.keys(t).length)?n:t}}function Oe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Ee(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),r=function(){throw new Error(pe(15))},n={getState:i.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(n)}));return r=Oe.apply(void 0,o)(i.dispatch),ve(ve({},i),{},{dispatch:r})}}}function je(t){return function(e){var i=e.dispatch,r=e.getState;return function(e){return function(n){return"function"==typeof n?n(i,r,t):e(n)}}}}var Ne=je();Ne.withExtraArgument=je;var Se,Re=Ne,Ce=(Se=function(t,e){return Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},Se(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Se(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Me=function(t,e){for(var i=0,r=e.length,n=t.length;i<r;i++,n++)t[n]=e[i];return t},Ae=Object.defineProperty,Te=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,$e=function(t,e,i){return e in t?Ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},ke=function(t,e){for(var i in e||(e={}))Ie.call(e,i)&&$e(t,i,e[i]);if(Te)for(var r=0,n=Te(e);r<n.length;r++){i=n[r];Ue.call(e,i)&&$e(t,i,e[i])}return t},Fe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Oe:Oe.apply(null,arguments)};var Pe=function(t){function e(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var n=t.apply(this,i)||this;return Object.setPrototypeOf(n,e.prototype),n}return Ce(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,Me([void 0],t[0].concat(this)))):new(e.bind.apply(e,Me([void 0],t.concat(this))))},e}(Array);function Le(t){return bt(t)?he(t,(function(){})):t}function Be(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,i=void 0===e||e;t.immutableCheck,t.serializableCheck;var r=new Pe;i&&(!function(t){return"boolean"==typeof t}(i)?r.push(Re.withExtraArgument(i.extraArgument)):r.push(Re));return r}(t)}}function _e(t){var e,i=Be(),r=t||{},n=r.reducer,o=void 0===n?void 0:n,s=r.middleware,a=void 0===s?i():s,u=r.devTools,c=void 0===u||u,l=r.preloadedState,h=void 0===l?void 0:l,f=r.enhancers,d=void 0===f?void 0:f;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var i=e;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return e===i}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=xe(o)}var v=a;"function"==typeof v&&(v=v(i));var p=Ee.apply(void 0,v),b=Oe;c&&(b=Fe(ke({trace:!1},"object"==typeof c&&c)));var w=[p];return Array.isArray(d)?w=Me([p],d):"function"==typeof d&&(w=d(w)),ge(e,h,b.apply(void 0,w))}function We(t,e){function i(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e){var n=e.apply(void 0,i);if(!n)throw new Error("prepareAction did not return an object");return ke(ke({type:t,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(e){return e.type===t},i}function De(t){var e,i={},r=[],n={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[r]=e,n},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),n},addDefaultCase:function(t){return e=t,n}};return t(n),[i,r,e]}function Ke(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var i,r="function"==typeof t.initialState?t.initialState:Le(t.initialState),n=t.reducers||{},o=Object.keys(n),s={},a={},u={};function c(){var e="function"==typeof t.extraReducers?De(t.extraReducers):[t.extraReducers],i=e[0],n=void 0===i?{}:i,o=e[1],s=void 0===o?[]:o,u=e[2],c=void 0===u?void 0:u,l=ke(ke({},n),a);return function(t,e,i,r){void 0===i&&(i=[]);var n,o="function"==typeof e?De(e):[e,i,r],s=o[0],a=o[1],u=o[2];if(function(t){return"function"==typeof t}(t))n=function(){return Le(t())};else{var c=Le(t);n=function(){return c}}function l(t,e){void 0===t&&(t=n());var i=Me([s[e.type]],a.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[u]),i.reduce((function(t,i){if(i){var r;if(pt(t))return void 0===(r=i(t,e))?t:r;if(bt(t))return he(t,(function(t){return i(t,e)}));if(void 0===(r=i(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return l.getInitialState=n,l}(r,l,s,c)}return o.forEach((function(t){var i,r,o=n[t],c=e+"/"+t;"reducer"in o?(i=o.reducer,r=o.prepare):i=o,s[t]=i,a[c]=i,u[t]=r?We(c,r):We(c)})),{name:e,reducer:function(t,e){return i||(i=c()),i(t,e)},actions:u,caseReducers:s,getInitialState:function(){return i||(i=c()),i.getInitialState()}}}var He="listenerMiddleware";We(He+"/add"),We(He+"/removeAll"),We(He+"/remove"),function(){function t(t,e){var i=n[t];return i?i.enumerable=e:n[t]=i={configurable:!0,enumerable:e,get:function(){var e=this[ee];return se.get(e,t)},set:function(e){var i=this[ee];se.set(i,t,e)}},i}function e(t){for(var e=t.length-1;e>=0;e--){var n=t[e][ee];if(!n.P)switch(n.i){case 5:r(n)&&Dt(n);break;case 4:i(n)&&Dt(n)}}}function i(t){for(var e=t.t,i=t.k,r=re(i),n=r.length-1;n>=0;n--){var o=r[n];if(o!==ee){var s=e[o];if(void 0===s&&!mt(e,o))return!0;var a=i[o],u=a&&a[ee];if(u?u.t!==s:!xt(a,s))return!0}}var c=!!e[ee];return r.length!==re(e).length+(c?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(e,e.length-1);if(i&&!i.get)return!0;for(var r=0;r<e.length;r++)if(!e.hasOwnProperty(r))return!0;return!1}var n={};!function(t,e){oe[t]||(oe[t]=e)}("ES5",{J:function(e,i){var r=Array.isArray(e),n=function(e,i){if(e){for(var r=Array(i.length),n=0;n<i.length;n++)Object.defineProperty(r,""+n,t(n,!0));return r}var o=ne(i);delete o[ee];for(var s=re(o),a=0;a<s.length;a++){var u=s[a];o[u]=t(u,e||!!o[u].enumerable)}return Object.create(Object.getPrototypeOf(i),o)}(r,e),o={i:r?5:4,A:i?i.A:At(),P:!1,I:!1,D:{},l:i,t:e,k:n,o:null,O:!1,C:!1};return Object.defineProperty(n,ee,{value:o,writable:!0}),n},S:function(t,i,n){n?pt(i)&&i[ee].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var i=e[ee];if(i){var n=i.t,o=i.k,s=i.D,a=i.i;if(4===a)wt(o,(function(e){e!==ee&&(void 0!==n[e]||mt(n,e)?s[e]||t(o[e]):(s[e]=!0,Dt(i)))})),wt(n,(function(t){void 0!==o[t]||mt(o,t)||(s[t]=!1,Dt(i))}));else if(5===a){if(r(i)&&(Dt(i),s.length=!0),o.length<n.length)for(var u=o.length;u<n.length;u++)s[u]=!1;else for(var c=n.length;c<o.length;c++)s[c]=!0;for(var l=Math.min(o.length,n.length),h=0;h<l;h++)o.hasOwnProperty(h)||(s[h]=!0),void 0===s[h]&&t(o[h])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?i(t):r(t)}})}();const ze=(t,e)=>(i,r)=>{i.constructor.createProperty(r,{attribute:!1,hasChanged:null!=e?e:(t,e)=>!s(t,e)});const n=i;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(r,null!=t?t:t=>t[r])};class Je extends ft{get store(){return this.internalStore}set store(t){this.internalStore=t,this.store&&this.setupStore()}updateFromStore(){const t=this.store.getState();this.reduxProperties&&this.reduxProperties.forEach(((e,i)=>{this[i]=e(t,this)}))}setupStore(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.updateFromStore(),this.unsubscribeFromStore=this.store.subscribe((()=>{this.updateFromStore()})),this.onStoreAvailable(),this.requestUpdate()}onStoreAvailable(){}connectedCallback(){super.connectedCallback(),this.store&&this.setupStore()}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),super.disconnectedCallback()}}var Ve,Ze;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ze=null===(Ve=window.safari)||void 0===Ve?void 0:Ve.pushNotification)||void 0===Ze||Ze.toString());const qe={setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setMapId:(t,e)=>{t.mapId=e.payload},setTocId:(t,e)=>{t.tocId=e.payload},setMap:(t,e)=>{t.map=e.payload},setToc:(t,e)=>{t.toc=e.payload},setPagesToc:(t,e)=>{t.pagesToc=e.payload},setCurrentPage:(t,e)=>{t.currentPage=e.payload},setScrollTarget:(t,e)=>{t.scrollTarget=e.payload},setVisibleTopics:(t,e)=>{t.visibleTopics=e.payload},setRenderBeforeFirst:(t,e)=>{t.renderBeforeFirst=e.payload},setRenderAfterLast:(t,e)=>{t.renderAfterLast=e.payload},setLabels:(t,e)=>{t.labels=e.payload}},Xe={topicMissingAdvice:"Sorry, this topic is missing",somethingWentWrong:"Oops, something went wrong"};class Ge{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var r,n,o;if(null==t.tocId)return[...this.convertSectionNodes(null!==(r=t.pageToc)&&void 0!==r?r:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let s=null===(n=t.prettyUrl)||void 0===n?void 0:n.replace(/^\//,"");const a={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:s,depth:e,parentTocId:i,children:[]};this.register(a);const u=this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,a.tocId);return a.children=[...u,...c],[a]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var r;let n=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const o={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:n,depth:e,parentTocId:i,children:[]};return this.register(o),o.children=this.convertSectionNodes(t.children,e+1,t.tocId),[o]}))}buildPage(t,e){var i,r,n,o,s,a;const u={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(r=t.tocId)&&void 0!==r?r:"root",toc:(null!==(n=t.pageToc)&&void 0!==n?n:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?u.topics:u.hiddenTopics).push(t),l=null!==(s=null===(o=t.pageConfiguration)||void 0===o?void 0:o.parentsVisibility)&&void 0!==s?s:[];return u.breadcrumb.forEach(((t,e)=>{c(t,l[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),u.topics.push(...this.tocIds(null!==(a=t.pageToc)&&void 0!==a?a:[])),u}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class Ye{convertPaginatedToc(t){return new Ge(t).build()}}class Qe{constructor(t,e,i,r){this.converter=t,this.api=e,this.baseUrl=i,this.mapId=r,this.topics={},this.topicContents={},this.labelResolver=new dt(Xe,{}),i.endsWith("/")||(this.baseUrl=i+"/")}static build(t,e,i){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");return new Qe(new Ye,new window.fluidtopics.FluidTopicsApi(t,e,!0),t,i)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={},this.ratingSummary=void 0}getMap(){return this.loadIfNeeded((()=>this.map),(t=>this.map=t),(()=>this.api.getMap(this.mapId)))}getEnrichedToc(){return this.loadIfNeeded((()=>this.enrichedToc),(t=>this.enrichedToc=t),(()=>this.api.getPages(this.mapId).then((t=>this.converter.convertPaginatedToc(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;if(!("boolean"==typeof this.enrichedToc||this.enrichedToc instanceof Error))return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(e=>this.topics[t]=e),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(e=>this.topicContents[t]=e),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,e,i){const r=this.getNavigationData(t,e,i),n="r/"+(r.prettyUrl?r.prettyUrl:`${r.mapId}/${r.tocId}`),o=new URL(n,this.baseUrl);return null!=r.page&&o.searchParams.set("page",`${r.page}`),r.prettyUrlDuplicated&&o.searchParams.set("tocId",r.tocId),null!=r.section&&o.searchParams.set("section",r.section),o.href}getNavigationData(t,e,i){var r,n;t=t||"root";const o="object"==typeof this.enrichedToc?this.enrichedToc:void 0,s=null==o?void 0:o.pageByTocId[t],a=null==o?void 0:o.nodeByTocId[t],u=null==a?void 0:a.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(r=null==a?void 0:a.title)&&void 0!==r?r:"",page:e&&s&&s.number!==e?e:void 0,prettyUrl:null!=u?u.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(n=null==o?void 0:o.duplicatedPrettyUrls.has(null!=u?u:""))&&void 0!==n&&n,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}async loadIfNeeded(t,e,i){for(void 0===t()&&(e(!0),e(await i().catch((t=>t))));!0===t();)await a(10);const r=t();if(r instanceof Error)throw r;return r}set labels(t){this.labelResolver=new dt(Xe,t)}resolveLabel(t,...e){return this.labelResolver.resolve(t,e)}getRatingSummary(){return this.loadIfNeeded((()=>this.ratingSummary),(t=>this.ratingSummary=t),(()=>this.api.getMapRating(this.mapId)))}getMapRating(){return this.getRatingSummary().then((t=>t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}}))}rateMap(t,e){return this.api.rateMap(this.mapId,t,e).then((()=>this.ratingSummary=void 0))}unrateMap(){return this.api.unrateMap(this.mapId).then((()=>this.ratingSummary=void 0))}sendMapFeedback(t){return this.api.sendMapFeedback(this.mapId,t)}rateTopic(t,e,i){return this.api.rateTopic(this.mapId,t,e,i).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}sendTopicFeedback(t,e){return this.api.sendTopicFeedback(this.mapId,t,e)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}}class ti{constructor(t,i){this.store=t,this.slice=i,this.reloadDebouncer=new e(10)}static build(t){const e=(t=>Ke({name:"ft-reader-"+t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:"ft-reader",mapId:void 0,visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:qe}))(t.trim()||"context");return new ti(function(t,e,i){window.ftReduxStores||(window.ftReduxStores={});const r=e||t.name;return window.ftReduxStores[r]||(window.ftReduxStores[r]=_e({reducer:t.reducer})),window.ftReduxStores[r]}(e),e)}setBaseUrl(t){this.setRequiredStateField("baseUrl","setBaseUrl",t)}setApiIntegrationIdentifier(t){this.setRequiredStateField("apiIntegrationIdentifier","setApiIntegrationIdentifier",t)}setMapId(t){this.setRequiredStateField("mapId","setMapId",t)}setRenderBeforeFirst(t){this.dispatch(this.slice.actions.setRenderBeforeFirst(t))}setRenderAfterLast(t){this.dispatch(this.slice.actions.setRenderAfterLast(t))}setVisibleTopics(t){this.dispatch(this.slice.actions.setVisibleTopics(t))}setLabels(t){this.dispatch(this.slice.actions.setLabels(t)),this.service&&(this.service.labels=t)}async awaitService(){for(;null==this.service;)await a(5);return this.service}async navigateToTopic(t,e,i){const r=await this.awaitService();let n=await(null!=i?r.getPage(i):r.getPageByTocId(t));this.dispatch(this.slice.actions.setCurrentPage(n),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(i))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,i){this.store.getState()[t]!==i&&(this.dispatch(this.slice.actions[e](i)),this.reload())}reload(){const t=this.store.getState();return t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=Qe.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setPagesToc(void 0),this.slice.actions.setCurrentPage(void 0)),this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,e,i;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getMap().then((t=>this.dispatch(this.slice.actions.setMap(t)))),null===(e=this.service)||void 0===e?void 0:e.getToc().then((t=>this.dispatch(this.slice.actions.setToc(t)))),null===(i=this.service)||void 0===i?void 0:i.getPagesToc().then((t=>this.dispatch(this.slice.actions.setPagesToc(t))))])}catch(t){this.errorHandler&&this.errorHandler(t)}}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const ei=v`
|
|
82
82
|
`;var ii=function(t,e,i,r){for(var n,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,i,s):n(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class ri extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class ni extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class oi extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class si extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class ai extends Event{constructor(){super("ft-reader-map-not-found")}}class ui extends Event{constructor(){super("ft-reader-map-unauthorized")}}const ci=t=>e=>+(null!=e?e:"NaN")>0?+e:t;class li extends Je{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-reader",this.renderBeforeFirst=2,this.renderAfterLast=3,this.labels={},this.visibleTopics=[],this.navigationDebouncer=new e(5)}render(){return H`
|
|
83
83
|
${this.importStyleIfNeeded()}
|
|
84
84
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
@@ -158,10 +158,10 @@ export class FtReaderService {
|
|
|
158
158
|
return this.api.sendTopicFeedback(this.mapId, tocId, message);
|
|
159
159
|
}
|
|
160
160
|
fontsStylesheet() {
|
|
161
|
-
return this.api.endpoints.stylesheets.fonts;
|
|
161
|
+
return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts);
|
|
162
162
|
}
|
|
163
163
|
themeStylesheet() {
|
|
164
|
-
return this.api.endpoints.stylesheets.theme;
|
|
164
|
+
return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
//# sourceMappingURL=FtReaderService.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-context",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.49",
|
|
4
4
|
"description": "Context block for integrated reader components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "0.3.49",
|
|
23
23
|
"@reduxjs/toolkit": "^1.6.2",
|
|
24
24
|
"lit": "2.2.8"
|
|
25
25
|
},
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@fluid-topics/public-api": "1.0.28"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "3584a4f0b3edc500a360c2afe2ef3e5cdbb604b6"
|
|
33
33
|
}
|