IOPaint/lama_cleaner/app/build/static/js/main.b169e669.chunk.js

1 line
38 KiB
JavaScript
Raw Normal View History

2022-05-23 15:16:59 +02:00
(this["webpackJsonplama-cleaner"]=this["webpackJsonplama-cleaner"]||[]).push([[0],{48:function(e,t,n){},51:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a),i=n(15),r=n.n(i),o=(n(48),n(10)),s=n(2),l=n(55),u=n(8),j=n.n(u),d=n(14);var b=n(3),h=n(16),f=n(21),p=n(1),v=function(e){var t=e.width,n=e.value,c=e.chevronDirection,i=e.options,r=e.autoFocusAfterClose,o=e.onChange,s=Object(a.useRef)(null);return Object(p.jsxs)(f.f,{value:n,onValueChange:o,onOpenChange:function(e){e||r||window.setTimeout((function(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.blur()}),100)},children:[Object(p.jsxs)(f.g,{className:"select-trigger",style:{width:t},ref:s,children:[Object(p.jsx)(f.h,{}),Object(p.jsx)(f.b,{children:"up"===c?Object(p.jsx)(h.e,{}):Object(p.jsx)(h.d,{})})]}),Object(p.jsx)(f.a,{className:"select-content",children:Object(p.jsx)(f.i,{className:"select-viewport",children:i.map((function(e){return Object(p.jsxs)(f.c,{value:e,className:"select-item",children:[Object(p.jsx)(f.e,{children:e}),Object(p.jsx)(f.d,{className:"select-item-indicator",children:Object(p.jsx)(h.c,{})})]},e)}))})})]})};v.defaultProps={chevronDirection:"down",autoFocusAfterClose:!0};var O=v,g=n(4),x=["value","onValue"],m=c.a.forwardRef((function(e,t){var n=e.value,a=e.onValue,c=Object(g.a)(e,x);return Object(p.jsx)("input",Object(b.a)(Object(b.a)({value:n,onInput:function(e){var t=e.target.value.replace(/\D/g,"");null===a||void 0===a||a(t)},className:"number-input"},c),{},{ref:t,type:"text"}))}));var w=function(e){var t=e.title,n=e.desc,a=e.input,c=e.optionDesc,i=e.className;return Object(p.jsxs)("div",{className:"setting-block ".concat(i),children:[Object(p.jsxs)("div",{className:"setting-block-content",children:[Object(p.jsxs)("div",{className:"setting-block-content-title",children:[Object(p.jsx)("span",{children:t}),n&&Object(p.jsx)("span",{className:"setting-block-desc",children:n})]}),a]}),c&&Object(p.jsx)("div",{className:"option-desc",children:c})]})};var y,k=function(e){var t=e.title,n=e.value,a=e.suffix,c=e.onValue;return Object(p.jsx)(w,{className:"sub-setting-block",title:t,input:Object(p.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px"},children:[Object(p.jsx)(m,{style:{width:"80px"},value:"".concat(n),onValue:c}),a&&Object(p.jsx)("span",{children:a})]})})};!function(e){e.ORIGINAL="Original",e.RESIZE="Resize",e.CROP="Crop"}(y||(y={}));var S,C=function(){var e=Object(o.c)(D),t=Object(s.a)(e,2),n=t[0],a=t[1],c=function(e){a((function(t){return Object(b.a)(Object(b.a)({},t),{},{hdStrategy:e})}))},i=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(b.a)(Object(b.a)({},e),{},{hdStrategyResizeLimit:t})}))},r=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(b.a)(Object(b.a)({},e),{},{hdStrategyCropTrigerSize:t})}))},l=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(b.a)(Object(b.a)({},e),{},{hdStrategyCropMargin:t})}))},u=function(){return Object(p.jsxs)("div",{children:["Use the original resolution of the picture, suitable for picture size below 2K. Try"," ",Object(p.jsx)("div",{tabIndex:0,role:"button",className:"inline-tip",onClick:function(){return c(y.RESIZE)},children:"Resize Strategy"})," ","if you do not get good results on high resolution images."]})};return Object(p.jsx)(w,{className:"hd-setting-block",title:"High Resolution Strategy",input:Object(p.jsx)(O,{width:80,value:n.hdStrategy,options:Object.values(y),onChange:function(e){return c(e)}}),optionDesc:function(){switch(n.hdStrategy){case y.ORIGINAL:return u();case y.CROP:return Object(p.jsxs)("div",{children:[Object(p.jsx)("div",{children:"Crop masking area from the original image to do inpainting, and paste the result back. Mainly for performance and memory reasons on high resolution image."}),Object(p.jsx)(k,{title:"Trigger size",value:"".concat(n.hdStrategyCropTrigerSize),suffix:"pixel",onValue:r}),Object(p.jsx)(k,{title:"Crop margin",value:"".concat(n.hdStrategyCropMargin),suffix:"pixel",onValue:l})]});case y.RESIZE:return Object(p.jsxs)("d