Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/capnfabs/paperesque.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Tamp <fabian.tamp@gmail.com>2022-06-20 01:32:21 +0300
committerFabian Tamp <fabian.tamp@gmail.com>2022-06-20 01:32:21 +0300
commit35157d042508b3c25a412bbe7112eac800f4977b (patch)
treeb743985981d3a3e7ecae6d4e74a88d17440655ce
parentf886ec19281c02837ebd7ba71fdbcdcf98060f74 (diff)
Get it working again with recent goldmarkHEADmainline
-rw-r--r--js/floatingFootnotes.js7
-rw-r--r--static/js/main.js2
2 files changed, 5 insertions, 4 deletions
diff --git a/js/floatingFootnotes.js b/js/floatingFootnotes.js
index 25ffb18..fd5bbc3 100644
--- a/js/floatingFootnotes.js
+++ b/js/floatingFootnotes.js
@@ -2,7 +2,9 @@ import { docReady, onWindowResize } from "./utils.js";
import { ResizeObserver } from '@juggle/resize-observer';
const ARTICLE_CONTENT_SELECTOR = "article#main";
-const FOOTNOTE_SECTION_SELECTOR = "section.footnotes[role=doc-endnotes]";
+const FOOTNOTE_SECTION_SELECTOR = "div.footnotes[role=doc-endnotes]";
+// this is a prefix-match on ID.
+const INDIVIDUAL_FOOTNOTE_SELECTOR = "li[id^='fn:']";
const FLOATING_FOOTNOTE_MIN_WIDTH = 1260;
// Computes an offset such that setting `top` on elemToAlign will put it
@@ -62,8 +64,7 @@ function clearFootnoteOffsets(footnotes) {
// lol.
function updateFootnoteFloat(shouldFloat) {
const footnoteSection = document.querySelector(FOOTNOTE_SECTION_SELECTOR);
- const footnotes = footnoteSection.querySelectorAll(
- "li[role=doc-endnote]");
+ const footnotes = footnoteSection.querySelectorAll(INDIVIDUAL_FOOTNOTE_SELECTOR);
if (shouldFloat) {
// Do this first because we need styles applied before doing other
diff --git a/static/js/main.js b/static/js/main.js
index e3aa7c0..b476957 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -1 +1 @@
-(function () {function G(e){var r=document.createElement("a");return r.className="header-link",r.title="Link to this section",r.href="#"+e,r.innerHTML="<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 8 8\"><path d=\"M5.88.03c-.18.01-.36.03-.53.09-.27.1-.53.25-.75.47a.5.5 0 1 0 .69.69c.11-.11.24-.17.38-.22.35-.12.78-.07 1.06.22.39.39.39 1.04 0 1.44l-1.5 1.5c-.44.44-.8.48-1.06.47-.26-.01-.41-.13-.41-.13a.5.5 0 1 0-.5.88s.34.22.84.25c.5.03 1.2-.16 1.81-.78l1.5-1.5c.78-.78.78-2.04 0-2.81-.28-.28-.61-.45-.97-.53-.18-.04-.38-.04-.56-.03zm-2 2.31c-.5-.02-1.19.15-1.78.75l-1.5 1.5c-.78.78-.78 2.04 0 2.81.56.56 1.36.72 2.06.47.27-.1.53-.25.75-.47a.5.5 0 1 0-.69-.69c-.11.11-.24.17-.38.22-.35.12-.78.07-1.06-.22-.39-.39-.39-1.04 0-1.44l1.5-1.5c.4-.4.75-.45 1.03-.44.28.01.47.09.47.09a.5.5 0 1 0 .44-.88s-.34-.2-.84-.22z\" /></svg>",r}function H(){var e=document.querySelectorAll("article#main");if(1==e.length){var r=e[0].querySelectorAll("h2, h3, h4");Array.prototype.forEach.call(r,function(e,r){var a=G(e.id);e.appendChild(a)})}}function I(){e(H)}function e(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,1):document.addEventListener("DOMContentLoaded",e)}function J(e){"complete"===document.readyState?setTimeout(e,1):window.addEventListener("load",e)}function K(e){J(function(){window.addEventListener("resize",e),setTimeout(e,1)})}var b=[];var L=function(){return b.some(function(e){return e.activeTargets.length>0})};var M=function(){return b.some(function(e){return e.skippedTargets.length>0})};var h="ResizeObserver loop completed with undelivered notifications.",N=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:h}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=h),window.dispatchEvent(e)};var O,c;!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(c||(O=c={},O));var y=function(){function t(t,h,i,e){return this.x=t,this.y=h,this.width=i,this.height=e,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Object.freeze(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(h){return new t(h.x,h.y,h.width,h.height)},t}();var w=function(e){return e instanceof SVGElement&&"getBBox"in e},A=function(e){if(w(e)){var t=e.getBBox(),i=t.width,$=t.height;return!i&&!$}var n=e,r=n.offsetWidth,s=n.offsetHeight;return!(r||s||e.getClientRects().length)},i=function(e){var t,i,$=null===(i=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===i?void 0:i.defaultView;return!!($&&e instanceof $.Element)},P=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0;}return!1};var a="undefined"!=typeof window?window:{};var q=new WeakMap,C=/auto|scroll/,Q=/^tb|vertical/,T=/msie|trident/i.test(a.navigator&&a.navigator.userAgent),j=function(e){return parseFloat(e||"0")},k=function(e,$,r){return void 0===e&&(e=0),void 0===$&&($=0),void 0===r&&(r=!1),Object.freeze({inlineSize:(r?$:e)||0,blockSize:(r?e:$)||0})},D=Object.freeze({devicePixelContentBoxSize:k(),borderBoxSize:k(),contentBoxSize:k(),contentRect:new y(0,0,0,0)}),l=function(e,$){if(void 0===$&&($=!1),q.has(e)&&!$)return q.get(e);if(A(e))return q.set(e,D),D;var r=getComputedStyle(e),i=w(e)&&e.ownerSVGElement&&e.getBBox(),t=!T&&"border-box"===r.boxSizing,o=Q.test(r.writingMode||""),P=!i&&C.test(r.overflowY||""),a=!i&&C.test(r.overflowX||""),n=i?0:j(r.paddingTop),s=i?0:j(r.paddingRight),c=i?0:j(r.paddingBottom),l=i?0:j(r.paddingLeft),v=i?0:j(r.borderTopWidth),Y=i?0:j(r.borderRightWidth),p=i?0:j(r.borderBottomWidth),d=l+s,x=n+c,z=(i?0:j(r.borderLeftWidth))+Y,u=v+p,B=a?e.offsetHeight-u-e.clientHeight:0,g=P?e.offsetWidth-z-e.clientWidth:0,h=t?d+z:0,m=t?x+u:0,R=i?i.width:j(r.width)-h-g,S=i?i.height:j(r.height)-m-B,b=R+d+g+z,O=S+x+B+u,f=Object.freeze({devicePixelContentBoxSize:k(Math.round(R*devicePixelRatio),Math.round(S*devicePixelRatio),o),borderBoxSize:k(b,O,o),contentBoxSize:k(R,S,o),contentRect:new y(l,n,R,S)});return q.set(e,f),f},m=function(e,$,r){var i=l(e,r),t=i.borderBoxSize,o=i.contentBoxSize,P=i.devicePixelContentBoxSize;switch($){case c.DEVICE_PIXEL_CONTENT_BOX:return P;case c.BORDER_BOX:return t;default:return o;}};var R=function(){return function(e){var t=l(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=[t.borderBoxSize],this.contentBoxSize=[t.contentBoxSize],this.devicePixelContentBoxSize=[t.devicePixelContentBoxSize]}}();var n=function(e){if(A(e))return 1/0;for(var r=0,t=e.parentNode;t;)r+=1,t=t.parentNode;return r};var S=function(){var e=1/0,r=[];b.forEach(function(t){if(0!==t.activeTargets.length){var a=[];t.activeTargets.forEach(function(r){var t=new R(r.target),s=n(r.target);a.push(t),r.lastReportedSize=m(r.target,r.observedBox),s<e&&(e=s)}),r.push(function(){t.callback.call(t.observer,a,t.observer)}),t.activeTargets.splice(0,t.activeTargets.length)}});for(var t=0,a=r;t<a.length;t++){(0,a[t])()}return e};var o=function(e){b.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(r){r.isActive()&&(n(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))})})};var U=function(){var r=0;for(o(r);L();)r=S(),o(r);return M()&&N(),r>0};var p,s=[],V=function(){return s.splice(0).forEach(function(a){return a()})},W=function(a){if(!p){var r=0,$=document.createTextNode("");new MutationObserver(function(){return V()}).observe($,{characterData:!0}),p=function(){$.textContent=""+(r?r--:r++)}}s.push(a),p()};var X=function(e){W(function(){requestAnimationFrame(e)})};var r=0,Y=function(){return!!r},Z=250,$={attributes:!0,characterData:!0,childList:!0,subtree:!0},t=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],u=function(e){return void 0===e&&(e=0),Date.now()+e},_=!1,aa=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var r=this;if(void 0===e&&(e=Z),!_){_=!0;var t=u(e);X(function(){var $=!1;try{$=U()}finally{if(_=!1,e=t-u(),!Y())return;$?r.run(1e3):e>0?r.run(e):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,r=function(){return e.observer&&e.observer.observe(document.body,$)};document.body?r():a.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),t.forEach(function(r){return a.addEventListener(r,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),t.forEach(function(r){return a.removeEventListener(r,e.listener,!0)}),this.stopped=!0)},e}(),g=new aa,v=function(e){!r&&e>0&&g.start(),!(r+=e)&&g.stop()};var ba=function(e){return!w(e)&&!P(e)&&"inline"===getComputedStyle(e).display},ca=function(){function e(e,i){this.target=e,this.observedBox=i||c.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=m(this.target,this.observedBox,!0);return ba(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}();var da=function(){return function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}}();var d=new WeakMap,x=function(e,r){for(var t=0;t<e.length;t+=1)if(e[t].target===r)return t;return-1},f=function(){function e(){}return e.connect=function(e,r){var t=new da(e,r);d.set(e,t)},e.observe=function(e,r,t){var s=d.get(e),$=0===s.observationTargets.length;x(s.observationTargets,r)<0&&($&&b.push(s),s.observationTargets.push(new ca(r,t&&t.box)),v(1),g.schedule())},e.unobserve=function(e,r){var t=d.get(e),s=x(t.observationTargets,r),$=1===t.observationTargets.length;s>=0&&($&&b.splice(b.indexOf(t),1),t.observationTargets.splice(s,1),v(-1))},e.disconnect=function(e){var r=this,t=d.get(e);t.observationTargets.slice().forEach(function(t){return r.unobserve(e,t.target)}),t.activeTargets.splice(0,t.activeTargets.length)},e}();var ea=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");f.connect(this,e)}return e.prototype.observe=function(e,r){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!i(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");f.observe(this,e,r)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!i(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");f.unobserve(this,e)},e.prototype.disconnect=function(){f.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var z="article#main",B="section.footnotes[role=doc-endnotes]",fa=1260;function ga(e,t){var o=e.offsetParent.getBoundingClientRect().top;return t.getBoundingClientRect().top-o}function ha(e){var t=0;Array.prototype.forEach.call(e,function(e,o){var r=document.querySelector("a.footnote-ref[href='#"+e.id+"']"),$=ga(e,r.closest("p,li")||r);$<t&&($=t),t=$+e.offsetHeight+parseInt(window.getComputedStyle(e).marginBottom)+parseInt(window.getComputedStyle(e).marginTop),e.style.top=$+"px",e.style.position="absolute"})}function ia(e){Array.prototype.forEach.call(e,function(e,t){e.style.top=null,e.style.position=null})}function E(e){var t=document.querySelector(B),o=t.querySelectorAll("li[role=doc-endnote]");e?(t.classList.add("floating-footnotes"),ha(o),ja()):(ka(),ia(o),t.classList.remove("floating-footnotes"))}function ja(){var e=document.querySelector(z);F.observe(e)}function ka(){F.disconnect()}var la=function(){var e=!1;return function(){var t=window.innerWidth>=fa;t!==e&&(E(t),e=t)}}(),F=new ea(function(e,t){E(!0)});function ma(){e(function(){var e=document.querySelector(B),t=document.querySelector(z),o=t&&!t.classList.contains("no-floating-footnotes");e&&o&&K(la)})}ma(),I();})(); \ No newline at end of file
+(function () {function G(e){var r=document.createElement("a");return r.className="header-link",r.title="Link to this section",r.href="#"+e,r.innerHTML="<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 8 8\"><path d=\"M5.88.03c-.18.01-.36.03-.53.09-.27.1-.53.25-.75.47a.5.5 0 1 0 .69.69c.11-.11.24-.17.38-.22.35-.12.78-.07 1.06.22.39.39.39 1.04 0 1.44l-1.5 1.5c-.44.44-.8.48-1.06.47-.26-.01-.41-.13-.41-.13a.5.5 0 1 0-.5.88s.34.22.84.25c.5.03 1.2-.16 1.81-.78l1.5-1.5c.78-.78.78-2.04 0-2.81-.28-.28-.61-.45-.97-.53-.18-.04-.38-.04-.56-.03zm-2 2.31c-.5-.02-1.19.15-1.78.75l-1.5 1.5c-.78.78-.78 2.04 0 2.81.56.56 1.36.72 2.06.47.27-.1.53-.25.75-.47a.5.5 0 1 0-.69-.69c-.11.11-.24.17-.38.22-.35.12-.78.07-1.06-.22-.39-.39-.39-1.04 0-1.44l1.5-1.5c.4-.4.75-.45 1.03-.44.28.01.47.09.47.09a.5.5 0 1 0 .44-.88s-.34-.2-.84-.22z\" /></svg>",r}function H(){var e=document.querySelectorAll("article#main");if(1==e.length){var r=e[0].querySelectorAll("h2, h3, h4");Array.prototype.forEach.call(r,function(e,r){var a=G(e.id);e.appendChild(a)})}}function I(){e(H)}function e(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,1):document.addEventListener("DOMContentLoaded",e)}function J(e){"complete"===document.readyState?setTimeout(e,1):window.addEventListener("load",e)}function K(e){J(function(){window.addEventListener("resize",e),setTimeout(e,1)})}var b=[];var L=function(){return b.some(function(e){return e.activeTargets.length>0})};var M=function(){return b.some(function(e){return e.skippedTargets.length>0})};var h="ResizeObserver loop completed with undelivered notifications.",N=function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:h}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=h),window.dispatchEvent(e)};var O,c;!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(c||(O=c={},O));var y=function(){function t(t,h,i,e){return this.x=t,this.y=h,this.width=i,this.height=e,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Object.freeze(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(h){return new t(h.x,h.y,h.width,h.height)},t}();var w=function(e){return e instanceof SVGElement&&"getBBox"in e},A=function(e){if(w(e)){var t=e.getBBox(),i=t.width,$=t.height;return!i&&!$}var n=e,r=n.offsetWidth,s=n.offsetHeight;return!(r||s||e.getClientRects().length)},i=function(e){var t,i,$=null===(i=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===i?void 0:i.defaultView;return!!($&&e instanceof $.Element)},P=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0;}return!1};var a="undefined"!=typeof window?window:{};var q=new WeakMap,C=/auto|scroll/,Q=/^tb|vertical/,T=/msie|trident/i.test(a.navigator&&a.navigator.userAgent),j=function(e){return parseFloat(e||"0")},k=function(e,$,r){return void 0===e&&(e=0),void 0===$&&($=0),void 0===r&&(r=!1),Object.freeze({inlineSize:(r?$:e)||0,blockSize:(r?e:$)||0})},D=Object.freeze({devicePixelContentBoxSize:k(),borderBoxSize:k(),contentBoxSize:k(),contentRect:new y(0,0,0,0)}),l=function(e,$){if(void 0===$&&($=!1),q.has(e)&&!$)return q.get(e);if(A(e))return q.set(e,D),D;var r=getComputedStyle(e),i=w(e)&&e.ownerSVGElement&&e.getBBox(),t=!T&&"border-box"===r.boxSizing,o=Q.test(r.writingMode||""),P=!i&&C.test(r.overflowY||""),a=!i&&C.test(r.overflowX||""),n=i?0:j(r.paddingTop),s=i?0:j(r.paddingRight),c=i?0:j(r.paddingBottom),l=i?0:j(r.paddingLeft),v=i?0:j(r.borderTopWidth),Y=i?0:j(r.borderRightWidth),p=i?0:j(r.borderBottomWidth),d=l+s,x=n+c,z=(i?0:j(r.borderLeftWidth))+Y,u=v+p,B=a?e.offsetHeight-u-e.clientHeight:0,g=P?e.offsetWidth-z-e.clientWidth:0,h=t?d+z:0,m=t?x+u:0,R=i?i.width:j(r.width)-h-g,S=i?i.height:j(r.height)-m-B,b=R+d+g+z,O=S+x+B+u,f=Object.freeze({devicePixelContentBoxSize:k(Math.round(R*devicePixelRatio),Math.round(S*devicePixelRatio),o),borderBoxSize:k(b,O,o),contentBoxSize:k(R,S,o),contentRect:new y(l,n,R,S)});return q.set(e,f),f},m=function(e,$,r){var i=l(e,r),t=i.borderBoxSize,o=i.contentBoxSize,P=i.devicePixelContentBoxSize;switch($){case c.DEVICE_PIXEL_CONTENT_BOX:return P;case c.BORDER_BOX:return t;default:return o;}};var R=function(){return function(e){var t=l(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=[t.borderBoxSize],this.contentBoxSize=[t.contentBoxSize],this.devicePixelContentBoxSize=[t.devicePixelContentBoxSize]}}();var n=function(e){if(A(e))return 1/0;for(var r=0,t=e.parentNode;t;)r+=1,t=t.parentNode;return r};var S=function(){var e=1/0,r=[];b.forEach(function(t){if(0!==t.activeTargets.length){var a=[];t.activeTargets.forEach(function(r){var t=new R(r.target),s=n(r.target);a.push(t),r.lastReportedSize=m(r.target,r.observedBox),s<e&&(e=s)}),r.push(function(){t.callback.call(t.observer,a,t.observer)}),t.activeTargets.splice(0,t.activeTargets.length)}});for(var t=0,a=r;t<a.length;t++){(0,a[t])()}return e};var o=function(e){b.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(r){r.isActive()&&(n(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))})})};var U=function(){var r=0;for(o(r);L();)r=S(),o(r);return M()&&N(),r>0};var p,s=[],V=function(){return s.splice(0).forEach(function(a){return a()})},W=function(a){if(!p){var r=0,$=document.createTextNode("");new MutationObserver(function(){return V()}).observe($,{characterData:!0}),p=function(){$.textContent=""+(r?r--:r++)}}s.push(a),p()};var X=function(e){W(function(){requestAnimationFrame(e)})};var r=0,Y=function(){return!!r},Z=250,$={attributes:!0,characterData:!0,childList:!0,subtree:!0},t=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],u=function(e){return void 0===e&&(e=0),Date.now()+e},_=!1,aa=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var r=this;if(void 0===e&&(e=Z),!_){_=!0;var t=u(e);X(function(){var $=!1;try{$=U()}finally{if(_=!1,e=t-u(),!Y())return;$?r.run(1e3):e>0?r.run(e):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,r=function(){return e.observer&&e.observer.observe(document.body,$)};document.body?r():a.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),t.forEach(function(r){return a.addEventListener(r,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),t.forEach(function(r){return a.removeEventListener(r,e.listener,!0)}),this.stopped=!0)},e}(),g=new aa,v=function(e){!r&&e>0&&g.start(),!(r+=e)&&g.stop()};var ba=function(e){return!w(e)&&!P(e)&&"inline"===getComputedStyle(e).display},ca=function(){function e(e,i){this.target=e,this.observedBox=i||c.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=m(this.target,this.observedBox,!0);return ba(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}();var da=function(){return function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}}();var d=new WeakMap,x=function(e,r){for(var t=0;t<e.length;t+=1)if(e[t].target===r)return t;return-1},f=function(){function e(){}return e.connect=function(e,r){var t=new da(e,r);d.set(e,t)},e.observe=function(e,r,t){var s=d.get(e),$=0===s.observationTargets.length;x(s.observationTargets,r)<0&&($&&b.push(s),s.observationTargets.push(new ca(r,t&&t.box)),v(1),g.schedule())},e.unobserve=function(e,r){var t=d.get(e),s=x(t.observationTargets,r),$=1===t.observationTargets.length;s>=0&&($&&b.splice(b.indexOf(t),1),t.observationTargets.splice(s,1),v(-1))},e.disconnect=function(e){var r=this,t=d.get(e);t.observationTargets.slice().forEach(function(t){return r.unobserve(e,t.target)}),t.activeTargets.splice(0,t.activeTargets.length)},e}();var ea=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");f.connect(this,e)}return e.prototype.observe=function(e,r){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!i(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");f.observe(this,e,r)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!i(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");f.unobserve(this,e)},e.prototype.disconnect=function(){f.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var z="article#main",B="div.footnotes[role=doc-endnotes]",fa="li[id^='fn:']",ga=1260;function ha(e,t){var o=e.offsetParent.getBoundingClientRect().top;return t.getBoundingClientRect().top-o}function ia(e){var t=0;Array.prototype.forEach.call(e,function(e,o){var r=document.querySelector("a.footnote-ref[href='#"+e.id+"']"),$=ha(e,r.closest("p,li")||r);$<t&&($=t),t=$+e.offsetHeight+parseInt(window.getComputedStyle(e).marginBottom)+parseInt(window.getComputedStyle(e).marginTop),e.style.top=$+"px",e.style.position="absolute"})}function ja(e){Array.prototype.forEach.call(e,function(e,t){e.style.top=null,e.style.position=null})}function E(e){var t=document.querySelector(B),o=t.querySelectorAll(fa);e?(t.classList.add("floating-footnotes"),ia(o),ka()):(la(),ja(o),t.classList.remove("floating-footnotes"))}function ka(){var e=document.querySelector(z);F.observe(e)}function la(){F.disconnect()}var ma=function(){var e=!1;return function(){var t=window.innerWidth>=ga;t!==e&&(E(t),e=t)}}(),F=new ea(function(e,t){E(!0)});function na(){e(function(){var e=document.querySelector(B),t=document.querySelector(z),o=t&&!t.classList.contains("no-floating-footnotes");e&&o&&K(ma)})}na(),I();})(); \ No newline at end of file