-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp-5618954f.js
5 lines (5 loc) · 21.3 KB
/
p-5618954f.js
1
2
3
4
5
/*!
* Built by BASIS
* Copyright BASIS International Ltd.
*/
var t="top",n="bottom",e="right",r="left",i="auto",o=[t,n,e,r],a="start",u="end",f="clippingParents",s="viewport",c="popper",d="reference",p=o.reduce((function(t,n){return t.concat([n+"-"+a,n+"-"+u])}),[]),l=[].concat(o,[i]).reduce((function(t,n){return t.concat([n,n+"-"+a,n+"-"+u])}),[]),h=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function v(t){return t?(t.nodeName||"").toLowerCase():null}function b(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function m(t){return t instanceof b(t).Element||t instanceof Element}function y(t){return t instanceof b(t).HTMLElement||t instanceof HTMLElement}function w(t){return"undefined"!=typeof ShadowRoot&&(t instanceof b(t).ShadowRoot||t instanceof ShadowRoot)}function x(t){return t.split("-")[0]}var O=Math.max,g=Math.min,j=Math.round;function M(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function A(){return!/^((?!chrome|android).)*safari/i.test(M())}function E(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t.getBoundingClientRect(),i=1,o=1;n&&y(t)&&(i=t.offsetWidth>0&&j(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&j(r.height)/t.offsetHeight||1);var a=(m(t)?b(t):window).visualViewport,u=!A()&&e,f=(r.left+(u&&a?a.offsetLeft:0))/i,s=(r.top+(u&&a?a.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:s,right:f+c,bottom:s+d,left:f,x:f,y:s}}function k(t){var n=E(t),e=t.offsetWidth,r=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-r)<=1&&(r=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:r}}function T(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&w(e)){var r=n;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function q(t){return b(t).getComputedStyle(t)}function B(t){return["table","td","th"].indexOf(v(t))>=0}function P(t){return((m(t)?t.ownerDocument:t.document)||window.document).documentElement}function H(t){return"html"===v(t)?t:t.assignedSlot||t.parentNode||(w(t)?t.host:null)||P(t)}function L(t){return y(t)&&"fixed"!==q(t).position?t.offsetParent:null}function R(t){for(var n=b(t),e=L(t);e&&B(e)&&"static"===q(e).position;)e=L(e);return e&&("html"===v(e)||"body"===v(e)&&"static"===q(e).position)?n:e||function(t){var n=/firefox/i.test(M());if(/Trident/i.test(M())&&y(t)&&"fixed"===q(t).position)return null;var e=H(t);for(w(e)&&(e=e.host);y(e)&&["html","body"].indexOf(v(e))<0;){var r=q(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||n&&"filter"===r.willChange||n&&r.filter&&"none"!==r.filter)return e;e=e.parentNode}return null}(t)||n}function S(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function W(t,n,e){return O(t,g(n,e))}function I(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function C(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function V(t){return t.split("-")[1]}var z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function F(i){var o,a=i.popper,f=i.popperRect,s=i.placement,c=i.variation,d=i.offsets,p=i.position,l=i.gpuAcceleration,h=i.adaptive,v=i.roundOffsets,m=i.isFixed,y=d.x,w=void 0===y?0:y,x=d.y,O=void 0===x?0:x,g="function"==typeof v?v({x:w,y:O}):{x:w,y:O};w=g.x,O=g.y;var M=d.hasOwnProperty("x"),A=d.hasOwnProperty("y"),E=r,k=t,T=window;if(h){var B=R(a),H="clientHeight",L="clientWidth";B===b(a)&&"static"!==q(B=P(a)).position&&"absolute"===p&&(H="scrollHeight",L="scrollWidth"),(s===t||(s===r||s===e)&&c===u)&&(k=n,O-=(m&&B===T&&T.visualViewport?T.visualViewport.height:B[H])-f.height,O*=l?1:-1),s!==r&&(s!==t&&s!==n||c!==u)||(E=e,w-=(m&&B===T&&T.visualViewport?T.visualViewport.width:B[L])-f.width,w*=l?1:-1)}var S,W=Object.assign({position:p},h&&z),I=!0===v?function(t){var n=t.y,e=window.devicePixelRatio||1;return{x:j(t.x*e)/e||0,y:j(n*e)/e||0}}({x:w,y:O}):{x:w,y:O};return w=I.x,O=I.y,Object.assign({},W,l?((S={})[k]=A?"0":"",S[E]=M?"0":"",S.transform=(T.devicePixelRatio||1)<=1?"translate("+w+"px, "+O+"px)":"translate3d("+w+"px, "+O+"px, 0)",S):((o={})[k]=A?O+"px":"",o[E]=M?w+"px":"",o.transform="",o))}var U={passive:!0},D={left:"right",right:"left",bottom:"top",top:"bottom"};function _(t){return t.replace(/left|right|bottom|top/g,(function(t){return D[t]}))}var G={start:"end",end:"start"};function J(t){return t.replace(/start|end/g,(function(t){return G[t]}))}function K(t){var n=b(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function N(t){return E(P(t)).left+K(t).scrollLeft}function Q(t){var n=q(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function X(t){return["html","body","#document"].indexOf(v(t))>=0?t.ownerDocument.body:y(t)&&Q(t)?t:X(H(t))}function Y(t,n){var e;void 0===n&&(n=[]);var r=X(t),i=r===(null==(e=t.ownerDocument)?void 0:e.body),o=b(r),a=i?[o].concat(o.visualViewport||[],Q(r)?r:[]):r,u=n.concat(a);return i?u:u.concat(Y(H(a)))}function Z(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $(t,n,e){return n===s?Z(function(t,n){var e=b(t),r=P(t),i=e.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,f=0;if(i){o=i.width,a=i.height;var s=A();(s||!s&&"fixed"===n)&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:u+N(t),y:f}}(t,e)):m(n)?function(t,n){var e=E(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):Z(function(t){var n,e=P(t),r=K(t),i=null==(n=t.ownerDocument)?void 0:n.body,o=O(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=O(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+N(t),f=-r.scrollTop;return"rtl"===q(i||e).direction&&(u+=O(e.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:f}}(P(t)))}function tt(i){var o,f=i.reference,s=i.element,c=i.placement,d=c?x(c):null,p=c?V(c):null,l=f.x+f.width/2-s.width/2,h=f.y+f.height/2-s.height/2;switch(d){case t:o={x:l,y:f.y-s.height};break;case n:o={x:l,y:f.y+f.height};break;case e:o={x:f.x+f.width,y:h};break;case r:o={x:f.x-s.width,y:h};break;default:o={x:f.x,y:f.y}}var v=d?S(d):null;if(null!=v){var b="y"===v?"height":"width";switch(p){case a:o[v]=o[v]-(f[b]/2-s[b]/2);break;case u:o[v]=o[v]+(f[b]/2-s[b]/2)}}return o}function nt(r,i){void 0===i&&(i={});var a=i.placement,u=void 0===a?r.placement:a,p=i.strategy,l=void 0===p?r.strategy:p,h=i.boundary,b=void 0===h?f:h,w=i.rootBoundary,x=void 0===w?s:w,j=i.elementContext,M=void 0===j?c:j,A=i.altBoundary,k=void 0!==A&&A,B=i.padding,L=void 0===B?0:B,S=I("number"!=typeof L?L:C(L,o)),W=r.rects.popper,V=r.elements[k?M===c?d:c:M],z=function(t,n,e,r){var i="clippingParents"===n?function(t){var n=Y(H(t)),e=["absolute","fixed"].indexOf(q(t).position)>=0&&y(t)?R(t):t;return m(e)?n.filter((function(t){return m(t)&&T(t,e)&&"body"!==v(t)})):[]}(t):[].concat(n),o=[].concat(i,[e]),a=o.reduce((function(n,e){var i=$(t,e,r);return n.top=O(i.top,n.top),n.right=g(i.right,n.right),n.bottom=g(i.bottom,n.bottom),n.left=O(i.left,n.left),n}),$(t,o[0],r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(m(V)?V:V.contextElement||P(r.elements.popper),b,x,l),F=E(r.elements.reference),U=tt({reference:F,element:W,strategy:"absolute",placement:u}),D=Z(Object.assign({},W,U)),_=M===c?D:F,G={top:z.top-_.top+S.top,bottom:_.bottom-z.bottom+S.bottom,left:z.left-_.left+S.left,right:_.right-z.right+S.right},J=r.modifiersData.offset;if(M===c&&J){var K=J[u];Object.keys(G).forEach((function(r){var i=[e,n].indexOf(r)>=0?1:-1,o=[t,n].indexOf(r)>=0?"y":"x";G[r]+=K[o]*i}))}return G}function et(t,n){void 0===n&&(n={});var e=n.boundary,r=n.rootBoundary,i=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,f=void 0===u?l:u,s=V(n.placement),c=s?a?p:p.filter((function(t){return V(t)===s})):o,d=c.filter((function(t){return f.indexOf(t)>=0}));0===d.length&&(d=c);var h=d.reduce((function(n,o){return n[o]=nt(t,{placement:o,boundary:e,rootBoundary:r,padding:i})[x(o)],n}),{});return Object.keys(h).sort((function(t,n){return h[t]-h[n]}))}const rt={name:"flip",enabled:!0,phase:"main",fn:function(o){var u=o.state,f=o.options,s=o.name;if(!u.modifiersData[s]._skip){for(var c=f.mainAxis,d=void 0===c||c,p=f.altAxis,l=void 0===p||p,h=f.fallbackPlacements,v=f.padding,b=f.boundary,m=f.rootBoundary,y=f.altBoundary,w=f.flipVariations,O=void 0===w||w,g=f.allowedAutoPlacements,j=u.options.placement,M=x(j),A=h||(M!==j&&O?function(t){if(x(t)===i)return[];var n=_(t);return[J(t),n,J(n)]}(j):[_(j)]),E=[j].concat(A).reduce((function(t,n){return t.concat(x(n)===i?et(u,{placement:n,boundary:b,rootBoundary:m,padding:v,flipVariations:O,allowedAutoPlacements:g}):n)}),[]),k=u.rects.reference,T=u.rects.popper,q=new Map,B=!0,P=E[0],H=0;H<E.length;H++){var L=E[H],R=x(L),S=V(L)===a,W=[t,n].indexOf(R)>=0,I=W?"width":"height",C=nt(u,{placement:L,boundary:b,rootBoundary:m,altBoundary:y,padding:v}),z=W?S?e:r:S?n:t;k[I]>T[I]&&(z=_(z));var F=_(z),U=[];if(d&&U.push(C[R]<=0),l&&U.push(C[z]<=0,C[F]<=0),U.every((function(t){return t}))){P=L,B=!1;break}q.set(L,U)}if(B)for(var D=function(t){var n=E.find((function(n){var e=q.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return P=n,"break"},G=O?3:1;G>0&&"break"!==D(G);G--);u.placement!==P&&(u.modifiersData[s]._skip=!0,u.placement=P,u.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function it(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function ot(i){return[t,e,n,r].some((function(t){return i[t]>=0}))}function at(t,n,e){void 0===e&&(e=!1);var r,i,o=y(n),a=y(n)&&function(t){var n=t.getBoundingClientRect(),e=j(n.width)/t.offsetWidth||1,r=j(n.height)/t.offsetHeight||1;return 1!==e||1!==r}(n),u=P(n),f=E(t,a,e),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&(("body"!==v(n)||Q(u))&&(s=(r=n)!==b(r)&&y(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:K(r)),y(n)?((c=E(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):u&&(c.x=N(u))),{x:f.left+s.scrollLeft-c.x,y:f.top+s.scrollTop-c.y,width:f.width,height:f.height}}function ut(t){var n=new Map,e=new Set,r=[];function i(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var r=n.get(t);r&&i(r)}})),r.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||i(t)})),r}var ft={placement:"bottom",modifiers:[],strategy:"absolute"};function st(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function ct(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?ft:r;return function(t,n,r){void 0===r&&(r=i);var o,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ft,i),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},f=[],s=!1,c={state:u,setOptions:function(r){var o="function"==typeof r?r(u.options):r;d(),u.options=Object.assign({},i,u.options,o),u.scrollParents={reference:m(t)?Y(t):t.contextElement?Y(t.contextElement):[],popper:Y(n)};var a,s,p=function(t){var n=ut(t);return h.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((a=[].concat(e,u.options.modifiers),s=a.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(s).map((function(t){return s[t]}))));return u.orderedModifiers=p.filter((function(t){return t.enabled})),u.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var r=e({state:u,name:t.name,instance:c,options:void 0===n?{}:n});f.push(r||function(){})}})),c.update()},forceUpdate:function(){if(!s){var t=u.elements,n=t.reference,e=t.popper;if(st(n,e)){u.rects={reference:at(n,R(e),"fixed"===u.options.strategy),popper:k(e)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(t){return u.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var i=u.orderedModifiers[r],o=i.fn,a=i.options;"function"==typeof o&&(u=o({state:u,options:void 0===a?{}:a,name:i.name,instance:c})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){c.forceUpdate(),t(u)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){d(),s=!0}};if(!st(t,n))return c;function d(){f.forEach((function(t){return t()})),f=[]}return c.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),c}}var dt=ct({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,r=t.options,i=r.scroll,o=void 0===i||i,a=r.resize,u=void 0===a||a,f=b(n.elements.popper),s=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&s.forEach((function(t){t.addEventListener("scroll",e.update,U)})),u&&f.addEventListener("resize",e.update,U),function(){o&&s.forEach((function(t){t.removeEventListener("scroll",e.update,U)})),u&&f.removeEventListener("resize",e.update,U)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=tt({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,r=e.gpuAcceleration,i=void 0===r||r,o=e.adaptive,a=void 0===o||o,u=e.roundOffsets,f=void 0===u||u,s={placement:x(n.placement),variation:V(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,F(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:f})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,F(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},r=n.attributes[t]||{},i=n.elements[t];y(i)&&v(i)&&(Object.assign(i.style,e),Object.keys(r).forEach((function(t){var n=r[t];!1===n?i.removeAttribute(t):i.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var r=n.elements[t],i=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});y(r)&&v(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(n){var i=n.state,o=n.name,a=n.options.offset,u=void 0===a?[0,0]:a,f=l.reduce((function(n,o){return n[o]=function(n,i,o){var a=x(n),u=[r,t].indexOf(a)>=0?-1:1,f="function"==typeof o?o(Object.assign({},i,{placement:n})):o,s=f[0],c=f[1];return s=s||0,c=(c||0)*u,[r,e].indexOf(a)>=0?{x:c,y:s}:{x:s,y:c}}(o,i.rects,u),n}),{}),s=f[i.placement],c=s.y;null!=i.modifiersData.popperOffsets&&(i.modifiersData.popperOffsets.x+=s.x,i.modifiersData.popperOffsets.y+=c),i.modifiersData[o]=f}},rt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(i){var o=i.state,u=i.options,f=i.name,s=u.mainAxis,c=void 0===s||s,d=u.altAxis,p=void 0!==d&&d,l=u.tether,h=void 0===l||l,v=u.tetherOffset,b=void 0===v?0:v,m=nt(o,{boundary:u.boundary,rootBoundary:u.rootBoundary,padding:u.padding,altBoundary:u.altBoundary}),y=x(o.placement),w=V(o.placement),j=!w,M=S(y),A="x"===M?"y":"x",E=o.modifiersData.popperOffsets,T=o.rects.reference,q=o.rects.popper,B="function"==typeof b?b(Object.assign({},o.rects,{placement:o.placement})):b,P="number"==typeof B?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),H=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,L={x:0,y:0};if(E){if(c){var I,C="y"===M?t:r,z="y"===M?n:e,F="y"===M?"height":"width",U=E[M],D=U+m[C],_=U-m[z],G=h?-q[F]/2:0,J=w===a?T[F]:q[F],K=w===a?-q[F]:-T[F],N=o.elements.arrow,Q=h&&N?k(N):{width:0,height:0},X=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=X[C],Z=X[z],$=W(0,T[F],Q[F]),tt=j?T[F]/2-G-$-Y-P.mainAxis:J-$-Y-P.mainAxis,et=j?-T[F]/2+G+$+Z+P.mainAxis:K+$+Z+P.mainAxis,rt=o.elements.arrow&&R(o.elements.arrow),it=null!=(I=null==H?void 0:H[M])?I:0,ot=U+et-it,at=W(h?g(D,U+tt-it-(rt?"y"===M?rt.clientTop||0:rt.clientLeft||0:0)):D,U,h?O(_,ot):_);E[M]=at,L[M]=at-U}if(p){var ut,ft=E[A],st="y"===A?"height":"width",ct=ft+m["x"===M?t:r],dt=ft-m["x"===M?n:e],pt=-1!==[t,r].indexOf(y),lt=null!=(ut=null==H?void 0:H[A])?ut:0,ht=pt?ct:ft-T[st]-q[st]-lt+P.altAxis,vt=pt?ft+T[st]+q[st]-lt-P.altAxis:dt,bt=h&&pt?function(t,n,e){var r=W(t,n,e);return r>e?e:r}(ht,ft,vt):W(h?ht:ct,ft,h?vt:dt);E[A]=bt,L[A]=bt-ft}o.modifiersData[f]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(i){var a,u=i.state,f=i.name,s=i.options,c=u.elements.arrow,d=u.modifiersData.popperOffsets,p=x(u.placement),l=S(p),h=[r,e].indexOf(p)>=0?"height":"width";if(c&&d){var v=function(t,n){return I("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:C(t,o))}(s.padding,u),b=k(c),m="y"===l?t:r,y="y"===l?n:e,w=u.rects.reference[h]+u.rects.reference[l]-d[l]-u.rects.popper[h],O=d[l]-u.rects.reference[l],g=R(c),j=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,M=j/2-b[h]/2+(w/2-O/2),A=W(v[m],M,j-b[h]-v[y]);u.modifiersData[f]=((a={})[l]=A,a.centerOffset=A-M,a)}},effect:function(t){var n=t.state,e=t.options.element,r=void 0===e?"[data-popper-arrow]":e;null!=r&&("string"!=typeof r||(r=n.elements.popper.querySelector(r)))&&T(n.elements.popper,r)&&(n.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,r=n.rects.reference,i=n.rects.popper,o=n.modifiersData.preventOverflow,a=nt(n,{elementContext:"reference"}),u=nt(n,{altBoundary:!0}),f=it(a,r),s=it(u,i,o),c=ot(f),d=ot(s);n.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]});class pt{constructor(t,n,e){this.options={},this.moved=!1,this._isVisible=!1,this.reference=t,this.popover=n,this.handleAfterTransition=this.handleAfterTransition.bind(this),this.popover.addEventListener("transitionend",this.handleAfterTransition),this.setOptions(Object.assign({strategy:"fixed",placement:"bottom-start",transitionedElement:this.popover,visibleClass:"dwc-positioner--visible",modifiers:[],onBeforeOpen:()=>{},onAfterOpen:()=>{},onAfterRestore:()=>{},onTransitionEnd:()=>{}},e))}set isVisible(t){this._isVisible=t,this.popover.hidden=!t,requestAnimationFrame((()=>{this.popover.classList.toggle(this.options.visibleClass,t)}))}get isVisible(){return this._isVisible}async open(){return this.move(),await this.options.onBeforeOpen.call(this),this.isVisible=!0,this.originalPopper&&this.originalPopper.destroy(),this.originalPopper=dt(this.reference,this.popover,this.options),await this.options.onAfterOpen.call(this),this.update()}async close(){return this.isVisible=!1,this.restore()}async update(){if(this.originalPopper)return this.originalPopper.update()}forceUpdate(){this.originalPopper&&this.originalPopper.forceUpdate()}setOptions(t){if(this.options=Object.assign(this.options,t),this.isVisible=this.isVisible,this.originalPopper)return this.originalPopper.setOptions(t),this.forceUpdate()}getOptions(){return this.options}async destroy(){if(this.popover.removeEventListener("transitionend",this.handleAfterTransition),this.originalPopper)return this.originalPopper.destroy(),this.restore()}async handleAfterTransition(t){t.target===this.options.transitionedElement&&(await this.options.onTransitionEnd.call(this,t),this.isVisible||this.popover.hidden||(this.popover.hidden=!0,this.popover.classList.remove(this.options.visibleClass),await this.restore()))}move(){this.options.moveTo instanceof HTMLElement&&!this.moved&&(this.options.moveTo.appendChild(this.popover),this.moved=!0)}async restore(){if(this.options.restoreTo instanceof HTMLElement&&this.moved)return this.isVisible=!1,this.moved=!1,this.options.restoreTo.appendChild(this.popover),this.options.onAfterRestore.call(this)}}const lt=(t=0,n=0)=>({name:"offset",options:{offset:[t,n]}}),ht=(t="viewport",n=!1)=>({name:"flip",options:{boundary:t,preventOverflow:n}}),vt=(t="viewport",n=!0)=>({name:"preventOverflow",options:{boundary:t,altAxis:n}}),bt=()=>({name:"hide"}),mt=()=>({name:"applyArrowHide",enabled:!0,phase:"write",fn({state:t}){const{arrow:n}=t.elements;n&&(n.style.display=0!==t.modifiersData.arrow.centerOffset?"none":"block")}});export{pt as P,mt as a,ht as f,bt as h,lt as o,vt as p}