1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34914,59824,29256],{14969:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/marketing/[model]",function(){return a(19919)}])},81555:function(e,t,a){"use strict";a.d(t,{gP:function(){return Condition},tf:function(){return ConditionalLogic},Ad:function(){return getConditionalValue},Vz:function(){return Conditional_getConditionalsFormKeys}});var n=a(85893);a(67294);let getConditionalsFormKeys=e=>{let getConditionalsFormKeysFirstLevel=e=>{let{fields:t=e}=e,a=t.filter(e=>e.value&&e.value.conditional).map(e=>{let t=e.value.conditional.replaceAll("+",",").replaceAll("-",",").split(","),a=t.map(t=>"".concat(e.prefix||"").concat(t)).join(","),n=t.map(e=>"".concat(e)).join(",");return"".concat(n,",").concat(a)}).reduce((e,t)=>"".concat(e,",").concat(t),"");return[...new Set(a.split(/[+,-]/).map(e=>e.split("|")[0]))].filter(Boolean)},getModelFieldLevelFields=e=>{let{fields:t=e}=e,a=[];return t.filter(e=>"ModelField"===e.type&&e.value.section).map(e=>e.value.section.body.map(t=>({...t,prefix:e.prefix||""}))).map(e=>{a=[...a,...e]}),a},getCollapseFieldLevelFields=e=>{let{fields:t=e}=e,a=[];return t.filter(e=>"Collapse"===e.type&&e.value.sections).forEach(e=>e.value.sections.map(e=>{e.value.conditional&&a.push(e),a.push(...e.value.fields)})),a},getGroupStreamLevelFields=e=>{let{fields:t=e}=e,a=[];return t.filter(e=>"GroupStream"===e.type).map(e=>e.value.tabs).map(e=>e.map(e=>{let t={title:e.title,type:"Tab",value:{conditional:e.conditional}};if(e.form_prefix){let n=e.fields.map(t=>({...t,prefix:e.form_prefix}));return a=[...a,...n,t]}return a=[...a,...e.fields,t]})),a},getAllFieldsForm=e=>{let{fields:t=e}=e,a=[],n=["GroupStream","ModelField","Collapse"],r=t.map(e=>({...e}));if(t.length){let e=[];r.filter(e=>n.includes(e.type)&&!e.processed).map(t=>{if("GroupStream"===t.type){let a=getGroupStreamLevelFields([t]);return t.processed=!0,e=[...e,...a],a}if("ModelField"===t.type){let a=getModelFieldLevelFields([t]);return t.processed=!0,e=[...e,...a],a}if("Collapse"===t.type){let a=getCollapseFieldLevelFields([t]);return t.processed=!0,e=[...e,...a],a}}),a=[...a,...r,...e]}return a};return(e=>{let t=getAllFieldsForm(e),a=getAllFieldsForm(t),n=getAllFieldsForm(a),r=getAllFieldsForm(n),l=getAllFieldsForm(r),o=getAllFieldsForm(l),i=getConditionalsFormKeysFirstLevel(o);return i})(e)};function getConditionalValue(e){let{conditional:t,prefix:a}=e;return a&&t?"".concat(a).concat(t.replaceAll("+","+".concat(a)).replaceAll(",",",".concat(a))):t}let lowerCase=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e&&e.toString().toLowerCase()},checkConditionalMatch=(e,t)=>lowerCase(e)===lowerCase(t)||Array.isArray(e)&&e.find(e=>lowerCase(t)===lowerCase(e)),ConditionalLogicPlus=e=>{let{conditional:t,conditionalKeysValues:a}=e;if(t&&a){let e=[],n=t.split("+"),r=n.length;if(n.forEach(t=>{let n=t.split("|");a&&n[0]in a&&checkConditionalMatch(a[n[0]],n[1])&&e.push("add")}),r===e.length)return!0;e.length}return!1};function ConditionalLogic(e){let{conditional:t,conditionalKeysValues:a}=e;if(t&&a){let e=[],n=t.split(",");if(n.map(t=>{t.includes("+")&&ConditionalLogicPlus({conditional:t,conditionalKeysValues:a})&&e.push(!0);let n=t.split("|");return a&&n[0]in a&&checkConditionalMatch(a[n[0]],n[1])&&e.push(a[n[0]]),!0}),0===e.length)return!1}return!0}function Condition(e){let{conditional:t,children:a,runGetConditionalValue:r=!0,prefix:l,conditionalKeysValues:o}=e,i=r?getConditionalValue({conditional:t,prefix:l}):t,s=ConditionalLogic({conditional:i,conditionalKeysValues:o});return s?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(n.Fragment,{})}function Conditional_getConditionalsFormKeys(e){let t=getConditionalsFormKeys(e);return t}},59824:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return GroupFields}});var n=a(85893),r=a(97538),l=a(94055);a(5904);var o=a(67814),i=a(93799);function GroupFields(e){let{form:t,formValue:a,setFormValue:s,field:c,setFieldResponse:d,autoFillFormExecuted:u,onValuesChangeAction:p}=e,f={...c,fields:c.group},m=(0,n.jsx)(n.Fragment,{});f.instructions&&(m=(0,n.jsx)(l.default,{title:f.instructions,children:(0,n.jsx)(o.FontAwesomeIcon,{icon:"question-circle"})}));let g=(0,n.jsxs)("span",{children:[f.title,"\xa0",m]});return(0,n.jsx)("div",{id:"groupForm",children:(0,n.jsx)(r.default.Item,{label:g,children:(0,n.jsx)("div",{className:"groupFields",children:(0,n.jsx)(i.default,{form:t,formFields:f,formValue:a,setFormValue:s,
1className:"spacing",setFieldResponse:d,autoFillFormExecuted:u,onValuesChangeAction:p})})})})}},29256:function(e,t,a){"use strict";a.r(t);var n=a(85893),r=a(67294),l=a(5152),o=a.n(l),i=a(25675),s=a.n(i),c=a(53740);let d=o()(()=>a.e(41044).then(a.bind(a,41044)),{loadableGenerated:{webpack:()=>[41044]}}),{Title:u,Paragraph:p}=c.default;t.default=(0,r.memo)(function(e){let{level:t=2,title:a,margin:l="",classNameTitle:o="",content:i,image:c="",className:f,titleSize:m="inherit"}=e,[g,h]=(0,r.useState)(!1),x=l?"":"noMargin";return(0,n.jsxs)("div",{className:f,children:[(0,n.jsx)(u,{level:t,style:{fontSize:m},className:o,children:a}),(0,n.jsx)(p,{className:"p".concat(t," ").concat(x),children:(0,n.jsx)("p",{className:"".concat(x),children:i.split("<br/>").map((e,t)=>(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e}},t))})}),c&&(0,n.jsxs)("div",{style:{marginBottom:"40px"},children:[(0,n.jsx)(s(),{quality:50,width:c.width,height:c.height,src:c.url,alt:a,onClick:()=>h(!0)}),(0,n.jsx)(d,{src:c.url,visible:g,onCancel:function(){h(!1)}})]})]},"title_text")})},19919:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return em}});var n=a(85893),r=a(67294),l=a(39691),o=a(90008),i=a(12918),s=a.n(i),c=a(62251),d=a(4670),u=a(5152),p=a.n(u),f=a(10149),m=a(55673),g=a(5789),h=a(94704),x=a(20838),y=a(59361),C=a(7136),_=a(96023),v=a(97538),j=a(56697),b=a(73818),F=a(53740),k=a(11187),A=a(26392),w=a(47041),I=a(91701),S=a(81713),P=a(51024),V=a(40987),N=a(64713),L=a(94055),E=a(64749),T=a(31059),R=a(74253),z=a(14321),M=a(4863),D=a(18945),q=a(58754),B=a(29256);a(5904);var G=a(67814),Z=a(27484),O=a.n(Z),J=a(97878);a(85518);var U=a(89552),K=a(33391),X=a(91530);let validateCEP=(e,t,a)=>{t&&!(0,X.jg)(t)&&a("CEP inv\xe1lido"),a()};var Address=function(e){let{formValue:t,prefix:a,group:l,form:o,resetFields:i,getFieldDecorator:s}=e,[c,d]=(0,r.useState)(t),[u,p]=(0,r.useState)({}),[f,h]=(0,r.useState)(!1),x=(0,n.jsx)(G.FontAwesomeIcon,{icon:"circle-notch",spin:!0}),y=(0,n.jsx)(U.default,{indicator:x,size:"small"}),C=a?"".concat(a,"_").concat(l.key):l.key,_=C?"".concat(C,"_"):C,j=l.required,getValue=(e,t)=>c["".concat(e).concat(t)]||c[t];function checkAddressData(){return{["".concat(_,"zip_code")]:getValue(_,"zip_code"),["".concat(_,"street")]:getValue(_,"street"),["".concat(_,"district")]:getValue(_,"district"),["".concat(_,"city")]:getValue(_,"city"),["".concat(_,"complement")]:getValue(_,"complement"),["".concat(_,"state")]:getValue(_,"state"),["".concat(_,"number")]:getValue(_,"number")}}function handleInputFocusAddress(e){let{name:t}=e.target;p({...u,focused:t})}function emptyParams(){t["".concat(_,"street")]="",t["".concat(_,"district")]="",t["".concat(_,"city")]="",t["".concat(_,"state")]="",t["".concat(_,"number")]="",p({}),i(Object.keys(u))}function handleInputChangeAddress(e){let{name:a,value:n}=e.target;if(a==="".concat(_,"zip_code")&&(emptyParams(),n=(0,X.Gs)(n),e.target.value=n),a==="".concat(_,"number")){if(emptyParams(),Number.isNaN(parseInt(n)))return e.target.value=null,delete t[a],p({...u}),"";e.target.value=parseInt(n),t[a]=n,p({...u,[a]:n})}return n}return(0,r.useEffect)(()=>{Object.keys(t).length&&!Object.keys(c).length&&d(t)},[t]),(0,r.useEffect)(()=>{p(checkAddressData())},[c]),(0,r.useEffect)(()=>{f&&p(checkAddressData())},[f]),(0,n.jsxs)("div",{id:"addressForm",children:[(0,n.jsxs)(m.default,{type:"flex",justify:"space-between",gutter:10,children:[(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:8},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"zip_code"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"zip_code")],getValueFromEvent:handleInputChangeAddress,rules:[{required:j,message:"Campo obrigatorio"},{validator:validateCEP}]})((0,n.jsx)(P.default,{name:"".concat(_,"zip_code"),placeholder:"CEP","data-hj-allow":!0,onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,onBlur:function(e){let a=e.target.value;emptyParams(),""!==a&&!(a.length<8)&&(p({...u,loading:y}),K.Z.SearchCep(a).then(e=>(e.data.erro?(emptyParams(),o.setFields({["".concat(_,"zip_code")]:{errors:[Error("CEP n\xe3o encontrado")]}})):(p({...u,["".concat(_,"zip_code")]:e.data.cep?e.data.cep:u["".concat(_,"zip_code")],["".concat(_,"street")]:e.data.logradouro?e.data.logradouro:u["".concat(_,"street")],["".concat(_,"district")]:e.data.bairro||"",["".concat(_,"city")]:e.data.localidade?e.data.localidade:u["".concat(_,"city")],["".concat(_,"state")]:e.data.uf?e.data.uf:u["".concat(_,"state")]}),e.data.cep&&(t["".concat(_,"zip_code")]=e.data.cep),e.data.logradouro&&(t["".concat(_,"street")]=e.data.logradouro),e.data.bairro&&(t["".concat(_,"district")]=e.data.bairro),e.data.localidade&&(t["".concat(_,"city")]=e.data.localidade),e.data.uf&&(t["".concat(_,"state")]=e.data.uf),e.data.bairro||(t["".concat(_,"district")]="")),!0)).catch(e=>{emptyParams()}))},tabIndex:"0",minLength:8,maxLength:9,autoComplete:"disabled",className:"darkplaceholder",suffix:u.loading}))})}),(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:16},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"street"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"street")],getValueFromEvent:handleInputChangeAddress,rules:[{required:j,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"street"),placeholder:"Nome da Rua",disabled:!!u.loading,onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,minLength:5,autoComplete:"disabled",className:"darkplaceholder"}))})})]}),(0,n.jsxs)(m.default,{type:"flex",justify:"space-between",gutter:10,children:[(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:4,offset:0},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"number"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"number")],getValueFromEvent:handleInputChangeAddress,rules:[{required:!1,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"number"),placeholder:"N\xba",onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,minLength:1,autoComplete:"disabled",className:"darkplaceholder"}))})}),(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:8},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"complement"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"complement")],getValueFromEvent:handleInputChangeAddress,rules:[{required:!1,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"complement"),placeholder:"Complemento",onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,className:"darkplaceholder",autoComplete:"disabled"}))})}),(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:8},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"city"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"city")],getValueFromEvent:handleInputChangeAddress,rules:[{required:j,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"city"),placeholder:"Cidade",onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,minLength:5,autoComplete:"disabled",className:"darkplaceholder"}))})}),(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:4},children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"state"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"state")],getValueFromEvent:handleInputChangeAddress,rules:[{required:j,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"state"),placeholder:"UF",onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,minLength:2,autoComplete:"disabled",className:"darkplaceholder"}))})})]}),(0,n.jsx)(m.default,{type:"flex",justify:"space-between",gutter:10,children:(0,n.jsx)(g.default,{xs:24,sm:24,md:24,children:(0,n.jsx)(v.default.Item,{style:{marginBottom:"10px"},children:s("".concat(_,"district"),{validateTrigger:["onChange"],initialValue:u["".concat(_,"district")],getValueFromEvent:handleInputChangeAddress,rules:[{required:j,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:"".concat(_,"district"),placeholder:"Bairro",onChange:handleInputChangeAddress,onFocus:handleInputFocusAddress,minLength:3,autoComplete:"disabled",className:"darkplaceholder"}))})})})]})},H=(0,r.memo)(function(e){let t=e.group.key?e.group.key:e.prefix?e.prefix:"",a=e.group.required,l=t?"".concat(t,"_first_name"):"first_name",o=t?"".concat(t,"_last_name"):"last_name",[i,s]=(0,r.useState)({[l]:e.formValue[l],[o]:e.formValue[o]});function handleInputChangeAddress(t){let{name:a,value:n}=t.target;
1return e.formValue[a]=n,s({...i,[a]:n}),n}return(0,r.useEffect)(()=>{s({[l]:e.formValue[l],[o]:e.formValue[o]})},[e.formValue[l],e.formValue[o]]),(0,n.jsx)("div",{id:"nameForm_".concat(t),children:(0,n.jsxs)(m.default,{type:"flex",justify:"space-between",gutter:20,children:[(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:12},children:(0,n.jsx)(v.default.Item,{style:{margin:"0px"},label:(0,n.jsx)("span",{children:"Primeiro nome\xa0"}),children:e.getFieldDecorator(l,{validateTrigger:["onChange"],initialValue:i[l],getValueFromEvent:handleInputChangeAddress,rules:[{required:a,whitespace:!0,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:l,placeholder:"Jo\xe3o","data-hj-allow":!0,onChange:handleInputChangeAddress,minLength:3,className:"darkplaceholder",suffix:i.loading},l))},l)}),(0,n.jsx)(g.default,{xs:24,sm:24,md:{span:12},children:(0,n.jsx)(v.default.Item,{style:{margin:"0px"},label:(0,n.jsx)("span",{children:"Sobrenome\xa0"}),children:e.getFieldDecorator(o,{validateTrigger:["onChange"],initialValue:i[o],getValueFromEvent:handleInputChangeAddress,rules:[{required:a,whitespace:!0,message:"Campo obrigatorio"}]})((0,n.jsx)(P.default,{name:o,placeholder:"Silva","data-hj-allow":!0,onChange:handleInputChangeAddress,minLength:3,className:"darkplaceholder"},o))},o)})]})},"nameForm_".concat(t))}),$=a(28465);let onRemove=e=>{o.ApiPrivate.removeIncorporateProcessFile(e)},Y=r.forwardRef((e,t)=>{let[a,l]=(0,r.useState)([]),o=(0,w.getCookie)("token"),{formValue:i,extensionsType:s,fieldKey:c,disabled:d,prefix:u,modelFieldId:p}=e,f={id:i.object_id,field_key:u?c.replace(u,""):c,form_id:i.form_id},m=Object.keys(i);p&&(f.form_model_id=p),u&&(f.tab_key=u),m.includes("company_id")&&(f.company_id=i.company_id),m.includes("model_id")&&(f.model_id=i.model_id),(0,r.useEffect)(()=>{if(!i.files)return;let e="string"==typeof i.files?JSON.parse(JSON.stringify(i.files.replaceAll("'",'"'))):i.files;if(e&&e.length>0&&"object"==typeof e){let t=e.filter(e=>c===e.field_key).map((e,t)=>{let a=e.document;return{key:t,uid:e.id,name:a.title,status:"done",url:a.url}});l(t)}},[i,c]);let getExtension=e=>{let{type:t,fileName:a}=e,n=t?t.split("/"):a.split(".");return String(n[n.length-1]).toLowerCase()},g={action:"".concat("https://smartstore.herosvc.com/api","/v2/incorporate/process/file/"),listType:"picture",data:{...f},disabled:d,onRemove,onChange:e=>{if(Array.isArray(e))return e;e.file.response&&"error"===e.file.status&&k.default.error("N\xe3o foi poss\xedvel salvar o arquivo! Verifique se a extens\xe3o do arquivo \xe9 permitida para o campo"),e.file&&e.file.response&&e.fileList.map(t=>{let a={...t};return t.uid.includes("rc-upload-")&&(a.key=e.file.response.file_id,a.uid=e.file.response.file_id,a.url=e.file.response.file_url),a});let t=e.fileList.map(e=>({...e,extension:getExtension({fileName:e.url||e.name})}));return l(s.includes("all")?t.filter(e=>"error"!==e.status):t.filter(e=>s.includes(e.extension))),e&&e.fileList},ref:t,headers:{authorization:"Bearer ".concat(o)}};return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)($.default,{...g,style:{margin:"0px"},fileList:[...a],accept:"".concat(s.includes("all")?"":s.map(e=>".".concat(e)).join(",")),beforeUpload:e=>{let{name:t}=e,a=String(t.split(".")[1]).toLowerCase();return!!(s.includes("all")||s.includes(a))||(k.default.error((0,n.jsxs)(n.Fragment,{children:["Apenas arquivos com formato(s)"," ",(0,n.jsx)("strong",{children:s.join(", ")})," s\xe3o aceitos"]})),!1)},children:[(0,n.jsx)("div",{style:{margin:"4px 0"},children:(0,n.jsx)(F.default.Text,{type:"secondary",children:(0,n.jsxs)("small",{children:["Formato(s) de arquivo(s) aceito(s):"," ",(0,n.jsx)("strong",{children:s.includes("all")?"pdf, arm, pfx, p12, pem, pub, docx, doc, xls, xlsx, jpg, jpeg, png":s.join(", ")})]})})}),(0,n.jsx)(C.zx,{children:"Upload"})]})})});var W=(0,r.memo)(Y);let Q=r.forwardRef((e,t)=>{let a=(0,w.getCookie)("token"),{formValue:l}=e,{field_key:i}=e,{disabled:s}=e,c={id:l.object_id,field_key:i},[d,u]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(l.files&&l.files&&l.files.length>0&&"object"==typeof l.files){let e=l.files,t=e.filter(e=>i==e.field_key).map((e,t)=>{let a=e.document;return{key:t,uid:e.id,name:a.title,status:"done",url:a.url}});u(t)}},[l,i]),Object.keys(l).includes("company_id")&&(c={...c,company_id:l.company_id}),Object.keys(l).includes("model_id")&&(c={...c,model_id:l.model_id});let p={action:"".concat("https://smartstore.herosvc.com/api","/v2/marketing/process/file/"),listType:"picture",data:{...c},disabled:s,onRemove:e=>{e.process_id=l.object_id||!1,o.ApiPrivate.removeMarketingProcessFile(e)},onChange:e=>Array.isArray(e)?e:(e.file&&e.file.response&&e.fileList.map(t=>(t.uid.includes("rc-upload-")&&(t.key=e.file.response.file_id,t.uid=e.f
1ile.response.file_id,t.url=e.file.response.file_url),t)),u(e.fileList),e&&e.fileList),ref:t,headers:{authorization:"Bearer ".concat(a)}};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)($.default,{...p,style:{margin:"0px"},fileList:[...d],children:(0,n.jsx)(C.zx,{children:"Upload"})})})});var ee=(0,r.memo)(Q),et=a(59824);let{TabPane:ea}=x.default,en=r.forwardRef((e,t)=>(0,n.jsx)(Address,{...e,forwardedRef:t})),er=r.forwardRef((e,t)=>(0,n.jsx)(H,{...e,forwardedRef:t})),ConditionalLogic=e=>{let{conditional:t,form:a}=e;if(t){let e=a.getFieldsValue(),n=[],r=t.split(",");if(r.map((t,a)=>{let r=t.split("|"),l=r[0],o=r[1],i=document.getElementsByClassName("field_".concat(l))[0];if(e[l]&&i){var s;(e[l]==o||(null===(s=e[l])||void 0===s?void 0:s.includes(o)))&&n.push(e[l])}}),0===n.length)return!1}return!0},Condition=e=>{let{conditional:t,form:a,name:r,children:l}=e,o=ConditionalLogic({conditional:t,form:a,name:r});return o?(0,n.jsx)(n.Fragment,{children:l}):(a.getFieldDecorator([r],{initialValue:null,rules:[{required:!1}]}),(0,n.jsx)("div",{}))};var el=(0,r.memo)(function FormFields(e){let{form:t}=e,{formFields:a}=e,{formValue:l}=e,{setFormValue:o}=e,i=!!e.disabled,s=!!e.hideLabels,c=e.prefix?e.prefix:"",{aditionals:d}=e,{GTMEventName:u}=e,{getFieldDecorator:p,resetFields:f}=t,{Option:m}=E.default,{TextArea:g}=P.default;function onChangeChoiceRadio(e){let{name:t,value:a}=e.target;l[t]=a,o({...l,[t]:a})}let handleSuffix=e=>{(0,J.e)("simple_form_".concat(e))};return a.fields.map((a,g)=>{let h=a.value||a,y="",C={},_="",j="",b="",F=!0,k="",A=!1;function onChangeChoice(e){o({...l,[c+h.key]:e})}if(!h)return!1;if("divider"==h.react_component)return(0,n.jsx)(R.default,{},g);
1if("GroupStream"==a.type)return(0,n.jsx)(x.default,{className:"padding ant-tabs-small",type:"card",animated:!0,items:h.tabs.filter(e=>{let a=ConditionalLogic({conditional:e.conditional,form:t});return a}).map((e,a)=>({label:e.tabTitle,key:e.form_prefix,children:(0,n.jsx)(FormFields,{formFields:e,formValue:l,form:t,setFormValue:o,disabled:i,prefix:e.form_prefix},a)}))},g);if("message"==h.react_component){let e=ConditionalLogic({conditional:h.conditional,form:t});return!!e&&(0,n.jsx)(B.default,{...h,level:2},g)}if("alert"==h.react_component){let e=ConditionalLogic({conditional:h.conditional,form:t});return!!e&&(0,n.jsx)(v.default.Item,{style:b,className:"".concat(k," field_").concat(c+h.key),children:(0,n.jsx)(M.default,{message:h.message,type:h.alert_type,showIcon:h.show_icon,description:h.description},"alert_".concat(h.key))},"".concat(h.key,"_alert"))}let w=[{required:h.required||!1,message:h.error_message||"Este campo \xe9 obrigatorio"}];"email"==h.field_type&&w.push({type:"email",message:"Este e-mail n\xe3o \xe9 v\xe1lido!"}),h.className&&(k=h.className),"hidden"==h.field_type&&(b={display:"none"},l[c+h.key]=l[c+h.key]?l[c+h.key]:h.default_value),h.instructions&&(y=(0,n.jsxs)(L.default,{title:h.instructions,children:["\xa0",(0,n.jsx)(G.FontAwesomeIcon,{icon:"question-circle",style:{color:"#616f80"}})]}));let suffix=t=>e.clipboard?(0,n.jsxs)(L.default,{placement:"topLeft",title:"copiado!",trigger:["click"],children:[" ",(0,n.jsx)(G.FontAwesomeIcon,{icon:"clipboard",style:{color:"#616f80",cursor:"pointer"},onClick:()=>handleSuffix(t)})]}):(0,n.jsx)("span",{}),I=(0,n.jsxs)("span",{children:[h.title,"\xa0",y]});if(_=(0,n.jsx)(P.default,{placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)}),"text_area"==h.field_type&&(_=(0,n.jsx)(P.default.TextArea,{rows:4,placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)})),"password"==h.field_type&&(_=(0,n.jsx)(P.default.Password,{placeholder:h.placeholder,disabled:i})),"date_field"==h.react_component&&(_=(0,n.jsx)(z.default,{placeholder:h.placeholder,style:{width:"100%"},format:"DD/MM/YYYY",showTime:!1,disabledTime:!0,disabled:i}),l[c+h.key]&&(A=O()(l[c+h.key]))),"upload_field"==h.react_component){C={valuePropName:"fileList"};let e=(0,r.useRef)(null);F=!1,_="MarketingFormSent"==u?(0,n.jsx)(ee,{ref:e,formValue:l,disabled:i,field_key:c+h.key,formItemName:c+h.key}):(0,n.jsx)(W,{ref:e,formValue:l,disabled:i,field_key:c+h.key,formItemName:c+h.key})}if("phone"==h.field_type&&(w.push({validator:q.a$}),_=(0,n.jsx)(P.default,{onChange:q.CN,maxLength:16,placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)})),"cpf_cnpj"==h.field_type&&(w.push({validator:q.sc}),_=(0,n.jsx)(P.default,{name:h.key,onChange:q.UV,maxLength:18,placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)})),"cpf"==h.field_type&&(w.push({validator:q.pM}),_=(0,n.jsx)(P.default,{name:h.key,onChange:q.Cz,maxLength:14,placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)})),"cnpj"==h.field_type&&(w.push({validator:q.VD}),_=(0,n.jsx)(P.default,{name:h.key,onChange:q.R4,maxLength:18,placeholder:h.placeholder,disabled:i,suffix:suffix(h.key)})),"selection"==h.field_type&&(j=h.alternative.map((e,t)=>(e.default&&!l[c+h.key]&&(l[c+h.key]=e.value),(0,n.jsx)(m,{value:e.value,children:e.label},t))),_=(0,n.jsx)(E.default,{onChange:onChangeChoice,disabled:i,children:j})),"multi_select_search"==h.react_component){let e=h.options.split("\n");if(j=e.map((e,t)=>{let a=e.split("|");return(0,n.jsx)(m,{value:"".concat(a[0]," | ").concat(a[1]),children:a[1]},"".concat(a[0],"_").concat(t))}),_=(0,n.jsx)(E.default,{onChange:onChangeChoice,mode:h.field_type,disabled:i,children:j}),l[c+h.key])try{A=l[c+h.key].split(", ")}catch(e){}}if("check_box"==h.field_type){if(C={valuePropName:"checked"},l[c+h.key]&&"string"==typeof l[c+h.key])try{A=l[c+h.key].split(", ")}catch(e){}_=(0,n.jsx)(T.default.Group,{onChange:onChangeChoice,options:h.alternative,disabled:i})}return"radio_button"==h.field_type&&(d&&h.alternative.forEach(e=>{let t=d.find(t=>t.value===e.value);return t&&t.credits&&!e.aditional&&(e.aditional=!0,e.label=(0,n.jsxs)("span",{children:[e.label," ",(0,n.jsxs)("small",{className:"primaryColor",children:["+",t.credits," horas"]})]})),e}),_=(0,n.jsx)(N.default.Group,{name:c+h.key,onChange:onChangeChoiceRadio,options:h.alternative,disabled:i})),"radio_button_tab"==h.field_type&&(j=h.alternative.map((e,t)=>(e.default&&!l[c+h.key]&&(l[c+h.key]=e.value),(0,n.jsxs)(N.default.Button,{value:e.value,children:[e.icon&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:e.icon}),"\xa0"]}),e.label]},e.value))),_=(0,n.jsx)(N.default.Group,{name:c+h.key,onChange:onChangeChoiceRadio,disabled:i,children:j},"radioo".concat(c).concat(h.key))),"true_false"==h.field_type&&(C={valuePropName:"checked"},"FALSE"==l[c+h.key]&&(l[c+h.key]=!1),_=(0,n.jsx)(V.default,{onChange:onChangeChoice,checked:l[c+h.key]||!1,disabled:i},c+h.key)),"terms_and_conditions"==h.field_type&&(C={valuePropName:"checked"},_=(0,n.jsx)(T.default.Group,{onChange:onChangeChoice,disabled:i,children:(0,n.jsxs)(T.default,{value:!0,disabled:i,children:["Aceito os",(0,n.jsx)(D.default,{href:h.link,target:"_blank",style:{marginLeft:"5px"},children:"Termos e condi\xe7\xf5es"})]})},h.key)),"address"==h.field_type&&(F=!1,_=(0,n.jsx)(en,{getFieldDecorator:p,resetFields:f,formValue:l,group:h,form:t,prefix:c},c)),"name_surname"==h.field_type&&(F=!1,I=null,_=(0,n.jsx)(er,{getFieldDecorator:p,resetFields:f,formValue:l,group:h,prefix:c},c)),"group_fields"==h.field_type&&(F=!1,I=null,h.fields=h.group,_=(0,n.jsx)(et.default,{form:t,formFields:h,formValue:l,setFormValue:o,className:"spacing",prefix:c})),(0,n.jsx)(Condition,{conditional:h.conditional,form:t,name:c+h.key,children:(0,n.jsx)(v.default.Item,{style:b,label:!s&&I,
1className:"".concat(k," field_").concat(c+h.key),required:h.required,children:F?p(c+h.key,{validateTrigger:["onChange"],initialValue:A||l[c+h.key],extra_params:C,rules:w})(_):_})},"item_".concat(g))})});p()(()=>a.e(18269).then(a.bind(a,18269)),{loadableGenerated:{webpack:()=>[18269]}});var eo=(0,r.memo)(function(e){var t;let{user:a,defaultCompanyId:i,companyCredits:s}=(0,r.useContext)(l.S),{setModalPointsVisible:c}=(0,r.useContext)(A.I),{form:d}=e,u=e.formFields,p=u.aditionals||!1,f=e.submitButtonText||!1,m=e.successExtra||!1,g=u.fields;e.subTotal;let h=e.hideSuccess||!1,x=u.review_before_send||!1,[y,_]=(0,r.useState)(!1),[P,V]=(0,r.useState)([]),[N,L]=(0,r.useState)([]),[E,T]=(0,r.useState)(!1),[R,z]=(0,r.useState)(!1),[M,D]=(0,r.useState)(!!e.disabled),[q,B]=(0,r.useState)(!1),[G,Z]=(0,r.useState)(!1);[].concat(g.filter(e=>e.value&&e.value.alternative).map(e=>e.value.alternative).flat(1));let[O,J]=(0,r.useState)(e.GTMEventName||!1),U={form_id:u.id,form_key:u.form_key,form_to:e.form_to||!1,hubspot_stage_id:u.post_hubspot||!1,hubspot_product_id:u.post_hubspot_product_id||!1,hubspot_seller_id:u.post_hubspot_seller_id||!1,...e.init},[K,X]=(0,r.useState)(U),{validateFieldsAndScroll:H,getFieldsError:$}=d,{Title:Y,Text:W,Paragraph:Q}=F.default,ee=r.useRef(null);function getFormFieldsValues(){let e=d.getFieldsValue();return!("name"in e)&&"first_name"in e&&(e.name="".concat(e.first_name," ").concat(e.last_name)),e}function getFormUpdated(){return{...K,...getFormFieldsValues()}}(0,r.useEffect)(()=>{e.formParams&&X({...U,...e.formParams})},[e.formParams]),(0,r.useEffect)(()=>{e.handleClick&&(ee.current.handleClick(e.handleClick),e.setHandleClick(!1))},[e.handleClick]),(0,r.useEffect)(()=>{if(q){let t=e.successText||"Dados salvos";k.default.success(t),e.setUpdateForm&&e.setUpdateForm(!0)}B(!1)},[q]),(0,r.useEffect)(()=>{S.T.setCsrf();let e={};for(let t in(0,w.getCookies)())t.includes("utm_")&&(e[t]=(0,w.getCookie)(t));z(e)},[]),(0,r.useEffect)(()=>{a&&R&&X({...K,loggedin_user_id:a.id||!1,loggedin_company_id:i||!1,intranet_company_id:i||!1})},[a,R]);let setCleanForm=t=>{e.setUpdateCleanForm&&e.setUpdateCleanForm(t)};(0,r.useEffect)(()=>{setCleanForm(K)},[K]);let handleSubmit=t=>{t.preventDefault(),V(t);let a=getFormFieldsValues();L(a),H((t,a)=>{t||(x?Z(!0):function(t){if(t.preventDefault(),Z(!1),_(!0),u.credits>s.credits_left)return _(!1),c(!0),!1;let a=function(){let e=getFormUpdated();return X(e),{...e,answers:getFormFieldsValues(),...R}}();o.mJ.postForm(a).then(t=>{_(!1),T(!0),h&&B(!0),O&&a.name&&a.email&&(0,I.Q)({event:O,user_name:a.name,user_email:a.email,user_phone:null==a?void 0:a.phone,user_street:(null==a?void 0:a.street)||(null==a?void 0:a.address_street),user_city:(null==a?void 0:a.city)||(null==a?void 0:a.address_city),user_region:(null==a?void 0:a.state)||(null==a?void 0:a.address_state),user_zip_code:(null==a?void 0:a.zip_code)||(null==a?void 0:a.address_zip_code)}),e.setCaptureFormResult&&e.setCaptureFormResult(t.data),e.setCaptureFormValues&&e.setCaptureFormValues(a),e.onSubmit&&e.onSubmit({...a,response:t.data})}).catch(e=>{let t="Porfavor tente novamente";e.response?t=e.response.data.error:e.request?(alert(e.request),t="Algo deu errado"):t=e.message,_(!1),j.default.error({title:"Ups! algo deu errado",content:t,bodyStyle:{padding:20}})})}(P))})},et=g.filter(e=>void 0!==e.value.title).map(e=>[e.value.key,e.value.title]);if(et.map(e=>({field:e[1],value:N[e[0]]})),E&&!h){let e=(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:u.post_success}});return(0,n.jsx)(b.default,{status:"success",title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Y,{level:2,children:u.post_success_title}),(0,n.jsx)(Q,{style:{fontSize:"18px"},children:e})]}),extra:[m]})}let ea="";return"horizontal"==u.form_align&&(ea={labelCol:{span:7},wrapperCol:{offset:1,span:16}}),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(v.default,{id:"contact_form",layout:u.form_align,onSubmit:handleSubmit,...ea,onChange:e=>{setCleanForm(getFormUpdated())},children:[(0,n.jsx)(el,{form:d,formFields:u,formValue:K,setFormValue:X,GTMEventName:O,className:"spacing",disabled:M,clipboard:e.clipboard,aditionals:p}
1),!M&&(0,n.jsx)(v.default.Item,{style:{marginTop:"15px"},children:(0,n.jsx)(C.zx,{ref:ee,disabled:M||Object.keys(t=$()).some(e=>t[e])||y,htmlType:"submit",className:"submit",onClick:handleSubmit,loading:y,children:f||e.formFields.button_text})})]})})}),ei=a(15231),es=a(11163),ec=a.n(es),ed=a(57632);let{Step:eu}=h.default,ep=p()(()=>a.e(77983).then(a.bind(a,77983)),{loadableGenerated:{webpack:()=>[77983]}}),ef=(0,r.memo)(e=>{let t=(0,es.useRouter)(),a=t.query.model,{userRole:i,defaultCompanyId:d,defaultCompanyObject:u}=(0,r.useContext)(l.S),[p,v]=(0,r.useState)(!1),[j,b]=(0,r.useState)([]),[F,k]=(0,r.useState)(!1),[A,w]=(0,r.useState)(!0),[I,S]=(0,r.useState)([]),[P,V]=(0,r.useState)(!1),[N,L]=(0,r.useState)({}),[E,T]=(0,r.useState)(!1),[R,z]=(0,r.useState)(!1),[M,D]=(0,r.useState)(""),serializerProcess=e=>{D((0,n.jsx)(y.default,{color:"green",className:"small",children:e.cycles.length>0?e.cycles[e.cycles.length-1].title:""})),S(e),function(e){var t;let a=(t=e.documents)?t.filter(e=>null!==e.field_key):[];(0,_.Z)(e.id,F.form_id,"id,key,value").then(t=>{let n={...t,object_type:"MarketingProcess",object_id:e.id,model_id:F.id,files:a,company_id:d};L(n),w(!1)})}(e)};async function fetchData(){let e=await o.ApiPrivate.getMarketingModel(a,"id,title,form_id,stages,video_ask_url,access_category").then(e=>(k(e.data),b(e.data.stages),e.data)),t=await o.ApiPrivate.getMarketingProcessByCompanyIdAndModelId(d,e.id,"id").then(e=>!!e.data.meta.total_count&&e.data.items[0].id),n={object_type:"marketingProcess",object_id:t||(0,ed.Z)(),model_id:e.id,company_id:d};return(await o.eZ.getForm(e.form_id).then(e=>(v(e.data),e.data)),t)?(V(t),!0):(L(n),w(!1),!1)}if((0,r.useEffect)(()=>{P&&o.ApiPrivate.getMarketingProcess(d,P,"status,stage_id,finished_at,documents,form_locked,cycles,id").then(e=>{let t=e.data;serializerProcess(t)})},[P]),(0,r.useEffect)(()=>{u&&fetchData()},[u]),(0,r.useEffect)(()=>{i&&F&&F.access_category&&i&&!F.access_category.some(e=>i.includes(e))&&ec().push("/app/home","/app/home")},[i,F]),(0,r.useEffect)(()=>{E&&R&&o.mJ.postMarketingForm(R)},[E,R]),e.errorCode)return(0,n.jsx)(s(),{statusCode:e.errorCode});let q={progressDot:!0,current:0,direction:"vertical"};I.stage_id&&delete q.current;let B={resume:(0,n.jsxs)("div",{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:"check-circle",size:"lg"}),"Resumo"]}),form:(0,n.jsxs)("div",{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:"align-left",size:"lg"}),"Briefing"]}),reviews:(0,n.jsxs)("div",{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:"edit",size:"lg"}),"Sua revis\xe3o"]}),messages:(0,n.jsxs)("div",{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:"comment-dots",size:"lg"}),"Mensagens"]}),conclusion:(0,n.jsxs)("div",{children:[(0,n.jsx)(G.FontAwesomeIcon,{icon:"calendar-alt",size:"lg"}),"Conclus\xe3o"]})},Z=[{label:B.form,key:"form",show:!0,children:(0,n.jsx)(n.Fragment,{children:!A&&(0,n.jsxs)(n.Fragment,{children:[!E&&!I.cycles&&F.video_ask_url&&(0,n.jsx)(c.Z,{src:F.video_ask_url,allow:"camera *; microphone *; autoplay *; encrypted-media *; fullscreen *; display-capture *;",width:"100%",height:"600px",style:{border:"0px",backgroundColor:"transparent"},id:"iframeSection",frameBorder:0,allowtransparency:"true"}),(0,n.jsx)("br",{}),N&&p&&(0,n.jsx)(eo,{formFields:p,formParams:N,GTMEventName:"MarketingFormSent",setCaptureFormValues:z,setCaptureFormResult:T,disabled:I.form_locked})]})})},{label:B.reviews,key:"reviews",show:I&&I.id&&I.cycles.length,children:(0,n.jsx)(ep,{projectCycles:I.cycles?I.cycles:[]})},{label:B.messages,key:"messages",show:I&&I.id,children:(0,n.jsx)(ei.default,{object_id:I.id,company_id:d,content_type:"marketing.MarketingProcess",reply_url:t.asPath,disabled:"finished"===I.status})}];return(0,n.jsxs)("section",{className:"padding paddingTop50 notMobilePadding",children:[(0,n.jsx)("div",{className:"container",children:(0,n.jsx)(C.mr,{title:F.title?"".concat(F.title):"...",subTitle:u?M:"",avatar:{src:"/icons/certificate.svg"}})}),(0,n.jsxs)(m.default,{type:"flex",justify:"space-between",style:{textAlign:"left"},className:"centerDiv container",gutter:[{xs:0,sm:0,md:0,lg:50},20],children:[(0,n.jsx)(g.default,{xs:{span:24,order:2},sm:{span:24,order:2},md:{span:24,order:2},lg:{span:16,order:1},children:(0,n.jsx)(C.Card,{className:"noPadding",children:(0,n.jsx)(f.default,{active:!0,loading:A,paragraph:{rows:10},className:"padding-inner",children:(0,n.jsx)(x.default,{type:"card",className:"paddingTop20 centerTabs rounded-top centerTabsIcons bigtabs",items:Z.filter(e=>e.show)})})})}),(0,n.jsx)(g.default,{xs:{span:24,order:1},sm:{span:24,order:1},md:{span:24,order:1},lg:{span:8,order:2},className:"padding-inner",children:F&&(0,n.jsx)(h.default,{...q,children:j.map(e=>
1(0,n.jsx)(eu,{title:e.value.title,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:e.value.description}),(0,n.jsx)("br",{}),e.value.response_deadline&&(0,n.jsx)("span",{style:{fontSize:"12px",color:I.stage_id===e.id?"#f06":"-moz-initial",marginTop:"10px",fontWeight:"bold"},children:e.value.response_deadline})]}),className:I.stage_id&&I.stage_id!==e.id?"notMobile notTablet":I.stage_id?"":"notMobile notTablet",status:I.stage_id&&I.stage_id===e.id?"process":I.stage_id?"wait":""},e.id))})})]})]})});var em=(0,d.FR)(ef)},33391:function(e,t,a){"use strict";var n=a(6154);t.Z={SearchCep:e=>n.Z.get("https://viacep.com.br/ws/".concat(e,"/json/"))}},58754:function(e,t,a){"use strict";a.d(t,{CN:function(){return formatPhone},Cz:function(){return formatCPF},R4:function(){return formatCNPJ},UV:function(){return formatCPFCNPJ},VD:function(){return validateCNPJ},a$:function(){return validatePhone},aA:function(){return validateNineDigitPhone},gj:function(){return formatMonetary},kh:function(){return formatInteger},pM:function(){return validateCPF},rl:function(){return formatPercentage},sc:function(){return validateCPFCNPJ}});var n=a(91530);let formatPhone=e=>{let{value:t}=e.target,a=(0,n.gw)(t);return e.target.value=a,a},validatePhone=(e,t)=>new Promise((e,a)=>{t?(0,n.Mn)(t)?e():a("Telefone inv\xe1lido"):e()}),validateNineDigitPhone=(e,t)=>new Promise((e,a)=>{t&&(t.replace(/[^0-9]/g,"").length<11||!(0,n.Mn)(t))?a("Telefone inv\xe1lido"):e()}),cleanRegistryCode=e=>String(null!=e?e:"").replace(/[^0-9A-Za-z]/g,""),isCnpjInput=e=>{let t=cleanRegistryCode(e);return/[A-Za-z]/.test(t)||t.length>11},formatCPFCNPJ=e=>{let{value:t}=e.target,a=isCnpjInput(t)?(0,n.fC)(t):(0,n.zt)(t);return e.target.value=a,a},validateCPFCNPJ=(e,t,a)=>{if(t){if(isCnpjInput(t)){if(!(0,n.Co)(t))return a("CNPJ inv\xe1lido")}else if(!(0,n.h0)(t))return a("CPF inv\xe1lido")}a()},validateCPF=(e,t,a)=>{t&&!(0,n.h0)(t)&&a("CPF inv\xe1lido"),a()},formatCPF=e=>{let{value:t}=e.target,a=(0,n.zt)(t);return e.target.value=a,a},validateCNPJ=(e,t,a)=>{t&&!(0,n.Co)(t)&&a("CNPJ inv\xe1lido"),a()},formatCNPJ=e=>{let{value:t}=e.target,a=(0,n.fC)(t);return e.target.value=a,a},formatInteger=e=>e.target.value.toString().replace(/[^0-9]+/g,""),formatMonetary=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{value:a}=e.target,{empty:n=!1,locales:r="pt-BR",options:l={minimumFractionDigits:2}}=t,o=a&&"number"==typeof a?a.toFixed(2):a,i=function(e){let t=String(e),a=t.replace(/\D/g,""),n=a.replace(/^0+(?=\d)/,""),r=t.startsWith("-");return(r?"-":"")+n}(o),s=i.padStart(3,"0"),c=s.slice(-2),d=s.slice(0,s.length-2);if(n&&"0"===d&&"00"===c)return"";let u=new Intl.NumberFormat(r,l).format("".concat(d,".").concat(c));return u},formatPercentage=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{value:a}=e.target,{empty:n=!1,locales:r="pt-BR",options:l={minimumFractionDigits:1,minimumFractionDigits:2}}=t;"number"==typeof a&&(a=a.toFixed(2));let o=String(a).replace(/\D/g,"").replace(/^0+/g,""),i=o.padStart(2,"0"),s=i.slice(-2),c=i.slice(0,i.length-2);if(n&&"0"===c&&"00"===s)return"";let d=new Intl.NumberFormat(r,l).format("".concat(c,".").concat(s));return d}},5904:function(e,t,a){"use strict";var n=a(23636),r=a(93024),l=a(59417);n.vI.add(l.fkH,l.rtB,l.vJI,l.KfU,l.ctA,l.FR9,l.hVM,l.r6c,l.tAh,l.mRT,l.RLE,l.eHv,l.DL8,l.oD0,l.X5K,l.zBy,l.gSj,l.DL8,l.a3n,l.ihg,l.G_j,l.Mzg,l.qmU,l.Z6I,l.ySZ,l.rxY,l.NBC,l.nYk,l.nFo,l.I4f,l.aQp,l.Cv1,l.IJ7,l.uMC,l.diR,l.EyR,l.E9T,l.FU$,l.I7k,l.wn1,l._su,l.nGr,l.SZw,l.J9Y,l.yOZ,l.OGB,l.HXv,l.owJ,l.drw,l.tho,l.bhf,l.VdD,l.Mm7,l.Xcf,l.Ssp,l.fT7,l.fab,l.IV4,l.Ozh,l.egO,l.X8G,l.elf,l.Kd5,l.ntl,l.iGi,l.gLc,l.Stf,l.Xf_,l.zDS,l.olY,l.bJI,l.u8Q,l.f8k,l.uqx,l.r8p,l.t5N,r.VHX,l.U7t,l.dLO,l.xiG,l.Mzo,l.FGq,l.DOT,l.eW2,l.otv,l.XCy,l.P88,l.caW,l.cyx,l._Ob,l.Xjp,l.dLy,l.FpQ,l.byT,l.ILF,l.r$M,l.pL1,l.sA5,l.FVb,l._mi,l.bgy,l.brg,l.Geg,l.d0$,l.$Aj,l.jOV,l.TEX,l.enB,l.T07,l.SvR,l.$rF,l.L5M,l.Yjj,l.wDC,l.A8,l.Fuz,l.WKO,l.yOe,l.j1w,l.IA$,r.neY,r.opf,r.TM9,r.k9Y,r.D9H,r.Zzi,l.Tab,l.KtF,l.mTx,l.ptq,l.iV1,l.m08,l.sqG,l.$nv,l.nP8,l.JYN,l.IwR,l.cf$,l.q7m,l.l9f,l.kZ_,l.DH$,l.acZ,l.m6i,l.s2n,l.zlW,l.MZe,l.T70,l.tLL,l.co4,l.oFW,l.gMD,l.eFW,l.Alc,l.U
1a$,l.FKd,l.XKl,l.UXu,l.CmM,l.FKd,l._1v,l.XKl,l.jZZ)},97878:function(e,t,a){"use strict";a.d(t,{N:function(){return clipboardInput},e:function(){return clipboardCleanInput}});var n=a(5982);function clipboardInput(e){let t=document.getElementById(e);t&&(t.select(),navigator.clipboard.writeText(t.value))}function clipboardCleanInput(e){let t=document.getElementById(e);t&&(t.select(),navigator.clipboard.writeText((0,n.SD)(t.value)))}},96023:function(e,t,a){"use strict";var n=a(90008);let getAnswers=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=await n.eZ.getAnswers(e,t,a).then(e=>{let t=e.data.items,a=[];return Object.keys(t).map(e=>{let n=t[e].value;return t[e].value.includes("[")&&(n=n.replace(/[.*"+?^${}()|[\]\\]/g,"").split(", ")),"True"===n?n=!0:"False"===n&&(n=!1),a[t[e].key]=n,a}),a}).catch(e=>{});return r};t.Z=getAnswers},4670:function(e,t,a){"use strict";a.d(t,{FR:function(){return ProtectRoute},Ko:function(){return ProtectRouteAndCheckIfHasRoleAccess},Qx:function(){return ProtectRouteAndCheckIfIsEnterprise},Xy:function(){return AdminRoute},cS:function(){return ProtectRouteAndVerifyAnsweredICP},jr:function(){return ProtectRouteAndCheckIfHasIndicationAccess}});var n=a(85893),r=a(67294),l=a(39691),o=a(11163),i=a(89552),s=a(47041);let SpinLoader=()=>(0,n.jsx)(i.default,{size:"large",style:{margin:"60px auto 0px",padding:"70px",height:"100px",display:"table",textAlign:"center"}}),ComponentView=e=>{let{Component:t,user:a,className:r,componentProps:l}=e;return(0,n.jsx)("div",{className:"loggedIn_layout ".concat(r),children:(0,n.jsx)(t,{...arguments,user:a,...l})})};function ProtectRoute(e){return t=>{let{user:a,userLoading:i,logout:s,answeredICPform:c,isRegisterICPFeatureOn:d}=(0,r.useContext)(l.S),u=(0,o.useRouter)();return((0,r.useEffect)(()=>{if(a||i||(s(),u.push("/login?logout=true&back=".concat(u.asPath,"&as=").concat(u.route))),a&&!i&&a.is_blocked){let redirectToBlocked=async()=>{await u.push("/blocked?from=".concat(u.asPath)),s()};redirectToBlocked()}},[i,a]),!a||i)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:e,user:a,componentProps:t})}}function AdminRoute(e){return()=>{let{user:t,userLoading:a,logout:i}=(0,r.useContext)(l.S),s=(0,o.useRouter)();return((0,r.useEffect)(()=>{t||a||(i(),s.push("/login?logout=true&back=".concat(s.asPath,"&as=").concat(s.route))),t&&!t.is_staff&&s.replace("/app/home")},[a,t]),!t||a||t&&!t.is_staff)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:e,user:t})}}function ProtectRouteAndCheckIfIsEnterprise(e){return()=>{let{user:t,userLoading:a,defaultCompanyObject:i}=(0,r.useContext)(l.S),s=(0,o.useRouter)(),[c,d]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{t||a||s.push("/login?logout=true&back=".concat(s.asPath,"&as=").concat(s.route)),t&&i&&i.is_enterprise_customer&&s.push("/app/home"),i&&(i.access_roles.includes("legalizacao-b2b2b")||i.access_roles.includes("influencer")?d(!1):s.push("/app/home"))},[a,t,i]),c)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:e,user:t})}}function ProtectRouteAndCheckIfHasIndicationAccess(e){return()=>{let{user:t,userLoading:a,defaultCompanyObject:i}=(0,r.useContext)(l.S),s=(0,o.useRouter)(),[c,d]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{t||a||s.push("/login?logout=true&back=".concat(s.asPath,"&as=").concat(s.route)),t&&i&&i.is_enterprise_customer&&s.push("/app/home"),i&&(i.access_roles.includes("dashboard-cad")||i.access_roles.includes("influencer")?d(!1):s.push("/app/home"))},[a,t,i,s]),c)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:e,user:t})}}function ProtectRouteAndCheckIfHasRoleAccess(e){let{Component:t,roleList:a=[],logicalOperator:i="AND"}=e;return()=>{let{user:e,userLoading:s,defaultCompanyObject:c}=(0,r.useContext)(l.S),d=(0,o.useRouter)(),[u,p]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{if(e||s||d.push("/login?logout=true&back=".concat(d.asPath,"&as=").concat(d.route)),e&&c&&c.is_enterprise_customer&&d.push("/app/home"),c){let e=a.map(e=>c.access_roles.includes(e)),t="AND"===i?e.every(e=>!!e):e.some(e=>!!e);t?p(!1):d.push("/app/home")}},[s,e,c,d]),u)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:t,user:e})}}function ProtectRouteAndVerifyAnsweredICP(e){return t=>{let{user:a,userLoading:i,logout:c,answeredICPform:d}=(0,r.useContext)(l.S);(0,s.getCookie)("_aicpf");let u=(0,o.useRouter)();return((0,r.useEffect)(()=>
1{if(a||i||(c(),u.push("/login?logout=true&back=".concat(u.asPath,"&as=").concat(u.route))),a&&!i&&a.is_blocked){let redirectToBlocked=async()=>{await u.push("/blocked?from=".concat(u.asPath)),c()};redirectToBlocked()}},[i,a]),!a||i)?(0,n.jsx)(SpinLoader,{}):(0,n.jsx)(ComponentView,{Component:e,user:a,componentProps:t})}}},81713:function(e,t,a){"use strict";a.d(t,{T:function(){return l}});var n=a(6154),r=a(47041);let l={async setCsrf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.getCookie)(e,"csrftoken")||await n.Z.get("".concat("https://smartstore.herosvc.com","/csrf/")).then(t=>{(0,r.setCookie)("csrftoken",e,t.data.csrfToken,{sameSite:"lax"})})}}},5982:function(e,t,a){"use strict";function replaceAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function converToLowerCase(e){return e.toLowerCase()}function removeSpecialCaracter(e){return e.replace(/[^a-zA-Z ]/g,"")}function replaceWhiteSpace(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/ /g,"-")}function removeHtmlParagraph(e){return e?e.replaceAll("<p>","").replaceAll("</p>",""):""}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}a.d(t,{Rt:function(){return removeSpecialCaracter},SD:function(){return replaceAccents},Xz:function(){return replaceWhiteSpace},aI:function(){return converToLowerCase},fm:function(){return capitalizeFirstLetter},z9:function(){return removeHtmlParagraph}})}},function(e){e.O(0,[94976,97948,23636,25675,69843,97538,64713,73818,56590,74806,19317,28465,14321,94704,12802,71432,15231,49774,92888,40179],function(){return e(e.s=14969)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.