@digital-realty/ui-launchpad 14.0.0 → 14.0.1-IXUAT-11107.550231

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sw.js CHANGED
@@ -1,2 +1,2 @@
1
- if(!self.define){let e,i={};const n=(n,t)=>(n=new URL(n+".js",t).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(t,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(i[r])return;let s={};const c=e=>n(e,r),l={module:{uri:r},exports:s,require:c};i[r]=Promise.all(t.map(e=>l[e]||c(e))).then(e=>(o(...e),s))}}define(["./workbox-b865b753"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"2c69eb2da85c9b2ee93b0c537cf41d78"},{url:"ui-launchpad.js",revision:"463984434d2c0fce5045b5c68da1070f"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")});
1
+ if(!self.define){let e,i={};const n=(n,t)=>(n=new URL(n+".js",t).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(t,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(i[r])return;let s={};const c=e=>n(e,r),l={module:{uri:r},exports:s,require:c};i[r]=Promise.all(t.map(e=>l[e]||c(e))).then(e=>(o(...e),s))}}define(["./workbox-b865b753"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"index.html",revision:"2c69eb2da85c9b2ee93b0c537cf41d78"},{url:"ui-launchpad.js",revision:"31879d341f8a5836c6b799c738a9af50"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")});
2
2
  //# sourceMappingURL=sw.js.map
package/dist/sw.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/8j/3c4g2vh16vgc8j40cj25qfqh0000gn/T/1b132bd0c0b69763faa44c0bf27e5776/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-strategies@6.6.0/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-core@6.6.0/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"2c69eb2da85c9b2ee93b0c537cf41d78\"\n },\n {\n \"url\": \"ui-launchpad.js\",\n \"revision\": \"463984434d2c0fce5045b5c68da1070f\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"inBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
1
+ {"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/vb/m6r1sg994rbgzbhtsm34bphh0000gn/T/a0a7dbd4be72a63103785bfdcf49bab9/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-strategies@6.6.0/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-core@6.6.0/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-routing@6.6.0/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/runner/work/1/s/ui-launchpad/node_modules/.pnpm/workbox-precaching@6.6.0/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"2c69eb2da85c9b2ee93b0c537cf41d78\"\n },\n {\n \"url\": \"ui-launchpad.js\",\n \"revision\": \"31879d341f8a5836c6b799c738a9af50\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"inBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
@@ -874,4 +874,4 @@ Souffl\xE9 macaroon drag\xE9e chocolate bar I love. Cake toffee sweet I love dan
874
874
  `;var p;(function(t){t.New="new",t.Submitting="submitting",t.Success="success",t.Error="error",t.Retrying="Retrying"})(p||(p={}));let J=class extends R{constructor(){super(...arguments),this.formStatus=p.Error}async handleOnRetry(){this.onRetryClick&&this.onRetryClick()}handleOnBackClick(){this.dispatchEvent(new CustomEvent("close-drawer",{bubbles:!0,composed:!0}))}renderIcon(){let t=Ot;return this.formStatus===p.Success&&(t=Rt),r` <div> <svg xmlns="http://www.w3.org/2000/svg" width="88" height="88" viewBox="0 0 88 88" fill="none"> ${t} </svg> </div> `}renderTitle(){const t=this.formStatus===p.Success?"Your request has been successfully submitted":"Request cannot be submitted";return r`<div class="dlr-text-page-title pb-4 pt-2">${t}</div>`}renderBody(){const t=this.formStatus===p.Success?"We will reach out to you shortly.":`
875
875
  We are unable to process your request. Please, retry or reach out to us
876
876
  via email for further assistance. We apologize for the inconvenience.`;return r`<div class="dlr-text-default">${t}</div>`}renderFooter(){switch(this.formStatus){case p.Error:return r`<div class="items-start flex gap-8"> <ix-button id="retryBtn" @click="${this.handleOnRetry}">Retry</ix-button> </div>`;case p.Retrying:return r`<div class="items-start flex gap-8"> <ix-button id="retryingBtn" submitting width="w-24">Retry</ix-button> </div>`;case p.Success:return r`<div class="items-start flex gap-8"> <ix-button id="closeBtn" @click="${this.handleOnBackClick}">Close</ix-button> </div>`;default:return v}}render(){return r` <div class="flex flex-col justify-center text-center items-center pt-16"> <div>${this.renderIcon()}</div> <div>${this.renderTitle()}</div> <div class="flex flex-col justify-center text-center items-center max-w-[696px] m-auto pb-6"> ${this.renderBody()} </div> <div>${this.renderFooter()}</div> </div>`}};J.styles=[N,G],a([b({type:String})],J.prototype,"formStatus",void 0),a([b({attribute:!1})],J.prototype,"onRetryClick",void 0),J=a([F("contact-us-result")],J);const Xe=async t=>{const e=new Headers;e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${n==null?void 0:n.access_token}`);const{ContactUsApiUrl:i}=U();return await fetch(`${i}`,{headers:e,method:"POST",body:JSON.stringify(t)}).then(s=>s.ok).catch(()=>!1)},At={notesMinLength:3,notesMaxLength:500,notesErrorText:void 0,supportCategoryErrorText:void 0};let q=class extends R{constructor(){var t,e;super(...arguments),this.showDrawer=!1,this.validations=At,this.formStatus=p.New,this.contactUsRequest={companyName:n==null?void 0:n.userCompany,email:n==null?void 0:n.email,firstName:(t=n==null?void 0:n.userProfileName)===null||t===void 0?void 0:t.split(" ")[0],lastName:(e=n==null?void 0:n.userProfileName)===null||e===void 0?void 0:e.split(" ")[1],notes:"",primaryContactEmail:n==null?void 0:n.email,product:"Global Portal",supportCategory:""},this.isValid=this.isValidForm(),this.toggleDrawer=()=>{this.showDrawer=!this.showDrawer,this.showDrawer||(this.formStatus=p.New,this.contactUsRequest.notes="",this.requestUpdate())}}connectedCallback(){super.connectedCallback(),window.addEventListener("contact-us",this.toggleDrawer)}disconnectedCallback(){window.removeEventListener("contact-us",this.toggleDrawer),super.disconnectedCallback()}async handleSubmitClick(){if(this.isValidForm()){this.formStatus=p.Submitting;const t=await Xe(this.contactUsRequest);this.formStatus=t?p.Success:p.Error,this.requestUpdate()}}async handleRetryClick(){if(this.isValidForm()){this.formStatus=p.Retrying;const t=await Xe(this.contactUsRequest);this.formStatus=t?p.Success:p.Error,this.requestUpdate()}}renderResultView(){return r` <contact-us-result slot="content" .formStatus="${this.formStatus}" .onRetryClick="${()=>this.handleRetryClick()}"></contact-us-result> `}handleNotesChange(t){this.contactUsRequest.notes=t,(this.contactUsRequest.notes!==null||this.contactUsRequest.notes!=="")&&(this.contactUsRequest.notes.length<this.validations.notesMinLength||this.contactUsRequest.notes.length>this.validations.notesMaxLength?this.validations.notesErrorText=`Notes must be between ${this.validations.notesMinLength} to ${this.validations.notesMaxLength} characters`:this.validations.notesErrorText=void 0),this.isValid=this.isValidForm()}isValidForm(){return this.contactUsRequest.notes.trim()!==""&&this.contactUsRequest.supportCategory!==""&&this.validations.notesErrorText===void 0&&this.validations.supportCategoryErrorText===void 0}handleSupportCategoryChange(t){t?(this.validations.supportCategoryErrorText=void 0,this.contactUsRequest.supportCategory=t):this.validations.supportCategoryErrorText="Please select a Support category",this.isValid=this.isValidForm()}renderDefaultView(){return r` <div slot="header"> <h2 class="pt-[60px] pb-[1.5rem] dlr-text-page-title">Contact Us</h2> <div class="flex flex-col grow pb-4 max-w-full"> <div class="dlr-text-heading items-center flex"> <h3 class="grow">Question not answered? We are here to help.</h3> <em class="italic dlr-text-caption">* denotes required field</em> </div> </div> </div> <div slot="content" class="pr-2"> <div class="form-wrapper flex flex-col gap-8 pb-[1rem]"> <ix-textbox label="User Name" name="username" type="text" required .value="${n.userProfileName}" .disabled="${!0}"></ix-textbox> <ix-textbox label="User Email Address" name="email" required .value="${n.email}" .disabled="${!0}"></ix-textbox> <ix-textbox label="Company Name" name="company" required .value="${n.userCompany}" .disabled="${!0}" max="100"></ix-textbox> <ix-select data-testid="cu-form-support-cat" label="Support Category" .wideMenu="${!0}" required .error="${!!this.validations.supportCategoryErrorText}" .errorText="${this.validations.supportCategoryErrorText}" @input="${t=>this.handleSupportCategoryChange(t.target.value)}"> <ix-select-option .value="${"Non-Technical & Functional Issues"}"><div slot="headline">Non-Technical & Functional Issues</div> </ix-select-option> <ix-select-option .value="${"Technical Issues"}"><div slot="headline">Technical Issues</div> </ix-select-option> <ix-select-option .value="${"Data Issues"}"><div slot="headline">Data Issues</div> </ix-select-option> <ix-select-option .value="${"How to & Training"}"><div slot="headline">How to & Training</div> </ix-select-option> </ix-select> <ix-textbox data-testid="cu-notes" label="Notes" name="notes" type="textarea" rows="4" required .value="${this.contactUsRequest.notes}" .minLength="${this.validations.notesMinLength}" .maxLength="${this.validations.notesMaxLength}" .error="${!!this.validations.notesErrorText}" .errorText="${this.validations.notesErrorText}" @input="${t=>this.handleNotesChange(t.target.value)}"></ix-textbox> </div> <div class="flex pt-2 pb-[1rem] justify-end"> <ix-button data-testid="cu-submit-btn" type="submit" name="submitBtn" ?disabled="${!this.isValid}" has-icon trailing-icon @click="${()=>this.handleSubmitClick()}"> <span>SUBMIT</span> <md-icon slot="icon">east</md-icon> </ix-button> </div> </div> `}render(){const t=this.formStatus!==p.New&&this.formStatus!==p.Submitting;return r` <ix-drawer ?isVisible="${this.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" .showConfirmationDialogOnClose="${this.formStatus===p.New}" @close-drawer="${()=>{var e;return(e=this.drawerEl)===null||e===void 0?void 0:e.handleClosing()}}"> ${t?this.renderResultView():this.renderDefaultView()} </ix-drawer> `}};q.styles=[N,G],a([b({type:Boolean,attribute:!0})],q.prototype,"showDrawer",void 0),a([Ee("ix-drawer")],q.prototype,"drawerEl",void 0),a([d()],q.prototype,"validations",void 0),a([d()],q.prototype,"formStatus",void 0),a([d()],q.prototype,"contactUsRequest",void 0),a([d()],q.prototype,"isValid",void 0),q=a([F("contact-us-form")],q);class Xt extends R{static get styles(){return[N]}static get properties(){return{ticketId:{type:String},ticketType:{type:String},requestType:{type:String}}}constructor(){super(),this.ticketId="",this.ticketType="",this.requestType=""}handleMouseEnter(e){document.dispatchEvent(new CustomEvent("show-tooltip",{detail:{target:e.target,tooltip:r` <ticket-update-comments ticketId="${this.ticketId}" ticketType="${this.ticketType}" requestType="${this.requestType}"></ticket-update-comments> `}}))}handleMouseLeave(){document.dispatchEvent(new CustomEvent("hide-tooltip",{detail:{force:!0}}))}render(){const e=!this.ticketId||!this.ticketType||!this.requestType;return r` <a aria-describedby="tooltip" href="${e?"javascript:void(0);":"#"}" style="${e?"pointer-events: none; opacity: 0.5; cursor: default;":""}" @click="${e?i=>i.preventDefault():void 0}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <path fill-rule="evenodd" clip-rule="evenodd" d="M20 2C21.1 2 21.99 2.9 21.99 4L22 22L18 18H4C2.9 18 2 17.1 2 16V4C2 2.9 2.9 2 4 2H20ZM6 14H18V12H6V14ZM18 11H6V9H18V11ZM6 8H18V6H6V8Z" class="fill-primary"/> </svg> </a> `}}window.customElements.get("comments-tooltip")||window.customElements.define("comments-tooltip",Xt);const L={CustomerCare:"sm-customer-care",Deliveries:"sm-deliveries",Removals:"sm-deliveries",References:"sm-references",RemoteHands:"sm-remote-hands",TroubleTickets:"sm-trouble-tickets",FacilityAccess:"sm-facility-access",ServiceTickets:"sm-service-tickets",SiteMaintenance:"sm-site-maintenance",Inventory:"inventory",SiteNavigation:"site-navigations"};function Vt(t,e){let i="";switch(t){case"Delivery":i=`${L.Deliveries}/delivery-tickets`;break;case"Removal":i=`${L.Removals}/removal-tickets`;break;case"Remote Hands":i=`${L.RemoteHands}/remote-hands-tickets`;break;case"Customer Care":i=`${L.CustomerCare}/customer-care-tickets`;break;case"Facility Access":switch(e){case"Visitor Access":i=`${L.FacilityAccess}/visitor-access-tickets`;break;case"Permanent Badge":i=`${L.FacilityAccess}/permanent-badge-tickets`;break;case"OSP Access":i=`${L.FacilityAccess}/osp-access-tickets`;break;case"POP and POE Access":i=`${L.FacilityAccess}/pop-access-tickets`;break}break;case"Trouble Ticket":i=`${L.TroubleTickets}/trouble-tickets`;break}return i}const Et=t=>new Date(t).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",year:"numeric"}),qt=t=>new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!0});class ue extends R{constructor(){super(),this.fetchInProgress=!0,this.data=null,this.abortController=new AbortController}viewTicketDetails(){const e=_[this.requestType]?`/${f[this.requestType]}`:"";M.go(`/${f.base}/${f[this.ticketType]}${e}/${this.ticketId}`)}updated(e){(e.has("ticketId")||e.has("ticketType")||e.has("requestType"))&&this.makeApiCall()}makeApiCall(){this.fetchInProgress=!0,ft(Vt(this.ticketType,this.requestType),this.ticketId,this.abortController.signal).then(async e=>{this.data=e?e[0]:null,this.fetchInProgress=!1}).catch(e=>{e.name==="AbortError"?console.log("aborted"):console.error("error:",e),this.fetchInProgress=!1})}disconnectedCallback(){super.disconnectedCallback(),this.fetchInProgress&&(this.abortController.abort(),this.abortController=new AbortController,this.fetchInProgress=!1)}render(){var e,i,s;return this.fetchInProgress?r` <div class="info"> <ix-progress .value="${.3}" .linear="${!1}" .indeterminate="${!0}"></ix-progress> </div> `:this.data?r` <div><i class="italic dlr-text-caption">Last Update</i></div> <div class="font-bold"> ${(e=this.data.created_by)!==null&&e!==void 0?e:this.data.commented_by} Said on ${Et((i=this.data.created_at)!==null&&i!==void 0?i:this.data.commented_on)} at ${qt((s=this.data.created_at)!==null&&s!==void 0?s:this.data.commented_on)} </div> <div class="comment"><p>${this.data.comment}</p></div> <div> <a href="#" @click="${this.viewTicketDetails}" class="underline text-primary">View Ticket</a> </div> `:r` <div class="info">No Comments</div> `}}ue.styles=te`:host{background:var(--clr-surface-container-lowest,#fff);display:block;padding:10px;min-width:100px;min-height:50px;max-width:400px;max-height:300px;overflow:hidden;text-align:left;border-radius:4px;box-shadow:0 4px 6px rgba(0,0,0,.1);font-family:var(--text-small-font,sans-serif);font-size:var(--text-small-size,.875rem);letter-spacing:var(--text-small-letter-spacing,.0275em);line-height:var(--text-small-line-height,1.42857143em);font-weight:var(--text-small-weight,normal);text-decoration:var(--text-small-decoration,none);text-transform:var(--text-small-transform,none)}p{font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;max-height:150px}.info{display:flex;justify-content:center;align-items:center;font-weight:700;text-align:center}`,ue.properties={data:{type:Object},ticketId:{type:String},ticketType:{type:String},requestType:{type:String},fetchInProgress:{type:Boolean}},window.customElements.get("ticket-update-comments")||window.customElements.define("ticket-update-comments",ue);const{ShowStaticKnowledgeBase:Lt,KnowledgeBaseLaunchpadVideoBase:Pt,IsInventoryManagementEnabled:pe,TrustedOrigins:Nt}=U(),It=Nt.split(",").map(t=>new RegExp(t,"i"));class H extends R{constructor(){super(),this.newReleaseNotes=void 0,this.isLoading=!0,this.getUsers=async()=>{const e=await vt();this.statusCounts.USERS=e,this.status=j(this.permissions,this.statusCounts)},this.getMySites=async()=>{const e=await pt();this.statusCounts.MY_SITES=e,this.status=j(this.permissions,this.statusCounts)},this.getServiceTickets=async()=>{const e=await gt();this.statusCounts.ACTIVE_TICKETS=e,this.status=j(this.permissions,this.statusCounts)},this.getDcimEnabledLocations=async()=>{const e=await ht();this.statusCounts.DCIM=e,this.status=j(this.permissions,this.statusCounts)},this.getActiveOrders=async()=>{const e=await wt();this.statusCounts.ACTIVE_ORDERS=e,this.status=j(this.permissions,this.statusCounts)},this.getTicketUpdates=async e=>{var i;const s=g(e,ge,c.UPDATE),o=g(e,W,c.CREATE),{rows:l}=s?await ke():m,{rows:h}=o&&pe&&!((i=window.registeredApps["ui-gom"])===null||i===void 0)&&i.enabled?await Te(le(e)):m,w=l.concat(h),x=w.length>0?w.sort((S,P)=>new Date(P.updated_at)-new Date(S.updated_at)).slice(0,5):[];this.ticketUpdates={...this.ticketUpdates,rows:x,disabled:l.length===0&&h.length===0,isAuthorizedToView:s||o}},this.getYourActionRequired=async e=>{var i;const s=g(e,[Q,$],c.APPROVE),o=g(e,W,c.CREATE),{rows:l}=s?await Re():m,{rows:h}=o&&pe&&!((i=window.registeredApps["ui-gom"])===null||i===void 0)&&i.enabled?await Oe(le(e)):m,w=l.concat(h),x=w.length>0?w.sort((S,P)=>new Date(P.updated_at)-new Date(S.updated_at)).slice(0,5):[];this.yourActionRequired={...this.yourActionRequired,rows:x,disabled:l.length===0&&h.length===0,isAuthorizedToView:s||o}},this.getKnowledgeBase=async()=>{var e;if(Lt)this.news=ce.whatsNews,this.promotions=ce.newsAndPromotions,this.resources=ce.resources;else{const i=await mt();this.news=i.whatsNews,((e=this.news)===null||e===void 0?void 0:e.length)>0&&this.checkReleaseNotes(this.news[0]),this.promotions=i.newsAndPromotions,this.resources=i.resources}},this.status=j(),this.statusCounts={USERS:void 0,ACTIVE_ORDERS:void 0,ACTIVE_TICKETS:void 0,MY_SITES:void 0,DCIM:void 0},this.ticketUpdates={header:"Ticket Updates",href:`/service-management/?createdBy_equals=${n==null?void 0:n.userProfileName}&sort=updatedAt&order=desc`,columns:re(this.ticketSelect),isAuthorizedToView:!1},this.yourActionRequired={header:"Your Action Required",href:"/service-management/?permission_privilege=Approve&status_equals=Pending+Approval",columns:oe(this.ticketSelect),isAuthorizedToView:!1},this.permissions={},this.navItems=fe(this.permissions,{})}checkReleaseNotes(e){var i,s,o;const l=localStorage.getItem("x-auth"),{access_token:h}=JSON.parse(l),{previous_login_date:w}=qe(h),x=(i=new Date(w))===null||i===void 0?void 0:i.getTime(),{id:S,dateAdded:P,documents:D,uid:Z}=e;if(localStorage.getItem("releaseNotesViewed")===String(S))return;const K=(s=new Date(P))===null||s===void 0?void 0:s.getTime(),Y=1440*60*1e3;if(Number.isNaN(x)||Number.isNaN(K)||x>K+Y)return;const ee=!((o=D==null?void 0:D[0])===null||o===void 0)&&o.url?`${Pt}${D[0].url}`:`/knowledge-base/details/${Z}`;this.newReleaseNotes={id:S,title:"New Release Updates!",href:ee,description:`We have introduced new and improved functionality on the Global Portal
877
- with our monthly release. Learn more by clicking on the link below or review it later in our What's New section!`}}dismissReleaseNotes(){localStorage.setItem("releaseNotesViewed",this.newReleaseNotes.id),this.newReleaseNotes=void 0}firstUpdated(){pe&&this.getActiveOrders(),this.getUsers(),this.getMySites(),this.getServiceTickets(),this.getKnowledgeBase(),Promise.all([yt(),xt()]).then(([e,i])=>{this.permissions=e,this.navItems=fe(this.permissions,i),this.getDcimEnabledLocations(),this.getTicketUpdates(this.permissions),this.getYourActionRequired(this.permissions),this.isLoading=!1})}messageHandler(e){const{origin:i,data:s}=e;if(!It.some(o=>o.test(i))){console.warn("Rejected message from untrusted origin:",i);return}s.knowledgeBaseURL&&M.go(`${Ie[Ne].path}${s.knowledgeBaseURL}`)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.messageHandler)}disconnectedCallback(){window.removeEventListener("message",this.messageHandler),super.disconnectedCallback()}route(e){const{route:i}=e.detail;if(i.startsWith("/"))M.go(i);else{const s=new CustomEvent(e.detail.route,{bubbles:!0,composed:!0,detail:{fromLaunchpad:!0}});this.dispatchEvent(s)}}ticketSelect(e){let i="";switch(e.source){case T.ServiceManagement:const{ticket_id:s,ticket_type:o,request_type:l}=e,h=_[l]?`/${f[l]}`:"";i=`/${f.base}/${f[o]}${h}/${s}`;break;case T.OrderManagement:i=`/order-management/order-details/${e.ticket_id}`;break;default:i="/order-management/order-details"}M.go(i)}renderNewReleaseNotes(){return r`<ix-dialog open> <h3 slot="headline" class="dlr-text-heading"> ${this.newReleaseNotes.title} </h3> <p slot="content" class="md:w-[380px]"> ${this.newReleaseNotes.description} </p> <div slot="actions" class="px-2 pb-2 pt-6"> <ix-button @click="${this.dismissReleaseNotes}" appearance="text"> Dismiss </ix-button> <ix-button @click="${this.dismissReleaseNotes}" href="${this.newReleaseNotes.href}" target="_blank" appearance="text"> Read More </ix-button> </div> </ix-dialog>`}render(){return r` <contact-us-form></contact-us-form> ${this.newReleaseNotes?this.renderNewReleaseNotes():v} ${this.isLoading?v:r` <ix-launchpad class="mb-4 block" api-permissions="${JSON.stringify(this.permissions)}" .status="${this.status}" .nav="${this.navItems}" .news="${this.news}" .promotions="${this.promotions}" .resources="${this.resources}" .contacts="${Tt}" .updates="${this.ticketUpdates}" .actions="${this.yourActionRequired}" @route="${this.route}"></ix-launchpad> `} <ix-tooltip></ix-tooltip> `}}H.styles=[N,G],H.properties={status:[],ticketUpdates:{},yourActionRequired:{}},a([d(Object)],H.prototype,"newReleaseNotes",void 0),a([d()],H.prototype,"isLoading",void 0),window.customElements.get("app-widgets")||window.customElements.define("app-widgets",H);let he=class extends R{render(){return r` <div class="launchpad-bg-image"></div> <app-widgets class="relative"> </app-widgets> `}};he.styles=[N,G],he=a([F("ui-launchpad")],he);
877
+ with our monthly release. Learn more by clicking on the link below or review it later in our What's New section!`}}dismissReleaseNotes(){localStorage.setItem("releaseNotesViewed",this.newReleaseNotes.id),this.newReleaseNotes=void 0}firstUpdated(){pe&&this.getActiveOrders(),this.getUsers(),this.getMySites(),this.getServiceTickets(),this.getKnowledgeBase(),Promise.all([yt(),xt()]).then(([e,i])=>{this.permissions=e,this.navItems=fe(this.permissions,i),this.getDcimEnabledLocations(),this.getTicketUpdates(this.permissions),this.getYourActionRequired(this.permissions),this.isLoading=!1})}messageHandler(e){const{origin:i,data:s}=e;if(!It.some(o=>o.test(i))){console.warn("Rejected message from untrusted origin:",i);return}s.knowledgeBaseURL&&M.go(`${Ie[Ne].path}${s.knowledgeBaseURL}`)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.messageHandler)}disconnectedCallback(){window.removeEventListener("message",this.messageHandler),super.disconnectedCallback()}route(e){const{route:i}=e.detail;if(i.startsWith("/"))M.go(i);else{const s=new CustomEvent(e.detail.route,{bubbles:!0,composed:!0,detail:{fromLaunchpad:!0}});this.dispatchEvent(s)}}ticketSelect(e){let i="";switch(e.source){case T.ServiceManagement:const{ticket_id:s,ticket_type:o,request_type:l}=e,h=_[l]?`/${f[l]}`:"";i=`/${f.base}/${f[o]}${h}/${s}`;break;case T.OrderManagement:i=`/order-management/order-details/${e.ticket_id}`;break;default:i="/order-management/order-details"}M.go(i)}renderNewReleaseNotes(){return r`<ix-dialog open> <h3 slot="headline" class="dlr-text-heading"> ${this.newReleaseNotes.title} </h3> <p slot="content" class="md:w-[380px]"> ${this.newReleaseNotes.description} </p> <div slot="actions" class="px-2 pb-2 pt-6"> <ix-button @click="${this.dismissReleaseNotes}" appearance="text"> Dismiss </ix-button> <ix-button @click="${this.dismissReleaseNotes}" href="${this.newReleaseNotes.href}" appearance="text"> Read More </ix-button> </div> </ix-dialog>`}render(){return r` <contact-us-form></contact-us-form> ${this.newReleaseNotes?this.renderNewReleaseNotes():v} ${this.isLoading?v:r` <ix-launchpad class="mb-4 block" api-permissions="${JSON.stringify(this.permissions)}" .status="${this.status}" .nav="${this.navItems}" .news="${this.news}" .promotions="${this.promotions}" .resources="${this.resources}" .contacts="${Tt}" .updates="${this.ticketUpdates}" .actions="${this.yourActionRequired}" @route="${this.route}"></ix-launchpad> `} <ix-tooltip></ix-tooltip> `}}H.styles=[N,G],H.properties={status:[],ticketUpdates:{},yourActionRequired:{}},a([d(Object)],H.prototype,"newReleaseNotes",void 0),a([d()],H.prototype,"isLoading",void 0),window.customElements.get("app-widgets")||window.customElements.define("app-widgets",H);let he=class extends R{render(){return r` <div class="launchpad-bg-image"></div> <app-widgets class="relative"> </app-widgets> `}};he.styles=[N,G],he=a([F("ui-launchpad")],he);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ui-launchpad following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "ui-launchpad",
6
- "version": "14.0.0",
6
+ "version": "14.0.1-IXUAT-11107.550231",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  "./ui-launchpad.js": "./dist/ui-launchpad.js",