"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5685],{5685:function(e,t,n){n.r(t);var r=n(6400),a=n(396),i=n(9529),o=n(679),l=n(7894),c=n(7830),u=n(8697);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.default=function(e){var t=e.field,n=e.handleChange,d=e.fieldData,f=e.handleToolTip,p=e._labelPosition,h=e._descPosition,m=e.isDisabled,b=e.enableQuantity,v=e.onQuantityChange,y=e.formsCount,F=e.design,g=t.required,_=t.placeholder,C=t.name,w=t.elementId,k=t.color_picker_colors,A=t.color_picker_mode,D=t.quantity_label,B=t.min_quantity,E=t.max_quantity,q=t.color_format,I=B||1,O=(k&&k.length)>0&&k.split(",").map((function(e){return e.trim()})),T=s((0,a.eJ)(!1),2),j=T[0],x=T[1],N=d.value,S=d.quantity,L=!1;void 0!==N&&((0,l.kJ)(N)?N.length>0:""!=N)&&(L=!0);var M,P=s((0,a.eJ)(N),2),J=P[0],V=P[1],Y=(0,o.r3)(t),Z=(0,l.Tj)(w,y),H=["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],Q=!1;switch(A){case"chrome":M=c.AI,H=H.splice(1,5);break;case"circle":M=c.iY,Q=!0,H=H.splice(1,20);break;case"compact":M=c.Ie;break;case"github":M=c.Lf,H=H.splice(1,16);break;case"block":M=c.if,H=H.splice(1,9);break;case"twitter":M=c.e8,H=H.splice(1,10);break;default:M=c.xS,H=H.splice(1,16)}var U,$,z=(0,a.I4)((function(){return x(!1)}),[]),G=(0,a.sO)();U=G,$=z,(0,a.d4)((function(){var e=function(e){U.current&&!U.current.contains(e.target)&&$(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[U,$]);var K=(0,r.h)(r.HY,null,(0,r.h)("div",{className:"wcpa_color_field",style:Q?{display:"none"}:void 0,onClick:m?void 0:function(){x(!j)}},(0,r.h)("input",{type:"text",className:"wcpa_field",name:(0,l.uM)(C),placeholder:_,defaultValue:N,required:g,readOnly:!0,disabled:m,id:Z}),(0,r.h)("div",{className:"wcpa_code"},""!=J?J:_),(0,r.h)("div",{className:"wcpa_color",style:{backgroundColor:J}})));return(0,r.h)(r.HY,null,(0,r.h)(i.Z,{handleToolTip:f,_labelPosition:p,_descPosition:h,field:t,dField:d,targetId:Z},b?(0,r.h)("div",{className:"wcpa_quantity_wrap"},K,D?(0,r.h)("div",{className:"wcpa_label_wrap"},(0,r.h)("label",null," ",D),(0,r.h)(u.Z,{name:"".concat((0,l.uM)(C,"_quantity")),disabled:m||!L,defaultValue:S,min:I,max:E,onChange:function(e){v(t,e.target.value)},design:F})):(0,r.h)(u.Z,{name:"".concat((0,l.uM)(C,"_quantity")),disabled:m||!L,defaultValue:S,min:I,max:E,onChange:function(e){v(t,e.target.value)},design:F})):K,j||Q?(0,r.h)("div",{class:"wcpa_color_picker ".concat(Q?"wcpa_inline_color_picker":""),ref:G},(0,r.h)(M,{className:"#FFFFFF"===J?"white-selected":"",color:J,colors:O||H,presetColors:O||H,onChange:function(e){var r=e.hex;if("rrggbbaa"===q&&e.rgb.a<1){var a=Math.round(255*e.rgb.a).toString(16);a.length<2&&(a="0"+a),r+=a}if(r=r.toUpperCase(),Y){var i=(0,o.OP)(t,d,r);if(!0!==i)return void Object.keys(i).map((function(e){V(r),n(w,r,i)}))}V(r);var l=setTimeout((function(){n(w,r,!1)}),100);return function(){return clearTimeout(l)}},width:Q?"auto":void 0,disableAlpha:"rrggbbaa"!==q})):null))}}}]);