2025-04-16 13:14:56 +08:00
import { S as $t , i as Mt , s as St , V as Ot , X as se , W as Ct , h as o , d as ge , t as _e , a as he , I as ee , Z as Ue , _ as bt , C as qt , $ as Rt , D as Ht , l as r , n , m as we , u as i , A as h , v as f , c as Te , w as k , J as ye , p as Lt , k as Ce , o as Pt , H as ie } from "./index-0unWA3Bg.js" ; import { F as Dt } from "./FieldsQueryParam-ZLlGrCBp.js" ; function mt ( d , e , t ) { const a = d . slice ( ) ; return a [ 10 ] = e [ t ] , a } function _t ( d , e , t ) { const a = d . slice ( ) ; return a [ 10 ] = e [ t ] , a } function ht ( d , e , t ) { const a = d . slice ( ) ; return a [ 15 ] = e [ t ] , a } function yt ( d ) { let e ; return { c ( ) { e = i ( "p" ) , e . innerHTML = ` <em>Note that in case of a password change all previously issued tokens for the current record
2025-03-18 03:19:47 +08:00
will be automatically invalidated and if you want your user to remain signed in you need to
reauthenticate manually after the update call . < / e m > ` } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n k t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " p " ) , e . i n n e r H T M L = " R e q u i r e s s u p e r u s e r < c o d e > A u t h o r i z a t i o n : T O K E N < / c o d e > h e a d e r " , k ( e , " c l a s s " , " t x t - h i n t t x t - s m t x t - r i g h t " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n v t ( d ) { l e t e , t , a , m , p , c , u , b , S , C , H , L , $ , M , q , P , U , J , O , R , D , v , g , w ; f u n c t i o n x ( _ , T ) { v a r t e , W , l e ; r e t u r n T & 1 & & ( b = n u l l ) , b = = n u l l & & ( b = ! ! ( ( l e = ( W = ( t e = _ [ 0 ] ) = = n u l l ? v o i d 0 : t e . f i e l d s ) = = n u l l ? v o i d 0 : W . f i n d ( W t ) ) ! = n u l l & & l e . r e q u i r e d ) ) , b ? B t : F t } l e t Q = x ( d , - 1 ) , B = Q ( d ) ; r e t u r n { c ( ) { e = i ( " t r " ) , e . i n n e r H T M L = ' < t d c o l s p a n = " 3 " c l a s s = " t x t - h i n t t x t - b o l d " > A u t h s p e c i f i c f i e l d s < / t d > ' , t = f ( ) , a = i ( " t r " ) , a . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > e m a i l < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > T h e a u t h r e c o r d e m a i l a d d r e s s .
< br / >
This field can be updated only by superusers or auth records with & quot ; Manage & quot ; access .
< br / >
Regular accounts can update their email by calling & quot ; Request email change & quot ; . < / t d > ` , m = f ( ) , p = i ( " t r " ) , c = i ( " t d " ) , u = i ( " d i v " ) , B . c ( ) , S = f ( ) , C = i ( " s p a n " ) , C . t e x t C o n t e n t = " e m a i l V i s i b i l i t y " , H = f ( ) , L = i ( " t d " ) , L . i n n e r H T M L = ' < s p a n c l a s s = " l a b e l " > B o o l e a n < / s p a n > ' , $ = f ( ) , M = i ( " t d " ) , M . t e x t C o n t e n t = " W h e t h e r t o s h o w / h i d e t h e a u t h r e c o r d e m a i l w h e n f e t c h i n g t h e r e c o r d d a t a . " , q = f ( ) , P = i ( " t r " ) , P . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > o l d P a s s w o r d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > O l d a u t h r e c o r d p a s s w o r d .
< br / >
This field is required only when changing the record password . Superusers and auth records
with & quot ; Manage & quot ; access can skip this field . < / t d > ` , U = f ( ) , J = i ( " t r " ) , J . i n n e r H T M L = ' < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > p a s s w o r d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > N e w a u t h r e c o r d p a s s w o r d . < / t d > ' , O = f ( ) , R = i ( " t r " ) , R . i n n e r H T M L = ' < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > p a s s w o r d C o n f i r m < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > N e w a u t h r e c o r d p a s s w o r d c o n f i r m a t i o n . < / t d > ' , D = f ( ) , v = i ( " t r " ) , v . i n n e r H T M L = ` < t d > < d i v c l a s s = " i n l i n e - f l e x " > < s p a n c l a s s = " l a b e l l a b e l - w a r n i n g " > O p t i o n a l < / s p a n > < s p a n > v e r i f i e d < / s p a n > < / d i v > < / t d > < t d > < s p a n c l a s s = " l a b e l " > B o o l e a n < / s p a n > < / t d > < t d > I n d i c a t e s w h e t h e r t h e a u t h r e c o r d i s v e r i f i e d o r n o t .
< br / >
This field can be set only by superusers or auth records with & quot ; Manage & quot ; access . < / t d > ` , g = f ( ) , w = i ( " t r " ) , w . i n n e r H T M L = ' < t d c o l s p a n = " 3 " c l a s s = " t x t - h i n t t x t - b o l d " > O t h e r f i e l d s < / t d > ' , k ( u , " c l a s s " , " i n l i n e - f l e x " ) } , m ( _ , T ) { r ( _ , e , T ) , r ( _ , t , T ) , r ( _ , a , T ) , r ( _ , m , T ) , r ( _ , p , T ) , n ( p , c ) , n ( c , u ) , B . m ( u , n u l l ) , n ( u , S ) , n ( u , C ) , n ( p , H ) , n ( p , L ) , n ( p , $ ) , n ( p , M ) , r ( _ , q , T ) , r ( _ , P , T ) , r ( _ , U , T ) , r ( _ , J , T ) , r ( _ , O , T ) , r ( _ , R , T ) , r ( _ , D , T ) , r ( _ , v , T ) , r ( _ , g , T ) , r ( _ , w , T ) } , p ( _ , T ) { Q ! = = ( Q = x ( _ , T ) ) & & ( B . d ( 1 ) , B = Q ( _ ) , B & & ( B . c ( ) , B . m ( u , S ) ) ) } , d ( _ ) { _ & & ( o ( e ) , o ( t ) , o ( a ) , o ( m ) , o ( p ) , o ( q ) , o ( P ) , o ( U ) , o ( J ) , o ( O ) , o ( R ) , o ( D ) , o ( v ) , o ( g ) , o ( w ) ) , B . d ( ) } } } f u n c t i o n F t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " O p t i o n a l " , k ( e , " c l a s s " , " l a b e l l a b e l - w a r n i n g " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n B t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " R e q u i r e d " , k ( e , " c l a s s " , " l a b e l l a b e l - s u c c e s s " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n N t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " O p t i o n a l " , k ( e , " c l a s s " , " l a b e l l a b e l - w a r n i n g " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n A t ( d ) { l e t e ; r e t u r n { c ( ) { e = i ( " s p a n " ) , e . t e x t C o n t e n t = " R e q u i r e d " , k ( e , " c l a s s " , " l a b e l l a b e l - s u c c e s s " ) } , m ( t , a ) { r ( t , e , a ) } , d ( t ) { t & & o ( e ) } } } f u n c t i o n E t ( d ) { l e t e , t = d [ 1 5 ] . m a x S e l e c t = = 1 ? " i d " : " i d s " , a , m ; r e t u r n { c ( ) { e = h ( " R e l a t i o n r e c o r d " ) , a = h ( t ) , m = h ( " . " ) } , m ( p , c ) { r ( p , e , c ) , r ( p , a , c ) , r ( p , m , c ) } , p ( p , c ) { c & 3 2 & & t ! = = ( t = p [ 1 5 ] . m a x S e l e c t = = 1 ? " i d " : " i d s " ) & & e e ( a , t ) } , d ( p ) { p & & ( o ( e ) , o ( a ) , o ( m ) ) } } } f u n c t i o n I t ( d ) { l e t e , t , a , m , p ; r e t u r n { c ( ) { e = h ( " F i l e o b j e c t . " ) , t = i ( " b r " ) , a = h ( `
Set to ` ),m=i("code"),m.textContent="null",p=h(" to delete already uploaded file(s).")},m(c,u){r(c,e,u),r(c,t,u),r(c,a,u),r(c,m,u),r(c,p,u)},p:ie,d(c){c&&(o(e),o(t),o(a),o(m),o(p))}}}function Jt(d){let e;return{c(){e=h("URL address.")},m(t,a){r(t,e,a)},p:ie,d(t){t&&o(e)}}}function Ut(d){let e;return{c(){e=h("Email address.")},m(t,a){r(t,e,a)},p:ie,d(t){t&&o(e)}}}function jt(d){let e;return{c(){e=h("JSON array or object.")},m(t,a){r(t,e,a)},p:ie,d(t){t&&o(e)}}}function Vt(d){let e;return{c(){e=h("Number value.")},m(t,a){r(t,e,a)},p:ie,d(t){t&&o(e)}}}function xt(d){let e;return{c(){e=h("Plain text value.")},m(t,a){r(t,e,a)},p:ie,d(t){t&&o(e)}}}function gt(d,e){let t,a,m,p,c,u=e[15].name+"",b,S,C,H,L=ye.getFieldValueType(e[15])+"", $ ,M,q,P;function U(g,w){return g[15].required?At:Nt}let J=U(e),O=J(e);function R(g,w){if(g[15].type==="text")return xt;if(g[15].type==="number")return Vt;if(g[15].type==="json")return jt;if(g[15].type==="email")return Ut;if(g[15].type==="url")return Jt;if(g[15].type==="file")return It;if(g[15].type==="relation")return Et}let D=R(e),v=D&&D(e);return{key:d,first:null,c(){t=i("tr"),a=i("td"),m=i("div"),O.c(),p=f(),c=i("span"),b=h(u),S=f(),C=i("td"),H=i("span"), $ =h(L),M=f(),q=i("td"),v&&v.c(),P=f(),k(m,"class","inline-flex"),k(H,"class","label"),this.first=t},m(g,w){r(g,t,w),n(t,a),n(a,m),O.m(m,null),n(m,p),n(m,c),n(c,b),n(t,S),n(t,C),n(C,H),n(H, $ ),n(t,M),n(t,q),v&&v.m(q,null),n(t,P)},p(g,w){e=g,J!==(J=U(e))&&(O.d(1),O=J(e),O&&(O.c(),O.m(m,p))),w&32&&u!==(u=e[15].name+"")&&ee(b,u),w&32&&L!==(L=ye.getFieldValueType(e[15])+"")&&ee( $ ,L),D===(D=R(e))&&v?v.p(e,w):(v&&v.d(1),v=D&&D(e),v&&(v.c(),v.m(q,null)))},d(g){g&&o(t),O.d(),v&&v.d()}}}function wt(d,e){let t,a=e[10].code+"",m,p,c,u;function b(){return e[9](e[10])}return{key:d,first:null,c(){t=i("button"),m=h(a),p=f(),k(t,"class","tab-item"),Ce(t,"active",e[2]===e[10].code),this.first=t},m(S,C){r(S,t,C),n(t,m),n(t,p),c||(u=Pt(t,"click",b),c=!0)},p(S,C){e=S,C&8&&a!==(a=e[10].code+"")&&ee(m,a),C&12&&Ce(t,"active",e[2]===e[10].code)},d(S){S&&o(t),c=!1,u()}}}function Tt(d,e){let t,a,m,p;return a=new Ct({props:{content:e[10].body}}),{key:d,first:null,c(){t=i("div"),Te(a. $ $ .fragment),m=f(),k(t,"class","tab-item"),Ce(t,"active",e[2]===e[10].code),this.first=t},m(c,u){r(c,t,u),we(a,t,null),n(t,m),p=!0},p(c,u){e=c;const b={};u&8&&(b.content=e[10].body),a. $ set(b),(!p||u&12)&&Ce(t,"active",e[2]===e[10].code)},i(c){p||(he(a. $ $ .fragment,c),p=!0)},o(c){_e(a. $ $ .fragment,c),p=!1},d(c){c&&o(t),ge(a)}}}function Qt(d){var ct,ut;let e,t,a=d[0].name+"",m,p,c,u,b,S,C,H=d[0].name+"",L, $ ,M,q,P,U,J,O,R,D,v,g,w,x,Q,B,_,T,te,W=d[0].name+"",le,je, $ e,Ve,Me,de,Se,oe,Oe,re,qe,z,Re,xe,K,He,j=[],Qe=new Map,Le,ce,Pe,X,De,We,ue,Y,Fe,ze,Be,Ke,N,Xe,ne,Ye,Ze,Ge,Ne,et,Ae,tt,Ee,lt,nt,ae,Ie,pe,Je,Z,fe,V=[],at=new Map,st,be,A=[],it=new Map,G,E=d[1]&&yt();R=new Ot({props:{js: `
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${d[4]}' ) ;
...
// example update data
const data = $ { JSON . stringify ( d [ 7 ] ( d [ 0 ] ) , null , 4 ) } ;
const record = await pb . collection ( '${(ct=d[0])==null?void 0:ct.name}' ) . update ( 'RECORD_ID' , data ) ;
` ,dart: `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${d[4]}' ) ;
...
// example update body
final body = < String , dynamic > $ { JSON . stringify ( d [ 7 ] ( d [ 0 ] ) , null , 2 ) } ;
final record = await pb . collection ( '${(ut=d[0])==null?void 0:ut.name}' ) . update ( 'RECORD_ID' , body : body ) ;
` }});let I=d[6]&&kt(),F=d[1]&&vt(d),ke=se(d[5]);const dt=l=>l[15].name;for(let l=0;l<ke.length;l+=1){let s=ht(d,ke,l),y=dt(s);Qe.set(y,j[l]=gt(y,s))}ne=new Ct({props:{content:"?expand=relField1,relField2.subRelField21"}}),ae=new Dt({});let ve=se(d[3]);const ot=l=>l[10].code;for(let l=0;l<ve.length;l+=1){let s=_t(d,ve,l),y=ot(s);at.set(y,V[l]=wt(y,s))}let me=se(d[3]);const rt=l=>l[10].code;for(let l=0;l<me.length;l+=1){let s=mt(d,me,l),y=rt(s);it.set(y,A[l]=Tt(y,s))}return{c(){e=i("h3"),t=h("Update ("),m=h(a),p=h(")"),c=f(),u=i("div"),b=i("p"),S=h("Update a single "),C=i("strong"),L=h(H), $ =h(" record."),M=f(),q=i("p"),q.innerHTML= ` Body parameters could be sent as < code > application / json < / c o d e > o r
< code > multipart / form - data < / c o d e > . ` , P = f ( ) , U = i ( " p " ) , U . i n n e r H T M L = ` F i l e u p l o a d i s s u p p o r t e d o n l y v i a < c o d e > m u l t i p a r t / f o r m - d a t a < / c o d e > .
< br / >
For more info and examples you could check the detailed
< a href = "https://pocketbase.io/docs/files-handling" target = "_blank" rel = "noopener noreferrer" > Files upload and handling docs
< / a > . ` , J = f ( ) , E & & E . c ( ) , O = f ( ) , T e ( R . $ $ . f r a g m e n t ) , D = f ( ) , v = i ( " h 6 " ) , v . t e x t C o n t e n t = " A P I d e t a i l s " , g = f ( ) , w = i ( " d i v " ) , x = i ( " s t r o n g " ) , x . t e x t C o n t e n t = " P A T C H " , Q = f ( ) , B = i ( " d i v " ) , _ = i ( " p " ) , T = h ( " / a p i / c o l l e c t i o n s / " ) , t e = i ( " s t r o n g " ) , l e = h ( W ) , j e = h ( " / r e c o r d s / " ) , $ e = i ( " s t r o n g " ) , $ e . t e x t C o n t e n t = " : i d " , V e = f ( ) , I & & I . c ( ) , M e = f ( ) , d e = i ( " d i v " ) , d e . t e x t C o n t e n t = " P a t h p a r a m e t e r s " , S e = f ( ) , o e = i ( " t a b l e " ) , o e . i n n e r H T M L = ' < t h e a d > < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 6 0 % " > D e s c r i p t i o n < / t h > < / t r > < / t h e a d > < t b o d y > < t r > < t d > i d < / t d > < t d > < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > < / t d > < t d > I D o f t h e r e c o r d t o u p d a t e . < / t d > < / t r > < / t b o d y > ' , O e = f ( ) , r e = i ( " d i v " ) , r e . t e x t C o n t e n t = " B o d y P a r a m e t e r s " , q e = f ( ) , z = i ( " t a b l e " ) , R e = i ( " t h e a d " ) , R e . i n n e r H T M L = ' < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 5 0 % " > D e s c r i p t i o n < / t h > < / t r > ' , x e = f ( ) , K = i ( " t b o d y " ) , F & & F . c ( ) , H e = f ( ) ; f o r ( l e t l = 0 ; l < j . l e n g t h ; l + = 1 ) j [ l ] . c ( ) ; L e = f ( ) , c e = i ( " d i v " ) , c e . t e x t C o n t e n t = " Q u e r y p a r a m e t e r s " , P e = f ( ) , X = i ( " t a b l e " ) , D e = i ( " t h e a d " ) , D e . i n n e r H T M L = ' < t r > < t h > P a r a m < / t h > < t h > T y p e < / t h > < t h w i d t h = " 6 0 % " > D e s c r i p t i o n < / t h > < / t r > ' , W e = f ( ) , u e = i ( " t b o d y " ) , Y = i ( " t r " ) , F e = i ( " t d " ) , F e . t e x t C o n t e n t = " e x p a n d " , z e = f ( ) , B e = i ( " t d " ) , B e . i n n e r H T M L = ' < s p a n c l a s s = " l a b e l " > S t r i n g < / s p a n > ' , K e = f ( ) , N = i ( " t d " ) , X e = h ( ` A u t o e x p a n d r e l a t i o n s w h e n r e t u r n i n g t h e u p d a t e d r e c o r d . E x . :
` ),Te(ne. $ $ .fragment),Ye=h( `
Supports up to 6 - levels depth nested relations expansion . ` ),Ze=i("br"),Ge=h( `
The expanded relations will be appended to the record under the
` ),Ne=i("code"),Ne.textContent="expand",et=h(" property (eg. "),Ae=i("code"),Ae.textContent='"expand": {"relField1": {...}, ...}',tt=h( ` ) . Only
the relations that the user has permissions to ` ),Ee=i("strong"),Ee.textContent="view",lt=h(" will be expanded."),nt=f(),Te(ae. $ $ .fragment),Ie=f(),pe=i("div"),pe.textContent="Responses",Je=f(),Z=i("div"),fe=i("div");for(let l=0;l<V.length;l+=1)V[l].c();st=f(),be=i("div");for(let l=0;l<A.length;l+=1)A[l].c();k(e,"class","m-b-sm"),k(u,"class","content txt-lg m-b-sm"),k(v,"class","m-b-xs"),k(x,"class","label label-primary"),k(B,"class","content"),k(w,"class","alert alert-warning"),k(de,"class","section-title"),k(oe,"class","table-compact table-border m-b-base"),k(re,"class","section-title"),k(z,"class","table-compact table-border m-b-base"),k(ce,"class","section-title"),k(X,"class","table-compact table-border m-b-lg"),k(pe,"class","section-title"),k(fe,"class","tabs-header compact combined left"),k(be,"class","tabs-content"),k(Z,"class","tabs")},m(l,s){r(l,e,s),n(e,t),n(e,m),n(e,p),r(l,c,s),r(l,u,s),n(u,b),n(b,S),n(b,C),n(C,L),n(b, $ ),n(u,M),n(u,q),n(u,P),n(u,U),n(u,J),E&&E.m(u,null),r(l,O,s),we(R,l,s),r(l,D,s),r(l,v,s),r(l,g,s),r(l,w,s),n(w,x),n(w,Q),n(w,B),n(B,_),n(_,T),n(_,te),n(te,le),n(_,je),n(_, $ e),n(w,Ve),I&&I.m(w,null),r(l,Me,s),r(l,de,s),r(l,Se,s),r(l,oe,s),r(l,Oe,s),r(l,re,s),r(l,qe,s),r(l,z,s),n(z,Re),n(z,xe),n(z,K),F&&F.m(K,null),n(K,He);for(let y=0;y<j.length;y+=1)j[y]&&j[y].m(K,null);r(l,Le,s),r(l,ce,s),r(l,Pe,s),r(l,X,s),n(X,De),n(X,We),n(X,ue),n(ue,Y),n(Y,Fe),n(Y,ze),n(Y,Be),n(Y,Ke),n(Y,N),n(N,Xe),we(ne,N,null),n(N,Ye),n(N,Ze),n(N,Ge),n(N,Ne),n(N,et),n(N,Ae),n(N,tt),n(N,Ee),n(N,lt),n(ue,nt),we(ae,ue,null),r(l,Ie,s),r(l,pe,s),r(l,Je,s),r(l,Z,s),n(Z,fe);for(let y=0;y<V.length;y+=1)V[y]&&V[y].m(fe,null);n(Z,st),n(Z,be);for(let y=0;y<A.length;y+=1)A[y]&&A[y].m(be,null);G=!0},p(l,[s]){var pt,ft;(!G||s&1)&&a!==(a=l[0].name+"")&&ee(m,a),(!G||s&1)&&H!==(H=l[0].name+"")&&ee(L,H),l[1]?E||(E=yt(),E.c(),E.m(u,null)):E&&(E.d(1),E=null);const y={};s&17&&(y.js= `
import PocketBase from 'pocketbase' ;
const pb = new PocketBase ( '${l[4]}' ) ;
...
// example update data
const data = $ { JSON . stringify ( l [ 7 ] ( l [ 0 ] ) , null , 4 ) } ;
const record = await pb . collection ( '${(pt=l[0])==null?void 0:pt.name}' ) . update ( 'RECORD_ID' , data ) ;
` ),s&17&&(y.dart= `
import 'package:pocketbase/pocketbase.dart' ;
final pb = PocketBase ( '${l[4]}' ) ;
...
// example update body
final body = < String , dynamic > $ { JSON . stringify ( l [ 7 ] ( l [ 0 ] ) , null , 2 ) } ;
final record = await pb . collection ( '${(ft=l[0])==null?void 0:ft.name}' ) . update ( 'RECORD_ID' , body : body ) ;
` ),R. $ set(y),(!G||s&1)&&W!==(W=l[0].name+"")&&ee(le,W),l[6]?I||(I=kt(),I.c(),I.m(w,null)):I&&(I.d(1),I=null),l[1]?F?F.p(l,s):(F=vt(l),F.c(),F.m(K,He)):F&&(F.d(1),F=null),s&32&&(ke=se(l[5]),j=Ue(j,s,dt,1,l,ke,Qe,K,bt,gt,null,ht)),s&12&&(ve=se(l[3]),V=Ue(V,s,ot,1,l,ve,at,fe,bt,wt,null,_t)),s&12&&(me=se(l[3]),qt(),A=Ue(A,s,rt,1,l,me,it,be,Rt,Tt,null,mt),Ht())},i(l){if(!G){he(R. $ $ .fragment,l),he(ne. $ $ .fragment,l),he(ae. $ $ .fragment,l);for(let s=0;s<me.length;s+=1)he(A[s]);G=!0}},o(l){_e(R. $ $ .fragment,l),_e(ne. $ $ .fragment,l),_e(ae. $ $ .fragment,l);for(let s=0;s<A.length;s+=1)_e(A[s]);G=!1},d(l){l&&(o(e),o(c),o(u),o(O),o(D),o(v),o(g),o(w),o(Me),o(de),o(Se),o(oe),o(Oe),o(re),o(qe),o(z),o(Le),o(ce),o(Pe),o(X),o(Ie),o(pe),o(Je),o(Z)),E&&E.d(),ge(R,l),I&&I.d(),F&&F.d();for(let s=0;s<j.length;s+=1)j[s].d();ge(ne),ge(ae);for(let s=0;s<V.length;s+=1)V[s].d();for(let s=0;s<A.length;s+=1)A[s].d()}}}const Wt=d=>d.name=="emailVisibility";function zt(d,e,t){let a,m,p,c,u,{collection:b}=e,S=200,C=[];function H( $ ){let M=ye.dummyCollectionSchemaData( $ ,!0);return a&&(M.oldPassword="12345678",M.password="87654321",M.passwordConfirm="87654321",delete M.verified,delete M.email),M}const L= $ =>t(2,S= $ .code);return d. $ $ set= $ =>{"collection"in $ &&t(0,b= $ .collection)},d. $ $ .update=()=>{var $ ,M,q;d. $ $ .dirty&1&&t(1,a=(b==null?void 0:b.type)==="auth"),d. $ $ .dirty&1&&t(6,m=(b==null?void 0:b.updateRule)===null),d. $ $ .dirty&2&&t(8,p=a?["id","password","verified","email","emailVisibility"]:["id"]),d. $ $ .dirty&257&&t(5,c=(( $ =b==null?void 0:b.fields)==null?void 0: $ .filter(P=>!P.hidden&&P.type!="autodate"&&!p.includes(P.name)))||[]),d. $ $ .dirty&1&&t(3,C=[{code:200,body:JSON.stringify(ye.dummyCollectionRecord(b),null,2)},{code:400,body: `
{
"status" : 400 ,
"message" : "Failed to update record." ,
"data" : {
"${(q=(M=b==null?void 0:b.fields)==null?void 0:M[0])==null?void 0:q.name}" : {
"code" : "validation_required" ,
"message" : "Missing required value."
}
}
}
` },{code:403,body: `
{
"status" : 403 ,
"message" : "You are not allowed to perform this request." ,
"data" : { }
}
` },{code:404,body: `
{
"status" : 404 ,
"message" : "The requested resource wasn't found." ,
"data" : { }
}
` }])},t(4,u=ye.getApiExampleUrl(Lt.baseURL)),[b,a,S,C,u,c,m,H,p,L]}class Yt extends $ t{constructor(e){super(),Mt(this,e,zt,Qt,St,{collection:0})}}export{Yt as default};