FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
surecart
Edit File: p-8c8c3326.js
function t(t){return t.split("-")[0]}function n(t){return t.split("-")[1]}function e(e){return["top","bottom"].includes(t(e))?"x":"y"}function o(t){return"y"===t?"height":"width"}function r(i,r,l){let{reference:s,floating:c}=i;const a=s.x+s.width/2-c.width/2,f=s.y+s.height/2-c.height/2,u=e(r),d=o(u),h=s[d]/2-c[d]/2,m="x"===u;let g;switch(t(r)){case"top":g={x:a,y:s.y-c.height};break;case"bottom":g={x:a,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:f};break;case"left":g={x:s.x-c.width,y:f};break;default:g={x:s.x,y:s.y}}switch(n(r)){case"start":g[u]-=h*(l&&m?-1:1);break;case"end":g[u]+=h*(l&&m?-1:1)}return g}const i=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:s}=n,c=await(null==s.isRTL?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=r(a,o,c),d=o,h={},m=0;for(let n=0;n<l.length;n++){const{name:g,fn:p}=l[n],{x:y,y:w,data:x,reset:v}=await p({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:a,platform:s,elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=w?w:u,h={...h,[g]:{...h[g],...x}},v&&m<=50&&(m++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(a=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),({x:f,y:u}=r(a,d,c))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}};function s(t){return{top:0,right:0,bottom:0,left:0,...t}}function c(t){return"number"!=typeof t?s(t):{top:t,right:t,bottom:t,left:t}}function l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function a(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=e,p=c(g),y=a[m?"floating"===h?"reference":"floating":h],w=l(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:f})),x=l(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===h?{...s.floating,x:o,y:i}:s.reference,offsetParent:await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),strategy:f}):s[h]);return{top:w.top-x.top+p.top,bottom:x.bottom-w.bottom+p.bottom,left:w.left-x.left+p.left,right:x.right-w.right+p.right}}const f=Math.min,u=Math.max;function d(t,e,n){return u(t,f(e,n))}const m={left:"right",right:"left",bottom:"top",top:"bottom"};function y(t){return t.replace(/left|right|bottom|top/g,(t=>m[t]))}function p(t,i,r){void 0===r&&(r=!1);const l=n(t),s=e(t),c=o(s);let a="x"===s?l===(r?"end":"start")?"right":"left":"start"===l?"bottom":"top";return i.reference[c]>i.floating[c]&&(a=y(a)),{main:a,cross:y(a)}}const g={start:"end",end:"start"};function h(t){return t.replace(/start|end/g,(t=>g[t]))}function x(t){const e=y(t);return[h(t),e,h(e)]}const w=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:g=!0,...w}=e,v=t(i),b=[s,...h||(v!==s&&g?x(s):[y(s)])],R=await a(n,w),L=[];let T=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&L.push(R[v]),d){const{main:t,cross:e}=p(i,l,await(null==c.isRTL?void 0:c.isRTL(f.floating)));L.push(R[t],R[e])}if(T=[...T,{placement:i,overflows:L}],!L.every((t=>t<=0))){var D,W;const t=(null!=(D=null==(W=r.flip)?void 0:W.index)?D:0)+1,e=b[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let n="bottom";switch(m){case"bestFit":{var A;const t=null==(A=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:A[0].placement;t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}};async function v(o,i){const{placement:r,platform:l,elements:s}=o,c=await(null==l.isRTL?void 0:l.isRTL(s.floating)),a=t(r),f=n(r),u="x"===e(r),d=["left","top"].includes(a)?-1:1,h=c&&u?-1:1,m="function"==typeof i?i(o):i;let{mainAxis:g,crossAxis:p,alignmentAxis:y}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return f&&"number"==typeof y&&(p="end"===f?-1*y:y),u?{x:p*h,y:g*d}:{x:g*d,y:p*h}}const b=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await v(e,t);return{x:n+i.x,y:o+i.y,data:i}}}};function A(t){return"x"===t?"y":"x"}const R=function(n){return void 0===n&&(n={}),{name:"shift",options:n,async fn(o){const{x:i,y:r,placement:l}=o,{mainAxis:s=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=n,h={x:i,y:r},m=await a(o,u),g=e(t(l)),p=A(g);let y=h[g],w=h[p];if(s){const t="y"===g?"bottom":"right";y=d(y+m["y"===g?"top":"left"],y,y-m[t])}if(c){const t="y"===p?"bottom":"right";w=d(w+m["y"===p?"top":"left"],w,w-m[t])}const x=f.fn({...o,[g]:y,[p]:w});return{...x,data:{x:x.x-i,y:x.y-r}}}}},k=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(o){const{placement:i,rects:r,platform:l,elements:s}=o,{apply:c,...f}=e,d=await a(o,f),h=t(i),m=n(i);let g,p;"top"===h||"bottom"===h?(g=h,p=m===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(p=h,g="end"===m?"top":"bottom");const y=u(d.left,0),w=u(d.right,0),x=u(d.top,0),v=u(d.bottom,0),b={availableHeight:r.floating.height-(["left","right"].includes(i)?2*(0!==x||0!==v?x+v:u(d.top,d.bottom)):d[g]),availableWidth:r.floating.width-(["top","bottom"].includes(i)?2*(0!==y||0!==w?y+w:u(d.left,d.right)):d[p])},R=await l.getDimensions(s.floating);null==c||c({...o,...b});const L=await l.getDimensions(s.floating);return R.width!==L.width||R.height!==L.height?{reset:{rects:!0}}:{}}}};function P(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function S(t){if(null==t)return window;if(!P(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function z(t){return S(t).getComputedStyle(t)}function C(t){return P(t)?"":t?(t.nodeName||"").toLowerCase():""}function T(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function D(t){return t instanceof S(t).HTMLElement}function F(t){return t instanceof S(t).Element}function L(t){return t instanceof S(t).Node}function M(t){return"undefined"!=typeof ShadowRoot&&(t instanceof S(t).ShadowRoot||t instanceof ShadowRoot)}function B(t){const{overflow:e,overflowX:n,overflowY:o}=z(t);return/auto|scroll|overlay|hidden/.test(e+o+n)}function E(t){return["table","td","th"].includes(C(t))}function O(t){const e=/firefox/i.test(T()),n=z(t);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function j(){return!/^((?!chrome|android).)*safari/i.test(T())}const q=Math.min,H=Math.max,V=Math.round;function W(t,e,n){var o,i,r,l;void 0===e&&(e=!1),void 0===n&&(n=!1);const s=t.getBoundingClientRect();let c=1,a=1;e&&D(t)&&(c=t.offsetWidth>0&&V(s.width)/t.offsetWidth||1,a=t.offsetHeight>0&&V(s.height)/t.offsetHeight||1);const f=F(t)?S(t):window,u=!j()&&n,d=(s.left+(u&&null!=(o=null==(i=f.visualViewport)?void 0:i.offsetLeft)?o:0))/c,h=(s.top+(u&&null!=(r=null==(l=f.visualViewport)?void 0:l.offsetTop)?r:0))/a,m=s.width/c,g=s.height/a;return{width:m,height:g,top:h,right:d+m,bottom:h+g,left:d,x:d,y:h}}function X(t){return((L(t)?t.ownerDocument:t.document)||window.document).documentElement}function Y(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function G(t){return W(X(t)).left+Y(t).scrollLeft}function I(t){const e=W(t);return V(e.width)!==t.offsetWidth||V(e.height)!==t.offsetHeight}function J(t,e,n){const o=D(e),i=X(e),r=W(t,o&&I(e),"fixed"===n);let l={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==C(e)||B(i))&&(l=Y(e)),D(e)){const t=W(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&(s.x=G(i));return{x:r.left+l.scrollLeft-s.x,y:r.top+l.scrollTop-s.y,width:r.width,height:r.height}}function K(t){return"html"===C(t)?t:t.assignedSlot||t.parentNode||(M(t)?t.host:null)||X(t)}function N(t){return D(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function Q(t){let e=K(t);for(M(e)&&(e=e.host);D(e)&&!["html","body"].includes(C(e));){if(O(e))return e;e=e.parentNode}return null}function U(t){const e=S(t);let n=N(t);for(;n&&E(n)&&"static"===getComputedStyle(n).position;)n=N(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===getComputedStyle(n).position&&!O(n))?e:n||Q(t)||e}function Z(t){if(D(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=W(t);return{width:e.width,height:e.height}}function $(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=D(n),r=X(n);if(n===r)return e;let l={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==C(n)||B(r))&&(l=Y(n)),D(n))){const t=W(n,!0);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{...e,x:e.x-l.scrollLeft+s.x,y:e.y-l.scrollTop+s.y}}function _(t,e){const n=S(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,c=0;if(i){r=i.width,l=i.height;const t=j();(t||!t&&"fixed"===e)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:r,height:l,x:s,y:c}}function tt(t){var e;const n=X(t),o=Y(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=H(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=H(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-o.scrollLeft+G(t);const c=-o.scrollTop;return"rtl"===z(i||n).direction&&(s+=H(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:l,x:s,y:c}}function nt(t){const e=K(t);return["html","body","#document"].includes(C(e))?t.ownerDocument.body:D(e)&&B(e)?e:nt(e)}function et(t,e){var n;void 0===e&&(e=[]);const o=nt(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=S(o),l=i?[r].concat(r.visualViewport||[],B(o)?o:[]):o,s=e.concat(l);return i?s:s.concat(et(l))}function ot(t,e){const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&M(n)){let n=e;do{if(n&&t===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function rt(t,e){const n=W(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function it(t,e,n){return"viewport"===e?l(_(t,n)):F(e)?rt(e,n):l(tt(X(t)))}function st(t){const e=et(t),n=["absolute","fixed"].includes(z(t).position)&&D(t)?U(t):t;return F(n)?e.filter((t=>F(t)&&ot(t,n)&&"body"!==C(t))):[]}function ct(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?st(e):[].concat(n),o],l=r[0],s=r.reduce(((t,n)=>{const o=it(e,n,i);return t.top=H(o.top,t.top),t.right=q(o.right,t.right),t.bottom=q(o.bottom,t.bottom),t.left=H(o.left,t.left),t}),it(e,l,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}const lt={getClippingRect:ct,convertOffsetParentRelativeRectToViewportRelativeRect:$,isElement:F,getDimensions:Z,getOffsetParent:U,getDocumentElement:X,getElementRects:t=>{let{reference:e,floating:n,strategy:o}=t;return{reference:J(e,U(n),o),floating:{...Z(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===z(t).direction};function at(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:s=!1}=o,c=i&&!s,a=r&&!s,f=c||a?[...F(t)?et(t):[],...et(e)]:[];f.forEach((t=>{c&&t.addEventListener("scroll",n,{passive:!0}),a&&t.addEventListener("resize",n)}));let u,d=null;if(l){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),F(t)&&!s&&d.observe(t),d.observe(e)}let h=s?W(t):null;return s&&function e(){const o=W(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n(),h=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach((t=>{c&&t.removeEventListener("scroll",n),a&&t.removeEventListener("resize",n)})),null==(t=d)||t.disconnect(),d=null,s&&cancelAnimationFrame(u)}}const ft=(t,e,n)=>i(t,e,{platform:lt,...n});export{at as a,k as b,ft as c,w as f,b as o,R as s};
Save
Back