PageSourceSearch

https://dashboard.xfa.tech/static/js/9335.d918fdf4.chunk.js

js xfa.tech collected 2026-09-24 09:30:03 UTC 103,390 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkxfa_dashboard=self.webpackChunkxfa_dashboard||[]).push([[9335],{98(e,i,o){o.d(i,{A:()=>n});o(9950);var s=o(44414);const n=e=>{let i=e.className,o=e.text,n=void 0===o?"beta":o;return(0,s.jsxs)("span",{className:i?"beta-tag ".concat(i):"beta-tag","aria-hidden":"true","data-testid":"beta-badge",children:["(",n,")"]})}},3720(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/linux-icon.877f1049c56e213dd8d7c4d47ee98cbc.svg"},4477(e,i,o){o.d(i,{A:()=>a});var s=o(23235),n=o(44414);const a=(0,s.A)((0,n.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft")},6493(e,i,o){o.d(i,{A:()=>f});var s=o(80045),n=o(89379),a=o(9950),t=o(72004),c=o(88465),l=o(19608),r=o(59254),d=o(18463),p=o(87233),u=o(1763),y=o(423);function m(e){return(0,y.Ay)("MuiDialogContentText",e)}(0,u.A)("MuiDialogContentText",["root"]);var h=o(44414);const v=["children","className"],g=(0,r.Ay)(p.A,{shouldForwardProp:e=>(0,l.A)(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,i)=>i.root})({}),f=a.forwardRef(function(e,i){const o=(0,d.b)({props:e,name:"MuiDialogContentText"}),a=(o.children,o.className),l=(0,s.A)(o,v),r=(e=>{const i=e.classes,o=(0,c.A)({root:["root"]},m,i);return(0,n.A)((0,n.A)({},i),o)})(l);return(0,h.jsx)(g,(0,n.A)((0,n.A)({component:"p",variant:"body1",color:"textSecondary",ref:i,ownerState:l,className:(0,t.A)(r.root,a)},o),{},{classes:r}))})},9245(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/android-icon.cdb79089d01ac68acef825a0ac7e4613.svg"},10783(e,i,o){o.d(i,{A:()=>a});var s=o(23235),n=o(44414);const a=(0,s.A)((0,n.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline")},19946(e,i,o){function s(e,i){return i(e.windows)+i(e.macOs)+i(e.linux)+i(e.android)+i(e.ios)+i(e.ipadOS)}function n(e){return e?{os:s(e,e=>e.osNotUpToDate||0),os_autoupdate:s(e,e=>e.osNotAutoUpdate||0),browser:s(e,e=>e.browserNotUpToDate||0),disk_encryption:s(e,e=>e.diskEncryptionNotActive||0),screen_lock:s(e,e=>e.authenticationNotActive||0),antivirus:s(e,e=>e.antivirusNotEnabled||0),password_manager:s(e,e=>e.passwordManagerNotInstalled||0),biometrics:s(e,e=>e.biometricsNotActive||0),reboot:s(e,e=>e.recentRebootNot||0),firewall:s(e,e=>e.firewallNotEnabled||0),find_my_device:s(e,e=>e.findMyDeviceNotEnabled||0),dns:s(e,e=>e.dnsNotCompliant||0),screen_sharing:s(e,e=>e.screenSharingEnabled||0),remote_scripting:s(e,e=>e.remoteScriptingEnabled||0),remote_management:s(e,e=>e.remoteManagementEnabled||0),remote_login:s(e,e=>e.remoteLoginEnabled||0),windows_recall:s(e,e=>e.windowsRecallAvailable||0),jailbroken:s(e,e=>(e.isJailbroken||0)+(e.isRooted||0)),developer_mode:s(e,e=>e.developerModeEnabled||0),secure_boot_enabled:s(e,e=>e.secureBootEnabled||0),integrity_protection_enabled:s(e,e=>e.integrityProtectionEnabled||0)}:null}o.d(i,{q:()=>n})},21750(e,i,o){o.d(i,{H:()=>n});var s=o(9950);const n=e=>{let i=e.hasUnsavedChanges,o=e.message;(0,s.useEffect)(()=>{const e=e=>{if(i)return e.preventDefault(),e.returnValue=o,o};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[i,o])}},23354(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/Slack-icon.75843cc7b002489e3c23e3105b8feac2.svg"},36665(e,i,o){e.exports=o.p+"static/media/Teams-icon.eeca978daf9901d2cb41.png"},38408(e,i,o){o.d(i,{A:()=>a});var s=o(23235),n=o(44414);const a=(0,s.A)((0,n.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline")},40033(e,i,o){o.d(i,{A:()=>v});var s=o(89379),n=o(80045),a=o(9950),t=o(72004),c=o(88465),l=o(87233),r=o(59254),d=o(18463),p=o(23025),u=o(5536),y=o(44414);const m=["className","id"],h=(0,r.Ay)(l.A,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,i)=>i.root})({padding:"16px 24px",flex:"0 0 auto"}),v=a.forwardRef(function(e,i){const o=(0,d.b)({props:e,name:"MuiDialogTitle"}),l=o.className,r=o.id,v=(0,n.A)(o,m),g=o,f=(e=>{const i=e.classes;return(0,c.A)({root:["root"]},p.t,i)})(g),x=a.useContext(u.A).titleId,_=void 0===x?r:x;return(0,y.jsx)(h,(0,s.A)({component:"h2",className:(0,t.A)(f.root,l),ownerState:g,ref:i,variant:"h6",id:null!==r&&void 0!==r?r:_},v))})},48608(e,i,o){o.d(i,{A:()=>y});var s=o(89379),n=(o(9950),o(55158)),a=o(96583),t=o(28170),c=o(25333),l=o(87233),r=o(10226),d=o(66096),p=o(86835),u=o(44414);const y=e=>{let i=e.open,o=e.onClose,y=e.badge,m=e.title,h=e.description,v=e.primaryLabel,g=e.onPrimary,f=e.dialogProps;const x=(0,d.A)("(min-width:992px)")?260:0;return(0,u.jsxs)(u.Fragment,{children:[i&&(0,u.jsx)(n.A,{open:!0,style:{zIndex:1299,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",left:x,top:60},onClick:o}),(0,u.jsx)(a.A,(0,s.A)((0,s.A)({open:i,onClose:o,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{backgroundColor:"white",borderRadius:"12px",boxShadow:"0px 8px 8px -4px #10182808, 0px 20px 24px -4px #10182814"}},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},sx:{position:"absolute",left:x,top:60,right:0,bottom:0,width:"auto",height:"auto",pointerEvents:"none","& .MuiDialog-container":{pointerEvents:"auto",height:"100%",alignItems:"center"}}},f),{},{children:(0,u.jsxs)(t.A,{sx:{display:"flex",flexDirection:"column",gap:2,p:3,position:"relative"},children:[(0,u.jsx)(c.A,{onClick:o,"aria-label":"Close",sx:{position:"absolute",top:8,right:8,color:"var(--color-gray-500)"},children:(0,u.jsx)(p.A,{})}),(0,u.jsx)("span",{className:"plan-upgrade-badge",children:y}),(0,u.jsx)(l.A,{variant:"h5",sx:{fontWeight:700,mb:1},children:m}),(0,u.jsx)(l.A,{variant:"body1",sx:{color:"var(--color-gray-700)"},children:h}),(0,u.jsx)("div",{style:{display:"flex",gap:12,marginTop:12},children:(0,u.jsx)(r.A,{variant:"contained",onClick:g,sx:{textTransform:"none",borderRadius:"8px",padding:"10px 16px"},children:v})})]})}))]})}},49959(e,i,o){o.d(i,{$Z:()=>g,F7:()=>k,TY:()=>m,WX:()=>h,aB:()=>_,dr:()=>f,g6:()=>x,gf:()=>v,hu:()=>y,yf:()=>r});var s=o(84730),n=o(58560),a=o(48091),t=o(22046),c=o(34263);function l(e,i){if(!s.yw.includes(i))return!0;return!(0,n._M)(e)||Boolean((0,n.Y_)(e,i))}function r(e,i){return(0,a.q$)(e,i)}function d(e,i,o){const s=a.z4[e].policyKey;return i.policy_id===t.JE?"dns_servers_compliant"!==e:"os_uptodate"===e?o?(0,c.uw)((0,c.WK)(i,o.os_name).value):(0,c.kc)(i):!!s&&(0,a.v)(i,s)}function p(e,i){const o=a.M$[i];if(!o)return!0;const s=e[o];return"string"===typeof s&&s.length>0}function u(e,i){return s.oT.includes(i)&&r(e,i)&&(0,s.Pw)(e,i)}function y(e,i,o){const s=[];for(const n of Object.keys(a.z4)){if("nativeClientInstalled"===n)continue;if(null!==o&&void 0!==o&&o.includes(n))continue;a.z4[n].policyKey?r(e,n)&&p(e,n)&&d(n,i,e)&&l(e,n)&&s.push(n):u(e,n)&&s.push(n)}return s}function m(e,i,o){if(!i)return 0;const c=i.policy_id===t.JE;let l=0;for(const t of y(e,i,o)){const o=(0,n.Y_)(e,t);if(!c&&(0,n._M)(e)&&(0,n.Fn)(t)&&!o)continue;(0,s.lJ)(e,t,i)===a.En.Unsafe&&l++}return l}function h(e){if(!e)return[];if(e.policy_id===t.JE)return Object.keys(a.z4).filter(e=>"nativeClientInstalled"!==e&&"dns_servers_compliant"!==e);const i=[];for(const o of Object.keys(a.z4)){if("nativeClientInstalled"===o)continue;const n=a.z4[o].policyKey;("os_uptodate"===o?(0,c.kc)(e):n?(0,a.v)(e,n):!!s.oT.includes(o)&&(0,a.v)(e,o))&&i.push(o)}return i}function v(e,i,o){if(!i)return[];const c=i.policy_id===t.JE,l=[];for(const t of y(e,i,o)){const o=(0,n.Y_)(e,t);if(!c&&(0,n._M)(e)&&(0,n.Fn)(t)&&!o)continue;(0,s.lJ)(e,t,i)===a.En.Unsafe&&l.push(t)}return l}function g(e,i){const o=[];for(const s of Object.keys(a.z4)){if("nativeClientInstalled"===s)continue;if(null!==i&&void 0!==i&&i.includes(s))continue;a.z4[s].policyKey?r(e,s)&&o.push(s):u(e,s)&&o.push(s)}return o}function f(e,i){if(!i)return[];const o=[];for(const n of Object.keys(a.z4)){if("nativeClientInstalled"===n)continue;if(!r(e,n))continue;if(a.z4[n].policyKey){if(!d(n,i,e))continue;if(!l(e,n))continue}else if(!(0,s.Pw)(e,n))continue;const t=(0,s.lJ)(e,n,i);t!==a.En.NotPresent&&t!==a.En.DontShow&&o.push({check:n,risk:t,isEnforced:!0})}return o}function x(e,i,o){if(!i)return[];const n=[];for(const t of y(e,i,o)){(0,s.lJ)(e,t,i)===a.En.Unknown&&n.push(t)}return n}function _(e,i,o){if(!i)return{failing:[],unknown:[],failingCount:0};const n=[],t=[];for(const c of y(e,i,o)){const o=(0,s.lJ)(e,c,i);o===a.En.Unsafe?n.push(c):o===a.En.Unknown&&t.push(c)}return{failing:n,unknown:t,failingCount:n.length}}const b={secure_boot_enabled:"secure_boot_enabled_evaluated_by_policy",jailbroken:"jailbroken_evaluated_by_policy",rooted:"rooted_evaluated_by_policy",developer_mode:"developer_mode_evaluated_by_policy",integrity_protection_enabled:"integrity_protection_enabled_evaluated_by_policy",remote_login_enabled:"remote_login_enabled_evaluated_by_policy",remote_management_enabled:"remote_management_enabled_evaluated_by_policy",remote_scripting_enabled:"remote_scripting_enabled_evaluated_by_policy",screen_sharing_enabled:"screen_sharing_enabled_evaluated_by_policy",unattended_remote_access_enabled:"unattended_remote_access_enabled_evaluated_by_policy"};function k(e,i){if(void 0!==(0,n.Y_)(e,i))return!0;
1if(s.oT.includes(i))return(0,s.Pw)(e,i);const o=b[i];return!o||!0===e[o]}},51245(e,i,o){o.d(i,{A:()=>a});var s=o(23235),n=o(44414);const a=(0,s.A)((0,n.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline")},51392(e,i,o){o.d(i,{JY:()=>l,Om:()=>r,m6:()=>p,uX:()=>d});var s=o(44426),n=o(84730),a=o(48091),t=o(60927);const c=new Set([s.T.PLAY_PROTECT,s.T.DESKTOP_AWARENESS_NOTIFICATIONS,s.T.RUNAWAY_AI,s.T.AIKIDO_ENABLED,s.T.SELF_INVITE,s.T.PASSKEYS,s.T.FIX_FROM_WEB,s.T.IDP,s.T.GOOGLE_ENFORCEMENT]),l=e=>c.has(e),r=()=>l(s.T.SELF_INVITE),d=(e,i,o)=>{if(((e,i,o)=>"antivirus_enabled"===e?!!(0,a.m0)(null!==i&&void 0!==i?i:void 0)&&!!l(s.T.PLAY_PROTECT)&&(0,t.st)(o,s.T.PLAY_PROTECT):n.rd.includes(e)?!!l(s.T.RUNAWAY_AI)&&(0,t.st)(o,s.T.RUNAWAY_AI):!!n.aJ.includes(e)&&!!l(s.T.AIKIDO_ENABLED)&&(0,t.st)(o,s.T.AIKIDO_ENABLED))(e,i,o))return"antivirus_enabled"===e?"devices.checks.androidBeta":"devices.checks.beta"},p=e=>(0,t.st)(e,s.T.PLAY_PROTECT)?"discovery.Antivirus.tooltip_extra_play_protect":"discovery.Antivirus.tooltip_extra"},60123(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/WarningIcon.e8dce4ce0a2935fcffd554c1698fdb73.svg"},68476(e,i,o){o.d(i,{A:()=>a});var s=o(23235),n=o(44414);const a=(0,s.A)((0,n.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight")},73847(e,i,o){o.d(i,{A:()=>c});o(9950);var s=o(87233),n=o(65429),a=o(22056),t=o(44414);const c=e=>{let i=e.title,o=e.content,c=e.error,l=e.cancelText,r=e.confirmText,d=e.inProgress,p=e.confirmDisabled,u=void 0!==p&&p,y=e.confirmColor,m=e.onCancel,h=e.onConfirm;return(0,t.jsxs)(a._T,{open:!0,onClose:m,title:i,maxWidth:"xs",actions:(0,t.jsx)(a.d_,{onCancel:m,onConfirm:h,cancelText:l,confirmText:r,inProgress:d,confirmDisabled:u,confirmColor:y}),children:[o&&(0,t.jsx)(s.A,{sx:{color:"var(--color-gray-700)",fontSize:"14px",lineHeight:"20px"},children:o}),c&&(0,t.jsx)(n.A,{severity:"error",sx:{marginTop:o?"12px":0},children:c})]})}},77286(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/apple-icon.d3bc8a0b56393f7e3b7b2c6ddc22a38e.svg"},85496(e,i,o){o.d(i,{A:()=>v});var s=o(5544),n=o(9950),a=o(25333),t=o(86835),c=o(55030),l=o(43907),r=o(62784);const d=o.p+"static/media/enforcement-info.d8e6033f8943032a3420.png",p=o.p+"static/media/policies-info.d12c105862b24874eaf2.png",u=o.p+"static/media/discovery-info.e68c80d6ee37ec8cabb5.png",y=o.p+"static/media/awareness-info.a6d6ab20e4c0c684fea1.png";var m=o(44414);const h={[r.Y.ENFORCEMENT]:d,[r.Y.POLICY]:p,[r.Y.DISCOVERY]:u,[r.Y.AWARENESS]:y},v=e=>{let i=e.type,o=e.storageKey;const r=(0,c.Bd)().t,d="informational-card-dismissed-".concat(i),p=o||d,u=(0,l.R)(i,r),y=u.title,v=u.paragraphs,g=u.hasImage,f=h[i],x=g&&f,_=(0,n.useState)(()=>"true"===localStorage.getItem(p)),b=(0,s.A)(_,2),k=b[0],A=b[1];return k?null:(0,m.jsxs)("div",{className:"informational-card",children:[x&&(0,m.jsx)("div",{className:"informational-card__image-container",children:(0,m.jsx)("img",{src:f,alt:y,className:"informational-card__image"})}),(0,m.jsxs)("div",{className:"informational-card__content",children:[(0,m.jsxs)("div",{className:"informational-card__text",children:[(0,m.jsx)("h3",{className:"informational-card__title",children:y}),(0,m.jsx)("div",{className:"informational-card__body",children:v.map((e,i)=>(0,m.jsx)("p",{className:"informational-card__paragraph",dangerouslySetInnerHTML:{__html:e}},i))})]}),(0,m.jsx)(a.A,{className:"informational-card__close-button",onClick:()=>{localStorage.setItem(p,"true"),A(!0)},"aria-label":"Close",size:"small",children:(0,m.jsx)(t.A,{})})]})]})}},86966(e,i,o){o.d(i,{g:()=>a});o(9950);var s=o(83274),n=o(44414);const a=e=>{let i=e.options,o=e.selectedOption,a=e.onChange,t=e.className,c=void 0===t?"":t,l=e.disabled,r=void 0!==l&&l,d=e.disabledOptions,p=void 0===d?[]:d,u=e.onAttemptDisabledOption,y=e.disabledTooltip;return(0,n.jsx)("div",{className:"xfa-selector-container-small ".concat(c),children:i.map(e=>{const i=r||p.includes(e),t=i?null===y||void 0===y?void 0:y(e):void 0,c=(0,n.jsx)("button",{type:"button",className:"xfa-selector-option-small ".concat(o===e?"selected-option-small":""," ").concat(i?"disabled-option-small":""),"aria-disabled":i,tabIndex:i?-1:0,onClick:()=>{i?null===u||void 0===u||u(e):a(e)},children:e},e);return t?(0,n.jsx)(s.A,{title:t,placement:"top",arrow:!0,children:(0,n.jsx)("span",{children:c})},e):c})})}},90668(e,i,o){o.r(i),o.d(i,{default:()=>Bi});var s=o(5544),n=o(89379),a=o(9950),t=o(55030),c=o(20032),l=o(10226),r=o(46639),d=o(25333),p=o(25277),u=o(36080),y=o(65429),m=o(23235),h=o(44414);const v=(0,m.A)((0,h.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");var g=o(40635),f=o(10783),x=o(15769),_=o(34075),b=o(21671),k=o(1320),A=o(69780),j=o(9213),w=o(70693),N=o(82259),C=o(73847),S=o(87233),K=o(96583),T=o(40033),E=o(28170),P=o(6493);const D=e=>(0,h.jsxs)("svg",(0,n.A)((0,n.A)({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},e),{},{children:[(0,h.jsx)("path",{d:"M20 9L18.005 20.3463C17.8369 21.3026 17.0062 22 16.0353 22H7.96474C6.99379 22 6.1631 21.3026 5.99496 20.3463L4 9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.jsx)("path",{d:"M21 6L15.375 6M3 6L8.625 6M8.625 6V4C8.625 2.89543 9.52043 2 10.625 2H13.375C14.4796 2 15.375 2.89543 15.375 4V6M8.625 6L15.375 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]}));var O=o(66364),L=o(93412),R=o(28429),M=o(68476),z=o(9245),I=o(77286);const G=o.p+"static/media/dropdown-icon.14ce099a24f618421e6ea794bc6b40f3.svg";var B=o(3720),F=o(95882),W=o(83250),U=o(62649),V=o(36006),Y=o(77532),q=o(44851),J=o(34263),H=o(14857),X=o(66096),Q=o(22056),$=o(11045),Z=o(2522),ee=(o(50351),o(76865)),ie=o(84696);const oe=e=>{var i,o,r,d,p;
1const u=e.title,y=e.subtitle,m=e.description,v=e.policyKey,g=e.isVerificationEnabled,f=e.onVerificationToggle,x=e.warningAndBlockingState,_=e.warningPeriod,b=e.blockingPeriod,k=e.showAdditionalSettings,A=void 0===k||k,j=e.policyType,w=void 0===j?"enabled":j,N=e.goalTime,C=e.goalTimeInDays,T=e.screenLockMaxTimeout,E=e.riskLevel,P=e.isReadOnly,D=void 0!==P&&P,O=e.policyBinding,L=e.configureAriaLabel,R=e.dialogContext,z=e.overviewVariant,I=void 0!==z&&z,G=e.overviewMetadataOnly,B=void 0!==G&&G,F=e.overviewMetadata,U=e.renderOverview,V=e.editorNotice,Y=e.editorTitle,q=e.overviewFooter,J=e.onPolicyDraftConfirm,oe=e.draftConfirmation,se=(0,t.Bd)().t,ne=(0,H.A)(),ae=(0,X.A)(ne.breakpoints.down("sm")),te=a.useId(),ce=a.useState(null),le=(0,s.A)(ce,2),re=le[0],de=le[1],pe=a.useState(null),ue=(0,s.A)(pe,2),ye=ue[0],me=ue[1],he=a.useRef(null),ve="skip"===v||"agentless"===v||"unsupported"===v,ge=null===e.settingId?void 0:null!==(i=e.settingId)&&void 0!==i?i:v?"policy-setting-".concat(v):void 0,fe="version"===w||"reboot"===w||"enabled"===w||"dns"===w,xe=!!e.onWarningAndBlockingChange||!!e.onWarningPeriodChange||!!e.onWarningTimeOptionChange,_e=!!e.onBlockingPeriodChange||!!e.onBlockingTimeOptionChange,be=A&&(null!==(o=null===(r=e.settings)||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0||void 0!==e.additionalDnsSettings||void 0!==e.additionalIntuneTenantSettings||void 0!==e.additionalAikidoEndpointSettings,ke=fe||xe||_e||be||!!m,Ae=I&&B?a.isValidElement(u)?a.Children.toArray(u.props.children).filter(e=>a.isValidElement(e)&&e.type===$.A):[]:u,je=()=>{var i;if(D)return;he.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const o=(0,ee.X)(null!==(i=null===O||void 0===O?void 0:O.policy)&&void 0!==i?i:{policy_id:"",organization_id:"",name:""},null!==v&&void 0!==v?v:"os_autoupdate",e);de({initialDraft:o,draft:o})},we=()=>{var i;de(null),me(null),null===(i=e.onDirtyChange)||void 0===i||i.call(e,!1),window.setTimeout(()=>{var e;return null===(e=he.current)||void 0===e?void 0:e.focus()},0)},Ne=()=>we(),Ce=()=>{me(null)};return ve?(0,h.jsxs)("div",{className:"policy-dropdown".concat(I?" policy-dropdown--overview":""),id:ge,"data-policy-setting-key":v,tabIndex:-1,children:[(0,h.jsx)("div",{className:"policy-dropdown-header",children:(0,h.jsxs)("div",{className:"policy-dropdown-header-content",children:[(0,h.jsxs)("div",{className:"policy-dropdown-title-row",children:[(0,h.jsx)("div",{className:"policy-dropdown-title",children:Ae}),(0,h.jsx)(Z.A,{level:E})]}),y&&(0,h.jsx)("div",{className:"policy-dropdown-label",children:y}),F&&(0,h.jsx)("div",{className:"policy-dropdown-overview-metadata",children:F})]})}),(0,h.jsx)("div",{className:"policy-dropdown-control-bar",children:(0,h.jsx)("div",{className:"policy-dropdown-control",children:(0,h.jsx)(W.w,{inputProps:{"aria-label":L},checked:g,disabled:D,onChange:e=>{e.stopPropagation(),D||f(e.target.checked)}})})})]}):(0,h.jsxs)(h.Fragment,{children:[U?U(je):(0,h.jsxs)("div",{className:"policy-dropdown".concat(I?" policy-dropdown--overview":""),id:ge,"data-policy-setting-key":v,tabIndex:-1,children:[(0,h.jsx)("div",{className:"policy-dropdown-header",children:(0,h.jsxs)("div",{className:"policy-dropdown-header-content",children:[(0,h.jsxs)("div",{className:"policy-dropdown-title-row",children:[(0,h.jsx)("div",{className:"policy-dropdown-title",children:Ae}),(0,h.jsx)(Z.A,{level:E})]}),y&&(0,h.jsx)("div",{className:"policy-dropdown-label",children:y}),F&&(0,h.jsx)("div",{className:"policy-dropdown-overview-metadata",children:F})]})}),(0,h.jsx)(ie.A,{isGoalEnabled:g,policyType:w,goalTime:N,goalTimeInDays:C,warningAndBlockingState:x,warningPerio
1d:_,blockingPeriod:b,screenLockMaxTimeout:T,policyKey:v}),(0,h.jsxs)("div",{className:"policy-dropdown-control-bar",children:[I&&(0,h.jsxs)("div",{className:"policy-dropdown-footer-state policy-dropdown-footer-state--".concat(null!==(d=null===q||void 0===q?void 0:q.stateTone)&&void 0!==d?d:g?"active":"inactive"),role:q?"status":void 0,"aria-live":q?"polite":void 0,"aria-atomic":q?"true":void 0,children:[R&&(0,h.jsxs)("span",{className:"sr-only",children:[R,": "]}),null!==(p=null===q||void 0===q?void 0:q.stateLabel)&&void 0!==p?p:se(g?"status.active":"status.inactive")]}),(0,h.jsx)("div",{className:"policy-dropdown-control",children:q?(0,h.jsx)("div",{className:"policy-dropdown-footer-actions",children:q.actions.map((e,i)=>(0,h.jsxs)(l.A,{onClick:i=>{i.stopPropagation(),e.onClick?e.onClick():je()},"aria-label":e.ariaLabel,className:e.primary?"link-button policy-dropdown-footer-primary":"policy-dropdown-footer-secondary",disabled:e.disabled||!e.onClick&&D,children:[e.label,e.primary&&(0,h.jsx)(M.A,{"aria-hidden":"true",className:"policy-dropdown-footer-chevron"})]},"".concat(e.ariaLabel,"-").concat(i)))}):ke?(0,h.jsxs)(l.A,{onClick:e=>{e.stopPropagation(),je()},"aria-label":L,className:"link-button",disabled:D,children:[se("policies.editPolicy.configure"),I?(0,h.jsx)(M.A,{"aria-hidden":"true",className:"policy-dropdown-footer-chevron"}):" >"]}):(0,h.jsx)(W.w,{checked:g,disabled:D,onChange:e=>{e.stopPropagation(),D||f(e.target.checked)}})})]})]}),!ye&&(0,h.jsx)(K.A,{open:null!==re,onClose:Ne,"aria-labelledby":te,maxWidth:!ae&&"sm",fullWidth:!0,PaperProps:{sx:(0,n.A)({backgroundColor:"white",borderRadius:"12px",padding:ae?"16px":"24px",boxShadow:"0px 8px 8px -4px #10182808, 0px 20px 24px -4px #10182814"},ae&&{margin:"16px",width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"})},children:(0,h.jsxs)(c.A,{sx:{display:"flex",flexDirection:"column",gap:"20px"},children:[(0,h.jsxs)(c.A,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,h.jsxs)(S.A,{id:te,sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:"18px",lineHeight:"28px",letterSpacing:"0px",textAlign:"left"},children:[(()=>{if(Y)return Y;if("string"===typeof u)return u;if(a.isValidElement(u)){const e=a.Children.toArray(u.props.children||[]).filter(e=>!a.isValidElement(e)||e.type!==$.A);return 0===e.length?u:1===e.length&&"string"===typeof e[0]?e[0]:(0,h.jsx)(h.Fragment,{children:e})}return u})(),!Y&&R&&(0,h.jsx)("span",{className:"policy-dialog-context",children:" (".concat(R,")")})]}),m&&(0,h.jsx)(S.A,{sx:{color:"var(--color-gray-700)",fontWeight:400,fontSize:"14px",lineHeight:"20px",letterSpacing:"0px",textAlign:"left"},children:m}),V&&(0,h.jsx)(S.A,{sx:{color:"var(--color-gray-600)",fontSize:"12px",lineHeight:"18px"},children:V})]}),O&&(0,h.jsxs)(c.A,{"data-testid":"fixed-policy-target-receipt",sx:{border:1,borderColor:"divider",borderRadius:"8px",backgroundColor:"var(--color-gray-50)",px:2,py:1.5},children:[(0,h.jsx)(S.A,{sx:{color:"var(--color-gray-900)",fontSize:"14px",fontWeight:600,lineHeight:"20px"},children:O.policy.name||O.policy.policy_id}),(0,h.jsx)(S.A,{sx:{color:"var(--color-gray-600)",fontSize:"12px",lineHeight:"18px"},children:se("policies.checkWorkflow.onlyThisPolicy")})]}),re&&(0,h.jsx)(ee.A,{draft:re.draft,initialDraft:re.initialDraft,onDraftChange:e=>{de(i=>i?(0,n.A)((0,n.A)({},i),{},{draft:e}):i)},onConfirm:e=>{oe&&oe.shouldOpen(e.policy)?me({completedPolicy:e.policy}):(oe||(J?J(e.policy):O&&O.setPolicy(e.policy)),we())},onCancel:Ne,isReadOnly:D,onDirtyChange:e.onDirtyChange,configOverride:O?void 0:e})]})}),ye&&oe&&(0,h.jsx)(Q._T,{open:!0,onClose:Ce,title:oe.title,maxWidth:"sm",actions:(0,h.jsxs)(c.A,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:"12px",justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"}},children:[(0,h.jsx)(l.A,{variant:"outlined",onClick:Ce,sx:Q.qC.button,children:se("general.cancel")}),oe.actions.map((e,i)=>(0,h.jsx)(l.A,{variant:e.primary?"contained":"outlined",disabled:e.disabled,onClick:()=>(e=>{ye&&!e.disabled&&(e.onConfirm(ye.completedPolicy),we())})(e),sx:(0,n.A)((0,n.A)({},Q.qC.button),{},{marginLeft:{xs:0,md:0===i?"auto":0},whiteSpace:{xs:"normal",md:"nowrap"}}),children:e.label},i))]}
1),children:(0,h.jsx)(S.A,{sx:{color:"var(--color-gray-700)",fontSize:"14px",lineHeight:"20px"},children:oe.content})})]})},se=e=>{let i=e.open,o=e.className,s=e.children;return(0,h.jsx)("div",{className:"policy-section-collapse","data-open":i?"true":"false","data-testid":"policy-section-collapse",inert:!i||void 0,children:(0,h.jsx)("div",{className:"policy-section-collapse-inner ".concat(o),"aria-hidden":!i,children:s})})},ne=["windows_os","macos_os","linux_os","ios_os","ipados_os","android_os"],ae=["windows_os","macos_os","linux_os","ios_os","ipados_os","android_os"],te=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,r=e.deviceStats,d=e.focusPolicyKey,p=e.focusRequestVersion;const u=(0,t.Bd)().t,y=(0,U.M)()||c,m=(0,V.L)(i,o,r),v=e=>{y||o(i=>{const o="function"===typeof e?e(i):e;return(0,n.A)((0,n.A)({},i),{},{os:o.os})})},g=e=>i=>{y||o(o=>{var s,a;const t=(0,n.A)((0,n.A)({},o),{},{os:null!==(s=o[e])&&void 0!==s?s:void 0}),c="function"===typeof i?i(t):i;return(0,n.A)((0,n.A)({},o),{},{[e]:null!==(a=c.os)&&void 0!==a?a:{}})})},f=e=>{const o=i[e];return"inherited"===(0,q.s7)(o)?i.os:null!==o&&void 0!==o?o:void 0},x=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("windows_os")}),g("windows_os")),_=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("macos_os")}),g("macos_os")),b=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("linux_os")}),g("linux_os")),k=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("android_os")}),g("android_os")),A=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("ios_os")}),g("ios_os")),j=(0,Y.F)((0,n.A)((0,n.A)({},i),{},{os:f("ipados_os")}),g("ipados_os")),w=(0,Y.F)(i,v),N=(e,i)=>e.find(e=>e.policyKey===i),C=N(m,"os_autoupdate"),S=N(m,"jailbroken"),K=N(m,"biometrics"),T=(0,a.useMemo)(()=>[{key:"windows_os",name:"Windows",icon:F.A,versionConfig:x,extras:[{config:N(m,"windows_recall"),name:u("applications.policies.windowsRecall")}]},{key:"macos_os",name:"macOS",icon:I.A,versionConfig:_,extras:[{config:N(m,"find_my_device"),name:u("applications.policies.findmydevice")}]},{key:"linux_os",name:"Linux",icon:B.A,versionConfig:b,extras:[]},{key:"ios_os",name:"iOS",icon:I.A,versionConfig:A,extras:[]},{key:"ipados_os",name:"iPadOS",icon:I.A,versionConfig:j,extras:[]},{key:"android_os",name:"Android",icon:z.A,versionConfig:k,extras:[{config:N(m,"rooted"),name:u("applications.policies.rootedAndroid")},{config:N(m,"developer_mode"),name:u("applications.policies.developerMode")}]}],[k,A,j,b,_,m,u,x]),E=[{key:"os_autoupdate",config:C,name:u("applications.policies.osAutoUpdate"),platforms:["Windows","macOS","Linux (Debian/Ubuntu)"]},{key:"jailbroken",config:S,name:u("applications.policies.jailbrokenIos"),platforms:["iOS","iPadOS"]},{key:"biometrics",config:K,name:u("applications.policies.biometrics"),platforms:["iOS","iPadOS","Android"]}],P=(0,a.useState)(()=>new Set(ae)),D=(0,s.A)(P,2),O=D[0],L=D[1],R=(0,a.useState)(()=>new Set(ae)),H=(0,s.A)(R,2),X=H[0],Q=H[1],$=(0,a.useState)(!0),Z=(0,s.A)($,2),ee=Z[0],te=Z[1],ce=ne.every(e=>"inherited"===(0,q.s7)(i[e])),le=ce&&(0,J.uw)(i.os);a.useEffect(()=>{if("os_autoupdate"===d||"jailbroken"===d||"biometrics"===d)return void te(!0);const e="windows_recall"===d||"windows_os"===d?"windows_os":"macos_os"===d||"find_my_device"===d?"macos_os":"linux_os"===d?"linux_os":"rooted"===d||"developer_mode"===d||"android_os"===d?"android_os":"ios_os"===d?"ios_os":"ipados_os"===d?"ipados_os":void 0;e&&(L(i=>new Set(i).add(e)),Q(i=>new Set(i).add(e)))},[d,p]);const re=(e,i)=>{y||o(o=>(0,n.A)((0,n.A)({},o),{},{[e]:i}))},de=e=>{y||o(i=>(0,n.A)((0,n.A)({},i),{},{os:e},Object.fromEntries(ne.map(e=>[e,null]))))};return(0,h.jsxs)("div",{className:"policy-os-layout",children:[(0,h.jsx)(oe,(0,n.A)((0,n.A)({},w),{},{settingId:null,isReadOnly:y,configureAriaLabel:u("applications.policies.osGroups.configureSharedAria"),onPolicyDraftConfirm:e=>{y||v(e)},draftConfirmation:ce?void 0:{title:u("applications.policies.osGroups.sharedConfirmTitle"),content:u("applications.policies.osGroups.sharedConfirmDescription"),shouldOpen:()=>!0,actions:[{label:u("applications.policies.osGroups.sharedConfirmAction"),onConfirm:e=>de(e.os),primary:!0,disabled:y}]},renderOverview:e=>(0,h.jsxs)("section",{className:"policy-os-shared-card",id:"policy-setting-os","data-
1policy-setting-key":"os",tabIndex:-1,"aria-labelledby":"policy-os-shared-heading",children:[(0,h.jsxs)("div",{className:"policy-os-shared-body",children:[(0,h.jsx)("h2",{className:"policy-os-shared-title",id:"policy-os-shared-heading",children:u("applications.policies.osGroups.sharedTitle")}),le&&(0,h.jsx)("p",{className:"policy-os-shared-policy",children:u("applications.policies.osGroups.configuredPolicy",{name:i.name})}),(0,h.jsx)("p",{className:"policy-os-shared-description",children:u("applications.policies.osGroups.sharedDescription")}),(0,h.jsxs)("div",{className:"policy-os-shared-summary",children:[(0,h.jsx)("span",{id:"policy-os-shared-summary-label",children:u("applications.policies.osGroups.sharedChecksLabel")}),(0,h.jsx)("span",{className:"policy-os-shared-chip",children:u("applications.policies.osGroups.sharedVersionOnly")})]}),le&&(0,h.jsx)(ie.A,(0,n.A)((0,n.A)({},w),{},{isGoalEnabled:w.isVerificationEnabled,policyType:"version"}))]}),(0,h.jsxs)("div",{className:"policy-os-shared-toggle",children:[(0,h.jsx)("span",{className:"policy-dropdown-footer-state",role:"status",children:u(le?"applications.policies.osGroups.inSync":"applications.policies.osGroups.notInSync")}),(0,h.jsxs)("div",{className:"policy-os-shared-actions",children:[le&&(0,h.jsxs)(l.A,{onClick:e,disabled:y,"aria-label":u("applications.policies.osGroups.configureSharedAria"),className:"link-button policy-dropdown-footer-primary",children:[u("policies.editPolicy.configure"),(0,h.jsx)(M.A,{"aria-hidden":"true",className:"policy-dropdown-footer-chevron"})]}),(0,h.jsx)(W.w,{inputProps:{"aria-label":u("applications.policies.osGroups.sharedSyncAria")},checked:le,disabled:y,onChange:i=>{i.target.checked?e():y||o(e=>(0,n.A)((0,n.A)({},e),Object.fromEntries(ne.map(i=>[i,e.os?(0,n.A)({},e.os):{}]))))}})]})]})]})})),(0,h.jsxs)("section",{className:"policy-cross-platform-checks-section","aria-labelledby":"policy-general-os-settings-heading","data-cross-platform-section":"general",children:[(0,h.jsx)("h2",{className:"policy-section-heading",id:"policy-general-os-settings-heading",children:(0,h.jsxs)("button",{id:"policy-general-os-settings-toggle",type:"button",className:"policy-section-toggle policy-cross-platform-checks-toggle","aria-expanded":ee,"aria-controls":"policy-general-os-settings-content",onClick:()=>te(e=>!e),children:[(0,h.jsx)("span",{className:"policy-section-title",children:u("applications.policies.osGroups.generalSettingsTitle")}),(0,h.jsxs)("span",{className:"policy-section-header-right",children:[(0,h.jsx)("span",{className:"policy-section-check-count",children:u("applications.policies.checkCount",{count:E.filter(e=>e.config).length})}),(0,h.jsx)("img",{src:G,alt:"",className:"policy-dropdown-icon ".concat(ee?"open":"closed")})]})]})}),(0,h.jsx)("div",{id:"policy-general-os-settings-content",children:(0,h.jsx)(se,{open:ee,className:"policy-cross-platform-checks-collapse",children:(0,h.jsx)("div",{className:"policy-cross-platform-checks-list",children:E.map(e=>{let i=e.key,o=e.config,s=e.name,a=e.platforms;if(!o)return null;const t=u("applications.policies.osGroups.configureMobileCheckAria",{check:s});return(0,h.jsx)(oe,(0,n.A)((0,n.A)({},o),{},{settingId:"policy-setting-".concat(i),overviewVariant:!0,dialogContext:u("applications.policies.osGroups.generalSettingsTitle"),configureAriaLabel:t,isReadOnly:y,overviewMetadata:(0,h.jsxs)("div",{className:"policy-cross-platform-check-scope",children:[(0,h.jsxs)("span",{className:"policy-cross-platform-check-scope-label",children:[u("applications.policies.osGroups.appliesTo"),":"]}),a.map(e=>(0,h.jsx)("span",{className:"policy-cross-platform-chip",children:e},e))]}),overviewFooter:{stateLabel:u(o.isVerificationEnabled?"status.active":"status.inactive"),stateTone:o.isVerificationEnabled?"active":"inactive",actions:[{label:u("policies.editPolicy.configure"),ariaLabel:t,primary:!0}]}}),i)})})})})]}),T.map(e=>{const o=O.has(e.key),s="inherited"===(0,q.s7)(i[e.key]),a=[e.versionConfig,...e.extras.map(e=>e.config)].filter(Boolean),t="policy-".concat(e.key,"-content");return(0,h.jsxs)("section",{className:"policy-os-section","aria-labelledby":"policy-".concat(e.key,"-heading"),children:[(0,h.jsx)("h2",{className:"policy-section-heading",id:"policy-".concat(e.key,"-heading"),children:(0,h.jsxs)("button",{id:"policy-setting-".concat(e.key),type:"button",className:"policy-section-toggle","data-policy-setting-key":e.key,"aria-expanded":o,"aria-controls":t,onClick:()=>{return i=e.key,Q(e=>new Set(e).add(i)),void L(e=>{const o=new Set(e);return o.has(i)?o.delete(i):o.add(i),o});var i},children:[(0,h.jsxs)("span",{className:"policy-section-title",children:[(0,h.jsx)("img",{className:"policy-section-icon",src:e.icon,alt:""}),e.name]}),(0,h.jsxs)("span",{className:"policy-section-header-right",children:[(0,h.jsx)("span",{className:"policy-section-check-count",children:u("applications.policies.checkCount",{count:a.length})}),(0,h.jsx)("img",{src:G,alt:"",className:"policy-dropdown-icon ".concat(o?"open":"closed")})]})]})}
1),(0,h.jsx)("div",{id:t,children:X.has(e.key)&&(0,h.jsxs)(se,{open:o,className:"policy-os-checks",children:[e.versionConfig&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},e.versionConfig),{},{settingId:null,dialogContext:e.name,editorTitle:u("applications.policies.osGroups.versionTitle",{os:e.name}),configureAriaLabel:u("applications.policies.osGroups.configureAria",{os:e.name}),editorNotice:s?u("applications.policies.osGroups.usingSharedSettings"):void 0,isReadOnly:y,overviewVariant:!0,overviewFooter:{stateLabel:u(le?"applications.policies.osGroups.inSync":e.versionConfig.isVerificationEnabled?"status.active":"status.inactive"),stateTone:le?"shared":e.versionConfig.isVerificationEnabled?"active":"inactive",actions:[...s?[]:[{label:u("applications.policies.osGroups.useSharedSettings"),ariaLabel:u("applications.policies.osGroups.useSharedAria",{os:e.name}),onClick:()=>re(e.key,null),disabled:y}],{label:u("policies.editPolicy.configure"),ariaLabel:u("applications.policies.osGroups.configureAria",{os:e.name}),primary:!0}]},onPolicyDraftConfirm:i=>{var o;return re(e.key,null!==(o=i.os)&&void 0!==o?o:{})},draftConfirmation:{title:u("applications.policies.osGroups.applyScopeTitle"),content:u(ce?"applications.policies.osGroups.applyScopeDescription":"applications.policies.osGroups.applyScopeNotInSyncDescription",{os:e.name}),shouldOpen:i=>{return o=i.os,s=f(e.key),!(JSON.stringify(null!==o&&void 0!==o?o:null)===JSON.stringify(null!==s&&void 0!==s?s:null));var o,s},actions:ce?[{label:u("applications.policies.osGroups.applyOnly",{os:e.name}),onConfirm:i=>{var o;return re(e.key,null!==(o=i.os)&&void 0!==o?o:{})},disabled:y},{label:u("applications.policies.osGroups.applyAll"),onConfirm:e=>de(e.os),primary:!0,disabled:y}]:[{label:u("applications.policies.osGroups.applyAllTurnOnSync"),onConfirm:e=>de(e.os),disabled:y},{label:u("applications.policies.osGroups.applyOnly",{os:e.name}),onConfirm:i=>{var o;return re(e.key,null!==(o=i.os)&&void 0!==o?o:{})},primary:!0,disabled:y}]}})),e.extras.map(i=>i.config&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},i.config),{},{settingId:"policy-setting-".concat(i.config.policyKey),overviewVariant:!0,dialogContext:e.name,configureAriaLabel:u("applications.policies.osGroups.configureCheckAria",{check:i.name,os:e.name}),isReadOnly:y}),i.config.policyKey))]})})]},e.key)})]})};var ce=o(8145),le=o(14115),re=o(74438);const de=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,l=e.deviceStats;const r=(0,t.Bd)().t,d=(0,U.M)()||c,p=(0,re.G)().applications,u=a.useMemo(()=>p&&null!==i&&void 0!==i&&i.policy_id?p.filter(e=>e.PolicyID===i.policy_id&&e.EnableMfa):[],[p,null===i||void 0===i?void 0:i.policy_id]),y=(0,V.L)(i,o,l,{conflictingApplications:u}),m=new Date>=le.q,v=y.find(e=>"skip"===e.policyKey),g=y.find(e=>"agentless"===e.policyKey),f=y.find(e=>"unsupported"===e.policyKey),x=[v,m?g:null,f].filter(Boolean).length,_=(0,a.useState)(!0),b=(0,s.A)(_,2),k=b[0],A=b[1],j=()=>{A(!k)};return(0,h.jsxs)("div",{className:"policy-general-wrapper",children:[(0,h.jsxs)("div",{className:"policy-name-container",children:[(0,h.jsx)(S.A,{variant:"h6",sx:{mb:1,fontWeight:600,fontSize:"16px"},children:r("policies.createPolicy.name")}),(0,h.jsx)(ce.A,{fullWidth:!0,variant:"outlined",placeholder:r("policies.createPolicy.namePlaceholder"),value:i.name||"",onChange:e=>o((0,n.A)((0,n.A)({},i),{},{name:e.target.value})),disabled:c||d,sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"var(--color-border)"}}}})]}),(0,h.jsxs)("div",{className:"policy-access-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:j,children:r("applications.policies.sectionTitles.access")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:j,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[x," ",1===x?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(k?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:k,className:"policy-access-checks",children:[v&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},v),{},{isReadOnly:d}),v.policyKey),m&&g&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},g),{},{isReadOnly:d}),g.policyKey),f&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},f),{},{isReadOnly:d}),f.policyKey)]})]})]})},pe=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,l=e.deviceStats,r=e.focusPolicyKey,d=e.hasUnattendedRemoteAccessFeature;const p=(0,t.Bd)().t,u=(0,U.M)()||c,y=(0,V.L)(i,o,l),m=y.find(e=>"disk_encryption"===e.policyKey),v=y.find(e=>"screen_lock"===e.policyKey),g=y.find(e=>"reboot"===e.policyKey),f=y.find(e=>"firewall"===e.policyKey),x=y.find(e=>"screen_sharing"===e.policyKey),_=y.find(e=>"remote_management"===e.policyKey),b=y.find(e=>"remote_login"===e.policyKey),k=y.find(e=>"unattended_remote_access"===e.policyKey),A=y.find(e=>"dns"===e.policyKey),j=y.find(e=>"secure_boot_enabled"===e.policyKey),w=y.find(e=>"remote_scripting"===e.policyKey),N=y.find(e=>"integrity_protection_enabled"===e.policyKey),C=[m,v,g,A,j,N].filter(
1Boolean).length,S=[f].filter(Boolean).length,K=[x,_,b,w,d?k:null].filter(Boolean).length,T=(0,a.useState)(!0),E=(0,s.A)(T,2),P=E[0],D=E[1],O=(0,a.useState)(!0),L=(0,s.A)(O,2),R=L[0],M=L[1],z=(0,a.useState)(!0),I=(0,s.A)(z,2),B=I[0],F=I[1];a.useEffect(()=>{r&&(["disk_encryption","screen_lock","reboot","dns","secure_boot_enabled","integrity_protection_enabled"].includes(r)&&D(!0),"firewall"===r&&M(!0),["screen_sharing","remote_management","remote_login","remote_scripting","unattended_remote_access"].includes(r)&&F(!0))},[r]);const W=()=>{D(!P)},Y=()=>{M(!R)},q=()=>{F(!B)};return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:W,children:p("applications.policies.sectionTitles.securityChecks")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:W,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[C," ",1===C?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(P?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:P,className:"policy-device-checks",children:[m&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},m),{},{isReadOnly:u}),m.policyKey),v&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},v),{},{isReadOnly:u}),v.policyKey),g&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},g),{},{isReadOnly:u}),g.policyKey),A&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},A),{},{isReadOnly:u}),A.policyKey),j&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},j),{},{isReadOnly:u}),j.policyKey),N&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},N),{},{isReadOnly:u}),N.policyKey)]})]}),(0,h.jsx)("div",{style:{height:"24px"}}),(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:Y,children:p("applications.policies.sectionTitles.firewall")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:Y,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[S," ",1===S?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(R?"open":"closed")})]})]}),(0,h.jsx)(se,{open:R,className:"policy-device-checks",children:f&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},f),{},{isReadOnly:u}),f.policyKey)})]}),(0,h.jsx)("div",{style:{height:"24px"}}),(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:q,children:p("applications.policies.sectionTitles.remoteAccessSettings")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:q,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[K," ",1===K?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(B?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:B,className:"policy-device-checks",children:[x&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},x),{},{isReadOnly:u}),x.policyKey),_&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},_),{},{isReadOnly:u}),_.policyKey),b&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},b),{},{isReadOnly:u}),b.policyKey),w&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},w),{},{isReadOnly:u}),w.policyKey),d&&k&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},k),{},{isReadOnly:u}),k.policyKey)]})]})]})},ue=o.p+"static/media/chrome.e4065efc86d00ec625da.png",ye=o.p+"static/media/firefox.2fb93929e877f77504aa.png",me=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,l=e.deviceStats,r=e.focusPolicyKey,d=e.hasSafeBrowsingFeature,p=void 0!==d&&d;const u=(0,t.Bd)().t,y=(0,U.M)()||c,m=(0,V.L)(i,o,l),v=m.find(e=>"browser"===e.policyKey),g=[m.find(e=>"chrome_safebrowsing_enabled"===e.policyKey),m.find(e=>"chrome_safebrowsing_enhanced"===e.policyKey),m.find(e=>"chrome_do_not_track"===e.policyKey),m.find(e=>
1"chrome_dns_over_https"===e.policyKey)].filter(Boolean),f=[m.find(e=>"firefox_https_only"===e.policyKey),m.find(e=>"firefox_dns_over_https"===e.policyKey),m.find(e=>"firefox_enhanced_tracking_protection"===e.policyKey),m.find(e=>"firefox_enhanced_tracking_protection_strict"===e.policyKey)].filter(Boolean),x=v?1:0,_=(0,a.useState)(!0),b=(0,s.A)(_,2),k=b[0],A=b[1],j=(0,a.useState)(!0),w=(0,s.A)(j,2),N=w[0],C=w[1],S=(0,a.useState)(!0),K=(0,s.A)(S,2),T=K[0],E=K[1];a.useEffect(()=>{"browser"===r&&A(!0),r&&["chrome_safebrowsing_enabled","chrome_safebrowsing_enhanced","chrome_do_not_track","chrome_dns_over_https"].includes(r)&&C(!0),r&&["firefox_https_only","firefox_dns_over_https","firefox_enhanced_tracking_protection","firefox_enhanced_tracking_protection_strict"].includes(r)&&E(!0)},[r]);const P=()=>{A(!k)};return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"policy-browser-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:P,children:u("policies.tabs.browsers")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:P,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[x," ",1===x?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(k?"open":"closed")})]})]}),(0,h.jsx)(se,{open:k,className:"policy-browser-checks",children:v&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},v),{},{isReadOnly:y}),v.policyKey)})]}),p&&g.length>0&&(0,h.jsxs)("div",{className:"policy-browser-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsxs)("div",{className:"policy-section-title policy-section-title-clickable",onClick:()=>C(!N),children:[(0,h.jsx)("img",{src:ue,alt:"Chrome icon",className:"policy-section-icon"}),u("policies.tabs.chrome")]}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:()=>C(!N),children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[g.length," ",1===g.length?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(N?"open":"closed")})]})]}),(0,h.jsx)(se,{open:N,className:"policy-browser-checks",children:g.map(e=>(0,h.jsx)(oe,(0,n.A)((0,n.A)({},e),{},{isReadOnly:y}),e.policyKey))})]}),p&&f.length>0&&(0,h.jsxs)("div",{className:"policy-browser-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsxs)("div",{className:"policy-section-title policy-section-title-clickable",onClick:()=>E(!T),children:[(0,h.jsx)("img",{src:ye,alt:"Firefox icon",className:"policy-section-icon"}),u("policies.tabs.firefox")]}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:()=>E(!T),children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[f.length," ",1===f.length?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(T?"open":"closed")})]})]}),(0,h.jsx)(se,{open:T,className:"policy-browser-checks",children:f.map(e=>(0,h.jsx)(oe,(0,n.A)((0,n.A)({},e),{},{isReadOnly:y}),e.policyKey))})]})]})};var he=o(98),ve=o(51392),ge=o(44426);const fe=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,l=e.deviceStats,r=e.focusPolicyKey,d=e.hasAikidoFeature,p=void 0!==d&&d;const u=(0,t.Bd)().t,y=((0,U.M)(),(0,V.L)(i,o,l)),m=y.find(e=>"password_manager"===e.policyKey),v=y.find(e=>"antivirus"===e.policyKey),g=y.find(e=>"vanta"===e.policyKey),f=y.find(e=>"intune"===e.policyKey),x=p?y.find(e=>"aikido_safe_chain"===e.policyKey):void 0,_=p?y.find(e=>"aikido_endpoint"===e.policyKey):void 0,b=(0,ve.JY)(ge.T.AIKIDO_ENABLED),k=e=>b?(0,h.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e,(0,h.jsx)(he.A,{text:u("devices.checks.beta")})]}):e,A=m?1:0,j=[v,x,_].filter(Boolean).length,w=[g,f].filter(Boolean).length,N=(0,a.useState)(!0),C=(0,s.A)(N,2),S=C[0],K=C[1],T=(0,a.useState)(!0),E=(0,s.A)(T,2),P=E[0],D=E[1],O=(0,a.useState)(!0),L=(0,s.A)(O,2),R=L[0],M=L[1];return a.useEffect(()=>
1{r&&("password_manager"===r&&K(!0),"antivirus"!==r&&"aikido_safe_chain"!==r&&"aikido_endpoint"!==r||D(!0))},[r]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"policy-password-manager-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:()=>K(!S),children:u("applications.policies.sectionTitles.passwordManager")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:()=>K(!S),children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[A," ",1===A?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(S?"open":"closed")})]})]}),(0,h.jsx)(se,{open:S,className:"policy-password-manager-checks",children:m&&(0,h.jsx)(oe,(0,n.A)({},m),m.policyKey)})]}),(0,h.jsx)("div",{style:{height:"24px"}}),(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:()=>D(!P),children:u("applications.policies.sectionTitles.antimalwareProtection")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:()=>D(!P),children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[j," ",1===j?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(P?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:P,className:"policy-device-checks",children:[v&&(0,h.jsx)(oe,(0,n.A)({},v),v.policyKey),x&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},x),{},{title:k(x.title)}),x.policyKey),_&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},_),{},{title:k(_.title)}),_.policyKey)]})]}),(0,h.jsx)("div",{style:{height:"24px"}}),(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsx)("div",{className:"policy-section-title policy-section-title-clickable",onClick:()=>M(!R),children:u("applications.policies.sectionTitles.deviceManagement")}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:()=>M(!R),children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[w," ",1===w?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(R?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:R,className:"policy-device-checks",children:[g&&(0,h.jsx)(oe,(0,n.A)({},g),g.policyKey),f&&(0,h.jsx)(oe,(0,n.A)({},f),f.policyKey)]})]})]})},xe=e=>{let i=e.policy,o=e.setPolicy,c=e.loading,l=e.deviceStats,r=e.focusPolicyKey;const d=(0,t.Bd)().t,p=(0,U.M)()||c,u=(0,V.L)(i,o,l),y=u.find(e=>"secrets_in_environment"===e.policyKey),m=u.find(e=>"autonomous_agents_present"===e.policyKey),v=u.find(e=>"unguarded_elevation"===e.policyKey),g=u.find(e=>"unsafe_ai_mode"===e.policyKey),f=[y,m,v,g].filter(Boolean).length,x=(0,a.useState)(!0),_=(0,s.A)(x,2),b=_[0],k=_[1];a.useEffect(()=>{r&&["secrets_in_environment","autonomous_agents_present","unguarded_elevation","unsafe_ai_mode"].includes(r)&&k(!0)},[r]);const A=()=>{k(!b)};return(0,h.jsxs)("div",{className:"policy-device-section",children:[(0,h.jsxs)("div",{className:"policy-section-header",children:[(0,h.jsxs)("div",{className:"policy-section-title policy-section-title-clickable",onClick:A,children:[d("applications.policies.sectionTitles.aiChecks"),(0,ve.JY)(ge.T.RUNAWAY_AI)&&(0,h.jsx)(he.A,{text:d("devices.checks.beta")})]}),(0,h.jsxs)("div",{className:"policy-section-header-right",onClick:A,children:[(0,h.jsxs)("span",{className:"policy-section-check-count policy-section-check-count-clickable",children:[f," ",1===f?"check":"checks"]}),(0,h.jsx)("img",{src:G,alt:"dropdown",className:"policy-dropdown-icon ".concat(b?"open":"closed")})]})]}),(0,h.jsxs)(se,{open:b,className:"policy-device-checks",children:[y&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},y),{},{isReadOnly:p}),y.policyKey),m&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},m),{},{isReadOnly:p}),m.policyKey),v&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},v),{},{isReadOnly:p}),v.policyKey),g&&(0,h.jsx)(oe,(0,n.A)((0,n.A)({},g),{},{isReadOnly:p}),g.policyKey)]})]})};var _e=o(86966),be=o(53286),ke=o(95173),Ae=o(79812),je=o(19946),we=o(21750),Ne=o(60927),Ce=o(83274),Se=o(84730),Ke=o(49959),Te=o(48091),Ee=o(87128);const Pe=[{key:"windows_os",osName:"Windows",nameKey:"applications.policies.osGroups.windowsVersion"},{key:"macos_os",osName:"macOS",nameKey:"applications.policies.osGroups.macosVersion"},{key:"linux_os",osName:"Linux",nameKey:"applications.policies.osGroups.linuxVersion"},{key:"android_os",osName:"Android",nameKey:"applications.policies.osGroups.androidVersion"},{key:"ios_os",osName:"iOS",nameKey:"applications.policies.osGroups.iosVersion"},{key:"ipados_os",osName:"iPadOS",nameKey:"applications.policies.osGroups.ipadosVersion"}],De=e=>void 0!==e.betaFeatureFlag&&(0,ve.JY)(e.betaFeatureFlag),Oe=(e,i)=>"runaway_ai"===e.requiresFeature&&!i.hasRunawayAiFeature||"unattended_remote_access"===e.requiresFeature&&!i.hasUnattendedRemoteAccessFeature,Le=e=>e?0:null,Re=(e,i)=>(0,Te.v)(e,i)?0:null,Me=e=>void 0===e||null===e?null:Math.max(0,Math.floor(e/86400)),ze=[{nameKey:"applications.policies.osAutoUpdate",checks:["os_autoupdate"],getGoalDays:e=>{var i;return Le(null===(i=e.os_autoupdate)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.diskEncryption",checks:["diskencryption_active"],getGoalDays:e=>{var i;return Le(null===(i=e.disk_encryption)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.screenlock",checks:["authentication_active"],getGoalDays:e=>{var i;return Le(null===(i=e.screen_lock)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.antivirus",checks:["antivirus_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.antivirus)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.biometrics",checks:["biometrics"],getGoalDays:e=>{var i;return Le(null===(i=e.biometrics)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.firewall",checks:["firewall_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.firewall)||void 0===i?void 0:i.goal)}}
1,{nameKey:"applications.policies.findmydevice",checks:["find_my_device_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.find_my_device)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.dns",checks:["dns_servers_compliant"],getGoalDays:e=>{var i;return Le(null===(i=e.dns)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.screenSharing",checks:["screen_sharing_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.screen_sharing)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.remoteScripting",checks:["remote_scripting_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.remote_scripting)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.remoteManagement",checks:["remote_management_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.remote_management)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.remoteLogin",checks:["remote_login_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.remote_login)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.unattendedRemoteAccess",checks:["unattended_remote_access_enabled"],requiresFeature:"unattended_remote_access",getGoalDays:e=>{var i;return Le(null===(i=e.unattended_remote_access)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.windowsRecall",checks:["windows_recall"],getGoalDays:e=>{var i;return Le(null===(i=e.windows_recall)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.jailbrokenIos",checks:["jailbroken"],getGoalDays:e=>{var i;return Le(null===(i=e.jailbroken)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.rootedAndroid",checks:["rooted"],getGoalDays:e=>{var i;return Le(null===(i=e.rooted)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.developerMode",checks:["developer_mode"],getGoalDays:e=>{var i;return Le(null===(i=e.developer_mode)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.secureBoot",checks:["secure_boot_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.secure_boot)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.integrityProtection",checks:["integrity_protection_enabled"],getGoalDays:e=>{var i;return Le(null===(i=e.integrity_protection)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.secretsInEnvironment",checks:["secrets_in_environment"],requiresFeature:"runaway_ai",getGoalDays:e=>{var i;return Le(null===(i=e.secrets_in_environment)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.autonomousAgentsPresent",checks:["autonomous_agents_present"],requiresFeature:"runaway_ai",getGoalDays:e=>{var i;return Le(null===(i=e.autonomous_agents_present)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.unguardedElevation",checks:["unguarded_elevation"],requiresFeature:"runaway_ai",getGoalDays:e=>{var i;return Le(null===(i=e.unguarded_elevation)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.unsafeAiMode",checks:["unsafe_ai_mode"],requiresFeature:"runaway_ai",getGoalDays:e=>{var i;return Le(null===(i=e.unsafe_ai_mode)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.os",checks:["os_uptodate"],isOSVersion:!0,getGoalDays:e=>(0,J.kc)(e)?0:null},{nameKey:"applications.policies.browser",checks:Ee.O3,getGoalDays:e=>{var i;return Me(null===(i=e.browser)||void 0===i?void 0:i.GoalTime)}},{nameKey:"applications.policies.reboot",checks:["reboot"],getGoalDays:e=>{var i,o;return null!==(i=null===(o=e.reboot)||void 0===o?void 0:o.GoalTimeInDays)&&void 0!==i?i:null}},{nameKey:"applications.policies.passwordmanager",checks:["passwordmanager"],getGoalDays:e=>{var i;return Le(null===(i=e.password_manager)||void 0===i?void 0:i.goal)}},{nameKey:"applications.policies.vanta",checks:["vanta_client_running"],getGoalDays:e=>Re(e,"vanta")},{nameKey:"applications.policies.intune",checks:["intune_enrolled"],getGoalDays:e=>Re(e,"intune")},{nameKey:"applications.policies.aikidoSafeChain",checks:["aikido_safe_chain"],policyKey:"aikido_safe_chain",tabKey:"otherTools",requiresFeature:"aikido_enabled",betaFeatureFlag:ge.T.AIKIDO_ENABLED,getGoalDays:e=>
1Re(e,"aikido_safe_chain")},{nameKey:"applications.policies.aikidoEndpoint",checks:["aikido_endpoint"],policyKey:"aikido_endpoint",tabKey:"otherTools",requiresFeature:"aikido_enabled",betaFeatureFlag:ge.T.AIKIDO_ENABLED,getGoalDays:e=>Re(e,"aikido_endpoint")}],Ie=e=>{if(void 0!==e.policyKey&&void 0!==e.tabKey)return{policyKey:e.policyKey,tabKey:e.tabKey};const i=(0,Ee.YW)(e.checks[0]);if(!(0,Ee.QX)(i))throw new Error("Policy stats check ".concat(e.checks[0]," has no supported editor"));return{policyKey:i.editorKey,tabKey:i.tabKey}},Ge=(e,i,o)=>e.reduce((e,s)=>{const n=(0,Ke.hu)(s,i);return o.checks.some(e=>n.includes(e)&&(0,Se.lJ)(s,e,i)===Te.En.Unsafe)?e+1:e},0),Be=(e,i,o)=>{const s=new Set(o.flatMap(e=>e.checks)),n=(0,Ke.hu)(e,i).filter(e=>s.has(e));let a=!1;for(const t of n){const o=(0,Se.lJ)(e,t,i);if(o===Te.En.Unsafe)return Te.En.Unsafe;o===Te.En.Unknown&&(a=!0)}return a?Te.En.Unknown:Te.En.Safe},Fe=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return{compliantCount:0,notCompliantCount:0,missingInfoCount:0,goalGroups:[],disabledChecks:[]};const a=new Map,t=[],c=((e,i)=>ze.filter(o=>!Oe(o,i)&&!("aikido_enabled"===o.requiresFeature&&!i.hasAikidoFeature)&&null!==o.getGoalDays(e)))(e,o),l=(0,J.kc)(e)?((e,i)=>{const o=new Map;let s=!1;for(const a of e){const e=(0,J.sF)(a.os_name),t=null!==e&&void 0!==e?e:"os";var n;e||(s=!0),(0,Ke.hu)(a,i).includes("os_uptodate")&&(0,Se.lJ)(a,"os_uptodate",i)===Te.En.Unsafe&&o.set(t,(null!==(n=o.get(t))&&void 0!==n?n:0)+1)}return{counts:o,hasUnknownOSDevices:s}})(i,e):{counts:new Map,hasUnknownOSDevices:!1};for(const s of ze){var r;if(Oe(s,o))continue;if("aikido_enabled"===s.requiresFeature&&!o.hasAikidoFeature)continue;if(s.isOSVersion){for(const i of Pe){var d,p,u;const o=(0,J.WK)(e,i.osName).value,s=(0,J.uw)(o)?null!==(d=Me(null===o||void 0===o?void 0:o.GoalTime))&&void 0!==d?d:0:null,c={nameKey:i.nameKey,policyKey:i.key,tabKey:"operatingSystem",isBeta:!1};if(null===s){t.push(c);continue}const r=null!==(p=a.get(s))&&void 0!==p?p:[];r.push((0,n.A)((0,n.A)({},c),{},{failedCount:null!==(u=l.counts.get(i.key))&&void 0!==u?u:0})),a.set(s,r)}if(l.hasUnknownOSDevices&&(0,J.uw)(e.os)){var y,m,h,v;const i=null!==(y=Me(null===(m=e.os)||void 0===m?void 0:m.GoalTime))&&void 0!==y?y:0,o=null!==(h=a.get(i))&&void 0!==h?h:[];o.push({nameKey:"applications.policies.os",policyKey:"os",tabKey:"operatingSystem",isBeta:!1,failedCount:null!==(v=l.counts.get("os"))&&void 0!==v?v:0}),a.set(i,o)}continue}const c=s.getGoalDays(e),g=Ie(s);if(null===c){t.push((0,n.A)((0,n.A)({nameKey:s.nameKey},g),{},{isBeta:De(s)}));continue}const f=null!==(r=a.get(c))&&void 0!==r?r:[];f.push((0,n.A)((0,n.A)({nameKey:s.nameKey,failedCount:Ge(i,e,s)},g),{},{isBeta:De(s)})),a.set(c,f)}let g=0,f=0,x=0;for(const s of i){const i=Be(s,e,c);i!==Te.En.Safe?i!==Te.En.Unsafe?i!==Te.En.Unknown&&i!==Te.En.SafeWithUnknowns||(x+=1):f+=1:g+=1}return{compliantCount:g,notCompliantCount:f,missingInfoCount:x,goalGroups:[...a.entries()].sort((e,i)=>(0,s.A)(e,1)[0]-(0,s.A)(i,1)[0]).map(e=>{let i=(0,s.A)(e,2);return{goalDays:i[0],checks:i[1]}}),disabledChecks:t}};var We=o(43198);const Ue="(pointer: coarse)",Ve=()=>"undefined"!==typeof window&&"function"===typeof window.matchMedia&&window.matchMedia(Ue).matches,Ye=()=>{const e=(0,a.useState)(Ve),i=(0,s.A)(e,2),o=i[0],n=i[1];return(0,a.useEffect)(()=>{var e;if("undefined"===typeof window||"function"!==typeof window.matchMedia)return;const i=window.matchMedia(Ue),o=e=>n(e.matches);return n(i.matches),null===(e=i.addEventListener)||void 0===e||e.call(i,"change",o),()=>{var e;return null===(e=i.removeEventListener)||void 0===e?void 0:e.call(i,"change",o)}},[]),o},qe=()=>(0,h.jsx)("svg",{className:"policy-stats-summary-icon",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M2.5 7.5L5.5 10.5L11.5 4",stroke:"var(--color-green-500)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Je=()=>(0,h.jsx)("svg",{className:"policy-stats-summary-icon",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M3.5 3.5L10.5 10.5M10.5 3.5L3.5 10.5",stroke:"var(--color-red-600)",strokeWidth:"2",strokeLinecap:"round"})}
1),He=()=>(0,h.jsxs)("svg",{className:"policy-stats-summary-icon",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("circle",{cx:"7",cy:"7",r:"5.5",stroke:"var(--color-gray-400)",strokeWidth:"1.2"}),(0,h.jsx)("path",{d:"M5.5 5.25C5.5 4.42 6.17 3.75 7 3.75C7.83 3.75 8.5 4.42 8.5 5.25C8.5 6.08 7.83 6.5 7 6.5V7.5",stroke:"var(--color-gray-400)",strokeWidth:"1.2",strokeLinecap:"round"}),(0,h.jsx)("circle",{cx:"7",cy:"9.5",r:"0.75",fill:"var(--color-gray-400)"})]}),Xe=()=>(0,h.jsxs)("svg",{className:"policy-stats-badge-check-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("circle",{cx:"9",cy:"9",r:"9",fill:"var(--color-green-500)"}),(0,h.jsx)("path",{d:"M5.5 9L8 11.5L12.5 6.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Qe=e=>{let i=e.check,o=e.isLoading,s=void 0!==o&&o,n=e.isOutdated,a=void 0!==n&&n,c=e.onClick;const l=(0,t.Bd)().t,d=0===i.failedCount,p=(0,h.jsxs)("button",{type:"button",className:a?"policy-stats-badge policy-stats-badge--outdated":"policy-stats-badge",onClick:()=>null===c||void 0===c?void 0:c(i),children:[s?(0,h.jsx)(r.A,{size:12,thickness:5,sx:{color:"var(--color-gray-500)"},className:"policy-stats-badge-spinner"}):d?(0,h.jsx)(Xe,{}):(0,h.jsx)("div",{className:"policy-stats-badge-count",children:i.failedCount}),(0,h.jsx)("span",{className:"policy-stats-badge-name",children:l(i.nameKey)}),i.isBeta&&(0,h.jsx)(he.A,{text:l("devices.checks.beta")})]});return s||d?p:(0,h.jsx)(Ce.A,{title:l("policyStats.devicesMissedGoal",{count:i.failedCount}),arrow:!0,placement:"top",children:p})},$e=e=>{let i=e.nameKey,o=e.policyKey,s=e.tabKey,n=e.isBeta,a=void 0!==n&&n,c=e.isLoading,l=void 0!==c&&c,d=e.isOutdated,p=void 0!==d&&d,u=e.onClick;const y=(0,t.Bd)().t;return(0,h.jsxs)("button",{type:"button",className:p?"policy-stats-badge policy-stats-badge--disabled policy-stats-badge--outdated":"policy-stats-badge policy-stats-badge--disabled",onClick:()=>null===u||void 0===u?void 0:u({nameKey:i,policyKey:o,tabKey:s}),children:[l&&(0,h.jsx)(r.A,{size:12,thickness:5,sx:{color:"var(--color-gray-500)"},className:"policy-stats-badge-spinner"}),(0,h.jsx)("span",{className:"policy-stats-badge-name",children:y(i)}),a&&(0,h.jsx)(he.A,{text:y("devices.checks.beta")})]})},Ze=e=>{let i=e.group,o=e.isLoading,s=void 0!==o&&o,n=e.outdatedPolicyKeys,a=e.onCheckClick;return(0,h.jsxs)("div",{className:"policy-stats-goal-group",children:[(0,h.jsx)(We.A,{goalDays:i.goalDays}),(0,h.jsx)("div",{className:"policy-stats-badges",children:i.checks.map((e,i)=>(0,h.jsx)(Qe,{check:e,isLoading:s,isOutdated:null===n||void 0===n?void 0:n.has(e.policyKey),onClick:a},"".concat(e.nameKey,"-").concat(i)))})]})},ei=e=>{let i=e.policy,o=e.devices,n=void 0===o?[]:o,c=e.hasRunawayAiFeature,l=void 0!==c&&c,d=e.hasUnattendedRemoteAccessFeature,p=void 0!==d&&d,u=e.hasAikidoFeature,y=void 0!==u&&u,m=e.isLoading,v=void 0!==m&&m,g=e.outdatedPolicyKeys,f=void 0===g?[]:g,x=e.onCheckClick,_=e.variant,b=void 0===_?"default":_;const k="embedded"===b,A="summary-only"===b,j=!k,w=!A,N=(0,t.Bd)().t,C=Ye(),S=a.useState(null),K=(0,s.A)(S,2),T=K[0],E=K[1],P=a.useRef(null),D=a.useState(!1),O=(0,s.A)(D,2),L=O[0],R=O[1],M=a.useCallback(e=>{E(i=>i===e?null:e)},[]);a.useEffect(()=>{if(!T)return;const e=()=>E(null);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[T]);const z=a.useMemo(()=>new Set(f),[f]),I=z.size>0,G=a.useMemo(()=>Fe(i,n,{hasRunawayAiFeature:l,hasUnattendedRemoteAccessFeature:p,hasAikidoFeature:y}),[n,y,l,p,i]),B=[{key:"compliant",icon:(0,h.jsx)(qe,{}),count:G.compliantCount,label:N("policyStats.compliant"),tooltipKey:"policyStats.compliantTooltip"},{key:"notCompliant",icon:(0,h.jsx)(Je,{}),count:G.notCompliantCount,label:N("policyStats.notCompliant"),tooltipKey:"policyStats.notCompliantTooltip"},{key:"missingInfo",icon:(0,h.jsx)(He,{}),count:G.missingInfoCount,label:N("policyStats.areMissingInformation"),tooltipKey:"policyStats.missingInfoTooltip"}],F=v?B:B.filter(e=>e.count>0),W=j&&F.length>0,U=a.useCallback(()=>{const e=P.current;if(!e)return void R(!1);const i=Array.from(e.querySelectorAll(".policy-stats-summary-segment"));if(i.length<2)return void R(!1);const o=Math.round(i[0].getBoundingClientRect().top),s=i.some(e=>Math.round(e.getBoundingClientRect().top)!==o);R(s)},[]);a.useLayoutEffect(()=>{U()},[U,W,F.length]),a.useEffect(()=>{if(!W)return;const e=P.current;if(e){if("undefined"!==typeof ResizeObserver){const i=new ResizeObserver(U);
1return i.observe(e),Array.from(e.children).forEach(e=>i.observe(e)),()=>i.disconnect()}return window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)}},[W,U,F.length]);const V=["policy-stats-card",k?"policy-stats-card--embedded":"",A?"policy-stats-card--summary-only":""].filter(Boolean).join(" ");return(0,h.jsxs)("div",{className:V,children:[I&&!k&&!A&&(0,h.jsxs)("div",{className:"policy-stats-outdated-notice",role:"status",children:[(0,h.jsx)("span",{className:"policy-stats-outdated-title",children:N("policyStats.outdatedTitle")}),(0,h.jsx)("span",{className:"policy-stats-outdated-description",children:N("policyStats.outdatedDescription")})]}),(0,h.jsxs)("div",{className:"policy-stats-content",children:[W&&(0,h.jsx)("div",{ref:P,className:["policy-stats-summary",L?"policy-stats-summary--wrapped":""].filter(Boolean).join(" "),children:F.map((e,i)=>{const o=["policy-stats-summary-segment",0===i?"policy-stats-summary-segment--first":"",i===F.length-1?"policy-stats-summary-segment--last":""].filter(
1Boolean).join(" ");return(0,h.jsx)(Ce.A,{title:v?"":N(e.tooltipKey,{count:e.count}),arrow:!0,placement:"top",open:C?T===e.key:void 0,children:(0,h.jsxs)("div",{className:o,"data-summary-segment-key":e.key,tabIndex:0,role:"button","aria-label":"".concat(e.count," ").concat(e.label),onClick:i=>{C&&(i.stopPropagation(),M(e.key))},onKeyDown:i=>{C&&("Enter"!==i.key&&" "!==i.key||(i.preventDefault(),i.stopPropagation(),M(e.key)))},children:[e.icon,(0,h.jsx)("span",{children:v?(0,h.jsx)(r.A,{size:12,thickness:6,sx:{color:"var(--color-gray-500)"},className:"policy-stats-summary-spinner"}):(0,h.jsxs)(h.Fragment,{children:[e.count," ",e.label]})})]})},e.key)})}),w&&(0,h.jsxs)("div",{className:"policy-stats-groups",children:[G.goalGroups.map((e,i)=>(0,h.jsx)(Ze,{group:e,isLoading:v,outdatedPolicyKeys:z,onCheckClick:x},i)),G.disabledChecks.length>0&&(0,h.jsxs)("div",{className:"policy-stats-goal-group",children:[(0,h.jsx)("span",{className:"policy-stats-disabled-title",children:N("policyStats.deviceChecksNotEnabled")}),(0,h.jsx)("div",{className:"policy-stats-badges",children:G.disabledChecks.map((e,i)=>(0,h.jsx)($e,{nameKey:e.nameKey,policyKey:e.policyKey,tabKey:e.tabKey,isBeta:e.isBeta,isLoading:v,isOutdated:z.has(e.policyKey),onClick:x},"disabled-".concat(i)))})]})]})]})]})};var ii=o(38408),oi=o(42167),si=o(87121),ni=o(71499);var ai=o(23354),ti=o(36665);const ci={email:"policies.editPolicy.affectedApplications.channelEmail",slack:"policies.editPolicy.affectedApplications.channelSlack",teams:"policies.editPolicy.affectedApplications.channelTeams"},li=e=>{let i=e.applications,o=e.organization,s=e.status;const n=(0,t.Bd)().t,c=(0,oi.g)(),l=c.settings,r=c.onTrial,d=(0,a.useMemo)(()=>((e,i,o)=>{if(!e||!i||(0,si.Gh)(i,o)||(0,ni.y)(null!==i&&void 0!==i?i:null,o))return[];const s=[];return e.notify_unsafe_devices&&s.push("email"),e.slack_notify_unsafe_devices&&s.push("slack"),e.teams_notify_unsafe_devices&&s.push("teams"),s})(o,l,r),[o,l,r]),p=e=>"slack"===e?(0,h.jsx)("span",{className:"policy-affected-apps-icon",children:(0,h.jsx)("img",{src:ai.A,alt:"",className:"policy-affected-apps-icon-img"})}):"teams"===e?(0,h.jsx)("span",{className:"policy-affected-apps-icon",children:(0,h.jsx)("img",{src:ti,alt:"",className:"policy-affected-apps-icon-img"})}):(0,h.jsx)("span",{className:"policy-affected-apps-icon",children:(0,h.jsx)(ii.A,{className:"policy-affected-apps-icon-img",sx:{color:"var(--color-gray-600)"}})});return(0,h.jsxs)("div",{className:"policy-affected-apps-card",children:[(0,h.jsx)("div",{className:"policy-affected-apps-title",children:n("policies.editPolicy.affectedApplications.title")}),"loading"===s?(0,h.jsx)("div",{className:"policy-affected-apps-empty",children:n("policies.editPolicy.affectedApplications.checking")}):"error"===s?(0,h.jsx)("div",{className:"policy-affected-apps-empty",children:n("policies.editPolicy.affectedApplications.unavailable")}):0===i.length?(0,h.jsx)("div",{className:"policy-affected-apps-empty",children:n("policies.editPolicy.affectedApplications.empty")}):(0,h.jsx)("div",{className:"policy-affected-apps-chips",children:i.map(e=>{var i,o,s,n;return(0,h.jsxs)("span",{className:"policy-affected-apps-chip",children:[e.IconUrl?(0,h.jsx)("span",{className:"policy-affected-apps-icon",children:(0,h.jsx)("img",{src:e.IconUrl,alt:"",className:"policy-affected-apps-icon-img"})}):(0,h.jsx)("span",{className:"policy-affected-apps-initial","aria-hidden":"true",children:null!==(i=null===(o=e.Name)||void 0===o||null===(s=o.trim())||void 0===s||null===(n=s[0])||void 0===n?void 0:n.toUpperCase())&&void 0!==i?i:"A"}),(0,h.jsx)("span",{className:"policy-affected-apps-chip-label",children:e.Name})]},e.ApplicationID)})}),"ready"===s&&d.length>0&&(0,h.jsxs)("div",{className:"policy-affected-apps-people",children:[(0,h.jsx)("div",{className:"policy-affected-apps-people-text",children:n("policies.editPolicy.affectedApplications.peopleWarning")}),(0,h.jsx)("div",{className:"policy-affected-apps-chips",children:d.map(e=>(0,h.jsxs)("span",{className:"policy-affected-apps-chip",children:[p(e),(0,h.jsx)("span",{className:"policy-affected-apps-chip-label",children:n(ci[e])})]},e))})]})]})};var ri=o(35565),di=o(35702);var pi=o(3684);const ui=new Set(["windows_os","macos_os","linux_os","android_os","ios_os","ipados_os"]),yi=e=>null!==e&&"object"===typeof e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype,mi=function(e,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(s=e,n=i,JSON.stringify(s)!==JSON.stringify(n)){var s,n;if(1===o.length&&ui.has(o[0]))return{kind:"replace",value:i};if(yi(e)&&yi(i)){const s=[...new Set([...Object.keys(e),...Object.keys(i)])].map(s=>[s,mi(e[s],i[s],[...o,s])]).filter(e=>void 0!==e[1]);return s.length>0?{kind:"object",entries:Object.fromEntries(s)}:void 0}return{kind:"replace",value:i}}},hi=(e,i)=>{if("replace"===i.kind)return i.value;const o=yi(e)?(0,n.A)({},e):{};
1return Object.entries(i.entries).forEach(e=>{let i=(0,s.A)(e,2),n=i[0],a=i[1];o[n]=hi(o[n],a)}),o},vi=(e,i,o)=>{const s=mi(i,o);return s?hi(e,s):e},gi=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"===typeof window?void 0:e=>window.matchMedia(e);return null!==e&&void 0!==e&&e("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"},fi=e=>{let i=e.state,o=e.onRetry,s=e.blockedReason,n=e.canRetry,a=void 0===n||n;const c=(0,t.Bd)().t,d=Boolean(s),p=!d&&"error"===i,u=d||p,y=!d&&"saving"===i;let m="";s?m=c(s):"saving"===i?m=c("policies.editPolicy.saveStatus.saving"):"error"===i?m=c("policies.editPolicy.saveStatus.error"):"saved"===i&&(m=c("policies.editPolicy.saveStatus.saved"));const v=["policy-save-status",u?"policy-save-status--error":"",m?"":"policy-save-status--empty"].filter(Boolean).join(" ");return(0,h.jsxs)("span",{className:v,"data-testid":m?"policy-save-status":void 0,"aria-live":u?"assertive":"polite","aria-atomic":"true",children:[y&&(0,h.jsx)(r.A,{size:"14px"}),m,p&&a&&(0,h.jsx)(l.A,{size:"small",className:"link-button",onClick:o,children:c("policies.editPolicy.saveStatus.retry")})]})};var xi=o(81134),_i=o(34507);const bi={color:"error.main",fontWeight:600,borderRadius:"6px",padding:"6px 12px",backgroundColor:"transparent","&:hover":{backgroundColor:"var(--color-red-50)",color:"error.main",textDecoration:"none"},"&:active":{backgroundColor:"var(--color-red-100)"}},ki=["os","windows_os","macos_os","linux_os","android_os","ios_os","ipados_os","os_autoupdate","browser","disk_encryption","screen_lock","antivirus","password_manager","biometrics","reboot","windows_recall","xfa_version","firewall","find_my_device","dns","screen_sharing","remote_scripting","remote_management","remote_login","unattended_remote_access","jailbroken","rooted","developer_mode","secure_boot","integrity_protection","vanta","intune","secrets_in_environment","autonomous_agents_present","unguarded_elevation","unsafe_ai_mode","chrome_safebrowsing_enabled","chrome_safebrowsing_enhanced","chrome_do_not_track","chrome_dns_over_https","firefox_https_only","firefox_dns_over_https","firefox_enhanced_tracking_protection","firefox_enhanced_tracking_protection_strict"],Ai=e=>Array.isArray(e)?e.map(Ai):e&&"object"===typeof e?Object.fromEntries(Object.entries(e).filter(e=>void 0!==(0,s.A)(e,2)[1]).map(e=>{let i=(0,s.A)(e,2),o=i[0],n=i[1];return[o,Ai(n)]})):e,ji=e=>{switch(e){case"secure_boot":return"secure_boot_enabled";case"integrity_protection":return"integrity_protection_enabled";default:return e}},wi=(e,i)=>ki.filter(o=>JSON.stringify(Ai(null===e||void 0===e?void 0:e[o]))!==JSON.stringify(Ai(null===i||void 0===i?void 0:i[o]))).map(ji),Ni=e=>{var i;return e.name?null===(i=e.dns)||void 0===i||!i.goal||e.dns.dns_servers&&0!==e.dns.dns_servers.length?void 0:"policies.createPolicy.dnsServersRequired":"policies.createPolicy.noName"},Ci=e=>{var i,o,d,p,u,m;const v=(0,t.Bd)().t,g=(0,R.g)().policyId,f=(0,R.zy)(),x=f.state,_=new URLSearchParams(f.search),b=null!==(i=_.get("tab"))&&void 0!==i?i:void 0,k=null!==(o=_.get("focus"))&&void 0!==o?o:void 0,A={activeTab:null!==b&&void 0!==b?b:null===x||void 0===x?void 0:x.activeTab,focusedPolicyKey:null!==k&&void 0!==k?k:null===x||void 0===x?void 0:x.focusedPolicyKey},j=(0,ri.w)(),w=j.permissionsLoading,M=j.canMutateOrganization,z=w||!M,I=(0,a.useState)(!1),G=(0,s.A)(I,2),B=G[0],F=G[1],W=(0,a.useState)(),U=(0,s.A)(W,2),V=U[0],Y=U[1],J=(0,a.useState)(),H=(0,s.A)(J,2),X=H[0],Q=H[1],$=!g&&!(null!==V&&void 0!==V&&V.policy_id),Z=(0,xi.d)().addToast,ee=(0,be.V)(),ie=ee.refreshPolicies,oe=ee.selectedPolicy,se=(0,pi.T)().updatePolicy,ne=(0,Ae.d)(),ae=ne.devices,ce=ne.loading,le=ne.isRefreshingPolicy,ue=ne.refreshUsers,ye=(0,a.useRef)(null),he=(0,a.useState)(!1),ve=(0,s.A)(he,2),Ce=ve[0],Se=ve[1],Ke=(0,a.useState)(!1),Te=(0,s.A)(Ke,2),Ee=Te[0],Pe=Te[1],De=(0,a.useState)(!1),Oe=(0,s.A)(De,2),Le=Oe[0],Re=Oe[1],Me=(0,a.useState)(void 0),ze=(0,s.A)(Me,2),Ie=ze[0],Ge=ze[1],Be=z,Fe=(0,a.useRef)(null),We=[{label:v("navigation.policies"),href:"/policies"},{label:v(g?"policies.editPolicy.title":"policies.createPolicy.title"),href:"/policies/new"}],Ue=(0,a.useState)(void 0),Ve=(0,s.A)(Ue,2),Ye=Ve[0],qe=Ve[1],Je=(0,a.useRef)(null);(0,a.useEffect)(()=>{var e;Ye&&(null===(e=Je.current)||void 0===e||e.scrollIntoView({behavior:gi(),block:"nearest"}))},[Ye]);const He=(0,a.useState)(null!==(d=null===A||void 0===A?void 0:A.activeTab)&&void 0!==d?d:"general"),Xe=(0,s.A)(He,2),Qe
1=Xe[0],$e=Xe[1],Ze=(0,a.useState)(null!==(p=null===A||void 0===A?void 0:A.focusedPolicyKey)&&void 0!==p?p:null),ii=(0,s.A)(Ze,2),oi=ii[0],si=ii[1],ni=(0,a.useState)(null!==A&&void 0!==A&&A.focusedPolicyKey?1:0),ai=(0,s.A)(ni,2),ti=ai[0],ci=ai[1],ui=(0,Ne.st)(e.role.organization,ge.T.RUNAWAY_AI),yi=(0,Ne.st)(e.role.organization,ge.T.SAFE_BROWSING),mi=(0,Ne.st)(e.role.organization,ge.T.UNATTENDED_REMOTE_ACCESS),hi=(0,Ne.st)(e.role.organization,ge.T.AIKIDO_ENABLED),Ai=(0,a.useMemo)(()=>[{key:"general",label:v("policies.tabs.general")},{key:"operatingSystem",label:v("policies.tabs.operatingSystem")},{key:"deviceSettings",label:v("policies.tabs.deviceSettings")},{key:"browsers",label:v("policies.tabs.browsers")},...ui?[{key:"aiChecks",label:v("policies.tabs.aiChecks")}]:[],{key:"otherTools",label:v("policies.tabs.otherTools")}],[ui,v]),ji=null!==(u=null===(m=Ai.find(e=>e.key===Qe))||void 0===m?void 0:m.label)&&void 0!==u?u:Ai[0].label,Ci=(0,ke.u)(),Si=Ci.shadowSnapshot,Ki=Ci.refreshShadowSnapshots,Ti=(0,a.useState)(null),Ei=(0,s.A)(Ti,2),Pi=Ei[0],Di=Ei[1],Oi=(0,a.useState)(void 0),Li=(0,s.A)(Oi,2),Ri=Li[0],Mi=Li[1],zi=(0,a.useMemo)(()=>wi(V,Ri),[V,Ri]),Ii=((e,i)=>{const o=(0,re.G)(),s=o.applications,n=o.loading,t=o.error;return(0,a.useMemo)(()=>{if(!e)return{applications:[],status:"ready"};const o=null!==i&&void 0!==i?i:[],a=!!s&&s.length>0;if(!a&&0===o.length){if(t)return{applications:[],status:"error"};if(n)return{applications:[],status:"loading"}}const c=a?s:o;return{applications:(0,di.D)(c,e),status:"ready"}},[s,i,e,n,t])})(null===V||void 0===V?void 0:V.policy_id,e.applications),Gi=Ii.applications,Bi=Ii.status,Fi=(0,a.useRef)(!0);(0,a.useEffect)(()=>(Fi.current=!0,()=>{Fi.current=!1}),[]);const Wi=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{Wi.current=X},[X]);const Ui=(0,a.useRef)(e=>e),Vi=(0,a.useCallback)((e,i)=>{_i.Cp(i,{level:"error",tags:{feature:"policy-autosave",phase:"after-unmount"},extra:{policyId:e.policy_id}}),Z((0,n.A)({isSaved:!1,title:v("policies.editPolicy.saveLostTitle"),message:v("policies.editPolicy.saveLostMessage",{name:e.name})},e.policy_id?{actionLabel:v("policies.editPolicy.saveLostAction"),action:()=>O.A.navigateTo("/policies/".concat(e.policy_id))}:{}))},[Z,v]),Yi=(0,a.useCallback)(async i=>{if(z)return;const o=e.role.organization.organization_id,s=Wi.current;let a;if(i.policy_id){const e=Wi.current,s=await se({organizationId:o,policyId:i.policy_id,supersedeInFlight:!0,replay:o=>vi(o,null!==e&&void 0!==e?e:o,i)}),n=Ui.current(s);a=s,Wi.current=s,Fi.current&&(Q(s),Y(n))}else{const e=await N.Ay.createPolicy(o,(0,q.r5)(i)),s=Ui.current(e);a=e,Fi.current&&(Q(e),Wi.current=e,Y(s),O.A.bypassBeforeNavigate(),O.A.navigateTo("/policies/".concat(e.policy_id),void 0,{replace:!0}))}(!i.policy_id||i.name!==(null===s||void 0===s?void 0:s.name))&&ie(),s&&(wi(s,a).length>0?ue(a,!0,!0).then(e=>{e&&Fi.current&&Mi(a)}):Mi(e=>e?(0,n.A)((0,n.A)({},a),Object.fromEntries(ki.map(i=>[i,e[i]]))):e))},[z,se,e.role.organization.organization_id,ie,ue]),qi=(e=>{let i=e.policy,o=e.enabled,t=e.save,c=e.validate,l=e.debounceMs,r=void 0===l?600:l,d=e.saveTimeoutMs,p=void 0===d?3e4:d,u=e.rebaseQueuedEdit,y=e.onFailureAfterUnmount;const m=(0,a.useState)("idle"),h=(0,s.A)(m,2),v=h[0],g=h[1],f=(0,a.useState)(!1),x=(0,s.A)(f,2),_=x[0],b=x[1],k=(0,a.useRef)(null),A=(0,a.useRef)(void 0),j=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),N=(0,a.useRef)(void 0),C=(0,a.useRef)(!1),S=(0,a.useRef)(!1),K=(0,a.useRef)(!0),T=(0,a.useRef)(0),E=(0,a.useRef)(t);(0,a.useEffect)(()=>{E.current=t},[t]);const P=(0,a.useRef)(y);(0,a.useEffect)(()=>{P.current=y},[y]);const D=(0,a.useRef)(u);(0,a.useEffect)(()=>{D.current=u},[u]);const O=(0,a.useRef)(c);(0,a.useEffect)(()=>{O.current=c},[c]);const L=(0,a.useRef)(o);(0,a.useEffect)(()=>{L.current=o},[o]);const R=(0,a.useRef)(p);(0,a.useEffect)(()=>{R.current=p},[p]);const M=(0,a.useCallback)(e=>{A.current=e,K.current&&b(Boolean(e))},[]),z=(0,a.useRef)(()=>{}),I=(0,a.useCallback)(e=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null,z.current()},e)},[]),G=(0,a.useCallback)(e=>{if(O.current&&!O.current(e))return;T.current+=1;const i=T.current;N.current=e,C.current=!0,K.current&&g("saving");let o=null;const s=()=>{i===T.current&&(o&&(clearTimeout(o),o=null),C.current=!1,A.current&&(k.current&&(clearTimeout(k.current),k.current=null),z.current()))};o=setTimeout(()=>{var s;(o=null,i===T.current)&&(T.current+=1,w.current=e,C.current=!1,K.current?g("error"):null===(s=P.current)||void 0===s||s.call(P,e,new Error("Policy save timed out")),A.current&&(k.current&&(clearTimeout(k.current),k.current=null),z.current()))},R.current),E.current(e).then(()=>{i===T.current&&(w.current=void 0,K.current&&g("saved")),s()}).catch(o=>{var n;i===T.current&&(w.current=e,K.current?g("error"):null===(n=P.current)||void 0===n||n.call(P,e,o)),s()})},[]),B=(0,a.useCallback)(()=>
1{if(S.current)return;const e=A.current;e&&L.current&&(C.current?I(r):(M(void 0),G(e)))},[r,G,I,M]);(0,a.useEffect)(()=>{z.current=B},[B]);const F=(0,a.useCallback)(()=>{var e;if(!L.current||S.current)return;const i=null!==(e=A.current)&&void 0!==e?e:w.current;i&&(M(i),z.current())},[M]),W=(0,a.useCallback)(e=>{const i=A.current;if(i&&i!==e){const o=N.current,s=D.current&&o?D.current(e,o,i):(0,n.A)((0,n.A)({},i),{},{policy_id:e.policy_id});return M(s),j.current=s,s}return j.current=e,e},[M]),U=(0,a.useCallback)(()=>{S.current=!0,k.current&&(clearTimeout(k.current),k.current=null),M(void 0),w.current=void 0,K.current&&g("idle")},[M]);return(0,a.useEffect)(()=>{i&&!S.current&&(void 0!==j.current?j.current!==i&&o&&(j.current=i,M(i),I(r)):j.current=i)},[i,o,r,I,M]),(0,a.useEffect)(()=>{o?!A.current||k.current||C.current||I(r):k.current&&(clearTimeout(k.current),k.current=null)},[o,r,I]),(0,a.useEffect)(()=>(K.current=!0,()=>{var e;if(K.current=!1,k.current&&(clearTimeout(k.current),k.current=null),S.current||C.current)return;const i=null!==(e=A.current)&&void 0!==e?e:w.current;A.current=void 0,w.current=void 0,i&&L.current&&(O.current&&!O.current(i)||E.current(i).catch(e=>{var o;null===(o=P.current)||void 0===o||o.call(P,i,e)}))}),[]),{state:v,hasUnsavedWork:_||"saving"===v||"error"===v,retry:F,acknowledge:W,discard:U}})({policy:V,enabled:!z&&!B,save:Yi,validate:e=>!Ni(e),rebaseQueuedEdit:vi,onFailureAfterUnmount:Vi}),Ji=qi.state,Hi=qi.hasUnsavedWork,Xi=qi.retry,Qi=qi.acknowledge,$i=qi.discard;(0,a.useEffect)(()=>{Ui.current=Qi},[Qi]);const Zi=V&&V!==X?Ni(V):void 0,eo=Hi||Boolean(Zi),io="error"===Ji||Boolean(Zi);(0,we.H)({hasUnsavedChanges:eo,message:v("policies.editPolicy.unsavedChangesDescription")}),(0,a.useEffect)(()=>{g&&e.organizationId&&Ki(e.organizationId,g)},[g,e.organizationId,Ki]),(0,a.useEffect)(()=>{const e=(0,je.q)(Si);Di(e)},[Si]),(0,a.useEffect)(()=>{ui||"aiChecks"!==Qe||$e("general")},[Qe,ui]),(0,a.useEffect)(()=>{if(null===V||void 0===V||!V.policy_id)return;if(V.policy_id===(null===oe||void 0===oe?void 0:oe.policy_id))return;const e=V;ue(e,!0,!0).then(i=>{i&&Fi.current&&Mi(e)})},[V,null===oe||void 0===oe?void 0:oe.policy_id,ue]),(0,a.useEffect)(()=>{if(!oi)return;const e="policy-setting-".concat(oi);let i=0;let o,s;const n=()=>{const a=document.getElementById(e);if(!a)return i+=1,void(i<50&&(o=window.setTimeout(n,100)));document.querySelectorAll(".policy-setting-highlight").forEach(e=>e.classList.remove("policy-setting-highlight")),a.scrollIntoView({behavior:gi(),block:"center"}),a.focus({preventScroll:!0}),a.classList.add("policy-setting-highlight"),s=window.setTimeout(()=>{a.classList.remove("policy-setting-highlight")},2200)},a=window.setTimeout(n,120);return()=>{var i;window.clearTimeout(a),o&&window.clearTimeout(o),s&&window.clearTimeout(s),null===(i=document.getElementById(e))||void 0===i||i.classList.remove("policy-setting-highlight")}},[Qe,oi,ti]),(0,a.useEffect)(()=>{const e=null!==b&&void 0!==b?b:null===x||void 0===x?void 0:x.activeTab,i=null!==k&&void 0!==k?k:null===x||void 0===x?void 0:x.focusedPolicyKey;e&&Ai.some(i=>i.key===e)&&$e(e),i&&(si(i),ci(e=>e+1))},[x,Ai,b,k]);const oo=(0,a.useCallback)(e=>{e.policyKey&&e.tabKey&&(si(e.policyKey),ci(e=>e+1),$e(e.tabKey))},[]);(0,a.useEffect)(()=>{if(!io)return void(Fe.current&&(O.A.setBeforeNavigate(void 0),Fe.current=null));const e=e=>{let i=e.path,o=e.state;return ye.current=()=>{O.A.bypassBeforeNavigate(),O.A.navigateTo(i,o)},Se(!0),!1};return Fe.current=e,O.A.setBeforeNavigate(e),()=>{Fe.current===e&&(O.A.setBeforeNavigate(void 0),Fe.current=null)}},[io]),(0,a.useEffect)(()=>{if(!io)return;const e=e=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;const i=e.target;if(!i)return;const o=i.closest("a");if(!o)return;const s=o.getAttribute("href");if(!s||s.startsWith("#"))return;if(o.getAttribute("target")&&"_self"!==o.getAttribute("target"))return;if(o.hasAttribute("download"))return;let n;try{n=new URL(s,window.location.origin)}catch(a){return}n.origin===window.location.origin&&(e.preventDefault(),e.stopPropagation(),ye.current=()=>{O.A.bypassBeforeNavigate(),O.A.navigateTo("".concat(n.pathname).concat(n.search).concat(n.hash))},Se(!0))};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[io]),(0,a.useEffect)(()=>()=>{Fe.current&&(O.A.setBeforeNavigate(void 0),Fe.current=null)},[]);const so=(0,a.useCallback)((e,i)=>{!1!==(null===i||void 0===i?void 0:i.markDirty)&&Be||(Y(e),!1===(null===i||void 0===i?void 0:i.markDirty)&&
1(Q(e),Mi(e)))},[Be]),no=(0,a.useCallback)(e=>{Be||("function"===typeof e?Y(i=>i?e(i):i):so(e))},[so,Be]),ao=(0,a.useCallback)(()=>{O.A.bypassBeforeNavigate(),O.A.navigateToPolicies()},[]),to=(0,a.useCallback)(()=>{Be||(Ge(void 0),Pe(!0))},[Be]),co=(0,a.useCallback)(()=>{const i=null===V||void 0===V?void 0:V.policy_id;i&&(Re(!0),Ge(void 0),N.Ay.deletePolicy(e.role.organization.organization_id,i).then(()=>{Pe(!1),$i(),Fi.current=!1,ie(),ao()}).catch(()=>{Ge(v("policies.deletePolicyError"))}).finally(()=>{Re(!1)}))},[null===V||void 0===V?void 0:V.policy_id,e.role.organization.organization_id,$i,ie,ao,v]),lo=(0,a.useCallback)(()=>{if(io)return ye.current=ao,void Se(!0);Fi.current=!1,ao()},[io,ao]),ro=!$&&!(null===V||void 0===V||!V.policy_id)&&V.policy_id!==e.role.organization.default_policy_id&&0===Gi.length;a.useEffect(()=>{$?V||so({name:"",policy_id:"",organization_id:"",installed:!1,unsupported:!1,skip:!1,skip_mobile:!1,skip_desktop:!1,agentless_allowed:!1,os:{WarnTime:1382400,GoalTime:2592e3},os_autoupdate:{warn:!0,goal:!0},browser:{WarnTime:1382400,GoalTime:2592e3},disk_encryption:{warn:!0,goal:!0},screen_lock:{warn:!0,goal:!0},antivirus:{warn:!0,goal:!0},password_manager:{warn:!0,goal:!0},biometrics:{warn:!0,goal:!0},reboot:{WarnTimeInDays:14,GoalTimeInDays:30},firewall:{warn:!0,goal:!0},dns:{dns_servers:[],validation_mode:"exact_match",warn:!1,block:!1,goal:!1},screen_sharing:{warn:!0,goal:!0},remote_scripting:{warn:!0,goal:!0},remote_management:{warn:!0,goal:!0},remote_login:{warn:!0,goal:!0},unattended_remote_access:{warn:!0,goal:!0},windows_recall:{warn:!0,goal:!0},jailbroken:{warn:!0,goal:!0},rooted:{warn:!0,goal:!0},developer_mode:{warn:!0,goal:!0},secrets_in_environment:{warn:!0,goal:!0},autonomous_agents_present:{warn:!0,goal:!0},unguarded_elevation:{warn:!0,goal:!0},unsafe_ai_mode:{warn:!0,goal:!0}},{markDirty:!1}):(F(!0),N.Ay.getPolicy(e.role.organization.organization_id,g).then(e=>{const i=(0,q.r5)(e);so(i,{markDirty:!1}),F(!1)}).catch(e=>{qe(e.message),F(!1)}))},[]);const po=()=>{Se(!1),ye.current=null};return(0,h.jsxs)("div",{className:"policy-page-shell",children:[(0,h.jsxs)("div",{className:"policy-sticky-header",children:[(0,h.jsx)(L.A,{links:We}),(0,h.jsxs)("div",{className:"policy-header",children:[(0,h.jsxs)(S.A,{variant:"pagetitle",component:"h2",className:"policy-header-title",children:[v($?"policies.createPolicy.title":"policies.editPolicy.title"),(null===V||void 0===V?void 0:V.name)&&": ".concat(V.name)]}),(0,h.jsxs)("div",{className:"policy-header-actions",children:[(0,h.jsx)(fi,{state:Ji,onRetry:Xi,blockedReason:Zi,canRetry:!z}),ro&&!Be&&(0,h.jsx)(l.A,{onClick:to,startIcon:(0,h.jsx)(D,{}),sx:bi,children:v("general.delete")}),(0,h.jsx)(l.A,{onClick:lo,variant:"outlined",children:v("general.close")})]})]}),V&&!B&&(0,h.jsx)("div",{className:"policy-tabs-wrapper",children:(0,h.jsx)(_e.g,{options:Ai.map(e=>e.label),selectedOption:ji,onChange:e=>{const i=Ai.find(i=>i.label===e);i&&$e(i.key)},className:"policy-tabs"})})]}),(0,h.jsx)(y.A,{ref:Je,severity:"error",className:"policy-error-alert",style:{display:Ye?"flex":"none",marginTop:16},children:Ye}),B?(0,h.jsx)("div",{className:"w-full flex justify-center items-center",style:{marginTop:16},children:(0,h.jsx)(r.A,{})}):V&&(0,h.jsx)("div",{className:"policy-page",children:(0,h.jsxs)("div",{className:"policy-content-wrapper",children:[(0,h.jsxs)("div",{className:"policy-main-content",children:["general"===Qe&&(0,h.jsx)(de,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi}),"operatingSystem"===Qe&&(0,h.jsx)(te,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi,focusPolicyKey:oi,focusRequestVersion:ti}),"deviceSettings"===Qe&&(0,h.jsx)(pe,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi,focusPolicyKey:oi,hasUnattendedRemoteAccessFeature:mi}),"browsers"===Qe&&(0,h.jsx)(me,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi,focusPolicyKey:oi,hasSafeBrowsingFeature:yi}),"otherTools"===Qe&&(0,h.jsx)(fe,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi,focusPolicyKey:oi,hasAikidoFeature:hi}),ui&&"aiChecks"===Qe&&(0,h.jsx)(xe,{policy:V,setPolicy:no,loading:B||Be,deviceStats:Pi,focusPolicyKey:oi})]}),(0,h.jsxs)("div",{className:"policy-stats-sidebar",children:[(0,h.jsx)(li,{applications:Gi,organization:e.role.organization,status:Bi}),(0,h.jsx)(ei,{policy:V,devices:ae,hasRunawayAiFeature:ui,hasUnattendedRemoteAccessFeature:mi,hasAikidoFeature:hi,isLoading:ce||le,outdatedPolicyKeys:zi,onCheckClick:oo})]})]})}),Ee&&(0,h.jsx)(C.A,{title:v("policies.deletePolicyConfirm"),content:v("policies.deletePolicyDescription"),cancelText:v("policies.deletePolicyCancel"),confirmText:v("policies.deletePolicyConfirmButton"),confirmColor:"error",inProgress:Le,error:Ie,onCancel:()=>{Pe(!1),Ge(void 0)},onConfirm:co}),(0,h.jsx)(K.A,{open:Ce,onClose:po,"aria-labelledby":"policy-unsaved-dialog-title","aria-describedby":"policy-unsaved-dialog-description",maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{backgroundColor:"white",borderRadius:"12px",padding:"24px",boxShadow:"0px 8px 8px -4px #10182808, 0px 20px 24px -4px #10182814"}},children:(0,h.jsxs)(c.A,{sx:{display:"flex",flexDirection:"column",gap:"20px"},children:[(0,h.jsxs)(c.A,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,h.jsx)(T.A,{id:"policy-unsaved-dialog-title",sx:{padding:0,color:"var(--color-gray-900)",fontWeight:600,fontSize:"18px",lineHeight:"28px"},children:v("policies.editPolicy.leaveTitle")}),(0,h.jsx)(E.A,{sx:{padding:0},children:(0,h.jsx)(P.A,{id:"policy-unsaved-dialog-description",sx:{margin:0,color:"var(--color-gray-700)",fontWeight:400,fontSize:"14px",lineHeight:"20px"},children:v("policies.editPolicy.leaveDescription")})})]}),(0,h.jsxs)(c.A,{sx:{display:"flex",width:"100%",flexWrap:"wrap",gap:"12px",justifyContent:"space-between"},children:[(0,h.jsx)(l.A,{onClick:po,variant:"outlined",children:v("general.cancel")}),(0,h.jsx)(l.A,{onClick:()=>{Se(!1);const e=ye.current;ye.current=null,$i(),Fi.current=!1,e&&e()},variant:"contained",children:v("policies.editPolicy.leaveConfirm")})]})]})})]})},Si=(0,m.A)((0,h.jsx)("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline");var Ki=o(16388);const Ti=(e,i,o)=>{const s=(e=>/iPhone|iPad|iPod/i.test(e)?"iOS":/Android/i.test(e)?"Android":/Windows/i.test(e)?"Windows":/Mac OS X|Macintosh/i.test(e)?"macOS":/Linux|X11/i.test(e)?"Linux":void 0)(o);if(!s)return;const n=i.trim().toLowerCase();return e.filter(e=>{var i;return(null===(i=e.email)||void 0===i?void 0:i.trim().toLowerCase())===n&&((e,i)=>{switch(i){case"Windows":return(0,Te.uF)(e);case"macOS":return(0,Te.U0)(e);case"Linux":return(0,Te.j9)(e);case"iOS":return(0,Te.m2)(e);case"Android":return(0,Te.m0)(e)}})(e.os_name,s)}).sort((e,i)=>{var o,s;return(null!==(o=i.timestamp_submitted)&&void 0!==o?o:0)-(null!==(s=e.timestamp_submitted)&&void 0!==s?s:0)})[0]};var Ei=o(41543),Pi=o(66282),Di=o(48608),Oi=o(70334),Li=o(85496),Ri=o(62784);const Mi=new Map,zi=new Map,Ii=(e,i,o)=>
1"".concat(e,":").concat(o?"trial":"standard",":").concat(i),Gi=e=>{var i;const o=(0,t.Bd)().t,m=(0,U.M)(),S=a.useState(""),K=(0,s.A)(S,2),T=K[0],E=K[1],P=a.useState(!0),D=(0,s.A)(P,2),L=D[0],R=D[1],M=a.useState(void 0),z=(0,s.A)(M,2),I=z[0],G=z[1],B=a.useState(!1),F=(0,s.A)(B,2),W=F[0],V=F[1],Y=(0,a.useState)(e.role.organization),J=(0,s.A)(Y,2),H=J[0],Q=J[1],$=(0,be.V)(),Z=$.policies,ee=$.loading,ie=$.refreshPolicies,oe=(0,re.G)(),se=oe.applications,ne=oe.loading,ae=(0,Ae.d)(),te=ae.devices,ce=ae.loading,le=(0,oi.g)(),de=le.planCapabilities,pe=le.settings,ue=le.onTrial,ye=(0,a.useState)(!1),me=(0,s.A)(ye,2),he=me[0],ve=me[1],fe=(0,a.useState)(()=>new Set),xe=(0,s.A)(fe,2),_e=xe[0],ke=xe[1],je=(0,a.useState)(()=>new Map),we=(0,s.A)(je,2),Ce=we[0],Se=we[1],Ke=a.useRef(!0),Ee=(0,a.useMemo)(()=>(0,Ne.st)(e.role.organization,ge.T.RUNAWAY_AI),[e.role.organization]),Pe=(0,a.useMemo)(()=>(0,Ne.st)(e.role.organization,ge.T.UNATTENDED_REMOTE_ACCESS),[e.role.organization]),De=(0,a.useMemo)(()=>(0,Ne.st)(e.role.organization,ge.T.AIKIDO_ENABLED),[e.role.organization]),Oe=a.useMemo(()=>{const e="https://web.xfa.tech/token";try{return new URL("/verify",e).toString()}catch(i){return}},[]),Le=a.useMemo(()=>Ti(te,e.role.email,window.navigator.userAgent),[te,e.role.email]),Re=void 0!==Oe&&void 0!==Le,Me=(0,X.A)("(max-width:768px)"),ze=Re&&!Me,Ie=Re&&Me,Ge=(0,a.useCallback)(i=>{if(!Oe||!Le)return;(0,Ki.s)("Test policy");const o=new URL(Oe);o.searchParams.set("organizationId",e.role.organization.organization_id),o.searchParams.set("deviceId",Le.device_id),o.searchParams.set("policyId",i.policy_id),O.A.navigateToExternal(o.toString())},[e.role.organization.organization_id,Le,Oe]);(0,a.useEffect)(()=>(Ke.current=!0,()=>{Ke.current=!1}),[]);const Be=(0,a.useCallback)(async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!H)return;const o=H.organization_id,s=Ii(o,e,!!ue),n=i.force?void 0:Mi.get(s);if(n&&"loading"!==n.status)return void Se(i=>{const o=new Map(i);return o.set(e,n),o});Ke.current&&Se(i=>{const o=new Map(i);return o.set(e,{status:"loading"}),o});let a=i.force?void 0:zi.get(s);a||(a=(async(e,i,o)=>{const s=(0,N.kT)(),n=s.fromDate,a=s.toDate,t=o?N.Ay.getGroupedDevicesInTrial:N.Ay.getGroupedDevices;let c,l=[];do{var r;const o=await t(e,c,i,!0,n,a);null!==o&&void 0!==o&&null!==(r=o.shadows)&&void 0!==r&&r.length&&(l=[...l,...o.shadows]),c=null===o||void 0===o?void 0:o.lastEvaluatedKey}while(c);return l.flatMap(e=>{var i;return(0,Te.Fz)(null!==(i=e.devices)&&void 0!==i?i:[])})})(o,e,!!ue),zi.set(s,a));try{const i={status:"ready",devices:await a};Mi.set(s,i),Ke.current&&Se(o=>{const s=new Map(o);return s.set(e,i),s})}catch(t){const i={status:"error"};Mi.set(s,i),Ke.current&&Se(o=>{const s=new Map(o);return s.set(e,i),s})}finally{zi.get(s)===a&&zi.delete(s)}},[H,ue]);(0,a.useEffect)(()=>{if(!H||null===Z||void 0===Z||!Z.length)return;const e=H.organization_id,i=H.default_policy_id,o=Z.map(e=>e.policy_id).filter(e=>e!==i);Se(i=>{const s=new Map(i);return o.forEach(i=>{var o;const n=Ii(e,i,!!ue),a=Mi.get(n);a&&"loading"!==a.status?s.set(i,a):s.has(i)&&"idle"!==(null===(o=s.get(i))||void 0===o?void 0:o.status)||s.set(i,{status:"loading"})}),s});let s=!1;return(async()=>{for(const i of o){if(s)return;const o=Ii(e,i,!!ue),n=Mi.get(o);"ready"!==(null===n||void 0===n?void 0:n.status)&&await Be(i)}})(),()=>{s=!0}},[Be,H,ue,Z]);const Fe=(0,a.useCallback)(e=>{const i=e.policy_id,o=!_e.has(i);if(ke(e=>{const o=new Set(e);return o.has(i)?o.delete(i):o.add(i),o}),o&&H&&i!==H.default_policy_id){const e=Ce.get(i);e&&"idle"!==e.status&&"error"!==e.status||Be(i,{force:"error"===(null===e||void 0===e?void 0:e.status)})}},[_e,H,Ce,Be]),We=(0,a.useCallback)(e=>{var i;return H&&e.policy_id===H.default_policy_id?ce?{status:"loading"}:{status:"ready",devices:te}:null!==(i=Ce.get(e.policy_id))&&void 0!==i?i:{status:"idle"}},[te,H,Ce,ce]),Ue=(0,a.useCallback)((e,i)=>{O.A.navigateToPolicy(e.policy_id,{focusedPolicyKey:i.policyKey,activeTab:i.tabKey})},[]),Ve=null!==(i=null===Z||void 0===Z?void 0:Z.length)&&void 0!==i?i:0,Ye=(0,si.Yf)(de,Ve,ue,pe),qe=(0,a.useCallback)(()=>{ve(!1);const e=o("policies.upgradeModal.contactSalesMessage");(0,Oi.z$)(e)},[o]),Je=(0,a.useCallback)(()=>{Ye?ve(!0):O.A.navigateToPolicy()},[Ye]);(0,a.useEffect)(()=>{R(!(!ee&&!ne))},[ee,ne]);const He=(0,a.useCallback)(()=>N.Ay.getOrganizationFull(e.role.organization.organization_id).then(i=>{i&&(e.role.organization=i,Q(i))}),[e.role.organization]),Xe=(0,a.useCallback)(i=>{const o=(0,n.A)({},e.role.organization);o.default_policy_id=i.policy_id,N.Ay.updateOrganization(e.role.organization.organization_id,o).then(()=>{e.role.organization.default_policy_id=i.policy_id,He()})},[He,e.role.organization]);return(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"policies-header policies-header--actions-only",children:!m&&Z&&Z.length>0&&(0,h.jsx)("div",{className:"invite-buttons",children:(0,h.jsx)(c.A,{onClick:e=>{Ye&&(e.stopPropagation(),ve(!0))},sx:{display:"inline-block"},children:(0,h.jsx)(l.A,{variant:"contained",onClick:Je,disabled:Ye,children:o("policies.createPolicy.button")})})})}),(0,h.jsx)("div",{style:{marginTop:16},children:(0,h.jsx)(Li.A,{type:Ri.Y.POLICY})}),L?(0,h.jsx)("div",{style:{textAlign:"center",paddingTop:25},children:(0,h.jsx)(r.A,{size:30})}):(0,h.jsxs)("div",{className:"table w-full","data-cy":"policies",children:[Z&&Z.length>0&&(0,h.jsxs)(k.A,{component:w.A,children:[(0,h.jsxs)(x.A,{sx:{minWidth:{xs:"unset",sm:650}},"aria-label":"simple table",className:"policies-table",children:[(0,h.jsx)(A.A,{style:{background:"var(--color-gray-100)"},children:(0,h.jsxs)(j.A,{children:[(0,h.jsx)(b.A,{className:"policies-toggle-cell"}),(0,h.jsx)(b.A,{children:o("policies.name")}
1),(0,h.jsx)(b.A,{children:o("policies.integrations")}),(0,h.jsx)(b.A,{children:o("policies.devices")}),(0,h.jsx)(b.A,{})]})}),(0,h.jsx)(_.A,{children:H&&Z&&Z.map((i,s)=>{const n=_e.has(i.policy_id),t=We(i),c="ready"===t.status?t.devices:[],r="loading"===t.status,y="error"===t.status,x="idle"===t.status,_=s%2===1?" policies-row--alt":"";return(0,h.jsxs)(a.Fragment,{children:[(0,h.jsxs)(j.A,{className:"selectableRow".concat(_),onClick:()=>Fe(i),children:[(0,h.jsx)(b.A,{className:"policies-toggle-cell",children:(0,h.jsx)(d.A,{size:"small","aria-label":o(n?"policies.collapseDetails":"policies.expandDetails"),"aria-expanded":n,onClick:e=>{e.stopPropagation(),Fe(i)},className:n?"policies-toggle-button policies-toggle-button--open":"policies-toggle-button",children:(0,h.jsx)(g.A,{fontSize:"small"})})}),(0,h.jsx)(b.A,{children:(0,h.jsxs)("div",{className:"policies-name-cell",children:[(0,h.jsx)("span",{className:"policies-name-text",children:i.name}),i.policy_id===H.default_policy_id&&(0,h.jsx)(p.A,{size:"small",label:"Default",color:"primary",className:"policies-name-badge"})]})}),(0,h.jsx)(b.A,{children:(0,q.k_)(null!==se&&void 0!==se?se:[],i,se.length)}),(0,h.jsx)(b.A,{className:"policies-devices-cell",children:x?(0,h.jsx)("div",{className:"policies-devices-placeholder","aria-hidden":"true",children:"\u2014"}):y?(0,h.jsxs)("button",{type:"button",className:"policies-devices-error",onClick:e=>{e.stopPropagation(),Be(i.policy_id,{force:!0})},children:[(0,h.jsx)(f.A,{fontSize:"small",className:"policies-devices-error-icon"}),(0,h.jsx)("span",{children:o("policies.devicesLoadError")}),(0,h.jsx)("span",{className:"policies-devices-error-retry",children:o("policies.devicesRetry")})]}):(0,h.jsx)(ei,{policy:i,devices:c,hasRunawayAiFeature:Ee,hasUnattendedRemoteAccessFeature:Pe,hasAikidoFeature:De,isLoading:r,variant:"summary-only"})}),(0,h.jsx)(b.A,{align:"right",className:"policies-actions-cell",children:(0,h.jsxs)("div",{className:"policies-actions",onClick:e=>e.stopPropagation(),children:[ze&&(0,h.jsx)(l.A,{variant:"outlined",size:"small",onClick:e=>{e.stopPropagation(),Ge(i)},children:o("policies.testPolicy")}),(0,h.jsx)(u.A,{component:"button",type:"button",underline:"hover",onClick:e=>{e.stopPropagation(),O.A.navigateToPolicy(i.policy_id)},className:"policies-edit-link",children:o("policies.editPolicy.title")}),(Ie||!m)&&(0,h.jsx)(Pi.A,{mode:"dropdown",actions:[...Ie?[{label:"policies.testPolicy",icon:(0,h.jsx)(Si,{className:"icon"}),onClick:()=>{Ge(i)}}]:[],...m?[]:[{label:"policies.setDefaultPolicy",icon:(0,h.jsx)(v,{className:"icon"}),disabled:i.policy_id===e.role.organization.default_policy_id,onClick:()=>{Xe(i)}},{label:"policies.deletePolicy",icon:(0,h.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon-delete",children:[(0,h.jsx)("path",{d:"M15 6.75L13.5037 15.2597C13.3777 15.977 12.7546 16.5 12.0265 16.5H5.97355C5.24534 16.5 4.62232 15.977 4.49622 15.2597L3 6.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.jsx)("path",{d:"M15.75 4.5H11.5312M11.5312 4.5V3C11.5312 2.17157 10.8597 1.5 10.0312 1.5H7.96875C7.14032 1.5 6.46875 2.17157 6.46875 3V4.5M11.5312 4.5H6.46875M2.25 4.5H6.46875",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),disabled:1===Z.length||(0,q.KQ)(null!==se&&void 0!==se?se:[],i),disabledTooltip:o("policies.deletePolicyTooltip"),delete:!0,onClick:()=>{G(i)}}]]})]})})]}),n&&(0,h.jsx)(j.A,{className:"policies-expanded-row".concat(_),children:(0,h.jsx)(b.A,{colSpan:5,className:"policies-expanded-cell",children:y?(0,h.jsxs)("div",{className:"policies-expanded-error",children:[(0,h.jsx)(f.A,{className:"policies-devices-error-icon",fontSize:"small"}),(0,h.jsx)("span",{children:o("policies.devicesLoadError")}),(0,h.jsx)(l.A,{size:"small",onClick:()=>Be(i.policy_id,{force:!0}),children:o("policies.devicesRetry")})]}):(0,h.jsx)(ei,{policy:i,devices:c,hasRunawayAiFeature:Ee,hasUnattendedRemoteAccessFeature:Pe,hasAikidoFeature:De,isLoading:r,variant:"embedded",onCheckClick:e=>Ue(i,e)})})})]},i.policy_id)})})]}),T&&(0,h.jsx)(y.A,{onClose:()=>{E("")},severity:"error",children:T})]}),Z&&0===Z.length&&(0,h.jsx)(Ei.A,{context:"policies",onClick:m?()=>{}:Je}),I&&(0,h.jsx)(C.A,{title:o("policies.deletePolicyConfirm"),cancelText:o("policies.deletePolicyCancel"),confirmText:o("policies.deletePolicyConfirmButton"),inProgress:W,onCancel:()=>{G(void 0)},onConfirm:()=>{V(!0),N.Ay.deletePolicy(e.role.organization.organization_id,I.policy_id).then(()=>{G(void 0),ie()}).finally(()=>{V(!1)})}}),(0,h.jsx)(Di.A,{open:he,onClose:()=>ve(!1),badge:o("policies.limitDialog.badge"),title:o("policies.limitDialog.title"),description:o("policies.limitDialog.description"),primaryLabel:o("policies.limitDialog.upgradePlan"),onPrimary:qe})]})]})},Bi=e=>(0,h.jsxs)(R.BV,{children:[(0,h.jsx)(R.qh,{path:"",element:(0,h.jsx)(Gi,(0,n.A)({},e))}),(0,h.jsx)(R.qh,{path:"new",element:(0,h.jsx)(Ci,{role:e.role,organizationId:e.role.organization.organization_id,applications:[]})}),(0,h.jsx)(R.qh,{path:":policyId",element:(0,h.jsx)(Ci,{role:e.role,organizationId:e.role.organization.organization_id,applications:[]})})]})},93412(e,i,o){o.d(i,{A:()=>t});o(9950);var s=o(68476),n=o(66364),a=o(44414);const t=e=>{let i=e.links;const o=i.length-1;return(0,a.jsx)("nav",{className:"breadcrumbs","aria-label":"breadcrumb",children:(0,a.jsx)("ol",{className:"breadcrumbs-list",children:i.map((e,i)=>{const t=i===o;return(0,a.jsxs)("li",{className:"breadcrumbs-item",children:[e.href&&!t?(0,a.jsx)("a",{className:"breadcrumbs-link",href:e.href,onClick:i=>((e,i)=>{e.preventDefault(),i&&n.A.navigateTo(i)})(i,e.href),children:e.label}):(0,a.jsx)("span",{className:"breadcrumbs-current","aria-current":"page",children:e.label}),!t&&(0,a.jsx)(s.A,{"aria-hidden":"true",className:"breadcrumbs-separator"})]},"".concat(e.label,"-").concat(i))})})})}},95882(e,i,o){o.d(i,{A:()=>s});o(9950);const s=o.p+"static/media/microsoft-icon.102a13bd2edb5a6934952aecbdd3f030.svg"}}]);

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.