1"use strict";(self.webpackChunkmy_webpack_project=self.webpackChunkmy_webpack_project||[]).push([[5029],{97082(e,t,n){n.d(t,{A:()=>T});var o=n(39471),r=n(54777),a=n(2366),i=n(17138),l=n(94854),s=n(73433),c=n(87073),d=n.n(c),m=n(39105),u=n(5832),p=n(75594),g=n(79905),h=n(11092),f=n(30348),v=n(93042),b=n(67403);const y=(e,t,n,o,r)=>({background:e,border:`${(0,f.zA)(o.lineWidth)} ${o.lineType} ${t}`,[`${r}-icon`]:{color:n}}),_=e=>{const{componentCls:t,motionDurationSlow:n,marginXS:o,marginSM:r,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:u,withDescriptionPadding:p,defaultPadding:g}=e;return{[t]:Object.assign(Object.assign({},(0,v.dF)(e)),{position:"relative",display:"flex",alignItems:"center",padding:g,wordWrap:"break-word",borderRadius:s,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:o,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:u},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${n} ${c}, opacity ${n} ${c},\n padding-top ${n} ${c}, padding-bottom ${n} ${c},\n margin-bottom ${n} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:p,[`${t}-icon`]:{marginInlineEnd:r,fontSize:d,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:o,color:u,fontSize:i},[`${t}-description`]:{display:"block",color:m}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},$=e=>{const{componentCls:t,colorSuccess:n,colorSuccessBorder:o,colorSuccessBg:r,colorWarning:a,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:d,colorInfo:m,colorInfoBorder:u,colorInfoBg:p}=e;return{[t]:{"&-success":y(r,o,n,e,t),"&-info":y(p,u,m,e,t),"&-warning":y(l,i,a,e,t),"&-error":Object.assign(Object.assign({},y(d,c,s,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},A=e=>{const{componentCls:t,iconCls:n,motionDurationMid:o,marginXS:r,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,f.zA)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${n}-close`]:{color:i,transition:`color ${o}`,"&:hover":{color:l}}},"&-close-text":{color:i,transition:`color ${o}`,"&:hover":{color:l}}}}},w=(0,b.OF)("Alert",e=>[_(e),$(e),A(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}));var E=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const S={success:r.A,info:s.A,error:a.A,warning:l.A},C=e=>{const{icon:t,prefixCls:n,type:r}=e,a=S[r]||null;return t?(0,g.fx)(t,o.createElement("span",{className:`${n}-icon`},t),()=>({className:d()(`${n}-icon`,t.props.className)})):o.createElement(a,{className:`${n}-icon`})},I=e=>{const{isClosable:t,prefixCls:n,closeIcon:r,handleClose:a,ariaProps:l}=e,s=!0===r||void 0===r?o.createElement(i.A,null):r;return t?o.createElement("button",Object.assign({type:"button",onClick:a,className:`${n}-close-icon`,tabIndex:0},l),s):null},x=o.forwardRef((e,t)=>{const{description:n,prefixCls:r,message:a,banner:i,className:l,rootClassName:s,style:c,onMouseEnter:g,onMouseLeave:f,onClick:v,afterClose:b,showIcon:y,closable:_,closeText:$,closeIcon:A,action:S,id:x}=e,j=E(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[k,O]=o.useState(!1),N=o.useRef(null);o.useImperativeHandle(t,()=>({nativeElement:N.current}));const{getPrefixCls:z,direction:M,closable:B,closeIcon:H,className:P,style:D}=(0,h.TP)("alert"),T=z("alert",r),[W,F,L]=w(T),R=t=>{var n;O(!0),null===(n=e.onClose)||void 0===n||n.call(e,t)},q=o.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),G=o.useMemo(()=>!("object"!=typeof _||!_.closeIcon)||!!$||("boolean"==typeof _?_:!1!==A&&null!=A||!!B),[$,A,_,B]),U=!(!i||void 0!==y)||y,V=d()(T,`${T}-${q}`,{[`${T}-with-description`]:!!n,[`${T}-no-icon`]:!U,[`${T}-banner`]:!!i,[`${T}-rtl`]:"rtl"===M},P,l,s,L,F),X=(0,u.A)(j,{aria:!0,data:!0}),Y=o.useMemo(()=>"object"==typeof _&&_.closeIcon?_.closeIcon:$||(void 0!==A?A:"object"==typeof B&&B.closeIcon?B.closeIcon:H),[A,_,B,$,H]),K=o.useMemo(()=>{const e=null!=_?_:B;if("object"==typeof e){const{closeIcon:t}=e;return E(e,["closeIcon"])}return{}},[_,B]);return W(o.createElement(m.Ay,{visible:!k,motionName:`${T}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:b},({className:t,style:r},i)=>o.createElement("div",Object.assign({id:x,ref:(0,p.K4)(N,i),"data-show":!k,className:d()(V,t),style:Object.assign(Object.assign(Object.assign({},D),c),r),onMouseEnter:g,onMouseLeave:f,onClick:v,role:"alert"},X),U?o.createElement(C,{description:n,icon:e.icon,prefixCls:T,type:q}):null,o.createElement("div",{className:`${T}-content`},a?o.createElement("div",{className:`${T}-message`},a):null,n?o.createElement("div",{className:`${T}-description`},n):null),S?o.createElement("div",{className:`${T}-action`},S):null,o.createElement(I,{isClosable:G,prefixCls:T,closeIcon:Y,handleClose:R,ariaProps:K}))))}),j=x;var k=n(7564),O=n(52690),N=n(77591),z=n(94445),M=n(57881),B=n(68964);let H=function(e){function t(){var e,n,o,r;return(0,k.A)(this,t),n=this,o=t,r=arguments,o=(0,N.A)(o),(e=(0,M.A)(n,(0,z.A)()?Reflect.construct(o,r||[],(0,N.A)(n).constructor):o.apply(n,r))).state={error:void 0,info:{componentStack:""}},e}
1return(0,B.A)(t,e),(0,O.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){const{message:e,description:t,id:n,children:r}=this.props,{error:a,info:i}=this.state,l=(null==i?void 0:i.componentStack)||null,s=void 0===e?(a||"").toString():e,c=void 0===t?l:t;return a?o.createElement(j,{id:n,type:"error",message:s,description:o.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},c)}):r}}])}(o.Component);const P=H,D=j;D.ErrorBoundary=P;const T=D},5029(e,t,n){n.r(t);var o=n(39471),r=n(97082),a=n(86287),i=n(28563),l=n(53836),s=n(50256),c=n(71757),d=n(34646),m=n(93267),u=n(48586),p=n(58480),g=n(51794);function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=a.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}const v=p.A.Text;n.d(t,["default",0,()=>{const e=h(l.A.useForm(),1)[0],t=h((0,o.useState)(!0),2),n=t[0],p=t[1],f=h((0,o.useState)(!1),2),b=f[0],y=f[1],_=h((0,o.useState)(null),2),$=_[0],A=_[1],w=async()=>{try{var t,n;p(!0),A(null);const o=await g.tY.GetSystemConfig(),r=(null==o?void 0:o.data)||{};e.setFieldsValue({video_pass_balance_warning_threshold:null!==(t=r.video_pass_balance_warning_threshold)&&void 0!==t?t:1e3,video_pass_balance_critical_threshold:null!==(n=r.video_pass_balance_critical_threshold)&&void 0!==n?n:500,video_pass_alert_emails:r.video_pass_alert_emails||""})}catch(e){var o,r;console.error("Failed to fetch SystemConfig:",(null==e||null===(o=e.response)||void 0===o?void 0:o.data)||e),A((null==e||null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.error)||"Failed to load settings.")}finally{p(!1)}};return(0,o.useEffect)(()=>{w()},[]),n?o.createElement("div",{style:{textAlign:"center",padding:"60px 0"}},o.createElement(u.A,{size:"large"})):$?o.createElement(r.A,{type:"error",message:$}):o.createElement(i.A,{title:"Video Pass â Balance Alerts",style:{maxWidth:720}},o.createElement(v,{type:"secondary"},'Thresholds drive the dashboard\'s color states and email alerts. Warning fires first (higher balance, "running low"); Critical fires when even lower ("urgent"). Warning must be greater than Critical.'),o.createElement(l.A,{form:e,layout:"vertical",style:{marginTop:24}},o.createElement(l.A.Item,{name:"video_pass_balance_warning_threshold",label:"Warning threshold (USD)",tooltip:"Dashboard turns yellow when balance ⤠this amount.",rules:[{required:!0,message:"Required"}]},o.createElement(c.A,{style:{width:220},min:1,step:50,precision:0,prefix:"$"})),o.createElement(l.A.Item,{name:"video_pass_balance_critical_threshold",label:"Critical threshold (USD)",tooltip:"Dashboard turns red when balance ⤠this amount.",rules:[{required:!0,message:"Required"}]},o.createElement(c.A,{style:{width:220},min:1,step:50,precision:0,prefix:"$"})),o.createElement(l.A.Item,{name:"video_pass_alert_emails",label:"Alert email recipients",tooltip:"Comma-separated email addresses. Leave blank to send the alert to every active admin user on the site.",extra:"If empty, every active admin user on the site receives the alert."},o.createElement(s.A,{placeholder:"[email protected], [email protected]",maxLength:1e3})),o.createElement(m.A,null,o.createElement(a.A,{type:"primary",loading:b,onClick:async()=>{try{const t=await e.validateFields();if(Number(t.video_pass_balance_warning_threshold)<=Number(t.video_pass_balance_critical_threshold))return void d.Ay.error("Warning threshold must be greater than the critical threshold.");y(!0),await g.tY.UpdateSystemConfig({video_pass_balance_warning_threshold:Number(t.video_pass_balance_warning_threshold),video_pass_balance_critical_threshold:Number(t.video_pass_balance_critical_threshold),video_pass_alert_emails:t.video_pass_alert_emails||""}),d.Ay.success("Video Pass settings saved")}catch(e){var t,n,o;if(null!=e&&e.errorFields)return;console.error("Failed to save:",(null==e||null===(t=e.response)||void 0===t?void 0:t.data)||e);const r=(null==e||null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.error)||("object"==typeof(null==e||null===(o=e.response)||void 0===o?void 0:o.data)?Object.entries(e.response.data).map(e=>{let t=h(e,2),n=t[0],o=t[1];return"".concat(n,": ").concat(Array.isArray(o)?o.join(", "):o)}).join("; "):null)||"Failed to save settings.";d.Ay.error(r)}finally{y(!1)}}},"Save"),o.createElement(a.A,{onClick:w,disabled:b},"Reset"))))}])}}]);
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.