Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

systema-attach

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

systema-attach - npm Package Compare versions

Comparing version 0.1.4 to 1.0.0

2

example.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.attach=t(require("react")):e.attach=t(e.react)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./example/index.js")}({"../../node_modules/popper.js/dist/esm/popper.js":function(e,t,n){"use strict";function o(e){var t=!1,n=0,o=document.createElement("span");return new MutationObserver(function(){e(),t=!1}).observe(o,{attributes:!0}),function(){t||(t=!0,o.setAttribute("x-index",n),n+=1)}}function r(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},fe))}}function i(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function s(e){if(!e||-1!==["HTML","BODY","#document"].indexOf(e.nodeName))return window.document.body;var t=a(e),n=t.overflow,o=t.overflowX;return/(auto|scroll)/.test(n+t.overflowY+o)?e:s(l(e))}function c(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===a(t,"position")?c(t):t:window.document.documentElement}function f(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||c(e.firstElementChild)===e)}function p(e){return null!==e.parentNode?p(e.parentNode):e}function u(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return window.document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,i=document.createRange();i.setStart(o,0),i.setEnd(r,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||o.contains(r))return f(a)?a:c(a);var l=p(e);return l.host?u(l.host,t):u(e,p(t).host)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",o=e.nodeName;if("BODY"===o||"HTML"===o){var r=window.document.documentElement;return(window.document.scrollingElement||r)[n]}return e[n]}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=d(t,"top"),r=d(t,"left"),i=n?-1:1;return e.top+=o*i,e.bottom+=o*i,e.left+=r*i,e.right+=r*i,e}function m(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return+e["border"+n+"Width"].split("px")[0]+ +e["border"+o+"Width"].split("px")[0]}function b(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],me()?n["offset"+e]+o["margin"+("Height"===e?"Top":"Left")]+o["margin"+("Height"===e?"Bottom":"Right")]:0)}function v(){var e=window.document.body,t=window.document.documentElement,n=me()&&window.getComputedStyle(t);return{height:b("Height",e,t,n),width:b("Width",e,t,n)}}function w(e){return ge({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var t={};if(me())try{t=e.getBoundingClientRect();var n=d(e,"top"),o=d(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}catch(e){}else t=e.getBoundingClientRect();var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?v():{},l=i.width||e.clientWidth||r.right-r.left,s=i.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-l,f=e.offsetHeight-s;if(c||f){var p=a(e);c-=m(p,"x"),f-=m(p,"y"),r.width-=c,r.height-=f}return w(r)}function y(e,t){var n=me(),o="HTML"===t.nodeName,r=g(e),i=g(t),l=s(e),c=a(t),f=+c.borderTopWidth.split("px")[0],p=+c.borderLeftWidth.split("px")[0],u=w({top:r.top-i.top-f,left:r.left-i.left-p,width:r.width,height:r.height});if(u.marginTop=0,u.marginLeft=0,!n&&o){var d=+c.marginTop.split("px")[0],m=+c.marginLeft.split("px")[0];u.top-=f-d,u.bottom-=f-d,u.left-=p-m,u.right-=p-m,u.marginTop=d,u.marginLeft=m}return(n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(u=h(u,t)),u}function E(e){var t=window.document.documentElement,n=y(e,t),o=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),i=d(t),a=d(t,"left");return w({top:i-n.top+n.marginTop,left:a-n.left+n.marginLeft,width:o,height:r})}function x(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===a(e,"position")||x(l(e)))}function O(e,t,n,o){var r={top:0,left:0},i=u(e,t);if("viewport"===o)r=E(i);else{var a=void 0;"scrollParent"===o?(a=s(l(e)),"BODY"===a.nodeName&&(a=window.document.documentElement)):a="window"===o?window.document.documentElement:o;var c=y(a,i);if("HTML"!==a.nodeName||x(i))r=c;else{var f=v(),p=f.height,d=f.width;r.top+=c.top-c.marginTop,r.bottom=p+c.top,r.left+=c.left-c.marginLeft,r.right=d+c.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function C(e){return e.width*e.height}function S(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=O(n,o,i,r),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(l).map(function(e){return ge({key:e},l[e],{area:C(l[e])})}).sort(function(e,t){return t.area-e.area}),c=s.filter(function(e){var t=e.width,o=e.height;return t>=n.clientWidth&&o>=n.clientHeight}),f=c.length>0?c[0].key:s[0].key,p=e.split("-")[1];return f+(p?"-"+p:"")}function T(e,t,n){return y(n,u(t,n))}function M(e){var t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function j(e,t,n){n=n.split("-")[0];var o=M(e),r={width:o.width,height:o.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",s=i?"height":"width",c=i?"width":"height";return r[a]=t[a]+t[s]/2-o[s]/2,r[l]=n===l?t[l]-o[c]:t[L(l)],r}function A(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function k(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=A(e,function(e){return e[t]===n});return e.indexOf(o)}function P(e,t,n){return(void 0===n?e:e.slice(0,k(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&i(n)&&(t.offsets.popper=w(t.offsets.popper),t.offsets.reference=w(t.offsets.reference),t=n(t,e))}),t}function N(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=T(this.state,this.popper,this.reference),e.placement=S(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=j(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position="absolute",e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function _(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function R(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<t.length-1;o++){var r=t[o],i=r?""+r+n:e;if(void 0!==window.document.body.style[i])return i}return null}function W(){return this.state.isDestroyed=!0,_(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[R("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function D(e,t,n,o){var r="BODY"===e.nodeName,i=r?window:e;i.addEventListener(t,n,{passive:!0}),r||D(s(i.parentNode),t,n,o),o.push(i)}function H(e,t,n,o){n.updateBound=o,window.addEventListener("resize",n.updateBound,{passive:!0});var r=s(e);return D(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function B(){this.state.eventsEnabled||(this.state=H(this.reference,this.options,this.state,this.scheduleUpdate))}function I(e,t){return window.removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function F(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=I(this.reference,this.state))}function U(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function q(e,t){Object.keys(t).forEach(function(n){var o="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&U(t[n])&&(o="px"),e.style[n]=t[n]+o})}function Y(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function z(e){return q(e.instance.popper,e.styles),Y(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&q(e.arrowElement,e.arrowStyles),e}function G(e,t,n,o,r){var i=T(r,t,e),a=S(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),q(t,{position:"absolute"}),n}function K(e,t){var n=t.x,o=t.y,r=e.offsets.popper,i=A(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,l=c(e.instance.popper),s=g(l),f={position:r.position},p={left:Math.floor(r.left),top:Math.floor(r.top),bottom:Math.floor(r.bottom),right:Math.floor(r.right)},u="bottom"===n?"top":"bottom",d="right"===o?"left":"right",h=R("transform"),m=void 0,b=void 0;if(b="bottom"===u?-s.height+p.bottom:p.top,m="right"===d?-s.width+p.right:p.left,a&&h)f[h]="translate3d("+m+"px, "+b+"px, 0)",f[u]=0,f[d]=0,f.willChange="transform";else{var v="bottom"===u?-1:1,w="right"===d?-1:1;f[u]=b*v,f[d]=m*w,f.willChange=u+", "+d}var y={"x-placement":e.placement};return e.attributes=ge({},y,e.attributes),e.styles=ge({},f,e.styles),e.arrowStyles=ge({},e.offsets.arrow,e.arrowStyles),e}function V(e,t,n){var o=A(e,function(e){return e.name===t}),r=!!o&&e.some(function(e){return e.name===n&&e.enabled&&e.order<o.order});if(!r){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return r}function X(e,t){if(!V(e.instance.modifiers,"arrow","keepTogether"))return e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],r=e.offsets,i=r.popper,l=r.reference,s=-1!==["left","right"].indexOf(o),c=s?"height":"width",f=s?"Top":"Left",p=f.toLowerCase(),u=s?"left":"top",d=s?"bottom":"right",h=M(n)[c];l[d]-h<i[p]&&(e.offsets.popper[p]-=i[p]-(l[d]-h)),l[p]+h>i[d]&&(e.offsets.popper[p]+=l[p]+h-i[d]);var m=l[p]+l[c]/2-h/2,b=a(e.instance.popper,"margin"+f).replace("px",""),v=m-w(e.offsets.popper)[p]-b;return v=Math.max(Math.min(i[c]-h,v),0),e.arrowElement=n,e.offsets.arrow={},e.offsets.arrow[p]=Math.round(v),e.offsets.arrow[u]="",e}function J(e){return"end"===e?"start":"start"===e?"end":e}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ee.indexOf(e),o=Ee.slice(n+1).concat(Ee.slice(0,n));return t?o.reverse():o}function Z(e,t){if(_(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=O(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),o=e.placement.split("-")[0],r=L(o),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case xe.FLIP:a=[o,r];break;case xe.CLOCKWISE:a=Q(o);break;case xe.COUNTERCLOCKWISE:a=Q(o,!0);break;default:a=t.behavior}return a.forEach(function(l,s){if(o!==l||a.length===s+1)return e;o=e.placement.split("-")[0],r=L(o);var c=e.offsets.popper,f=e.offsets.reference,p=Math.floor,u="left"===o&&p(c.right)>p(f.left)||"right"===o&&p(c.left)<p(f.right)||"top"===o&&p(c.bottom)>p(f.top)||"bottom"===o&&p(c.top)<p(f.bottom),d=p(c.left)<p(n.left),h=p(c.right)>p(n.right),m=p(c.top)<p(n.top),b=p(c.bottom)>p(n.bottom),v="left"===o&&d||"right"===o&&h||"top"===o&&m||"bottom"===o&&b,w=-1!==["top","bottom"].indexOf(o),g=!!t.flipVariations&&(w&&"start"===i&&d||w&&"end"===i&&h||!w&&"start"===i&&m||!w&&"end"===i&&b);(u||v||g)&&(e.flipped=!0,(u||v)&&(o=a[s+1]),g&&(i=J(i)),e.placement=o+(i?"-"+i:""),e.offsets.popper=ge({},e.offsets.popper,j(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,"flip"))}),e}function $(e){var t=e.offsets,n=t.popper,o=t.reference,r=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(r),l=a?"right":"bottom",s=a?"left":"top",c=a?"width":"height";return n[l]<i(o[s])&&(e.offsets.popper[s]=i(o[s])-n[c]),n[s]>i(o[l])&&(e.offsets.popper[s]=i(o[l])),e}function ee(e,t,n,o){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+r[1],a=r[2];if(!i)return e;if(0===a.indexOf("%")){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=o}return w(l)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}function te(e,t,n,o){var r=[0,0],i=-1!==["right","left"].indexOf(o),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),l=a.indexOf(A(a,function(e){return-1!==e.search(/,|\s/)}));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,c=-1!==l?[a.slice(0,l).concat([a[l].split(s)[0]]),[a[l].split(s)[1]].concat(a.slice(l+1))]:[a];return c=c.map(function(e,o){var r=(1===o?!i:i)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return ee(e,r,t,n)})}),c.forEach(function(e,t){e.forEach(function(n,o){U(n)&&(r[t]+=n*("-"===e[o-1]?-1:1))})}),r}function ne(e,t){var n=t.offset,o=e.placement,r=e.offsets,i=r.popper,a=r.reference,l=o.split("-")[0],s=void 0;return s=U(+n)?[+n,0]:te(n,i,a,l),"left"===l?(i.top+=s[0],i.left-=s[1]):"right"===l?(i.top+=s[0],i.left+=s[1]):"top"===l?(i.left+=s[0],i.top-=s[1]):"bottom"===l&&(i.left+=s[0],i.top+=s[1]),e.popper=i,e}function oe(e,t){var n=t.boundariesElement||c(e.instance.popper);e.instance.reference===n&&(n=c(n));var o=O(e.instance.popper,e.instance.reference,t.padding,n);t.boundaries=o;var r=t.priority,i=e.offsets.popper,a={primary:function(e){var n=i[e];return i[e]<o[e]&&!t.escapeWithReference&&(n=Math.max(i[e],o[e])),we({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=i[n];return i[e]>o[e]&&!t.escapeWithReference&&(r=Math.min(i[n],o[e]-("right"===e?i.width:i.height))),we({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";i=ge({},i,a[t](e))}),e.offsets.popper=i,e}function re(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var r=e.offsets,i=r.reference,a=r.popper,l=-1!==["bottom","top"].indexOf(n),s=l?"left":"top",c=l?"width":"height",f={start:we({},s,i[s]),end:we({},s,i[s]+i[c]-a[c])};e.offsets.popper=ge({},a,f[o])}return e}function ie(e){if(!V(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=A(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function ae(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,r=o.popper,i=o.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=i[n]-(l?r[a?"width":"height"]:0),e.placement=L(t),e.offsets.popper=w(r),e}Object.defineProperty(t,"__esModule",{value:!0});for(var le=["native code","[object MutationObserverConstructor]"],se="undefined"!=typeof window,ce=["Edge","Trident","Firefox"],fe=0,pe=0;pe<ce.length;pe+=1)if(se&&navigator.userAgent.indexOf(ce[pe])>=0){fe=1;break}var ue=se&&function(e){return le.some(function(t){return(e||"").toString().indexOf(t)>-1})}(window.MutationObserver),de=ue?o:r,he=void 0,me=function(){return void 0===he&&(he=-1!==navigator.appVersion.indexOf("MSIE 10")),he},be=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ve=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),we=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ye=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Ee=ye.slice(3),xe={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},Oe={shift:{order:100,enabled:!0,fn:re},offset:{order:200,enabled:!0,fn:ne,offset:0},preventOverflow:{order:300,enabled:!0,fn:oe,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:$},arrow:{order:500,enabled:!0,fn:X,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:Z,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:ae},hide:{order:800,enabled:!0,fn:ie},computeStyle:{order:850,enabled:!0,fn:K,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:z,onLoad:G,gpuAcceleration:void 0}},Ce={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Oe},Se=function(){function e(t,n){var o=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};be(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=de(this.update.bind(this)),this.options=ge({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ge({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){o.options.modifiers[t]=ge({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return ge({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&i(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return ve(e,[{key:"update",value:function(){return N.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return B.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),e}();Se.Utils=("undefined"!=typeof window?window:global).PopperUtils,Se.placements=ye,Se.Defaults=Ce,t.default=Se},"./example/index.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n("react"),c=o(s),f=n("./src/index.js"),p=o(f),u=n("./example/styles.css"),d=o(u),h=function(e){function t(){var e,n,o,a;r(this,t);for(var l=arguments.length,s=Array(l),c=0;c<l;c++)s[c]=arguments[c];return n=o=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.state={component:void 0},o.setRef=function(e){o.setState({component:e})},a=n,i(o,a)}return a(t,e),l(t,[{key:"render",value:function(){return c.default.createElement("div",{className:d.default.example},c.default.createElement("div",{"data-snapshot":this.props.placement},c.default.createElement("p",null,"This example showcases a simple sticky. It should be positioned:"," ",this.props.placement," (unless there's not enough space)."),c.default.createElement("div",{className:d.default.anchorContainer},c.default.createElement("strong",{ref:this.setRef},"attachment point")),c.default.createElement(p.default,{to:this.state.component,placement:this.props.placement},c.default.createElement(m,null,"position: ",this.props.placement))))}}]),t}(s.Component),m=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),l(t,[{key:"render",value:function(){return c.default.createElement("div",{ref:this.props.setContentRef,style:this.props.contentStyles,className:d.default.sticky},this.props.children)}}]),t}(s.Component),b=function(){return c.default.createElement("div",{className:d.default.page},c.default.createElement("h1",null,"Attach"),c.default.createElement("p",null,"Used to attach it's children the position of a certain element. This is a low-level component that should not be used directly: higher level components like the tooltip & dropdown have styling and that will match the systema look and feel much better."),c.default.createElement("h2",null,"Attach component"),c.default.createElement("p",null,"The package exports a single Component which on its own does not render any html, nor has styles. It requires 3 props (including children):"),c.default.createElement("table",{width:"100%"},c.default.createElement("thead",null,c.default.createElement("tr",null,c.default.createElement("th",{width:"20%"},"Prop"),c.default.createElement("th",null,"Description"))),c.default.createElement("tbody",null,c.default.createElement("tr",null,c.default.createElement("td",null,c.default.createElement("code",null,"to")),c.default.createElement("td",null,"This is a reference to a `HTMLElement`. It's what the component tries to display itself next to")),c.default.createElement("tr",null,c.default.createElement("td",null,c.default.createElement("code",null,"placement")),c.default.createElement("td",null,"Used to determine the prefered location for placment. Supported values are:",c.default.createElement("code",null,"auto-start"),", ",c.default.createElement("code",null,"auto"),", ",c.default.createElement("code",null,"auto-end"),","," ",c.default.createElement("code",null,"top-start"),", ",c.default.createElement("code",null,"top"),", ",c.default.createElement("code",null,"top-end"),","," ",c.default.createElement("code",null,"right-start"),", ",c.default.createElement("code",null,"right"),", ",c.default.createElement("code",null,"right-end"),","," ",c.default.createElement("code",null,"bottom-end"),", ",c.default.createElement("code",null,"bottom"),","," ",c.default.createElement("code",null,"bottom-start")," ,",c.default.createElement("code",null,"left-end"),", ",c.default.createElement("code",null,"left")," and ",c.default.createElement("code",null,"left-start"))),c.default.createElement("tr",null,c.default.createElement("td",null,c.default.createElement("code",null,"children")),c.default.createElement("td",null,"Can only be a single component. Which should at least respond to the following props:",c.default.createElement("pre",null,c.default.createElement("code",null," // Flowtype definitions of the supported/required props\n{\n arrowStyles: CSSStyleDeclaration,\n contentStyles: CSSStyleDeclaration,\n placement: Placement,\n setArrowRef?: HTMLElement => void,\n setContentRef: HTMLElement => void,\n}")),"The ",c.default.createElement("code",null,"Attach")," component adds these props to the children component. We'll go into each prop and what it exactly means below.")))),c.default.createElement("h3",null,"Children"),c.default.createElement("p",null,"The props that the child needs to support can be divided into two parts:"),c.default.createElement("ol",null,c.default.createElement("li",null,"reference related (",c.default.createElement("code",null,"setArrowRef")," and"," ",c.default.createElement("code",null,"setContentRef"),"). There are functions to be used as a"," ",c.default.createElement("code",null,"ref=","{...}")," on DOM elements. ",c.default.createElement("br",null),"Where ",c.default.createElement("code",null,"setContentRef")," should be set on the main container for the tooltip. The other prop (",c.default.createElement("code",null,"setArrowRef"),") can be set on an html element that will be used as the arrow. Arrows are optional."),c.default.createElement("li",null,"Positioning related props: ",c.default.createElement("code",null,"placement")," (contains information where the tooltip is actually rendered). The other two"," ",c.default.createElement("code",null,"arrowStyles")," and ",c.default.createElement("code",null,"contentStyles")," are styles to be applied to the content and arrow elements.")),c.default.createElement("h3",null,"Example implementation"),c.default.createElement("p",null,"Next is an example implementation (without an arrow). It's split up into two parts/classes. The ",c.default.createElement("code",null,"Example")," class which renders an anchor as well as the Attach component (with the"," ",c.default.createElement("code",null,"ExampleAttachment")," class). First up: the"," ",c.default.createElement("code",null,"ExampleAttachment")," (which supports the required children props)."),c.default.createElement("pre",null,c.default.createElement("code",null,"\n// Simple class that renders a div with a ref so that the attach component can\n// inspect it (find out sizes etc), sets the style for the 'content' and has\n// some additional styling\nclass ExampleAttachment extends Component {\n render() {\n return (\n <div\n ref={this.props.setContentRef}\n style={this.props.contentStyles}\n className={styles.sticky}\n >\n {this.props.children}\n </div>\n );\n }\n}\n")),c.default.createElement("pre",null,c.default.createElement("code",null,"\n// Component that can be used\nclass Example extends Component {\n state = {\n component: undefined,\n };\n\n defaultProps = {\n placement: 'bottom',\n };\n\n // We're using a ref function that updates the state\n // the component stored in the state is passed as a\n // prop to the Attach component\n setRef = (ref: HTMLElement | void) => {\n this.setState({ component: ref });\n }\n\n render() {\n return (\n <div className={styles.example}>\n <p>\n This example showcases a simple sticky. It should be positioned:{' '}\n {this.props.placement} (unless there's not enough space).\n </p>\n <div className={styles.anchorContainer}>\n <strong ref={this.setRef}>attachment point</strong>\n </div>\n\n <Attach to={this.state.component} placement={this.props.placement}>\n <ExampleAttachment>\n position: {this.props.placement}\n </ExampleAttachment>\n </Attach>\n </div>\n );\n }\n}\n\n")),c.default.createElement("h3",null,"Example in action"),c.default.createElement("p",null,"The last part shows the ",c.default.createElement("code",null,"<Attach>")," in action, displaying content top/right/bottom/left of a specific dom element. If elements are on oposite side of the element they are attached to, this is probably because there's not enough space to display the attached content on the requested side (best visible with content positioned above/below another element while scrolling the page)"),c.default.createElement(h,{placement:"top"}),c.default.createElement(h,{placement:"right"}),c.default.createElement(h,{placement:"bottom"}),c.default.createElement(h,{placement:"left"}))};b.displayName="Attach-example",t.default=b,e.exports=t.default},"./example/styles.css":function(e,t){e.exports={example:"gdLWynsg",anchorContainer:"tGsyP1E3",sticky:"_13mA98Y7"}},"./src/index.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n("react"),c=o(s),f=n("../../node_modules/popper.js/dist/esm/popper.js"),p=o(f),u=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.updateStateModifier={enabled:!0,order:900,fn:function(e){return this.setState({styles:e.styles,arrowStyles:e.arrowStyles,placement:e.placement}),e}},n.setContentRef=function(e){n.content=e},n.setArrowRef=function(e){n.arrow=e},n.state={styles:{},arrowStyles:{},placement:"bottom"},n}return a(t,e),l(t,[{key:"componentWillMount",value:function(){this.updateStateModifier.fn=this.updateStateModifier.fn.bind(this)}},{key:"componentDidMount",value:function(){this.props.to&&this.createPopper(this.props.to)}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.to,n=e.to;n&&n!==t&&(this.popper&&this.popper.destroy(),this.createPopper(n))}},{key:"componentWillUnmount",value:function(){this.popper&&this.popper.destroy()}},{key:"createPopper",value:function(e){var t={applyStyle:{enabled:!1},updateState:this.updateStateModifier,preventOverflow:{boundariesElement:"window"}};this.arrow&&(t.arrow={element:this.arrow}),this.popper=new p.default(e,this.content,{placement:this.props.placement,modifiers:t}),this.popper.scheduleUpdate()}},{key:"render",value:function(){var e={arrowStyles:this.state.arrowStyles,contentStyles:this.state.styles,setArrowRef:this.setArrowRef,setContentRef:this.setContentRef,placement:this.state.placement};return c.default.cloneElement(this.props.children,e)}}]),t}(s.Component);u.displayName="Attach",u.defaultProps={placement:"bottom"},t.default=u,e.exports=t.default},react:function(e,t){e.exports=require("react")}})});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.attach=t(require("react")):e.attach=t(e.react)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./example/index.js")}({"../../node_modules/popper.js/dist/esm/popper.js":function(e,t,n){"use strict";function o(e){var t=!1,n=0,o=document.createElement("span");return new MutationObserver(function(){e(),t=!1}).observe(o,{attributes:!0}),function(){t||(t=!0,o.setAttribute("x-index",n),n+=1)}}function r(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},fe))}}function i(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function s(e){if(!e||-1!==["HTML","BODY","#document"].indexOf(e.nodeName))return window.document.body;var t=a(e),n=t.overflow,o=t.overflowX;return/(auto|scroll)/.test(n+t.overflowY+o)?e:s(l(e))}function c(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===a(t,"position")?c(t):t:window.document.documentElement}function f(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||c(e.firstElementChild)===e)}function p(e){return null!==e.parentNode?p(e.parentNode):e}function u(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return window.document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,i=document.createRange();i.setStart(o,0),i.setEnd(r,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||o.contains(r))return f(a)?a:c(a);var l=p(e);return l.host?u(l.host,t):u(e,p(t).host)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",o=e.nodeName;if("BODY"===o||"HTML"===o){var r=window.document.documentElement;return(window.document.scrollingElement||r)[n]}return e[n]}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=d(t,"top"),r=d(t,"left"),i=n?-1:1;return e.top+=o*i,e.bottom+=o*i,e.left+=r*i,e.right+=r*i,e}function m(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return+e["border"+n+"Width"].split("px")[0]+ +e["border"+o+"Width"].split("px")[0]}function b(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],me()?n["offset"+e]+o["margin"+("Height"===e?"Top":"Left")]+o["margin"+("Height"===e?"Bottom":"Right")]:0)}function v(){var e=window.document.body,t=window.document.documentElement,n=me()&&window.getComputedStyle(t);return{height:b("Height",e,t,n),width:b("Width",e,t,n)}}function w(e){return ge({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var t={};if(me())try{t=e.getBoundingClientRect();var n=d(e,"top"),o=d(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}catch(e){}else t=e.getBoundingClientRect();var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?v():{},l=i.width||e.clientWidth||r.right-r.left,s=i.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-l,f=e.offsetHeight-s;if(c||f){var p=a(e);c-=m(p,"x"),f-=m(p,"y"),r.width-=c,r.height-=f}return w(r)}function y(e,t){var n=me(),o="HTML"===t.nodeName,r=g(e),i=g(t),l=s(e),c=a(t),f=+c.borderTopWidth.split("px")[0],p=+c.borderLeftWidth.split("px")[0],u=w({top:r.top-i.top-f,left:r.left-i.left-p,width:r.width,height:r.height});if(u.marginTop=0,u.marginLeft=0,!n&&o){var d=+c.marginTop.split("px")[0],m=+c.marginLeft.split("px")[0];u.top-=f-d,u.bottom-=f-d,u.left-=p-m,u.right-=p-m,u.marginTop=d,u.marginLeft=m}return(n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(u=h(u,t)),u}function E(e){var t=window.document.documentElement,n=y(e,t),o=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),i=d(t),a=d(t,"left");return w({top:i-n.top+n.marginTop,left:a-n.left+n.marginLeft,width:o,height:r})}function x(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===a(e,"position")||x(l(e)))}function O(e,t,n,o){var r={top:0,left:0},i=u(e,t);if("viewport"===o)r=E(i);else{var a=void 0;"scrollParent"===o?(a=s(l(e)),"BODY"===a.nodeName&&(a=window.document.documentElement)):a="window"===o?window.document.documentElement:o;var c=y(a,i);if("HTML"!==a.nodeName||x(i))r=c;else{var f=v(),p=f.height,d=f.width;r.top+=c.top-c.marginTop,r.bottom=p+c.top,r.left+=c.left-c.marginLeft,r.right=d+c.left}}return r.left+=n,r.top+=n,r.right-=n,r.bottom-=n,r}function T(e){return e.width*e.height}function C(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=O(n,o,i,r),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(l).map(function(e){return ge({key:e},l[e],{area:T(l[e])})}).sort(function(e,t){return t.area-e.area}),c=s.filter(function(e){var t=e.width,o=e.height;return t>=n.clientWidth&&o>=n.clientHeight}),f=c.length>0?c[0].key:s[0].key,p=e.split("-")[1];return f+(p?"-"+p:"")}function j(e,t,n){return y(n,u(t,n))}function S(e){var t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function M(e,t,n){n=n.split("-")[0];var o=S(e),r={width:o.width,height:o.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",s=i?"height":"width",c=i?"width":"height";return r[a]=t[a]+t[s]/2-o[s]/2,r[l]=n===l?t[l]-o[c]:t[L(l)],r}function A(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function P(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=A(e,function(e){return e[t]===n});return e.indexOf(o)}function N(e,t,n){return(void 0===n?e:e.slice(0,P(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&i(n)&&(t.offsets.popper=w(t.offsets.popper),t.offsets.reference=w(t.offsets.reference),t=n(t,e))}),t}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=j(this.state,this.popper,this.reference),e.placement=C(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=M(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position="absolute",e=N(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function _(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function R(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<t.length-1;o++){var r=t[o],i=r?""+r+n:e;if(void 0!==window.document.body.style[i])return i}return null}function W(){return this.state.isDestroyed=!0,_(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[R("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function D(e,t,n,o){var r="BODY"===e.nodeName,i=r?window:e;i.addEventListener(t,n,{passive:!0}),r||D(s(i.parentNode),t,n,o),o.push(i)}function H(e,t,n,o){n.updateBound=o,window.addEventListener("resize",n.updateBound,{passive:!0});var r=s(e);return D(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function B(){this.state.eventsEnabled||(this.state=H(this.reference,this.options,this.state,this.scheduleUpdate))}function I(e,t){return window.removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=I(this.reference,this.state))}function F(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function q(e,t){Object.keys(t).forEach(function(n){var o="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&F(t[n])&&(o="px"),e.style[n]=t[n]+o})}function Y(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function z(e){return q(e.instance.popper,e.styles),Y(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&q(e.arrowElement,e.arrowStyles),e}function G(e,t,n,o,r){var i=j(r,t,e),a=C(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),q(t,{position:"absolute"}),n}function K(e,t){var n=t.x,o=t.y,r=e.offsets.popper,i=A(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,l=c(e.instance.popper),s=g(l),f={position:r.position},p={left:Math.floor(r.left),top:Math.floor(r.top),bottom:Math.floor(r.bottom),right:Math.floor(r.right)},u="bottom"===n?"top":"bottom",d="right"===o?"left":"right",h=R("transform"),m=void 0,b=void 0;if(b="bottom"===u?-s.height+p.bottom:p.top,m="right"===d?-s.width+p.right:p.left,a&&h)f[h]="translate3d("+m+"px, "+b+"px, 0)",f[u]=0,f[d]=0,f.willChange="transform";else{var v="bottom"===u?-1:1,w="right"===d?-1:1;f[u]=b*v,f[d]=m*w,f.willChange=u+", "+d}var y={"x-placement":e.placement};return e.attributes=ge({},y,e.attributes),e.styles=ge({},f,e.styles),e.arrowStyles=ge({},e.offsets.arrow,e.arrowStyles),e}function V(e,t,n){var o=A(e,function(e){return e.name===t}),r=!!o&&e.some(function(e){return e.name===n&&e.enabled&&e.order<o.order});if(!r){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return r}function X(e,t){if(!V(e.instance.modifiers,"arrow","keepTogether"))return e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],r=e.offsets,i=r.popper,l=r.reference,s=-1!==["left","right"].indexOf(o),c=s?"height":"width",f=s?"Top":"Left",p=f.toLowerCase(),u=s?"left":"top",d=s?"bottom":"right",h=S(n)[c];l[d]-h<i[p]&&(e.offsets.popper[p]-=i[p]-(l[d]-h)),l[p]+h>i[d]&&(e.offsets.popper[p]+=l[p]+h-i[d]);var m=l[p]+l[c]/2-h/2,b=a(e.instance.popper,"margin"+f).replace("px",""),v=m-w(e.offsets.popper)[p]-b;return v=Math.max(Math.min(i[c]-h,v),0),e.arrowElement=n,e.offsets.arrow={},e.offsets.arrow[p]=Math.round(v),e.offsets.arrow[u]="",e}function J(e){return"end"===e?"start":"start"===e?"end":e}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ee.indexOf(e),o=Ee.slice(n+1).concat(Ee.slice(0,n));return t?o.reverse():o}function Z(e,t){if(_(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=O(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),o=e.placement.split("-")[0],r=L(o),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case xe.FLIP:a=[o,r];break;case xe.CLOCKWISE:a=Q(o);break;case xe.COUNTERCLOCKWISE:a=Q(o,!0);break;default:a=t.behavior}return a.forEach(function(l,s){if(o!==l||a.length===s+1)return e;o=e.placement.split("-")[0],r=L(o);var c=e.offsets.popper,f=e.offsets.reference,p=Math.floor,u="left"===o&&p(c.right)>p(f.left)||"right"===o&&p(c.left)<p(f.right)||"top"===o&&p(c.bottom)>p(f.top)||"bottom"===o&&p(c.top)<p(f.bottom),d=p(c.left)<p(n.left),h=p(c.right)>p(n.right),m=p(c.top)<p(n.top),b=p(c.bottom)>p(n.bottom),v="left"===o&&d||"right"===o&&h||"top"===o&&m||"bottom"===o&&b,w=-1!==["top","bottom"].indexOf(o),g=!!t.flipVariations&&(w&&"start"===i&&d||w&&"end"===i&&h||!w&&"start"===i&&m||!w&&"end"===i&&b);(u||v||g)&&(e.flipped=!0,(u||v)&&(o=a[s+1]),g&&(i=J(i)),e.placement=o+(i?"-"+i:""),e.offsets.popper=ge({},e.offsets.popper,M(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,"flip"))}),e}function $(e){var t=e.offsets,n=t.popper,o=t.reference,r=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(r),l=a?"right":"bottom",s=a?"left":"top",c=a?"width":"height";return n[l]<i(o[s])&&(e.offsets.popper[s]=i(o[s])-n[c]),n[s]>i(o[l])&&(e.offsets.popper[s]=i(o[l])),e}function ee(e,t,n,o){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+r[1],a=r[2];if(!i)return e;if(0===a.indexOf("%")){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=o}return w(l)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}function te(e,t,n,o){var r=[0,0],i=-1!==["right","left"].indexOf(o),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),l=a.indexOf(A(a,function(e){return-1!==e.search(/,|\s/)}));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,c=-1!==l?[a.slice(0,l).concat([a[l].split(s)[0]]),[a[l].split(s)[1]].concat(a.slice(l+1))]:[a];return c=c.map(function(e,o){var r=(1===o?!i:i)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return ee(e,r,t,n)})}),c.forEach(function(e,t){e.forEach(function(n,o){F(n)&&(r[t]+=n*("-"===e[o-1]?-1:1))})}),r}function ne(e,t){var n=t.offset,o=e.placement,r=e.offsets,i=r.popper,a=r.reference,l=o.split("-")[0],s=void 0;return s=F(+n)?[+n,0]:te(n,i,a,l),"left"===l?(i.top+=s[0],i.left-=s[1]):"right"===l?(i.top+=s[0],i.left+=s[1]):"top"===l?(i.left+=s[0],i.top-=s[1]):"bottom"===l&&(i.left+=s[0],i.top+=s[1]),e.popper=i,e}function oe(e,t){var n=t.boundariesElement||c(e.instance.popper);e.instance.reference===n&&(n=c(n));var o=O(e.instance.popper,e.instance.reference,t.padding,n);t.boundaries=o;var r=t.priority,i=e.offsets.popper,a={primary:function(e){var n=i[e];return i[e]<o[e]&&!t.escapeWithReference&&(n=Math.max(i[e],o[e])),we({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=i[n];return i[e]>o[e]&&!t.escapeWithReference&&(r=Math.min(i[n],o[e]-("right"===e?i.width:i.height))),we({},n,r)}};return r.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";i=ge({},i,a[t](e))}),e.offsets.popper=i,e}function re(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var r=e.offsets,i=r.reference,a=r.popper,l=-1!==["bottom","top"].indexOf(n),s=l?"left":"top",c=l?"width":"height",f={start:we({},s,i[s]),end:we({},s,i[s]+i[c]-a[c])};e.offsets.popper=ge({},a,f[o])}return e}function ie(e){if(!V(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=A(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function ae(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,r=o.popper,i=o.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=i[n]-(l?r[a?"width":"height"]:0),e.placement=L(t),e.offsets.popper=w(r),e}Object.defineProperty(t,"__esModule",{value:!0});for(var le=["native code","[object MutationObserverConstructor]"],se="undefined"!=typeof window,ce=["Edge","Trident","Firefox"],fe=0,pe=0;pe<ce.length;pe+=1)if(se&&navigator.userAgent.indexOf(ce[pe])>=0){fe=1;break}var ue=se&&function(e){return le.some(function(t){return(e||"").toString().indexOf(t)>-1})}(window.MutationObserver),de=ue?o:r,he=void 0,me=function(){return void 0===he&&(he=-1!==navigator.appVersion.indexOf("MSIE 10")),he},be=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ve=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),we=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ye=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Ee=ye.slice(3),xe={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},Oe={shift:{order:100,enabled:!0,fn:re},offset:{order:200,enabled:!0,fn:ne,offset:0},preventOverflow:{order:300,enabled:!0,fn:oe,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:$},arrow:{order:500,enabled:!0,fn:X,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:Z,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:ae},hide:{order:800,enabled:!0,fn:ie},computeStyle:{order:850,enabled:!0,fn:K,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:z,onLoad:G,gpuAcceleration:void 0}},Te={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Oe},Ce=function(){function e(t,n){var o=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};be(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=de(this.update.bind(this)),this.options=ge({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ge({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){o.options.modifiers[t]=ge({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return ge({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&i(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return ve(e,[{key:"update",value:function(){return k.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return B.call(this)}},{key:"disableEventListeners",value:function(){return U.call(this)}}]),e}();Ce.Utils=("undefined"!=typeof window?window:global).PopperUtils,Ce.placements=ye,Ce.Defaults=Te,t.default=Ce},"./example/index.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n("react"),c=o(s),f=n("./src/index.js"),p=o(f),u=n("./example/styles.css"),d=o(u),h=function(e){function t(){var e,n,o,a;r(this,t);for(var l=arguments.length,s=Array(l),c=0;c<l;c++)s[c]=arguments[c];return n=o=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.state={component:null},o.setRef=function(e){o.setState({component:e})},a=n,i(o,a)}return a(t,e),l(t,[{key:"render",value:function(){return c.default.createElement("div",{className:d.default.example},c.default.createElement("div",{"data-snapshot":this.props.placement},c.default.createElement("p",null,"This example showcases a simple sticky. It should be positioned:"," ",this.props.placement," (unless there's not enough space)."),c.default.createElement("div",{className:d.default.anchorContainer},c.default.createElement("strong",{ref:this.setRef},"attachment point")),c.default.createElement(b,{to:this.state.component,placement:this.props.placement})))}}]),t}(s.Component),m=function(e){return c.default.createElement("div",{ref:e.setContentRef,style:e.contentStyles,className:d.default.sticky},"position: ",e.placement)},b=(0,p.default)()(m),v=function(){return c.default.createElement("div",{className:d.default.page},c.default.createElement("h1",null,"Attach"),c.default.createElement("p",null,"Used to attach components to a certain element. This is a [higher-order component](https://reactjs.org/docs/higher-order-components.html) which provides low-level functionality: positioning componets relative to other dom elements. This means that it will be used by higher level components such as tooltips, dropdown menus etc."),c.default.createElement("h2",null,"Attach component"),c.default.createElement("p",null,"The package exports a single function, to wrap a component that needs to positioned relative to a DOM element. The resulting component accepts two additional props:"),c.default.createElement("table",{width:"100%"},c.default.createElement("thead",null,c.default.createElement("tr",null,c.default.createElement("th",{width:"20%"},"Prop"),c.default.createElement("th",null,"Description"))),c.default.createElement("tbody",null,c.default.createElement("tr",null,c.default.createElement("td",null,c.default.createElement("code",null,"to")),c.default.createElement("td",null,"This is a reference to a `HTMLElement`. It's what the component tries to display itself next to")),c.default.createElement("tr",null,c.default.createElement("td",null,c.default.createElement("code",null,"placement")),c.default.createElement("td",null,"Used to determine the prefered location for placment. Supported values are:",c.default.createElement("code",null,"auto-start"),", ",c.default.createElement("code",null,"auto"),", ",c.default.createElement("code",null,"auto-end"),","," ",c.default.createElement("code",null,"top-start"),", ",c.default.createElement("code",null,"top"),", ",c.default.createElement("code",null,"top-end"),","," ",c.default.createElement("code",null,"right-start"),", ",c.default.createElement("code",null,"right"),", ",c.default.createElement("code",null,"right-end"),","," ",c.default.createElement("code",null,"bottom-end"),", ",c.default.createElement("code",null,"bottom"),","," ",c.default.createElement("code",null,"bottom-start")," ,",c.default.createElement("code",null,"left-end"),", ",c.default.createElement("code",null,"left")," and ",c.default.createElement("code",null,"left-start"))))),c.default.createElement("h3",null,"Wrapped component"),c.default.createElement("p",null,"The wrapped component will receive additional props. Which can be divided into two parts:"),c.default.createElement("ol",null,c.default.createElement("li",null,"reference related (",c.default.createElement("code",null,"setArrowRef")," and"," ",c.default.createElement("code",null,"setContentRef"),"). There are functions to be used as a"," ",c.default.createElement("code",null,"ref=","{...}")," on DOM elements. ",c.default.createElement("br",null),"Where ",c.default.createElement("code",null,"setContentRef")," should be set on the main container for the tooltip. The other prop (",c.default.createElement("code",null,"setArrowRef"),") can be set on an html element that will be used as the arrow. Arrows are optional."),c.default.createElement("li",null,"Positioning related props: ",c.default.createElement("code",null,"placement")," (contains information where the tooltip is actually rendered). Placement can be different from the value that was requested (typically if there's no space to position the content in the originally requested position). The other two: ",c.default.createElement("code",null,"arrowStyles")," and ",c.default.createElement("code",null,"contentStyles")," are styles to be applied to the content and arrow elements.")),c.default.createElement("h3",null,"Example implementation"),c.default.createElement("p",null,"Next is an example implementation (without an arrow). It's split up into two parts/classes. The ",c.default.createElement("code",null,"Example")," class which renders an anchor as well as the Attach component (with the"," ",c.default.createElement("code",null,"ExampleAttachment")," class). First up: the"," ",c.default.createElement("code",null,"ExampleAttachment")," (which supports the required children props)."),c.default.createElement("pre",null,c.default.createElement("code",null,"\n// Simple class that renders a div with a ref so that the attach component can\n// inspect it (find out sizes etc), sets the style for the 'content' and has\n// some additional styling\nclass ExampleAttachment extends Component {\n render() {\n return (\n <div\n ref={this.props.setContentRef}\n style={this.props.contentStyles}\n className={styles.sticky}\n >\n position: {this.props.placement}\n </div>\n );\n }\n}\n\nconst AttachedExample = attach()(ExampleAttachment);\n")),c.default.createElement("pre",null,c.default.createElement("code",null,"\n// Component that can be used\nclass Example extends Component {\n state = {\n component: undefined,\n };\n\n defaultProps = {\n placement: 'bottom',\n };\n\n // We're using a ref function that updates the state\n // the component stored in the state is passed as a\n // prop to the Attach component\n setRef = (ref: HTMLElement | void) => {\n this.setState({ component: ref });\n }\n\n render() {\n return (\n <div className={styles.example}>\n <p>\n This example showcases a simple sticky. It should be positioned:{' '}\n {this.props.placement} (unless there's not enough space).\n </p>\n <div className={styles.anchorContainer}>\n <strong ref={this.setRef}>attachment point</strong>\n </div>\n <AttachedExample\n to={this.state.component}\n placement={this.props.placement}\n />\n </div>\n );\n }\n}\n\n")),c.default.createElement("h3",null,"Example in action"),c.default.createElement("p",null,"The last part shows the ",c.default.createElement("code",null,"<Attach>")," in action, displaying content top/right/bottom/left of a specific dom element. If elements are on oposite side of the element they are attached to, this is probably because there's not enough space to display the attached content on the requested side (best visible with content positioned above/below another element while scrolling the page)"),c.default.createElement(h,{placement:"top"}),c.default.createElement(h,{placement:"right"}),c.default.createElement(h,{placement:"bottom"}),c.default.createElement(h,{placement:"left"}))};v.displayName="Attach-example",t.default=v,e.exports=t.default},"./example/styles.css":function(e,t){e.exports={example:"gdLWynsg",anchorContainer:"tGsyP1E3",sticky:"_13mA98Y7"}},"./src/index.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(){return function(e){var t,n;return n=t=function(t){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.updateStateModifier={enabled:!0,order:900,fn:function(e){return t.setState({arrowStyles:e.arrowStyles,placement:e.placement,styles:e.styles}),e}},t.setContentRef=function(e){t.setState({content:e})},t.setArrowRef=function(e){t.setState({arrow:e})},t.state={arrow:null,arrowStyles:{},content:null,placement:e.placement||h,styles:{}},t}return a(n,t),c(n,[{key:"componentDidMount",value:function(){this.props.to&&this.state.content&&this.createPopper(this.props.to,this.state.content,this.state.arrow)}},{key:"componentWillUpdate",value:function(e,t){var n=e.to,o=this.props.to!==n,r=t.content,i=this.state.content!==r,a=t.arrow,l=this.state.arrow!==a;n&&r&&(o||i||l)&&(this.popper&&this.popper.destroy(),this.createPopper(n,r,a))}},{key:"componentWillUnmount",value:function(){this.popper&&this.popper.destroy()}},{key:"createPopper",value:function(e,t,n){var o={applyStyle:{enabled:!1},updateState:this.updateStateModifier,preventOverflow:{boundariesElement:"window"},arrow:void 0};n&&(o.arrow={enabled:!0,element:n}),this.popper=new d.default(e,t,{placement:this.props.placement,modifiers:o}),this.popper.scheduleUpdate()}},{key:"render",value:function(){var t={arrowStyles:this.state.arrowStyles,contentStyles:this.state.styles,setArrowRef:this.setArrowRef,setContentRef:this.setContentRef,placement:this.state.placement};return p.default.createElement(e,s({},this.props,t))}}]),n}(f.Component),t.displayName="Attach",t.defaultProps={placement:h},n}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n("react"),p=o(f),u=n("../../node_modules/popper.js/dist/esm/popper.js"),d=o(u),h="bottom";t.default=l,e.exports=t.default},react:function(e,t){e.exports=require("react")}})});

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("popper.js"),require("react")):"function"==typeof define&&define.amd?define(["popper.js","react"],t):"object"==typeof exports?exports.attach=t(require("popper.js"),require("react")):e.attach=t(e["popper.js"],e.react)}(this,function(e,t){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="../attach/src/index.js")}({"../attach/src/index.js":function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),a=r("react"),u=o(a),c=r("popper.js"),l=o(c),f=function(e){function t(e){n(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.updateStateModifier={enabled:!0,order:900,fn:function(e){return this.setState({styles:e.styles,arrowStyles:e.arrowStyles,placement:e.placement}),e}},r.setContentRef=function(e){r.content=e},r.setArrowRef=function(e){r.arrow=e},r.state={styles:{},arrowStyles:{},placement:"bottom"},r}return i(t,e),s(t,[{key:"componentWillMount",value:function(){this.updateStateModifier.fn=this.updateStateModifier.fn.bind(this)}},{key:"componentDidMount",value:function(){this.props.to&&this.createPopper(this.props.to)}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.to,r=e.to;r&&r!==t&&(this.popper&&this.popper.destroy(),this.createPopper(r))}},{key:"componentWillUnmount",value:function(){this.popper&&this.popper.destroy()}},{key:"createPopper",value:function(e){var t={applyStyle:{enabled:!1},updateState:this.updateStateModifier,preventOverflow:{boundariesElement:"window"}};this.arrow&&(t.arrow={element:this.arrow}),this.popper=new l.default(e,this.content,{placement:this.props.placement,modifiers:t}),this.popper.scheduleUpdate()}},{key:"render",value:function(){var e={arrowStyles:this.state.arrowStyles,contentStyles:this.state.styles,setArrowRef:this.setArrowRef,setContentRef:this.setContentRef,placement:this.state.placement};return u.default.cloneElement(this.props.children,e)}}]),t}(a.Component);f.displayName="Attach",f.defaultProps={placement:"bottom"},t.default=f,e.exports=t.default},"popper.js":function(e,t){e.exports=require("popper.js")},react:function(e,t){e.exports=require("react")}})});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("popper.js"),require("react")):"function"==typeof define&&define.amd?define(["popper.js","react"],t):"object"==typeof exports?exports.attach=t(require("popper.js"),require("react")):e.attach=t(e["popper.js"],e.react)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="../attach/src/index.js")}({"../attach/src/index.js":function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(){return function(e){var t,r;return r=t=function(t){function r(e){o(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.updateStateModifier={enabled:!0,order:900,fn:function(e){return t.setState({arrowStyles:e.arrowStyles,placement:e.placement,styles:e.styles}),e}},t.setContentRef=function(e){t.setState({content:e})},t.setArrowRef=function(e){t.setState({arrow:e})},t.state={arrow:null,arrowStyles:{},content:null,placement:e.placement||h,styles:{}},t}return p(r,t),c(r,[{key:"componentDidMount",value:function(){this.props.to&&this.state.content&&this.createPopper(this.props.to,this.state.content,this.state.arrow)}},{key:"componentWillUpdate",value:function(e,t){var r=e.to,n=this.props.to!==r,o=t.content,a=this.state.content!==o,p=t.arrow,s=this.state.arrow!==p;r&&o&&(n||a||s)&&(this.popper&&this.popper.destroy(),this.createPopper(r,o,p))}},{key:"componentWillUnmount",value:function(){this.popper&&this.popper.destroy()}},{key:"createPopper",value:function(e,t,r){var n={applyStyle:{enabled:!1},updateState:this.updateStateModifier,preventOverflow:{boundariesElement:"window"},arrow:void 0};r&&(n.arrow={enabled:!0,element:r}),this.popper=new d.default(e,t,{placement:this.props.placement,modifiers:n}),this.popper.scheduleUpdate()}},{key:"render",value:function(){var t={arrowStyles:this.state.arrowStyles,contentStyles:this.state.styles,setArrowRef:this.setArrowRef,setContentRef:this.setContentRef,placement:this.state.placement};return l.default.createElement(e,i({},this.props,t))}}]),r}(u.Component),t.displayName="Attach",t.defaultProps={placement:h},r}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r("react"),l=n(u),f=r("popper.js"),d=n(f),h="bottom";t.default=s,e.exports=t.default},"popper.js":function(e,t){e.exports=require("popper.js")},react:function(e,t){e.exports=require("react")}})});
//# sourceMappingURL=index.js.map
{
"name": "systema-attach",
"version": "0.1.4",
"version": "1.0.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc