PageSourceSearch

https://mos.meddicc.com/_next/static/chunks/pages/admin-panel/shorts-9d099560ddc323f6.js

js meddicc.com collected 2026-09-25 20:16:21 UTC 31,199 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c919dfe5-71e5-4cc9-9f93-1111370d3da3",e._sentryDebugIdIdentifier="sentry-dbid-c919dfe5-71e5-4cc9-9f93-1111370d3da3")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8130],{2979:(e,t,r)=>{"use strict";r.d(t,{O:()=>f});var a=r(37876),s=r(14e3),n=r(89099),o=r(14232),l=r(23377),i=r(68660),d=r(60509),c=r(64232),u=r(3228),m=r(1196),p=r(81130),h=r(89638),x=r(20843),g=r(54663),b=r(33216);let f=e=>{var t,r,f;let{excludeSingleProgramUsers:y,allowedPermissions:v,productToCheck:j,featureToCheck:w,withMembership:k,requireB2B:N,children:S}=e,C=(0,n.useRouter)(),A=(0,s.usePathname)(),{data:P,isLoading:I,isFetching:M}=(0,i.vf)(),{data:T,isLoading:D}=(0,u.Rd)(),{data:E,isLoading:F}=(0,m.xC)(Number(null==P||null==(t=P.organisation)?void 0:t.id),{skip:!(null==P||null==(r=P.organisation)?void 0:r.id)}),{data:B,isLoading:L}=(0,d.ZI)({userId:Number(null==P?void 0:P.id),endpoint:void 0,page:1,query:"",sort:null,entries:5,filter:""},{skip:!(null==P?void 0:P.id)}),[R,z]=(0,o.useState)(!1),V=null==P?void 0:P.permissionLevel;null==P||P.permissionLevel,p.E1.superAdmin;let H=(0,o.useMemo)(()=>[...v,...l.uK],[v]),U=j===x.lk.ENABLE,_=k&&(null==P||null==(f=P.organisation)?void 0:f.id),W=(0,o.useMemo)(()=>{var e,t,r,a,s;if(!P)return;let n=!N||(null==P||null==(e=P.organisation)?void 0:e.orgType)===x.tW.B2B;if(!j&&!w)return n;let o=(0,c.ul)(E,k),l=null==A?void 0:A.includes("reports/enable"),i=j===x.lk.ENABLE&&B&&(null==B||null==(t=B.results)?void 0:t.length)>0,d=!j||(null==P||null==(r=P.products)?void 0:r.includes(String(j)))||i&&!l,u=!j||(null==P||null==(s=P.organisation)||null==(a=s.products)?void 0:a.includes(String(j))),m=(0,h.xS)(P,w,T),p=(0,h.Uc)(P,w,T);return d&&u&&!!(m&&p)&&o&&n},[j,P,B,T,k,E,A,w,N]),q=(0,o.useMemo)(()=>!I&&!!P&&!D&&(!U||!L)&&(!_||!F),[I,P,D,U,L,_,F]);return((0,o.useEffect)(()=>{var e;if(!q)return;let t=V&&H.includes(V),r=y&&(0,c.W6)(E,B,null==P||null==(e=P.organisation)?void 0:e.isPersonal);W&&t&&!r?z(!1):z(!0)},[q,V,W,H,j,w,y,P]),q)?R&&P?(0,a.jsx)(g.v,{handleClose:()=>C.push("/profile/".concat(null==P?void 0:P.slug)),handleDelete:()=>C.push("/profile/".concat(null==P?void 0:P.slug)),title:"No Available Products",message:(0,a.jsxs)("p",{children:["Unauthorized product access or no products are currently assigned to your account. Please contact your mOS admin or email MEDDICC Support at"," ",(0,a.jsxs)("a",{href:"mailto:[email protected]",className:"text-cobalt-blue-500",children:[" ","[email protected]"]})," ","to request access."]}),actionButtonTitle:"Close",isDelete:!1,hideCancel:!0}):W&&V&&H.includes(V)?(0,a.jsx)(a.Fragment,{children:S}):null:(0,a.jsx)(b.y,{})}},10368:(e,t,r)=>{"use strict";r.d(t,{t:()=>g});var a=r(37876),s=r(14232),n=r(37101),o=r(76896),l=r(65704),i=r(23377),d=r(27772),c=r(84976);let u=c.Ay.div.withConfig({componentId:"sc-6791260b-0"})(["display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;> p:last-of-type{color:",";text-align:center;}> div:last-child{margin-top:4px;}"],e=>{let{theme:t}=e;return t.colors.black[60]}),m=c.Ay.div.withConfig({componentId:"sc-6791260b-1"})(["position:relative;display:flex;justify-content:center;align-items:center;border-radius:999px;cursor:pointer;:hover::after{content:'';opacity:0.5;display:block;background-color:",";}"," .logo{max-width:292px;max-height:162px;border-radius:5px;object-fit:cover;}"],e=>{let{theme:t}=e;return t.colors.pure.trueBlack},e=>{let{hasImage:t}=e;return!t&&(0,c.AH)(["min-width:170px;min-height:100px;height:178px;width:310px;"])}),p=c.Ay.div.withConfig({componentId:"sc-6791260b-2"})(["position:relative;overflow:hidden;width:290px;height:142px;border-radius:",";.reactEasyCrop_CropArea{border-color:rgba(255,255,255,0.48);color:rgba(0,0,0,0.48);}"],e=>{let{theme:t}=e;return t.borderRadius.medium}),h=c.Ay.div.withConfig({componentId:"sc-6791260b-3"})(["display:flex;align-items:center;gap:16px;width:100%;margin-top:36px;"]),x=c.Ay.input.withConfig({componentId:"sc-6791260b-4"})(["width:100%;margin:7px 0;background-color:transparent;-webkit-appearance:none;:focus{outline:none;}::-webkit-slider-runnable-track{width:100%;height:2px;border:none;border-radius:1.3px;background:#e0e3ea;cursor:pointer;}::-webkit-slider-thumb{width:16px;height:16px;
1margin-top:-7px;border:1px solid #7583a1;border-radius:50px;background:",";cursor:pointer;-webkit-appearance:none;}:focus::-webkit-slider-runnable-track{background:#eff1f4;}::-moz-range-track{width:100%;height:2px;border:none;border-radius:1.3px;background:#e0e3ea;cursor:pointer;}::-moz-range-thumb{width:1px;height:16px;border:1px solid #7583a1;border-radius:50px;background:",";cursor:pointer;}::-ms-track{width:100%;height:2px;border-width:8px 0;border-color:transparent;background:transparent;color:transparent;cursor:pointer;}::-ms-fill-lower{border:none;border-radius:2.6px;background:#d1d5e0;}::-ms-fill-upper{border:none;border-radius:2.6px;background:#e0e3ea;}::-ms-thumb{width:1px;height:16px;margin-top:0;border:1px solid #7583a1;border-radius:50px;background:",";cursor:pointer;}:focus::-ms-fill-lower{background:#e0e3ea;}:focus::-ms-fill-upper{background:#eff1f4;}"],e=>{let{theme:t}=e;return t.colors.pure.white100},e=>{let{theme:t}=e;return t.colors.pure.white100},e=>{let{theme:t}=e;return t.colors.pure.white100}),g=e=>{let{register:t,onChange:r,handleEdit:c,isEdit:g,value:b}=e,[f,y]=(0,s.useState)(null),[v,j]=(0,s.useState)({x:0,y:0}),[w,k]=(0,s.useState)(1),[N,S]=(0,s.useState)(null),[C,A]=(0,s.useState)("vertical-cover"),P=async(e,t)=>{let a=await new Promise((t,r)=>{let a=new Image;a.addEventListener("load",()=>t(a)),a.addEventListener("error",e=>r(e)),a.src=e});a.width>a.height?A("vertical-cover"):A("horizontal-cover");let s=document.createElement("canvas"),n=s.getContext("2d");return n?(s.width=800,s.height=442,n.drawImage(a,t.x,t.y,t.width,t.height,0,0,800,442),s.toBlob(e=>{e&&r(new File([e],"image.jpg"))}),s.toDataURL("image/jpeg")):null};return(0,s.useEffect)(()=>{g||k(1)},[g]),(0,a.jsxs)(u,{"data-testid":"input-image","data-sentry-element":"Wrapper","data-sentry-component":"InputImageWithRectangleCrop","data-sentry-source-file":"InputImageWithRectangleCrop.tsx",children:[(0,a.jsx)(n.Ay,{maxFiles:1,maxSize:0xa00000,multiple:!1,noDrag:!0,accept:{"image/jpg":[".jpg",".jpeg"],"image/png":[".png"],"image/webp":[".webp"]},onDropAccepted:e=>(e=>{y(window.URL.createObjectURL(e)),r(e),null==c||c(),S(null)})(e[0]),onDropRejected:e=>{var t;return S((e=>{switch(e){case"file-too-large":return"Uploaded file is too big";case"file-invalid-type":return"Invalid format";default:return"Unknown error"}})(null==e||null==(t=e[0])?void 0:t.errors[0].code))},"data-sentry-element":"Dropzone","data-sentry-source-file":"InputImageWithRectangleCrop.tsx",children:e=>{let{getRootProps:r,getInputProps:s}=e;return(0,a.jsxs)(m,{...r(),hasImage:g,children:[(0,a.jsx)("input",{type:"hidden",...s({multiple:!1}),...t||{}}),b&&!g&&(0,a.jsx)("img",{src:"string"==typeof b?b:URL.createObjectURL(b),alt:"",role:"presentation",className:"logo"}),!g&&!b&&(0,a.jsx)("img",{src:"/icons/noLogo.svg",alt:"",role:"presentation"}),!g&&(0,a.jsx)("div",{className:"absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full bg-primary-800",children:(0,a.jsx)("img",{className:"h-4 w-4",src:"/icons/editSmall.svg",alt:"Badge Icon",role:"presentation"})})]})}}),g&&f&&(0,a.jsx)(p,{children:(0,a.jsx)(o.Ay,{image:f,crop:v,zoom:w,minZoom:i.ZU,onCropChange:j,onZoomChange:k,showGrid:!1,objectFit:C,onCropComplete:(e,t)=>P(f,t),cropSize:{height:145,width:258}})}),g&&(0,a.jsxs)(h,{children:[(0,a.jsx)("img",{src:"/icons/minus.svg",alt:"",role:"presentation",onClick:()=>k(e=>e>=i.KT?e-i.mC:i.Wb)}),(0,a.jsx)(x,{type:"range",min:i.Wb,max:i.nD,step:i.zp,onChange:e=>k(parseFloat(e.target.value)),value:w}),(0,a.jsx)("img",{src:"/icons/plus.svg",alt:"",role:"presentation",onClick:()=>k(e=>e<=i.oN?e+i.mC:i.nD)})]}),!g&&(0,a.jsxs)(d.HL,{children:["Max 1024 x 420 px and 10MB.",(0,a.jsx)("br",{}),"Recommended rectangle images.",(0,a.jsx)("br",{}),"Acceptable formats: JPG, PNG, WEBP."]}),N&&(0,a.jsx)(l.w,{type:"error",children:N})]})}},23006:(e,t,r)=>{"use strict";r.d(t,{AM:()=>l,Wv:()=>i,dT:()=>c,hl:()=>d});var a=r(37876),s=r(76777),n=r(14232),o=r(91722);function l(e){let{...t}=e;return(0,a.jsx)(s.bL,{"data-slot":"popover",...t,"data-sentry-element":"PopoverPrimitive.Root","data-sentry-component":"Popover","data-sentry-source-file":"popover.tsx"})}function i(e){let{...t}=e;return(0,a.jsx)(s.l9,{"data-slot":"popover-trigger",...t,"data-sentry-element":"PopoverPrimitive.Trigger","data-sentry-component":"PopoverTrigger","data-sentry-source-file":"popover.tsx"})}let d=n.forwardRef((e,t)=>
1{let{className:r,align:n="center",sideOffset:l=4,...i}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsx)(s.UC,{ref:t,"data-slot":"popover-content",align:n,sideOffset:l,className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin) outline-hidden z-50 w-72 rounded-md border border-silver-300 bg-white p-4 text-dark-900 shadow-md",r),...i})})});function c(e){let{...t}=e;return(0,a.jsx)(s.Mz,{"data-slot":"popover-anchor",...t,"data-sentry-element":"PopoverPrimitive.Anchor","data-sentry-component":"PopoverAnchor","data-sentry-source-file":"popover.tsx"})}d.displayName=s.UC.displayName},28491:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin-panel/shorts",function(){return r(94071)}])},28959:(e,t,r)=>{"use strict";r.d(t,{p:()=>a.A});var a=r(34455)},34455:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var a=r(37876),s=r(47137),n=r(14232),o=r(91722),l=r(19525),i=r(23006);(0,s.F)("",{variants:{variant:{bottom:"",standard:""}},defaultVariants:{variant:"standard"}});let d=e=>{let{disabled:t,variant:r,items:s,isButton:d,className:c}=e,[u,m]=(0,n.useState)(!1);return(0,a.jsxs)(i.AM,{open:u,onOpenChange:m,"data-sentry-element":"Popover","data-sentry-component":"KebabMenuV2","data-sentry-source-file":"KebabMenuV2.tsx",children:[(0,a.jsx)(i.Wv,{asChild:!0,disabled:t,"data-sentry-element":"PopoverTrigger","data-sentry-source-file":"KebabMenuV2.tsx",children:(0,a.jsx)("div",{"data-testid":"kebab-menu",onClick:e=>e.stopPropagation(),className:(0,o.cn)("relative cursor-pointer rounded-lg",d?"border bg-white p-2 hover:bg-gray-200":"",c),children:(0,a.jsx)(l.T,{className:"stroke-cobalt-blue-500","data-testid":"kebab-menu-button","data-sentry-element":"KebabIcon","data-sentry-source-file":"KebabMenuV2.tsx"})})}),(0,a.jsx)(i.hl,{className:"w-28 p-2",align:"bottom"===r?"end":"start",side:"bottom"===r?"bottom":"left",sideOffset:4,"data-sentry-element":"PopoverContent","data-sentry-source-file":"KebabMenuV2.tsx",children:(0,a.jsx)("div",{className:"flex flex-col","data-testid":"kebab-menu-wrapper",children:s.map((e,t)=>{let{label:r,onClick:s,isDanger:n}=e;return(0,a.jsx)("div",{role:"button","data-testid":"kebab-item",className:"group/kebab flex cursor-pointer items-center gap-2 rounded p-2 hover:bg-cobalt-blue-500",onClick:e=>{e.stopPropagation(),s(),m(!1)},children:(0,a.jsx)("p",{className:(0,o.cn)("text-xs group-hover/kebab:text-white",n?"text-red-600":""),children:r})},t)})})})]})};d.displayName="KebabMenuV2";let c=d},40620:(e,t,r)=>{"use strict";r.d(t,{z:()=>l});var a=r(37876),s=r(25145),n=r(45036);let o=e=>{let{pagination:t,isTextNavPagination:r,paginationPlacement:o="footer",...l}=e,i=["header","both"].includes(o),d=["footer","both"].includes(o),c=t?(0,a.jsx)(n.P,{isTextNav:r,...t}):void 0;return(0,a.jsx)(s.e,{...l,renderHeader:i?()=>(0,a.jsx)("div",{className:"-mt-4 mb-4",children:c}):void 0,renderFooter:d?()=>c:void 0,"data-sentry-element":"BaseDataGrid","data-sentry-component":"DataGrid","data-sentry-source-file":"DataGrid.tsx"})};o.displayName="DataGrid";let l=o},45036:(e,t,r)=>{"use strict";r.d(t,{P:()=>c});var a=r(37876),s=r(14232),n=r(91722),o=r(27772),l=r(77007);let i=e=>{let{children:t,onClick:r,disabled:s=!1,isActive:o=!1,className:l,isTextNav:i=!0,activePageBackgroundClass:d="bg-cobalt-blue-200"}=e;return(0,a.jsx)("button",{onClick:r,disabled:s,className:(0,n.cn)("flex w-8 flex-col items-center border",i?"py-2":"py-1",o?(0,n.cn)(d,"font-bold"):"hover:bg-cobalt-blue-100",null!=l?l:""),"data-sentry-component":"PaginationButton","data-sentry-source-file":"TablePaginationV2.tsx",children:t})},d=()=>(0,a.jsx)("div",{className:"flex w-8 flex-col items-center border py-2","data-sentry-component":"EllipsisButton","data-sentry-source-file":"TablePaginationV2.tsx",children:(0,a.jsx)("label",{className:"text-xs text-dark-700",children:"..."})}),c=e=>{let{currentPage:t,entriesPerPage:r,entriesCount:c,isLoading:u=!1,previous:m,next:p,onPrevClick:h,onNextClick:x,onPageClick:g,withTotal:b=!0,isTextNav:f=!0,activePageBackgroun
1dClass:y,maxVisiblePages:v=7}=e,j=Math.ceil(c/r),w=(0,s.useMemo)(()=>{if(j<=v)return Array.from({length:j},(e,t)=>t+1);let e=[];e.push(1);let r=Math.floor((v-3)/2),a=Math.max(2,t-r),s=Math.min(j-1,t+r);t-r<2&&(s=Math.min(j-1,v-2)),t+r>j-1&&(a=Math.max(2,j-v+2)),a>2&&e.push("start-ellipsis");for(let t=a;t<=s;t++)e.push(t);return s<j-1&&e.push("end-ellipsis"),j>1&&e.push(j),e},[j,t,v]),k=(0,s.useMemo)(()=>(t-1)*r+1,[t,r]),N=(0,s.useMemo)(()=>Math.min(t*r,c),[t,r,c]);return(0,a.jsxs)("div",{className:(0,n.cn)(b?"mt-4 flex w-full items-center justify-between":""),"data-sentry-component":"TablePaginationV2","data-sentry-source-file":"TablePaginationV2.tsx",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(i,{onClick:h,disabled:!m||u||1===t,className:(0,n.cn)(f?"w-[74px]":""),isTextNav:f,"data-sentry-element":"PaginationButton","data-sentry-source-file":"TablePaginationV2.tsx",children:(0,a.jsx)("label",{className:"text-xs text-dark-700",children:f?"Previous":(0,a.jsx)(l.z,{className:"w-3 rotate-90"})})}),u,w.map((e,r)=>"start-ellipsis"===e||"end-ellipsis"===e?(0,a.jsx)(d,{},"".concat(e,"-").concat(r)):(0,a.jsx)(i,{activePageBackgroundClass:y,onClick:()=>g(e),isActive:t===e,children:(0,a.jsx)("label",{className:"text-xs text-dark-700",children:e})},e)),(0,a.jsx)(i,{onClick:x,disabled:!p||u||t===j,className:(0,n.cn)(f?"w-[74px]":""),isTextNav:f,"data-sentry-element":"PaginationButton","data-sentry-source-file":"TablePaginationV2.tsx",children:(0,a.jsx)("label",{className:"text-xs text-dark-700",children:f?"Next":(0,a.jsx)(l.z,{className:"w-3 -rotate-90"})})})]}),b&&(0,a.jsxs)(o.EY,{secondary:!0,children:["Showing ",k,"-",N,"/",c]})]})}},50926:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var a=r(14232);let s=function(){let e=(0,a.useRef)(!0);return e.current?(e.current=!1,!0):e.current}},53969:(e,t,r)=>{"use strict";r.d(t,{d:()=>n});var a=r(37876),s=r(27772);let n=e=>{let{children:t,title:r}=e;return(0,a.jsxs)(s.ff,{variant:s.R1.adminPanel,isFullWidth:!0,"data-sentry-element":"PageWrapper","data-sentry-component":"AdminPanelContainer","data-sentry-source-file":"AdminPanelContainer.tsx",children:[r&&(0,a.jsx)(s.DZ,{as:"h2",className:"!mb-10",children:r}),t]})}},65704:(e,t,r)=>{"use strict";r.d(t,{w:()=>d});var a=r(37876);r(14232);var s=r(27772),n=r(37219),o=r(84976),l=r(23377);let i=o.Ay.div.withConfig({componentId:"sc-1cc92883-0"})(["display:flex;align-items:center;width:100%;border-radius:",";padding:16px;gap:12px;"," p::first-letter{text-transform:capitalize;}"],e=>{let{theme:t}=e;return t.borderRadius.medium},e=>{let{type:t}=e;switch(t){case"success":return(0,o.AH)(["background-color:",";img{filter:",";}"],e=>{let{theme:t}=e;return t.colors.secondary.green[10]},l.dV.toGreen120);case"info":return(0,o.AH)(["background-color:",";img{filter:",";}"],e=>{let{theme:t}=e;return t.colors.primary[10]},l.dV.toPrimary100);case"error":return(0,o.AH)(["background-color:",";p{color:",";}"],e=>{let{theme:t}=e;return t.colors.error[3]},e=>{let{theme:t}=e;return t.colors.secondary.red[100]});case"warning":return(0,o.AH)(["background-color:",";img{filter:",";}"],e=>{let{theme:t}=e;return t.colors.secondary.yellow[10]},l.dV.toBlack100);default:return(0,o.AH)(["background-color:",";p{color:",";}"],e=>{let{theme:t}=e;return t.colors.black[10]},e=>{let{theme:t}=e;return t.colors.black[100]})}}),d=e=>{let{children:t,type:r,dataCy:o}=e;return(0,a.jsxs)(i,{type:r,"data-sentry-element":"Wrapper","data-sentry-component":"InfoBox","data-sentry-source-file":"InfoBox.tsx",children:[(0,a.jsx)(n._,{height:25,width:25,src:(e=>{switch(e){case"success":return"/icons/checkCircleMedium.svg";case"info":return"/icons/info.svg";default:return"/icons/alert.svg"}})(r),alt:"Status Icon",role:"presentation","data-sentry-element":"Image","data-sentry-source-file":"InfoBox.tsx"}),(0,a.jsx)(s.EY,{"data-cy":o,secondary:!0,"data-sentry-element":"Text","data-sentry-source-file":"InfoBox.tsx",children:t})]})}},80174:(e,t,r)=>{"use strict";r.d(t,{T:()=>d});var a=r(37876),s=r(14232),n=r(4831),o=r(84976);let l=o.Ay.div.withConfig({componentId:"sc-f2d4cda7-0"})(["display:flex;flex-direction:column;margin-bottom:",";p{font-weight:",";span{color:",";font-weight:",";}}",""],e=>{let{marginBottomFormRow:t}=e;return t},e=>{let{theme:t}=e;return t.fontWeight.medium},e=>{let{theme:t}=e;return t.colors.black[40]},e=>{let{theme:t}=e;return t.fontWeight.regular},e=>{let{error:t}=e;return t&&(0,o.AH)(["> textarea:first-of-type{border-color:",";}"],e=>{let{theme:t}=e;return t.colors.error[20]})}),i=o.Ay.textarea.withConfig({componentId:"sc-f2d4cda7-1"})([""," resize:none;margin-top:2px;border:1px solid ",";border-radius:",";padding:10px 14px;font-size:",";line-height:",";word-break:break-word;:focus{outline:none;border:1px solid ",";}::placeholder{color:",";}:disabled{border:1px solid ",";background-color:",";::placeholder{color:",";}}"],e=>{let{autoResize:t}=e;return!t&&"height: 128px;"},e=>{let{theme:t}=e;return t.colors.black[10]},e=>{let{theme:t}=e;return t.borderRadius.medium},e=>{let{theme:t}=e;return t.fontSize.primary},e=>{let{theme:t}=e;return t.lineHeight.primary},e=>{let{theme:t}=e;return t.colors.primary[120]},e=>{let{theme:t}=e;return t.colors.black[60]},e=>{let{theme:t}=e;return t.colors.black[4]},e=>{let{theme:t}=e;return t.colors.black[4]},e=>{let{theme:t}=e;return t.colors.black[40]}),d=e=>{let{children:t,placeholder:r,name:o,register:d,className:c,textAreaClassName:u,disabled:m,error:p,marginBottomFormRow:h,value:x,dataCy:g,id:b,autoResize:f=!1,minRows:y=1,maxRows:v}=e,j=(0,s.useRef)(null),w=()=>{let e=j.current;if(!e||!f)return;e.style.height="auto";let t=e.scrollHeight,r=!1;if(y&&(t=Math.max(t,(parseInt(getComputedStyle(e).lineHeight)||20)*y)),v){let a=(parseInt(getComputedStyle(e).lineHeight)||20)*v;t>
1a&&(t=a,r=!0)}e.style.height=t+"px",e.style.overflowY=r?"auto":"hidden"};(0,s.useEffect)(()=>{f&&w()},[x,r,f]),(0,s.useEffect)(()=>{if(!f)return;let e=()=>{setTimeout(w,0)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[f]);let{ref:k,...N}=d(o);return(0,a.jsxs)(l,{className:c,error:!!p,marginBottomFormRow:h,"data-sentry-element":"Wrapper","data-sentry-component":"Textarea","data-sentry-source-file":"Textarea.tsx",children:[t,(0,a.jsx)(i,{ref:e=>{k(e),j.current=e},id:null!=b?b:"",placeholder:r,disabled:m,value:x&&x,className:u,style:{...m?{color:"#7583A1"}:void 0,...f?{resize:"none"}:void 0},"data-cy":g,rows:f?y:void 0,...N,onChange:e=>{N.onChange(e),f&&w()},onInput:f?w:void 0,"data-sentry-element":"TextareaInput","data-sentry-source-file":"Textarea.tsx"}),(null==p?void 0:p.message)&&(0,a.jsx)("div",{style:{marginTop:"0.25rem"},children:(0,a.jsx)(n.sG,{children:null==p?void 0:p.message})})]})}},94071:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>K});var a=r(37876),s=r(86200),n=r(2979),o=r(23377),l=r(53969),i=r(14232),d=r(40620),c=r(54663),u=r(87707),m=r(43371),p=r(63370),h=r(60509),x=r(29321),g=r(91722),b=r(69798),f=r(28959),y=r(89638),v=r(45938);let j=e=>{let{short:t,index:r,onSelect:s,className:n,onDelete:o,onEdit:l}=e,{title:i,thumbnail:d,duration:c,createdAt:u}=t;return(0,a.jsxs)("div",{role:"article",className:(0,g.cn)("group mb-2 w-full cursor-pointer overflow-hidden rounded-xl border bg-white shadow-md",null!=n?n:""),onClick:s,"data-sentry-component":"AdminShortItem","data-sentry-source-file":"AdminShortItem.tsx",children:[(0,a.jsxs)("div",{className:"relative aspect-video",children:[(0,a.jsx)("img",{src:d,alt:"".concat(i," Thumbnail"),role:"presentation",className:"h-full w-full object-cover"}),(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,a.jsx)(b.s,{className:"h-12 w-12 opacity-0 transition-opacity duration-300 group-hover:opacity-80","data-sentry-element":"PlayButtonIcon","data-sentry-source-file":"AdminShortItem.tsx"})}),(0,a.jsxs)("p",{className:"absolute left-2 top-2 rounded bg-cobalt-blue-500 p-2 text-xs text-white",children:["Upload date: ",(0,v.Yq)(u,"MMM d, yyyy")]}),(0,a.jsx)("div",{className:"absolute right-2 top-2",children:(0,a.jsx)(f.p,{isButton:!0,variant:"bottom",items:[{label:"Edit short",onClick:()=>l(t)},{label:"Delete short",onClick:()=>o(t),isDanger:!0}],"data-sentry-element":"KebabMenuV2","data-sentry-source-file":"AdminShortItem.tsx"})}),(0,a.jsx)("p",{className:"absolute bottom-2 right-2 rounded bg-dark-50 px-2 font-semibold text-dark-700",children:(0,y.xm)(c)})]}),(0,a.jsx)("div",{className:"border-t border-gray-200"}),(0,a.jsx)("div",{className:"flex flex-col gap-6 bg-white p-6",children:(0,a.jsx)("p",{className:"line-clamp-2 text-base font-medium",children:i})})]},"".concat(i,"-").concat(r))};j.displayName="AdminShortItem";var w=r(71090),k=r(88992),N=r(64941),S=r(57888),C=r(27772),A=r(39324),P=r.n(A),I=r(14259),M=r(80174),T=r(24856),D=r(97979),E=r(64232),F=r(50926),B=r(10368);let L=()=>{let{NEXT_BASE_CLIENT_URL:e}=P()().publicRuntimeConfig,{register:t,formState:{errors:r},control:s,watch:n,setValue:l}=(0,k.xW)(),d=n("videoUrl"),c=(0,F.A)(),[u,m]=(0,i.useState)(null),[h,x]=(0,i.useState)(!1),[b,f]=(0,i.useState)(!1),y=(0,p.d7)(u,o.BL);(0,i.useEffect)(()=>{if(c)return;if(!d){x(!1),m(null),l("duration",""),l("title","");return}x(!0);let e=(0,g.V3)(d);if(!e){l("duration",""),l("title",""),x(!1),m(null);return}e!==u&&(m(e),f(!0))},[d,u,l]);let v=(0,i.useCallback)(e=>{x(!1);let t=e.target.getDuration()/60;l("duration",(0,E.a3)(t),{shouldValidate:!0}),l("title",e.target.videoTitle,{shouldValidate:!0}),f(!1)},[l]),j=(0,i.useCallback)(()=>{x(!1),f(!1),l("duration",""),l("title","")},[l]);return(0,a.jsx)("div",{className:"w-full","data-sentry-component":"ShortsForm","data-sentry-source-file":"ShortsForm.tsx",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-6",children:[y&&b&&(0,a.jsx)("div",{className:"hidden",children:(0,a.jsx)(I.A,{opts:{playerVars:{autoplay:!1,cc_load_policy:1,controls:0,rel:0,origin:e}},loading:"lazy",onReady:v,...u&&{videoId:u},onError:j})}),(0,a.jsx)(T.A,{label:"Video URL",register:t,name:"videoUrl",error:r.videoUrl,placeholder:"e.g. https://youtu.be/dQw4w9WgXcQ","data-sentry-element":"TextField","data-sentry-source-file":"ShortsForm.tsx"}),(0,a.jsx)(T.A,{label:"Title",placeholder:h?"Retrieving title...":"
1Video title",register:t,name:"title",error:r.title,"data-sentry-element":"TextField","data-sentry-source-file":"ShortsForm.tsx"}),(0,a.jsx)(T.A,{disabled:!0,placeholder:"00:00:00",label:"Duration",register:t,name:"duration",error:r.duration,"data-sentry-element":"TextField","data-sentry-source-file":"ShortsForm.tsx"}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(M.T,{id:"description",placeholder:"",register:t,error:null==r?void 0:r.description,name:"description","data-sentry-element":"Textarea","data-sentry-source-file":"ShortsForm.tsx",children:(0,a.jsx)(D.p2,{htmlFor:"description","data-sentry-element":"TextfieldLabel","data-sentry-source-file":"ShortsForm.tsx",children:"Description"})})}),(0,a.jsx)(k.xI,{name:"thumbnail",control:s,render:e=>{var t,s;let{field:n}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(B.t,{onChange:n.onChange,value:null!=(s=n.value)?s:"",isEdit:!1}),(null==r?void 0:r.thumbnail)&&(0,a.jsx)(D.sG,{className:"text-center",children:null==(t=r.thumbnail)?void 0:t.message})]})},"data-sentry-element":"Controller","data-sentry-source-file":"ShortsForm.tsx"})]})})};L.displayName="ShortsForm";var R=r(39091);let z=R.Ik({title:R.Yj().max(128,"Title is too long").required("Title is required"),description:R.Yj().required("Description is required").max(512,"Description must be less than 512 characters"),duration:R.Yj().required("Duration is required").matches(/^([0-9]{2}):([0-5][0-9]):([0-5][0-9])$/,"Duration must be in the format HH:MM:SS").test("duration-validation","Duration is required",e=>{if(!e)return!1;let[t,r,a]=e.split(":").map(Number);return!!t||!!r||!!a}),thumbnail:R.gl().required("Thumbnail is required").test("fileSize","File size must be less than 10MB",e=>"string"==typeof e||!!e&&e.size<=o.No).test("fileType","File must be JPG or PNG",e=>"string"==typeof e||!!e&&o.Ft.includes(e.type)),videoUrl:R.Yj().url("Must be a URL").required("Video URL is required")}),V=e=>{let{onClose:t,short:r,isEditing:s}=e,n=(0,k.mN)({resolver:(0,w.t)(z),defaultValues:{title:null==r?void 0:r.title,description:null==r?void 0:r.description,videoUrl:null==r?void 0:r.videoUrl,thumbnail:null==r?void 0:r.thumbnail,duration:null==r?void 0:r.duration}}),[o,{isLoading:l,isError:i}]=(0,x.Bm)(),[d,{isLoading:c}]=(0,x.uJ)(),p=async e=>{try{if(s&&r){let t=Object.keys(e).reduce((t,a)=>(e[a]!==r[a]&&(t[a]=e[a]),t),{});await d({...t,slug:r.slug}).unwrap()}else await o(e).unwrap();(0,u.P)("Short ".concat(s?"updated":"created"," successfully"),"Success",m.l.success,null),t()}catch(e){if((0,g.ht)(e)){let{data:t}=e.response;Object.keys(t).forEach(e=>{t[e]&&n.setError(e,{type:"manual",message:t[e][0]})})}else n.setError("thumbnail",{type:"manual",message:"Something went wrong"})}};return(0,a.jsx)("form",{onSubmit:n.handleSubmit(p),"data-sentry-component":"ModalShortsForm","data-sentry-source-file":"ModalShortsForm.tsx",children:(0,a.jsx)(S.a,{title:"".concat(s?'Edit "'.concat(null==r?void 0:r.title,'"'):"Create Short"),actionButtons:(0,a.jsxs)(C.eM,{children:[(0,a.jsx)(N.$,{onClick:t,type:"button",children:"Cancel"}),(0,a.jsx)(N.$,{disabled:l||c,variant:"isPrimary",type:"submit",children:"Save Changes"})]}),handleClose:t,width:"32rem","data-sentry-element":"Modal","data-sentry-source-file":"ModalShortsForm.tsx",children:(0,a.jsx)(k.Op,{...n,"data-sentry-element":"FormProvider","data-sentry-source-file":"ModalShortsForm.tsx",children:(0,a.jsx)(L,{"data-sentry-element":"ShortsForm","data-sentry-source-file":"ModalShortsForm.tsx"})})})})};V.displayName="ModalShortsForm";let H=()=>(0,a.jsx)("div",{"data-testid":"shorts-skeleton",className:"mt-10 grid w-full min-w-full grid-cols-1 gap-4 md:grid-cols-3","data-sentry-component":"ShortsSkeleton","data-sentry-source-file":"ShortsSkeleton.tsx",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"w-full flex-shrink-0 animate-pulse overflow-hidden rounded-xl bg-white shadow-md",children:[(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("div",{className:"absolute left-2 top-2 h-4 w-36 rounded bg-gray-200"})}),(0,a.jsx)("div",{className:"relative aspect-video bg-gray-200",children:(0,a.jsx)("div",{className:"absolute bottom-2 right-2 h-6 w-12 rounded bg-gray-300"})}),(0,a.jsx)("div",{className:"border-t border-gray-100"}),(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)("div",{className:"h-4 w-3/4 rounded bg-gray-200"})})]},e))});var U=r(83521),_=r(51694),W=r(71876);let q=e=>{let{handleChange:t,handleCreateShortModal:r,handleFilterByCreatedAt:s}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(T.A,{name:"searchInput",icon:"/icons/magnifyingGlass.svg",iconLeft:!0,placeholder:"Search by name",className:"!w-[550px]",onChange:t,"data-sentry-element":"TextField","data-sentry-source-file":"HeaderActions.tsx"}),(0,a.jsx)("span",{className:"my-auto text-sm font-semibold",children:"Date created"}),(0,a.jsx)("div",{className:"w-1/6",children:(0,a.jsx)(_.m,{data:[{value:"",label:"-"},{value:"1",label:"1 Day Ago"},{value:"7",label:"7 Days Ago"},{value:"30",label:"30 Days Ago"}],placeholder:"-",onChange:s,"data-sentry-element":"Dropdown","data-sentry-source-file":"HeaderActions.tsx"})})]}),(0,a.jsxs)(N.$,{variant:"isPrimary",onClick:r,"data-cy":"add-course-button","data-sentry-element":"Button","data-sentry-source-file":"HeaderActions.tsx",children:[(0,a.jsx)(W.c,{className:"stroke-white","data-sentry-element":"PlusIcon","data-sentry-source-file":"HeaderActions.tsx"}),"Create Short"]})]})};q.displayName="HeaderActions";let G=()=>{var e;let[t,r]=(0,i.useState)(""),[s,n]=(0,i.useState)(""),[l,g]=(0,i.useState)(!1),[b,f]=(0,i.useState)(null),[y,v]=(0,i.useState)(!1),w=(0,p.d7)(t,o.BL),{data:k,isLoading:N,isFetching:S}=(0,h.DH)({ordering:"-created_at",...w&&{search:w},...s&&{createdAt:s}}),[C,{isLoading:A}]=(0,x.Ip)(),P=e=>{f(e),v(!y)},I=()=>{f(null),g(!l)},M=e=>{f(e),g(!l)},T=async()=>{try{b&&await C(b.slug).unwrap(),f(null),v(!1),(0,u.P)("Short deleted successfully","Success",m.l.success,null)}catch(e){(0,u.P)("There was an error deleting this short","Error",m.l.error,null)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(U.Z,{"data-sentry-element":"HeaderWrapper","data-sentry-source-file":"ShortsManagement.tsx",children:(0,a.jsx)(q,{handleChange:e=>{r(e.target.value)},handleCreateShortModal:I,handleFilterByCreatedAt:e=>{n(e.value)},"data-sentry-element":"HeaderActions","data-sentry-source-file":"ShortsManagement.tsx"})}),(0,a.jsx)("div",{className:"container mx-auto mt-10",children:!k||N||S?(0,a.jsx)(H,{}):(0,a.jsx)(d.z,{data:k.results,keyExtractor:e=>e.id,emptyContent:"No ".concat(w?"results":"shorts"," found"),renderItem:(e,t)=>
1(0,a.jsx)(j,{short:e,index:t,onSelect:()=>{},onDelete:P,onEdit:M})})}),l&&(0,a.jsx)(V,{short:b,onClose:I,isEditing:!!b}),y&&(0,a.jsx)(c.v,{isSubmitting:A,title:'Delete "'.concat(null!=(e=null==b?void 0:b.title)?e:"",'"'),actionButtonTitle:"Delete",message:"Are you sure you want to delete this short? This action cannot be undone.",handleClose:()=>P(null),handleDelete:T,modalParentClass:"!w-[600px]",isDelete:!0})]})},O=()=>(0,a.jsx)(n.O,{allowedPermissions:[...o.yY],"data-sentry-element":"ProtectedRoute","data-sentry-component":"ShortsAdminPage","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(s.P,{title:"Admin Panel: Enable Shorts","data-sentry-element":"Layout","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(l.d,{title:"Admin Panel / Shorts","data-sentry-element":"AdminPanelContainer","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(G,{"data-sentry-element":"ShortsManagement","data-sentry-source-file":"index.tsx"})})})});O.isRestricted=!0,O.displayName="ShortsAdminPage";let K=O}},e=>{e.O(0,[9030,7972,4442,8001,3781,722,7101,6777,6896,3370,2163,6200,1694,636,6593,8792],()=>e(e.s=28491)),_N_E=e.O()}]);

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.