PageSourceSearch

https://pro.icreate.fashion/static/js/8650.bfd158da.chunk.js

js icreate.fashion collected 2026-10-08 23:07:29 UTC 11,744 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpro_ui=self.webpackChunkpro_ui||[]).push([[8650],{67473(e,t,n){n.d(t,{CD:()=>l,nq:()=>i,r_:()=>r});var a=n(80045),s=n(80211);const o=["parentTeam"];function r(e){return{id:0,name:"",poms:[],tabs:[],locked:!1,active:!0,isPublic:!1,parentTeamId:e?e.id:0,parentTeamDisplayName:"",parentTeam:e,clientId:null,clientName:null,createdAt:new Date,updatedAt:new Date,createdBy:"",updatedBy:"",canEdit:!0}}function i(e){return{keyId:(0,s.R)(),pomName:"",sequence:e}}function l(e,t,n){const{parentTeam:s}=e,r=(0,a.A)(e,o),i=r.poms.map(e=>({pomName:e.pomName,sequence:e.sequence}));return{id:r.id,name:r.name,poms:JSON.stringify(i),locked:!1,active:t,isPublic:!1,parentTeamId:null===s||void 0===s?void 0:s.id,createdAt:r.createdAt||new Date,updatedAt:new Date,createdBy:r.createdBy||n,updatedBy:n}}},25394(e,t,n){n.d(t,{Zg:()=>m,eT:()=>u,wm:()=>d});var a=n(89379),s=n(80045),o=n(85916),r=n(26910),i=n(80211),l=n(29939);const c=["poms"];async function d(e,t,n,a,s,i){let l=o.J.pomTemplates.pagedWithDetailsByUser(e,n,a,s);return t&&(l=o.J.pomTemplates.pagedWithDetailsByTeam(e,t,n,a,s)),r.A.get(l).then(e=>p(e.data,i))}async function m(e){const t=o.J.pomTemplates.create();return r.A.post(t,e).then(e=>e.data.object)}async function u(e){const t=o.J.pomTemplates.update();return r.A.put(t,e).then(e=>e.data.object)}const p=(e,t)=>{try{const n=(e.object||[]).map(e=>{const n=t.isDataAdmin||(0,l.u9)(e.parentTeamId,t,"LIBRARY"),{poms:o}=e,r=(0,s.A)(e,c),d=JSON.parse(o);return(0,a.A)({poms:d.map(e=>(0,a.A)((0,a.A)({},e),{},{keyId:(0,i.R)()})),tabs:[],parentTeam:{id:e.parentTeamId,displayName:e.parentTeamDisplayName,clientId:e.clientId},canEdit:n},r)});return(0,a.A)((0,a.A)({},e),{},{object:n})}catch(n){return console.error("getFormattedDetailData error ".concat(n," ")),(0,a.A)((0,a.A)({},e),{},{object:[]})}}},94836(e,t,n){n.d(t,{f:()=>i});var a=n(41836),s=n(25394),o=n(82632);const r=["pomTemplate"],i=(e,t,n,i)=>{const{getCurrentUserId:l,user:c}=(0,o.Z)();return(0,a.I)({queryKey:r,queryFn:()=>(0,s.wm)(l(),e,t,n,i,c),staleTime:0})}},74853(e,t,n){n.d(t,{a:()=>r});var a=n(51778),s=n(25394);const o=["pomTemplate"],r=()=>(0,a.n)({mutationKey:o,mutationFn:s.eT})},48650(e,t,n){n.r(t),n.d(t,{default:()=>S});var a=n(89379),s=n(9950),o=n(85923),r=n(67473),i=n(94836),l=n(74853),c=n(82632),d=n(19818),m=n(47468),u=n(91180),p=n(22782),h=n(51810),A=n(27230),x=n(10371),g=n(68605),j=n(51496),y=n(83563),v=n(36080),f=n(25333),b=n(27987),T=n(44414);var w=n(34276);const C=()=>{const{getNonDataAdminCurrentTeam:e,getUserFullName:t}=(0,c.Z)(),n=e(),[C,S]=(0,s.useState)({teamId:(null===n||void 0===n?void 0:n.id)||null,page:0,size:50,searchString:""}),[k,I]=(0,s.useState)(null),[N,D]=(0,s.useState)(null),{mutate:P}=(0,l.a)(),{data:R,isFetching:E,isFetched:q,refetch:F}=(0,i.f)(C.teamId,C.page,C.size,C.searchString),B=(null===R||void 0===R?void 0:R.count)||0,z=(null===R||void 0===R?void 0:R.object)||[];(0,s.useEffect)(()=>{E||F()},[C]);const O=e=>{const t=(0,a.A)((0,a.A)({},C),e);("size"in e||"searchString"in e||"teamId"in e)&&(t.page=0),S(t)},V=[{label:"All",value:"all",count:z.length,color:"default"}],W=(0,T.jsx)(m.A,{currentTeam:n,searchString:C.searchString,onSearchStringChange:e=>O({searchString:e}),onTeamChange:e=>{O({teamId:e?e.id:null}),D(e)}});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(p.A,{loading:!q,data:z,defaultFilters:{tab:"all"},orderBy:"name",sort:"asc",rowsPerPageOptions:[10,25,50],page:C.page,pageSize:C.size,totalElements:B,setPage:e=>O({page:e}),setPageSize:e=>O({size:e}),fullWidth:!0,heading:"Point of Measure Templates",toolbar:W,links:[{name:"Home",href:u.m6.general.dashboard.home},{name:"Point of Measure Templates",href:u.m6.general.library.pomTemplates.list}],tableHead:[{id:"name",label:"Name",width:250,align:"left"},{id:"pomQuantity",label:"Pom Quantity",width:250,align:"center"},{id:"parentTeamDisplayName",label:"Team",width:250,align:"left"},{id:"actions",label:"",width:250,align:"left"}],showSelectedDelete:!0,pageHeadAction:(0,T.jsx)(w.A,{variant:"outlined",color:"primary",endIcon:(0,T.jsx)(d.A,{icon:"eva:plus-fill"}),onClick:()=>I((0,r.r_)(N)),children:"Create Pom Template"}),tabs:V,TableRow:e=>{let{row:t,selected:n,onSelectRow:a,onDeleteRow:s,onEditRow:o,onViewRow:r}=e;return function(e){let{row:t,selected:n,onSelectRow:a,onDeleteRow:s,onEditRow:o}=e;const{id:r,name:i,parentTeamDisplayName:l,poms:c,canEdit:m}=t,u=(0,A.f)();return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(x.A,{hover:!0,selected:n,children:[(0,T.jsx)(g.A,{padding:"checkbox",children:(0,T.jsx)(j.A,{checked:n,onClick:()=>a(r)})}
1),(0,T.jsx)(g.A,{children:(0,T.jsx)(y.A,{sx:{height:"100%"},disableTypography:!0,primary:(0,T.jsx)(v.A,{noWrap:!0,color:"inherit",variant:"subtitle2",onClick:()=>o(r),sx:{cursor:"pointer"},children:i})})}),(0,T.jsx)(g.A,{align:"center",children:c.length}),(0,T.jsx)(g.A,{children:l}),(0,T.jsx)(g.A,{align:"right",children:(0,T.jsx)(f.A,{color:u.open?"primary":"default",onClick:u.onOpen,children:(0,T.jsx)(d.A,{icon:"eva:more-vertical-fill"})})})]}),(0,T.jsxs)(A.A,{open:u.open,onClose:u.onClose,arrow:"right-top",sx:{width:140},children:[(0,T.jsxs)(b.A,{onClick:()=>{o(r),u.onClose()},children:[m?(0,T.jsx)(d.A,{icon:"solar:pen-bold"}):(0,T.jsx)(d.A,{icon:"eva:eye-outline"}),m?"Edit":"View"]}),m?(0,T.jsxs)(b.A,{onClick:()=>{s(r),u.onClose()},sx:{color:"error.main"},children:[(0,T.jsx)(d.A,{icon:"solar:trash-bin-trash-bold"}),"Delete"]}):null]})]})}({row:t,selected:n,onSelectRow:a,onDeleteRow:s,onEditRow:o,onViewRow:r})},onEditCustom:e=>(e=>{const t=z.find(t=>t.id===e);t&&I(t)})(e),onDeleteItems:e=>(async e=>{const n=z.filter(t=>e.includes(t.id));try{await Promise.all(n.map(e=>{const n=(0,r.CD)(e,!1,t());P(n)})),o.oR.success("Successfully deleted!"),O({page:0})}catch(a){o.oR.error(a.message)}})(e)}),(0,T.jsx)(h.A,{pomTemplate:k,isOpen:!!k,onClose:e=>{I(null),e&&F()}})]})},S=()=>(0,T.jsx)(C,{})},51810(e,t,n){n.d(t,{A:()=>H});var a=n(89379),s=n(9950),o=n(19818),r=n(95349),i=n(38513),l=n(45014),c=n(85923),d=n(67473),m=n(51778),u=n(25394);const p=["pomTemplate"];var h=n(74853),A=n(82632),x=n(9449),g=n(47509),j=n(29714),y=n(26473),v=n(17765);const f=j.Ik({name:j.Yj().required("Name is required").max(255),poms:j.YO().min(1,"At least one Pom is required"),parentTeam:v.A.required("Team is required")}),b=(0,y.t)(f);var T=n(82142),w=n(44184),C=n(20760),S=n(12257),k=n(16491),I=n(87233),N=n(34276),D=n(83280),P=n(8145),R=n(53065),E=n(25333),q=n(44414);const F=e=>{var t;let{canEdit:n}=e;const{clearErrors:a,formState:s,setValue:r,watch:i}=(0,x.xW)(),l=i("poms"),c=(0,w.p)((e,t)=>{const n=structuredClone(l),s=n.find(t=>t.keyId===e);s&&(s.pomName=t),a("missingPomName"),r("poms",n)},500);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(S.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsxs)(k.A,{children:[(0,q.jsx)(I.A,{variant:"subtitle2",children:"Points of Measure"}),l.length>0?(0,q.jsx)(I.A,{variant:"body2",children:"".concat(l.length," Pom").concat(l.length>1?"'s":""," Added")}):(0,q.jsx)(I.A,{variant:"body2",children:"At least one point of measure is needed"}),null!==(t=s.errors)&&void 0!==t&&t.poms?(0,q.jsx)(I.A,{color:"error",variant:"body2",children:"Please add at least one point of measure."}):null]}),n?(0,q.jsx)(N.A,{variant:"outlined",color:"primary",endIcon:(0,q.jsx)(o.A,{icon:"solar:add-circle-outline"}),onClick:()=>{const e=structuredClone(l);e.push((0,d.nq)(e.length)),r("poms",e),a("poms")},sx:{flexShrink:0,alignSelf:"start"},children:"Add Pom"}):null]}),l.sort((e,t)=>e.sequence-t.sequence).map((e,t)=>(0,q.jsxs)(D.Ay,{container:!0,direction:"row",spacing:1,children:[(0,q.jsx)(D.Ay,{item:!0,xs:1.5,children:n?(0,q.jsx)(T.A,{index:t,itemsLength:l.length,itemName:"",iconStyle:"arrow",onMove:t=>((e,t)=>{const n=structuredClone(l);for(const a of n)if(a.keyId===e){let e=a.sequence,s=e+1;"up"===t&&(s=e-1);const o=n[s];a.sequence=s,o.sequence=e,r("poms",n)}})(e.keyId,t)}):null}),(0,q.jsx)(D.Ay,{item:!0,xs:8.5,children:(0,q.jsx)(P.A,{label:"Pom Name",required:!0,fullWidth:!0,defaultValue:e.pomName,disabled:!n,onChange:t=>{c(e.keyId,t.target.value)}})}),(0,q.jsx)(D.Ay,{item:!0,xs:2,children:n?(0,q.jsx)(R.A,{title:"Delete this Pom",placement:"top",children:(0,q.jsx)(E.A,{onClick:()=>{return t=e.keyId,void r("poms",l.filter(e=>e.keyId!==t));var t},children:(0,q.jsx)(C.A,{})})}):null})]},e.keyId))]})};var B=n(91609),z=n(80134);const O=e=>{var t,n,o;let{pomTemplate:r,submitting:i,resetForm:l,onClose:c,onSubmit:d}=e;const m=(0,x.mN)({resolver:b,defaultValues:(0,a.A)({},r)}),{handleSubmit:u,register:p,getValues:h,reset:A,setError:j,formState:{errors:y}}=m;return(0,s.useEffect)(()=>{A()},[l]),(0,q.jsx)(x.Op,(0,a.A)((0,a.A)({},m),{}
1,{children:(0,q.jsxs)(S.A,{sx:{p:3},spacing:3,children:[(0,q.jsx)(S.A,{spacing:3,sx:{mb:3},children:(0,q.jsxs)(D.Ay,{container:!0,direction:"row",spacing:2,children:[(0,q.jsx)(D.Ay,{item:!0,xs:12,md:6,children:(0,q.jsx)(P.A,(0,a.A)((0,a.A)({},p("name")),{},{required:!0,label:"Name",placeholder:"Template name",disabled:!(null!==r&&void 0!==r&&r.canEdit),fullWidth:!0,error:!!y.name,helperText:null!==y&&void 0!==y&&null!==(t=y.name)&&void 0!==t&&t.message?y.name.message.toString():null}))}),(0,q.jsx)(D.Ay,{item:!0,xs:12,md:6,children:null!==r&&void 0!==r&&r.canEdit?(0,q.jsx)(g.A,{teamItemAccessType:"LIBRARY"}):(0,q.jsxs)(S.A,{sx:{pl:1,pb:1},children:[(0,q.jsx)(I.A,{variant:"caption",children:"Team"}),(0,q.jsx)(I.A,{children:null!==(n=null===r||void 0===r||null===(o=r.parentTeam)||void 0===o?void 0:o.displayName)&&void 0!==n?n:""})]})})]})}),(0,q.jsx)(F,{canEdit:null===r||void 0===r?void 0:r.canEdit}),(0,q.jsxs)(S.A,{direction:"row",spacing:2,justifyContent:"flex-end",marginTop:4,children:[y.missingPomName?(0,q.jsx)(z.A,{severity:"error",children:"".concat(y.missingPomName.message)}):null,(0,q.jsx)(N.A,{type:"reset",variant:"outlined",disabled:i,size:"large",onClick:c,children:null!==r&&void 0!==r&&r.canEdit?"Cancel":"Close"}),null!==r&&void 0!==r&&r.canEdit?(0,q.jsx)(B.A,{type:"submit",variant:"contained",disabled:i,loading:i,size:"large",onClick:e=>{u(()=>(()=>{if(h("poms").some(e=>!e.pomName))return j("missingPomName",{type:"required",message:"Please add a name for all points of measure."});d(h())})())(e)},children:"Save"}):null]})]})}))},V=e=>{let{pomTemplate:t,resetForm:n,onClose:a}=e;const{user:o}=(0,A.Z)(),r=o,[i,l]=(0,s.useState)(!1),{mutate:x}=(0,m.n)({mutationKey:p,mutationFn:u.Zg}),{mutate:g}=(0,h.a)();return(0,q.jsx)(O,{pomTemplate:t,submitting:i,resetForm:n,onClose:a,onSubmit:e=>{l(!0);const t=(0,d.CD)(e,!0,r.fullName);t.id?g(t,{onSuccess:()=>{c.oR.success("Template updated!"),a(!0)},onError:e=>{c.oR.error(e.message||"".concat(e)),l(!1)}}):x(t,{onSuccess:()=>{c.oR.success("Template created!"),a(!0)},onError:e=>{c.oR.error(e.message||"".concat(e)),l(!1)}})}})};var W=n(14857),J=n(18001),Y=n(27777),Z=n(74745);function H(e){let{pomTemplate:t,isOpen:n,onClose:c}=e;const d=(0,W.A)(),m=(0,i.A)("up","lg"),[u,p]=(0,s.useState)(0),h=e=>{p(e=>e+1),c(!!e)};return(0,q.jsx)(J.Ay,{anchor:"right",open:n,hideBackdrop:!0,sx:{["& .".concat(Y.A.paper)]:(0,a.A)((0,a.A)({},(0,l.FY)({theme:d,bgcolor:d.palette.background.default})),{},{width:m?"50%":"100vw"})},children:(0,q.jsxs)(S.A,{height:"100vh",overflow:"hidden",children:[(0,q.jsxs)(S.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{py:2,pr:1,pl:2.5,height:64},children:[(0,q.jsx)(I.A,{variant:"h6",sx:{flexGrow:1},children:"".concat(null!==t&&void 0!==t&&t.id?"Edit":"Create"," Pom Template")}),(0,q.jsx)(E.A,{onClick:()=>h(),children:(0,q.jsx)(o.A,{icon:"mingcute:close-line"})})]}),(0,q.jsx)(Z.A,{sx:{borderStyle:"dashed"}}),(0,q.jsx)(r.A,{sx:{flexGrow:1,maxHeight:"100vh - 100px",pb:10},children:(0,q.jsx)(V,{pomTemplate:t,resetForm:u,onClose:h})})]})})}}}]);

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.