PageSourceSearch

https://static.scale.com/dashboard.scale.com/rrvqttTwFdiikV-VvVU_R…/static/chunks/4363-2ec486b6a06b1925.js

js scale.com collected 2026-09-24 08:47:16 UTC 30,089 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4363,50326],{191955:function(e,l,t){t.d(l,{Q:function(){return m},r:function(){return r}});var n,r,a=t(667488),i=t(885115),s=t(747910),o=t.n(s),c=t(450326),u=t(186793),d=t(172868);(n=r||(r={})).SelectMenu="SelectMenu",n.Switch="Switch",n.TextField="TextField",n.NumberField="NumberField",n.Array="Array",n.Json="Json";let m=(0,i.memo)(e=>{let{schema:l,parentName:t,metadataByConfigPath:n,fields:r}=e,s=(0,i.useMemo)(()=>(0,u.Ly)((0,u.UC)({schema:l,parentName:t}),r),[l,t,r]);return(0,a.jsx)(a.Fragment,{children:s.map(e=>{var l,t,i,s,p,x,f,h,v,g,j;let{name:y,schema:b,Component:S}=e,N=(0,u.nb)(b),w=null==n?void 0:n[y],F={key:y,label:(null==w?void 0:w.title)||b.title||o().startCase(y.split(".")[y.split(".").length-1]),name:y,labelDescription:null!==(l=null==w?void 0:w.description)&&void 0!==l?l:b.description,useFastField:!0};if(S)return(0,a.jsx)(S,{...F,className:"w-full max-w-[360px]"});switch(N){case"SelectMenu":{let e=null!==(i=null===(t=b.enum)||void 0===t?void 0:t.map((e,l)=>{var t;return{id:e,name:(null===(t=b.enumNames)||void 0===t?void 0:t[l])||(null===e?"None":o().isNumber(e)?e.toString():function(e){let l=o().startCase(e);return l||e}(e))}}))&&void 0!==i?i:[];return(0,a.jsx)(c.aS,{...F,className:"w-full max-w-[360px]",options:e,renderValue:l=>{var t,n;let r=e.find(e=>{let{id:t}=e;return t===l}),a=e.find(e=>{let{id:l}=e;return l===b.default});return null!==(n=null!==(t=null==r?void 0:r.name)&&void 0!==t?t:null==a?void 0:a.name)&&void 0!==n?n:"Select a value"}})}case"Switch":return(0,a.jsx)(c.Se,{...F,className:"w-full max-w-[360px]"});case"TextField":return(0,a.jsx)(c.fh,{...F,className:"w-full max-w-[360px]",id:y,type:"text",placeholder:null!==(s=b.default)&&void 0!==s?s:""});case"NumberField":return(0,a.jsx)(c.fh,{...F,className:"w-full max-w-[360px]",id:y,type:"number",placeholder:null!==(p=b.default)&&void 0!==p?p:"",min:b.minimum||b.exclusiveMinimum,max:b.maximum||b.exclusiveMaximum,step:null!==(x=b.multipleOf)&&void 0!==x?x:1});case"Json":return(0,a.jsx)(c.u0,{...F,className:"w-full max-w-[480px]",id:y,label:F.label+" (JSON)"});case"Array":{let e=b.items,l=Array.isArray(e)?e[0]:e,t=(0,u.nb)(l);if("TextField"===t)return(0,a.jsx)(d.S,{...F,className:"w-full max-w-[360px]",id:y,type:"text",placeholder:l.default});if("NumberField"===t&&!(null==l?void 0:l.enum))return(0,a.jsx)(d.S,{...F,className:"w-full max-w-[360px]",id:y,type:"number",placeholder:null!==(f=l.default)&&void 0!==f?f:"",min:l.minimum||l.exclusiveMinimum,max:l.maximum||l.exclusiveMaximum,step:null!==(h=l.multipleOf)&&void 0!==h?h:1});if("SelectMenu"===t||"NumberField"===t&&(null==l?void 0:l.enum)){let e=null!==(g=null===(v=l.enum)||void 0===v?void 0:v.map(e=>({id:e,name:o().isNumber(e)?e.toString():o().startCase(e)})))&&void 0!==g?g:[];return(0,a.jsx)(c.nQ,{...F,className:"w-full max-w-[360px]",multiple:!0,options:e,renderValue:t=>{var n;let r=e.filter(e=>{let{id:l}=e;return t.includes(l)}),a=e.find(e=>{let{id:t}=e;return t===(null==l?void 0:l.default)});return r.length?r.map(e=>{let{name:l}=e;return l}).join():null!==(n=null==a?void 0:a.name)&&void 0!==n?n:"Select some values"}})}if(l)return(0,a.jsx)(c.Jw,{...F,className:"w-full max-w-[360px]",initialValue:null!==(j=b.default)&&void 0!==j?j:(0,u.D1)(l),children:e=>(0,a.jsx)(m,{schema:l,fields:r,parentName:"".concat(y,"[").concat(e,"]")},"".concat(y,"[").concat(e,"]"))});break}default:console.warn("Unsupported componentType",N,y,b)}})})})},108384:function(e,l,t){t.d(l,{d:function(){return FormikConfigSectionLoading}});var n=t(667488),r=t(281219);let a=["100%","80%"],i=[,,].fill(""),LoadingSkeleton=e=>{let{className:l=""}=e;return(0,n.jsx)("div",{className:(0,r.m)("overflow-hidden rounded-md",l),children:(0,n.jsx)("div",{className:(0,r.m)("animate-[pulse_1s_cubic-bezier(0.4,0,0.6,1)_infinite] h-full  min-h-[16px] w-full bg-neutral-300 rounded")})})},FieldLoading=()=>(0,n.jsxs)("div",{className:"w-full space-y-1",children:[(0,n.jsx)(LoadingSkeleton,{className:"w-1/2 h-5"}),(0,n.jsx)(LoadingSkeleton,{className:"w-full h-9"})]});function FormikConfigSectionLoading(e){let{className:l}=e;return(0,n.jsxs)("div",{className:(0,r.m)("flex gap-10 py-4",l),children:[(0,n.jsxs)("div",{className:"flex-1 flex flex-col gap-2 w-2/
15 max-w-[360px]",children:[(0,n.jsx)(LoadingSkeleton,{className:"h-5 w-[55%] max-w-[360px]"}),(0,n.jsx)("div",{className:"grid gap-1",children:a.map((e,l)=>(0,n.jsx)(LoadingSkeleton,{className:(0,r.m)("h-4","w-[".concat(e,"] max-w-[360px]"))},l))})]}),(0,n.jsx)("div",{className:"flex-1 flex flex-col gap-5 w-3/5 max-w-[360px]",children:i.map((e,l)=>(0,n.jsx)(FieldLoading,{},l))})]})}},979127:function(e,l,t){t.d(l,{c:function(){return p}});var n=t(667488),r=t(885115),a=t(281219),i=t(278619),s=t(450326),o=t(685862),c=t(384719),u=t(289763),d=t(707691);let m={behavior:"smooth",block:"nearest",inline:"start"},p=(0,r.memo)(e=>{let{messageType:l=d.r.Error,getErrors:t}=e,{values:p}=(0,i.u6)(),x=(0,r.useMemo)(()=>t(p).filter(e=>{let{type:t}=e;return l===t}),[p,l,t]),f=(0,r.useCallback)(e=>{let l=null==e?void 0:e[0];if(l){let e=document.body.querySelector('[name="'.concat(l,'"]'))||document.getElementById(l);if(e){let l="none"===window.getComputedStyle(e).display?e.parentElement:e;null==l||l.scrollIntoView(m),(0,s.NM)(l)&&l.focus({preventScroll:!0})}}},[]);return(null==x?void 0:x.length)?(0,n.jsx)(o.U,{className:"overflow-hidden",buttonClassName:"py-0 pl-0",contentContainerClassName:"pl-0 pb-0",startOpen:!0,header:(0,n.jsx)("div",{className:"flex items-center justify-between w-full transition-colors rounded-lg scaleui text-neutral-900 h-fit bg-neutral-0",children:(0,n.jsxs)("div",{className:"relative flex items-center h-full",children:[(0,n.jsx)("div",{className:(0,a.m)("w-1 h-full rounded-t-l absolute",l===d.r.Warn&&"bg-warning-500",l===d.r.Error&&"bg-danger-500")}),(0,n.jsxs)("div",{className:"ml-2",children:[l===d.r.Warn&&(0,n.jsx)(c.J,{icon:"exclamation-circle",variant:"warning"}),l===d.r.Error&&(0,n.jsx)(c.J,{icon:"exclamation-circle",variant:"danger"})]}),(0,n.jsx)("div",{className:"py-3 ml-3",children:(0,n.jsx)(u.ZT.Subtitle3,{children:"There ".concat(x.length>1?"are ".concat(x.length," ").concat(l===d.r.Error?"errors":"warnings"):"is ".concat(x.length," ").concat(l===d.r.Error?"error":"warning"))})})]})}),children:(0,n.jsxs)("div",{className:"relative flex items-center h-full",children:[(0,n.jsx)("div",{className:(0,a.m)("w-1 h-full rounded-b-l absolute",l===d.r.Warn&&"bg-warning-500",l===d.r.Error&&"bg-danger-500")}),(0,n.jsx)("div",{className:"pl-4 pr-2 divide-y divide-neutral-300 w-full pb-4",children:x.map(e=>{let{text:l,fieldName:t}=e;return(0,n.jsx)("div",{className:(0,a.m)("flex items-center h-full px-2",t&&"cursor-pointer hover:bg-neutral-100 rounded-sm"),onClick:()=>f(t),children:(0,n.jsx)("div",{className:"py-3",children:(0,n.jsx)("p",{className:"text-sm font-medium",children:l})})},l)})})]})}):null})},923739:function(e,l,t){t.d(l,{a:function(){return FormikSelectMenuField}});var n=t(667488),r=t(710352),a=t(278619),i=t(66688),s=t.n(i);let FormikSelectMenu=e=>{var l;let{field:t,form:a,disabled:i,helperText:o,error:c,nullable:u,...d}=e,m=t.name,p=s()(a.errors,m),x=a.isSubmitting||i;return(0,n.jsx)(r.S,{...d,name:m,buttonClassName:"scroll-mb-4 scroll-mt-6",setSelected:e=>{a.setFieldValue(m,u&&e===t.value?null:e)},disabled:x,selectedOptionId:null!==(l=t.value)&&void 0!==l?l:"",error:!!p||c,helperText:null!=p?p:o})},FormikSelectMenuField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(a.Rt,{...t,component:FormikSelectMenu}):(0,n.jsx)(a.gN,{...t,component:FormikSelectMenu})}},172868:function(e,l,t){t.d(l,{S:function(){return FormikTextChipsField}});var n=t(667488),r=t(278619),a=t(66688),i=t.n(a),s=t(747910),o=t.n(s),c=t(281219),u=t(885115),d=t(171106),m=t(645181),p=t(147379),x=t(941314),components_TextFieldChips=e=>{let{maxNumberOptions:l,value:t,type:r,onChange:a,placeholder:i="Type a new tag_ID and press enter",renderLabel:s,className:f,...h}=e,[v,g]=(0,u.useState)(""),j=(0,u.useMemo)(()=>(t?Array.isArray(t)?t:t.toString().split(","):[]).sort((e,l)=>e.toString().toLowerCase().localeCompare(l.toString().toLowerCase())),[t]),y=!!(null==h?void 0:h.disabled)||!o().isNil(l)&&!isNaN(l)&&j.length>=l,b=(0,u.useCallback)(()=>{let e=j.includes(v)?j:[...j,v];if(a){if(l&&e.length>l)return;a(e.sort((e,l)=>e.toString().toLowerCase().localeCompare(l.toString().toLowerCase())))}g("")},[j,l,v,a]),S=(0,u.useCallback)(e=>{"Enter"===e.key&&""!==v&&(e.preventDefault(),e.stopPropagation(),b())},[b,v]);
1return(0,n.jsxs)("div",{className:(0,c.m)("grid gap-2",f),children:[(0,n.jsxs)("div",{className:"flex flex-row items-end justify-center gap-2",children:[(0,n.jsx)(d.n,{className:"w-full whitespace-nowrap",placeholder:i,...o().omit(h,"ref"),type:r,disabled:y,value:v,onChange:e=>{let l=e.target.value,t=r&&/number|range/.test(r)?o().isNaN(parseFloat(l))?"":parseFloat(l):l;g(t)},onKeyDown:S}),(0,n.jsx)(m.zx,{className:"whitespace-nowrap p-2 pr-4 mb-1 w-24 justify-center",icon:{position:"left",type:["fas","add"],variant:"primary"},disabled:y||""===v,onClick:b,variant:"primary",type:"button",children:"Add tag"})]}),(0,n.jsxs)("div",{className:"px-1 grid gap-1",children:[(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:j.map(e=>(0,n.jsx)(p.A,{disabled:!!(null==h?void 0:h.disabled),className:"p-1 px-2 bg-neutral-200",label:s?s(e.toString()):e.toString(),onDismiss:()=>{null==a||a(j.filter(l=>l!==e))}},"".concat(h.name,"-chips-").concat(e.toString())))}),l?(0,n.jsxs)(x.p,{disabled:y,children:["You can have a maximum of ",l," options"]}):null]})]})};function TextChipsField(e){let{field:l,form:t,meta:r,helperText:a,disabled:s,ref:o,...c}=e,u=l.name,d=i()(t.touched,u)&&i()(t.errors,u),m=t.isSubmitting||s,p=!!d;return(0,n.jsx)(components_TextFieldChips,{...c,...l,onChange:e=>{t.setFieldValue(u,e),i()(t.touched,u)||t.setFieldTouched(u,!0)},error:p,helperText:p?d:a,disabled:m})}let FormikTextChipsField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(r.Rt,{...t,component:TextChipsField}):(0,n.jsx)(r.gN,{...t,component:TextChipsField})}},450326:function(e,l,t){t.d(l,{Jw:function(){return FormikArrayField},XY:function(){return FormikButton},u0:function(){return FormikJsonField},nQ:function(){return FormikMultipleSelectMenuField},vM:function(){return FormikScrollToFirstError},aS:function(){return h.a},Se:function(){return FormikSwitchField},fh:function(){return FormikTextField},NM:function(){return canFocusElement}});var n=t(667488),r=t(171106),a=t(278619),i=t(66688),s=t.n(i),o=t(885115),c=t(808574),u=t(602872),d=t(975343),m=t(747910),p=t.n(m);function TextField(e){let{field:l,form:t,meta:a,helperText:i,disabled:m,ref:x,...f}=e,[h,v]=(0,o.useState)(!1),g=l.name,j=s()(t.touched,g)&&s()(t.errors,g),y=t.isSubmitting||m,b=(0,c.v)(),S=(0,d.ZP)("bypass-benchmark-wall-size-serving-rate-caps",{projectId:b},!1);return(0,n.jsxs)("div",{children:[(0,n.jsx)(r.n,{...f,...l,inputClassName:"scroll-mb-4 scroll-mt-6",value:l.value,onChange:e=>{let l=e.target.value,n=g.includes("minimumBenchmarks")&&parseFloat(l)>u.ZN,r=g.includes("benchmarkRate")&&parseFloat(l)>u.iT,a=g.includes("disablingBenchmarkAccuracyThresholdMinTaskCount")&&(p().isNaN(Number(l))||0>=Number(l));!S&&(n||r)?v(!0):a?t.setFieldValue(g,"1"):t.setFieldValue(g,l)},error:!!j,helperText:j||i,disabled:y}),(0,n.jsx)(u.ZP,{open:h,fields:[g.includes("minimumBenchmarks")?u.aN.WallSize:u.aN.ServingRate],onClose:()=>v(!1)})]})}let FormikTextField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(a.Rt,{...t,component:TextField}):(0,n.jsx)(a.gN,{...t,component:TextField})};var x=t(459117),f=t(281219);let FormikSwitch=e=>{let{field:l,form:t,disabled:r,helperText:a,className:i,...o}=e,c=l.name,u=s()(t.errors,c),d=t.isSubmitting||r;return(0,n.jsx)(x.r,{...o,id:c,className:(0,f.m)("scroll-mb-4 scroll-mt-6",i),checked:l.value,onCheckedChange:e=>{t.setFieldValue(c,e)},error:!!u,helperText:u||a,disabled:d})},FormikSwitchField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(a.Rt,{...t,component:FormikSwitch}):(0,n.jsx)(a.gN,{...t,component:FormikSwitch})};var h=t(923739),v=t(710352),g=t(147379);let cleanValue=e=>Array.isArray(e)?e.every(e=>"number"==typeof e||"string"==typeof e)?e:[]:"number"==typeof e||"string"==typeof e?[e]:[],FormikMultipleSelectMenu=e=>{let{field:l,form:t,disabled:r,helperText:a,error:i,className:o,...c}=e,u=l.name,d=s()(t.errors,u),m=t.isSubmitting||r,p=cleanValue(l.value);return(0,n.jsxs)("div",{className:(0,f.m)("space-y-2",o),children:[(0,n.jsx)(v.S,{...c,name:u,setSelected:e=>{t.setFieldValue(u,e)},disabled:m,selectedOptionId:p,error:!!d||i,helperText:null!=d?d:a,buttonClassName:"scroll-mb-4 scroll-mt-6"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>{var l,r;return(0,n.jsx)(g.A,{disabled:!!m,className:"p-1 px-2 bg-neutral-200",label:null!==(r=null===(l=c.options.find(l=>l.id===e))||void 0===l?void 0:l.name)&&void 0!==r?r:"",onDismiss:()=>{t.setFieldValue(u,p.filter(l=>l!==e))}},e.toString())})})]})},FormikMultipleSelectMenuField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(a.Rt,{...t,component:FormikMultipleSelectMenu}):(0,n.jsx)(a.gN,{...t,component:FormikMultipleSelectMenu})};var j=t(542645),y=t(189590);let validateJson=e=>{if(void 0!==e&&""!==e){if(e instanceof Error)return"Invalid JSON";try{JSON.parse(JSON.stringify(e));return}catch(e){return"Invalid JSON"}}};function JsonField(e){let{field:l,form:t,disabled:r,label:a,helperText:i,error:c,...u}=e,d=l.name,m=s()(t.touched,d)&&s()(t.errors,d),p=t.isSubmitting||r,[x,f]=(0,o.useState)(JSON.stringify(l.value)),h=t.initialValues[d];return(0,j.Z)(()=>{f(JSON.stringify(h))},[h]),(0,n.jsx)(y.B,{...u,name:l.name,value:x,disabled:p,label:a,error:!!m||c,helperText:null!=m?m:i,editorProps:{language:"json",wrapperProps:{className:"scroll-mb-4 scroll-mt-8 w-full"},height:300},onBlurEditor:()=>{s()(t.touched,d)||t.setFieldTouched(d,!0)},onChangeValue:e=>{f(e);try{""===e?t.setFieldValue(d,e):t.setFieldValue(d,JSON.parse(e))}catch(e){t.setFieldValue(d,Error("Invalid JSON"))}}})}let FormikJsonField=e=>{let{useFastField:l,...t}=e;return l?(0,n.jsx)(a.Rt,{...t,component:JsonField,validate:validateJson}):(0,n.jsx)(a.gN,{...t,component:JsonField,validate:validateJson})};var b=t(506782),S=t(289763),N=t(685862),w=t(384719),F=t(645181),k=t(941314);function FormArray(e){let{name:l,label:t,helperText:r,error:i,required:s,arrayHelpers:o,className:c,iconProps:u,initialValue:d,tooltipContentClassName:p,startOpen:x,labelDescription:h,disabled:v,addNewButtonLabel:g,children:j,itemPropertyLabel:y,labelDescriptionAsSubtitle:C=!1,hideAddNewButton:T=!1,actions:P}=e,{isSubmitting:I,values:M,errors:E}=(0,a.u6)(),O=m.get(M,l),J=I||(null==u?void 0:u.disabled)||v,A=m.isString(m.get(E,l))&&m.get(E,l);return(0,n.jsxs)("div",{className:(0,f.m)("w-full flex flex-col gap-2",c),children:[t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.A,{id:l,className:"focus:text-primary-400",required:s,error:i||!!A,tooltipContentClassName:p,labelDescription:C?null:h,children:t}),C?(0,n.jsx)(S.ZT.Subtitle4,{className:"text-neutral-500",children:h}):null]}):null,(null==O?void 0:O.length)?(0,n.jsx)("div",{className:"flex flex-col gap-1",children:O.map((e,l)=>(0,n.jsx)(N.U,{header:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)(w.J,{...u,rounded:!0,icon:["fas","trash"],onClick:()=>o.remove(l),disabled:J}),(0,n.jsx)(S.ZT.Subtitle3,{children:y&&e[y]?e[y]:"".concat(t," (").concat(l+1,")")})]}),startOpen:x,unmount:!1,children:(0,n.jsx)("div",{className:"flex flex-col gap-4 w-full",children:null==j?void 0:j(l,e)})},l))}):null,T?null:(0,n.jsx)(F.zx,{type:"button",className:"justify-center",variant:"secondary",disabled:J,onClick:()=>o.push(d),children:g||"Add new item"}),P||null,r?(0,n.jsx)(k.p,{error:i||!!A,children:r}):null,A?(0,n.jsx)(k.p,{error:!0,children:A}):null]})}let FormikArrayField=e=>(0,n.jsx)(a.F2,{name:e.name,render:l=>(0,n.jsx)(FormArray,{...e,arrayHelpers:l,itemPropertyLabel:e.itemPropertyLabel})});t(172868);var C=t(428575);function FormikButton(e){let{variant:l,children:t,disabled:r,...i}=e,{dirty:s,isSubmitting:o}=(0,a.u6)();return(0,n.jsx)(F.zx,{...i,variant:l,disabled:r||!s||o,children:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[t,o?(0,n.jsx)(C.$,{variant:l&&!["outline","transparent"].includes(l)?l:void 0,size:"xs"}):null]})})}var T=t(100133);function canFocusElement(e){return!!(e&&"focus"in e&&"function"==typeof e.focus)}function FormikScrollToFirstError(){let{errors:e,isSubmitting:l}=(0,a.u6)();return(0,T.Z)(()=>{l&&Object.keys(e).some(e=>
1{let l=document.body.querySelector('[name="'.concat(e,'"]'));if(l)return canFocusElement(l)?l.focus():null==l||l.scrollIntoView({behavior:"smooth"}),!0})},300,[e,l]),null}},707691:function(e,l,t){t.d(l,{U:function(){return useGetErrors},r:function(){return r.r1}});var n=t(885115),r=t(129132),a=t(747910),i=t.n(a),s=t(243553),o=t(625914);let useGetErrors=e=>{let{schema:l,configMeta:t,configType:a,project:c,startsWith:u,acpBenchmarkWallProject:d}=e;return(0,n.useCallback)(e=>{if(!l||!e||i().isEmpty(e)||!t||a===s.rO7.Project&&!c)return[{type:r.r1.Error,validatorName:"JS Check",text:"Missing required information to validate config"}];try{var n,m;let l=null!==(m=null!==(n=null==c?void 0:c.taskType)&&void 0!==n?n:null==t?void 0:t.taskType)&&void 0!==m?m:null,{validatorMessages:a}=(0,r.ww)(e,l,!!d);if(u.length)return a.filter(e=>!e.fieldName||u.some(l=>{var t;return null===(t=e.fieldName)||void 0===t?void 0:t.some(e=>e.startsWith(l))}));return a}catch(e){return o.Am.error("Error running custom JSON Schema validation function: ".concat(e)),[{type:r.r1.Error,validatorName:"JS Check",text:"Error running custom JSON Schema validation function: ".concat(e)}]}},[l,t,a,c,u])}},186793:function(e,l,t){t.d(l,{D1:function(){return getArrayInitialValue},Ly:function(){return getVisibleFields},UC:function(){return function getFieldsDefinitions(e){let{schema:l,parentName:t=""}=e,n=[];if("properties"in l){let e=l.properties;for(let l in e){let r=e[l];n.push(...getFieldsDefinitions({schema:r,parentName:[t,l].filter(e=>e).join(".")}))}}else"oneOf"in l||"anyOf"in l?console.warn("Not supported schema oneOf or anyOf",l):"allOf"in l?console.warn("Not supported schema allOf",l):"then"in l?console.warn("Not supported schema then",l):"else"in l?console.warn("Not supported schema else",l):n.push({schema:l,name:t});return n}},nb:function(){return getComponentType}});var n=t(11373),r=t(464221),a=t(191955);function getArrayInitialValue(e){return"type"in e?(0,r.TD)(e.type,"array")?[]:!(0,r.TD)(e.type,"boolean")&&((0,r.TD)(e.type,"string")?"":(0,r.TC)(e.type)?0:(0,r.TD)(e.type,"object")?{}:""):""}let getComponentType=e=>"type"in e?(0,r.TD)(e.type,"array")?a.r.Array:(0,r.TD)(e.type,"boolean")?a.r.Switch:(0,r.TD)(e.type,"string")?e.enum?a.r.SelectMenu:e.widget===n.v.WorkerTag?null:e.widget===n.v.Code?a.r.Json:a.r.TextField:(0,r.TC)(e.type)?a.r.NumberField:(0,r.TD)(e.type,"object")?e.oneOf||e.anyOf||e.allOf||e.then||e.else?null:e.properties&&Object.keys(e.properties).length?null:a.r.TextField:null:null;function getStartsWithIndex(e,l){return l.findIndex(l=>e===l||e.startsWith("".concat(l,"."))||e.startsWith("".concat(l,"[")))}function getVisibleFields(e,l){return e.reduce((e,t)=>{let{name:n}=t;return(null==l?void 0:l.length)?e=e.concat(l.reduce((l,r)=>{let{startsWith:a,Component:i}=r,s=getStartsWithIndex(n,a);if(-1!==s){let n=0;for(;n<e.length;){let{name:l}=e[n],t=getStartsWithIndex(l,a);if(s<t)break;n++}l.splice(n,0,{...t,Component:i})}return l},[])):e.push(t),e},[])}},602872:function(e,l,t){t.d(l,{ZN:function(){return p},aN:function(){return r},em:function(){return renderBenchmarkConfigWarnings},iT:function(){return x}});var n,r,a=t(667488),i=t(471522),s=t(947028),o=t(970057),c=t(645181),u=t(127213),d=t(801532),m=t(727599);(n=r||(r={})).WallSize="wall size",n.ServingRate="serving rate";let p=3,x=.05,renderBenchmarkConfigWarnings=e=>{let l=e.map(e=>"wall size"===e?p:x);return(0,a.jsxs)("div",{className:"space-y-2",children:[e.map((e,t)=>(0,a.jsxs)(u.Root,{color:"warning",role:"alert",className:"space-x-2 p-4 rounded-md",children:[(0,a.jsx)(u.Icon,{children:(0,a.jsx)(d.J,{icon:i.eHv,label:"info"})}),(0,a.jsxs)(u.Text,{children:["Setting a ",e," greater than ",l[t]," leads to high spend on benchmarks with diminishing returns. Please reduce your ",e,"."]})]},t)),e.length>0&&(0,a.jsxs)(u.Root,{color:"info",role:"info",className:"space-x-2 p-4 rounded-md",children:[(0,a.jsx)(u.Icon,{children:(0,a.jsx)(d.J,{icon:s.DBf,label:"info"})}),(0,a.jsxs)(u.Text,{children:["If you need an exception, please reach out in"," ",(0,a.jsx)(m.rU,{href:"https://scale.enterprise.slack.com/archives/C082XKP7MN3",target:"_blank",rel:"noopener noreferrer",children:"#bm-cost-config-changes"})," ","for approval."]})]})]})};l.ZP=e=>{let{open:l,fields:t,onClose:n}=e;return(0,a.jsx)(o.u,{title:"Warning",open:l,onClose:n,actions:(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(c.zx,{variant:"primary",onClick:n,children:"OK"})}),children:renderBenchmarkConfigWarnings(t)})}},604363:function(e,l,t){t.d(l,{A:function(){return QMPaySandboxPageImpl},Z:function(){return qm_QMPaySandboxPage}});var n=t(667488),r=t(885115),a=t(100133),i=t(482770),s=t(699890),o=t(663752),c=t(243553),u=t(998885),d=t(289763),m=t(428575),p=t(630081),x=t(899442),f=t(171106),h=t(645181),v=t(970057),g=t(205876),j=t(747910),y=t.n(j),b=t(191955),S=t(278619),N=t(450326),w=t(108384),F=t(979127),k=t(707691),C=t(481269);let T=(0,r.memo)(e=>{let{project:l,config:t,configMeta:a,setConfig:i,setConfigChanged:s}=e,{isLoading:o,data:u}=(0,C.IxA)(),d=(0,r.useMemo)(()=>{var e;return null!==(e=null==u?void 0:u.reduce((e,l)=>(e[l.path.split("properties.").join("")]=l,e),{}))&&void 0!==e?e:{}},[u]),m=(0,k.U)({schema:g.eI,configMeta:a,configType:c.rO7.Project,project:null!=l?l:null,startsWith:["payoutConfigs"]});return o?(0,n.jsx)(w.d,{}):t&&g.eI?(0,n.jsx)(S.J9,{enableReinitialize:!0,initialValues:t,validate:e=>m(e).reduce((e,l)=>{let{type:t,text:n,fieldName:r}=l;return t===k.r.Error&&(null==r||r.forEach(l=>{e[l]=n})),e},{}),onSubmit:e=>{i(e),s(!0)},children:(0,n.jsxs)(S.l0,{className:"flex flex-col space-y-2 gap-4",children:[(0,n.jsxs)("div",{className:"sticky z-10 overflow-y-auto pr-4 pb-4",style:{maxHeight:"70vh"},children:[(0,n.jsx)(N.vM,{}),(0,n.jsx)(F.c,{getErrors:m}),(0,n.jsx)(F.c,{messageType:k.r.Warn,getErrors:m}),(0,n.jsx)("div",{className:"flex-1 flex flex-col gap-5 justify-center",children:(0,n.jsx)(b.Q,{schema:g.eI,fields:[{startsWith:["payoutConfigs"]}],metadataByConfigPath:d})})]}),(0,n.jsx)(N.aS,{name:"forceUseStrataPayCalculation",label:"Force Use Strata Pay?",labelDescription:"Whether to force or not to use Strata Pay calculations, or just use the project configured behavior.",options:[{id:"",name:"Default"},{id:"true",name:"Force Use"},{id:"false",name:"Force Not Use"}]}
1),(0,n.jsx)(N.XY,{className:"sticky bottom-0 justify-center",type:"submit",size:"lg",children:"Save and preview"})]})}):(0,n.jsx)(n.Fragment,{children:'Error: The "config" or the "configJsonSchema" are missing!'})});var P=t(862949),I=t(203581),M=t.n(I),E=t(85866),O=t(625914),J=t(974113),A=t(990977),D=t(665583),W=t(280306),z=t(245987),L=t(541053);let V=["id","email"];async function fetchPaySandboxBacktest(e){let{projectId:l,...t}=e,{workerInfo:n}=await (0,o.ZP)(null,"corp-api/pay-sandbox/".concat(l,"/backtest/"),{method:"POST",body:t});return n}let QMPaySandboxPageImpl=e=>{var l;let{project:t,user:i}=e,{data:s,isLoading:j}=(0,C.PYZ)({projectId:t.id}),[b,S]=(0,r.useState)(function(){let e=new Date().getDay(),l=(e-2)%7,t=(0,A.default)((0,J.Z)(new Date,{days:l})),n=(0,A.default)((0,J.Z)(new Date,{days:l+7}));return[n,t]}()),[N,w]=(0,r.useState)(""),[F,k]=(0,r.useState)([]),[I,Z]=(0,r.useState)(!1),[R,U]=(0,r.useState)([]),[B,_]=(0,r.useState)([]),[Q,q]=(0,r.useState)({}),[$,H]=(0,r.useState)(!1),[Y,K]=(0,r.useState)(),{data:X,isLoading:G}=(0,D.w4)({userIds:[i.id]});(0,r.useEffect)(()=>{let e=Object.entries(Q).reduce((e,l)=>{var t,n;let[r,a]=l;return a&&(null===(t=R[parseInt(r)])||void 0===t?void 0:t.attemptInfo)&&e.push(null===(n=R[parseInt(r)])||void 0===n?void 0:n.attemptInfo),e},[]);e.length>0?_(y().flatten(e)):_([])},[Q,R]);let ee=(0,r.useMemo)(()=>null==t?void 0:t.taskType,[t]),el=(0,r.useMemo)(()=>({type:c.rO7.Project,id:t.id,taskType:ee}),[t.id,ee]),et=(0,P.D)(el,s,i),{data:en,isLoading:er}=(0,C.WWw)({configMeta:el,configAttributes:et}),ea=y().cloneDeep(null==en?void 0:en.config),[ei,es]=(0,r.useState)(null==en?void 0:en.config),{mutateAsync:eo,isLoading:ec}=(0,C.ndy)({configMeta:el,configAttributes:et,lastVersion:null==en?void 0:en.version,configJsonSchema:g.eI});(0,a.Z)(()=>{U(""!==N?new u.Z(F,V).search(N):F)},300,[N]);let eu=b[0].toString(),ed=b[1].toString(),{data:em,error:ep,isLoading:ex}=(0,L.useQuery)(["paySandboxBacktest",t.id,b,null==ei?void 0:ei.forceUseStrataPayCalculation,ei&&JSON.stringify(ei.payoutConfigs)],()=>ei&&fetchPaySandboxBacktest({projectId:t.id,startDate:eu,endDate:ed,payConfig:ei.payoutConfigs,forceUseStrataPayCalculation:ei.forceUseStrataPayCalculation?"true"===ei.forceUseStrataPayCalculation:void 0}),{onError:e=>{var l,t;(0,o.vj)(e,{handleHttp:!0});let n=null!==(t=null===(l=e.response)||void 0===l?void 0:l.message)&&void 0!==t?t:e.message;K(n)},retry:!1,refetchOnWindowFocus:!1});(0,r.useEffect)(()=>{if(!em)return;let e=em.map(e=>{let{workerEmail:l,workerId:t,workerPayout:r,timeSpent:a,attemptCount:i,workerSource:s,attemptInfo:o}=e;return{id:t,email:l,userInfo:(0,n.jsxs)("div",{className:"flex flex-col gap-1 items-start",children:[l?(0,n.jsx)(d.ZT.Subtitle4,{children:l}):null,t?(0,n.jsx)("p",{className:"text-[0.6rem] leading-3",children:t}):null]}),workerPayout:"$".concat(y().round((r||0)/1e4,2)),timeSpent:"".concat(y().round(a||0,2)),attemptCount:i,workerSource:s,attemptInfo:o}});k(e),U(e)},[em]),(0,r.useEffect)(()=>{ei||es(null==en?void 0:en.config)},[ei,en]);let ef=(0,r.useCallback)(()=>{es(null==en?void 0:en.config)},[null==en?void 0:en.config]),eh=(0,r.useCallback)(async()=>{var e;if(y().isEqual(ea,ei))return;let l=(0,E.x)(ea,{safe:!0}),t=(0,E.x)(ei,{safe:!0}),n=(null!==(e=M().diff(l,t))&&void 0!==e?e:[]).reduce((e,l)=>{var n,r,a;let i=null===(n=l.path)||void 0===n?void 0:n[0];return i&&(["N","E"].includes(l.kind)&&"rhs"in l?(null!==(a=null==l?void 0:null===(r=l.path)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>1?e[i]=null==t?void 0:t[i]:e[i]=l.rhs:["A"].includes(l.kind)&&(e[i]=null==t?void 0:t[i])),e},{});await eo({changes:n}),O.Am.success("Saved changes on config!")},[ea,ei,eo]);return(0,n.jsxs)("div",{className:"scale-tailwind scaleui scale-theme bg-neutral-50 py-8 px-6 grid grid-cols-4 w-full",children:[(0,n.jsx)("div",{className:"col-span-1 ",children:er||j?(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)(m.$,{variant:"primary",size:"md",className:"mb-2"}),(0,n.jsx)(d.ZT.Subtitle2,{children:"Loading configs..."})]}):(0,n.jsx)(T,{project:s,config:ei,configMeta:el,setConfig:es,setConfigChanged:H})}),(0,n.jsxs)("div",{className:"flex flex-col gap-4 col-span-3 pl-4 border-b-2 border-neutral-200",children:[(0,n.jsxs)("div",{className:"flex gap-4 items-center flex-wrap",children:[(0,n.jsx)(d.ZT.Subtitle1,{color:"text-neutral-900",className:"mr-auto",children:"Pay Sandbox"}),(0,n.jsx)(p.M,{value:b,onChange:S,placeholder:new Date().toString(),isRangePicker:!0})]}),ex?(0,n.jsxs)("div",{className:"h-[300px] w-full flex flex-col items-center justify-center border border-neutral-200 border-transparent roun
1ded-lg shadow bg-neutral-0 p-4 overflow-hidden",children:[(0,n.jsx)(m.$,{variant:"primary",size:"md",className:"mb-2"}),(0,n.jsx)(d.ZT.Subtitle2,{children:"Loading payout data..."})]}):ep?(0,n.jsx)("div",{className:"h-[300px] w-full border border-neutral-200 border-transparent rounded-lg shadow bg-neutral-0 p-4 overflow-hidden",children:(0,n.jsxs)(z.bZ,{severity:"error",className:"mt-4",children:["An error occurred while loading payout data: ",Y]})}):(0,n.jsx)(x.i,{data:R,className:"-highlight",defaultPageSize:10,tableActions:(0,n.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,n.jsx)("div",{children:(0,n.jsx)(f.n,{id:"search-text",className:"w-full",value:N,placeholder:"Search by Email or ID",trailingIcon:"trash",onTrailingIconClick:()=>w(""),onChange:e=>w(e.target.value)})}),(0,n.jsx)("div",{className:"flex gap-2 items-center",children:(0,n.jsx)(h.zx,{size:"lg",variant:"neutral",onClick:()=>Z(!0),children:"Show Attempts"})}),(0,n.jsx)("div",{className:"flex gap-2 items-center",children:(0,n.jsx)(h.zx,{size:"lg",variant:"neutral",disabled:!$,onClick:ef,children:"Reset Config"})}),!G&&(null==X?void 0:null===(l=X[0].accessRoles)||void 0===l?void 0:l.includes(W.UserIdentityROAccessRolesEnum.PayoutsOperator))&&(ec?(0,n.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,n.jsx)(m.$,{variant:"primary",size:"xs"}),(0,n.jsx)(d.ZT.Subtitle3,{children:"Saving config..."})]}):(0,n.jsx)("div",{className:"flex gap-2 items-center",children:(0,n.jsx)(h.zx,{size:"lg",variant:"neutral",disabled:!$,onClick:eh,children:"Update Project"})}))]}),rowSelectionState:Q,onRowSelectionStateChange:q,enableRowSelection:!0,columns:[{id:"userInfo",header:"Worker Info"},{id:"workerPayout",header:"Worker Payout"},{id:"timeSpent",header:"Total Time Spent (secs)"},{id:"attemptCount",header:"Number of Attempts"},{id:"workerSource",header:"Worker Source"}]}),(0,n.jsx)(v.u,{className:"scaleui scale-theme scale-tailwind [&_form]:overflow-visible",open:I,title:"Attempts",onClose:()=>{Z(!1)},children:(0,n.jsx)(x.i,{data:B,className:"-highlight",defaultPageSize:12,columns:[{id:"attemptId",header:"Task ID"},{id:"workerId",header:"Worker ID"},{id:"time",header:"Total Time Spent (secs)"},{id:"attemptType",header:"Task Type"},{id:"config",header:"Config Number"}]})})]})]})};var qm_QMPaySandboxPage=e=>{let{project:l,user:t}=e,r=s.NZ.PaySandbox;return(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[(0,n.jsx)("div",{children:(0,n.jsx)(i.Z,{project:l,activeSection:r})}),(0,n.jsx)(QMPaySandboxPageImpl,{project:l,user:t})]})}}}]);

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.