1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[22],{70022:(e,l,a)=>{a.r(l),a.d(l,{RelationshipComponent:()=>_});var t=a(9170),o=a(83270),s=a(82822),n=a(12526),c=a(33402),i=a(57799),r=a(46024),u=a(37121),d=a(69541),p=a(68406),b=a(99486),h="lexical-relationship",m={depth:0},v=e=>{var l,a,v;let{data:{relationTo:_,value:g},nodeKey:f}=e;if("object"==typeof g)throw Error("Relationship value should be a string or number. The Lexical Relationship component should not receive the populated value object.");let x=(0,b.useRef)(null),[j]=(0,c.DF)(),{fieldProps:{readOnly:w}}=(0,s.b)(),{config:{routes:{api:N},serverURL:C},getEntityConfig:R}=(0,r.b)(),[k]=(0,b.useState)(()=>R({collectionSlug:_})),{i18n:y,t:D}=(0,u.d)(),[E,S]=(0,b.useReducer)(e=>e+1,0),[{data:B},{setParams:P}]=(0,d.usePayloadAPI)("".concat(C).concat(N,"/").concat(k.slug,"/").concat(g),{initialParams:m}),{closeDocumentDrawer:T,DocumentDrawer:A,DocumentDrawerToggler:K}=(0,o.a)({id:g,collectionSlug:k.slug}),L=(0,b.useCallback)(()=>{j.update(()=>{var e;null==(e=(0,p.nsf)(f))||e.remove()})},[j,f]),F=b.useCallback(()=>{P({...m,cacheBust:E}),T(),S()},[E,P,T]);return(0,n.jsxs)("div",{className:h,contentEditable:!1,ref:x,children:[(0,n.jsxs)("div",{className:"".concat(h,"__wrap"),children:[(0,n.jsx)("p",{className:"".concat(h,"__label"),children:D("fields:labelRelationship",{label:(null==(l=k.labels)?void 0:l.singular)?(0,i.s)(null==(a=k.labels)?void 0:a.singular,y):k.slug})}),(0,n.jsx)(K,{className:"".concat(h,"__doc-drawer-toggler"),children:(0,n.jsx)("p",{className:"".concat(h,"__title"),children:B?B[(null==k||null==(v=k.admin)?void 0:v.useAsTitle)||"id"]:g})})]}),j.isEditable()&&(0,n.jsxs)("div",{className:"".concat(h,"__actions"),children:[(0,n.jsx)(d.Button,{buttonStyle:"icon-label",className:"".concat(h,"__swapButton"),disabled:w,el:"button",icon:"swap",onClick:()=>{f&&j.dispatchCommand(t.a,{replace:{nodeKey:f}})},round:!0,tooltip:D("fields:swapRelationship")}),(0,n.jsx)(d.Button,{buttonStyle:"icon-label",className:"".concat(h,"__removeButton"),disabled:w,icon:"x",onClick:e=>{e.preventDefault(),L()},round:!0,tooltip:D("fields:removeRelationship")})]}),!!g&&(0,n.jsx)(A,{onSave:F})]})},_=e=>(0,n.jsx)(v,{...e})}}]);
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.