/*!
 * 
 * [Dojo](https://dojo.io/)
 * Copyright [JS Foundation](https://js.foundation/) & contributors
 * [New BSD license](https://github.com/dojo/meta/blob/master/LICENSE)
 * All rights reserved
 * 
 */
(window.dojoWebpackJsonpdojo_widgets_custom_elements=window.dojoWebpackJsonpdojo_widgets_custom_elements||[]).push([[14,33],{125:function(e,t,o){e.exports={" _key":"@dojo/widgets/context-popup",trigger:"context-popup-m__trigger__3A_JZ"}},25:function(e,t,o){"use strict";o.r(t),o.d(t,"Popup",function(){return u});var n=o(88),r=o(106),s=o(80),i=o(92),c=o(5),a=o(93),p=o(94);const u=Object(c.a)({dimensions:n.b,theme:s.a,bodyScroll:i.a,resize:r.b}).properties().children()(function({properties:e,children:t,middleware:{dimensions:o,theme:n,bodyScroll:r,resize:s}}){const{underlayVisible:i=!1,yBottom:u,yTop:l,xRight:d,xLeft:m,onClose:h,open:f}=e();let{position:g="below"}=e();s.get("wrapper");const y=o.get("wrapper"),b=document.documentElement.scrollTop+document.documentElement.clientHeight,v=document.documentElement.scrollTop,_=document.documentElement.clientWidth,j=l+y.size.height<=b,w=u-y.size.height>=v,O=m-y.size.width>=0,x=d+y.size.width<=_;let $={opacity:"0"};if(y.size.height){if($={left:`${m}px`,opacity:"1"},"below"===g?$.top=j?`${l}px`:`${u-y.size.height}px`:"above"===g&&($.top=w?`${u-y.size.height}px`:`${l}px`),"left"===g||"right"===g){const e=l-u;$.top=`${Math.max(u+e/2-y.size.height/2,v)}px`}"left"===g?$.left=O?`${m-y.size.width}px`:`${d}px`:"right"===g&&($.left=x?`${d}px`:`${m-y.size.width}px`)}const k=n.classes(a),[z]=t(),C="function"==typeof z?z(g):z;return r(!f),f&&Object(c.m)("body",null,Object(c.m)("div",{key:"underlay",classes:[n.variant(),p.underlay,i&&k.underlayVisible],onclick:h}),Object(c.m)("div",{key:"wrapper",classes:[n.variant(),p.root],styles:$},C))});t.default=u},36:function(e,t,o){"use strict";o.r(t),o.d(t,"ContextPopup",function(){return l});var n=o(5),r=o(86),s=o(25),i=o(80),c=o(82),a=o(125);const p=Object(c.a)(),u=Object(n.a)({icache:p,focus:r.a,theme:i.a}).properties().children(),l=u(function({properties:e,children:t,middleware:{icache:o,focus:r}}){const{variant:i,theme:c,classes:p}=e(),u=o.getOrSet("x",0),l=o.getOrSet("y",0),{trigger:d,content:m}=t()[0],h=()=>{const{onClose:t}=e();o.set("open",!1),t&&t()};return Object(n.m)("virtual",null,Object(n.m)("div",{classes:a.trigger,key:"trigger",oncontextmenu:t=>{const{onOpen:n}=e();t.preventDefault(),r.focus(),o.set("x",t.pageX-2),o.set("y",t.pageY-4),o.set("open",!0),n&&n()}},d),Object(n.m)(s.default,{key:"popup",theme:c,variant:i,classes:p,yTop:l,yBottom:document.documentElement.scrollTop+document.documentElement.clientHeight,xLeft:u,xRight:u,onClose:h,position:"below",open:o.get("open")},Object(n.m)("div",null,m({close:h,shouldFocus:r.shouldFocus}))))});t.default=l},80:function(e,t,o){"use strict";o.d(t,"b",function(){return p});var n=o(5),r=o(83),s=o(12);const i=Object(n.a)({coreTheme:r.a}).properties();function c(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function a(e){return e&&e.hasOwnProperty("variant")}const p=i(function({middleware:{coreTheme:e},properties:t}){const{variant:o,get:n,set:r,classes:i}=e;return{compose:(o,n,r)=>{const i=function(){const{theme:o}=t();if(o)return o;const n=e.get();return Object(s.c)(n)?{theme:n.theme,variant:n.variant}:n?n.theme:void 0}(),p=o[" _key"],u=n[" _key"],l=Object.keys(o).reduce((e,t)=>" _key"===t?e:(r&&!e[`${r}${c(t)}`]&&(e[`${r}${c(t)}`]=" "),n[t]||(e[t]=" "),e),{" _key":u}),d=e.classes(l),m=e.classes(n);let h=e.classes(o);if(r){const e=Object.keys(Object.assign({},d,m)).reduce((e,t)=>{if(0===t.indexOf(r)&&t!==r){const o=function(e){return`${e.charAt(0).toLowerCase()}${e.slice(1)}`}(t.replace(r,"")),n="string"==typeof m[t]&&m[t].trim(),s="string"==typeof d[t]&&d[t].trim();!n&&s&&(e[o]=`${h[o]} ${s}`),n&&(e[o]=m[t])}return e},{});return h=Object.assign({},h,e),a(i)?{theme:{theme:Object.assign({},i.theme.theme,{[p]:h}),variants:i.theme.variants},variant:i.variant}:Object.assign({},i,{[p]:h})}const f=Object.keys(h).reduce((e,t)=>{if(" _key"===t)return e;const o="string"==typeof m[t]&&m[t].trim(),n="string"==typeof d[t]&&d[t].trim();return o?e[t]=o:n&&(e[t]=`${e[t]} ${n}`),e},Object.assign({},h));return a(i)?{theme:{theme:Object.assign({},i.theme.theme,{[p]:f}),variants:i.theme.variants},variant:i.variant}:Object.assign({},i,{[p]:f})},variant:()=>"inherit"===t().variant?void 0:o(),get:n,set:r,classes:i}});t.a=p},92:function(e,t,o){"use strict";o.d(t,"a",function(){return c});var n=o(5),r=o(0);const s=Object(n.a)({destroy:n.c}),i=r.a.document.body.style,c=s(function({middleware:{destroy:e}}){let t=!1,o=void 0;const n=()=>{t&&(o?i.setProperty("overflow",o):i.removeProperty("overflow"),t=!1,o=void 0)};return e(()=>{t&&n()}),e=>{e?n():t||(t=!0,o=i.getPropertyValue("overflow"),i.setProperty("overflow","hidden"))}});t.b=c},93:function(e,t,o){e.exports={" _key":"@dojo/widgets/popup",underlayVisible:"popup-m__underlayVisible__1Cxv3"}},94:function(e,t,o){e.exports={" _key":"@dojo/widgets/popup",root:"popup-m__root__3WJlO",underlay:"popup-m__underlay__2CC_p"}}}]);
//# sourceMappingURL=context-popup-8.0.0-beta.12.js.map