import{aI as p,b0 as P,ao as e,bS as k,cm as w,bT as y,aq as x,L as N,bq as v,aA as A,hp as F,v as C,du as H,dm as E}from"./app-k0jcl5PQ.js";import{F as R}from"./kLXBNYk1.chunk.js";import{L as s}from"./CCKlkV4O.chunk.js";import{L as U}from"./BCKXZxoz.chunk.js";import{u as _}from"./BDd2EAdq.chunk.js";const M="_input_ts5j9_9",V={input:M},h="share.videoPincode",i=N.encloseNamespace(h);function $(a){const[r,j]=p.useState(a.pincode??""),[u,n]=p.useState(!1),[c,l]=p.useState(""),S=P(),o=_(a.shareId);async function L(d){var f,g;if(d.preventDefault(),!!r){n(!0);try{const t=await S(A.getPincodeByCode(r));if((t==null?void 0:t.shareId)!==a.shareId){l(i("incorrectPincodeError")),n(!1);return}const m={...a.appLink};typeof m.params!="string"&&((f=m.params)==null||delete f.joinCode),F.setPincode(a.shareId,r);const I=C.getHref(m);H.PageLoad(I)}catch(t){if(((g=t.responseJSON)==null?void 0:g.status)===E.NotFound){l(i("incorrectPincodeError")),n(!1);return}l(i("ajaxErrorMessage")),n(!1)}}}if(!o)return e.jsx(e.Fragment,{});const b=k.createUrl(w.getImageUrl(o),{size:y.Large});return e.jsxs(s,{children:[e.jsx(s.LeftImage,{title:o.name,imageUrl:b,objectType:o.typeId,fallbackImages:U}),e.jsxs(s.Right,{children:[e.jsx(s.Header,{}),e.jsx(s.Content,{children:e.jsx(s.NarrowContent,{children:e.jsxs("form",{onSubmit:L,className:"position-relative",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"h2",htmlFor:"link-password",children:e.jsx(x,{namespace:h,phrase:"info"})}),e.jsx("input",{id:"link-password",type:"text",className:`form-control form-control-lg ${V.input} ${c?"is-invalid":""}`,placeholder:i("placeholder"),onChange:d=>j(d.target.value),value:r,autoComplete:"off","aria-errormessage":"linkPasswordError"}),c&&e.jsx(R,{className:"mb-3",name:"linkPassword",children:c})]}),e.jsx(v,{variant:"dark",showSpinner:u,type:"submit",className:"w-100 mt-3 btn-lg",disabled:u||!r,children:e.jsx(x,{namespace:h,phrase:"confirm"})})]})})})]})]})}export{$ as VideoPincodeView};
//# sourceMappingURL=CZPEehWM.chunk.js.map
