1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5208],{60598:(e,n,r)=>{"use strict";r.d(n,{T:()=>d});var t=r(67914),a=r(44948),i=r(74353),o=r(23369),l=r(60513);let c=l.g1(l.Yj(),l.YO(l.Yj()));function d(){return(0,t.I)({queryKey:[o.Bz.BrandKey],queryFn:async()=>{let e=(await a.A.get("/api/brands")).data;try{var n;let r=await a.A.get("/api/brands/aliases"),t=c.safeParse(r.data);if(!t.success)return(0,i.C)(Error("Invalid data in /api/brands/aliases response",{cause:t.error}),{component:"useBrandIdentifiers"}),e;return n=t.data,e.flatMap(e=>{var r;let t=null!=(r=n[e.chainCode])?r:[];return[e,...t.map(n=>({...e,brandName:n}))]})}catch(n){return(0,i.C)(n instanceof Error?n:Error(String(n)),{component:"useBrandIdentifiers"}),e}}})}},71628:(e,n,r)=>{"use strict";r.d(n,{g:()=>o});let t=new Set(["a","an","and","by","of","the","hotel","hotels","resort","resorts"]),a=/[^a-z0-9]+/g;function i(e){return e.toLowerCase().replace(a," ").split(/\s+/).filter(e=>e.length>0&&!t.has(e))}function o(e,n){let r,t;if(!e||!n||0===n.length)return;let a=i(e);if(0===a.length)return;let o=new Set(a);for(let e of n){let n=i(e.brandName);if(0===n.length)continue;let a=new Set(n),l=0;for(let e of o)a.has(e)&&l++;if(0===l)continue;let c=o.size+a.size-l,d=l/c;(!r||d>r.score)&&(r={brand:e,score:d}),l===o.size&&(!t||d>t.score)&&(t={brand:e,score:d})}return r&&r.score>=.5?r.brand:t?t.brand:void 0}},82362:(e,n,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/pe-config",function(){return r(84868)}])},84868:(e,n,r)=>{"use strict";r.r(n),r.d(n,{default:()=>C});
1var t=r(18153),a=r(11808),i=r(88288),o=r(60598),l=r(14232),c=r(95043),d=r(67914),u=r(44948),s=r(23369),f=r(71234);function h(){var e;let[n,r]=(0,l.useState)(null),h=(0,i.KK)(n),g=(0,o.T)(),p=null!=(e=g.data)?e:[],b=(0,d.I)({queryKey:[s.Bz.AdminPEConfig,h],queryFn:()=>u.A.get("/api/chain/".concat(h,"/partnership-enrollment-configuration?includeRecipientLists=true")).then(e=>e.data),enabled:!!h}),{control:m,errors:C,isDirty:w,isValid:Y,onSubmit:_,isSaving:v,reset:y}=(0,c.fw)(b.data,h);return(0,t.FD)(a.azJ,{display:"flex",flexDirection:"column",gap:24,children:[(0,t.Y)(a.azJ,{style:{maxWidth:480},children:(0,t.Y)(a.MJN,{label:"Chain Code",children:(0,t.FD)(a.a32,{value:n,onValueChange:e=>{let n=function(e,n){if(!n)return null;let r=(0,i.ao)(e,n)||e.find(e=>"".concat(e.chainCode," â ").concat(e.brandName)===n);return r?(0,i._n)(r):n}(p,e),t=(0,i.KK)(n);r(n),t!==h&&y(c.gE)},children:[(0,t.Y)(a.mN2,{placeholder:"Search by chain code or brandâ¦",isDisabled:g.isLoading}),(0,t.Y)(a.tZr,{children:(0,t.Y)(a._pX,{children:p.map(e=>(0,t.FD)(a.xO9,{value:(0,i._n)(e),children:[e.chainCode," â ",e.brandName]},(0,i._n)(e)))})})]})})}),b.isLoading&&(0,t.Y)(a.o5u,{variant:"body/md",color:"foregroundSecondary",children:"Loading configurationâ¦"}),b.isError&&(0,t.Y)(a.o5u,{variant:"body/md",color:"sentimentCriticalDefault",children:"Failed to load configuration for this chain code."}),b.data&&(0,t.FD)(t.FK,{children:[(0,t.Y)(f.B,{control:m,errors:C,showRecipientLists:!0}),(0,t.Y)(a.azJ,{children:(0,t.Y)(a.$nd,{onClick:_,isLoading:v,isDisabled:v||!w||!Y,children:"Save Changes"})})]})]})}var g=r(77292),p=r(51635),b=r(32419),m=r(89099);function C(){let e=(0,m.useRouter)();return(0,t.Y)(b.L,{allowedRoles:Object.values(g.InternalRole),children:(0,t.Y)(p.A,{title:"Enrollment Setup",action:(0,t.Y)(a.$nd,{onClick:()=>void e.push("/admin/pe-config/create"),children:"Add New Configuration"}),children:(0,t.Y)(h,{})})})}},88288:(e,n,r)=>{"use strict";r.d(n,{KK:()=>o,MW:()=>a,Qg:()=>d,_n:()=>i,ao:()=>l,wb:()=>c});var t=r(71628);function a(e,n){return"".concat(e).concat("!").concat(n)}function i(e){let{chainCode:n,brandName:r}=e;return a(n,r)}function o(e){if(!e)return null;let[n]=e.split("!");return n||null}function l(e,n){if(e&&n)return e.find(e=>i(e)===n)}function c(e,n){if(e&&n)return e.find(e=>e.chainCode===n)}function d(e,n){return(0,t.g)(n,e)}}},e=>{e.O(0,[9639,3796,4587,9764,4782,3729,965,9108,2640,6897,6947,3507,576,6875,1848,636,6593,8792],()=>e(e.s=82362)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.