PageSourceSearch

https://app.stoqui.com.br/assets/FooterScreen-awIh27Ee.js

js stoqui.com.br collected 2026-09-24 11:58:01 UTC 6,816 bytes, 1 lines download raw bytes

1import{j as t,a7 as h,T as c,B as z,ab as x}from"./mui-CRsYZxVY.js";import{r as d}from"./vendor-Dwao9eNC.js";import{eD as g,eX as k,y as X,z as $,eY as E,e as J,dG as V,C as W,D as U,aD as Y,F as q}from"./index-TALscxEc.js";import{S as G}from"./SettingsScreenLayout-BWFwVJu5.js";import{u as K}from"./useWebCatalogSettingsSave-Byg91ItV.js";import{L as Q,M as Z,c as ee,d as te,e as oe,D as re,P as ne,T as ae,B as se,I as ie,a as le,b as de}from"./LocalizedRichTextEditor-DcQWzYKR.js";import{S as ce}from"./appearanceTokens-DaF_sGil.js";import"./query-8ViTdhdk.js";import"./datePickers-BIJXYOKG.js";import"./icons-D8aatgQ4.js";import"./lab-DSem1Osk.js";import"./UnsavedChangesDialog-gqy_t4YT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d3c39eab-36ee-4235-a88f-90648b4fa440",e._sentryDebugIdIdentifier="sentry-dbid-d3c39eab-36ee-4235-a88f-90648b4fa440")})()}catch{}const pe=[re,ne,ae,se,ie,le,de],ue=({value:e,onChange:o,onEditorReady:l,error:p,disabled:f})=>{const s=d.useRef(null);return d.useEffect(()=>{var r;l(((r=s.current)==null?void 0:r.editor)??null)},[l]),t.jsxs(h,{children:[t.jsx(Q,{ref:s,sx:{borderRadius:2,backgroundColor:"white",'& [class*="notchedOutline"]':{borderRadius:r=>`${r.shape.borderRadius*2}px !important`},"& .ProseMirror":{minHeight:"180px",maxHeight:"360px",overflowY:"auto",padding:"12px",fontSize:"0.9375rem",lineHeight:1.55,"&:focus":{outline:"none"},"& p:first-of-type":{mt:0},"& p:last-child":{mb:0},"& ul, & ol":{paddingLeft:"1.25rem",margin:0}}},extensions:pe,content:e||"",onUpdate:({editor:r})=>{const y=r.getHTML(),m=g(y);o(m)},renderControls:r=>t.jsxs(Z,{children:[t.jsx(ee,{tooltipLabel:r("bold")}),t.jsx(te,{tooltipLabel:r("italic")}),t.jsx(oe,{tooltipLabel:r("bulletList")})]}),editable:!f}),p&&t.jsx(c,{variant:"caption",color:"error",sx:{mt:1,display:"block",px:1.5},children:p})]})},fe=({icon:e,label:o,description:l,trailing:p,onClick:f,disabled:s})=>t.jsx(z,{onClick:f,disabled:s,focusRipple:!0,sx:{width:"100%",bgcolor:"white",borderRadius:2,px:1.75,py:1.25,justifyContent:"flex-start",textAlign:"left",transition:"transform 0.1s","&:active":{transform:"scale(0.995)"},"&.Mui-disabled":{opacity:.6}},children:t.jsxs(x,{direction:"row",alignItems:"center",spacing:1.5,sx:{width:"100%"},children:[t.jsx(h,{sx:{width:32,height:32,borderRadius:"8px",bgcolor:"primary.50",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),t.jsxs(x,{spacing:.25,sx:{minWidth:0,flex:1},children:[t.jsx(c,{variant:"body2",sx:{fontWeight:600,lineHeight:1.3},children:o}),t.jsx(c,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.3},children:l})]}),p]})}),_=e=>(e||"").replace(/\D/g,""),xe=e=>_(e).length===14,me=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),be=[{id:"hours",label:"Horário de atendimento",description:"Segunda a sexta, sábado e domingo",build:()=>"<p><strong>Horário de atendimento</strong></p><ul><li>Segunda a sexta: 9h às 18h</li><li>Sábado: 9h às 13h</li><li>Domingo: fechado</li></ul>"},{id:"address",label:"Endereço da loja",description:"Onde você está, para o cliente saber",build:()=>"<p><strong>Onde estamos</strong></p><p>Rua, número - Bairro, Cidade/UF - CEP</p>"},{id:"returns",label:"Política de troca",description:"Prazo de 7 dias e como solicitar",build:()=>"<p><strong>Trocas e devoluções</strong></p><p>Você tem até 7 dias após o recebimento para solicitar troca ou devolução. Entre em contato pelos canais abaixo e nossa equipe vai te ajudar.</p>"},{id:"payment",label:"Formas de pagamento",description:"PIX, cartão de crédito e boleto",build:()=>"<p><strong>Formas de pagamento</strong></p><ul><li>PIX</li><li>Cartão de crédito em até 12x</li><li>Boleto bancário</li></ul>"},{id:"cnpj",label:"CNPJ",description:"Obrigatório para fiscal e confiança",build:e=>{const o=e==null?void 0:e.cpf_cnpj;return o&&xe(o)?`<p>${e!=null&&e.nome_loja?`${me(e.nome_loja)} - `:""}CNPJ ${k(_(o))}</p>`:"<p>CNPJ: 00.000.000/0000-00</p>"}}],b=650,he=X({texto_rodape:$().nullable().transform(e=>e?g(e):null).test("max-text-length","Máximo 650 caracteres",e=>e?E(e)<=b:!0)}),Pe=()=>{const{catalog:e,isLoading:o,save:l}=K(),{data:p}=J(),f=V(p),[s,r]=d.useState(!1),[y,m]=d.useState(null),[u,L]=d.use
1State(null),{control:I,handleSubmit:P,reset:v,watch:R,formState:{errors:B,isDirty:D}}=W({resolver:q(he),defaultValues:{texto_rodape:""}}),M=e==null?void 0:e.id;d.useEffect(()=>{e&&v({texto_rodape:e.texto_rodape||""})},[M]);const C=R("texto_rodape")||"",j=d.useMemo(()=>E(C),[C]),S=j>b,T=j>b*.9,N=S?"error.main":T?"warning.main":"text.secondary",H=n=>{if(!u)return;const a=g(n);if(!a)return;if(E(u.getHTML())===0)u.chain().focus().setContent(a,!0).run();else{const i=u.state.doc.content.size;u.chain().focus(i).insertContentAt(i,a).run()}},O=n=>{H(n.build(e))},A=()=>new Promise((n,a)=>{P(async w=>{if(S){a(new Error("over limit"));return}m(null),r(!0);try{const i=g(w.texto_rodape??"");await l({texto_rodape:i},"appearance_footer"),v({texto_rodape:i}),n()}catch(i){m("Não foi possível salvar. Tente novamente."),a(i instanceof Error?i:new Error("save failed"))}finally{r(!1)}},()=>a(new Error("validation failed")))()}),F=!o&&!f?{plan:"lite",trigger:"footer_text"}:void 0;return t.jsx(G,{title:"Texto do rodapé",isLoading:o,isDirty:D&&!S,isSaving:s,onSave:A,saveError:y,lock:F,children:t.jsxs(x,{spacing:2.5,children:[t.jsx(c,{variant:"caption",color:"text.secondary",sx:{px:.5},children:"Aparece no rodapé da sua loja. Use para horários, endereço, CNPJ, política de troca e canais de contato."}),t.jsxs(h,{children:[t.jsx(U,{name:"texto_rodape",control:I,render:({field:n})=>{var a;return t.jsx(ue,{value:n.value||"",onChange:n.onChange,onEditorReady:L,error:(a=B.texto_rodape)==null?void 0:a.message,disabled:s})}}),t.jsx(x,{direction:"row",justifyContent:"flex-end",sx:{mt:.75,px:.5},children:t.jsxs(c,{variant:"caption",sx:{color:N,fontWeight:T?600:400,fontVariantNumeric:"tabular-nums"},children:[j.toLocaleString("pt-BR")," /"," ",b.toLocaleString("pt-BR")]})})]}),t.jsxs(h,{children:[t.jsx(c,{sx:ce,children:"Modelos prontos"}),t.jsx(c,{variant:"caption",color:"text.secondary",sx:{display:"block",px:.5,mb:1.25},children:"Toque para adicionar ao rodapé. Edite o texto à vontade."}),t.jsx(x,{spacing:1,children:be.map(n=>t.jsx(fe,{icon:t.jsx(Y,{size:18}),label:n.label,description:n.description,onClick:()=>O(n),disabled:s||!u},n.id))})]})]})})};export{Pe as default};

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.