import{ao as a,ap as r,aS as m,aI as b,b8 as j,az as N,be as I,b0 as C,aB as f,aA as o}from"./app-k0jcl5PQ.js";import{R as y}from"./BlKMjFEf.chunk.js";import{S as s}from"./Boh3c6zT.chunk.js";const w="_textarea_kx2v6_1",F={textarea:w};function R(e){const n=b.useId();if(!e.hide)return a.jsx(m,{xs:12,className:r(e.className),children:a.jsxs("div",{className:"d-flex w-100",children:[a.jsx(j,{id:n,name:n,onChange:e.onClick,checked:e.toggled,disabled:e.disabled}),a.jsxs("div",{className:"w-100",children:[a.jsxs("div",{className:"mb-1",children:[a.jsx("label",{className:"mb-1",htmlFor:n,children:e.title}),a.jsx("p",{className:"m-0 text-secondary",children:e.description})]}),e.children]})]})})}function P(e){const n=b.useId();if(!e.hide)return a.jsx(m,{xs:12,className:r(e.className),children:a.jsxs("div",{className:"d-flex flex-column w-100",children:[a.jsx("label",{className:"mb-1",htmlFor:n,children:e.title}),a.jsx("input",{type:"text",id:n,className:r("form-control",e.error&&"is-invalid"),placeholder:e.placeholder??"",value:e.value,onChange:i=>e.onChange(i.target.value)}),!!e.note&&a.jsx("span",{className:"mt-1 text-secondary",children:e.note}),!!e.error&&a.jsx("span",{className:"mt-1 text-danger",children:e.error})]})})}function q(e){if(!e.hide)return a.jsx(m,{xs:12,children:a.jsx("textarea",{className:r("form-control",F.textarea),placeholder:e.placeholder,value:e.value,onChange:n=>e.onChange(n.target.value)})})}function k(e){if(!e.hide)return a.jsx("hr",{className:r(!e.withMargins&&"m-0")})}function h(e){if(!e.hide)return a.jsxs(y,{className:r("flow-setting-item-group gap-3 gx-0",e.className),children:[!!e.name&&a.jsx(m,{xs:12,className:"h6 m-0",children:e.name}),a.jsx("div",{className:r("d-flex flex-column gap-3",e.childContainerClassName),children:e.children})]})}h.Toggle=R;h.TextArea=q;h.Divider=k;h.Input=P;function D(e){var g;const n=N(I.getPrivacy(e)),i=C(),u=(g=n.data)==null?void 0:g.canManageAccess;async function v(t){if(!n.data)return;const c=t.requireSignIn?s.Direct:s.PinCode,l=await i(o.createShare({objectId:t.objectId,type:f.Classroom,privacy:c,optionRequest:{preventScrubbing:t.preventScrubbing,immediateFeedback:t.immediateFeedback},recipientRequest:t.recipients.map(d=>({recipientId:d,message:t.message,scopeId:t.scopeId}))}));return c===s.PinCode&&await x({shareId:l.shareId}),l}async function S(t){if(!n.data)return;let c=s.PinCode;t.requireSignIn&&(t.respectRatingsAndRestrictions?c=u?s.JustMySchool:s.Protected:c=u?s.JustMySchoolOverrideRestriction:s.ProtectedOverrideRestriction);const l={objectId:t.objectId,type:f.Open,privacy:c,optionRequest:{preventScrubbing:t.preventScrubbing,immediateFeedback:t.immediateFeedback}};t.name.length&&(l.optionRequest.openClassroomName=t.name);const d=await i(o.createShare(l));return c===s.PinCode&&await x({shareId:d.shareId}),d}async function x(t){return await i(o.createSharePincode(t.shareId))}return{createDirectShare:v,createOpenSession:S,canManageAccess:u,hasCompleted:n.hasCompleted}}export{h as F,D as u};
//# sourceMappingURL=DhnwJTPa.chunk.js.map
