@flarehr/cars-calculator 2.3.49 → 2.3.57
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/lib/cars-calculator/cars-calculator.esm.js +1 -1
- package/dist/lib/cars-calculator/cars-calculator.js +1 -1
- package/dist/lib/cars-calculator/{p-b7e7dc0f.system.entry.js → p-08f08988.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-0b08c63c.system.js → p-19b00569.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-92efd97a.system.entry.js → p-2f318de8.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-cc24e248.js → p-34be9e94.js} +1 -1
- package/dist/lib/cars-calculator/{p-9e42ba48.system.entry.js → p-3986811b.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-69382409.entry.js → p-40adf333.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-45d6fbc2.system.js +1 -0
- package/dist/lib/cars-calculator/{p-82b4b9ca.entry.js → p-5feb27ac.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5e27b626.js → p-628050dd.js} +1 -1
- package/dist/lib/cars-calculator/{p-f91aa986.system.js → p-6339bd49.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-a0ed3a75.system.js → p-63ad215f.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-03836e14.entry.js → p-6a379ac2.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-7062880e.js +1 -0
- package/dist/lib/cars-calculator/{p-20a242dc.entry.js → p-7141bc11.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-ac38cb9d.system.entry.js → p-7234d34c.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-9cc8b374.system.entry.js → p-7fed1bfc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-192dd4a3.system.js → p-8d4bb973.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-25e24da6.system.entry.js → p-94ba6def.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5efd0fbd.entry.js → p-a54b8d09.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-50451ff0.entry.js → p-aa6eeef5.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-98bd1117.system.entry.js → p-aa7dc5dc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-819cfa63.js → p-ab3a7737.js} +1 -1
- package/dist/lib/cars-calculator/{p-821b5928.entry.js → p-af1b58b9.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-78c4dce3.system.js → p-b41f72c8.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-598f4a0b.system.js → p-b51215ae.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-69960bb6.system.js → p-bdb3fb61.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-5c2cc99d.js → p-bf086b51.js} +1 -1
- package/dist/lib/cars-calculator/p-c39a8fe9.entry.js +1 -0
- package/dist/lib/cars-calculator/p-c3b6466e.js +1 -0
- package/dist/lib/cars-calculator/{p-3126f655.system.entry.js → p-c3d37683.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-c49546ea.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-88c232fe.system.entry.js → p-c77c24a6.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-1bc2b206.system.js → p-c9562e73.system.js} +1 -1
- package/dist/lib/cars-calculator/p-cbc447c7.system.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-2e1b766b.system.entry.js → p-cd0073f4.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-c35d387e.js → p-d14b00d9.js} +1 -1
- package/dist/lib/cars-calculator/{p-c4cda1ba.entry.js → p-e385dbe0.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-066d8e7b.js → p-f3effa5d.js} +1 -1
- package/dist/lib/cars-calculator/{p-4b3e246f.js → p-fa160c9f.js} +1 -1
- package/dist/lib/cars-calculator/{p-8ec3baa9.system.js → p-fa7a5280.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-e45ce69c.entry.js → p-ffa283e3.entry.js} +1 -1
- package/dist/lib/cjs/ap-ben-asset_15.cjs.entry.js +1 -1
- package/dist/lib/cjs/ap-ben-benefit-card.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-list-item.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-url_10.cjs.entry.js +6 -6
- package/dist/lib/cjs/ap-ben-benefits-list_3.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefits-page.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-confirm-dialog_4.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-edit-benefit-page_5.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-loading-page_2.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-oidc-callback-page.cjs.entry.js +2 -2
- package/dist/lib/cjs/api-client-00edc9b6.js +107 -0
- package/dist/lib/cjs/{app-globals-086f9d49.js → app-globals-dec360ac.js} +1 -1
- package/dist/lib/cjs/{authentication.service-11c30071.js → authentication.service-12f9ead3.js} +1 -1
- package/dist/lib/cjs/benefits-app-host.cjs.entry.js +2 -2
- package/dist/lib/cjs/{benefits-app.query-97410065.js → benefits-app.query-98898e4c.js} +2 -2
- package/dist/lib/cjs/{benefits.api-053c4334.js → benefits.api-a4bd9804.js} +1 -1
- package/dist/lib/cjs/cars-calculator.cjs.js +2 -2
- package/dist/lib/cjs/{datorama-akita-792b4d1d.js → datorama-akita-bb801820.js} +15 -5
- package/dist/lib/cjs/{event-tracking.service-6ae64142.js → event-tracking.service-fcc820f1.js} +1 -1
- package/dist/lib/cjs/loader.cjs.js +2 -2
- package/dist/lib/cjs/{manage-benefits.service-04883c9b.js → manage-benefits.service-f45b4602.js} +3 -3
- package/dist/lib/cjs/{role-management.service-120cb99a.js → role-management.service-2109723c.js} +2 -2
- package/dist/lib/esm/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm/ap-ben-benefit-card.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-list-item.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-url_10.entry.js +6 -6
- package/dist/lib/esm/ap-ben-benefits-list_3.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefits-page.entry.js +4 -4
- package/dist/lib/esm/ap-ben-confirm-dialog_4.entry.js +3 -3
- package/dist/lib/esm/ap-ben-edit-benefit-page_5.entry.js +4 -4
- package/dist/lib/esm/ap-ben-loading-page_2.entry.js +4 -4
- package/dist/lib/esm/ap-ben-oidc-callback-page.entry.js +2 -2
- package/dist/lib/esm/api-client-a68152b8.js +99 -0
- package/dist/lib/esm/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm/benefits-app-host.entry.js +2 -2
- package/dist/lib/esm/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +2 -2
- package/dist/lib/esm/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm/cars-calculator.js +2 -2
- package/dist/lib/esm/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +15 -5
- package/dist/lib/esm/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm/loader.js +2 -2
- package/dist/lib/esm/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +3 -3
- package/dist/lib/esm/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +2 -2
- package/dist/lib/esm-es5/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-card.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-list-item.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-url_10.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-list_3.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-page.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-confirm-dialog_4.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-edit-benefit-page_5.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-loading-page_2.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-oidc-callback-page.entry.js +1 -1
- package/dist/lib/esm-es5/api-client-a68152b8.js +1 -0
- package/dist/lib/esm-es5/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm-es5/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm-es5/benefits-app-host.entry.js +1 -1
- package/dist/lib/esm-es5/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +1 -1
- package/dist/lib/esm-es5/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm-es5/cars-calculator.js +1 -1
- package/dist/lib/esm-es5/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +1 -1
- package/dist/lib/esm-es5/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +1 -1
- package/dist/lib/esm-es5/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +1 -1
- package/package.json +7 -3
- package/dist/lib/cars-calculator/p-1bdb5093.entry.js +0 -1
- package/dist/lib/cars-calculator/p-307f91bf.system.entry.js +0 -1
- package/dist/lib/cars-calculator/p-56fb974f.entry.js +0 -1
- package/dist/lib/cars-calculator/p-69cf2679.system.js +0 -1
- package/dist/lib/cars-calculator/p-dc58dd5c.js +0 -1
- package/dist/lib/cars-calculator/p-df0a267a.js +0 -1
- package/dist/lib/cjs/api-client-a3c12426.js +0 -107
- package/dist/lib/esm/api-client-8974d2bd.js +0 -99
- package/dist/lib/esm-es5/api-client-8974d2bd.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as s,d as i,e as n}from"./p-91e1cdd0.js";import{n as o,c as a}from"./p-2c9dd7c4.js";import{a as r}from"./p-7ad92407.js";import{n as h,M as c,A as l,E as d}from"./p-3023f507.js";import{e as u,a as p,m as f,b,c as m,s as g,d as w,f as y,g as v,h as k,i as P,j,k as C,l as x}from"./p-cc24e248.js";import{a as B}from"./p-ea120e31.js";import{A as S}from"./p-8622df5e.js";import"./p-556fdb43.js";import"./p-fdc8ec5f.js";import"./p-066d8e7b.js";import"./p-054d1471.js";import"./p-f63d9d89.js";import"./p-df0a267a.js";import"./p-5347b880.js";import"./p-5c2cc99d.js";const T=class{constructor(e){t(this,e),this.benefitId=o,this.showDeleteConfirmDialog=!1,this.showCancelConfirmDialog=!1,this.isLoading=!1,this.isValidationDisplayed=!1,this.stateSubscription=new B}async componentWillLoad(){await this.initialiseAsync()}disconnectedCallback(){this.stateSubscription.unsubscribe()}render(){return e(s,{class:"w-100"},e("ap-ben-ui-container",{class:"w-100 d-none"},e("div",{class:"row my-5"},e("div",{class:"uiid-new-edit-delete-benefit-page col-12"},e("h3",null,"add"===this.editMode?"New Benefit":"Edit Benefit"),e("ap-ben-edit-benefit-form",{class:"d-block mt-4 mb-3",disabled:this.isLoading,isValidationDisplayed:this.isValidationDisplayed}),this.renderActionBar()))),this.showDeleteConfirmDialog&&this.renderDeleteConfirmDialog(),this.showCancelConfirmDialog&&this.renderCancelConfirmDialog())}renderActionBar(){return e("div",{class:"row"},e("div",{class:"col-12 d-flex"},e("button",{hidden:"add"===this.editMode,class:"uiid-delete-benefit-item btn btn-outline-danger",onClick:()=>{this.showDeleteConfirmDialog=!0}},"Delete"),e("div",{class:"ml-auto"},e("button",{class:"btn btn-light mr-3",onClick:()=>this.onCancelClicked()},"Cancel"),e("button",{class:"uiid-publish-benefit btn btn-primary",onClick:()=>this.publishBenefit(),disabled:this.isLoading},"Publish"))))}renderDeleteConfirmDialog(){return e("ap-ben-modal-section",{show:this.showDeleteConfirmDialog,showHeader:!0,modalTitle:"Delete benefit",onModalClosed:()=>{this.showDeleteConfirmDialog=!1}},e("ap-ben-confirm-dialog",{acceptText:"Delete",declineText:"Cancel",dialogStyle:"danger",onAccepted:async()=>{await this.deleteBenefitAsync(),this.showDeleteConfirmDialog=!1},onDeclined:()=>{this.showDeleteConfirmDialog=!1}},e("p",null,e("strong",null,'"',r(this.selectedBenefit).title.value,'"')," will be permanently deleted from your benefits. Are you sure you want to delete it?")))}renderCancelConfirmDialog(){return e("ap-ben-modal-section",{show:this.showCancelConfirmDialog,showHeader:!0,modalTitle:"Unsaved changes",onModalClosed:()=>{this.showCancelConfirmDialog=!1}},e("ap-ben-confirm-dialog",{acceptText:"Publish",declineText:"Discard",dialogStyle:"warning",onAccepted:async()=>{this.showCancelConfirmDialog=!1,await this.publishBenefit()},onDeclined:()=>{this.showCancelConfirmDialog=!1,this.navigateToManageBenefits()}},"add"===this.editMode?"Do you want to save your new benefit?":e("p",null,e("strong",null,'"',r(this.selectedBenefit).title.value,'"')," has been modified. Do you want to publish your changes?")))}async initialiseAsync(){this.stateSubscription.add(u.isLoading$.subscribe((t=>this.isLoading=t))),this.stateSubscription.add(u.selectedBenefit$.subscribe((t=>this.selectedBenefit=t))),this.stateSubscription.add(u.draftBenefit$.subscribe((t=>this.draftBenefit=t))),a(this.benefitId)?(this.editMode="edit",p.loadExistingBenefitForEditingAsync(this.benefitId.value)):(p.createDraftBenefit(),this.editMode="add")}navigateToManageBenefits(){p.clearDraftBenefit(),h.navigateInternally(c)}async publishBenefit(){r(this.draftBenefit).isValid?(r(this.draftBenefit).isDirty&&await p.publishDraftBenefitAsync(),this.navigateToManageBenefits()):this.isValidationDisplayed=!0}async onCancelClicked(){r(this.draftBenefit).isDirty?this.showCancelConfirmDialog=!0:this.navigateToManageBenefits()}async deleteBenefitAsync(){await p.deleteSelectedBenefitAsync(),this.navigateToManageBenefits()}},_=class{constructor(e){t(this,e),this.showDisabledBenefits=!1,this.storeSubscription=new B}componentWillLoad(){f.loadPageStateAsync(),this.storeSubscription.add(b.manageBenefitsPageState$.subscribe((t=>this.pageState=t))),this.storeSubscription.add(b.isLoading$.subscribe((t=>this.isLoading=t)))}disconnectedCallback(){this.storeSubscription.unsubscribe()}render(){return this.isLoading?e(s,{class:"w-100 text-center mt-5"},e("ap-ben-ui-container",{class:"w-100 d-none"},e("fl-loading-indicator",null))):e(s,{class:"w-100"},e("ap-ben-ui-container",{class:"w-100 d-none"},this.managedBenefitHeader(),e("div",{class:"uiid-manage-benefit-body row bg-white border-left border-right border-bottom mb-5 mx-0 rounded no-gutters"},e("div",{class:"col-12"},0===this.pageState.enabledBenefits.length?e("ap-ben-empty-benefits",{onNewBenefitButtonClicked:()=>this.addBenefit()}):this.ActiveBenefitsSection(),this.ToggleInactiveBenefitsRow(),this.showDisabledBenefits&&this.InactiveBenefitsSection()))))}ActiveBenefitsSection(){return[e("ap-ben-manage-benefits-header-row",{class:"d-none d-md-block"}),this.pageState.enabledBenefits.map((t=>e("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:t=>this.editBenefit(t.detail)})))]}ToggleInactiveBenefitsRow(){return e("div",{class:"col-12 py-3 border-top d-flex justify-content-center"},e("button",{class:"uiid-show-inactive-benefit-item btn btn-link",onClick:()=>this.onToggleInactiveBenefits()},e("h6",{class:"m-0"},this.showDisabledBenefits?`Hide inactive benefits (${this.pageState.disabledBenefits.length})`:`Show inactive (${this.pageState.disabledBenefits.length})`)))}InactiveBenefitsSection(){return 0===this.pageState.disabledBenefits.length?[e("div",{class:"row border-top py-3 px-3 d-flex align-items-center no-gutters"},e("div",{class:"col-12 my-1 d-flex justify-content-center"},e("span",{class:"text-muted"},"No inactive benefits.")))]:this.pageState.disabledBenefits.map((t=>e("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:t=>this.editBenefit(t.detail)})))}managedBenefitHeader(){return e("div",{class:"uiid-manage-benefit-header row mb-3 mt-5"},e("div",{class:"col-12 col-sm-6"},e("h3",null,"Manage Benefits")),e("div",{class:"col-12 col-sm-6 d-flex justify-content-end align-items-center"},e("fl-button",{class:"uiid-new-benefit-button",onClick:()=>this.addBenefit()},e("ap-ben-icon",{class:"mr-2",iconPrefix:"far",iconId:"plus"}),"New benefit")))}onToggleInactiveBenefits(){this.showDisabledBenefits=!this.showDisabledBenefits}addBenefit(){h.navigateInternally(l)}editBenefit(t){h.navigateInternally(`${d}/${t.id}`)}};_.style="manage-page .benefits-zero-state{height:32rem}";const A=(t,e,s)=>s(t.confirm(e)),O=(t,e)=>{const s=t[e],i="__storage_test__";try{return s.setItem(i,i),s.removeItem(i),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==s.length}},E=class{constructor(e){t(this,e),this.unsubscribe=()=>{},this.activeClass="link-active",this.exact=!1,this.strict=!0,this.custom="a",this.match=null}componentWillLoad(){this.computeMatch()}computeMatch(){this.location&&(this.match=m(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict}))}handleClick(t){var e,s,i;if(!((e=t).metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&this.history&&this.url&&this.root)return t.preventDefault(),this.history.push((i=this.root,"/"==(s=this.url).charAt(0)&&"/"==i.charAt(i.length-1)?i.slice(0,i.length-1)+s:i+s))}render(){let t={class:{[this.activeClass]:null!==this.match},onClick:this.handleClick.bind(this)};return this.anchorClass&&(t.class[this.anchorClass]=!0),"a"===this.custom&&(t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})),e(this.custom,Object.assign({},t),e("slot",null))}get el(){return i(this)}static get watchers(){return{location:["computeMatch"]}}};S.injectProps(E,["history","location","root"]);const H=t=>"STENCIL-ROUTE"===t.tagName,D=class{constructor(e){t(this,e),this.group=((1e17*Math.random()).toString().match(/.{4}/g)||[]).join("-"),this.subscribers=[],this.queue=n(this,"queue")}componentWillLoad(){null!=this.location&&this.regenerateSubscribers(this.location)}async regenerateSubscribers(t){if(null==t)return;let e=-1;if(this.subscribers=Array.prototype.slice.call(this.el.children).filter(H).map(((s,i)=>{const n=m(t.pathname,{path:s.url,exact:s.exact,strict:!0});return n&&-1===e&&(e=i),{el:s,match:n}})),-1===e)return;if(this.activeIndex===e)return void(this.subscribers[e].el.match=this.subscribers[e].match);this.activeIndex=e;const s=this.subscribers[this.activeIndex];this.scrollTopOffset&&(s.el.scrollTopOffset=this.scrollTopOffset),s.el.group=this.group,s.el.match=s.match,s.el.componentUpdated=t=>{this.queue.write((()=>{this.subscribers.forEach(((t,e)=>{if(t.el.componentUpdated=void 0,e===this.activeIndex)return t.el.style.display="";this.scrollTopOffset&&(t.el.scrollTopOffset=this.scrollTopOffset),t.el.group=this.group,t.el.match=null,t.el.style.display="none"}))})),this.routeViewsUpdated&&this.routeViewsUpdated(Object.assign({scrollTopOffset:this.scrollTopOffset},t))}}render(){return e("slot",null)}get el(){return i(this)}static get watchers(){return{location:["regenerateSubscribers"]}}};S.injectProps(D,["location","routeViewsUpdated"]);const M=(t,...e)=>{t||console.warn(...e)},L=()=>{let t,e=[];return{setPrompt:e=>(M(null==t,"A history supports only one prompt at a time"),t=e,()=>{t===e&&(t=null)}),confirmTransitionTo:(e,s,i,n)=>{if(null!=t){const o="function"==typeof t?t(e,s):t;"string"==typeof o?"function"==typeof i?i(o,n):(M(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),n(!0)):n(!1!==o)}else n(!0)},appendListener:t=>{let s=!0;const i=(...e)=>{s&&t(...e)};return e.push(i),()=>{s=!1,e=e.filter((t=>t!==i))}},notifyListeners:(...t)=>{e.forEach((e=>e(...t)))}}},U=(t,e="scrollPositions")=>{let s=new Map;const i=(e,i)=>{if(s.set(e,i),O(t,"sessionStorage")){const e=[];s.forEach(((t,s)=>{e.push([s,t])})),t.sessionStorage.setItem("scrollPositions",JSON.stringify(e))}};if(O(t,"sessionStorage")){const i=t.sessionStorage.getItem(e);s=i?new Map(JSON.parse(i)):s}return"scrollRestoration"in t.history&&(history.scrollRestoration="manual"),{set:i,get:t=>s.get(t),has:t=>s.has(t),capture:e=>{i(e,[t.scrollX,t.scrollY])}}},R={hashbang:{encodePath:t=>"!"===t.charAt(0)?t:"!/"+C(t),decodePath:t=>"!"===t.charAt(0)?t.substr(1):t},noslash:{encodePath:C,decodePath:w},slash:{encodePath:w,decodePath:w}},N=(t,e)=>{const s=0==t.pathname.indexOf(e)?"/"+t.pathname.slice(e.length):t.pathname;return Object.assign({},t,{pathname:s})},W={browser:(t,e={})=>{let s=!1;const i=t.history,n=t.location,o=t.navigator,a=(t=>{const e=t.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&t.history&&"pushState"in t.history})(t),r=!(-1===o.userAgent.indexOf("Trident")),h=U(t),c=null!=e.forceRefresh&&e.forceRefresh,l=null!=e.getUserConfirmation?e.getUserConfirmation:A,d=null!=e.keyLength?e.keyLength:6,u=e.basename?g(w(e.basename)):"",p=()=>{try{return t.history.state||{}}catch(t){return{}}},f=t=>{t=t||{};const{key:e,state:s}=t,{pathname:i,search:o,hash:a}=n;let r=i+o+a;return M(!u||k(r,u),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+r+'" to begin with "'+u+'".'),u&&(r=P(r,u)),y(r,s,e||v(d))},b=L(),m=t=>{h.capture(N.location.key),Object.assign(N,t),N.location.scrollPosition=h.get(N.location.key),N.length=i.length,b.notifyListeners(N.location,N.action)},C=t=>{((t,e)=>void 0===e.state&&-1===t.userAgent.indexOf("CriOS"))(o,t)||B(f(t.state))},x=()=>{B(f(p()))},B=t=>{if(s)s=!1,m();else{const e="POP";b.confirmTransitionTo(t,e,l,(s=>{s?m({action:e,location:t}):S(t)}))}},S=t=>{let e=_.indexOf(N.location.key),i=_.indexOf(t.key);-1===e&&(e=0),-1===i&&(i=0);const n=e-i;n&&(s=!0,D(n))},T=f(p());let _=[T.key],O=0,E=!1;const H=t=>u+j(t),D=t=>{i.go(t)},R=e=>{O+=e,1===O?(t.addEventListener("popstate",C),r&&t.addEventListener("hashchange",x)):0===O&&(t.removeEventListener("popstate",C),r&&t.removeEventListener("hashchange",x))},N={length:i.length,action:"POP",location:T,createHref:H,push:(t,e)=>{M(!("object"==typeof t&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");const s="PUSH",o=y(t,e,v(d),N.location);b.confirmTransitionTo(o,s,l,(t=>{if(!t)return;const e=H(o),{key:r,state:h}=o;if(a)if(i.pushState({key:r,state:h},"",e),c)n.href=e;else{const t=_.indexOf(N.location.key),e=_.slice(0,-1===t?0:t+1);e.push(o.key),_=e,m({action:s,location:o})}else M(void 0===h,"Browser history cannot push state in browsers that do not support HTML5 history"),n.href=e}))},replace:(t,e)=>{M(!("object"==typeof t&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");const s="REPLACE",o=y(t,e,v(d),N.location);b.confirmTransitionTo(o,s,l,(t=>{if(!t)return;const e=H(o),{key:r,state:h}=o;if(a)if(i.replaceState({key:r,state:h},"",e),c)n.replace(e);else{const t=_.indexOf(N.location.key);-1!==t&&(_[t]=o.key),m({action:s,location:o})}else M(void 0===h,"Browser history cannot replace state in browsers that do not support HTML5 history"),n.replace(e)}))},go:D,goBack:()=>D(-1),goForward:()=>D(1),block:(t="")=>{const e=b.setPrompt(t);return E||(R(1),E=!0),()=>(E&&(E=!1,R(-1)),e())},listen:t=>{const e=b.appendListener(t);return R(1),()=>{R(-1),e()}},win:t};return N},hash:(t,e={})=>{let s=!1,i=null,n=0,o=!1;const a=t.location,r=t.history,h=-1===t.navigator.userAgent.indexOf("Firefox"),c=null!=e.keyLength?e.keyLength:6,{getUserConfirmation:l=A,hashType:d="slash"}=e,u=e.basename?g(w(e.basename)):"",{encodePath:p,decodePath:f}=R[d],b=()=>{const t=a.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},m=t=>{const e=a.href.indexOf("#");a.replace(a.href.slice(0,e>=0?e:0)+"#"+t)},C=()=>{let t=f(b());return M(!u||k(t,u),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+u+'".'),u&&(t=P(t,u)),y(t,void 0,v(c))},B=L(),S=t=>{Object.assign(I,t),I.length=r.length,B.notifyListeners(I.location,I.action)},T=()=>{const t=b(),e=p(t);if(t!==e)m(e);else{const t=C(),e=I.location;if(!s&&x(e,t))return;if(i===j(t))return;i=null,_(t)}},_=t=>{if(s)s=!1,S();else{const e="POP";B.confirmTransitionTo(t,e,l,(s=>{s?S({action:e,location:t}):O(t)}))}},O=t=>{let e=U.lastIndexOf(j(I.location)),i=U.lastIndexOf(j(t));-1===e&&(e=0),-1===i&&(i=0);const n=e-i;n&&(s=!0,N(n))},E=b(),H=p(E);E!==H&&m(H);const D=C();let U=[j(D)];const N=t=>{M(h,"Hash history go(n) causes a full page reload in this browser"),r.go(t)},W=(t,e)=>{n+=e,1===n?t.addEventListener("hashchange",T):0===n&&t.removeEventListener("hashchange",T)},I={length:r.length,action:"POP",location:D,createHref:t=>"#"+p(u+j(t)),push:(t,e)=>{M(void 0===e,"Hash history cannot push state; it is ignored");const s="PUSH",n=y(t,void 0,v(c),I.location);B.confirmTransitionTo(n,s,l,(t=>{if(!t)return;const e=j(n),o=p(u+e);if(b()!==o){i=e,(t=>{a.hash=t})(o);const t=U.lastIndexOf(j(I.location)),r=U.slice(0,-1===t?0:t+1);r.push(e),U=r,S({action:s,location:n})}else M(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),S()}))},replace:(t,e)=>{M(void 0===e,"Hash history cannot replace state; it is ignored");const s="REPLACE",n=y(t,void 0,v(c),I.location);B.confirmTransitionTo(n,s,l,(t=>{if(!t)return;const e=j(n),o=p(u+e);b()!==o&&(i=e,m(o));const a=U.indexOf(j(I.location));-1!==a&&(U[a]=e),S({action:s,location:n})}))},go:N,goBack:()=>N(-1),goForward:()=>N(1),block:(e="")=>{const s=B.setPrompt(e);return o||(W(t,1),o=!0),()=>(o&&(o=!1,W(t,-1)),s())},listen:e=>{const s=B.appendListener(e);return W(t,1),()=>{W(t,-1),s()}},win:t};return I}},I=class{constructor(e){t(this,e),this.root="/",this.historyType="browser",this.titleSuffix="",this.routeViewsUpdated=(t={})=>{if(this.history&&t.scrollToId&&"browser"===this.historyType){const e=this.history.win.document.getElementById(t.scrollToId);if(e)return e.scrollIntoView()}this.scrollTo(t.scrollTopOffset||this.scrollTopOffset)},this.isServer=n(this,"isServer"),this.queue=n(this,"queue")}componentWillLoad(){this.history=W[this.historyType](this.el.ownerDocument.defaultView),this.history.listen((t=>{t=N(t,this.root),this.location=t})),this.location=N(this.history.location,this.root)}scrollTo(t){const e=this.history;if(null!=t&&!this.isServer&&e)return"POP"===e.action&&Array.isArray(e.location.scrollPosition)?this.queue.write((()=>{e&&e.location&&Array.isArray(e.location.scrollPosition)&&e.win.scrollTo(e.location.scrollPosition[0],e.location.scrollPosition[1])})):this.queue.write((()=>{e.win.scrollTo(0,t)}))}render(){if(this.location&&this.history)return e(S.Provider,{state:{historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated}},e("slot",null))}get el(){return i(this)}};export{T as ap_ben_edit_benefit_page,_ as ap_ben_manage_page,E as stencil_route_link,D as stencil_route_switch,I as stencil_router}
|
|
1
|
+
import{r as t,h as e,H as s,d as i,e as n}from"./p-91e1cdd0.js";import{n as o,c as a}from"./p-2c9dd7c4.js";import{a as r}from"./p-7ad92407.js";import{n as h,M as c,A as l,E as d}from"./p-3023f507.js";import{e as u,a as p,m as f,b,c as m,s as g,d as w,f as y,g as v,h as k,i as P,j,k as C,l as x}from"./p-34be9e94.js";import{a as B}from"./p-ea120e31.js";import{A as S}from"./p-8622df5e.js";import"./p-556fdb43.js";import"./p-fdc8ec5f.js";import"./p-f3effa5d.js";import"./p-054d1471.js";import"./p-f63d9d89.js";import"./p-7062880e.js";import"./p-5347b880.js";import"./p-bf086b51.js";const T=class{constructor(e){t(this,e),this.benefitId=o,this.showDeleteConfirmDialog=!1,this.showCancelConfirmDialog=!1,this.isLoading=!1,this.isValidationDisplayed=!1,this.stateSubscription=new B}async componentWillLoad(){await this.initialiseAsync()}disconnectedCallback(){this.stateSubscription.unsubscribe()}render(){return e(s,{class:"w-100"},e("ap-ben-ui-container",{class:"w-100 d-none"},e("div",{class:"row my-5"},e("div",{class:"uiid-new-edit-delete-benefit-page col-12"},e("h3",null,"add"===this.editMode?"New Benefit":"Edit Benefit"),e("ap-ben-edit-benefit-form",{class:"d-block mt-4 mb-3",disabled:this.isLoading,isValidationDisplayed:this.isValidationDisplayed}),this.renderActionBar()))),this.showDeleteConfirmDialog&&this.renderDeleteConfirmDialog(),this.showCancelConfirmDialog&&this.renderCancelConfirmDialog())}renderActionBar(){return e("div",{class:"row"},e("div",{class:"col-12 d-flex"},e("button",{hidden:"add"===this.editMode,class:"uiid-delete-benefit-item btn btn-outline-danger",onClick:()=>{this.showDeleteConfirmDialog=!0}},"Delete"),e("div",{class:"ml-auto"},e("button",{class:"btn btn-light mr-3",onClick:()=>this.onCancelClicked()},"Cancel"),e("button",{class:"uiid-publish-benefit btn btn-primary",onClick:()=>this.publishBenefit(),disabled:this.isLoading},"Publish"))))}renderDeleteConfirmDialog(){return e("ap-ben-modal-section",{show:this.showDeleteConfirmDialog,showHeader:!0,modalTitle:"Delete benefit",onModalClosed:()=>{this.showDeleteConfirmDialog=!1}},e("ap-ben-confirm-dialog",{acceptText:"Delete",declineText:"Cancel",dialogStyle:"danger",onAccepted:async()=>{await this.deleteBenefitAsync(),this.showDeleteConfirmDialog=!1},onDeclined:()=>{this.showDeleteConfirmDialog=!1}},e("p",null,e("strong",null,'"',r(this.selectedBenefit).title.value,'"')," will be permanently deleted from your benefits. Are you sure you want to delete it?")))}renderCancelConfirmDialog(){return e("ap-ben-modal-section",{show:this.showCancelConfirmDialog,showHeader:!0,modalTitle:"Unsaved changes",onModalClosed:()=>{this.showCancelConfirmDialog=!1}},e("ap-ben-confirm-dialog",{acceptText:"Publish",declineText:"Discard",dialogStyle:"warning",onAccepted:async()=>{this.showCancelConfirmDialog=!1,await this.publishBenefit()},onDeclined:()=>{this.showCancelConfirmDialog=!1,this.navigateToManageBenefits()}},"add"===this.editMode?"Do you want to save your new benefit?":e("p",null,e("strong",null,'"',r(this.selectedBenefit).title.value,'"')," has been modified. Do you want to publish your changes?")))}async initialiseAsync(){this.stateSubscription.add(u.isLoading$.subscribe((t=>this.isLoading=t))),this.stateSubscription.add(u.selectedBenefit$.subscribe((t=>this.selectedBenefit=t))),this.stateSubscription.add(u.draftBenefit$.subscribe((t=>this.draftBenefit=t))),a(this.benefitId)?(this.editMode="edit",p.loadExistingBenefitForEditingAsync(this.benefitId.value)):(p.createDraftBenefit(),this.editMode="add")}navigateToManageBenefits(){p.clearDraftBenefit(),h.navigateInternally(c)}async publishBenefit(){r(this.draftBenefit).isValid?(r(this.draftBenefit).isDirty&&await p.publishDraftBenefitAsync(),this.navigateToManageBenefits()):this.isValidationDisplayed=!0}async onCancelClicked(){r(this.draftBenefit).isDirty?this.showCancelConfirmDialog=!0:this.navigateToManageBenefits()}async deleteBenefitAsync(){await p.deleteSelectedBenefitAsync(),this.navigateToManageBenefits()}},_=class{constructor(e){t(this,e),this.showDisabledBenefits=!1,this.storeSubscription=new B}componentWillLoad(){f.loadPageStateAsync(),this.storeSubscription.add(b.manageBenefitsPageState$.subscribe((t=>this.pageState=t))),this.storeSubscription.add(b.isLoading$.subscribe((t=>this.isLoading=t)))}disconnectedCallback(){this.storeSubscription.unsubscribe()}render(){return this.isLoading?e(s,{class:"w-100 text-center mt-5"},e("ap-ben-ui-container",{class:"w-100 d-none"},e("fl-loading-indicator",null))):e(s,{class:"w-100"},e("ap-ben-ui-container",{class:"w-100 d-none"},this.managedBenefitHeader(),e("div",{class:"uiid-manage-benefit-body row bg-white border-left border-right border-bottom mb-5 mx-0 rounded no-gutters"},e("div",{class:"col-12"},0===this.pageState.enabledBenefits.length?e("ap-ben-empty-benefits",{onNewBenefitButtonClicked:()=>this.addBenefit()}):this.ActiveBenefitsSection(),this.ToggleInactiveBenefitsRow(),this.showDisabledBenefits&&this.InactiveBenefitsSection()))))}ActiveBenefitsSection(){return[e("ap-ben-manage-benefits-header-row",{class:"d-none d-md-block"}),this.pageState.enabledBenefits.map((t=>e("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:t=>this.editBenefit(t.detail)})))]}ToggleInactiveBenefitsRow(){return e("div",{class:"col-12 py-3 border-top d-flex justify-content-center"},e("button",{class:"uiid-show-inactive-benefit-item btn btn-link",onClick:()=>this.onToggleInactiveBenefits()},e("h6",{class:"m-0"},this.showDisabledBenefits?`Hide inactive benefits (${this.pageState.disabledBenefits.length})`:`Show inactive (${this.pageState.disabledBenefits.length})`)))}InactiveBenefitsSection(){return 0===this.pageState.disabledBenefits.length?[e("div",{class:"row border-top py-3 px-3 d-flex align-items-center no-gutters"},e("div",{class:"col-12 my-1 d-flex justify-content-center"},e("span",{class:"text-muted"},"No inactive benefits.")))]:this.pageState.disabledBenefits.map((t=>e("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:t=>this.editBenefit(t.detail)})))}managedBenefitHeader(){return e("div",{class:"uiid-manage-benefit-header row mb-3 mt-5"},e("div",{class:"col-12 col-sm-6"},e("h3",null,"Manage Benefits")),e("div",{class:"col-12 col-sm-6 d-flex justify-content-end align-items-center"},e("fl-button",{class:"uiid-new-benefit-button",onClick:()=>this.addBenefit()},e("ap-ben-icon",{class:"mr-2",iconPrefix:"far",iconId:"plus"}),"New benefit")))}onToggleInactiveBenefits(){this.showDisabledBenefits=!this.showDisabledBenefits}addBenefit(){h.navigateInternally(l)}editBenefit(t){h.navigateInternally(`${d}/${t.id}`)}};_.style="manage-page .benefits-zero-state{height:32rem}";const A=(t,e,s)=>s(t.confirm(e)),O=(t,e)=>{const s=t[e],i="__storage_test__";try{return s.setItem(i,i),s.removeItem(i),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==s.length}},E=class{constructor(e){t(this,e),this.unsubscribe=()=>{},this.activeClass="link-active",this.exact=!1,this.strict=!0,this.custom="a",this.match=null}componentWillLoad(){this.computeMatch()}computeMatch(){this.location&&(this.match=m(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict}))}handleClick(t){var e,s,i;if(!((e=t).metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&this.history&&this.url&&this.root)return t.preventDefault(),this.history.push((i=this.root,"/"==(s=this.url).charAt(0)&&"/"==i.charAt(i.length-1)?i.slice(0,i.length-1)+s:i+s))}render(){let t={class:{[this.activeClass]:null!==this.match},onClick:this.handleClick.bind(this)};return this.anchorClass&&(t.class[this.anchorClass]=!0),"a"===this.custom&&(t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})),e(this.custom,Object.assign({},t),e("slot",null))}get el(){return i(this)}static get watchers(){return{location:["computeMatch"]}}};S.injectProps(E,["history","location","root"]);const H=t=>"STENCIL-ROUTE"===t.tagName,D=class{constructor(e){t(this,e),this.group=((1e17*Math.random()).toString().match(/.{4}/g)||[]).join("-"),this.subscribers=[],this.queue=n(this,"queue")}componentWillLoad(){null!=this.location&&this.regenerateSubscribers(this.location)}async regenerateSubscribers(t){if(null==t)return;let e=-1;if(this.subscribers=Array.prototype.slice.call(this.el.children).filter(H).map(((s,i)=>{const n=m(t.pathname,{path:s.url,exact:s.exact,strict:!0});return n&&-1===e&&(e=i),{el:s,match:n}})),-1===e)return;if(this.activeIndex===e)return void(this.subscribers[e].el.match=this.subscribers[e].match);this.activeIndex=e;const s=this.subscribers[this.activeIndex];this.scrollTopOffset&&(s.el.scrollTopOffset=this.scrollTopOffset),s.el.group=this.group,s.el.match=s.match,s.el.componentUpdated=t=>{this.queue.write((()=>{this.subscribers.forEach(((t,e)=>{if(t.el.componentUpdated=void 0,e===this.activeIndex)return t.el.style.display="";this.scrollTopOffset&&(t.el.scrollTopOffset=this.scrollTopOffset),t.el.group=this.group,t.el.match=null,t.el.style.display="none"}))})),this.routeViewsUpdated&&this.routeViewsUpdated(Object.assign({scrollTopOffset:this.scrollTopOffset},t))}}render(){return e("slot",null)}get el(){return i(this)}static get watchers(){return{location:["regenerateSubscribers"]}}};S.injectProps(D,["location","routeViewsUpdated"]);const M=(t,...e)=>{t||console.warn(...e)},L=()=>{let t,e=[];return{setPrompt:e=>(M(null==t,"A history supports only one prompt at a time"),t=e,()=>{t===e&&(t=null)}),confirmTransitionTo:(e,s,i,n)=>{if(null!=t){const o="function"==typeof t?t(e,s):t;"string"==typeof o?"function"==typeof i?i(o,n):(M(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),n(!0)):n(!1!==o)}else n(!0)},appendListener:t=>{let s=!0;const i=(...e)=>{s&&t(...e)};return e.push(i),()=>{s=!1,e=e.filter((t=>t!==i))}},notifyListeners:(...t)=>{e.forEach((e=>e(...t)))}}},U=(t,e="scrollPositions")=>{let s=new Map;const i=(e,i)=>{if(s.set(e,i),O(t,"sessionStorage")){const e=[];s.forEach(((t,s)=>{e.push([s,t])})),t.sessionStorage.setItem("scrollPositions",JSON.stringify(e))}};if(O(t,"sessionStorage")){const i=t.sessionStorage.getItem(e);s=i?new Map(JSON.parse(i)):s}return"scrollRestoration"in t.history&&(history.scrollRestoration="manual"),{set:i,get:t=>s.get(t),has:t=>s.has(t),capture:e=>{i(e,[t.scrollX,t.scrollY])}}},R={hashbang:{encodePath:t=>"!"===t.charAt(0)?t:"!/"+C(t),decodePath:t=>"!"===t.charAt(0)?t.substr(1):t},noslash:{encodePath:C,decodePath:w},slash:{encodePath:w,decodePath:w}},N=(t,e)=>{const s=0==t.pathname.indexOf(e)?"/"+t.pathname.slice(e.length):t.pathname;return Object.assign({},t,{pathname:s})},W={browser:(t,e={})=>{let s=!1;const i=t.history,n=t.location,o=t.navigator,a=(t=>{const e=t.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&t.history&&"pushState"in t.history})(t),r=!(-1===o.userAgent.indexOf("Trident")),h=U(t),c=null!=e.forceRefresh&&e.forceRefresh,l=null!=e.getUserConfirmation?e.getUserConfirmation:A,d=null!=e.keyLength?e.keyLength:6,u=e.basename?g(w(e.basename)):"",p=()=>{try{return t.history.state||{}}catch(t){return{}}},f=t=>{t=t||{};const{key:e,state:s}=t,{pathname:i,search:o,hash:a}=n;let r=i+o+a;return M(!u||k(r,u),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+r+'" to begin with "'+u+'".'),u&&(r=P(r,u)),y(r,s,e||v(d))},b=L(),m=t=>{h.capture(N.location.key),Object.assign(N,t),N.location.scrollPosition=h.get(N.location.key),N.length=i.length,b.notifyListeners(N.location,N.action)},C=t=>{((t,e)=>void 0===e.state&&-1===t.userAgent.indexOf("CriOS"))(o,t)||B(f(t.state))},x=()=>{B(f(p()))},B=t=>{if(s)s=!1,m();else{const e="POP";b.confirmTransitionTo(t,e,l,(s=>{s?m({action:e,location:t}):S(t)}))}},S=t=>{let e=_.indexOf(N.location.key),i=_.indexOf(t.key);-1===e&&(e=0),-1===i&&(i=0);const n=e-i;n&&(s=!0,D(n))},T=f(p());let _=[T.key],O=0,E=!1;const H=t=>u+j(t),D=t=>{i.go(t)},R=e=>{O+=e,1===O?(t.addEventListener("popstate",C),r&&t.addEventListener("hashchange",x)):0===O&&(t.removeEventListener("popstate",C),r&&t.removeEventListener("hashchange",x))},N={length:i.length,action:"POP",location:T,createHref:H,push:(t,e)=>{M(!("object"==typeof t&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");const s="PUSH",o=y(t,e,v(d),N.location);b.confirmTransitionTo(o,s,l,(t=>{if(!t)return;const e=H(o),{key:r,state:h}=o;if(a)if(i.pushState({key:r,state:h},"",e),c)n.href=e;else{const t=_.indexOf(N.location.key),e=_.slice(0,-1===t?0:t+1);e.push(o.key),_=e,m({action:s,location:o})}else M(void 0===h,"Browser history cannot push state in browsers that do not support HTML5 history"),n.href=e}))},replace:(t,e)=>{M(!("object"==typeof t&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");const s="REPLACE",o=y(t,e,v(d),N.location);b.confirmTransitionTo(o,s,l,(t=>{if(!t)return;const e=H(o),{key:r,state:h}=o;if(a)if(i.replaceState({key:r,state:h},"",e),c)n.replace(e);else{const t=_.indexOf(N.location.key);-1!==t&&(_[t]=o.key),m({action:s,location:o})}else M(void 0===h,"Browser history cannot replace state in browsers that do not support HTML5 history"),n.replace(e)}))},go:D,goBack:()=>D(-1),goForward:()=>D(1),block:(t="")=>{const e=b.setPrompt(t);return E||(R(1),E=!0),()=>(E&&(E=!1,R(-1)),e())},listen:t=>{const e=b.appendListener(t);return R(1),()=>{R(-1),e()}},win:t};return N},hash:(t,e={})=>{let s=!1,i=null,n=0,o=!1;const a=t.location,r=t.history,h=-1===t.navigator.userAgent.indexOf("Firefox"),c=null!=e.keyLength?e.keyLength:6,{getUserConfirmation:l=A,hashType:d="slash"}=e,u=e.basename?g(w(e.basename)):"",{encodePath:p,decodePath:f}=R[d],b=()=>{const t=a.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},m=t=>{const e=a.href.indexOf("#");a.replace(a.href.slice(0,e>=0?e:0)+"#"+t)},C=()=>{let t=f(b());return M(!u||k(t,u),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+u+'".'),u&&(t=P(t,u)),y(t,void 0,v(c))},B=L(),S=t=>{Object.assign(I,t),I.length=r.length,B.notifyListeners(I.location,I.action)},T=()=>{const t=b(),e=p(t);if(t!==e)m(e);else{const t=C(),e=I.location;if(!s&&x(e,t))return;if(i===j(t))return;i=null,_(t)}},_=t=>{if(s)s=!1,S();else{const e="POP";B.confirmTransitionTo(t,e,l,(s=>{s?S({action:e,location:t}):O(t)}))}},O=t=>{let e=U.lastIndexOf(j(I.location)),i=U.lastIndexOf(j(t));-1===e&&(e=0),-1===i&&(i=0);const n=e-i;n&&(s=!0,N(n))},E=b(),H=p(E);E!==H&&m(H);const D=C();let U=[j(D)];const N=t=>{M(h,"Hash history go(n) causes a full page reload in this browser"),r.go(t)},W=(t,e)=>{n+=e,1===n?t.addEventListener("hashchange",T):0===n&&t.removeEventListener("hashchange",T)},I={length:r.length,action:"POP",location:D,createHref:t=>"#"+p(u+j(t)),push:(t,e)=>{M(void 0===e,"Hash history cannot push state; it is ignored");const s="PUSH",n=y(t,void 0,v(c),I.location);B.confirmTransitionTo(n,s,l,(t=>{if(!t)return;const e=j(n),o=p(u+e);if(b()!==o){i=e,(t=>{a.hash=t})(o);const t=U.lastIndexOf(j(I.location)),r=U.slice(0,-1===t?0:t+1);r.push(e),U=r,S({action:s,location:n})}else M(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),S()}))},replace:(t,e)=>{M(void 0===e,"Hash history cannot replace state; it is ignored");const s="REPLACE",n=y(t,void 0,v(c),I.location);B.confirmTransitionTo(n,s,l,(t=>{if(!t)return;const e=j(n),o=p(u+e);b()!==o&&(i=e,m(o));const a=U.indexOf(j(I.location));-1!==a&&(U[a]=e),S({action:s,location:n})}))},go:N,goBack:()=>N(-1),goForward:()=>N(1),block:(e="")=>{const s=B.setPrompt(e);return o||(W(t,1),o=!0),()=>(o&&(o=!1,W(t,-1)),s())},listen:e=>{const s=B.appendListener(e);return W(t,1),()=>{W(t,-1),s()}},win:t};return I}},I=class{constructor(e){t(this,e),this.root="/",this.historyType="browser",this.titleSuffix="",this.routeViewsUpdated=(t={})=>{if(this.history&&t.scrollToId&&"browser"===this.historyType){const e=this.history.win.document.getElementById(t.scrollToId);if(e)return e.scrollIntoView()}this.scrollTo(t.scrollTopOffset||this.scrollTopOffset)},this.isServer=n(this,"isServer"),this.queue=n(this,"queue")}componentWillLoad(){this.history=W[this.historyType](this.el.ownerDocument.defaultView),this.history.listen((t=>{t=N(t,this.root),this.location=t})),this.location=N(this.history.location,this.root)}scrollTo(t){const e=this.history;if(null!=t&&!this.isServer&&e)return"POP"===e.action&&Array.isArray(e.location.scrollPosition)?this.queue.write((()=>{e&&e.location&&Array.isArray(e.location.scrollPosition)&&e.win.scrollTo(e.location.scrollPosition[0],e.location.scrollPosition[1])})):this.queue.write((()=>{e.win.scrollTo(0,t)}))}render(){if(this.location&&this.history)return e(S.Provider,{state:{historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated}},e("slot",null))}get el(){return i(this)}};export{T as ap_ben_edit_benefit_page,_ as ap_ben_manage_page,E as stencil_route_link,D as stencil_route_switch,I as stencil_router}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,n,i as r,f as e}from"./p-2c9dd7c4.js";import{g as i}from"./p-7ad92407.js";import{S as o,a as u}from"./p-f3effa5d.js";const f=new class{async getUserProfile(){return await ct.instance.url("users/self").get().json()}async getBasicProfileByEmail(n){const r=await ct.instance.url(`users?email=${n}`).get().notFound((()=>null)).json();return t(r)}};class c{static toDomain(t){return{basicProfile:t.basicProfile,benefitsProfile:t.benefitsProfile}}}function a(t){for(var n=arguments.length,r=Array(n>1?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function s(t){return!!t&&!!t[J]}function l(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var n=Object.getPrototypeOf(t);if(null===n)return!0;var r=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Q}(t)||Array.isArray(t)||!!t[H]||!!t.constructor[H]||p(t)||h(t))}function v(t,n,r){void 0===r&&(r=!1),0===d(t)?(r?Object.keys:V)(t).forEach((function(e){r&&"symbol"==typeof e||n(e,t[e],t)})):t.forEach((function(r,e){return n(e,r,t)}))}function d(t){var n=t[J];return n?n.i>3?n.i-4:n.i:Array.isArray(t)?1:p(t)?2:h(t)?3:0}function y(t,n){return 2===d(t)?t.has(n):Object.prototype.hasOwnProperty.call(t,n)}function b(t,n,r){var e=d(t);2===e?t.set(n,r):3===e?(t.delete(n),t.add(r)):t[n]=r}function p(t){return L&&t instanceof Map}function h(t){return W&&t instanceof Set}function m(t){return t.o||t.t}function j(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=Y(t);delete n[J];for(var r=V(n),e=0;e<r.length;e++){var i=r[e],o=n[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),n)}function O(t,n){return void 0===n&&(n=!1),w(t)||s(t)||!l(t)||(d(t)>1&&(t.set=t.add=t.clear=t.delete=P),Object.freeze(t),n&&v(t,(function(t,n){return O(n,!0)}),!0)),t}function P(){a(2)}function w(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function g(t){var n=Z[t];return n||a(18,t),n}function S(){return T}function A(t,n){n&&(g("Patches"),t.u=[],t.s=[],t.v=n)}function I(t){R(t),t.p.forEach(D),t.p=null}function R(t){t===T&&(T=t.l)}function E(t){return T={p:[],l:T,h:t,m:!0,_:0}}function D(t){var n=t[J];0===n.i||1===n.i?n.j():n.O=!0}function _(t,n){n._=n.p.length;var r=n.p[0],e=void 0!==t&&t!==r;return n.h.g||g("ES5").S(n,t,e),e?(r[J].P&&(I(n),a(4)),l(t)&&(t=x(n,t),n.l||B(n,t)),n.u&&g("Patches").M(r[J],t,n.u,n.s)):t=x(n,r,[]),I(n),n.u&&n.v(n.u,n.s),t!==G?t:void 0}function x(t,n,r){if(w(n))return n;var e=n[J];if(!e)return v(n,(function(i,o){return M(t,e,n,i,o,r)}),!0),n;if(e.A!==t)return n;if(!e.P)return B(t,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var i=4===e.i||5===e.i?e.o=j(e.k):e.o;v(3===e.i?new Set(i):i,(function(n,o){return M(t,e,i,n,o,r)})),B(t,i,!1),r&&t.u&&g("Patches").R(e,r,t.u,t.s)}return e.o}function M(t,n,r,e,i,o){if(s(i)){var u=x(t,i,o&&n&&3!==n.i&&!y(n.D,e)?o.concat(e):void 0);if(b(r,e,u),!s(u))return;t.m=!1}if(l(i)&&!w(i)){if(!t.h.F&&t._<1)return;x(t,i),n&&n.A.l||B(t,i)}}function B(t,n,r){void 0===r&&(r=!1),t.h.F&&t.m&&O(n,r)}function F(t,n){var r=t[J];return(r?m(r):t)[n]}function U(t,n){if(n in t)for(var r=Object.getPrototypeOf(t);r;){var e=Object.getOwnPropertyDescriptor(r,n);if(e)return e;r=Object.getPrototypeOf(r)}}function X(t){t.P||(t.P=!0,t.l&&X(t.l))}function $(t){t.o||(t.o=j(t.t))}function C(t,n,r){var e=p(n)?g("MapSet").N(n,r):h(n)?g("MapSet").T(n,r):t.g?function(t,n){var r=Array.isArray(t),e={i:r?1:0,A:n?n.A:S(),P:!1,I:!1,D:{},l:n,t,k:null,o:null,j:null,C:!1},i=e,o=tt;r&&(i=[e],o=nt);var u=Proxy.revocable(i,o),f=u.revoke,c=u.proxy;return e.k=c,e.j=f,c}(n,r):g("ES5").J(n,r);return(r?r.A:S()).p.push(e),e}function k(t){return s(t)||a(22,t),function t(n){if(!l(n))return n;var r,e=n[J],i=d(n);if(e){if(!e.P&&(e.i<4||!g("ES5").K(e)))return e.t;e.I=!0,r=K(n,i),e.I=!1}else r=K(n,i);return v(r,(function(n,i){e&&function(t,n){return 2===d(t)?t.get(n):t[n]}(e.t,n)===i||b(r,n,t(i))})),3===i?new Set(r):r}(t)}function K(t,n){switch(n){case 2:return new Map(t);case 3:return Array.from(t)}return j(t)}var N,T,z="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),L="undefined"!=typeof Map,W="undefined"!=typeof Set,q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,G=z?Symbol.for("immer-nothing"):((N={})["immer-nothing"]=!0,N),H=z?Symbol.for("immer-draftable"):"__$immer_draftable",J=z?Symbol.for("immer-state"):"__$immer_state",Q=""+Object.prototype.constructor,V="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Y=Object.getOwnPropertyDescriptors||function(t){var n={};return V(t).forEach((function(r){n[r]=Object.getOwnPropertyDescriptor(t,r)})),n},Z={},tt={get:function(t,n){if(n===J)return t;var r=m(t);if(!y(r,n))return function(t,n,r){var e,i=U(n,r);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(t.k):void 0}(t,r,n);var e=r[n];return t.I||!l(e)?e:e===F(t.t,n)?($(t),t.o[n]=C(t.A.h,e,t)):e},has:function(t,n){return n in m(t)},ownKeys:function(t){return Reflect.ownKeys(m(t))},set:function(t,n,r){var e=U(m(t),n);if(null==e?void 0:e.set)return e.set.call(t.k,r),!0;if(!t.P){var i=F(m(t),n),o=null==i?void 0:i[J];if(o&&o.t===r)return t.o[n]=r,t.D[n]=!1,!0;if(function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}(r,i)&&(void 0!==r||y(t.t,n)))return!0;$(t),X(t)}return t.o[n]===r&&"number"!=typeof r&&(void 0!==r||n in t.o)||(t.o[n]=r,t.D[n]=!0,!0)},deleteProperty:function(t,n){return void 0!==F(t.t,n)||n in t.t?(t.D[n]=!1,$(t),X(t)):delete t.D[n],t.o&&delete t.o[n],!0},getOwnPropertyDescriptor:function(t,n){var r=m(t),e=Reflect.getOwnPropertyDescriptor(r,n);return e?{writable:!0,configurable:1!==t.i||"length"!==n,enumerable:e.enumerable,value:r[n]}:e},defineProperty:function(){a(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){a(12)}},nt={};v(tt,(function(t,n){nt[t]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}})),nt.deleteProperty=function(t,n){return tt.deleteProperty.call(this,t[0],n)},nt.set=function(t,n,r){return tt.set.call(this,t[0],n,r,t[0])};var rt=new(function(){function t(t){var n=this;this.g=q,this.F=!0,this.produce=function(t,r,e){if("function"==typeof t&&"function"!=typeof r){var i=r;r=t;var o=n;return function(t){var n=this;void 0===t&&(t=i);for(var e=arguments.length,u=Array(e>1?e-1:0),f=1;f<e;f++)u[f-1]=arguments[f];return o.produce(t,(function(t){var e;return(e=r).call.apply(e,[n,t].concat(u))}))}}var u;if("function"!=typeof r&&a(6),void 0!==e&&"function"!=typeof e&&a(7),l(t)){var f=E(n),c=C(n,t,void 0),s=!0;try{u=r(c),s=!1}finally{s?I(f):R(f)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return A(f,e),_(t,f)}),(function(t){throw I(f),t})):(A(f,e),_(u,f))}if(!t||"object"!=typeof t){if((u=r(t))===G)return;return void 0===u&&(u=t),n.F&&O(u,!0),u}a(21,t)},this.produceWithPatches=function(t,r){return"function"==typeof t?function(r){for(var e=arguments.length,i=Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return n.produceWithPatches(r,(function(n){return t.apply(void 0,[n].concat(i))}))}:[n.produce(t,r,(function(t,n){e=t,i=n})),e,i];var e,i},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var n=t.prototype;return n.createDraft=function(t){l(t)||a(8),s(t)&&(t=k(t));var n=E(this),r=C(this,t,void 0);return r[J].C=!0,R(n),r},n.finishDraft=function(t,n){var r=(t&&t[J]).A;return A(r,n),_(void 0,r)},n.setAutoFreeze=function(t){this.F=t},n.setUseProxies=function(t){t&&!q&&a(20),this.g=t},n.applyPatches=function(t,n){var r;for(r=n.length-1;r>=0;r--){var e=n[r];if(0===e.path.length&&"replace"===e.op){t=e.value;break}}var i=g("Patches").$;return s(t)?i(t,n):this.produce(t,(function(t){return i(t,n.slice(r+1))}))},t}()),et=rt.produce;rt.produceWithPatches.bind(rt),rt.setAutoFreeze.bind(rt),rt.setUseProxies.bind(rt),rt.applyPatches.bind(rt),rt.createDraft.bind(rt),rt.finishDraft.bind(rt);let it=class extends u{constructor(){super({user:n})}};it=function(t,n,r,e){var i,o=arguments.length,u=o<3?n:null===e?e=Object.getOwnPropertyDescriptor(n,r):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,e);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(u=(o<3?i(u):o>3?i(n,r,u):i(n,r))||u);return o>3&&u&&Object.defineProperty(n,r,u),u}([o({name:"benefits-app",resettable:!0,producerFn:et})],it);const ot=new it;class ut{static set profileId(n){this._profileId=t(n)}static get profileId(){if(r(this._profileId))throw Error("ProfileId is missing.");return this._profileId.value}static set accountId(n){this._accountId=t(n)}static get accountIdOrDefault(){return i(this._accountId,"")}async loadSignedInUserProfileAsync(){const n=c.toDomain(await f.getUserProfile());ut.accountId=n.basicProfile.accountId,ot.update((r=>{r.user=t(n)}))}static get partnerIdOrDefault(){return i(this._partnerId,"")}}ut._profileId=n,ut._accountId=n,ut._partnerId=n;const ft=new ut;class ct{static setParameters(t,n){this._apiBaseUrl=t,this._jwt=n}static get instance(){return e(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-PROFILE-ID":ut.profileId,"X-ACCOUNT-ID":ut.accountIdOrDefault,"X-PARTNER-ID":ut.partnerIdOrDefault})}}export{ct as B,c as U,ut as a,ft as b,ot as c,et as f,f as u}
|