(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{10:function(e,t,n){e.exports=n(29)},29:function(e,t,n){"use strict";n.r(t);var a=n(1),o=n.n(a),c=n(7),r=n.n(c),i=n(0),l=n(8),u=n.n(l),s=n(4);function d(e,t,n){Object(a.useEffect)((function(){var a=setTimeout((function(){e.apply(void 0,n)}),t);return function(){clearTimeout(a)}}),n)}n(28);var m=Object(s.b)((function(e){var t=e.args,n=t.initialPositions[0];n&&(n.unit="px");var c=Object(a.useRef)(null),r=Object(a.useRef)(null),l=Object(a.useState)(n),m=Object(i.a)(l,2),v=m[0],p=m[1],f=Object(a.useState)(n),h=Object(i.a)(f,2),g=h[0],b=h[1];Object(a.useEffect)((function(){return s.a.setFrameHeight()}));var O=Object(a.useCallback)((function(e){var n,a=document.querySelectorAll(".ReactCrop__crop-selection img"),o=1!==a.length;if(o){for(var r=0;r<a.length;r++)a[r].remove();n=document.createElement("img")}else n=a[0];if(n.src=t.overlays[0],n.width=null===e||void 0===e?void 0:e.width,n.height="".concat(null===e||void 0===e?void 0:e.height),o){var i,l=null===(i=c.current)||void 0===i?void 0:i.querySelector(".ReactCrop__crop-selection");null===l||void 0===l||l.prepend(n)}}),[JSON.stringify(t.overlays)]),j=Object(a.useCallback)((function(){void 0===g&&void 0!==v&&O(v),s.a.setFrameHeight()}),[v,g,O]);return d((function(){var e=void 0!==g&&0!==g.height&&0!==g.width;O(g),s.a.setComponentValue({positions:[e&&void 0!==g?{x:g.x,y:g.y,width:g.width,height:g.height}:null]})}),1,[g,O]),d((function(){O(v)}),0,[v,O]),o.a.createElement("div",{className:"App"},o.a.createElement("div",{className:"crop-container",ref:c},o.a.createElement("div",{className:"crop-controls"}),o.a.createElement(u.a,Object.assign({className:"gradient-border-canvas"},t.kwargs,{crop:v,onChange:function(e,t){return p(e)},onComplete:function(e){return b(e)}}),o.a.createElement("img",{ref:r,alt:"Background",src:t.background,onLoad:j}))))}));r.a.render(o.a.createElement(o.a.StrictMode,null,o.a.createElement(m,null)),document.getElementById("root"))}},[[10,1,2]]]);
//# sourceMappingURL=main.30a77405.chunk.js.map