PageSourceSearch

https://preferredhotels.com/_next/static/chunks/1822-69a3c70586dcf568.js

js preferredhotels.com collected 2026-09-24 09:29:28 UTC 7,451 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1822],{32271:(e,a,t)=>{t.d(a,{w:()=>n});function n(e){let{resource:a,headers:t={"Content-Type":"application/json"}}=e,n="".concat("https://ptgapis.com","/admin/").concat(a,"/");return{fetchAll:async e=>{let o="".concat(n,"?");if(e)for(let a in e)void 0!==e[a]&&null!==e[a]&&(o+="".concat(a,"=").concat(encodeURIComponent(e[a]),"&"));let s=await fetch(o,{headers:t});if(!s.ok)throw Error("Failed to fetch ".concat(a));return s.json()},getById:async e=>{let o="".concat(n).concat(e,"?"),s=await fetch(o,{headers:t});if(!s.ok)throw Error("".concat(a," not found"));return s.json()},create:async e=>{var a;let o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(e)}),s=await o.json();if(!o.ok)throw Error(null!=(a=null==s?void 0:s.error)?a:"Create failed");return s},update:async(e,a)=>{var o;let s="".concat(n).concat(e),i=await fetch(s,{method:"PUT",headers:{"Content-Type":"application/json",...t},body:JSON.str
1ingify(a)}),c=await i.json();if(!i.ok)throw Error(null!=(o=null==c?void 0:c.error)?o:"Update failed");return c},delete:async e=>{let a="".concat(n).concat(e),o=await fetch(a,{method:"DELETE",headers:t}),s=await o.json();if(!o.ok)throw Error("Delete failed");return s}}}},38382:(e,a,t)=>{t.d(a,{A:()=>g,w:()=>m});var n=t(37876),o=t(14232),s=t(20512),i=t(77526),c=t(45051),r=t(94989),l=t(21645);let d=e=>{let{onLogin:a}=e;return(0,n.jsx)("div",{className:"FAFLogin__masthead",children:(0,n.jsxs)("div",{className:"FAFLogin__login",children:[(0,n.jsx)("h1",{className:"FAFLogin__header",children:"PTG Family Program"}),(0,n.jsx)("div",{className:"FAFLogin__login-text",children:"You must be signed into a PTG employee account to access this page."}),(0,n.jsxs)("button",{className:"FAFLogin__btn",onClick:a,children:[(0,n.jsx)("img",{className:"FAFLogin__btn-icon",src:"/assets/images/icons/log-in.svg",alt:"log in"}),(0,n.jsx)("span",{children:"sign in"})]})]})})},u=e=>{let{onLogin:a}=e;return(0,n.jsx)("div",{className:"AdminPortalLogin__masthead",children:(0,n.jsxs)("div",{className:"AdminPortalLogin__login",children:[(0,n.jsx)("h1",{className:"AdminPortalLogin__header",children:"PTG Admin Portal"}),(0,n.jsx)("div",{className:"AdminPortalLogin__login-text",children:"You must be signed into a PTG employee account to access this page."}),(0,n.jsxs)("button",{className:"AdminPortalLogin__btn",onClick:a,children:[(0,n.jsx)("img",{className:"AdminPortalLogin__btn-icon",src:"/assets/images/icons/log-in.svg",alt:"log in"}),(0,n.jsx)("span",{children:"sign in"})]})]})})},h=(0,o.createContext)({employeeObj:void 0,friendsAndFamily:{},azureAccessToken:""}),m=()=>(0,o.useContext)(h),g=e=>{var a,t;let{children:m,loginPageType:g="faf"}=e,[p,v]=(0,o.useState)(""),[f,j]=(0,o.useState)(""),{instance:_,inProgress:x}=(0,c.dk)(),y=_.getActiveAccount(),A=(0,l.rd)(),[k,w]=(0,o.useState)("");(0,o.useEffect)(()=>{y?(v(y.username),j((null==y?void 0:y.name)||"")):v("")},[y]),(0,o.useEffect)(()=>{if((null==k?void 0:k.length)<=0&&x===s.T$.None){let e={scopes:["user.read"],account:y};_.acquireTokenSilent(e).then(e=>{w(e.accessToken)}).catch(a=>{a instanceof i.CB&&_.acquireTokenPopup(e).then(function(e){w(e.accessToken)}).catch(function(e){console.log(e)}),console.log(a)})}},[_,y,x]);let C=e=>{"popup"===e&&_.loginPopup(r.$8).catch(e=>{console.log(e)})},N="admin"===g?(0,n.jsx)(u,{onLogin:()=>C("popup")}):(0,n.jsx)(d,{onLogin:()=>C("popup")});return(0,n.jsx)(h.Provider,{value:{employeeObj:null!=y?y:void 0,friendsAndFamily:y&&(null==A||null==(a=A.pathname)?void 0:a.startsWith("/ptgfamily"))?y:{},azureAccessToken:k||""},children:(0,n.jsx)("div",{className:"azure-sso-gate",children:p?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"azure-sso-gate__top",children:[(0,n.jsxs)("button",{onClick:()=>void _.logoutPopup({postLogoutRedirectUri:"/",mainWindowRedirectUri:"/"}),className:"azure-sso-gate__btn",children:[(0,n.jsx)("img",{className:"azure-sso-gate__btn-icon",src:"/assets/images/icons/log-out.svg",alt:"log out"}),(0,n.jsx)("span",{children:"sign out"})]}),(0,n.jsxs)("div",{className:"azure-sso-gate__user-container",children:[(0,n.jsx)("div",{className:"azure-sso-gate__letter gbmask",children:null==(t=f.slice(0,1))?void 0:t.toUpperCase()}),(0,n.jsxs)("div",{className:"azure-sso-gate__details",children:[(0,n.jsx)("div",{className:"azure-sso-gate__name gbmask",children:f}),(0,n.jsx)("div",{className:"azure-sso-gate__email gbmask",children:p})]})]})]}),(0,n.jsx)("div",{children:m})]}):N})})}},41822:(e,a,t)=>{t.d(a,{A:()=>d});var n=t(37876);t(14232);var o=t(45051),s=t(47243),i=t(89244),c=t(38382),r=t(59387);let l=new s.v({auth:{clientId:"6cafafaf-1587-44ce-a7f8-e62c063fa20c",authority:"https://login.microsoftonline.com/6752f108-3392-40ee-a729-1f58085694d7",redirectUri:"/",postLogoutRedirectUri:"/"}});l.addEventCallback(e=>{try{var a;e.eventType===i.B.LOGIN_SUCCESS&&(null==e||null==(a=e.payload)?void 0:a.account)&&l.setActiveAccount(e.payload.account)}catch(e){console.error("Something wrong in msalInstance.addEventCallback - ",e)}});let d=e=>{let{children:a}=e;return(0,n.jsx)(o.r7,{instance:l,children:(0,n.jsx)(c.A,{loginPageType:"admin",children:(0,n.jsx)(r.T,{children:(0,n.jsx)("main",{className:"container",children:a})})})})}},59387:(e,a,t)=>{t.d(a,{T:()=>l,bn:()=>d});var n=t(37876),o=t(14232),s=t(32271),i=t(92097),c=t(38382);let r=(0,o.createContext)({access:{},marketingNightsCrud:void 0,accessControlCrud:void 0,isLoading:!1,refreshAccess:void 0}),l=e=>{let{children:a}=e,{azureAccessToken:t,employeeObj:l}=(0,c.w)(),[d,u]=(0,o.useState)(!1),[h,m]=(0,o.useState)({}),[g,p]=(0,o.useState)(),[v,f]=(0,o.useState)(),[j,_]=(0,o.useState)(),[x,y]=(0,o.useState)(),[A,k]=(0,o.useState)(),w=async()=>{var e;u(!0);let a=await (null==v?void 0:v.fetchAll({email:(null==l||null==(e=l.username)?void 0:e.toLowerCase())||""}));if(a&&Array.isArray(a)&&a.length>0){let e={};a.forEach(a=>{a.module&&a.accessLevel&&(e[a.module]=a.accessLevel)}),m(e)}else m({});u(!1)};return(0,o.useEffect)(()=>
1{if(t&&t.length>0)p((0,i.uL)(t)),f((0,s.w)({resource:"access-control/v1",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})),_((0,s.w)({resource:"activation-codes/v1",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})),y((0,s.w)({resource:"marketplace-manager/products/v1",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})),k((0,s.w)({resource:"marketplace-manager/hotels/v1",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}));else p(void 0),f(void 0),_(void 0),y(void 0),k(void 0),m({})},[t]),(0,o.useEffect)(()=>{v&&(null==l?void 0:l.username)?w():m({})},[v,l]),(0,n.jsx)(r.Provider,{value:{access:h,marketingNightsCrud:g,accessControlCrud:v,activationCodesCrud:j,marketplaceProductCrud:x,marketplaceHotelCrud:A,isLoading:d,refreshAccess:w},children:a})},d=()=>(0,o.useContext)(r)},92097:(e,a,t)=>{t.d(a,{bp:()=>o,uL:()=>s});var n=t(32271);let o={"key-access":"KA","friends-and-family":"FAF"},s=e=>(0,n.w)({resource:"marketing-nights/v1",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}})},94989:(e,a,t)=>{t.d(a,{$8:()=>o,wO:()=>n});let n={auth:{clientId:"6cafafaf-1587-44ce-a7f8-e62c063fa20c",authority:"https://login.microsoftonline.com/6752f108-3392-40ee-a729-1f58085694d7",redirectUri:"/",postLogoutRedirectUri:"/"}},o={scopes:["User.Read"]}}}]);

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.