@fluid-topics/ft-reader-context 0.3.27 → 0.3.30

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,r,n,e){function i(t){for(var r=arguments.length,n=Array(r>1?r-1:0),e=1;e<r;e++)n[e-1]=arguments[e];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function o(t){return!!t&&!!t[q]}function u(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var r=Object.getPrototypeOf(t);if(null===r)return!0;var n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===V}(t)||Array.isArray(t)||!!t[W]||!!t.constructor[W]||d(t)||h(t))}function s(t,r,n){void 0===n&&(n=!1),0===a(t)?(n?Object.keys:J)(t).forEach((function(e){n&&"symbol"==typeof e||r(e,t[e],t)})):t.forEach((function(n,e){return r(e,n,t)}))}function a(t){var r=t[q];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:d(t)?2:h(t)?3:0}function c(t,r){return 2===a(t)?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function f(t,r,n){var e=a(t);2===e?t.set(r,n):3===e?(t.delete(r),t.add(n)):t[r]=n}function l(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function d(t){return k&&t instanceof Map}function h(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 r=X(t);delete r[q];for(var n=J(r),e=0;e<n.length;e++){var i=n[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),r)}function b(t,r){return void 0===r&&(r=!1),g(t)||o(t)||!u(t)||(a(t)>1&&(t.set=t.add=t.clear=t.delete=y),Object.freeze(t),r&&s(t,(function(t,r){return b(r,!0)}),!0)),t}function y(){i(2)}function g(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function m(t){var r=Y[t];return r||i(18,t),r}function w(){return F}function j(t,r){r&&(m("Patches"),t.u=[],t.s=[],t.v=r)}function I(t){O(t),t.p.forEach(A),t.p=null}function O(t){t===F&&(F=t.l)}function T(t){return F={p:[],l:F,h:t,m:!0,_:0}}function A(t){var r=t[q];0===r.i||1===r.i?r.j():r.O=!0}function P(t,r){r._=r.p.length;var n=r.p[0],e=void 0!==t&&t!==n;return r.h.g||m("ES5").S(r,t,e),e?(n[q].P&&(I(r),i(4)),u(t)&&(t=S(r,t),r.l||M(r,t)),r.u&&m("Patches").M(n[q].t,t,r.u,r.s)):t=S(r,n,[]),I(r),r.u&&r.v(r.u,r.s),t!==K?t:void 0}function S(t,r,n){if(g(r))return r;var e=r[q];if(!e)return s(r,(function(i,o){return E(t,e,r,i,o,n)}),!0),r;if(e.A!==t)return r;if(!e.P)return M(t,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var i=4===e.i||5===e.i?e.o=p(e.k):e.o;s(3===e.i?new Set(i):i,(function(r,o){return E(t,e,i,r,o,n)})),M(t,i,!1),n&&t.u&&m("Patches").R(e,n,t.u,t.s)}return e.o}function E(t,r,n,e,i,s){if(o(i)){var a=S(t,i,s&&r&&3!==r.i&&!c(r.D,e)?s.concat(e):void 0);if(f(n,e,a),!o(a))return;t.m=!1}if(u(i)&&!g(i)){if(!t.h.F&&t._<1)return;S(t,i),r&&r.A.l||M(t,i)}}function M(t,r,n){void 0===n&&(n=!1),t.h.F&&t.m&&b(r,n)}function R(t,r){var n=t[q];return(n?v(n):t)[r]}function U(t,r){if(r in t)for(var n=Object.getPrototypeOf(t);n;){var e=Object.getOwnPropertyDescriptor(n,r);if(e)return e;n=Object.getPrototypeOf(n)}}function _(t){t.P||(t.P=!0,t.l&&_(t.l))}function C(t){t.o||(t.o=p(t.t))}function x(t,r,n){var e=d(r)?m("MapSet").N(r,n):h(r)?m("MapSet").T(r,n):t.g?function(t,r){var n=Array.isArray(t),e={i:n?1:0,A:r?r.A:w(),P:!1,I:!1,D:{},l:r,t,k:null,o:null,j:null,C:!1},i=e,o=z;n&&(i=[e],o=H);var u=Proxy.revocable(i,o),s=u.revoke,a=u.proxy;return e.k=a,e.j=s,a}(r,n):m("ES5").J(r,n);return(n?n.A:w()).p.push(e),e}function B(t){return o(t)||i(22,t),function t(r){if(!u(r))return r;var n,e=r[q],i=a(r);if(e){if(!e.P&&(e.i<4||!m("ES5").K(e)))return e.t;e.I=!0,n=D(r,i),e.I=!1}else n=D(r,i);return s(n,(function(r,i){e&&function(t,r){return 2===a(t)?t.get(r):t[r]}(e.t,r)===i||f(n,r,t(i))})),3===i?new Set(n):n}(t)}function D(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return p(t)}var N,F,L="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),k="undefined"!=typeof Map,$="undefined"!=typeof Set,G="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,K=L?Symbol.for("immer-nothing"):((N={})["immer-nothing"]=!0,N),W=L?Symbol.for("immer-draftable"):"__$immer_draftable",q=L?Symbol.for("immer-state"):"__$immer_state",V=""+Object.prototype.constructor,J="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,X=Object.getOwnPropertyDescriptors||function(t){var r={};return J(t).forEach((function(n){r[n]=Object.getOwnPropertyDescriptor(t,n)})),r},Y={},z={get:function(t,r){if(r===q)return t;var n=v(t);if(!c(n,r))return function(t,r,n){var e,i=U(r,n);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(t.k):void 0}(t,n,r);var e=n[r];return t.I||!u(e)?e:e===R(t.t,r)?(C(t),t.o[r]=x(t.A.h,e,t)):e},has:function(t,r){return r in v(t)},ownKeys:function(t){return Reflect.ownKeys(v(t))},set:function(t,r,n){var e=U(v(t),r);if(null==e?void 0:e.set)return e.set.call(t.k,n),!0;if(!t.P){var i=R(v(t),r),o=null==i?void 0:i[q];if(o&&o.t===n)return t.o[r]=n,t.D[r]=!1,!0;if(l(n,i)&&(void 0!==n||c(t.t,r)))return!0;C(t),_(t)}return t.o[r]===n&&"number"!=typeof n&&(void 0!==n||r in t.o)||(t.o[r]=n,t.D[r]=!0,!0)},deleteProperty:function(t,r){return void 0!==R(t.t,r)||r in t.t?(t.D[r]=!1,C(t),_(t)):delete t.D[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var n=v(t),e=Reflect.getOwnPropertyDescriptor(n,r);return e?{writable:!0,configurable:1!==t.i||"length"!==r,enumerable:e.enumerable,value:n[r]}:e},defineProperty:function(){i(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){i(12)}},H={};s(z,(function(t,r){H[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),H.deleteProperty=function(t,r){return H.set.call(this,t,r,void 0)},H.set=function(t,r,n){return z.set.call(this,t[0],r,n,t[0])};var Q=function(){function t(t){var r=this;this.g=G,this.F=!0,this.produce=function(t,n,e){if("function"==typeof t&&"function"!=typeof n){var o=n;n=t;var s=r;return function(t){var r=this;void 0===t&&(t=o);for(var e=arguments.length,i=Array(e>1?e-1:0),u=1;u<e;u++)i[u-1]=arguments[u];return s.produce(t,(function(t){var e;return(e=n).call.apply(e,[r,t].concat(i))}))}}var a;if("function"!=typeof n&&i(6),void 0!==e&&"function"!=typeof e&&i(7),u(t)){var c=T(r),f=x(r,t,void 0),l=!0;try{a=n(f),l=!1}finally{l?I(c):O(c)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return j(c,e),P(t,c)}),(function(t){throw I(c),t})):(j(c,e),P(a,c))}if(!t||"object"!=typeof t){if(void 0===(a=n(t))&&(a=t),a===K&&(a=void 0),r.F&&b(a,!0),e){var d=[],h=[];m("Patches").M(t,a,d,h),e(d,h)}return a}i(21,t)},this.produceWithPatches=function(t,n){if("function"==typeof t)return function(n){for(var e=arguments.length,i=Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return r.produceWithPatches(n,(function(r){return t.apply(void 0,[r].concat(i))}))};var e,i,o=r.produce(t,n,(function(t,r){e=t,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,e,i]})):[o,e,i]},"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 r=t.prototype;return r.createDraft=function(t){u(t)||i(8),o(t)&&(t=B(t));var r=T(this),n=x(this,t,void 0);return n[q].C=!0,O(r),n},r.finishDraft=function(t,r){var n=(t&&t[q]).A;return j(n,r),P(void 0,n)},r.setAutoFreeze=function(t){this.F=t},r.setUseProxies=function(t){t&&!G&&i(20),this.g=t},r.applyPatches=function(t,r){var n;for(n=r.length-1;n>=0;n--){var e=r[n];if(0===e.path.length&&"replace"===e.op){t=e.value;break}}n>-1&&(r=r.slice(n+1));var i=m("Patches").$;return o(t)?i(t,r):this.produce(t,(function(t){return i(t,r)}))},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 rt,nt=tt,et=(rt=function(t,r){return rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},rt(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}rt(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),it=function(t,r){for(var n=0,e=r.length,i=t.length;n<e;n++,i++)t[i]=r[n];return t},ot=Object.defineProperty,ut=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=function(t,r,n){return r in t?ot(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n},ft=function(t,r){for(var n in r||(r={}))st.call(r,n)&&ct(t,n,r[n]);if(ut)for(var e=0,i=ut(r);e<i.length;e++){n=i[e];at.call(r,n)&&ct(t,n,r[n])}return t};function lt(t){return u(t)?nt(t,(function(){})):t}function dt(t,r){function n(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(r){var i=r.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return ft(ft({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return n.toString=function(){return""+t},n.type=t,n.match=function(r){return r.type===t},n}function ht(t){var r,n={},e=[],i={addCase:function(t,r){var e="string"==typeof t?t:t.type;if(e in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[e]=r,i},addMatcher:function(t,r){return e.push({matcher:t,reducer:r}),i},addDefaultCase:function(t){return r=t,i}};return t(i),[n,e,r]}function vt(t){var r=t.name;if(!r)throw new Error("`name` is a required option for createSlice");var n,e="function"==typeof t.initialState?t.initialState:lt(t.initialState),i=t.reducers||{},s=Object.keys(i),a={},c={},f={};function l(){var r="function"==typeof t.extraReducers?ht(t.extraReducers):[t.extraReducers],n=r[0],i=void 0===n?{}:n,s=r[1],a=void 0===s?[]:s,f=r[2],l=void 0===f?void 0:f,d=ft(ft({},i),c);return function(t,r,n,e){void 0===n&&(n=[]);var i,s="function"==typeof r?ht(r):[r,n,e],a=s[0],c=s[1],f=s[2];if(function(t){return"function"==typeof t}(t))i=function(){return lt(t())};else{var l=lt(t);i=function(){return l}}function d(t,r){void 0===t&&(t=i());var n=it([a[r.type]],c.filter((function(t){return(0,t.matcher)(r)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return!!t})).length&&(n=[f]),n.reduce((function(t,n){if(n){var e;if(o(t))return void 0===(e=n(t,r))?t:e;if(u(t))return nt(t,(function(t){return n(t,r)}));if(void 0===(e=n(t,r))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return e}return t}),t)}return d.getInitialState=i,d}(e,d,a,l)}return s.forEach((function(t){var n,e,o=i[t],u=r+"/"+t;"reducer"in o?(n=o.reducer,e=o.prepare):n=o,a[t]=n,c[u]=n,f[t]=e?dt(u,e):dt(u)})),{name:r,reducer:function(t,r){return n||(n=l()),n(t,r)},actions:f,caseReducers:a,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}!function(t){function r(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var i=t.apply(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}et(r,t),Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},r.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(r.bind.apply(r,it([void 0],t[0].concat(this)))):new(r.bind.apply(r,it([void 0],t.concat(this))))}}(Array);var pt="listenerMiddleware";dt(pt+"/add"),dt(pt+"/removeAll"),dt(pt+"/remove"),function(){function t(t,r){var n=i[t];return n?n.enumerable=r:i[t]=n={configurable:!0,enumerable:r,get:function(){var r=this[q];return z.get(r,t)},set:function(r){var n=this[q];z.set(n,t,r)}},n}function r(t){for(var r=t.length-1;r>=0;r--){var i=t[r][q];if(!i.P)switch(i.i){case 5:e(i)&&_(i);break;case 4:n(i)&&_(i)}}}function n(t){for(var r=t.t,n=t.k,e=J(n),i=e.length-1;i>=0;i--){var o=e[i];if(o!==q){var u=r[o];if(void 0===u&&!c(r,o))return!0;var s=n[o],a=s&&s[q];if(a?a.t!==u:!l(s,u))return!0}}var f=!!r[q];return e.length!==J(r).length+(f?0:1)}function e(t){var r=t.k;if(r.length!==t.t.length)return!0;var n=Object.getOwnPropertyDescriptor(r,r.length-1);if(n&&!n.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}var i={};!function(t,r){Y[t]||(Y[t]=r)}("ES5",{J:function(r,n){var e=Array.isArray(r),i=function(r,n){if(r){for(var e=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=X(n);delete o[q];for(var u=J(o),s=0;s<u.length;s++){var a=u[s];o[a]=t(a,r||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(e,r),o={i:e?5:4,A:n?n.A:w(),P:!1,I:!1,D:{},l:n,t:r,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,q,{value:o,writable:!0}),i},S:function(t,n,i){i?o(n)&&n[q].A===t&&r(t.p):(t.u&&function t(r){if(r&&"object"==typeof r){var n=r[q];if(n){var i=n.t,o=n.k,u=n.D,a=n.i;if(4===a)s(o,(function(r){r!==q&&(void 0!==i[r]||c(i,r)?u[r]||t(o[r]):(u[r]=!0,_(n)))})),s(i,(function(t){void 0!==o[t]||c(o,t)||(u[t]=!1,_(n))}));else if(5===a){if(e(n)&&(_(n),u.length=!0),o.length<i.length)for(var f=o.length;f<i.length;f++)u[f]=!1;else for(var l=i.length;l<o.length;l++)u[l]=!0;for(var d=Math.min(o.length,i.length),h=0;h<d;h++)o.hasOwnProperty(h)||(u[h]=!0),void 0===u[h]&&t(o[h])}}}}(t.p[0]),r(t.p))},K:function(t){return 4===t.i?n(t):e(t)}})}();const bt={setBaseUrl:(t,r)=>{t.baseUrl=r.payload},setApiIntegrationIdentifier:(t,r)=>{t.apiIntegrationIdentifier=r.payload},setMapId:(t,r)=>{t.mapId=r.payload},setTocId:(t,r)=>{t.tocId=r.payload},setMap:(t,r)=>{t.map=r.payload},setToc:(t,r)=>{t.toc=r.payload},setCurrentPage:(t,r)=>{t.currentPage=r.payload},setScrollTarget:(t,r)=>{t.scrollTarget=r.payload},setVisibleTopics:(t,r)=>{t.visibleTopics=r.payload},setRenderBeforeFirst:(t,r)=>{t.renderBeforeFirst=r.payload},setRenderAfterLast:(t,r)=>{t.renderAfterLast=r.payload},setLabels:(t,r)=>{t.labels=r.payload}},yt={topicMissingAdvice:"Sorry, this topic is missing",somethingWentWrong:"Oops, something went wrong"};class gt{convertNodes(t){var r,n,e,i;const o={},u=new Set,s=new Set,a=[],c=(t,r,n)=>t.map((t=>{var e;t.page&&a.push(t.tocId);let i=null===(e=t.prettyUrl)||void 0===e?void 0:e.replace(/^\//,"");const f={...t,prettyUrl:i,depth:r,parentTocId:n,children:c(t.children,r+1,t.tocId)};return i&&(u.has(i)&&s.add(i),u.add(i)),o[t.tocId]=f,f})),f=c(null!=t?t:[],1),l=this.buildPages(a,o);let d={};return 0===l.length?l.push({number:1,title:null!==(n=null===(r=f[0])||void 0===r?void 0:r.title)&&void 0!==n?n:"",rootTocId:null!==(i=null===(e=f[0])||void 0===e?void 0:e.tocId)&&void 0!==i?i:"root",toc:[],topics:this.tocIds(f),hiddenTopics:[],breadcrumb:[]}):d=this.indexPages(l),{toc:f,nodeByTocId:o,duplicatedPrettyUrls:s,pages:l,pageByTocId:d}}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildPages(t,r){return t.map((t=>r[t])).map(((t,n)=>{var e,i,o,u,s;const a={number:n+1,title:t.title,rootTocId:t.tocId,toc:(null===(e=t.page)||void 0===e?void 0:e.onItsOwn)?[]:t.children,topics:[],hiddenTopics:[],breadcrumb:this.buildBreadcrumb(t,r)},c=(t,r)=>(r?a.topics:a.hiddenTopics).push(t),f=null!==(o=null===(i=t.page)||void 0===i?void 0:i.parentsVisibility)&&void 0!==o?o:[];return a.breadcrumb.forEach(((t,r)=>{c(t,f[r])})),c(t.tocId,null===(u=t.page)||void 0===u?void 0:u.visible),(null===(s=t.page)||void 0===s?void 0:s.onItsOwn)||a.topics.push(...this.tocIds(t.children)),a}))}buildBreadcrumb(t,r){const n=[];for(;null==t?void 0:t.parentTocId;)n.unshift(t.parentTocId),t=r[t.parentTocId];return n}indexPages(t){const r={};for(let n of t)for(let t of[...n.topics,...n.hiddenTopics])r[t]||(r[t]=n);return r}}class mt{constructor(t,n,e,i){this.converter=t,this.api=n,this.baseUrl=e,this.mapId=i,this.topics={},this.topicContents={},this.labelResolver=new r.ParametrizedLabelResolver(yt,{}),e.endsWith("/")||(this.baseUrl=e+"/")}static build(t,r,n){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 mt(new gt,new window.fluidtopics.FluidTopicsApi(t,r,!0),t,n)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={}}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.getTableOfContent(this.mapId).then((t=>this.converter.convertNodes(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeOrThrow(t){if("boolean"==typeof this.enrichedToc)throw new Error((this.enrichedToc," still loading"));if(this.enrichedToc instanceof Error)throw this.enrichedToc;return this.enrichedToc.nodeByTocId[t]}async getPage(t){const r=await this.getEnrichedToc();return r.pages[t-1]||r.pages[0]}async getPageByTocId(t){const r=await this.getEnrichedToc();return r.pageByTocId[t]||r.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(r=>this.topics[t]=r),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(r=>this.topicContents[t]=r),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,r,n){const e=this.getNavigationData(t,r,n),i="r/"+(e.prettyUrl?e.prettyUrl:`${e.mapId}/${e.tocId}`),o=new URL(i,this.baseUrl);return null!=e.page&&o.searchParams.set("page",`${e.page}`),e.prettyUrlDuplicated&&o.searchParams.set("tocId",e.tocId),null!=e.section&&o.searchParams.set("section",e.section),o.href}getNavigationData(t,r,n){var e,i;t=t||"root";const o="object"==typeof this.enrichedToc?this.enrichedToc:void 0,u=null==o?void 0:o.pageByTocId[t],s=null==o?void 0:o.nodeByTocId[t],a=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(e=null==s?void 0:s.title)&&void 0!==e?e:"",page:r&&u&&u.number!==r?r:void 0,prettyUrl:null!=a?a.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(i=null==o?void 0:o.duplicatedPrettyUrls.has(null!=a?a:""))&&void 0!==i&&i,section:n}}async getAccurateNavigationData(t,r,n){return await this.getEnrichedToc(),this.getNavigationData(t,r,n)}async loadIfNeeded(t,n,e){for(void 0===t()&&(n(!0),n(await e().catch((t=>t))));!0===t();)await r.delay(10);const i=t();if(i instanceof Error)throw i;return i}set labels(t){this.labelResolver=new r.ParametrizedLabelResolver(yt,t)}resolveLabel(t,...r){return this.labelResolver.resolve(t,r)}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((r=>{var n;return{type:r.topics.type,rating:null===(n=r.topics)||void 0===n?void 0:n.ratings.find((r=>r.tocId===t))}}))}rateMap(t,r){return this.api.rateMap(this.mapId,t,r).then((()=>this.ratingSummary=void 0))}unrateMap(){return this.api.unrateMap(this.mapId).then((()=>this.ratingSummary=void 0))}rateTopic(t,r,n){return this.api.rateTopic(this.mapId,t,r,n).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}}class wt{constructor(t,n){this.store=t,this.slice=n,this.reloadDebouncer=new r.Debouncer(10)}static build(t){const n=(t=>vt({name:"ft-reader-"+t,initialState:{baseUrl:"",apiIntegrationIdentifier:"ft-reader",visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:bt}))(t.trim()||"context");return new wt(r.getStore(n),n)}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 navigateToTopic(t,n,e){for(;null==this.service;)await r.delay(5);let i=null!=e?await this.service.getPage(e):await this.service.getPageByTocId(t);this.dispatch(this.slice.actions.setCurrentPage(i),this.slice.actions.setScrollTarget({tocId:t,section:n}))}async navigateToPage(t){for(;null==this.service;)await r.delay(5);let n=await this.service.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(n))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,r,n){this.store.getState()[t]!==n&&(this.dispatch(this.slice.actions[r](n)),this.clearAll(),this.reload())}clearAll(){this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setCurrentPage(void 0))}reload(){const t=this.store.getState();t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=mt.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.reloadDebouncer.run((async()=>{this.reloadMap(),this.reloadToc()}))}async reloadMap(){var t;const r=await(null===(t=this.service)||void 0===t?void 0:t.getMap());this.dispatch(this.slice.actions.setMap(r))}async reloadToc(){var t;const r=await(null===(t=this.service)||void 0===t?void 0:t.getToc());this.dispatch(this.slice.actions.setToc(r))}dispatch(...t){for(let r of t)this.store.dispatch(r)}}const jt=n.css`
2
- `;var It=function(t,r,n,e){for(var i,o=arguments.length,u=o<3?r:null===e?e=Object.getOwnPropertyDescriptor(r,n):e,s=t.length-1;s>=0;s--)(i=t[s])&&(u=(o<3?i(u):o>3?i(r,n,u):i(r,n))||u);return o>3&&u&&Object.defineProperty(r,n,u),u};class Ot extends CustomEvent{constructor(t,r){super("ft-reader-map-loaded",{detail:{map:t,toc:r}})}}class Tt extends CustomEvent{constructor(t,r){super("ft-reader-visible-topics-change",{detail:{visibleTopics:r}})}}class At extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}const Pt=t=>r=>+(null!=r?r:"NaN")>0?+r:t;class St extends r.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-reader",this.renderBeforeFirst=2,this.renderAfterLast=3,this.labels={},this.visibleTopics=[],this.navigationDebouncer=new r.Debouncer(5)}render(){return n.html`
1
+ !function(t,r,i,n){function e(t){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];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 o(t){return!!t&&!!t[q]}function s(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var r=Object.getPrototypeOf(t);if(null===r)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===V}(t)||Array.isArray(t)||!!t[W]||!!t.constructor[W]||h(t)||d(t))}function u(t,r,i){void 0===i&&(i=!1),0===a(t)?(i?Object.keys:J)(t).forEach((function(n){i&&"symbol"==typeof n||r(n,t[n],t)})):t.forEach((function(i,n){return r(n,i,t)}))}function a(t){var r=t[q];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:h(t)?2:d(t)?3:0}function c(t,r){return 2===a(t)?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function f(t,r,i){var n=a(t);2===n?t.set(r,i):3===n?(t.delete(r),t.add(i)):t[r]=i}function l(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function h(t){return k&&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 r=X(t);delete r[q];for(var i=J(r),n=0;n<i.length;n++){var e=i[n],o=r[e];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[e]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[e]})}return Object.create(Object.getPrototypeOf(t),r)}function b(t,r){return void 0===r&&(r=!1),g(t)||o(t)||!s(t)||(a(t)>1&&(t.set=t.add=t.clear=t.delete=y),Object.freeze(t),r&&u(t,(function(t,r){return b(r,!0)}),!0)),t}function y(){e(2)}function g(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function w(t){var r=Y[t];return r||e(18,t),r}function m(){return F}function I(t,r){r&&(w("Patches"),t.u=[],t.s=[],t.v=r)}function j(t){T(t),t.p.forEach(A),t.p=null}function T(t){t===F&&(F=t.l)}function O(t){return F={p:[],l:F,h:t,m:!0,_:0}}function A(t){var r=t[q];0===r.i||1===r.i?r.j():r.O=!0}function P(t,r){r._=r.p.length;var i=r.p[0],n=void 0!==t&&t!==i;return r.h.g||w("ES5").S(r,t,n),n?(i[q].P&&(j(r),e(4)),s(t)&&(t=S(r,t),r.l||E(r,t)),r.u&&w("Patches").M(i[q].t,t,r.u,r.s)):t=S(r,i,[]),j(r),r.u&&r.v(r.u,r.s),t!==K?t:void 0}function S(t,r,i){if(g(r))return r;var n=r[q];if(!n)return u(r,(function(e,o){return M(t,n,r,e,o,i)}),!0),r;if(n.A!==t)return r;if(!n.P)return E(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var e=4===n.i||5===n.i?n.o=p(n.k):n.o;u(3===n.i?new Set(e):e,(function(r,o){return M(t,n,e,r,o,i)})),E(t,e,!1),i&&t.u&&w("Patches").R(n,i,t.u,t.s)}return n.o}function M(t,r,i,n,e,u){if(o(e)){var a=S(t,e,u&&r&&3!==r.i&&!c(r.D,n)?u.concat(n):void 0);if(f(i,n,a),!o(a))return;t.m=!1}if(s(e)&&!g(e)){if(!t.h.F&&t._<1)return;S(t,e),r&&r.A.l||E(t,e)}}function E(t,r,i){void 0===i&&(i=!1),t.h.F&&t.m&&b(r,i)}function R(t,r){var i=t[q];return(i?v(i):t)[r]}function U(t,r){if(r in t)for(var i=Object.getPrototypeOf(t);i;){var n=Object.getOwnPropertyDescriptor(i,r);if(n)return n;i=Object.getPrototypeOf(i)}}function C(t){t.P||(t.P=!0,t.l&&C(t.l))}function N(t){t.o||(t.o=p(t.t))}function _(t,r,i){var n=h(r)?w("MapSet").N(r,i):d(r)?w("MapSet").T(r,i):t.g?function(t,r){var i=Array.isArray(t),n={i:i?1:0,A:r?r.A:m(),P:!1,I:!1,D:{},l:r,t,k:null,o:null,j:null,C:!1},e=n,o=z;i&&(e=[n],o=H);var s=Proxy.revocable(e,o),u=s.revoke,a=s.proxy;return n.k=a,n.j=u,a}(r,i):w("ES5").J(r,i);return(i?i.A:m()).p.push(n),n}function x(t){return o(t)||e(22,t),function t(r){if(!s(r))return r;var i,n=r[q],e=a(r);if(n){if(!n.P&&(n.i<4||!w("ES5").K(n)))return n.t;n.I=!0,i=B(r,e),n.I=!1}else i=B(r,e);return u(i,(function(r,e){n&&function(t,r){return 2===a(t)?t.get(r):t[r]}(n.t,r)===e||f(i,r,t(e))})),3===e?new Set(i):i}(t)}function B(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return p(t)}var D,F,L="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),k="undefined"!=typeof Map,$="undefined"!=typeof Set,G="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,K=L?Symbol.for("immer-nothing"):((D={})["immer-nothing"]=!0,D),W=L?Symbol.for("immer-draftable"):"__$immer_draftable",q=L?Symbol.for("immer-state"):"__$immer_state",V=""+Object.prototype.constructor,J="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,X=Object.getOwnPropertyDescriptors||function(t){var r={};return J(t).forEach((function(i){r[i]=Object.getOwnPropertyDescriptor(t,i)})),r},Y={},z={get:function(t,r){if(r===q)return t;var i=v(t);if(!c(i,r))return function(t,r,i){var n,e=U(r,i);return e?"value"in e?e.value:null===(n=e.get)||void 0===n?void 0:n.call(t.k):void 0}(t,i,r);var n=i[r];return t.I||!s(n)?n:n===R(t.t,r)?(N(t),t.o[r]=_(t.A.h,n,t)):n},has:function(t,r){return r in v(t)},ownKeys:function(t){return Reflect.ownKeys(v(t))},set:function(t,r,i){var n=U(v(t),r);if(null==n?void 0:n.set)return n.set.call(t.k,i),!0;if(!t.P){var e=R(v(t),r),o=null==e?void 0:e[q];if(o&&o.t===i)return t.o[r]=i,t.D[r]=!1,!0;if(l(i,e)&&(void 0!==i||c(t.t,r)))return!0;N(t),C(t)}return t.o[r]===i&&"number"!=typeof i&&(void 0!==i||r in t.o)||(t.o[r]=i,t.D[r]=!0,!0)},deleteProperty:function(t,r){return void 0!==R(t.t,r)||r in t.t?(t.D[r]=!1,N(t),C(t)):delete t.D[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var i=v(t),n=Reflect.getOwnPropertyDescriptor(i,r);return n?{writable:!0,configurable:1!==t.i||"length"!==r,enumerable:n.enumerable,value:i[r]}:n},defineProperty:function(){e(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){e(12)}},H={};u(z,(function(t,r){H[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),H.deleteProperty=function(t,r){return H.set.call(this,t,r,void 0)},H.set=function(t,r,i){return z.set.call(this,t[0],r,i,t[0])};var Q=function(){function t(t){var r=this;this.g=G,this.F=!0,this.produce=function(t,i,n){if("function"==typeof t&&"function"!=typeof i){var o=i;i=t;var u=r;return function(t){var r=this;void 0===t&&(t=o);for(var n=arguments.length,e=Array(n>1?n-1:0),s=1;s<n;s++)e[s-1]=arguments[s];return u.produce(t,(function(t){var n;return(n=i).call.apply(n,[r,t].concat(e))}))}}var a;if("function"!=typeof i&&e(6),void 0!==n&&"function"!=typeof n&&e(7),s(t)){var c=O(r),f=_(r,t,void 0),l=!0;try{a=i(f),l=!1}finally{l?j(c):T(c)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return I(c,n),P(t,c)}),(function(t){throw j(c),t})):(I(c,n),P(a,c))}if(!t||"object"!=typeof t){if(void 0===(a=i(t))&&(a=t),a===K&&(a=void 0),r.F&&b(a,!0),n){var h=[],d=[];w("Patches").M(t,a,h,d),n(h,d)}return a}e(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var n=arguments.length,e=Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];return r.produceWithPatches(i,(function(r){return t.apply(void 0,[r].concat(e))}))};var n,e,o=r.produce(t,i,(function(t,r){n=t,e=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,n,e]})):[o,n,e]},"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 r=t.prototype;return r.createDraft=function(t){s(t)||e(8),o(t)&&(t=x(t));var r=O(this),i=_(this,t,void 0);return i[q].C=!0,T(r),i},r.finishDraft=function(t,r){var i=(t&&t[q]).A;return I(i,r),P(void 0,i)},r.setAutoFreeze=function(t){this.F=t},r.setUseProxies=function(t){t&&!G&&e(20),this.g=t},r.applyPatches=function(t,r){var i;for(i=r.length-1;i>=0;i--){var n=r[i];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}i>-1&&(r=r.slice(i+1));var e=w("Patches").$;return o(t)?e(t,r):this.produce(t,(function(t){return e(t,r)}))},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 rt,it=tt,nt=(rt=function(t,r){return rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},rt(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}rt(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),et=function(t,r){for(var i=0,n=r.length,e=t.length;i<n;i++,e++)t[e]=r[i];return t},ot=Object.defineProperty,st=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=function(t,r,i){return r in t?ot(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i},ft=function(t,r){for(var i in r||(r={}))ut.call(r,i)&&ct(t,i,r[i]);if(st)for(var n=0,e=st(r);n<e.length;n++){i=e[n];at.call(r,i)&&ct(t,i,r[i])}return t};function lt(t){return s(t)?it(t,(function(){})):t}function ht(t,r){function i(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(r){var e=r.apply(void 0,i);if(!e)throw new Error("prepareAction did not return an object");return ft(ft({type:t,payload:e.payload},"meta"in e&&{meta:e.meta}),"error"in e&&{error:e.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(r){return r.type===t},i}function dt(t){var r,i={},n=[],e={addCase:function(t,r){var n="string"==typeof t?t:t.type;if(n in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[n]=r,e},addMatcher:function(t,r){return n.push({matcher:t,reducer:r}),e},addDefaultCase:function(t){return r=t,e}};return t(e),[i,n,r]}function vt(t){var r=t.name;if(!r)throw new Error("`name` is a required option for createSlice");var i,n="function"==typeof t.initialState?t.initialState:lt(t.initialState),e=t.reducers||{},u=Object.keys(e),a={},c={},f={};function l(){var r="function"==typeof t.extraReducers?dt(t.extraReducers):[t.extraReducers],i=r[0],e=void 0===i?{}:i,u=r[1],a=void 0===u?[]:u,f=r[2],l=void 0===f?void 0:f,h=ft(ft({},e),c);return function(t,r,i,n){void 0===i&&(i=[]);var e,u="function"==typeof r?dt(r):[r,i,n],a=u[0],c=u[1],f=u[2];if(function(t){return"function"==typeof t}(t))e=function(){return lt(t())};else{var l=lt(t);e=function(){return l}}function h(t,r){void 0===t&&(t=e());var i=et([a[r.type]],c.filter((function(t){return(0,t.matcher)(r)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[f]),i.reduce((function(t,i){if(i){var n;if(o(t))return void 0===(n=i(t,r))?t:n;if(s(t))return it(t,(function(t){return i(t,r)}));if(void 0===(n=i(t,r))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return t}),t)}return h.getInitialState=e,h}(n,h,a,l)}return u.forEach((function(t){var i,n,o=e[t],s=r+"/"+t;"reducer"in o?(i=o.reducer,n=o.prepare):i=o,a[t]=i,c[s]=i,f[t]=n?ht(s,n):ht(s)})),{name:r,reducer:function(t,r){return i||(i=l()),i(t,r)},actions:f,caseReducers:a,getInitialState:function(){return i||(i=l()),i.getInitialState()}}}!function(t){function r(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var e=t.apply(this,i)||this;return Object.setPrototypeOf(e,r.prototype),e}nt(r,t),Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.prototype.concat.apply(this,r)},r.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(r.bind.apply(r,et([void 0],t[0].concat(this)))):new(r.bind.apply(r,et([void 0],t.concat(this))))}}(Array);var pt="listenerMiddleware";ht(pt+"/add"),ht(pt+"/removeAll"),ht(pt+"/remove"),function(){function t(t,r){var i=e[t];return i?i.enumerable=r:e[t]=i={configurable:!0,enumerable:r,get:function(){var r=this[q];return z.get(r,t)},set:function(r){var i=this[q];z.set(i,t,r)}},i}function r(t){for(var r=t.length-1;r>=0;r--){var e=t[r][q];if(!e.P)switch(e.i){case 5:n(e)&&C(e);break;case 4:i(e)&&C(e)}}}function i(t){for(var r=t.t,i=t.k,n=J(i),e=n.length-1;e>=0;e--){var o=n[e];if(o!==q){var s=r[o];if(void 0===s&&!c(r,o))return!0;var u=i[o],a=u&&u[q];if(a?a.t!==s:!l(u,s))return!0}}var f=!!r[q];return n.length!==J(r).length+(f?0:1)}function n(t){var r=t.k;if(r.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(r,r.length-1);if(i&&!i.get)return!0;for(var n=0;n<r.length;n++)if(!r.hasOwnProperty(n))return!0;return!1}var e={};!function(t,r){Y[t]||(Y[t]=r)}("ES5",{J:function(r,i){var n=Array.isArray(r),e=function(r,i){if(r){for(var n=Array(i.length),e=0;e<i.length;e++)Object.defineProperty(n,""+e,t(e,!0));return n}var o=X(i);delete o[q];for(var s=J(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,r||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(i),o)}(n,r),o={i:n?5:4,A:i?i.A:m(),P:!1,I:!1,D:{},l:i,t:r,k:e,o:null,O:!1,C:!1};return Object.defineProperty(e,q,{value:o,writable:!0}),e},S:function(t,i,e){e?o(i)&&i[q].A===t&&r(t.p):(t.u&&function t(r){if(r&&"object"==typeof r){var i=r[q];if(i){var e=i.t,o=i.k,s=i.D,a=i.i;if(4===a)u(o,(function(r){r!==q&&(void 0!==e[r]||c(e,r)?s[r]||t(o[r]):(s[r]=!0,C(i)))})),u(e,(function(t){void 0!==o[t]||c(o,t)||(s[t]=!1,C(i))}));else if(5===a){if(n(i)&&(C(i),s.length=!0),o.length<e.length)for(var f=o.length;f<e.length;f++)s[f]=!1;else for(var l=e.length;l<o.length;l++)s[l]=!0;for(var h=Math.min(o.length,e.length),d=0;d<h;d++)o.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&t(o[d])}}}}(t.p[0]),r(t.p))},K:function(t){return 4===t.i?i(t):n(t)}})}();const bt={setBaseUrl:(t,r)=>{t.baseUrl=r.payload},setApiIntegrationIdentifier:(t,r)=>{t.apiIntegrationIdentifier=r.payload},setMapId:(t,r)=>{t.mapId=r.payload},setTocId:(t,r)=>{t.tocId=r.payload},setMap:(t,r)=>{t.map=r.payload},setToc:(t,r)=>{t.toc=r.payload},setPagesToc:(t,r)=>{t.pagesToc=r.payload},setCurrentPage:(t,r)=>{t.currentPage=r.payload},setScrollTarget:(t,r)=>{t.scrollTarget=r.payload},setVisibleTopics:(t,r)=>{t.visibleTopics=r.payload},setRenderBeforeFirst:(t,r)=>{t.renderBeforeFirst=r.payload},setRenderAfterLast:(t,r)=>{t.renderAfterLast=r.payload},setLabels:(t,r)=>{t.labels=r.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,r,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,r,i):[{tocId:t.tocId,title:t.title,depth:r,children:this.extractPagesToc(t.children,r+1,t.tocId)}])))}convertNodes(t,r,i){return t.flatMap((t=>{var n,e,o;if(null==t.tocId)return[...this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],r,t.tocId),...this.convertNodes(t.children,r,t.tocId)];let s=null===(e=t.prettyUrl)||void 0===e?void 0:e.replace(/^\//,"");const u={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:s,depth:r,parentTocId:i,children:[]};this.register(u);const a=this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],r+1,t.tocId),c=this.convertNodes(t.children,r+1,u.tocId);return u.children=[...a,...c],[u]}))}convertSectionNodes(t,r,i){return t.flatMap((t=>{var n;let e=null===(n=t.prettyUrl)||void 0===n?void 0:n.replace(/^\//,"");const o={tocId:t.tocId,contentId:t.contentId,title:t.title,prettyUrl:e,depth:r,parentTocId:i,children:[]};return this.register(o),o.children=this.convertSectionNodes(t.children,r+1,t.tocId),[o]}))}buildPage(t,r){var i,n,e,o,s,u;const a={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(n=t.tocId)&&void 0!==n?n:"root",toc:(null!==(e=t.pageToc)&&void 0!==e?e:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},c=(t,r)=>(r?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,r)=>{c(t,f[r])})),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 r of[...t.topics,...t.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const r=[t.tocId];for(;null==t?void 0:t.parentTocId;)r.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return r}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 wt{convertPaginatedToc(t){return new gt(t).build()}}class mt{constructor(t,i,n,e){this.converter=t,this.api=i,this.baseUrl=n,this.mapId=e,this.topics={},this.topicContents={},this.labelResolver=new r.ParametrizedLabelResolver(yt,{}),n.endsWith("/")||(this.baseUrl=n+"/")}static build(t,r,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 mt(new wt,new window.fluidtopics.FluidTopicsApi(t,r,!0),t,i)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={}}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 r;if(!("boolean"==typeof this.enrichedToc||this.enrichedToc instanceof Error))return null===(r=this.enrichedToc)||void 0===r?void 0:r.nodeByTocId[t]}async getPage(t){const r=await this.getEnrichedToc();return r.pages[t-1]||r.pages[0]}async getPageByTocId(t){const r=await this.getEnrichedToc();return r.pageByTocId[t]||r.pages[0]}getTopicInfo(t){return this.loadIfNeeded((()=>this.topics[t]),(r=>this.topics[t]=r),(()=>this.api.getTopic(this.mapId,t)))}getTopicContent(t){return this.loadIfNeeded((()=>this.topicContents[t]),(r=>this.topicContents[t]=r),(()=>this.api.getTopicHTMLContent(this.mapId,t,"DESIGNED_READER")))}getLink(t,r,i){const n=this.getNavigationData(t,r,i),e="r/"+(n.prettyUrl?n.prettyUrl:`${n.mapId}/${n.tocId}`),o=new URL(e,this.baseUrl);return null!=n.page&&o.searchParams.set("page",`${n.page}`),n.prettyUrlDuplicated&&o.searchParams.set("tocId",n.tocId),null!=n.section&&o.searchParams.set("section",n.section),o.href}getNavigationData(t,r,i){var n,e;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!==(n=null==u?void 0:u.title)&&void 0!==n?n:"",page:r&&s&&s.number!==r?r:void 0,prettyUrl:null!=a?a.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(e=null==o?void 0:o.duplicatedPrettyUrls.has(null!=a?a:""))&&void 0!==e&&e,section:i}}async getAccurateNavigationData(t,r,i){return await this.getEnrichedToc(),this.getNavigationData(t,r,i)}async loadIfNeeded(t,i,n){for(void 0===t()&&(i(!0),i(await n().catch((t=>t))));!0===t();)await r.delay(10);const e=t();if(e instanceof Error)throw e;return e}set labels(t){this.labelResolver=new r.ParametrizedLabelResolver(yt,t)}resolveLabel(t,...r){return this.labelResolver.resolve(t,r)}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((r=>{var i;return{type:r.topics.type,rating:null===(i=r.topics)||void 0===i?void 0:i.ratings.find((r=>r.tocId===t))}}))}rateMap(t,r){return this.api.rateMap(this.mapId,t,r).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,r,i){return this.api.rateTopic(this.mapId,t,r,i).then((()=>this.ratingSummary=void 0))}unrateTopic(t){return this.api.unrateTopic(this.mapId,t).then((()=>this.ratingSummary=void 0))}sendTopicFeedback(t,r){return this.api.sendTopicFeedback(this.mapId,t,r)}}class It{constructor(t,i){this.store=t,this.slice=i,this.reloadDebouncer=new r.Debouncer(10)}static build(t){const i=(t=>vt({name:"ft-reader-"+t,initialState:{baseUrl:"",apiIntegrationIdentifier:"ft-reader",visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:bt}))(t.trim()||"context");return new It(r.getStore(i),i)}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 navigateToTopic(t,i,n){for(;null==this.service;)await r.delay(5);let e=null!=n?await this.service.getPage(n):await this.service.getPageByTocId(t);this.dispatch(this.slice.actions.setCurrentPage(e),this.slice.actions.setScrollTarget({tocId:t,section:i}))}async navigateToPage(t){for(;null==this.service;)await r.delay(5);let i=await this.service.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(i))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,r,i){this.store.getState()[t]!==i&&(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.slice.actions[r](i)),this.reload())}reload(){const t=this.store.getState();t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=mt.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.reloadDebouncer.run((async()=>{this.reloadMap(),this.reloadToc()}))}async reloadMap(){var t;const r=await(null===(t=this.service)||void 0===t?void 0:t.getMap());this.dispatch(this.slice.actions.setMap(r))}async reloadToc(){var t,r;const i=await(null===(t=this.service)||void 0===t?void 0:t.getToc()),n=await(null===(r=this.service)||void 0===r?void 0:r.getPagesToc());this.dispatch(this.slice.actions.setToc(i),this.slice.actions.setPagesToc(n))}dispatch(...t){for(let r of t)this.store.dispatch(r)}}const jt=i.css`
2
+ `;var Tt=function(t,r,i,n){for(var e,o=arguments.length,s=o<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,i):n,u=t.length-1;u>=0;u--)(e=t[u])&&(s=(o<3?e(s):o>3?e(r,i,s):e(r,i))||s);return o>3&&s&&Object.defineProperty(r,i,s),s};class Ot extends CustomEvent{constructor(t,r){super("ft-reader-map-loaded",{detail:{map:t,toc:r}})}}class At extends CustomEvent{constructor(t,r){super("ft-reader-visible-topics-change",{detail:{visibleTopics:r}})}}class Pt extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}const St=t=>r=>+(null!=r?r:"NaN")>0?+r:t;class Mt extends r.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-reader",this.renderBeforeFirst=2,this.renderAfterLast=3,this.labels={},this.visibleTopics=[],this.navigationDebouncer=new r.Debouncer(5)}render(){return i.html`
3
3
  <slot @register-ft-reader-component=${this.registerComponent}></slot>
4
- `}get stateManager(){return null==this._stateManager&&(this._stateManager=wt.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this.store=this.stateManager.store),this._stateManager}updated(t){super.updated(t),t.has("baseUrl")&&this.baseUrl&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),(t.has("tocId")||t.has("section")||t.has("page"))&&this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):t.has("page")&&!this.tocId&&null!=this.page?this.stateManager.navigateToPage(this.page):t.has("mapId")&&this.mapId&&this.navigateToTarget(),t.has("renderBeforeFirst")&&this.stateManager.setRenderBeforeFirst(this.renderBeforeFirst),t.has("renderAfterLast")&&this.stateManager.setRenderAfterLast(this.renderAfterLast),t.has("labels")&&this.stateManager.setLabels(this.labels)}contentAvailableCallback(t){var r;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new Ot(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)){const r=t.get("scrollTarget");null!=(null==r?void 0:r.tocId)&&this.navigationDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(r.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,r.section).then((t=>this.dispatchEvent(new At(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var r;return this.stateManager.service.getAccurateNavigationData(t,null===(r=this.currentPage)||void 0===r?void 0:r.number)}))).then((t=>{let r=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>({tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated})));this.dispatchEvent(new Tt(this.map,r))}))}navigateToTarget(){null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}registerComponent(t){t.stopPropagation();const r=t.composedPath()[0];this.register(r)}register(t){t.setReaderStateManager(this.stateManager)}}St.styles=jt,It([e.property()],St.prototype,"baseUrl",void 0),It([e.property()],St.prototype,"apiIntegrationIdentifier",void 0),It([e.property()],St.prototype,"mapId",void 0),It([e.property()],St.prototype,"tocId",void 0),It([e.property()],St.prototype,"section",void 0),It([e.property({type:Number,converter:{fromAttribute:Pt()}})],St.prototype,"page",void 0),It([e.property({type:Number,converter:{fromAttribute:Pt(2)}})],St.prototype,"renderBeforeFirst",void 0),It([e.property({type:Number,converter:{fromAttribute:Pt(3)}})],St.prototype,"renderAfterLast",void 0),It([r.jsonProperty({})],St.prototype,"labels",void 0),It([r.redux()],St.prototype,"map",void 0),It([r.redux()],St.prototype,"toc",void 0),It([r.redux()],St.prototype,"visibleTopics",void 0),It([r.redux()],St.prototype,"currentPage",void 0),It([r.redux()],St.prototype,"scrollTarget",void 0),r.customElement("ft-reader-context")(St),t.FtReaderContext=St,t.FtReaderContextCssVariables={},t.MapLoadedEvent=Ot,t.NavigationDoneEvent=At,t.VisibleTopicsChangeEvent=Tt,t.styles=jt,Object.defineProperty(t,"U",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
4
+ `}get stateManager(){return null==this._stateManager&&(this._stateManager=It.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this.store=this.stateManager.store),this._stateManager}updated(t){super.updated(t),t.has("baseUrl")&&this.baseUrl&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),(t.has("tocId")||t.has("section")||t.has("page"))&&this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):t.has("page")&&!this.tocId&&null!=this.page?this.stateManager.navigateToPage(this.page):t.has("mapId")&&this.mapId&&this.navigateToTarget(),t.has("renderBeforeFirst")&&this.stateManager.setRenderBeforeFirst(this.renderBeforeFirst),t.has("renderAfterLast")&&this.stateManager.setRenderAfterLast(this.renderAfterLast),t.has("labels")&&this.stateManager.setLabels(this.labels)}contentAvailableCallback(t){var r;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new Ot(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)){const r=t.get("scrollTarget");null!=(null==r?void 0:r.tocId)&&this.navigationDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(r.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,r.section).then((t=>this.dispatchEvent(new Pt(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var r;return this.stateManager.service.getAccurateNavigationData(t,null===(r=this.currentPage)||void 0===r?void 0:r.number)}))).then((t=>{let r=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>({tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated})));this.dispatchEvent(new At(this.map,r))}))}navigateToTarget(){null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}registerComponent(t){t.stopPropagation();const r=t.composedPath()[0];this.register(r)}register(t){t.setReaderStateManager(this.stateManager)}}Mt.styles=jt,Tt([n.property()],Mt.prototype,"baseUrl",void 0),Tt([n.property()],Mt.prototype,"apiIntegrationIdentifier",void 0),Tt([n.property()],Mt.prototype,"mapId",void 0),Tt([n.property()],Mt.prototype,"tocId",void 0),Tt([n.property()],Mt.prototype,"section",void 0),Tt([n.property({type:Number,converter:{fromAttribute:St()}})],Mt.prototype,"page",void 0),Tt([n.property({type:Number,converter:{fromAttribute:St(2)}})],Mt.prototype,"renderBeforeFirst",void 0),Tt([n.property({type:Number,converter:{fromAttribute:St(3)}})],Mt.prototype,"renderAfterLast",void 0),Tt([r.jsonProperty({})],Mt.prototype,"labels",void 0),Tt([r.redux()],Mt.prototype,"map",void 0),Tt([r.redux()],Mt.prototype,"toc",void 0),Tt([r.redux()],Mt.prototype,"visibleTopics",void 0),Tt([r.redux()],Mt.prototype,"currentPage",void 0),Tt([r.redux()],Mt.prototype,"scrollTarget",void 0),r.customElement("ft-reader-context")(Mt),t.FtReaderContext=Mt,t.FtReaderContextCssVariables={},t.MapLoadedEvent=Ot,t.NavigationDoneEvent=Pt,t.VisibleTopicsChangeEvent=At,t.styles=jt,Object.defineProperty(t,"U",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
@@ -34,19 +34,19 @@ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.cust
34
34
  * @license
35
35
  * Copyright 2017 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
- */;var w;const y=window,m=y.trustedTypes,g=m?m.emptyScript:"",x=y.reactiveElementPolyfillSupport,O={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>e!==t&&(e==e||t==t),j={attribute:!0,type:String,converter:O,reflect:!1,hasChanged:E};class N extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const r=this._$Ep(i,e);void 0!==r&&(this._$Ev.set(r,i),t.push(r))})),t}static createProperty(t,e=j){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||j}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(b(t))}else void 0!==t&&e.push(b(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return p(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=j){var r;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const o=(void 0!==(null===(r=i.converter)||void 0===r?void 0:r.toAttribute)?i.converter:O).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,e){var i;const r=this.constructor,n=r._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=r.getPropertyOptions(n),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:O;this._$El=n,this[n]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let r=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||E)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
37
+ */;var w;const y=window,g=y.trustedTypes,m=g?g.emptyScript:"",x=y.reactiveElementPolyfillSupport,O={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>e!==t&&(e==e||t==t),j={attribute:!0,type:String,converter:O,reflect:!1,hasChanged:E};class N extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const r=this._$Ep(i,e);void 0!==r&&(this._$Ev.set(r,i),t.push(r))})),t}static createProperty(t,e=j){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||j}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(b(t))}else void 0!==t&&e.push(b(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return p(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=j){var r;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const o=(void 0!==(null===(r=i.converter)||void 0===r?void 0:r.toAttribute)?i.converter:O).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,e){var i;const r=this.constructor,n=r._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=r.getPropertyOptions(n),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:O;this._$El=n,this[n]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let r=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||E)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
38
38
  /**
39
39
  * @license
40
40
  * Copyright 2017 Google LLC
41
41
  * SPDX-License-Identifier: BSD-3-Clause
42
42
  */
43
- var R;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==x||x({ReactiveElement:N}),(null!==(w=y.reactiveElementVersions)&&void 0!==w?w:y.reactiveElementVersions=[]).push("1.4.1");const S=window,C=S.trustedTypes,M=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,U="?"+A,T=`<${U}>`,$=document,I=(t="")=>$.createComment(t),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,F=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,_=/>/g,B=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),W=/'/g,D=/"/g,K=/^(?:script|style|textarea|title)$/i,H=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),V=new WeakMap,Z=$.createTreeWalker($,129,null,!1);class q{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const s=t.length-1,a=this.parts,[u,c]=((t,e)=>{const i=t.length-1,r=[];let n,o=2===e?"<svg>":"",s=L;for(let e=0;e<i;e++){const i=t[e];let a,u,c=-1,l=0;for(;l<i.length&&(s.lastIndex=l,u=s.exec(i),null!==u);)l=s.lastIndex,s===L?"!--"===u[1]?s=P:void 0!==u[1]?s=_:void 0!==u[2]?(K.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=B):void 0!==u[3]&&(s=B):s===B?">"===u[0]?(s=null!=n?n:L,c=-1):void 0===u[1]?c=-2:(c=s.lastIndex-u[2].length,a=u[1],s=void 0===u[3]?B:'"'===u[3]?D:W):s===D||s===W?s=B:s===P||s===_?s=L:(s=B,n=void 0);const h=s===B&&t[e+1].startsWith("/>")?" ":"";o+=s===L?i+T:c>=0?(r.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+A+h):i+A+(-2===c?(r.push(void 0),e):h)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(a):a,r]})(t,e);if(this.el=q.createElement(u,i),Z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=Z.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(A)){const i=c[o++];if(t.push(e),void 0!==i){const t=r.getAttribute(i.toLowerCase()+"$lit$").split(A),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?tt:"?"===e[1]?it:"@"===e[1]?rt:Q})}else a.push({type:6,index:n})}for(const e of t)r.removeAttribute(e)}if(K.test(r.tagName)){const t=r.textContent.split(A),e=t.length-1;if(e>0){r.textContent=C?C.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],I()),Z.nextNode(),a.push({type:2,index:++n});r.append(t[e],I())}}}else if(8===r.nodeType)if(r.data===U)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=r.data.indexOf(A,t+1));)a.push({type:7,index:n}),t+=A.length-1}n++}}static createElement(t,e){const i=$.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,r){var n,o,s,a;if(e===z)return e;let u=void 0!==r?null===(n=i._$Co)||void 0===n?void 0:n[r]:i._$Cl;const c=k(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==c&&(null===(o=null==u?void 0:u._$AO)||void 0===o||o.call(u,!1),void 0===c?u=void 0:(u=new c(t),u._$AT(t,i,r)),void 0!==r?(null!==(s=(a=i)._$Co)&&void 0!==s?s:a._$Co=[])[r]=u:i._$Cl=u),void 0!==u&&(e=X(t,u._$AS(t,e.values),u,r)),e}class G{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:r}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:$).importNode(i,!0);Z.currentNode=n;let o=Z.nextNode(),s=0,a=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new Y(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new nt(o,this,t)),this.u.push(e),u=r[++a]}s!==(null==u?void 0:u.index)&&(o=Z.nextNode(),s++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Y{constructor(t,e,i,r){var n;this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cm=null===(n=null==r?void 0:r.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),k(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==z&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>F(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==J&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T($.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=q.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new G(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=V.get(t.strings);return void 0===e&&V.set(t.strings,e=new q(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new Y(this.O(I()),this.O(I()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Q{constructor(t,e,i,r,n){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=J}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(void 0===n)t=X(this,t,e,0),o=!k(t)||t!==this._$AH&&t!==z,o&&(this._$AH=t);else{const r=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=X(this,r[i+s],e,s),a===z&&(a=this._$AH[s]),o||(o=!k(a)||a!==this._$AH[s]),a===J?t=J:t!==J&&(t+=(null!=a?a:"")+n[s+1]),this._$AH[s]=a}o&&!r&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tt extends Q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}const et=C?C.emptyScript:"";class it extends Q{constructor(){super(...arguments),this.type=4}j(t){t&&t!==J?this.element.setAttribute(this.name,et):this.element.removeAttribute(this.name)}}class rt extends Q{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:J)===z)return;const r=this._$AH,n=t===J&&r!==J||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==J&&(r===J||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const ot=S.litHtmlPolyfillSupport;null==ot||ot(q,Y),(null!==(R=S.litHtmlVersions)&&void 0!==R?R:S.litHtmlVersions=[]).push("2.4.0");
43
+ var R;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==x||x({ReactiveElement:N}),(null!==(w=y.reactiveElementVersions)&&void 0!==w?w:y.reactiveElementVersions=[]).push("1.4.1");const S=window,C=S.trustedTypes,M=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,T="?"+A,U=`<${T}>`,I=document,$=(t="")=>I.createComment(t),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,F=Array.isArray,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,_=/>/g,B=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),W=/'/g,D=/"/g,K=/^(?:script|style|textarea|title)$/i,H=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),V=new WeakMap,Z=I.createTreeWalker(I,129,null,!1);class q{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const s=t.length-1,a=this.parts,[u,c]=((t,e)=>{const i=t.length-1,r=[];let n,o=2===e?"<svg>":"",s=P;for(let e=0;e<i;e++){const i=t[e];let a,u,c=-1,l=0;for(;l<i.length&&(s.lastIndex=l,u=s.exec(i),null!==u);)l=s.lastIndex,s===P?"!--"===u[1]?s=L:void 0!==u[1]?s=_:void 0!==u[2]?(K.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=B):void 0!==u[3]&&(s=B):s===B?">"===u[0]?(s=null!=n?n:P,c=-1):void 0===u[1]?c=-2:(c=s.lastIndex-u[2].length,a=u[1],s=void 0===u[3]?B:'"'===u[3]?D:W):s===D||s===W?s=B:s===L||s===_?s=P:(s=B,n=void 0);const h=s===B&&t[e+1].startsWith("/>")?" ":"";o+=s===P?i+U:c>=0?(r.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+A+h):i+A+(-2===c?(r.push(void 0),e):h)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(a):a,r]})(t,e);if(this.el=q.createElement(u,i),Z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=Z.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(A)){const i=c[o++];if(t.push(e),void 0!==i){const t=r.getAttribute(i.toLowerCase()+"$lit$").split(A),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?tt:"?"===e[1]?it:"@"===e[1]?rt:Q})}else a.push({type:6,index:n})}for(const e of t)r.removeAttribute(e)}if(K.test(r.tagName)){const t=r.textContent.split(A),e=t.length-1;if(e>0){r.textContent=C?C.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],$()),Z.nextNode(),a.push({type:2,index:++n});r.append(t[e],$())}}}else if(8===r.nodeType)if(r.data===T)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=r.data.indexOf(A,t+1));)a.push({type:7,index:n}),t+=A.length-1}n++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,r){var n,o,s,a;if(e===z)return e;let u=void 0!==r?null===(n=i._$Co)||void 0===n?void 0:n[r]:i._$Cl;const c=k(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==c&&(null===(o=null==u?void 0:u._$AO)||void 0===o||o.call(u,!1),void 0===c?u=void 0:(u=new c(t),u._$AT(t,i,r)),void 0!==r?(null!==(s=(a=i)._$Co)&&void 0!==s?s:a._$Co=[])[r]=u:i._$Cl=u),void 0!==u&&(e=X(t,u._$AS(t,e.values),u,r)),e}class G{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:r}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:I).importNode(i,!0);Z.currentNode=n;let o=Z.nextNode(),s=0,a=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new Y(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new nt(o,this,t)),this.u.push(e),u=r[++a]}s!==(null==u?void 0:u.index)&&(o=Z.nextNode(),s++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Y{constructor(t,e,i,r){var n;this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cm=null===(n=null==r?void 0:r.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),k(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==z&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>F(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==J&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(I.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=q.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new G(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=V.get(t.strings);return void 0===e&&V.set(t.strings,e=new q(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new Y(this.O($()),this.O($()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Q{constructor(t,e,i,r,n){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=J}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(void 0===n)t=X(this,t,e,0),o=!k(t)||t!==this._$AH&&t!==z,o&&(this._$AH=t);else{const r=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=X(this,r[i+s],e,s),a===z&&(a=this._$AH[s]),o||(o=!k(a)||a!==this._$AH[s]),a===J?t=J:t!==J&&(t+=(null!=a?a:"")+n[s+1]),this._$AH[s]=a}o&&!r&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tt extends Q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}const et=C?C.emptyScript:"";class it extends Q{constructor(){super(...arguments),this.type=4}j(t){t&&t!==J?this.element.setAttribute(this.name,et):this.element.removeAttribute(this.name)}}class rt extends Q{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:J)===z)return;const r=this._$AH,n=t===J&&r!==J||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==J&&(r===J||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const ot=S.litHtmlPolyfillSupport;null==ot||ot(q,Y),(null!==(R=S.litHtmlVersions)&&void 0!==R?R:S.litHtmlVersions=[]).push("2.4.0");
44
44
  /**
45
45
  * @license
46
46
  * Copyright 2017 Google LLC
47
47
  * SPDX-License-Identifier: BSD-3-Clause
48
48
  */
49
- var st,at;class ut extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var r,n;const o=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;o._$litPart$=s=new Y(e.insertBefore(I(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return z}}ut.finalized=!0,ut._$litElement$=!0,null===(st=globalThis.litElementHydrateSupport)||void 0===st||st.call(globalThis,{LitElement:ut});const ct=globalThis.litElementPolyfillSupport;null==ct||ct({LitElement:ut}),(null!==(at=globalThis.litElementVersions)&&void 0!==at?at:globalThis.litElementVersions=[]).push("3.2.2");class lt{static create(t,e,i){let r=t=>d(null!=t?t:i),n=v`var(${d(t)}, ${r(i)})`;return n.name=t,n.category=e,n.defaultValue=i,n.defaultCssValue=r,n.get=e=>v`var(${d(t)}, ${r(e)})`,n.breadcrumb=()=>[],n.lastResortDefaultValue=()=>i,n}static extend(t,e,i){let r=t=>e.get(null!=t?t:i),n=v`var(${d(t)}, ${r(i)})`;return n.name=t,n.category=e.category,n.fallbackVariable=e,n.defaultValue=i,n.defaultCssValue=r,n.get=e=>v`var(${d(t)}, ${r(e)})`,n.breadcrumb=()=>[e.name,...e.breadcrumb()],n.lastResortDefaultValue=()=>i,n}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):d(null!=e?e:t.defaultValue),r=v`var(${d(t.name)}, ${i(t.defaultValue)})`;return r.name=t.name,r.category=t.category,r.fallbackVariable=t.fallbackVariable,r.defaultValue=t.defaultValue,r.context=e,r.defaultCssValue=i,r.get=e=>v`var(${d(t.name)}, ${i(e)})`,r.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],r.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},r}}lt.create("--ft-color-primary","COLOR","#2196F3"),lt.create("--ft-color-primary-variant","COLOR","#1976D2"),lt.create("--ft-color-secondary","COLOR","#FFCC80"),lt.create("--ft-color-secondary-variant","COLOR","#F57C00"),lt.create("--ft-color-surface","COLOR","#FFFFFF"),lt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-error","COLOR","#B00020"),lt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),lt.create("--ft-color-opacity-high","NUMBER","1"),lt.create("--ft-color-opacity-medium","NUMBER","0.74"),lt.create("--ft-color-opacity-disabled","NUMBER","0.38"),lt.create("--ft-color-on-primary","COLOR","#FFFFFF"),lt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),lt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),lt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),lt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),lt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),lt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),lt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),lt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),lt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),lt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),lt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),lt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),lt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),lt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),lt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),lt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),lt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),lt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),lt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),lt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),lt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),lt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),lt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),lt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),lt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),lt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),lt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),lt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),lt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),lt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),lt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),lt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-border-radius-S","SIZE","4px"),lt.create("--ft-border-radius-M","SIZE","8px"),lt.create("--ft-border-radius-L","SIZE","12px"),lt.create("--ft-border-radius-XL","SIZE","16px"),lt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),lt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),lt.create("--ft-transition-duration","UNKNOWN","250ms"),lt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");var ht=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 ft extends(
49
+ var st,at;class ut extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var r,n;const o=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;o._$litPart$=s=new Y(e.insertBefore($(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return z}}ut.finalized=!0,ut._$litElement$=!0,null===(st=globalThis.litElementHydrateSupport)||void 0===st||st.call(globalThis,{LitElement:ut});const ct=globalThis.litElementPolyfillSupport;null==ct||ct({LitElement:ut}),(null!==(at=globalThis.litElementVersions)&&void 0!==at?at:globalThis.litElementVersions=[]).push("3.2.2");class lt{static create(t,e,i){let r=t=>d(null!=t?t:i),n=v`var(${d(t)}, ${r(i)})`;return n.name=t,n.category=e,n.defaultValue=i,n.defaultCssValue=r,n.get=e=>v`var(${d(t)}, ${r(e)})`,n.breadcrumb=()=>[],n.lastResortDefaultValue=()=>i,n}static extend(t,e,i){let r=t=>e.get(null!=t?t:i),n=v`var(${d(t)}, ${r(i)})`;return n.name=t,n.category=e.category,n.fallbackVariable=e,n.defaultValue=i,n.defaultCssValue=r,n.get=e=>v`var(${d(t)}, ${r(e)})`,n.breadcrumb=()=>[e.name,...e.breadcrumb()],n.lastResortDefaultValue=()=>i,n}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):d(null!=e?e:t.defaultValue),r=v`var(${d(t.name)}, ${i(t.defaultValue)})`;return r.name=t.name,r.category=t.category,r.fallbackVariable=t.fallbackVariable,r.defaultValue=t.defaultValue,r.context=e,r.defaultCssValue=i,r.get=e=>v`var(${d(t.name)}, ${i(e)})`,r.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],r.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},r}}lt.create("--ft-color-primary","COLOR","#2196F3"),lt.create("--ft-color-primary-variant","COLOR","#1976D2"),lt.create("--ft-color-secondary","COLOR","#FFCC80"),lt.create("--ft-color-secondary-variant","COLOR","#F57C00"),lt.create("--ft-color-surface","COLOR","#FFFFFF"),lt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-error","COLOR","#B00020"),lt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),lt.create("--ft-color-opacity-high","NUMBER","1"),lt.create("--ft-color-opacity-medium","NUMBER","0.74"),lt.create("--ft-color-opacity-disabled","NUMBER","0.38"),lt.create("--ft-color-on-primary","COLOR","#FFFFFF"),lt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),lt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),lt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),lt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),lt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),lt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),lt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),lt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),lt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),lt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),lt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),lt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),lt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),lt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),lt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),lt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),lt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),lt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),lt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),lt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),lt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),lt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),lt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),lt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),lt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),lt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),lt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),lt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),lt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),lt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),lt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),lt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),lt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),lt.create("--ft-border-radius-S","SIZE","4px"),lt.create("--ft-border-radius-M","SIZE","8px"),lt.create("--ft-border-radius-L","SIZE","12px"),lt.create("--ft-border-radius-XL","SIZE","16px"),lt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),lt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),lt.create("--ft-transition-duration","UNKNOWN","250ms"),lt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");var ht=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 ft extends(
50
50
  /**
51
51
  * @license
52
52
  * Copyright 2021 Google LLC
@@ -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 Rt(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=St),Object.freeze(t),e&&wt(t,(function(t,e){return Rt(e,!0)}),!0)),t}function St(){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 Ut(t,e){e&&(Mt("Patches"),t.u=[],t.s=[],t.v=e)}function Tt(t){$t(t),t.p.forEach(kt),t.p=null}function $t(t){t===Zt&&(Zt=t.l)}function It(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&&(Tt(e),vt(4)),bt(t)&&(t=Lt(e,t),e.l||_t(e,t)),e.u&&Mt("Patches").M(i[ee].t,t,e.u,e.s)):t=Lt(e,i,[]),Tt(e),e.u&&e.v(e.u,e.s),t!==Qt?t:void 0}function Lt(t,e,i){if(Ct(e))return e;var r=e[ee];if(!r)return wt(e,(function(n,o){return Pt(t,r,e,n,o,i)}),!0),e;if(r.A!==t)return e;if(!r.P)return _t(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 Pt(t,r,n,e,o,i)})),_t(t,n,!1),i&&t.u&&Mt("Patches").R(r,i,t.u,t.s)}return r.o}function Pt(t,e,i,r,n,o){if(pt(n)){var s=Lt(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;Lt(t,n),e&&e.A.l||_t(t,n)}}function _t(t,e,i){void 0===i&&(i=!1),t.h.F&&t.m&&Rt(e,i)}function Bt(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===Bt(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=Bt(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!==Bt(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=It(e),u=Ht(e,t,void 0),c=!0;try{s=i(u),c=!1}finally{c?Tt(a):$t(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Ut(a,r),Ft(t,a)}),(function(t){throw Tt(a),t})):(Ut(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&&Rt(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=It(this),i=Ht(this,t,void 0);return i[ee].C=!0,$t(e),i},e.finishDraft=function(t,e){var i=(t&&t[ee]).A;return Ut(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 Re,Se=Ne,Ce=(Re=function(t,e){return Re=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])},Re(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}Re(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,Ue=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,Ie=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={}))Te.call(e,i)&&Ie(t,i,e[i]);if(Ue)for(var r=0,n=Ue(e);r<n.length;r++){i=n[r];$e.call(e,i)&&Ie(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 Le=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 Pe(t){return bt(t)?he(t,(function(){})):t}function _e(){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 Le;i&&(!function(t){return"boolean"==typeof t}(i)?r.push(Se.withExtraArgument(i.extraArgument)):r.push(Se));return r}(t)}}function Be(t){var e,i=_e(),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:Pe(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 Pe(t())};else{var c=Pe(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},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{convertNodes(t){var e,i,r,n;const o={},s=new Set,a=new Set,u=[],c=(t,e,i)=>t.map((t=>{var r;t.page&&u.push(t.tocId);let n=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const l={...t,prettyUrl:n,depth:e,parentTocId:i,children:c(t.children,e+1,t.tocId)};return n&&(s.has(n)&&a.add(n),s.add(n)),o[t.tocId]=l,l})),l=c(null!=t?t:[],1),h=this.buildPages(u,o);let f={};return 0===h.length?h.push({number:1,title:null!==(i=null===(e=l[0])||void 0===e?void 0:e.title)&&void 0!==i?i:"",rootTocId:null!==(n=null===(r=l[0])||void 0===r?void 0:r.tocId)&&void 0!==n?n:"root",toc:[],topics:this.tocIds(l),hiddenTopics:[],breadcrumb:[]}):f=this.indexPages(h),{toc:l,nodeByTocId:o,duplicatedPrettyUrls:a,pages:h,pageByTocId:f}}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildPages(t,e){return t.map((t=>e[t])).map(((t,i)=>{var r,n,o,s,a;const u={number:i+1,title:t.title,rootTocId:t.tocId,toc:(null===(r=t.page)||void 0===r?void 0:r.onItsOwn)?[]:t.children,topics:[],hiddenTopics:[],breadcrumb:this.buildBreadcrumb(t,e)},c=(t,e)=>(e?u.topics:u.hiddenTopics).push(t),l=null!==(o=null===(n=t.page)||void 0===n?void 0:n.parentsVisibility)&&void 0!==o?o:[];return u.breadcrumb.forEach(((t,e)=>{c(t,l[e])})),c(t.tocId,null===(s=t.page)||void 0===s?void 0:s.visible),(null===(a=t.page)||void 0===a?void 0:a.onItsOwn)||u.topics.push(...this.tocIds(t.children)),u}))}buildBreadcrumb(t,e){const i=[];for(;null==t?void 0:t.parentTocId;)i.unshift(t.parentTocId),t=e[t.parentTocId];return i}indexPages(t){const e={};for(let i of t)for(let t of[...i.topics,...i.hiddenTopics])e[t]||(e[t]=i);return e}}class Ye{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 Ye(new Ge,new window.fluidtopics.FluidTopicsApi(t,e,!0),t,i)}clear(){this.map=void 0,this.enrichedToc=void 0,this.topics={},this.topicContents={}}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.getTableOfContent(this.mapId).then((t=>this.converter.convertNodes(t)))))}async getToc(){return(await this.getEnrichedToc()).toc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeOrThrow(t){if("boolean"==typeof this.enrichedToc)throw new Error((this.enrichedToc," still loading"));if(this.enrichedToc instanceof Error)throw this.enrichedToc;return this.enrichedToc.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))}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))}}class Qe{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:"",apiIntegrationIdentifier:"ft-reader",visibleTopics:[],renderBeforeFirst:2,renderAfterLast:3,labels:{}},reducers:qe}))(t.trim()||"context");return new Qe(function(t,e,i){window.ftReduxStores||(window.ftReduxStores={});const r=e||t.name;return window.ftReduxStores[r]||(window.ftReduxStores[r]=Be({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 navigateToTopic(t,e,i){for(;null==this.service;)await a(5);let r=null!=i?await this.service.getPage(i):await this.service.getPageByTocId(t);this.dispatch(this.slice.actions.setCurrentPage(r),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){for(;null==this.service;)await a(5);let e=await this.service.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(e))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,i){this.store.getState()[t]!==i&&(this.dispatch(this.slice.actions[e](i)),this.clearAll(),this.reload())}clearAll(){this.service=void 0,this.dispatch(this.slice.actions.setMap(void 0),this.slice.actions.setToc(void 0),this.slice.actions.setCurrentPage(void 0))}reload(){const t=this.store.getState();t.baseUrl&&t.apiIntegrationIdentifier&&t.mapId?(this.service=Ye.build(t.baseUrl,t.apiIntegrationIdentifier,t.mapId),this.service.labels=t.labels):this.service=void 0,this.reloadDebouncer.run((async()=>{this.reloadMap(),this.reloadToc()}))}async reloadMap(){var t;const e=await(null===(t=this.service)||void 0===t?void 0:t.getMap());this.dispatch(this.slice.actions.setMap(e))}async reloadToc(){var t;const e=await(null===(t=this.service)||void 0===t?void 0:t.getToc());this.dispatch(this.slice.actions.setToc(e))}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const ti=v`
82
- `;var ei=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 ii extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class ri extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class ni extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}const oi=t=>e=>+(null!=e?e:"NaN")>0?+e:t;class si 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`
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 gt(t,e){return 2===yt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function mt(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 Rt(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=St),Object.freeze(t),e&&wt(t,(function(t,e){return Rt(e,!0)}),!0)),t}function St(){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 Ut(t){It(t),t.p.forEach(kt),t.p=null}function It(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&&(Ut(e),vt(4)),bt(t)&&(t=Pt(e,t),e.l||_t(e,t)),e.u&&Mt("Patches").M(i[ee].t,t,e.u,e.s)):t=Pt(e,i,[]),Ut(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 _t(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)})),_t(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&&!gt(e.D,r)?o.concat(r):void 0);if(mt(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||_t(t,n)}}function _t(t,e,i){void 0===i&&(i=!1),t.h.F&&t.m&&Rt(e,i)}function Bt(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||mt(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(!gt(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===Bt(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=Bt(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||gt(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!==Bt(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?Ut(a):It(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Tt(a,r),Ft(t,a)}),(function(t){throw Ut(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&&Rt(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,It(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 ge(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 me(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(me)(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(!ge(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 Re,Se=Ne,Ce=(Re=function(t,e){return Re=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])},Re(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}Re(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,Ue=Object.prototype.hasOwnProperty,Ie=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={}))Ue.call(e,i)&&$e(t,i,e[i]);if(Te)for(var r=0,n=Te(e);r<n.length;r++){i=n[r];Ie.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 _e(){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(Se.withExtraArgument(i.extraArgument)):r.push(Se));return r}(t)}}function Be(t){var e,i=_e(),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)),me(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&&!gt(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]||gt(n,e)?s[e]||t(o[e]):(s[e]=!0,Dt(i)))})),wt(n,(function(t){void 0!==o[t]||gt(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={}}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)}}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:"",apiIntegrationIdentifier:"ft-reader",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]=Be({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 navigateToTopic(t,e,i){for(;null==this.service;)await a(5);let r=null!=i?await this.service.getPage(i):await this.service.getPageByTocId(t);this.dispatch(this.slice.actions.setCurrentPage(r),this.slice.actions.setScrollTarget({tocId:t,section:e}))}async navigateToPage(t){for(;null==this.service;)await a(5);let e=await this.service.getPage(t);this.dispatch(this.slice.actions.setCurrentPage(e))}scrollDone(){this.dispatch(this.slice.actions.setScrollTarget({}))}setRequiredStateField(t,e,i){this.store.getState()[t]!==i&&(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.slice.actions[e](i)),this.reload())}reload(){const t=this.store.getState();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.reloadDebouncer.run((async()=>{this.reloadMap(),this.reloadToc()}))}async reloadMap(){var t;const e=await(null===(t=this.service)||void 0===t?void 0:t.getMap());this.dispatch(this.slice.actions.setMap(e))}async reloadToc(){var t,e;const i=await(null===(t=this.service)||void 0===t?void 0:t.getToc()),r=await(null===(e=this.service)||void 0===e?void 0:e.getPagesToc());this.dispatch(this.slice.actions.setToc(i),this.slice.actions.setPagesToc(r))}dispatch(...t){for(let e of t)this.store.dispatch(e)}}const ei=v`
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})}}const si=t=>e=>+(null!=e?e:"NaN")>0?+e:t;class ai 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
  <slot @register-ft-reader-component=${this.registerComponent}></slot>
84
- `}get stateManager(){return null==this._stateManager&&(this._stateManager=Qe.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this.store=this.stateManager.store),this._stateManager}updated(t){super.updated(t),t.has("baseUrl")&&this.baseUrl&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),(t.has("tocId")||t.has("section")||t.has("page"))&&this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):t.has("page")&&!this.tocId&&null!=this.page?this.stateManager.navigateToPage(this.page):t.has("mapId")&&this.mapId&&this.navigateToTarget(),t.has("renderBeforeFirst")&&this.stateManager.setRenderBeforeFirst(this.renderBeforeFirst),t.has("renderAfterLast")&&this.stateManager.setRenderAfterLast(this.renderAfterLast),t.has("labels")&&this.stateManager.setLabels(this.labels)}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new ii(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)){const e=t.get("scrollTarget");null!=(null==e?void 0:e.tocId)&&this.navigationDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(e.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,e.section).then((t=>this.dispatchEvent(new ni(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var e;return this.stateManager.service.getAccurateNavigationData(t,null===(e=this.currentPage)||void 0===e?void 0:e.number)}))).then((t=>{let e=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>({tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated})));this.dispatchEvent(new ri(this.map,e))}))}navigateToTarget(){null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}}var ai;si.styles=ti,ei([r()],si.prototype,"baseUrl",void 0),ei([r()],si.prototype,"apiIntegrationIdentifier",void 0),ei([r()],si.prototype,"mapId",void 0),ei([r()],si.prototype,"tocId",void 0),ei([r()],si.prototype,"section",void 0),ei([r({type:Number,converter:{fromAttribute:oi()}})],si.prototype,"page",void 0),ei([r({type:Number,converter:{fromAttribute:oi(2)}})],si.prototype,"renderBeforeFirst",void 0),ei([r({type:Number,converter:{fromAttribute:oi(3)}})],si.prototype,"renderAfterLast",void 0),ei([o({})],si.prototype,"labels",void 0),ei([ze()],si.prototype,"map",void 0),ei([ze()],si.prototype,"toc",void 0),ei([ze()],si.prototype,"visibleTopics",void 0),ei([ze()],si.prototype,"currentPage",void 0),ei([ze()],si.prototype,"scrollTarget",void 0),(ai="ft-reader-context",t=>{window.customElements.get(ai)||window.customElements.define(ai,t)})(si),t.FtReaderContext=si,t.FtReaderContextCssVariables={},t.MapLoadedEvent=ii,t.NavigationDoneEvent=ni,t.VisibleTopicsChangeEvent=ri,t.styles=ti,Object.defineProperty(t,"U",{value:!0})}({});
84
+ `}get stateManager(){return null==this._stateManager&&(this._stateManager=ti.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this.store=this.stateManager.store),this._stateManager}updated(t){super.updated(t),t.has("baseUrl")&&this.baseUrl&&this.stateManager.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),(t.has("tocId")||t.has("section")||t.has("page"))&&this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):t.has("page")&&!this.tocId&&null!=this.page?this.stateManager.navigateToPage(this.page):t.has("mapId")&&this.mapId&&this.navigateToTarget(),t.has("renderBeforeFirst")&&this.stateManager.setRenderBeforeFirst(this.renderBeforeFirst),t.has("renderAfterLast")&&this.stateManager.setRenderAfterLast(this.renderAfterLast),t.has("labels")&&this.stateManager.setLabels(this.labels)}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new ri(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)){const e=t.get("scrollTarget");null!=(null==e?void 0:e.tocId)&&this.navigationDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(e.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,e.section).then((t=>this.dispatchEvent(new oi(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var e;return this.stateManager.service.getAccurateNavigationData(t,null===(e=this.currentPage)||void 0===e?void 0:e.number)}))).then((t=>{let e=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>({tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated})));this.dispatchEvent(new ni(this.map,e))}))}navigateToTarget(){null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}}var ui;ai.styles=ei,ii([r()],ai.prototype,"baseUrl",void 0),ii([r()],ai.prototype,"apiIntegrationIdentifier",void 0),ii([r()],ai.prototype,"mapId",void 0),ii([r()],ai.prototype,"tocId",void 0),ii([r()],ai.prototype,"section",void 0),ii([r({type:Number,converter:{fromAttribute:si()}})],ai.prototype,"page",void 0),ii([r({type:Number,converter:{fromAttribute:si(2)}})],ai.prototype,"renderBeforeFirst",void 0),ii([r({type:Number,converter:{fromAttribute:si(3)}})],ai.prototype,"renderAfterLast",void 0),ii([o({})],ai.prototype,"labels",void 0),ii([ze()],ai.prototype,"map",void 0),ii([ze()],ai.prototype,"toc",void 0),ii([ze()],ai.prototype,"visibleTopics",void 0),ii([ze()],ai.prototype,"currentPage",void 0),ii([ze()],ai.prototype,"scrollTarget",void 0),(ui="ft-reader-context",t=>{window.customElements.get(ui)||window.customElements.define(ui,t)})(ai),t.FtReaderContext=ai,t.FtReaderContextCssVariables={},t.MapLoadedEvent=ri,t.NavigationDoneEvent=oi,t.VisibleTopicsChangeEvent=ni,t.styles=ei,Object.defineProperty(t,"U",{value:!0})}({});
@@ -19,7 +19,6 @@ export declare class FtReaderStateManager {
19
19
  navigateToPage(pageNumber: number): Promise<void>;
20
20
  scrollDone(): void;
21
21
  private setRequiredStateField;
22
- private clearAll;
23
22
  private reloadDebouncer;
24
23
  private reload;
25
24
  private reloadMap;
@@ -54,15 +54,11 @@ export class FtReaderStateManager {
54
54
  }
55
55
  setRequiredStateField(field, setter, value) {
56
56
  if (this.store.getState()[field] !== value) {
57
- this.dispatch(this.slice.actions[setter](value));
58
- this.clearAll();
57
+ this.service = undefined;
58
+ this.dispatch(this.slice.actions.setMap(undefined), this.slice.actions.setToc(undefined), this.slice.actions.setPagesToc(undefined), this.slice.actions.setCurrentPage(undefined), this.slice.actions[setter](value));
59
59
  this.reload();
60
60
  }
61
61
  }
62
- clearAll() {
63
- this.service = undefined;
64
- this.dispatch(this.slice.actions.setMap(undefined), this.slice.actions.setToc(undefined), this.slice.actions.setCurrentPage(undefined));
65
- }
66
62
  reload() {
67
63
  const state = this.store.getState();
68
64
  if (state.baseUrl && state.apiIntegrationIdentifier && state.mapId) {
@@ -83,9 +79,10 @@ export class FtReaderStateManager {
83
79
  this.dispatch(this.slice.actions.setMap(map));
84
80
  }
85
81
  async reloadToc() {
86
- var _a;
82
+ var _a, _b;
87
83
  const toc = await ((_a = this.service) === null || _a === void 0 ? void 0 : _a.getToc());
88
- this.dispatch(this.slice.actions.setToc(toc));
84
+ const pagesToc = await ((_b = this.service) === null || _b === void 0 ? void 0 : _b.getPagesToc());
85
+ this.dispatch(this.slice.actions.setToc(toc), this.slice.actions.setPagesToc(pagesToc));
89
86
  }
90
87
  dispatch(...actions) {
91
88
  for (let action of actions) {
@@ -2,6 +2,12 @@ import { Store } from "@reduxjs/toolkit";
2
2
  import { FtMap, FtRatingType, FtTocNode, FtTopic, FtTopicRating } from "@fluid-topics/public-api";
3
3
  import { ParametrizedLabels } from "@fluid-topics/ft-wc-utils";
4
4
  export declare type FtReaderStore = Store<FtReaderState>;
5
+ export interface FtPagesTocNode {
6
+ depth: number;
7
+ tocId: string;
8
+ title: string;
9
+ children: Array<FtPagesTocNode>;
10
+ }
5
11
  export interface FtReaderTocNode extends FtTocNode {
6
12
  depth: number;
7
13
  parentTocId?: string;
@@ -30,6 +36,7 @@ export interface FtReaderState {
30
36
  tocId?: string;
31
37
  map?: FtMap;
32
38
  toc?: Array<FtReaderTocNode>;
39
+ pagesToc?: Array<FtPagesTocNode>;
33
40
  currentPage?: FtReaderPage;
34
41
  scrollTarget?: FtReaderScrollTarget;
35
42
  visibleTopics: string[];
@@ -7,6 +7,7 @@ declare const readerStateReducers: {
7
7
  setTocId: (state: FtReaderState, action: PayloadAction<FtReaderState["tocId"]>) => void;
8
8
  setMap: (state: FtReaderState, action: PayloadAction<FtReaderState["map"]>) => void;
9
9
  setToc: (state: FtReaderState, action: PayloadAction<FtReaderState["toc"]>) => void;
10
+ setPagesToc: (state: FtReaderState, action: PayloadAction<FtReaderState["pagesToc"]>) => void;
10
11
  setCurrentPage: (state: FtReaderState, action: PayloadAction<FtReaderState["currentPage"]>) => void;
11
12
  setScrollTarget: (state: FtReaderState, action: PayloadAction<FtReaderState["scrollTarget"]>) => void;
12
13
  setVisibleTopics: (state: FtReaderState, action: PayloadAction<FtReaderState["visibleTopics"]>) => void;
@@ -22,6 +23,7 @@ export declare const createReaderSlice: (id: string) => import("@reduxjs/toolkit
22
23
  setTocId: (state: FtReaderState, action: PayloadAction<FtReaderState["tocId"]>) => void;
23
24
  setMap: (state: FtReaderState, action: PayloadAction<FtReaderState["map"]>) => void;
24
25
  setToc: (state: FtReaderState, action: PayloadAction<FtReaderState["toc"]>) => void;
26
+ setPagesToc: (state: FtReaderState, action: PayloadAction<FtReaderState["pagesToc"]>) => void;
25
27
  setCurrentPage: (state: FtReaderState, action: PayloadAction<FtReaderState["currentPage"]>) => void;
26
28
  setScrollTarget: (state: FtReaderState, action: PayloadAction<FtReaderState["scrollTarget"]>) => void;
27
29
  setVisibleTopics: (state: FtReaderState, action: PayloadAction<FtReaderState["visibleTopics"]>) => void;
@@ -18,6 +18,9 @@ const readerStateReducers = {
18
18
  setToc: (state, action) => {
19
19
  state.toc = action.payload;
20
20
  },
21
+ setPagesToc: (state, action) => {
22
+ state.pagesToc = action.payload;
23
+ },
21
24
  setCurrentPage: (state, action) => {
22
25
  state.currentPage = action.payload;
23
26
  },
@@ -1,17 +1,15 @@
1
- import { FtTocNode } from "@fluid-topics/public-api";
2
- import { FtReaderPage, FtReaderTocNode } from "../model";
1
+ import { FtPaginatedToc, FtPaginationConfiguration } from "@fluid-topics/public-api";
2
+ import { FtPagesTocNode, FtReaderPage, FtReaderTocNode } from "../model";
3
3
  export declare type EnrichedToc = {
4
+ paginationConfiguration: FtPaginationConfiguration;
4
5
  toc: Array<FtReaderTocNode>;
6
+ pagesToc: Array<FtPagesTocNode>;
5
7
  nodeByTocId: Record<string, FtReaderTocNode>;
6
8
  duplicatedPrettyUrls: Set<string>;
7
9
  pages: Array<FtReaderPage>;
8
10
  pageByTocId: Record<string, FtReaderPage>;
9
11
  };
10
12
  export declare class FtReaderConverter {
11
- convertNodes(nodes?: Array<FtTocNode>): EnrichedToc;
12
- private tocIds;
13
- private buildPages;
14
- private buildBreadcrumb;
15
- private indexPages;
13
+ convertPaginatedToc(paginatedToc: FtPaginatedToc): EnrichedToc;
16
14
  }
17
15
  //# sourceMappingURL=FtReaderConverter.d.ts.map
@@ -1,97 +1,140 @@
1
- export class FtReaderConverter {
2
- convertNodes(nodes) {
3
- var _a, _b, _c, _d;
4
- const nodeByTocId = {};
5
- const knownPrettyUrls = new Set();
6
- const duplicatedPrettyUrls = new Set();
7
- const pagesToBuild = [];
8
- const convertNodesRec = (nodes, depth, parentTocId) => nodes.map(node => {
9
- var _a;
10
- if (node.page) {
11
- pagesToBuild.push(node.tocId);
1
+ class EnrichedTocBuilder {
2
+ constructor(paginatedToc) {
3
+ this.paginatedToc = paginatedToc;
4
+ this.nodeByTocId = {};
5
+ this.knownPrettyUrls = new Set();
6
+ this.duplicatedPrettyUrls = new Set();
7
+ this.pages = [];
8
+ this.pageByTocId = {};
9
+ }
10
+ build() {
11
+ return {
12
+ paginationConfiguration: this.paginatedToc.configuration,
13
+ toc: this.convertNodes(this.paginatedToc.paginatedToc, 1),
14
+ pagesToc: this.extractPagesToc(this.paginatedToc.paginatedToc, 1),
15
+ nodeByTocId: this.nodeByTocId,
16
+ duplicatedPrettyUrls: this.duplicatedPrettyUrls,
17
+ pages: this.pages,
18
+ pageByTocId: this.pageByTocId,
19
+ };
20
+ }
21
+ extractPagesToc(nodes, depth, parentTocId) {
22
+ return nodes.flatMap(node => {
23
+ if (node.pageConfiguration) {
24
+ this.registerPage(this.buildPage(node, parentTocId));
25
+ }
26
+ if (node.tocId == null) {
27
+ return this.extractPagesToc(node.children, depth, parentTocId);
28
+ }
29
+ return [{
30
+ tocId: node.tocId,
31
+ title: node.title,
32
+ depth,
33
+ children: this.extractPagesToc(node.children, depth + 1, node.tocId)
34
+ }];
35
+ });
36
+ }
37
+ convertNodes(nodes, depth, parentTocId) {
38
+ return nodes.flatMap(node => {
39
+ var _a, _b, _c;
40
+ if (node.tocId == null) {
41
+ return [
42
+ ...this.convertSectionNodes((_a = node.pageToc) !== null && _a !== void 0 ? _a : [], depth, node.tocId),
43
+ ...this.convertNodes(node.children, depth, node.tocId)
44
+ ];
12
45
  }
46
+ let prettyUrl = (_b = node.prettyUrl) === null || _b === void 0 ? void 0 : _b.replace(/^\//, "");
47
+ const enrichedNode = {
48
+ tocId: node.tocId,
49
+ contentId: node.contentId,
50
+ title: node.title,
51
+ prettyUrl,
52
+ depth,
53
+ parentTocId: parentTocId,
54
+ children: []
55
+ };
56
+ this.register(enrichedNode);
57
+ const sectionChildren = this.convertSectionNodes((_c = node.pageToc) !== null && _c !== void 0 ? _c : [], depth + 1, node.tocId);
58
+ const childrenWithPages = this.convertNodes(node.children, depth + 1, enrichedNode.tocId);
59
+ enrichedNode.children = [
60
+ ...sectionChildren,
61
+ ...childrenWithPages
62
+ ];
63
+ return [enrichedNode];
64
+ });
65
+ }
66
+ convertSectionNodes(nodes, depth, parentTocId) {
67
+ return nodes.flatMap(node => {
68
+ var _a;
13
69
  let prettyUrl = (_a = node.prettyUrl) === null || _a === void 0 ? void 0 : _a.replace(/^\//, "");
14
70
  const enrichedNode = {
15
- ...node,
71
+ tocId: node.tocId,
72
+ contentId: node.contentId,
73
+ title: node.title,
16
74
  prettyUrl,
17
75
  depth,
18
76
  parentTocId,
19
- children: convertNodesRec(node.children, depth + 1, node.tocId)
77
+ children: []
20
78
  };
21
- if (prettyUrl) {
22
- if (knownPrettyUrls.has(prettyUrl)) {
23
- duplicatedPrettyUrls.add(prettyUrl);
24
- }
25
- knownPrettyUrls.add(prettyUrl);
26
- }
27
- nodeByTocId[node.tocId] = enrichedNode;
28
- return enrichedNode;
79
+ this.register(enrichedNode);
80
+ enrichedNode.children = this.convertSectionNodes(node.children, depth + 1, node.tocId);
81
+ return [enrichedNode];
82
+ });
83
+ }
84
+ buildPage(node, parentTocId) {
85
+ var _a, _b, _c, _d, _e, _f;
86
+ const page = {
87
+ number: this.pages.length + 1,
88
+ title: (_a = node.title) !== null && _a !== void 0 ? _a : "",
89
+ rootTocId: (_b = node.tocId) !== null && _b !== void 0 ? _b : "root",
90
+ toc: ((_c = node.pageToc) !== null && _c !== void 0 ? _c : []).map(n => this.nodeByTocId[n.tocId]),
91
+ topics: [],
92
+ hiddenTopics: [],
93
+ breadcrumb: parentTocId ? this.buildBreadcrumb(this.nodeByTocId[parentTocId]) : []
94
+ };
95
+ const add = (tocId, visible) => (visible ? page.topics : page.hiddenTopics).push(tocId);
96
+ const parentsVisibility = (_e = (_d = node.pageConfiguration) === null || _d === void 0 ? void 0 : _d.parentsVisibility) !== null && _e !== void 0 ? _e : [];
97
+ page.breadcrumb.forEach((tocId, index) => {
98
+ add(tocId, parentsVisibility[index]);
29
99
  });
30
- const toc = convertNodesRec(nodes !== null && nodes !== void 0 ? nodes : [], 1);
31
- const pages = this.buildPages(pagesToBuild, nodeByTocId);
32
- let pageByTocId = {};
33
- if (pages.length === 0) {
34
- pages.push({
35
- number: 1,
36
- title: (_b = (_a = toc[0]) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : "",
37
- rootTocId: (_d = (_c = toc[0]) === null || _c === void 0 ? void 0 : _c.tocId) !== null && _d !== void 0 ? _d : "root",
38
- toc: [],
39
- topics: this.tocIds(toc),
40
- hiddenTopics: [],
41
- breadcrumb: []
42
- });
100
+ if (node.tocId) {
101
+ add(node.tocId, node.pageConfiguration.isVisible);
43
102
  }
44
- else {
45
- pageByTocId = this.indexPages(pages);
103
+ page.topics.push(...this.tocIds((_f = node.pageToc) !== null && _f !== void 0 ? _f : []));
104
+ return page;
105
+ }
106
+ registerPage(page) {
107
+ for (let tocId of [...page.topics, ...page.hiddenTopics]) {
108
+ if (!this.pageByTocId[tocId]) {
109
+ this.pageByTocId[tocId] = page;
110
+ }
46
111
  }
47
- return { toc, nodeByTocId, duplicatedPrettyUrls, pages, pageByTocId };
112
+ this.pages.push(page);
48
113
  }
49
114
  tocIds(nodes) {
50
115
  return nodes.flatMap(node => [node.tocId, ...this.tocIds(node.children)]);
51
116
  }
52
- buildPages(pagesToBuild, nodeByTocId) {
53
- return pagesToBuild.map(tocId => nodeByTocId[tocId])
54
- .map((node, index) => {
55
- var _a, _b, _c, _d, _e;
56
- const page = {
57
- number: index + 1,
58
- title: node.title,
59
- rootTocId: node.tocId,
60
- toc: ((_a = node.page) === null || _a === void 0 ? void 0 : _a.onItsOwn) ? [] : node.children,
61
- topics: [],
62
- hiddenTopics: [],
63
- breadcrumb: this.buildBreadcrumb(node, nodeByTocId)
64
- };
65
- const add = (tocId, visible) => (visible ? page.topics : page.hiddenTopics).push(tocId);
66
- const parentsVisibility = (_c = (_b = node.page) === null || _b === void 0 ? void 0 : _b.parentsVisibility) !== null && _c !== void 0 ? _c : [];
67
- page.breadcrumb.forEach((tocId, index) => {
68
- add(tocId, parentsVisibility[index]);
69
- });
70
- add(node.tocId, (_d = node.page) === null || _d === void 0 ? void 0 : _d.visible);
71
- if (!((_e = node.page) === null || _e === void 0 ? void 0 : _e.onItsOwn)) {
72
- page.topics.push(...this.tocIds(node.children));
73
- }
74
- return page;
75
- });
76
- }
77
- buildBreadcrumb(node, nodeByTocId) {
78
- const breadcrumb = [];
117
+ buildBreadcrumb(node) {
118
+ const breadcrumb = [node.tocId];
79
119
  while (node === null || node === void 0 ? void 0 : node.parentTocId) {
80
120
  breadcrumb.unshift(node.parentTocId);
81
- node = nodeByTocId[node.parentTocId];
121
+ node = this.nodeByTocId[node.parentTocId];
82
122
  }
83
123
  return breadcrumb;
84
124
  }
85
- indexPages(pages) {
86
- const pageByTocId = {};
87
- for (let page of pages) {
88
- for (let tocId of [...page.topics, ...page.hiddenTopics]) {
89
- if (!pageByTocId[tocId]) {
90
- pageByTocId[tocId] = page;
91
- }
125
+ register(enrichedNode) {
126
+ if (enrichedNode.prettyUrl) {
127
+ if (this.knownPrettyUrls.has(enrichedNode.prettyUrl)) {
128
+ this.duplicatedPrettyUrls.add(enrichedNode.prettyUrl);
92
129
  }
130
+ this.knownPrettyUrls.add(enrichedNode.prettyUrl);
93
131
  }
94
- return pageByTocId;
132
+ this.nodeByTocId[enrichedNode.tocId] = enrichedNode;
133
+ }
134
+ }
135
+ export class FtReaderConverter {
136
+ convertPaginatedToc(paginatedToc) {
137
+ return new EnrichedTocBuilder(paginatedToc).build();
95
138
  }
96
139
  }
97
140
  //# sourceMappingURL=FtReaderConverter.js.map
@@ -1,6 +1,6 @@
1
1
  import type { FluidTopicsApi, FtMap, FtPublicationRatingSummary, FtTopic } from "@fluid-topics/public-api";
2
2
  import { FtRatingType } from "@fluid-topics/public-api";
3
- import { FtReaderLabels, FtReaderNavigationData, FtReaderPage, FtReaderTocNode, FtTopicRatingSummary } from "../model";
3
+ import { FtPagesTocNode, FtReaderLabels, FtReaderNavigationData, FtReaderPage, FtReaderTocNode, FtTopicRatingSummary } from "../model";
4
4
  import { FtReaderConverter } from "./FtReaderConverter";
5
5
  declare global {
6
6
  interface Window {
@@ -22,8 +22,9 @@ export declare class FtReaderService {
22
22
  private enrichedToc?;
23
23
  private getEnrichedToc;
24
24
  getToc(): Promise<Array<FtReaderTocNode>>;
25
+ getPagesToc(): Promise<Array<FtPagesTocNode>>;
25
26
  getTocNode(tocId: string): Promise<FtReaderTocNode>;
26
- getTocNodeOrThrow(tocId: string): FtReaderTocNode;
27
+ getTocNodeNow(tocId: string): FtReaderTocNode | undefined;
27
28
  getPage(number: number): Promise<FtReaderPage>;
28
29
  getPageByTocId(tocId: string): Promise<FtReaderPage>;
29
30
  private topics;
@@ -43,7 +44,9 @@ export declare class FtReaderService {
43
44
  getTopicRating(tocId: string): Promise<FtTopicRatingSummary>;
44
45
  rateMap(type: FtRatingType, value: number): Promise<undefined>;
45
46
  unrateMap(): Promise<undefined>;
47
+ sendMapFeedback(message: string): Promise<void>;
46
48
  rateTopic(tocId: string, type: FtRatingType, value: number): Promise<undefined>;
47
49
  unrateTopic(tocId: string): Promise<undefined>;
50
+ sendTopicFeedback(tocId: string, message: string): Promise<void>;
48
51
  }
49
52
  //# sourceMappingURL=FtReaderService.d.ts.map
@@ -31,25 +31,27 @@ export class FtReaderService {
31
31
  return this.loadIfNeeded(() => this.map, v => this.map = v, () => this.api.getMap(this.mapId));
32
32
  }
33
33
  getEnrichedToc() {
34
- return this.loadIfNeeded(() => this.enrichedToc, v => this.enrichedToc = v, () => this.api.getTableOfContent(this.mapId)
35
- .then(toc => this.converter.convertNodes(toc)));
34
+ return this.loadIfNeeded(() => this.enrichedToc, v => this.enrichedToc = v, () => this.api.getPages(this.mapId)
35
+ .then(toc => this.converter.convertPaginatedToc(toc)));
36
36
  }
37
37
  async getToc() {
38
38
  const enrichedToc = await this.getEnrichedToc();
39
39
  return enrichedToc.toc;
40
40
  }
41
+ async getPagesToc() {
42
+ const enrichedToc = await this.getEnrichedToc();
43
+ return enrichedToc.pagesToc;
44
+ }
41
45
  async getTocNode(tocId) {
42
46
  const enrichedToc = await this.getEnrichedToc();
43
47
  return enrichedToc.nodeByTocId[tocId];
44
48
  }
45
- getTocNodeOrThrow(tocId) {
46
- if (typeof this.enrichedToc === "boolean") {
47
- throw new Error("Toc node" + this.enrichedToc ? " still loading" : " loading failed");
48
- }
49
- if (this.enrichedToc instanceof Error) {
50
- throw this.enrichedToc;
49
+ getTocNodeNow(tocId) {
50
+ var _a;
51
+ if (typeof this.enrichedToc === "boolean" || this.enrichedToc instanceof Error) {
52
+ return undefined;
51
53
  }
52
- return this.enrichedToc.nodeByTocId[tocId];
54
+ return (_a = this.enrichedToc) === null || _a === void 0 ? void 0 : _a.nodeByTocId[tocId];
53
55
  }
54
56
  async getPage(number) {
55
57
  const enrichedToc = await this.getEnrichedToc();
@@ -142,11 +144,17 @@ export class FtReaderService {
142
144
  unrateMap() {
143
145
  return this.api.unrateMap(this.mapId).then(() => this.ratingSummary = undefined);
144
146
  }
147
+ sendMapFeedback(message) {
148
+ return this.api.sendMapFeedback(this.mapId, message);
149
+ }
145
150
  rateTopic(tocId, type, value) {
146
151
  return this.api.rateTopic(this.mapId, tocId, type, value).then(() => this.ratingSummary = undefined);
147
152
  }
148
153
  unrateTopic(tocId) {
149
154
  return this.api.unrateTopic(this.mapId, tocId).then(() => this.ratingSummary = undefined);
150
155
  }
156
+ sendTopicFeedback(tocId, message) {
157
+ return this.api.sendTopicFeedback(this.mapId, tocId, message);
158
+ }
151
159
  }
152
160
  //# 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.27",
3
+ "version": "0.3.30",
4
4
  "description": "Context block for integrated reader components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,15 +19,15 @@
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.27",
22
+ "@fluid-topics/ft-wc-utils": "0.3.30",
23
23
  "@reduxjs/toolkit": "^1.6.2",
24
24
  "lit": "2.2.8"
25
25
  },
26
26
  "devDependencies": {
27
- "@fluid-topics/public-api": "1.0.25"
27
+ "@fluid-topics/public-api": "1.0.27"
28
28
  },
29
29
  "peerDependencies": {
30
- "@fluid-topics/public-api": "1.0.25"
30
+ "@fluid-topics/public-api": "1.0.27"
31
31
  },
32
- "gitHead": "f5803fb3e6142ab47511c72bfb0e572828f3ad75"
32
+ "gitHead": "b82e37919b38b7a367762ddc9a1780dc0280d5d2"
33
33
  }