1"use strict";(self.rspackChunk_pathwright_mainclient=self.rspackChunk_pathwright_mainclient||[]).push([["id"],{J0(e,n,l){l.r(n);var r=l("r"),i=l("B"),o=l("PT"),a=l("ze"),t=l("e"),c=l("Nw"),s=l("ag"),d=l("zuE"),p=l("HH"),h=l("d8"),u=l("dE6"),x=l("M7"),v=l("Mn"),k=l.n(v),b=l("p8i"),g=l("zh"),m=l("qD"),j=l("sX"),y=l("Zh"),C=l("uh8"),f=l("Ocn"),w=l("Wmu"),S=l("nN"),z=l("C"),T=l.n(z),E=l("dx"),_=l("ms"),A=l("fS");let $=e=>{let{errorMessage:n,user:l,school:r}=e,{display_name:i="",email:o=""}=l||{},{name:a=""}=r||{};return"Hello Pathwright team,\n\nI encountered an error in a block in ".concat(a," at ").concat(window.location.href," and would like your help resolving it.\n\nError message:\n").concat(n,"\n\nThanks,\n").concat(i,"\nAccount: ").concat(o,"\n")},D=e=>{let{block:n,blockType:l,allowEdit:v,onSave:w}=e,{open:z,onOpen:T,onClose:A}=(0,a.j)(),[$,D]=(0,E.useState)(n),[B,H]=(0,E.useState)(!1),[N,O]=(0,E.useState)(null),q=(0,g.fk)(e=>e.blockTypes),P=(0,E.useRef)(null),F=n.type?(0,b.T3)(n.type,q):null;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.$,{variant:"plain",colorPalette:"orange",cursor:"pointer",bg:"transparent",_hover:{opacity:"0.8",backgroundColor:"transparent"},onClick:T,size:"md",children:[(0,o.jsx)(m.A,{}),"Fix Block data"]}),(0,o.jsxs)(c.Dz,{placement:"center",size:"xl",onOpenChange:e=>!e.open&&A(),open:z,children:[(0,o.jsx)(c.Xi,{}),(0,o.jsxs)(c.Cf,{maxH:"90vh",overflowY:"auto",children:[(0,o.jsx)(c.c7,{children:"Block data"}),(0,o.jsx)(c.tK,{}),(0,o.jsx)(c.R4,{css:{"& .copy-to-clipboard-container":{display:"inline-block !important",visibility:"hidden"},"& .react-json-view:hover":{".copy-to-clipboard-container":{visibility:"visible"}},"& .copy-to-clipboard-container > span > span":{display:"inline-flex"},"& .copy-to-clipboard-container > span > span > span:last-of-type":{marginLeft:"0px !important"},"& .variable-row, & .variable-value, & .variable-value textarea":{width:"100%",lineHeight:"1.4"},"& .variable-row, & .variable-row > span, & .variable-value > div":{display:"flex"},"& .copy-icon svg":{fontSize:"18px !important"},"& .expanded-icon svg, & .collapsed-icon svg":{fontSize:"16px !important"},"& .click-to-edit-icon, & .edit-cancel, & .edit-check":{display:"none"}},children:N&&F?(0,o.jsxs)(S.A,{catchLoadingChunkFailures:!1,renderError:e=>(0,o.jsxs)(s.T,{children:[(0,o.jsx)(d.D,{size:"sm",mb:4,children:"This block still has errors."}),(0,o.jsx)(p.C,{maxW:"100%",maxH:"300px",overflow:"auto",children:JSON.stringify(e,null,2)}),(0,o.jsx)(t.$,{onClick:()=>{O(null)},children:"Try again"})]}),children:[(0,o.jsx)(h.E,{children:"The block seems to be working correctly."}),(0,o.jsx)(u.$U,{my:4,maxW:"100%",children:(0,o.jsx)(_.A,{block:N,blockIndex:n.order||0,blockType:F,onChange:()=>{}})}),(0,o.jsx)(t.$,{onClick:()=>{w($),O(null),A()},mr:2,children:"Save changes"}),(0,o.jsx)(t.$,{onClick:()=>{O(null)},children:"Keep editing"})]}):(0,o.jsxs)(s.T,{ref:P,align:"stretch",children:[(0,o.jsx)(h.E,{textStyle:"xxs",fontWeight:"400",mb:4,children:"Edit this block's content at your own risk. You will have a chance to preview the block before saving it."}),(0,o.jsx)(x.z,{gap:4,children:B?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.$,{variant:"plain",onClick:()=>{var e;let n=null==(e=P.current)?void 0:e.querySelector(".edit-check");n&&n.click(),H(!1)},children:[(0,o.jsx)(j.A,{size:"1.2em"}),"Save"]}),(0,o.jsxs)(t.$,{variant:"plain",onClick:()=>{var e;let n=null==(e=P.current)?void 0:e.querySelector(".edit-cancel");n&&n.click(),H(!1)},children:[(0,o.jsx)(y.A,{size:"1.2em"}),"Cancel"]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.$,{variant:"plain",onClick:()=>{var e;let n=null==(e=P.current)?void 0:e.querySelector(".click-to-edit > span");n&&n.click(),H(!0)},children:[(0,o.jsx)(C.A,{size:"1.2em"}),"Edit"]}),(0,o.jsxs)(t.$,{variant:"plain",onClick:()=>{O($)},children:[(0,o.jsx)(f.A,{size:"1.2em"}),"Preview"]})]})}),(0,o.jsx)(k(),{displayDataTypes:!1,displayObjectSize:!1,quotesOnKeys:!1,theme:"rjv-default",iconStyle:"triangle",name:null,collapsed:1,src:$.data,enableClipboard:e=>{var n,l;(null==(l=navigator)||null==(n=l.clipboard)?void 0:n.writeText)&&navigator.clipboard.writeText(JSON.stringify(null==e?void 0:e.src))},onEdit:v?e=>{let n=(0,i._)((0,r._)({},$),{data:(0,r._)({},e.updated_src)});D(n),O(n)}:void 0})]})})]})]})]})},B=e=>{let{error:n,block:l,allowEdit:i,blockType:a,onFixedBlock:c}=e,{isSuperuser:d,openSupportRequest:u,templateVariables:v}=(0,g.cF)(),k=(0,g.fk)(e=>e.deleteBlockID),b=(0,g.fk)(e=>e.handleBlockDelete),m=(0,g.fk)(e=>e.handleCancelBlockDelete),j=(0,g.fk)(e=>e.handleBlockChange),C=k===l.id,f=n.stack?JSON.stringify(n.stack):JSON.stringify(n),{user:S,school:z}=v||{};return(null==l?void 0:l.id)&&S&&z?(0,o.jsxs)(s.T,{px:5,py:5,border:"2px s
1olid",borderColor:"red.300",pos:"relative",children:[C&&(0,o.jsx)(A.A,{onCancel:()=>{var e;return null==m?void 0:m(Number((null!=(e=l.order)?e:1)-1))},onDelete:()=>null==b?void 0:b(l.id)}),(0,o.jsxs)(s.T,{maxW:"sm",children:[(0,o.jsx)(h.E,{my:0,children:"The content in this block caused the following error."}),(0,o.jsx)(p.C,{px:2,my:0,color:"gray.500",lineClamp:2,children:f})]}),(0,o.jsxs)(s.T,{children:[(0,o.jsx)(h.E,{mt:4,mb:0,children:"How would you like to proceed?"}),(0,o.jsxs)(x.z,{gap:4,children:[d?(0,o.jsx)(D,{block:l,allowEdit:i,blockType:a,onSave:e=>{j&&(null==j||j((0,r._)({},l.data,e.data),l.id),c())}}):(0,o.jsxs)(t.$,{variant:"plain",colorPalette:"gray",cursor:"pointer",bg:"transparent",_hover:{opacity:"0.8",backgroundColor:"transparent"},onClick:e=>{e.preventDefault(),u?u({message:$({errorMessage:null==n?void 0:n.message,user:S,school:z}),error:(null==n?void 0:n.message)||""}):window.open((e=>{let{errorMessage:n,user:l,school:r}=e,i=$({errorMessage:n,user:l,school:r}),o="Block error in ".concat(r.name);return"mailto:".concat("[email protected]","?subject=").concat(encodeURIComponent(o),"&body=").concat(encodeURIComponent(i))})({errorMessage:null==n?void 0:n.message,user:S,school:z}))},size:"md",children:[(0,o.jsx)(w.A,{}),"Send to Pathwright Support"]}),(0,o.jsxs)(t.$,{variant:"plain",colorPalette:"red",color:"rgb(255, 0, 0)",bg:"transparent",_hover:{opacity:"0.8",backgroundColor:"transparent"},onClick:()=>null==b?void 0:b(l.id),cursor:"pointer",size:"md",children:[(0,o.jsx)(y.A,{color:"rgb(255, 0, 0)",size:"1.2em"}),"Delete block"]})]})]})]}):null};B.displayName="BlockErrorHandler",B.propTypes={error:T().object.isRequired,block:T().object.isRequired,allowEdit:T().bool},n.default=B}}]); 2//# sourceMappingURL=BlockErrorHandler.70fcd9e950.js.map
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.