PageSourceSearch

https://portals.noloco.io/assets/RecordDetails-1PLNuA9d.js

js noloco.io collected 2026-10-03 21:23:04 UTC 10,287 bytes, 1 lines download raw bytes

1import{j as e}from"./jsx-runtime-esm-DkAt4wbo.js";import{a9 as ke,p as ze,aG as Ge,a_ as We,a$ as ie,b0 as He,g as N,aN as Ue,b1 as Xe,a3 as de,c as Ke,R as Ye,i as qe,b2 as ce,e as pe,d as I,F as Je,b3 as Qe,q as Ze,r as es,a7 as ss,$ as as,b4 as ts,b5 as ns,b6 as ls,S as os,aM as rs,h as is,y as ds,ar as cs}from"./Icon-oGravVff.js";import{at as ps,au as us,R as ue,av as me,aw as ms,ax as xe,ay as fe,az as Ie,m as M,g as xs,aA as fs,l as be,aB as bs,n as ys,s as gs,aC as Es,A as hs,M as Ss,aD as Is,aE as ye,aF as js,F as Cs}from"./app-x6fDPxye.js";import{u as Ns}from"./useAuthWrapper-BfiReOjv.js";import{n as _s,o as ws,d as ge,I as Rs,a as je,e as vs,f as As}from"./tabs-BBTGYUlo.js";import{a as E}from"./index-ByLmqo6e.js";import{L as Ee}from"./isEqual-DlV9wj1O.js";import{D as he,a as Fs,g as Ts,b as Ms,B as Ds,F as Os,c as Ls}from"./index-Cbqy7Iw-.js";import{B as Ps}from"./BlockContentCard-ByGP-cHM.js";import{B as $s}from"./BlockContentHeader-DxATyAIj.js";import{C as Bs}from"./CollapsibleSectionBody-ByNweMZZ.js";import{u as Vs}from"./useSectionCollapse-yrS24FCr.js";import{R as ks}from"./RecordEmptyState-BnTpy9bo.js";import"./index-ByInV43t.js";import"./_commonjsHelpers-yjRi3dfI.js";import"./index-BXXzNVct.js";import"./react-redux-YN15yk5j.js";import"./with-selector-CogykupQ.js";import"./project-DLQ_xSEO.js";import"./user-avatar-DDG4jDfk.js";import"./normalizeDates-zLvF6tl8.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"5ee2174"},n._sentryModuleMetadata=n._sentryModuleMetadata||{},n._sentryModuleMetadata[new n.Error().stack]=(function(p){for(var s=1;s<arguments.length;s++){var r=arguments[s];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(p[i]=r[i])}return p})({},n._sentryModuleMetadata[new n.Error().stack],{"_sentryBundlerPluginAppKey:noloco-ui":!0});var a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="dc08bd38-ad1a-4756-8473-3f1eef87d61e",n._sentryDebugIdIdentifier="sentry-dbid-dc08bd38-ad1a-4756-8473-3f1eef87d61e")}catch{}})();const zs=({dataTypes:n,field:a,project:p,value:s})=>{const r=_s(),{relatedField:i,relationship:g,type:u}=a;if(u===ke&&s){const t=ze(a),l=t?s.edges.map(h=>h.node):s?[s]:[],{fileType:f,name:V,url:b}=s;return f===Ge?e.jsx("img",{alt:V,className:"mx-auto w-14 overflow-hidden rounded",src:b}):e.jsx(ps,{files:l,id:a.name,isMultiple:t,readOnly:!0})}if(u==="membership"&&s&&s.plan){const{stripe:t}=p.integrations,l=t&&t.plans.find(({id:f})=>f===s.plan.id);if(l)return e.jsx("a",{className:"flex items-center rounded-md bg-pink-700 px-2 py-1",href:`https://dashboard.stripe.com/${s.subscriptionId?"subscriptions":"prices"}/${s.subscriptionId||l.priceId}`,rel:"noopener noreferrer",target:"_blank",children:l.name})}if(We(a))return e.jsx(us,{className:"w-full flex-wrap rounded-sm p-1 hover:bg-muted",field:a,recordLinkRoot:`/_/data/internal/${a.type}`,value:s});if(i&&ie(i.relationship)||He(g)){const t=N(s,"edges.length",0);return e.jsxs("div",{className:"-ml-1.5 -mt-1.5 flex flex-wrap",children:[e.jsx("div",{className:"inline-block",children:e.jsx(ws,{className:"m-1 inline-block",color:"pink-900",children:e.jsx("div",{className:"py-1",children:t})})}),N(s,"edges",[]).map(l=>e.jsx("div",{className:"m-1 inline-block",children:e.jsx(Ee,{className:"flex items-center rounded-md bg-pink-700 p-1",onClick:f=>f.stopPropagation(),to:`/_/data/internal/${a.type}/view/${l.node.id}`,children:e.jsx(ue,{dataTypes:n,field:a,single:!0,value:l.node})})},l.node.id))]})}if(g||i&&!ie(i.relationship))return!s||!s.uuid?null:e.jsx("div",{className:"-mt-0.5 inline-block",children:e.jsx(Ee,{className:"flex items-center rounded-md bg-pink-700 p-1",onClick:t=>t.stopPropagation(),to:`/_/data/internal/${a.type}/view/${s.id}`,children:e.jsx(ue,{dataTypes:n,field:a,value:s})})});if(a.type===Ue){const t=a.options.find(({name:l})=>l===s);if(t)return e.jsx(me,{badgeStyle:a.typeOptions?.badgeStyle,className:"-mt-0.5 mr-auto",option:t})}if(a.type===Xe){const t=de(s).map(l=>a.options.find(({name:f})=>
1f===l)).filter(Boolean);return e.jsx("div",{className:"-ml-1.5 -mt-1.5 flex flex-wrap gap-1",children:t.map(l=>e.jsx(me,{badgeStyle:a.typeOptions?.badgeStyle,option:l},l.name))})}return a.name==="id"?s:Ke(a)===Ye?e.jsx(ms,{disabled:!0,maxRating:N(a.typeOptions,"max"),value:s}):qe(s)?null:a.multiple?e.jsx("div",{className:"flex flex-wrap gap-1",children:de(s).map((t,l)=>a.type===ce?e.jsx(xe,{surface:pe,value:t?e.jsx(ge,{size:20}):e.jsx(Rs,{size:20})},`${a.name}-${t}`):e.jsx(xe,{surface:pe,value:fe(t,a,{},r)},`${t}-${l}`))}):u===ce?s?e.jsx(ge,{size:18}):"-":fe(s,a,{},r)},Gs=({config:n,field:a,htmlFor:p,label:s,required:r})=>{const[i]=je(),g=i?M.text.secondary:"text-stone-500",u=n.showFieldIcon,t=u?Ie(a):null;return e.jsxs("label",{className:I("font-medium",n.hasBlockChrome&&n.isStacked?"text-base":"text-xs",g,u&&"inline-flex items-center gap-2"),htmlFor:p,children:[t&&e.jsx(t,{size:16}),e.jsx("span",{children:s}),r&&!n.readOnly&&e.jsx("span",{className:"ml-px opacity-75",children:"*"})]})},C=n=>n.columnWidth||n.columnSpan*4,Ws=[],Hs=[],Us={},Se=()=>{};function Xs({backLink:n,columns:a,rootDataType:p,parentMergedScope:s,project:r,record:i,transformRecordScope:g,valuePrefix:u,field:t,config:l,permissions:f}){return()=>e.jsx(Cs,{backLink:n,className:"flex flex-col",columns:a,config:l,dataType:p,field:t,layout:ds,mergedScope:s,permissions:f,project:r,readOnly:!0,record:i,section:!0,showInput:!1,showLabel:!1,transformScope:g,value:N(i,[...u,t.name])},t.name)}const ga=({actionButtons:n,backLink:a,columns:p,dataType:s,editorMode:r=!1,elementPath:i=Ws,fields:g=Hs,rootPathname:u="",project:t,isEditingData:l=!1,onLoadingChange:f,onError:V=Se,record:b,mergedScope:h=Us,rootField:_,subtitle:Ce,title:Ne,sectionId:_e="",recordScope:Y,sectionWidth:S,toggleSectionExpandedState:we=Se,isExpanded:Re={},isModal:ve=!1,collapsable:Ae,layout:Fe,maxHeight:q,spacing:Te,dividers:Me,fieldIcons:J,hasBlockChrome:c,contentCap:De})=>{const d=(Fe??he.FLEX_WRAP)===he.STACKED_LIST,Q=d&&Me!==Fs.HIDE,D=c&&!d,Z=d?Ms:D?Ds:Os,ee=Z[Te]??Z.M,k=q?Ls[q]:void 0,{user:O}=Ns(),{push:z}=xs(),Oe=fs(),L=be(Je),se=be(Qe),[P]=je(),Le=bs(),{actionButtons:G,title:w,subtitle:j,collapsable:R}=ys(es,{actionButtons:n,title:Ne,subtitle:Ce,collapsable:Ae},t,i,Y,gs([Ze])),v=E.useMemo(()=>ss(_,s,t.dataTypes),[s,t.dataTypes,_]),A=E.useMemo(()=>as(g,v,O,t.dataTypes,L),[L,g,t.dataTypes,v,O]),y=E.useMemo(()=>_&&s.fields.getByName(_),[s.fields,_]),W=E.useMemo(()=>y?[y.name]:[],[y]),H=E.useCallback(m=>({...h,...m}),[h]),ae=!!S&&S<=6,$=E.useMemo(()=>{const m=D?Ts(A,S):[];return A.map(({field:x,config:o,permissions:re},Be)=>({field:x,config:{...Es(x,t,O,L,o),...d&&{orientation:"horizontal"},hasBlockChrome:c,isStacked:d,showFieldIcon:c?!!J&&!!Ie(x):x&&ls(x),className:d?"py-2":D?m[Be]:I("md:col-span-1",{"col-span-3 lg:col-span-6":C(o)===3||!o.columnWidth&&!o.columnSpan&&S!==6,"col-span-6 lg:col-span-12":!o.columnWidth&&!o.columnSpan&&S===6,"col-span-4 lg:col-span-6":C(o)===4,"col-span-6":C(o)===6,"col-span-8 lg:col-span-12":C(o)===8,"col-span-9 lg:col-span-12":C(o)===9,"col-span-12":C(o)===12||!o.columnWidth&&!o.columnSpan&&S===3,"lg:col-span-12":ae}),label:o.label&&!o.label.hidden&&o.label.value,readOnly:!re.update||x.readOnly||o.elementType===ts?!0:!l&&o.editInline?!ns(o,se,Ve=>cs(Ve,h,t)):!l&&!o.editInline,ReadOnlyCell:Xs({backLink:a,columns:p,config:o,field:x,parentMergedScope:h,permissions:re,project:t,record:b,rootDataType:v,transformRecordScope:H,valuePrefix:W})}}))},[A,t,O,L,S,ae,d,l,a,p,v,b,W,H,se,h,J,c,D]),Pe=E.useCallback(m=>y?{...b,[y.name]:m}:m,[b,y]),U=G&&G.filter(Boolean).length>0,F=!!(w&&w.value&&w.value!==""),X=!!(j&&!j.hidden&&j.value&&j.value!==""),{isSectionExpanded:T,showToggle:B,handleToggle:te}=Vs({sectionId:_e,collapsable:R,hasTitle:F,isExpanded:Re,toggleSectionExpandedState:we,defaultExpanded:!!c}),ne=F||X||U,le=$.length>0||F||X,$e=E.useCallback((m,x)=>{a&&a.enabled?z(a.to??u):z(u),x()},[a,z,u]),K=E.useMemo(()=>(!R||R&&T)&&$.length>0,[R,T,$]);if(!le&&!r)return null;if(!le&&r)return e.jsx(ks,{});const oe=U?G.filter(Boolean).map((m,x)=>e.jsx(hs,{actionButton:m,buttonClassName:c?"h-7 gap-1 px-2 text-[13px] shadow-xs":void 0,dataType:s,editorMode:r,index:x,onDeleteRecord:$e,project:t,record:b,recordScope:Y,size:c?os:void 0},m.id)):null;return e.jsxs("div",{className:I("flex flex-col rounded-lg text-sm",{[`${M.surfaces.elevation1} ${M.borders.one}`]:!c&&P,"border-stone-200 bg-white":!c&&!P,"border shadow-md":!ve&&!c}),"data-testid":"details-section",children:[c&&ne&&e.jsx($s,{className:"px-3 py-1.5",isDarkModeEnabled:P,isExpanded:T,onToggleCollapse:B?te:void 0,showCollapseIcon:B,subtitle:T?j:{hidden:!0},title:w,children:oe}),!c&&ne&&e.jsxs("div",{className:I(`flex flex-col p-6 ${R?"hover:cursor-pointer":""}`,P?`${M.surfaces.elevation1} ${M.borders.one}`:"bg-stone-50",{"rounded-lg":!K,"rounded-t-lg border-b":K}),onClick:B?te:void 0,children:[e.jsxs("div",{className:"flex w-full max-w-full items-start justify-between sm:flex-wrap sm:gap-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[B&&(T?e.jsx(vs,{size:16}):e.jsx(As,{size:16})),F&&e.jsx("h2",{className:"text-2xl font-medium sm:overflow-visible sm:whitespace-normal",children:w.value})]}),U&&e.jsx("div",{className:"ml-auto flex flex-wrap items-center justify-end gap-2",children:oe})]}),X&&e.jsx("div",{className:I("w-full",{"mt-2":F}),children:e.jsx(Ss,{disabledHeadings:!1,children:j.value})})]}),e.jsx(Bs,{isExpanded:K,children:e.jsx(Is,{dataType:v,fields:$,formatRecordScope:Pe,inline:!1,Label:Gs,mutationType:rs,onError:m=>{m instanceof js||Le(is("project.errors.generic")),V()},onErrorResetFormFieldValues:!0,onLoadingChange:f,ReadOnlyCell:zs,readOnly:!!y&&!N(b,[y.name,"id"]),submitOnBlur:!0,surface:Oe,transformRecordScope:H,value:y?N(b,y.name):b,valuePrefix:W,children:c?e.jsx(Ps,{cap:De,scrollsWhenCapped:!0,children:e.jsx(ye,{className:I("p-4",ee,{"grid md:grid-cols-1":!d,"grid-cols-12":!d&&A.length>0,"flex flex-col":d,"divide-y divide-border":Q})})}):e.jsx(ye,{className:I("px-6",ee,{"grid md:grid-cols-1":!d,"gap-x-4":!d,"grid-cols-12":!d&&A.length>0,"flex flex-col":d,"divide-y divide-border":Q,[k]:!!k,"overflow-y-auto":!!k})})})})]})};export{ga 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.