diff --git a/setup.cfg b/setup.cfg index c8a97db..dabea20 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = wagtail_fedit -version = 1.5.8 +version = 1.5.9rc1 description = Frontend editing for your Wagtail site long_description = file: README.md long_description_content_type = text/markdown diff --git a/wagtail_fedit/static/wagtail_fedit/js/edit.js b/wagtail_fedit/static/wagtail_fedit/js/edit.js index c1a9c20..61958de 100644 --- a/wagtail_fedit/static/wagtail_fedit/js/edit.js +++ b/wagtail_fedit/static/wagtail_fedit/js/edit.js @@ -1 +1 @@ -(()=>{"use strict";var e={2:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(601),r=n.n(i),o=n(314),a=n.n(o)()(r());a.push([e.id,'.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}',""]);const s=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var s=0;s0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},72:e=>{var t=[];function n(e){for(var n=-1,i=0;i{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{function e(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function t(t){return t instanceof e(t).Element||t instanceof Element}function i(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function r(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}var o=Math.max,a=Math.min,s=Math.round;function c(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function l(){return!/^((?!chrome|android).)*safari/i.test(c())}function d(n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!1);var a=n.getBoundingClientRect(),c=1,d=1;r&&i(n)&&(c=n.offsetWidth>0&&s(a.width)/n.offsetWidth||1,d=n.offsetHeight>0&&s(a.height)/n.offsetHeight||1);var p=(t(n)?e(n):window).visualViewport,u=!l()&&o,f=(a.left+(u&&p?p.offsetLeft:0))/c,h=(a.top+(u&&p?p.offsetTop:0))/d,m=a.width/c,v=a.height/d;return{width:m,height:v,top:h,right:f+m,bottom:h+v,left:f,x:f,y:h}}function p(t){var n=e(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function u(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((t(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return d(f(e)).left+p(e).scrollLeft}function m(t){return e(t).getComputedStyle(t)}function v(e){var t=m(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function g(t,n,r){void 0===r&&(r=!1);var o,a,c=i(n),l=i(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,i=s(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(n),m=f(n),g=d(t,l,r),w={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(c||!c&&!r)&&(("body"!==u(n)||v(m))&&(w=(o=n)!==e(o)&&i(o)?{scrollLeft:(a=o).scrollLeft,scrollTop:a.scrollTop}:p(o)),i(n)?((y=d(n,!0)).x+=n.clientLeft,y.y+=n.clientTop):m&&(y.x=h(m))),{x:g.left+w.scrollLeft-y.x,y:g.top+w.scrollTop-y.y,width:g.width,height:g.height}}function w(e){var t=d(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function y(e){return"html"===u(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||f(e)}function b(e){return["html","body","#document"].indexOf(u(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:b(y(e))}function E(t,n){var i;void 0===n&&(n=[]);var r=b(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),a=e(r),s=o?[a].concat(a.visualViewport||[],v(r)?r:[]):r,c=n.concat(s);return o?c:c.concat(E(y(s)))}function x(e){return["table","td","th"].indexOf(u(e))>=0}function O(e){return i(e)&&"fixed"!==m(e).position?e.offsetParent:null}function L(t){for(var n=e(t),o=O(t);o&&x(o)&&"static"===m(o).position;)o=O(o);return o&&("html"===u(o)||"body"===u(o)&&"static"===m(o).position)?n:o||function(e){var t=/firefox/i.test(c());if(/Trident/i.test(c())&&i(e)&&"fixed"===m(e).position)return null;var n=y(e);for(r(n)&&(n=n.host);i(n)&&["html","body"].indexOf(u(n))<0;){var o=m(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||n}var T="top",A="bottom",S="right",C="left",D="auto",M=[T,A,S,C],I="start",k="end",R="viewport",j="popper",P=M.reduce((function(e,t){return e.concat([t+"-"+I,t+"-"+k])}),[]),H=[].concat(M,[D]).reduce((function(e,t){return e.concat([t,t+"-"+I,t+"-"+k])}),[]),N=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function W(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var B={placement:"bottom",modifiers:[],strategy:"absolute"};function F(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function X(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?$(r):null,a=r?U(r):null,s=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(o){case T:t={x:s,y:n.y-i.height};break;case A:t={x:s,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:c};break;case C:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?z(o):null;if(null!=l){var d="y"===l?"height":"width";switch(a){case I:t[l]=t[l]-(n[d]/2-i[d]/2);break;case k:t[l]=t[l]+(n[d]/2-i[d]/2)}}return t}var Y={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(t){var n,i=t.popper,r=t.popperRect,o=t.placement,a=t.variation,c=t.offsets,l=t.position,d=t.gpuAcceleration,p=t.adaptive,u=t.roundOffsets,h=t.isFixed,v=c.x,g=void 0===v?0:v,w=c.y,y=void 0===w?0:w,b="function"==typeof u?u({x:g,y}):{x:g,y};g=b.x,y=b.y;var E=c.hasOwnProperty("x"),x=c.hasOwnProperty("y"),O=C,D=T,M=window;if(p){var I=L(i),R="clientHeight",j="clientWidth";I===e(i)&&"static"!==m(I=f(i)).position&&"absolute"===l&&(R="scrollHeight",j="scrollWidth"),(o===T||(o===C||o===S)&&a===k)&&(D=A,y-=(h&&I===M&&M.visualViewport?M.visualViewport.height:I[R])-r.height,y*=d?1:-1),o!==C&&(o!==T&&o!==A||a!==k)||(O=S,g-=(h&&I===M&&M.visualViewport?M.visualViewport.width:I[j])-r.width,g*=d?1:-1)}var P,H=Object.assign({position:l},p&&Y),N=!0===u?function(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:s(n*r)/r||0,y:s(i*r)/r||0}}({x:g,y},e(i)):{x:g,y};return g=N.x,y=N.y,d?Object.assign({},H,((P={})[D]=x?"0":"",P[O]=E?"0":"",P.transform=(M.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P)):Object.assign({},H,((n={})[D]=x?y+"px":"",n[O]=E?g+"px":"",n.transform="",n))}const G={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:$(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},K={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&u(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});i(r)&&u(r)&&(Object.assign(r.style,a),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},Q={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=H.reduce((function(e,n){return e[n]=function(e,t,n){var i=$(e),r=[C,T].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[C,S].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[i]=a}};var Z={left:"right",right:"left",bottom:"top",top:"bottom"};function ee(e){return e.replace(/left|right|bottom|top/g,(function(e){return Z[e]}))}var te={start:"end",end:"start"};function ne(e){return e.replace(/start|end/g,(function(e){return te[e]}))}function ie(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oe(n,i,r){return i===R?re(function(t,n){var i=e(t),r=f(t),o=i.visualViewport,a=r.clientWidth,s=r.clientHeight,c=0,d=0;if(o){a=o.width,s=o.height;var p=l();(p||!p&&"fixed"===n)&&(c=o.offsetLeft,d=o.offsetTop)}return{width:a,height:s,x:c+h(t),y:d}}(n,r)):t(i)?function(e,t){var n=d(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(i,r):re(function(e){var t,n=f(e),i=p(e),r=null==(t=e.ownerDocument)?void 0:t.body,a=o(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=o(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-i.scrollLeft+h(e),l=-i.scrollTop;return"rtl"===m(r||n).direction&&(c+=o(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:s,x:c,y:l}}(f(n)))}function ae(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function se(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ce(e,n){void 0===n&&(n={});var r=n,s=r.placement,c=void 0===s?e.placement:s,l=r.strategy,p=void 0===l?e.strategy:l,h=r.boundary,v=void 0===h?"clippingParents":h,g=r.rootBoundary,w=void 0===g?R:g,b=r.elementContext,x=void 0===b?j:b,O=r.altBoundary,C=void 0!==O&&O,D=r.padding,I=void 0===D?0:D,k=ae("number"!=typeof I?I:se(I,M)),P=x===j?"reference":j,H=e.rects.popper,N=e.elements[C?P:x],W=function(e,n,r,s){var c="clippingParents"===n?function(e){var n=E(y(e)),r=["absolute","fixed"].indexOf(m(e).position)>=0&&i(e)?L(e):e;return t(r)?n.filter((function(e){return t(e)&&ie(e,r)&&"body"!==u(e)})):[]}(e):[].concat(n),l=[].concat(c,[r]),d=l[0],p=l.reduce((function(t,n){var i=oe(e,n,s);return t.top=o(i.top,t.top),t.right=a(i.right,t.right),t.bottom=a(i.bottom,t.bottom),t.left=o(i.left,t.left),t}),oe(e,d,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}(t(N)?N:N.contextElement||f(e.elements.popper),v,w,p),B=d(e.elements.reference),F=X({reference:B,element:H,strategy:"absolute",placement:c}),q=re(Object.assign({},H,F)),_=x===j?q:B,V={top:W.top-_.top+k.top,bottom:_.bottom-W.bottom+k.bottom,left:W.left-_.left+k.left,right:_.right-W.right+k.right},$=e.modifiersData.offset;if(x===j&&$){var U=$[c];Object.keys(V).forEach((function(e){var t=[S,A].indexOf(e)>=0?1:-1,n=[T,A].indexOf(e)>=0?"y":"x";V[e]+=U[n]*t}))}return V}const le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,d=n.boundary,p=n.rootBoundary,u=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=$(v),w=c||(g!==v&&h?function(e){if($(e)===D)return[];var t=ee(e);return[ne(e),t,ne(t)]}(v):[ee(v)]),y=[v].concat(w).reduce((function(e,n){return e.concat($(n)===D?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?H:c,d=U(i),p=d?s?P:P.filter((function(e){return U(e)===d})):M,u=p.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=p);var f=u.reduce((function(t,n){return t[n]=ce(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[$(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:d,rootBoundary:p,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),b=t.rects.reference,E=t.rects.popper,x=new Map,O=!0,L=y[0],k=0;k=0,B=W?"width":"height",F=ce(t,{placement:R,boundary:d,rootBoundary:p,altBoundary:u,padding:l}),q=W?N?S:C:N?A:T;b[B]>E[B]&&(q=ee(q));var _=ee(q),V=[];if(o&&V.push(F[j]<=0),s&&V.push(F[q]<=0,F[_]<=0),V.every((function(e){return e}))){L=R,O=!1;break}x.set(R,V)}if(O)for(var z=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return L=t,"break"},X=h?3:1;X>0&&"break"!==z(X);X--);t.placement!==L&&(t.modifiersData[i]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return o(e,a(t,n))}const pe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,c=n.altAxis,l=void 0!==c&&c,d=n.boundary,p=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,g=void 0===v?0:v,y=ce(t,{boundary:d,rootBoundary:p,padding:f,altBoundary:u}),b=$(t.placement),E=U(t.placement),x=!E,O=z(b),D="x"===O?"y":"x",M=t.modifiersData.popperOffsets,k=t.rects.reference,R=t.rects.popper,j="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,P="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(M){if(s){var W,B="y"===O?T:C,F="y"===O?A:S,q="y"===O?"height":"width",_=M[O],V=_+y[B],X=_-y[F],Y=m?-R[q]/2:0,J=E===I?k[q]:R[q],G=E===I?-R[q]:-k[q],K=t.elements.arrow,Q=m&&K?w(K):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[B],te=Z[F],ne=de(0,k[q],Q[q]),ie=x?k[q]/2-Y-ne-ee-P.mainAxis:J-ne-ee-P.mainAxis,re=x?-k[q]/2+Y+ne+te+P.mainAxis:G+ne+te+P.mainAxis,oe=t.elements.arrow&&L(t.elements.arrow),ae=oe?"y"===O?oe.clientTop||0:oe.clientLeft||0:0,se=null!=(W=null==H?void 0:H[O])?W:0,le=_+re-se,pe=de(m?a(V,_+ie-se-ae):V,_,m?o(X,le):X);M[O]=pe,N[O]=pe-_}if(l){var ue,fe="x"===O?T:C,he="x"===O?A:S,me=M[D],ve="y"===D?"height":"width",ge=me+y[fe],we=me-y[he],ye=-1!==[T,C].indexOf(b),be=null!=(ue=null==H?void 0:H[D])?ue:0,Ee=ye?ge:me-k[ve]-R[ve]-be+P.altAxis,xe=ye?me+k[ve]+R[ve]-be-P.altAxis:we,Oe=m&&ye?function(e,t,n){var i=de(e,t,n);return i>n?n:i}(Ee,me,xe):de(m?Ee:ge,me,m?xe:we);M[D]=Oe,N[D]=Oe-me}t.modifiersData[i]=N}},requiresIfExists:["offset"]},ue={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=$(n.placement),c=z(s),l=[C,S].indexOf(s)>=0?"height":"width";if(o&&a){var d=function(e,t){return ae("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:se(e,M))}(r.padding,n),p=w(o),u="y"===c?T:C,f="y"===c?A:S,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=L(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=d[u],E=g-p[l]-d[f],x=g/2-p[l]/2+y,O=de(b,x,E),D=c;n.modifiersData[i]=((t={})[D]=O,t.centerOffset=O-x,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ie(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function he(e){return[T,S,A,C].some((function(t){return e[t]>=0}))}var me=q({defaultModifiers:[V,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},G,K,Q,le,pe,ue,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=ce(t,{elementContext:"reference"}),s=ce(t,{altBoundary:!0}),c=fe(a,i),l=fe(s,r,o),d=he(c),p=he(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}}]}),ve="tippy-content",ge="tippy-backdrop",we="tippy-arrow",ye="tippy-svg-arrow",be={passive:!0,capture:!0},Ee=function(){return document.body};function xe(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function Oe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Le(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Te(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function Ae(e){return[].concat(e)}function Se(e,t){-1===e.indexOf(t)&&e.push(t)}function Ce(e){return[].slice.call(e)}function De(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Me(){return document.createElement("div")}function Ie(e){return["Element","Fragment"].some((function(t){return Oe(e,t)}))}function ke(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Re(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function je(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function Pe(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var He={isTouch:!1},Ne=0;function We(){He.isTouch||(He.isTouch=!0,window.performance&&document.addEventListener("mousemove",Be))}function Be(){var e=performance.now();e-Ne<20&&(He.isTouch=!1,document.removeEventListener("mousemove",Be)),Ne=e}function Fe(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var qe=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),_e=Object.assign({appendTo:Ee,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ve=Object.keys(_e);function $e(e){var t=(e.plugins||[]).reduce((function(t,n){var i,r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:null!=(i=_e[r])?i:o),t}),{});return Object.assign({},e,t)}function Ue(e,t){var n=Object.assign({},t,{content:Le(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys($e(Object.assign({},_e,{plugins:t}))):Ve).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var ze=function(){return"innerHTML"};function Xe(e,t){e[ze()]=t}function Ye(e){var t=Me();return!0===e?t.className=we:(t.className=ye,Ie(e)?t.appendChild(e):Xe(t,e)),t}function Je(e,t){Ie(t.content)?(Xe(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Xe(e,t.content):e.textContent=t.content)}function Ge(e){var t=e.firstElementChild,n=Ce(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ve)})),arrow:n.find((function(e){return e.classList.contains(we)||e.classList.contains(ye)})),backdrop:n.find((function(e){return e.classList.contains(ge)}))}}function Ke(e){var t=Me(),n=Me();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Me();function r(n,i){var r=Ge(t),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Je(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Ye(i.arrow))):o.appendChild(Ye(i.arrow)):s&&o.removeChild(s)}return i.className=ve,i.setAttribute("data-state","hidden"),Je(i,e.props),t.appendChild(n),n.appendChild(i),r(e.props,e.props),{popper:t,onUpdate:r}}Ke.$$tippy=!0;var Qe=1,Ze=[],et=[];function tt(e,t){var n,i,r,o,a,s,c,l,d=Ue(e,Object.assign({},_e,$e(De(t)))),p=!1,u=!1,f=!1,h=!1,m=[],v=Te(X,d.interactiveDebounce),g=Qe++,w=(l=d.plugins).filter((function(e,t){return l.indexOf(e)===t})),y={id:g,reference:e,popper:Me(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:w,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)},setProps:function(t){if(!y.state.isDestroyed){R("onBeforeUpdate",[y,t]),U();var n=y.props,i=Ue(e,Object.assign({},n,De(t),{ignoreAttributes:!0}));y.props=i,$(),n.interactiveDebounce!==i.interactiveDebounce&&(H(),v=Te(X,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ae(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded"),P(),k(),x&&x(n,i),y.popperInstance&&(K(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[y,t])}},setContent:function(e){y.setProps({content:e})},show:function(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=He.isTouch&&!y.props.touch,r=xe(y.props.duration,0,_e.duration);if(!(e||t||n||i||C().hasAttribute("disabled")||(R("onShow",[y],!1),!1===y.props.onShow(y)))){if(y.state.isVisible=!0,S()&&(E.style.visibility="visible"),k(),F(),y.state.isMounted||(E.style.transition="none"),S()){var o=M();ke([o.box,o.content],0)}var a,c,l;s=function(){var e;if(y.state.isVisible&&!h){if(h=!0,E.offsetHeight,E.style.transition=y.props.moveTransition,S()&&y.props.animation){var t=M(),n=t.box,i=t.content;ke([n,i],r),Re([n,i],"visible")}j(),P(),Se(et,y),null==(e=y.popperInstance)||e.forceUpdate(),R("onMount",[y]),y.props.animation&&S()&&function(e,t){_(e,(function(){y.state.isShown=!0,R("onShown",[y])}))}(r)}},c=y.props.appendTo,l=C(),(a=y.props.interactive&&c===Ee||"parent"===c?l.parentNode:Le(c,[l])).contains(E)||a.appendChild(E),y.state.isMounted=!0,K()}},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=xe(y.props.duration,1,_e.duration);if(!(e||t||n)&&(R("onHide",[y],!1),!1!==y.props.onHide(y))){if(y.state.isVisible=!1,y.state.isShown=!1,h=!1,p=!1,S()&&(E.style.visibility="hidden"),H(),q(),k(!0),S()){var r=M(),o=r.box,a=r.content;y.props.animation&&(ke([o,a],i),Re([o,a],"hidden"))}j(),P(),y.props.animation?S()&&function(e,t){_(e,(function(){!y.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(i,y.unmount):y.unmount()}},hideWithInteractivity:function(e){D().addEventListener("mousemove",v),Se(Ze,v),v(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Q(),Z().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E),et=et.filter((function(e){return e!==y})),y.state.isMounted=!1,R("onHidden",[y]))},destroy:function(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),U(),delete e._tippy,y.state.isDestroyed=!0,R("onDestroy",[y]))}};if(!d.render)return y;var b=d.render(y),E=b.popper,x=b.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+y.id,y.popper=E,e._tippy=y,E._tippy=y;var O=w.map((function(e){return e.fn(y)})),L=e.hasAttribute("aria-expanded");return $(),P(),k(),R("onCreate",[y]),d.showOnCreate&&ee(),E.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",v)})),y;function T(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===T()[0]}function S(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function C(){return c||e}function D(){var e,t,n=C().parentNode;return n?null!=(t=Ae(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function M(){return Ge(E)}function I(e){return y.state.isMounted&&!y.state.isVisible||He.isTouch||o&&"focus"===o.type?0:xe(y.props.delay,e?0:1,_e.delay)}function k(e){void 0===e&&(e=!1),E.style.pointerEvents=y.props.interactive&&!e?"":"none",E.style.zIndex=""+y.props.zIndex}function R(e,t,n){var i;void 0===n&&(n=!0),O.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(i=y.props)[e].apply(i,t)}function j(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,i=E.id;Ae(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var r=t&&t.replace(i,"").trim();r?e.setAttribute(n,r):e.removeAttribute(n)}}))}}function P(){!L&&y.props.aria.expanded&&Ae(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function H(){D().removeEventListener("mousemove",v),Ze=Ze.filter((function(e){return e!==v}))}function N(t){if(!He.isTouch||!f&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!Pe(E,n)){if(Ae(y.props.triggerTarget||e).some((function(e){return Pe(e,n)}))){if(He.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout((function(){u=!1})),y.state.isMounted||q())}}}function W(){f=!0}function B(){f=!1}function F(){var e=D();e.addEventListener("mousedown",N,!0),e.addEventListener("touchend",N,be),e.addEventListener("touchstart",B,be),e.addEventListener("touchmove",W,be)}function q(){var e=D();e.removeEventListener("mousedown",N,!0),e.removeEventListener("touchend",N,be),e.removeEventListener("touchstart",B,be),e.removeEventListener("touchmove",W,be)}function _(e,t){var n=M().box;function i(e){e.target===n&&(je(n,"remove",i),t())}if(0===e)return t();je(n,"remove",a),je(n,"add",i),a=i}function V(t,n,i){void 0===i&&(i=!1),Ae(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),m.push({node:e,eventType:t,handler:n,options:i})}))}function $(){var e;A()&&(V("touchstart",z,{passive:!0}),V("touchend",Y,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,z),e){case"mouseenter":V("mouseleave",Y);break;case"focus":V(qe?"focusout":"blur",J);break;case"focusin":V("focusout",J)}}))}function U(){m.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),m=[]}function z(e){var t,n=!1;if(y.state.isEnabled&&!G(e)&&!u){var i="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,P(),!y.state.isVisible&&Oe(e,"MouseEvent")&&Ze.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||p)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(p=!n),n&&!i&&te(e)}}function X(e){var t=e.target,n=C().contains(t)||E.contains(t);if("mousemove"!==e.type||!n){var i=Z().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,o=e.props.interactiveBorder,a=r.placement.split("-")[0],s=r.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,d="right"===a?s.left.x:0,p="left"===a?s.right.x:0,u=t.top-i+c>o,f=i-t.bottom-l>o,h=t.left-n+d>o,m=n-t.right-p>o;return u||f||h||m}))})(i,e)&&(H(),te(e))}}function Y(e){G(e)||y.props.trigger.indexOf("click")>=0&&p||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function J(e){y.props.trigger.indexOf("focusin")<0&&e.target!==C()||y.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||te(e)}function G(e){return!!He.isTouch&&A()!==e.type.indexOf("touch")>=0}function K(){Q();var t=y.props,n=t.popperOptions,i=t.placement,r=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=S()?Ge(E).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,d=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var n=M().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];S()&&c&&d.push({name:"arrow",options:{element:c,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),y.popperInstance=me(l,E,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return Ce(E.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&R("onTrigger",[y,e]),F();var t=I(!0),i=T(),r=i[0],o=i[1];He.isTouch&&"hold"===r&&o&&(t=o),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),R("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=I(!1);t?i=setTimeout((function(){y.state.isVisible&&y.hide()}),t):r=requestAnimationFrame((function(){y.hide()}))}}else q()}}function nt(e,t){void 0===t&&(t={});var n=_e.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",We,be),window.addEventListener("blur",Fe);var i,r=Object.assign({},t,{plugins:n}),o=(i=e,Ie(i)?[i]:function(e){return Oe(e,"NodeList")}(i)?Ce(i):Array.isArray(i)?i:Ce(document.querySelectorAll(i))).reduce((function(e,t){var n=t&&tt(t,r);return n&&e.push(n),e}),[]);return Ie(e)?o[0]:o}nt.defaultProps=_e,nt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){_e[t]=e[t]}))},nt.currentInput=He,Object.assign({},K,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),nt.setDefaultProps({render:Ke});const it=nt;var rt=n(72),ot=n.n(rt),at=n(825),st=n.n(at),ct=n(659),lt=n.n(ct),dt=n(56),pt=n.n(dt),ut=n(540),ft=n.n(ut),ht=n(113),mt=n.n(ht),vt=n(2),gt={};gt.styleTagTransform=mt(),gt.setAttributes=pt(),gt.insert=lt().bind(null,"head"),gt.domAPI=st(),gt.insertStyleElement=ft(),ot()(vt.A,gt),vt.A&&vt.A.locals&&vt.A.locals;class wt{constructor(e){this.element=e,this.tooltipConfig=this.makeConfig(),this.init()}init(){it(this.element,this.tooltipConfig)}makeConfig(){const e={content:this.element.getAttribute("title")};for(let t=0;t100&&t.searchParams.set("scrollY",`${window.scrollY}`),window.scrollX>100&&t.searchParams.set("scrollX",`${window.scrollX}`),e.href=t.toString()}class Ot{constructor(e){this.editor=e}openEditor(){this.editor.openEditor()}closeEditor(){this.editor.closeEditor()}executeEvent(e,t){this.editor.executeEvent(e,t)}addEventListener(e,t){this.editor.addEventListener(e,t)}removeEventListener(e,t,n){this.editor.removeEventListener(e,t,n)}updateHtml(e){return new Promise(((t,n)=>{const i=e=>{const n=this.editor.wrapperElement,i=document.createElement("div");i.innerHTML=e;const r=i.firstElementChild;return r.classList.add("wagtail-fedit-initialized"),n.parentNode.insertBefore(r,n),n.parentNode.removeChild(n),this.editor.wrapperElement=r,this.editor.initNewEditors(),this.editor.init(),t(r),n};if("string"!=typeof e)return"function"==typeof e?(this.editor.wrapperElement.editorAPI=this,void e(i)):void 0;i(e)}))}fetch(e,t,n){return i=this,r=void 0,a=function*(){let i=new Headers;return i.append("X-Requested-With","XMLHttpRequest"),i.append("X-CSRFToken",function(e){let t=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let i=0;ie.json()))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,s)}c((a=a.apply(i,r||[])).next())}));var i,r,o,a}refetch(){return this.editor.refetch()}execRelated(e){for(const t of this.editor.relatedWrappers)e(t.editorAPI)}}const Lt="wagtail-fedit-modal",Tt=`\n
\n
\n
\n
`;class At{constructor(e){this.options=e,this.modalHtml=Tt.replace("__ID__",this.options.modalId)}static get modalWrapper(){var e=document.querySelector(`#${Lt}-wrapper`);return e||((e=document.createElement("div")).id=`${Lt}-wrapper`,e.classList.add(`${Lt}-wrapper`),document.body.appendChild(e),e)}get wrapper(){return this.constructor.modalWrapper}get modal(){var e=this.wrapper.querySelector(`.${Lt}`);e&&e.id!==`${Lt}-${this.options.modalId}-modal`&&(e.remove(),e=null),e||(e=this.buildModal());var t=e;return t.modal=this,t}get innerHTML(){return this.modal.innerHTML}set innerHTML(e){this.modal.innerHTML=e}get style(){return this.modal.style}get classList(){return this.modal.classList}get children(){return this.modal.children}buildModal(){var e=this.wrapper,t=e.querySelector(`.${Lt}`);return t||(e.innerHTML=this.modalHtml,t=e.querySelector(`.${Lt}`)),t.modal||(t.modal=this),t}addClass(e){this.modal.classList.add(e)}removeClass(e){this.modal.classList.remove(e)}openModal(){this.wrapper.classList.add("open"),this.options.onOpen&&this.options.onOpen()}closeModal(){this.wrapper.classList.remove("open"),this.wrapper.innerHTML="",this.options.onClose&&this.options.onClose()}destroy(){this.wrapper.remove(),this.options.onDestroy&&this.options.onDestroy()}appendChild(...e){if(0!==e.length)for(let t=0;t{}),onError:a=(()=>{}),onCancel:s=(()=>{}),onResize:c=(()=>{}),executeOnloadImmediately:l=!1}=e;this.url=r,this.srcdoc=i,this.iframe=null,this.id=t,this.className=n,this.onResize=c,this.executeOnloadImmediately=l,this.onLoad=o,this.onError=a,this.onCancel=s,this.render()}get element(){return this.iframe||(this.iframe=this._renderFrame(this.url,this.srcdoc,this.onLoad)),this.iframe}get document(){return this.window?this.window.document:null}get window(){return this.element.contentWindow}get mainElement(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector("#main")}get formElement(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector("#wagtail-fedit-form")}get formWrapper(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector(".wagtail-fedit-form-wrapper")}destroy(){this.iframe.remove(),this.resizeInterval&&(clearInterval(this.resizeInterval),delete this.resizeInterval)}update(e,t){this.srcdoc=t,this.url=e,this._renderFrame(this.url,this.srcdoc,(({newFrame:e})=>{this.iframe.remove(),this.iframe=e,this.onLoad({newFrame:e})}),this.onError)}render(){return this.iframe||(this.iframe=this._renderFrame(this.url,this.srcdoc,this.onLoad)),this.iframe}_renderFrame(e,t,n,i=(()=>{})){const r=document.createElement("iframe");return t?r.srcdoc=t:r.src=e,r.id=this.id,r.className=this.className,r.onload=()=>{if(!this.formElement)return void i();let e=this.formElement,t=e.scrollHeight;this.onResize&&this.onResize(0,t),this.resizeInterval&&clearInterval(this.resizeInterval),this.onResize&&(this.resizeInterval=setInterval((()=>{if(e)try{t!==e.scrollHeight&&(this.onResize(t,e.scrollHeight),t=e.scrollHeight)}catch(e){clearInterval(this.resizeInterval),console.error(e),i()}else clearInterval(this.resizeInterval)}),25));const o=this.document.querySelector(".wagtail-fedit-cancel-button");o&&o.addEventListener("click",(()=>{clearInterval(this.resizeInterval),this.onCancel()})),"complete"===this.document.readyState||this.executeOnloadImmediately?n({newFrame:r}):r.contentWindow.addEventListener("DOMContentLoaded",(()=>{n({newFrame:r})}))},r.onerror=()=>{i()},r}}class Ct extends EventTarget{constructor(e){super(),this.api=new Ot(this),this.initialTitle=document.title,this.wrapperElement=e,this.sharedContext=null,this.editBtn=null,this.iframe=null,this.init(),window.location.hash===`#${this.wrapperElement.id}`&&(this.openEditor(),this.focus())}get editUrl(){return this.wrapperElement.dataset.editUrl}get refetchUrl(){return this.wrapperElement.dataset.refetchUrl}get relatedWrappers(){const e=this.wrapperElement.dataset.wrapperId,t=document.querySelectorAll(`[data-wrapper-id="${e}"]`);return Array.from(t).filter((e=>e!==this.wrapperElement))}init(){this.sharedContext=this.wrapperElement.dataset.sharedContext,this.wrapperElement.editorAPI=this.api,this.editBtn=this.wrapperElement.querySelector(".wagtail-fedit-edit-button"),this.editBtn.addEventListener("click",(e=>{return t=this,n=void 0,r=function*(){e.preventDefault(),e.stopPropagation(),this.opened||this.openEditor()},new((i=void 0)||(i=Promise))((function(e,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}c((r=r.apply(t,n||[])).next())}));var t,n,i,r}))}initNewEditors(){bt(this.wrapperElement)}focus(){this.wrapperElement.focus()}refetch(){return new Promise(((e,t)=>{fetch(this.refetchUrl).then((e=>e.json())).then((t=>{t.success?(this.onResponse(t),e(t)):console.error("Errors rendering response, failed to refetch",t)})).catch((e=>{console.error("Failed to refetch",e),t(e)}))}))}onResponse(e){throw new Error("onResponse not implemented, cannot call super")}get frameOptions(){return{}}openIframe(e,t){this.iframe||(this.iframe=new St(Object.assign(Object.assign({url:this.editUrl,id:"wagtail-fedit-iframe",className:null,executeOnloadImmediately:!0},this.frameOptions),{onLoad:()=>{const t=e=>{e.preventDefault();const n=new FormData(this.iframe.formElement);this.executeEvent(window.wagtailFedit.EVENTS.SUBMIT,{element:this.wrapperElement,formData:n}),fetch(this.editUrl,{method:"POST",body:n}).then((e=>e.json())).then((e=>{if(!e.success){console.error("Errors rendering response",e);let n=document.createElement("div");n.innerHTML=e.html,this.iframe.mainElement.innerHTML=n.querySelector("#main").innerHTML,this.iframe.formElement.onsubmit=t;const i=this.iframe.mainElement.querySelector("#value[data-block]");i&&this.iframe.window.initBlockWidget(i.id);const r=this.iframe.document.querySelector(".wagtail-fedit-cancel-button"),o=this.closeEditor.bind(this);return r.addEventListener("click",o),this.iframe.onCancel=o,void this.executeEvent(window.wagtailFedit.EVENTS.SUBMIT_ERROR,{element:this.wrapperElement,response:e})}const n=this.onResponse(e),i=()=>{this.closeEditor(),this.executeEvent(window.wagtailFedit.EVENTS.CHANGE,{element:this.wrapperElement})};n instanceof Promise?n.then(i):i()}))};this.iframe.formElement.onsubmit=t,this.iframe.onCancel=this.closeEditor.bind(this);const n=this.iframe.formWrapper,i=["large","full"];for(const t of i)if(n&&(n.classList.contains(`fedit-${t}`)||(this.iframe.formElement.dataset.editorSize||"").toLowerCase()===t)){e.classList.add(`fedit-${t}`);break}const r=window.location.href.split("#")[0];window.history.pushState(null,this.iframe.document.title,r+`#${this.wrapperElement.id}`),document.title=this.iframe.document.title,this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_LOAD,{iframe:this.iframe})},onError:()=>{this.closeEditor()},onCancel:()=>{this.closeEditor()}})),e.appendChild(this.iframe.element)),t(this.iframe)}openEditor(){this.modal||(this.modal=new At({modalId:this.wrapperElement.id})),this.opened=!0,this.openIframe(this.modal,(e=>{const t=document.createElement("button");t.innerHTML="×",t.classList.add("wagtail-fedit-close-button"),t.addEventListener("click",this.closeEditor.bind(this)),this.modal.appendChild(t),this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_OPEN,{iframe:this.iframe,modal:this.modal}),this.modal.openModal()}))}closeEditor(){this.opened=!1,window.history.pushState(null,this.initialTitle,window.location.href.split("#")[0]),document.title=this.initialTitle,this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_CLOSE),this.modal.closeModal()}executeEvent(e,t){t||(t={element:this.wrapperElement}),t.editor=this,t.api=this.api,e.startsWith(`${window.wagtailFedit.NAMESPACE}:`)||(e=`${window.wagtailFedit.NAMESPACE}:${e}`);const n=new CustomEvent(e,{detail:t});super.dispatchEvent(n),this.wrapperElement.dispatchEvent(n),document.dispatchEvent(n)}}class Dt{constructor(e){this.publishButton=e,this.publishButtonsWrapper=e.parentElement.querySelector(".wagtail-fedit-form-buttons"),this.publishButtonsWrapper.querySelectorAll(".wagtail-fedit-userbar-button"),this.init()}init(){this.publishButton.addEventListener("click",(e=>{this.publishButtonsWrapper.classList.contains("open")?this.publishButtonsWrapper.animate([{opacity:1,height:`${this.publishButtonsWrapper.scrollHeight}px`},{opacity:0,height:"0px"}],{duration:500,easing:"ease-in-out"}).onfinish=()=>{this.publishButtonsWrapper.classList.remove("open")}:(e.preventDefault(),e.stopPropagation(),this.publishButtonsWrapper.animate([{opacity:0,height:"0px"},{opacity:1,height:`${this.publishButtonsWrapper.scrollHeight}px`}],{duration:500,easing:"ease-in-out"}).onfinish=()=>{this.publishButtonsWrapper.classList.add("open")})}))}}class Mt extends Ct{static get funcMap(){return window}onResponse(e){const t=e.func.name,n=e.func.target;if(!t||!n)return void console.error("Invalid response",e);const i=document.querySelector(n);if(!i)return void console.error("Target element not found",n);const r=this.constructor.funcMap[t];if(r)return r(i,e);console.error("Function not found",t)}}class It extends Ct{onResponse(e){return this.api.updateHtml((t=>{this.wrapperElement.animate([{opacity:1},{opacity:0}],{duration:350,easing:"ease-in-out"}).onfinish=()=>{const n=t(e.html);e.refetch||this.api.execRelated((e=>{e.refetch()})),n.animate([{opacity:0},{opacity:1}],{duration:350,easing:"ease-in-out"}).onfinish=()=>{n.style.opacity="1"}}}))}}function kt(e){return class extends e{constructor(...e){super(...e);let t=this.wrapperElement.querySelectorAll("[data-direction]");for(let e=0;e{e.preventDefault(),this.api.fetch(i,"POST",{}).then((e=>{e.success?Et():e.error?alert("Failed to move block: "+e.error):alert("Failed to move block")})).catch((e=>{console.error("Failed to move block",e),alert("Failed to move block")}))}))}}}}class Rt extends(kt(It)){}class jt extends It{get buttonsElement(){return this.wrapperElement.querySelector(".wagtail-fedit-buttons")}get formElement(){return this.wrapperElement.querySelector(".wagtail-fedit-adapter-form")}get contentElement(){return this.wrapperElement.querySelector(".wagtail-fedit-adapter-content")}get frameOptions(){return{onResize:(e,t)=>{this.iframe.element.style.height=`${t}px`}}}openEditor(){this.openIframe(this.formElement,(e=>{this.contentElement.style.display="none"}))}closeEditor(){this.opened=!1,window.history.pushState(null,this.initialTitle,window.location.href.split("#")[0]),document.title=this.initialTitle,this.contentElement.style.display="block",this.iframe.destroy(),this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_CLOSE),delete this.iframe}}class Pt extends(kt(jt)){}function Ht(){bt(),new MutationObserver((e=>{for(const t of e)for(let e=0;e0||n>0)&&window.scrollTo(n,t);const i=document.querySelector("wagtail-userbar");if(i){const e=i.shadowRoot.querySelector("#wagtail-fedit-editor-button"),t=i.shadowRoot.querySelector("#wagtail-fedit-live-button"),n=i.shadowRoot.querySelector("#wagtail-fedit-publish-menu");if(e||t){let n;window.addEventListener("scroll",(()=>{n&&clearTimeout(n),n=setTimeout((()=>{xt(e),xt(t);const n=new URL(window.location.href);n.searchParams.set("scrollY",`${window.scrollY}`),n.searchParams.set("scrollX",`${window.scrollX}`),window.history.replaceState(null,"",n.toString())}),50)}))}n&&new Dt(n)}}window.wagtailFedit={NAMESPACE:"wagtail-fedit",EVENTS:{SUBMIT:"wagtail-fedit:submit",CHANGE:"wagtail-fedit:change",EDITOR_OPEN:"wagtail-fedit:editorOpen",EDITOR_LOAD:"wagtail-fedit:editorLoad",EDITOR_CLOSE:"wagtail-fedit:editorClose",SUBMIT_ERROR:"wagtail-fedit:submitError"},editors:{"wagtail_fedit.editors.BaseFuncEditor":Mt,"wagtail_fedit.editors.FieldEditor":It,"wagtail_fedit.editors.BlockEditor":Rt,"wagtail_fedit.editors.DomPositionedFieldEditor":jt,"wagtail_fedit.editors.DomPositionedBlockEditor":Pt,"wagtail_fedit.editors.WagtailFeditFuncEditor":class extends Mt{static get funcMap(){return window.wagtailFedit.funcs}}},funcs:{"wagtail_fedit.funcs.backgroundImageFunc":function(e,t){const n=t.url,i=t.css_variable_name;i?(i.startsWith("--"),e.style.setProperty(i,`url(${n})`)):e.style.backgroundImage=`url(${n})`}},register:function(e,t){this.editors[e]=t},registerFunc:function(e,t){this.funcs[e]=t}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ht):Ht()})()})(); \ No newline at end of file +(()=>{"use strict";var e={2:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(601),r=n.n(i),o=n(314),a=n.n(o)()(r());a.push([e.id,'.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}',""]);const s=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var s=0;s0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},72:e=>{var t=[];function n(e){for(var n=-1,i=0;i{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{function e(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function t(t){return t instanceof e(t).Element||t instanceof Element}function i(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function r(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}var o=Math.max,a=Math.min,s=Math.round;function c(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function l(){return!/^((?!chrome|android).)*safari/i.test(c())}function d(n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!1);var a=n.getBoundingClientRect(),c=1,d=1;r&&i(n)&&(c=n.offsetWidth>0&&s(a.width)/n.offsetWidth||1,d=n.offsetHeight>0&&s(a.height)/n.offsetHeight||1);var p=(t(n)?e(n):window).visualViewport,u=!l()&&o,f=(a.left+(u&&p?p.offsetLeft:0))/c,h=(a.top+(u&&p?p.offsetTop:0))/d,m=a.width/c,v=a.height/d;return{width:m,height:v,top:h,right:f+m,bottom:h+v,left:f,x:f,y:h}}function p(t){var n=e(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function u(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((t(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return d(f(e)).left+p(e).scrollLeft}function m(t){return e(t).getComputedStyle(t)}function v(e){var t=m(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function g(t,n,r){void 0===r&&(r=!1);var o,a,c=i(n),l=i(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,i=s(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(n),m=f(n),g=d(t,l,r),w={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(c||!c&&!r)&&(("body"!==u(n)||v(m))&&(w=(o=n)!==e(o)&&i(o)?{scrollLeft:(a=o).scrollLeft,scrollTop:a.scrollTop}:p(o)),i(n)?((y=d(n,!0)).x+=n.clientLeft,y.y+=n.clientTop):m&&(y.x=h(m))),{x:g.left+w.scrollLeft-y.x,y:g.top+w.scrollTop-y.y,width:g.width,height:g.height}}function w(e){var t=d(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function y(e){return"html"===u(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||f(e)}function b(e){return["html","body","#document"].indexOf(u(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:b(y(e))}function E(t,n){var i;void 0===n&&(n=[]);var r=b(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),a=e(r),s=o?[a].concat(a.visualViewport||[],v(r)?r:[]):r,c=n.concat(s);return o?c:c.concat(E(y(s)))}function x(e){return["table","td","th"].indexOf(u(e))>=0}function O(e){return i(e)&&"fixed"!==m(e).position?e.offsetParent:null}function L(t){for(var n=e(t),o=O(t);o&&x(o)&&"static"===m(o).position;)o=O(o);return o&&("html"===u(o)||"body"===u(o)&&"static"===m(o).position)?n:o||function(e){var t=/firefox/i.test(c());if(/Trident/i.test(c())&&i(e)&&"fixed"===m(e).position)return null;var n=y(e);for(r(n)&&(n=n.host);i(n)&&["html","body"].indexOf(u(n))<0;){var o=m(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(t)||n}var T="top",A="bottom",S="right",C="left",D="auto",M=[T,A,S,C],I="start",k="end",R="viewport",j="popper",P=M.reduce((function(e,t){return e.concat([t+"-"+I,t+"-"+k])}),[]),H=[].concat(M,[D]).reduce((function(e,t){return e.concat([t,t+"-"+I,t+"-"+k])}),[]),N=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function W(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var B={placement:"bottom",modifiers:[],strategy:"absolute"};function F(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function X(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?$(r):null,a=r?U(r):null,s=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(o){case T:t={x:s,y:n.y-i.height};break;case A:t={x:s,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:c};break;case C:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?z(o):null;if(null!=l){var d="y"===l?"height":"width";switch(a){case I:t[l]=t[l]-(n[d]/2-i[d]/2);break;case k:t[l]=t[l]+(n[d]/2-i[d]/2)}}return t}var Y={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(t){var n,i=t.popper,r=t.popperRect,o=t.placement,a=t.variation,c=t.offsets,l=t.position,d=t.gpuAcceleration,p=t.adaptive,u=t.roundOffsets,h=t.isFixed,v=c.x,g=void 0===v?0:v,w=c.y,y=void 0===w?0:w,b="function"==typeof u?u({x:g,y}):{x:g,y};g=b.x,y=b.y;var E=c.hasOwnProperty("x"),x=c.hasOwnProperty("y"),O=C,D=T,M=window;if(p){var I=L(i),R="clientHeight",j="clientWidth";I===e(i)&&"static"!==m(I=f(i)).position&&"absolute"===l&&(R="scrollHeight",j="scrollWidth"),(o===T||(o===C||o===S)&&a===k)&&(D=A,y-=(h&&I===M&&M.visualViewport?M.visualViewport.height:I[R])-r.height,y*=d?1:-1),o!==C&&(o!==T&&o!==A||a!==k)||(O=S,g-=(h&&I===M&&M.visualViewport?M.visualViewport.width:I[j])-r.width,g*=d?1:-1)}var P,H=Object.assign({position:l},p&&Y),N=!0===u?function(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:s(n*r)/r||0,y:s(i*r)/r||0}}({x:g,y},e(i)):{x:g,y};return g=N.x,y=N.y,d?Object.assign({},H,((P={})[D]=x?"0":"",P[O]=E?"0":"",P.transform=(M.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P)):Object.assign({},H,((n={})[D]=x?y+"px":"",n[O]=E?g+"px":"",n.transform="",n))}const G={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:$(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},K={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&u(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});i(r)&&u(r)&&(Object.assign(r.style,a),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},Q={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=H.reduce((function(e,n){return e[n]=function(e,t,n){var i=$(e),r=[C,T].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[C,S].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[i]=a}};var Z={left:"right",right:"left",bottom:"top",top:"bottom"};function ee(e){return e.replace(/left|right|bottom|top/g,(function(e){return Z[e]}))}var te={start:"end",end:"start"};function ne(e){return e.replace(/start|end/g,(function(e){return te[e]}))}function ie(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oe(n,i,r){return i===R?re(function(t,n){var i=e(t),r=f(t),o=i.visualViewport,a=r.clientWidth,s=r.clientHeight,c=0,d=0;if(o){a=o.width,s=o.height;var p=l();(p||!p&&"fixed"===n)&&(c=o.offsetLeft,d=o.offsetTop)}return{width:a,height:s,x:c+h(t),y:d}}(n,r)):t(i)?function(e,t){var n=d(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(i,r):re(function(e){var t,n=f(e),i=p(e),r=null==(t=e.ownerDocument)?void 0:t.body,a=o(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=o(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-i.scrollLeft+h(e),l=-i.scrollTop;return"rtl"===m(r||n).direction&&(c+=o(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:s,x:c,y:l}}(f(n)))}function ae(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function se(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ce(e,n){void 0===n&&(n={});var r=n,s=r.placement,c=void 0===s?e.placement:s,l=r.strategy,p=void 0===l?e.strategy:l,h=r.boundary,v=void 0===h?"clippingParents":h,g=r.rootBoundary,w=void 0===g?R:g,b=r.elementContext,x=void 0===b?j:b,O=r.altBoundary,C=void 0!==O&&O,D=r.padding,I=void 0===D?0:D,k=ae("number"!=typeof I?I:se(I,M)),P=x===j?"reference":j,H=e.rects.popper,N=e.elements[C?P:x],W=function(e,n,r,s){var c="clippingParents"===n?function(e){var n=E(y(e)),r=["absolute","fixed"].indexOf(m(e).position)>=0&&i(e)?L(e):e;return t(r)?n.filter((function(e){return t(e)&&ie(e,r)&&"body"!==u(e)})):[]}(e):[].concat(n),l=[].concat(c,[r]),d=l[0],p=l.reduce((function(t,n){var i=oe(e,n,s);return t.top=o(i.top,t.top),t.right=a(i.right,t.right),t.bottom=a(i.bottom,t.bottom),t.left=o(i.left,t.left),t}),oe(e,d,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}(t(N)?N:N.contextElement||f(e.elements.popper),v,w,p),B=d(e.elements.reference),F=X({reference:B,element:H,strategy:"absolute",placement:c}),q=re(Object.assign({},H,F)),_=x===j?q:B,V={top:W.top-_.top+k.top,bottom:_.bottom-W.bottom+k.bottom,left:W.left-_.left+k.left,right:_.right-W.right+k.right},$=e.modifiersData.offset;if(x===j&&$){var U=$[c];Object.keys(V).forEach((function(e){var t=[S,A].indexOf(e)>=0?1:-1,n=[T,A].indexOf(e)>=0?"y":"x";V[e]+=U[n]*t}))}return V}const le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,d=n.boundary,p=n.rootBoundary,u=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=$(v),w=c||(g!==v&&h?function(e){if($(e)===D)return[];var t=ee(e);return[ne(e),t,ne(t)]}(v):[ee(v)]),y=[v].concat(w).reduce((function(e,n){return e.concat($(n)===D?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?H:c,d=U(i),p=d?s?P:P.filter((function(e){return U(e)===d})):M,u=p.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=p);var f=u.reduce((function(t,n){return t[n]=ce(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[$(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:d,rootBoundary:p,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),b=t.rects.reference,E=t.rects.popper,x=new Map,O=!0,L=y[0],k=0;k=0,B=W?"width":"height",F=ce(t,{placement:R,boundary:d,rootBoundary:p,altBoundary:u,padding:l}),q=W?N?S:C:N?A:T;b[B]>E[B]&&(q=ee(q));var _=ee(q),V=[];if(o&&V.push(F[j]<=0),s&&V.push(F[q]<=0,F[_]<=0),V.every((function(e){return e}))){L=R,O=!1;break}x.set(R,V)}if(O)for(var z=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return L=t,"break"},X=h?3:1;X>0&&"break"!==z(X);X--);t.placement!==L&&(t.modifiersData[i]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return o(e,a(t,n))}const pe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,c=n.altAxis,l=void 0!==c&&c,d=n.boundary,p=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,g=void 0===v?0:v,y=ce(t,{boundary:d,rootBoundary:p,padding:f,altBoundary:u}),b=$(t.placement),E=U(t.placement),x=!E,O=z(b),D="x"===O?"y":"x",M=t.modifiersData.popperOffsets,k=t.rects.reference,R=t.rects.popper,j="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,P="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(M){if(s){var W,B="y"===O?T:C,F="y"===O?A:S,q="y"===O?"height":"width",_=M[O],V=_+y[B],X=_-y[F],Y=m?-R[q]/2:0,J=E===I?k[q]:R[q],G=E===I?-R[q]:-k[q],K=t.elements.arrow,Q=m&&K?w(K):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[B],te=Z[F],ne=de(0,k[q],Q[q]),ie=x?k[q]/2-Y-ne-ee-P.mainAxis:J-ne-ee-P.mainAxis,re=x?-k[q]/2+Y+ne+te+P.mainAxis:G+ne+te+P.mainAxis,oe=t.elements.arrow&&L(t.elements.arrow),ae=oe?"y"===O?oe.clientTop||0:oe.clientLeft||0:0,se=null!=(W=null==H?void 0:H[O])?W:0,le=_+re-se,pe=de(m?a(V,_+ie-se-ae):V,_,m?o(X,le):X);M[O]=pe,N[O]=pe-_}if(l){var ue,fe="x"===O?T:C,he="x"===O?A:S,me=M[D],ve="y"===D?"height":"width",ge=me+y[fe],we=me-y[he],ye=-1!==[T,C].indexOf(b),be=null!=(ue=null==H?void 0:H[D])?ue:0,Ee=ye?ge:me-k[ve]-R[ve]-be+P.altAxis,xe=ye?me+k[ve]+R[ve]-be-P.altAxis:we,Oe=m&&ye?function(e,t,n){var i=de(e,t,n);return i>n?n:i}(Ee,me,xe):de(m?Ee:ge,me,m?xe:we);M[D]=Oe,N[D]=Oe-me}t.modifiersData[i]=N}},requiresIfExists:["offset"]},ue={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=$(n.placement),c=z(s),l=[C,S].indexOf(s)>=0?"height":"width";if(o&&a){var d=function(e,t){return ae("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:se(e,M))}(r.padding,n),p=w(o),u="y"===c?T:C,f="y"===c?A:S,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=L(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=d[u],E=g-p[l]-d[f],x=g/2-p[l]/2+y,O=de(b,x,E),D=c;n.modifiersData[i]=((t={})[D]=O,t.centerOffset=O-x,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ie(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function he(e){return[T,S,A,C].some((function(t){return e[t]>=0}))}var me=q({defaultModifiers:[V,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},G,K,Q,le,pe,ue,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=ce(t,{elementContext:"reference"}),s=ce(t,{altBoundary:!0}),c=fe(a,i),l=fe(s,r,o),d=he(c),p=he(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}}]}),ve="tippy-content",ge="tippy-backdrop",we="tippy-arrow",ye="tippy-svg-arrow",be={passive:!0,capture:!0},Ee=function(){return document.body};function xe(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function Oe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Le(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Te(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function Ae(e){return[].concat(e)}function Se(e,t){-1===e.indexOf(t)&&e.push(t)}function Ce(e){return[].slice.call(e)}function De(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Me(){return document.createElement("div")}function Ie(e){return["Element","Fragment"].some((function(t){return Oe(e,t)}))}function ke(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Re(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function je(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function Pe(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var He={isTouch:!1},Ne=0;function We(){He.isTouch||(He.isTouch=!0,window.performance&&document.addEventListener("mousemove",Be))}function Be(){var e=performance.now();e-Ne<20&&(He.isTouch=!1,document.removeEventListener("mousemove",Be)),Ne=e}function Fe(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var qe=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),_e=Object.assign({appendTo:Ee,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ve=Object.keys(_e);function $e(e){var t=(e.plugins||[]).reduce((function(t,n){var i,r=n.name,o=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:null!=(i=_e[r])?i:o),t}),{});return Object.assign({},e,t)}function Ue(e,t){var n=Object.assign({},t,{content:Le(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys($e(Object.assign({},_e,{plugins:t}))):Ve).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},_e.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var ze=function(){return"innerHTML"};function Xe(e,t){e[ze()]=t}function Ye(e){var t=Me();return!0===e?t.className=we:(t.className=ye,Ie(e)?t.appendChild(e):Xe(t,e)),t}function Je(e,t){Ie(t.content)?(Xe(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Xe(e,t.content):e.textContent=t.content)}function Ge(e){var t=e.firstElementChild,n=Ce(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ve)})),arrow:n.find((function(e){return e.classList.contains(we)||e.classList.contains(ye)})),backdrop:n.find((function(e){return e.classList.contains(ge)}))}}function Ke(e){var t=Me(),n=Me();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Me();function r(n,i){var r=Ge(t),o=r.box,a=r.content,s=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"==typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||Je(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(o.removeChild(s),o.appendChild(Ye(i.arrow))):o.appendChild(Ye(i.arrow)):s&&o.removeChild(s)}return i.className=ve,i.setAttribute("data-state","hidden"),Je(i,e.props),t.appendChild(n),n.appendChild(i),r(e.props,e.props),{popper:t,onUpdate:r}}Ke.$$tippy=!0;var Qe=1,Ze=[],et=[];function tt(e,t){var n,i,r,o,a,s,c,l,d=Ue(e,Object.assign({},_e,$e(De(t)))),p=!1,u=!1,f=!1,h=!1,m=[],v=Te(X,d.interactiveDebounce),g=Qe++,w=(l=d.plugins).filter((function(e,t){return l.indexOf(e)===t})),y={id:g,reference:e,popper:Me(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:w,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)},setProps:function(t){if(!y.state.isDestroyed){R("onBeforeUpdate",[y,t]),U();var n=y.props,i=Ue(e,Object.assign({},n,De(t),{ignoreAttributes:!0}));y.props=i,$(),n.interactiveDebounce!==i.interactiveDebounce&&(H(),v=Te(X,i.interactiveDebounce)),n.triggerTarget&&!i.triggerTarget?Ae(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded"),P(),k(),x&&x(n,i),y.popperInstance&&(K(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[y,t])}},setContent:function(e){y.setProps({content:e})},show:function(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=He.isTouch&&!y.props.touch,r=xe(y.props.duration,0,_e.duration);if(!(e||t||n||i||C().hasAttribute("disabled")||(R("onShow",[y],!1),!1===y.props.onShow(y)))){if(y.state.isVisible=!0,S()&&(E.style.visibility="visible"),k(),F(),y.state.isMounted||(E.style.transition="none"),S()){var o=M();ke([o.box,o.content],0)}var a,c,l;s=function(){var e;if(y.state.isVisible&&!h){if(h=!0,E.offsetHeight,E.style.transition=y.props.moveTransition,S()&&y.props.animation){var t=M(),n=t.box,i=t.content;ke([n,i],r),Re([n,i],"visible")}j(),P(),Se(et,y),null==(e=y.popperInstance)||e.forceUpdate(),R("onMount",[y]),y.props.animation&&S()&&function(e,t){_(e,(function(){y.state.isShown=!0,R("onShown",[y])}))}(r)}},c=y.props.appendTo,l=C(),(a=y.props.interactive&&c===Ee||"parent"===c?l.parentNode:Le(c,[l])).contains(E)||a.appendChild(E),y.state.isMounted=!0,K()}},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=xe(y.props.duration,1,_e.duration);if(!(e||t||n)&&(R("onHide",[y],!1),!1!==y.props.onHide(y))){if(y.state.isVisible=!1,y.state.isShown=!1,h=!1,p=!1,S()&&(E.style.visibility="hidden"),H(),q(),k(!0),S()){var r=M(),o=r.box,a=r.content;y.props.animation&&(ke([o,a],i),Re([o,a],"hidden"))}j(),P(),y.props.animation?S()&&function(e,t){_(e,(function(){!y.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(i,y.unmount):y.unmount()}},hideWithInteractivity:function(e){D().addEventListener("mousemove",v),Se(Ze,v),v(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Q(),Z().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E),et=et.filter((function(e){return e!==y})),y.state.isMounted=!1,R("onHidden",[y]))},destroy:function(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),U(),delete e._tippy,y.state.isDestroyed=!0,R("onDestroy",[y]))}};if(!d.render)return y;var b=d.render(y),E=b.popper,x=b.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+y.id,y.popper=E,e._tippy=y,E._tippy=y;var O=w.map((function(e){return e.fn(y)})),L=e.hasAttribute("aria-expanded");return $(),P(),k(),R("onCreate",[y]),d.showOnCreate&&ee(),E.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",v)})),y;function T(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function A(){return"hold"===T()[0]}function S(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function C(){return c||e}function D(){var e,t,n=C().parentNode;return n?null!=(t=Ae(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function M(){return Ge(E)}function I(e){return y.state.isMounted&&!y.state.isVisible||He.isTouch||o&&"focus"===o.type?0:xe(y.props.delay,e?0:1,_e.delay)}function k(e){void 0===e&&(e=!1),E.style.pointerEvents=y.props.interactive&&!e?"":"none",E.style.zIndex=""+y.props.zIndex}function R(e,t,n){var i;void 0===n&&(n=!0),O.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(i=y.props)[e].apply(i,t)}function j(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,i=E.id;Ae(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var r=t&&t.replace(i,"").trim();r?e.setAttribute(n,r):e.removeAttribute(n)}}))}}function P(){!L&&y.props.aria.expanded&&Ae(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===C()?"true":"false"):e.removeAttribute("aria-expanded")}))}function H(){D().removeEventListener("mousemove",v),Ze=Ze.filter((function(e){return e!==v}))}function N(t){if(!He.isTouch||!f&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!Pe(E,n)){if(Ae(y.props.triggerTarget||e).some((function(e){return Pe(e,n)}))){if(He.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout((function(){u=!1})),y.state.isMounted||q())}}}function W(){f=!0}function B(){f=!1}function F(){var e=D();e.addEventListener("mousedown",N,!0),e.addEventListener("touchend",N,be),e.addEventListener("touchstart",B,be),e.addEventListener("touchmove",W,be)}function q(){var e=D();e.removeEventListener("mousedown",N,!0),e.removeEventListener("touchend",N,be),e.removeEventListener("touchstart",B,be),e.removeEventListener("touchmove",W,be)}function _(e,t){var n=M().box;function i(e){e.target===n&&(je(n,"remove",i),t())}if(0===e)return t();je(n,"remove",a),je(n,"add",i),a=i}function V(t,n,i){void 0===i&&(i=!1),Ae(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),m.push({node:e,eventType:t,handler:n,options:i})}))}function $(){var e;A()&&(V("touchstart",z,{passive:!0}),V("touchend",Y,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,z),e){case"mouseenter":V("mouseleave",Y);break;case"focus":V(qe?"focusout":"blur",J);break;case"focusin":V("focusout",J)}}))}function U(){m.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),m=[]}function z(e){var t,n=!1;if(y.state.isEnabled&&!G(e)&&!u){var i="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,P(),!y.state.isVisible&&Oe(e,"MouseEvent")&&Ze.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||p)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(p=!n),n&&!i&&te(e)}}function X(e){var t=e.target,n=C().contains(t)||E.contains(t);if("mousemove"!==e.type||!n){var i=Z().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,o=e.props.interactiveBorder,a=r.placement.split("-")[0],s=r.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,d="right"===a?s.left.x:0,p="left"===a?s.right.x:0,u=t.top-i+c>o,f=i-t.bottom-l>o,h=t.left-n+d>o,m=n-t.right-p>o;return u||f||h||m}))})(i,e)&&(H(),te(e))}}function Y(e){G(e)||y.props.trigger.indexOf("click")>=0&&p||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function J(e){y.props.trigger.indexOf("focusin")<0&&e.target!==C()||y.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||te(e)}function G(e){return!!He.isTouch&&A()!==e.type.indexOf("touch")>=0}function K(){Q();var t=y.props,n=t.popperOptions,i=t.placement,r=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=S()?Ge(E).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||C()}:e,d=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var n=M().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];S()&&c&&d.push({name:"arrow",options:{element:c,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),y.popperInstance=me(l,E,Object.assign({},n,{placement:i,onFirstUpdate:s,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return Ce(E.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&R("onTrigger",[y,e]),F();var t=I(!0),i=T(),r=i[0],o=i[1];He.isTouch&&"hold"===r&&o&&(t=o),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),R("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=I(!1);t?i=setTimeout((function(){y.state.isVisible&&y.hide()}),t):r=requestAnimationFrame((function(){y.hide()}))}}else q()}}function nt(e,t){void 0===t&&(t={});var n=_e.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",We,be),window.addEventListener("blur",Fe);var i,r=Object.assign({},t,{plugins:n}),o=(i=e,Ie(i)?[i]:function(e){return Oe(e,"NodeList")}(i)?Ce(i):Array.isArray(i)?i:Ce(document.querySelectorAll(i))).reduce((function(e,t){var n=t&&tt(t,r);return n&&e.push(n),e}),[]);return Ie(e)?o[0]:o}nt.defaultProps=_e,nt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){_e[t]=e[t]}))},nt.currentInput=He,Object.assign({},K,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),nt.setDefaultProps({render:Ke});const it=nt;var rt=n(72),ot=n.n(rt),at=n(825),st=n.n(at),ct=n(659),lt=n.n(ct),dt=n(56),pt=n.n(dt),ut=n(540),ft=n.n(ut),ht=n(113),mt=n.n(ht),vt=n(2),gt={};gt.styleTagTransform=mt(),gt.setAttributes=pt(),gt.insert=lt().bind(null,"head"),gt.domAPI=st(),gt.insertStyleElement=ft(),ot()(vt.A,gt),vt.A&&vt.A.locals&&vt.A.locals;class wt{constructor(e){this.element=e,this.tooltipConfig=this.makeConfig(),this.init()}init(){it(this.element,this.tooltipConfig)}makeConfig(){const e={content:this.element.getAttribute("title")};for(let t=0;t100&&t.searchParams.set("scrollY",`${window.scrollY}`),window.scrollX>100&&t.searchParams.set("scrollX",`${window.scrollX}`),e.href=t.toString()}class Ot{constructor(e){this.editor=e}openEditor(){this.editor.openEditor()}closeEditor(){this.editor.closeEditor()}executeEvent(e,t){this.editor.executeEvent(e,t)}addEventListener(e,t){this.editor.addEventListener(e,t)}removeEventListener(e,t,n){this.editor.removeEventListener(e,t,n)}updateHtml(e){return new Promise(((t,n)=>{const i=e=>{const n=this.editor.wrapperElement,i=document.createElement("div");i.innerHTML=e;const r=i.firstElementChild;return r.classList.add("wagtail-fedit-initialized"),n.parentNode.insertBefore(r,n),n.parentNode.removeChild(n),this.editor.wrapperElement=r,this.editor.initNewEditors(),this.editor.init(),t(r),n};if("string"!=typeof e)return"function"==typeof e?(this.editor.wrapperElement.editorAPI=this,void e(i)):void 0;i(e)}))}fetch(e,t,n){return i=this,r=void 0,a=function*(){let i=new Headers;return i.append("X-Requested-With","XMLHttpRequest"),i.append("X-CSRFToken",function(e){let t=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let i=0;ie.json()))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,s)}c((a=a.apply(i,r||[])).next())}));var i,r,o,a}refetch(){return this.editor.refetch()}execRelated(e){for(const t of this.editor.relatedWrappers)e(t.editorAPI)}}const Lt="wagtail-fedit-modal",Tt=`\n
\n
\n
\n
`;class At{constructor(e){this.options=e,this.modalHtml=Tt.replace("__ID__",this.options.modalId)}static get modalWrapper(){var e=document.querySelector(`#${Lt}-wrapper`);return e||((e=document.createElement("div")).id=`${Lt}-wrapper`,e.classList.add(`${Lt}-wrapper`),document.body.appendChild(e),e)}get wrapper(){return this.constructor.modalWrapper}get modal(){var e=this.wrapper.querySelector(`.${Lt}`);e&&e.id!==`${Lt}-${this.options.modalId}-modal`&&(e.remove(),e=null),e||(e=this.buildModal());var t=e;return t.modal=this,t}get innerHTML(){return this.modal.innerHTML}set innerHTML(e){this.modal.innerHTML=e}get style(){return this.modal.style}get classList(){return this.modal.classList}get children(){return this.modal.children}buildModal(){var e=this.wrapper,t=e.querySelector(`.${Lt}`);return t||(e.innerHTML=this.modalHtml,t=e.querySelector(`.${Lt}`)),t.modal||(t.modal=this),t}addClass(e){this.modal.classList.add(e)}removeClass(e){this.modal.classList.remove(e)}openModal(){this.wrapper.classList.add("open"),this.options.onOpen&&this.options.onOpen()}closeModal(){this.wrapper.classList.remove("open"),this.wrapper.innerHTML="",this.options.onClose&&this.options.onClose()}destroy(){this.wrapper.remove(),this.options.onDestroy&&this.options.onDestroy()}appendChild(...e){if(0!==e.length)for(let t=0;t{}),onError:a=(()=>{}),onCancel:s=(()=>{}),onResize:c=(()=>{}),executeOnloadImmediately:l=!1}=e;this.url=r,this.srcdoc=i,this.iframe=null,this.id=t,this.className=n,this.onResize=c,this.executeOnloadImmediately=l,this.onLoad=o,this.onError=a,this.onCancel=s,this.render()}get element(){return this.iframe||(this.iframe=this._renderFrame(this.url,this.srcdoc,this.onLoad)),this.iframe}get document(){return this.window?this.window.document:null}get window(){return this.element.contentWindow}get mainElement(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector("#main")}get formElement(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector("#wagtail-fedit-form")}get formWrapper(){var e;return null===(e=this.document)||void 0===e?void 0:e.querySelector(".wagtail-fedit-form-wrapper")}destroy(){this.iframe.remove(),this.resizeInterval&&(clearInterval(this.resizeInterval),delete this.resizeInterval)}update(e,t){this.srcdoc=t,this.url=e,this._renderFrame(this.url,this.srcdoc,(({newFrame:e})=>{this.iframe.remove(),this.iframe=e,this.onLoad({newFrame:e})}),this.onError)}render(){return this.iframe||(this.iframe=this._renderFrame(this.url,this.srcdoc,this.onLoad)),this.iframe}_renderFrame(e,t,n,i=(()=>{})){const r=document.createElement("iframe");return t?r.srcdoc=t:r.src=e,r.id=this.id,r.className=this.className,r.onload=()=>{if(!this.formElement)return void i();let e=this.formElement,t=e.scrollHeight;this.onResize&&this.onResize(0,t),this.resizeInterval&&clearInterval(this.resizeInterval),this.onResize&&(this.resizeInterval=setInterval((()=>{if(e)try{t!==e.scrollHeight&&(this.onResize(t,e.scrollHeight),t=e.scrollHeight)}catch(e){clearInterval(this.resizeInterval),console.error(e),i()}else clearInterval(this.resizeInterval)}),25));const o=this.document.querySelector(".wagtail-fedit-cancel-button");o&&o.addEventListener("click",(()=>{clearInterval(this.resizeInterval),this.onCancel()})),"complete"===this.document.readyState||this.executeOnloadImmediately?n({newFrame:r}):r.contentWindow.addEventListener("DOMContentLoaded",(()=>{n({newFrame:r})}))},r.onerror=()=>{i()},r}}class Ct extends EventTarget{constructor(e){super(),this.api=new Ot(this),this.initialTitle=document.title,this.wrapperElement=e,this.sharedContext=null,this.editBtn=null,this.iframe=null,this.init(),window.location.hash===`#${this.wrapperElement.id}`&&(this.openEditor(),this.focus())}get editUrl(){return this.wrapperElement.dataset.editUrl}get refetchUrl(){return this.wrapperElement.dataset.refetchUrl}get relatedWrappers(){const e=this.wrapperElement.dataset.wrapperId,t=document.querySelectorAll(`[data-wrapper-id="${e}"]`);return Array.from(t).filter((e=>e!==this.wrapperElement))}init(){this.sharedContext=this.wrapperElement.dataset.sharedContext,this.wrapperElement.editorAPI=this.api,this.editBtn=this.wrapperElement.querySelector(".wagtail-fedit-edit-button"),this.editBtn.addEventListener("click",(e=>{return t=this,n=void 0,r=function*(){e.preventDefault(),e.stopPropagation(),this.opened||this.openEditor()},new((i=void 0)||(i=Promise))((function(e,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,s)}c((r=r.apply(t,n||[])).next())}));var t,n,i,r}))}initNewEditors(){bt(this.wrapperElement)}focus(){this.wrapperElement.focus()}refetch(){return new Promise(((e,t)=>{fetch(this.refetchUrl).then((e=>e.json())).then((t=>{t.success?(this.onResponse(t),e(t)):console.error("Errors rendering response, failed to refetch",t)})).catch((e=>{console.error("Failed to refetch",e),t(e)}))}))}onResponse(e){throw new Error("onResponse not implemented, cannot call super")}get frameOptions(){return{}}openIframe(e,t){if(this.iframe)return e.appendChild(this.iframe.element),void t(this.iframe);this.iframe=new St(Object.assign(Object.assign({url:this.editUrl,id:"wagtail-fedit-iframe",className:null,executeOnloadImmediately:!0},this.frameOptions),{onLoad:()=>{const t=e=>{e.preventDefault();const n=new FormData(this.iframe.formElement);this.executeEvent(window.wagtailFedit.EVENTS.SUBMIT,{element:this.wrapperElement,formData:n}),fetch(this.editUrl,{method:"POST",body:n}).then((e=>e.json())).then((e=>{if(!e.success){console.error("Errors rendering response",e);let n=document.createElement("div");n.innerHTML=e.html,this.iframe.mainElement.innerHTML=n.querySelector("#main").innerHTML,this.iframe.formElement.onsubmit=t;const i=this.iframe.mainElement.querySelector("#value[data-block]");i&&this.iframe.window.initBlockWidget(i.id);const r=this.iframe.document.querySelector(".wagtail-fedit-cancel-button"),o=this.closeEditor.bind(this);return r.addEventListener("click",o),this.iframe.onCancel=o,void this.executeEvent(window.wagtailFedit.EVENTS.SUBMIT_ERROR,{element:this.wrapperElement,response:e})}const n=this.onResponse(e),i=()=>{this.closeEditor(),this.executeEvent(window.wagtailFedit.EVENTS.CHANGE,{element:this.wrapperElement})};n instanceof Promise?n.then(i):i()}))};this.iframe.formElement.onsubmit=t,this.iframe.onCancel=this.closeEditor.bind(this);const n=this.iframe.formWrapper,i=["large","full"];for(const t of i)if(n&&(n.classList.contains(`fedit-${t}`)||(this.iframe.formElement.dataset.editorSize||"").toLowerCase()===t)){e.classList.add(`fedit-${t}`);break}const r=window.location.href.split("#")[0];window.history.pushState(null,this.iframe.document.title,r+`#${this.wrapperElement.id}`),document.title=this.iframe.document.title,this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_LOAD,{iframe:this.iframe})},onError:()=>{this.closeEditor()},onCancel:()=>{this.closeEditor()}})),e.appendChild(this.iframe.element),t(this.iframe)}openEditor(){this.modal||(this.modal=new At({modalId:this.wrapperElement.id})),this.opened=!0,this.openIframe(this.modal,(e=>{const t=document.createElement("button");t.innerHTML="×",t.classList.add("wagtail-fedit-close-button"),t.addEventListener("click",this.closeEditor.bind(this)),this.modal.appendChild(t),this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_OPEN,{iframe:this.iframe,modal:this.modal}),this.modal.openModal()}))}closeEditor(){this.opened=!1,window.history.pushState(null,this.initialTitle,window.location.href.split("#")[0]),document.title=this.initialTitle,this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_CLOSE),this.modal.closeModal()}executeEvent(e,t){t||(t={element:this.wrapperElement}),t.editor=this,t.api=this.api,e.startsWith(`${window.wagtailFedit.NAMESPACE}:`)||(e=`${window.wagtailFedit.NAMESPACE}:${e}`);const n=new CustomEvent(e,{detail:t});super.dispatchEvent(n),this.wrapperElement.dispatchEvent(n),document.dispatchEvent(n)}}class Dt{constructor(e){this.publishButton=e,this.publishButtonsWrapper=e.parentElement.querySelector(".wagtail-fedit-form-buttons"),this.publishButtonsWrapper.querySelectorAll(".wagtail-fedit-userbar-button"),this.init()}init(){this.publishButton.addEventListener("click",(e=>{this.publishButtonsWrapper.classList.contains("open")?this.publishButtonsWrapper.animate([{opacity:1,height:`${this.publishButtonsWrapper.scrollHeight}px`},{opacity:0,height:"0px"}],{duration:500,easing:"ease-in-out"}).onfinish=()=>{this.publishButtonsWrapper.classList.remove("open")}:(e.preventDefault(),e.stopPropagation(),this.publishButtonsWrapper.animate([{opacity:0,height:"0px"},{opacity:1,height:`${this.publishButtonsWrapper.scrollHeight}px`}],{duration:500,easing:"ease-in-out"}).onfinish=()=>{this.publishButtonsWrapper.classList.add("open")})}))}}class Mt extends Ct{static get funcMap(){return window}onResponse(e){const t=e.func.name,n=e.func.target;if(!t||!n)return void console.error("Invalid response",e);const i=document.querySelector(n);if(!i)return void console.error("Target element not found",n);const r=this.constructor.funcMap[t];if(r)return r(i,e);console.error("Function not found",t)}}class It extends Ct{onResponse(e){return this.api.updateHtml((t=>{this.wrapperElement.animate([{opacity:1},{opacity:0}],{duration:350,easing:"ease-in-out"}).onfinish=()=>{const n=t(e.html);e.refetch||this.api.execRelated((e=>{e.refetch()})),n.animate([{opacity:0},{opacity:1}],{duration:350,easing:"ease-in-out"}).onfinish=()=>{n.style.opacity="1"}}}))}}function kt(e){return class extends e{constructor(...e){super(...e);let t=this.wrapperElement.querySelectorAll("[data-direction]");for(let e=0;e{e.preventDefault(),this.api.fetch(i,"POST",{}).then((e=>{e.success?Et():e.error?alert("Failed to move block: "+e.error):alert("Failed to move block")})).catch((e=>{console.error("Failed to move block",e),alert("Failed to move block")}))}))}}}}class Rt extends(kt(It)){}class jt extends It{get buttonsElement(){return this.wrapperElement.querySelector(".wagtail-fedit-buttons")}get formElement(){return this.wrapperElement.querySelector(".wagtail-fedit-adapter-form")}get contentElement(){return this.wrapperElement.querySelector(".wagtail-fedit-adapter-content")}get frameOptions(){return{onResize:(e,t)=>{this.iframe.element.style.height=`${t}px`}}}openEditor(){this.openIframe(this.formElement,(e=>{this.contentElement.style.display="none"}))}closeEditor(){this.opened=!1,window.history.pushState(null,this.initialTitle,window.location.href.split("#")[0]),document.title=this.initialTitle,this.contentElement.style.display="block",this.iframe.destroy(),this.executeEvent(window.wagtailFedit.EVENTS.EDITOR_CLOSE),delete this.iframe}}class Pt extends(kt(jt)){}function Ht(){bt(),new MutationObserver((e=>{for(const t of e)for(let e=0;e0||n>0)&&window.scrollTo(n,t);const i=document.querySelector("wagtail-userbar");if(i){const e=i.shadowRoot.querySelector("#wagtail-fedit-editor-button"),t=i.shadowRoot.querySelector("#wagtail-fedit-live-button"),n=i.shadowRoot.querySelector("#wagtail-fedit-publish-menu");if(e||t){let n;window.addEventListener("scroll",(()=>{n&&clearTimeout(n),n=setTimeout((()=>{xt(e),xt(t);const n=new URL(window.location.href);n.searchParams.set("scrollY",`${window.scrollY}`),n.searchParams.set("scrollX",`${window.scrollX}`),window.history.replaceState(null,"",n.toString())}),50)}))}n&&new Dt(n)}}window.wagtailFedit={NAMESPACE:"wagtail-fedit",EVENTS:{SUBMIT:"wagtail-fedit:submit",CHANGE:"wagtail-fedit:change",EDITOR_OPEN:"wagtail-fedit:editorOpen",EDITOR_LOAD:"wagtail-fedit:editorLoad",EDITOR_CLOSE:"wagtail-fedit:editorClose",SUBMIT_ERROR:"wagtail-fedit:submitError"},editors:{"wagtail_fedit.editors.BaseFuncEditor":Mt,"wagtail_fedit.editors.FieldEditor":It,"wagtail_fedit.editors.BlockEditor":Rt,"wagtail_fedit.editors.DomPositionedFieldEditor":jt,"wagtail_fedit.editors.DomPositionedBlockEditor":Pt,"wagtail_fedit.editors.WagtailFeditFuncEditor":class extends Mt{static get funcMap(){return window.wagtailFedit.funcs}}},funcs:{"wagtail_fedit.funcs.backgroundImageFunc":function(e,t){const n=t.url,i=t.css_variable_name;i?(i.startsWith("--"),e.style.setProperty(i,`url(${n})`)):e.style.backgroundImage=`url(${n})`}},register:function(e,t){this.editors[e]=t},registerFunc:function(e,t){this.funcs[e]=t}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ht):Ht()})()})(); \ No newline at end of file diff --git a/wagtail_fedit/static_src/editors/base/base.ts b/wagtail_fedit/static_src/editors/base/base.ts index 090280b..6e88b2b 100644 --- a/wagtail_fedit/static_src/editors/base/base.ts +++ b/wagtail_fedit/static_src/editors/base/base.ts @@ -116,6 +116,7 @@ class BaseWagtailFeditEditor extends EventTarget { openIframe(wrapper: HTMLElement, fn: (iframe: iFrame) => void) { if (this.iframe) { + wrapper.appendChild(this.iframe.element); fn(this.iframe); return; }