@meetelise/chat 1.42.3 → 1.42.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.42.3",
3
+ "version": "1.42.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
@@ -3288,7 +3288,7 @@ xmlns="http://www.w3.org/2000/svg"
3288
3288
  margin: 2px 0;
3289
3289
  }
3290
3290
  }
3291
- `;class Vo{constructor(e={}){var t,i,n,o,r;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(i=e.description)&&void 0!==i?i:"",this.rent=null!==(n=e.rent)&&void 0!==n?n:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(r=e.available)&&void 0!==r&&r,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Yo{constructor(e={}){var t,i,n,o,r;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.minAvailableItem=e.minAvailableItem?new Vo(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Vo(e.maxAvailableItem):void 0,this.allItems=(null!==(n=e.allItems)&&void 0!==n?n:[]).map((e=>new Vo(e))),this.rent=null!==(o=e.rent)&&void 0!==o?o:0,this.priceDescription=null!==(r=e.priceDescription)&&void 0!==r?r:""}get displayName(){return this.description}get itemDescription(){return 0===this.allItems.length?"":this.allItems[0].description}}class Ko{constructor(e=[]){this.quantities=e}toKey(){return this.quantities.sort(((e,t)=>e.itemType.localeCompare(t.itemType))).map((e=>`${e.itemType}:${e.quantity}`)).join(",")}}class Xo{constructor(e={}){var t;this.rules=new Map,(null!==(t=e.pricingRules)&&void 0!==t?t:[]).forEach((e=>this.addRule(e)))}addRule(e){const t=e.combination.toKey();this.rules.set(t,e)}getPrice(e){const t=e.toKey(),i=this.rules.get(t);return null==i?void 0:i.price}toRuleArray(){return Array.from(this.rules.values())}toJSON(){return{pricingRules:this.toRuleArray()}}static fromJSON(e){var t;return new Xo({pricingRules:null===(t=e.pricingRules)||void 0===t?void 0:t.map((e=>({...e,combination:new Ko(e.combination.quantities)})))})}}var Zo;!function(e){e.OneTime="One Time",e.Monthly="Monthly",e.Quarterly="Quarterly",e.Annually="Annually",e.PerOccurrence="Per Occurrence"}(Zo||(Zo={}));class Jo{constructor(e={}){var t,i,n,o,r,a,s,l,u,c;this.category="Other",this.syncActive=!0,this.refundable=!1,this.publicFacing=!0,this.id=e.id,this.buildingId=null!==(t=e.buildingId)&&void 0!==t?t:0,this.feeName=null!==(i=e.feeName)&&void 0!==i?i:"",this.description=e.description,this.category=null!==(n=e.category)&&void 0!==n?n:"Other",this.unitIds=e.unitIds,this.layoutIds=e.layoutIds,this.startDate=e.startDate,this.endDate=e.endDate,this.source=e.source,this.externalKey=e.externalKey,this.syncActive=null===(o=e.syncActive)||void 0===o||o,this.hiddenReason=e.hiddenReason,this.refundable=null!==(r=e.refundable)&&void 0!==r&&r,this.bundleKey=e.bundleKey,this.publicFacing=null===(a=e.publicFacing)||void 0===a||a,this.chargeCode=e.chargeCode,this.prorated=e.prorated,this.pricingCategory=null!==(s=e.pricingCategory)&&void 0!==s?s:"mandatory",this.pricingType=null!==(l=e.pricingType)&&void 0!==l?l:"fixed",this.frequency=null!==(u=e.frequency)&&void 0!==u?u:Zo.OneTime,this.nlpPricing=e.nlpPricing,this.isAddon=null!==(c=e.isAddon)&&void 0!==c&&c,void 0!==e.amount&&(this.amount=e.amount),void 0!==e.percentRent&&(this.percentRent=e.percentRent),void 0!==e.unitLabel&&(this.unitLabel=e.unitLabel),void 0!==e.minAmount&&(this.minAmount=e.minAmount),void 0!==e.maxAmount&&(this.maxAmount=e.maxAmount);const d=e.customMatrixData;var h;d instanceof Xo?this.customMatrixData=d:(h=d)&&"object"==typeof h&&"pricingRules"in h&&Array.isArray(h.pricingRules)&&(this.customMatrixData=Xo.fromJSON(d))}get isOptional(){return"situational"===this.pricingCategory}get hasMatrix(){return!("custom"!==this.pricingType||!this.customMatrixData)}}const er=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach((t=>{t&&this.params.append(`${e}[]`,t)})),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},tr=e=>new Jo(e),ir=e=>new Yo(e),nr=async(e,i)=>{try{const n=(new er).addArray("layout_ids",null==i?void 0:i.map((e=>e.toString()))),o=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/fees?${n.build()}`);if(o.data){const e=mi(o.data);return{fees:e.fees.map(tr),rentableItems:e.rentableItems.map(ir),buildingIncentives:e.buildingIncentives}}}catch(t){kn({logType:Sn.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t}})}return{fees:[],rentableItems:[],buildingIncentives:[]}},or=-1,rr=(e="black")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
3291
+ `;class Vo{constructor(e={}){var t,i,n,o,r;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(i=e.description)&&void 0!==i?i:"",this.rent=null!==(n=e.rent)&&void 0!==n?n:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(r=e.available)&&void 0!==r&&r,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Yo{constructor(e={}){var t,i,n,o,r;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.minAvailableItem=e.minAvailableItem?new Vo(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Vo(e.maxAvailableItem):void 0,this.allItems=(null!==(n=e.allItems)&&void 0!==n?n:[]).map((e=>new Vo(e))),this.rent=null!==(o=e.rent)&&void 0!==o?o:0,this.priceDescription=null!==(r=e.priceDescription)&&void 0!==r?r:""}get displayName(){return this.description}get itemDescription(){return 0===this.allItems.length?"":this.allItems[0].description}}class Ko{constructor(e=[]){this.quantities=e}toKey(){return this.quantities.sort(((e,t)=>e.itemType.localeCompare(t.itemType))).map((e=>`${e.itemType}:${e.quantity}`)).join(",")}}class Xo{constructor(e={}){var t;this.rules=new Map,(null!==(t=e.pricingRules)&&void 0!==t?t:[]).forEach((e=>this.addRule(e)))}addRule(e){const t=e.combination.toKey();this.rules.set(t,e)}getPrice(e){const t=e.toKey(),i=this.rules.get(t);return null==i?void 0:i.price}toRuleArray(){return Array.from(this.rules.values())}toJSON(){return{pricingRules:this.toRuleArray()}}static fromJSON(e){var t;return new Xo({pricingRules:null===(t=e.pricingRules)||void 0===t?void 0:t.map((e=>({...e,combination:new Ko(e.combination.quantities)})))})}}var Zo;!function(e){e.OneTime="One Time",e.Monthly="Monthly",e.Quarterly="Quarterly",e.Annually="Annually",e.PerOccurrence="Per Occurrence"}(Zo||(Zo={}));class Jo{constructor(e={}){var t,i,n,o,r,a,s,l,u,c;this.category="Other",this.syncActive=!0,this.refundable=!1,this.publicFacing=!0,this.id=e.id,this.buildingId=null!==(t=e.buildingId)&&void 0!==t?t:0,this.feeName=null!==(i=e.feeName)&&void 0!==i?i:"",this.description=e.description,this.category=null!==(n=e.category)&&void 0!==n?n:"Other",this.unitIds=e.unitIds,this.layoutIds=e.layoutIds,this.startDate=e.startDate,this.endDate=e.endDate,this.source=e.source,this.externalKey=e.externalKey,this.syncActive=null===(o=e.syncActive)||void 0===o||o,this.hiddenReason=e.hiddenReason,this.refundable=null!==(r=e.refundable)&&void 0!==r&&r,this.bundleKey=e.bundleKey,this.publicFacing=null===(a=e.publicFacing)||void 0===a||a,this.chargeCode=e.chargeCode,this.prorated=e.prorated,this.pricingCategory=null!==(s=e.pricingCategory)&&void 0!==s?s:"mandatory",this.pricingType=null!==(l=e.pricingType)&&void 0!==l?l:"fixed",this.frequency=null!==(u=e.frequency)&&void 0!==u?u:Zo.OneTime,this.nlpPricing=e.nlpPricing,this.isAddon=null!==(c=e.isAddon)&&void 0!==c&&c,void 0!==e.amount&&(this.amount=e.amount),void 0!==e.percentRent&&(this.percentRent=e.percentRent),void 0!==e.unitLabel&&(this.unitLabel=e.unitLabel),void 0!==e.minAmount&&(this.minAmount=e.minAmount),void 0!==e.maxAmount&&(this.maxAmount=e.maxAmount);const d=e.customMatrixData;var h;d instanceof Xo?this.customMatrixData=d:(h=d)&&"object"==typeof h&&"pricingRules"in h&&Array.isArray(h.pricingRules)&&(this.customMatrixData=Xo.fromJSON(d))}get isOptional(){return"situational"===this.pricingCategory}get hasMatrix(){return!!this.customMatrixData}}const er=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach((t=>{t&&this.params.append(`${e}[]`,t)})),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},tr=e=>new Jo(e),ir=e=>new Yo(e),nr=async(e,i)=>{try{const n=(new er).addArray("layout_ids",null==i?void 0:i.map((e=>e.toString()))),o=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/fees?${n.build()}`);if(o.data){const e=mi(o.data);return{fees:e.fees.map(tr),rentableItems:e.rentableItems.map(ir),buildingIncentives:e.buildingIncentives}}}catch(t){kn({logType:Sn.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t}})}return{fees:[],rentableItems:[],buildingIncentives:[]}},or=-1,rr=(e="black")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
3292
3292
  <line x1="1.70782" y1="13.2254" x2="13.2376" y2="1.69554" stroke="${e}" stroke-width="2.13401"/>
3293
3293
  <path d="M2.00929 1.99996L13.3328 13.3421" stroke="${e}" stroke-width="2.13401"/>
3294
3294
  </svg>`,ar=({color:e="#347FF7",size:t=24}={})=>B`
@@ -4308,14 +4308,14 @@ xmlns="http://www.w3.org/2000/svg"
4308
4308
  font-style: italic;
4309
4309
  cursor: not-allowed;
4310
4310
  }
4311
- `;var Br=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let jr=class extends oe{constructor(){super(...arguments),this._feeItem=null,this.onQuantityChange=null,this.disabled=!1,this.quantities={},this._availableTypes=[]}set feeItem(e){var t,i;const n=this._feeItem,o=null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null,r=null!==(i=null==e?void 0:e.id)&&void 0!==i?i:null;this._feeItem=e,r!==o&&(this.quantities={},this._availableTypes=this.getAvailableTypes()),this.requestUpdate("feeItem",n)}get feeItem(){return this._feeItem}get matrixRules(){var e,t,i;return null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.customMatrixData)||void 0===t?void 0:t.toRuleArray())&&void 0!==i?i:[]}getAvailableTypes(){const e=new Set;return this.matrixRules.forEach((t=>{t.combination.quantities.forEach((t=>e.add(t.itemType)))})),Array.from(e).sort()}get itemTypes(){return this._availableTypes}getMaxQuantityForType(e){let t=0;return this.matrixRules.forEach((i=>{const n=i.combination.quantities.find((t=>t.itemType===e));n&&(t=Math.max(t,n.quantity))})),t}isValidCombination(e,t){const i={...this.quantities,[e]:t};return this.matrixRules.filter((t=>t.combination.quantities.some((t=>t.itemType===e)))).some((e=>{const t=new Map(e.combination.quantities.map((e=>[e.itemType,e.quantity])));return Array.from(t.entries()).every((([e,t])=>{var n;return(null!==(n=i[e])&&void 0!==n?n:0)===t}))}))}handleIncrement(e){var t;if(this.disabled)return;const i=(null!==(t=this.quantities[e])&&void 0!==t?t:0)+1;if(i>this.getMaxQuantityForType(e))return;if(!this.isValidCombination(e,i))return;const n={...this.quantities};n[e]=i,this.quantities=n,this.notifyQuantityChange()}handleDecrement(e){var t;if(this.disabled)return;const i=null!==(t=this.quantities[e])&&void 0!==t?t:0;if(i<=0)return;const n=i-1;if(!this.isValidCombination(e,n))return;const o={...this.quantities};o[e]=n,this.quantities=o,this.notifyQuantityChange()}notifyQuantityChange(){var e;if(!this.onQuantityChange||!this.feeItem)return;const t=this.itemTypes.map((e=>{var t;return{itemType:e,quantity:null!==(t=this.quantities[e])&&void 0!==t?t:0}}));this.onQuantityChange({id:null!==(e=this.feeItem.id)&&void 0!==e?e:0,quantities:t})}formatItemType(e){return e.split(/[_-]/).map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")}renderItemType(e){var t;const i=null!==(t=this.quantities[e])&&void 0!==t?t:0,n=this.getMaxQuantityForType(e),o=this.isValidCombination(e,i+1)&&i<n,r=this.formatItemType(e);return R`
4311
+ `;var Br=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let jr=class extends oe{constructor(){super(...arguments),this._feeItem=null,this.onQuantityChange=null,this.disabled=!1,this.quantities={},this._availableTypes=[]}set feeItem(e){var t,i;const n=this._feeItem,o=null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null,r=null!==(i=null==e?void 0:e.id)&&void 0!==i?i:null;this._feeItem=e,r!==o&&(this.quantities={},this._availableTypes=this.getAvailableTypes()),this.requestUpdate("feeItem",n)}get feeItem(){return this._feeItem}get matrixRules(){var e,t,i;return null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.customMatrixData)||void 0===t?void 0:t.toRuleArray())&&void 0!==i?i:[]}getAvailableTypes(){const e=new Set;return this.matrixRules.forEach((t=>{t.combination.quantities.forEach((t=>e.add(t.itemType)))})),Array.from(e).sort()}get itemTypes(){return this._availableTypes}getMaxQuantityForType(e){let t=0;return this.matrixRules.forEach((i=>{const n=i.combination.quantities.find((t=>t.itemType===e));n&&(t=Math.max(t,n.quantity))})),t}isValidCombination(e,t){const i={...this.quantities,[e]:t};return this.matrixRules.filter((t=>t.combination.quantities.some((t=>t.itemType===e)))).some((e=>{const t=new Map(e.combination.quantities.map((e=>[e.itemType,e.quantity])));return Array.from(t.entries()).every((([e,t])=>{var n;return(null!==(n=i[e])&&void 0!==n?n:0)===t}))}))}handleIncrement(e){var t;if(this.disabled)return;const i=(null!==(t=this.quantities[e])&&void 0!==t?t:0)+1;if(i>this.getMaxQuantityForType(e))return;if(!this.isValidCombination(e,i))return;const n={...this.quantities};n[e]=i,this.quantities=n,this.notifyQuantityChange()}handleDecrement(e){var t;if(this.disabled)return;const i=null!==(t=this.quantities[e])&&void 0!==t?t:0;if(i<=0)return;const n=i-1;if(!this.isValidCombination(e,n))return;const o={...this.quantities};o[e]=n,this.quantities=o,this.notifyQuantityChange()}notifyQuantityChange(){var e;if(!this.onQuantityChange||!this.feeItem)return;const t=this.itemTypes.map((e=>{var t;return{itemType:e,quantity:null!==(t=this.quantities[e])&&void 0!==t?t:0}}));this.onQuantityChange({id:null!==(e=this.feeItem.id)&&void 0!==e?e:0,quantities:t})}formatItemType(e){return e.split(/[_-]/).map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")}renderItemType(e,t){var i;const n=null!==(i=this.quantities[e])&&void 0!==i?i:0,o=this.getMaxQuantityForType(e),r=this.isValidCombination(e,n+1)&&n<o,a=this.formatItemType(e);return R`
4312
4312
  <div class="item-type-row">
4313
- <div class="item-label">${r}:</div>
4313
+ ${t?R`<div></div>`:R`<div class="item-label">${a}:</div>`}
4314
4314
  <div class="quantity-control ${this.disabled?"unavailable":""}">
4315
4315
  <button
4316
4316
  class="quantity-button"
4317
4317
  @click=${()=>this.handleDecrement(e)}
4318
- ?disabled=${this.disabled||i<=0}
4318
+ ?disabled=${this.disabled||n<=0}
4319
4319
  aria-label="Decrease ${e} quantity"
4320
4320
  >
4321
4321
  <span class="operator-sign">&minus;</span>
@@ -4323,23 +4323,23 @@ xmlns="http://www.w3.org/2000/svg"
4323
4323
  <span
4324
4324
  class="quantity-value ${this.disabled?"unavailable-text":""}"
4325
4325
  >
4326
- ${i}
4326
+ ${n}
4327
4327
  </span>
4328
4328
  <button
4329
4329
  class="quantity-button"
4330
4330
  @click=${()=>this.handleIncrement(e)}
4331
- ?disabled=${this.disabled||!o}
4331
+ ?disabled=${this.disabled||!r}
4332
4332
  aria-label="Increase ${e} quantity"
4333
4333
  >
4334
4334
  <span class="operator-sign">+</span>
4335
4335
  </button>
4336
4336
  </div>
4337
4337
  </div>
4338
- `}render(){if(!this.feeItem||!this.matrixRules.length)return R``;const e=this.itemTypes;return e.length?R`
4338
+ `}render(){if(!this.feeItem||!this.matrixRules.length)return R``;const e=this.itemTypes;if(!e.length)return R``;const t=1===e.length;return R`
4339
4339
  <div class="matrix-container">
4340
- ${e.map((e=>this.renderItemType(e)))}
4340
+ ${e.map((e=>this.renderItemType(e,t)))}
4341
4341
  </div>
4342
- `:R``}};jr.styles=Rr,Br([le({type:Object})],jr.prototype,"feeItem",null),Br([le()],jr.prototype,"onQuantityChange",void 0),Br([le({type:Boolean,reflect:!0})],jr.prototype,"disabled",void 0),Br([ue()],jr.prototype,"quantities",void 0),jr=Br([ae("table-matrix-qty-selector")],jr);var Hr=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Fr=class extends oe{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemSelect=null,this.quantities=new Map,this.handleAddonQuantityChange=e=>{var t;const i=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(i))?this.quantities.set(i,e.quantities):this.quantities.set(i,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,i,n;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const o=this.addons.find((t=>!(t instanceof Jo)&&t.type===e.type)),r=null===(i=null===(t=null==o?void 0:o.allItems)||void 0===t?void 0:t.find((e=>e.available)))||void 0===i?void 0:i.id;r&&(null===(n=this.onRentableItemSelect)||void 0===n||n.call(this,{id:r,type:e.type}))}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}initializeQuantities(){const e=new Map;this.addons.forEach((t=>{var i,n,o,r,a,s,l;if(!(t instanceof Jo))return void e.set(t.type,0);if(!t.hasMatrix)return void e.set(null!==(i=t.unitLabel)&&void 0!==i?i:0,0);const u=null!==(s=null===(a=null===(r=null===(o=null===(n=t.customMatrixData)||void 0===n?void 0:n.toRuleArray())||void 0===o?void 0:o[0])||void 0===r?void 0:r.combination)||void 0===a?void 0:a.quantities.map((e=>({...e,quantity:0}))))&&void 0!==s?s:[];e.set(null!==(l=t.id)&&void 0!==l?l:0,u.length>0?u:[{itemType:"default",quantity:0}])})),this.quantities=e}getName(e){return e instanceof Jo?e.feeName:e.displayName}getSortedAddons(){return[...this.addons].sort(((e,t)=>{const i=this.getName(e),n=this.getName(t);return i.localeCompare(n)}))}isRentableItemAvailable(e){var t,i;return e instanceof Jo||(null!==(i=null===(t=e.allItems)||void 0===t?void 0:t.filter((e=>e.available)).length)&&void 0!==i?i:0)>0}renderQtySelector(e){return e instanceof Jo?e.hasMatrix?R`
4342
+ `}};jr.styles=Rr,Br([le({type:Object})],jr.prototype,"feeItem",null),Br([le()],jr.prototype,"onQuantityChange",void 0),Br([le({type:Boolean,reflect:!0})],jr.prototype,"disabled",void 0),Br([ue()],jr.prototype,"quantities",void 0),jr=Br([ae("table-matrix-qty-selector")],jr);var Hr=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Fr=class extends oe{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemSelect=null,this.quantities=new Map,this.handleAddonQuantityChange=e=>{var t;const i=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(i))?this.quantities.set(i,e.quantities):this.quantities.set(i,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,i,n;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const o=this.addons.find((t=>!(t instanceof Jo)&&t.type===e.type)),r=null===(i=null===(t=null==o?void 0:o.allItems)||void 0===t?void 0:t.find((e=>e.available)))||void 0===i?void 0:i.id;r&&(null===(n=this.onRentableItemSelect)||void 0===n||n.call(this,{id:r,type:e.type}))}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}initializeQuantities(){const e=new Map;this.addons.forEach((t=>{var i,n,o,r,a,s,l;if(!(t instanceof Jo))return void e.set(t.type,0);if(!t.hasMatrix)return void e.set(null!==(i=t.unitLabel)&&void 0!==i?i:0,0);const u=null!==(s=null===(a=null===(r=null===(o=null===(n=t.customMatrixData)||void 0===n?void 0:n.toRuleArray())||void 0===o?void 0:o[0])||void 0===r?void 0:r.combination)||void 0===a?void 0:a.quantities.map((e=>({...e,quantity:0}))))&&void 0!==s?s:[];e.set(null!==(l=t.id)&&void 0!==l?l:0,u.length>0?u:[{itemType:"default",quantity:0}])})),this.quantities=e}getName(e){return e instanceof Jo?e.feeName:e.displayName}getSortedAddons(){return[...this.addons].sort(((e,t)=>{const i=this.getName(e),n=this.getName(t);return i.localeCompare(n)}))}isRentableItemAvailable(e){var t,i;return e instanceof Jo||(null!==(i=null===(t=e.allItems)||void 0===t?void 0:t.filter((e=>e.available)).length)&&void 0!==i?i:0)>0}renderQtySelector(e){return e instanceof Jo?e.hasMatrix?R`
4343
4343
  <table-matrix-qty-selector
4344
4344
  .feeItem=${e}
4345
4345
  .onQuantityChange=${this.handleAddonQuantityChange}
@@ -145,16 +145,20 @@ export class TableMatrixQtySelector extends LitElement {
145
145
  .join(" ");
146
146
  }
147
147
 
148
- private renderItemType(type: string): TemplateResult {
148
+ private renderItemType(type: string, isSingleItem: boolean): TemplateResult {
149
149
  const quantity = this.quantities[type] ?? 0;
150
150
  const maxQty = this.getMaxQuantityForType(type);
151
151
  const canIncrement =
152
152
  this.isValidCombination(type, quantity + 1) && quantity < maxQty;
153
153
  const formattedType = this.formatItemType(type);
154
154
 
155
+ const showTypeLabel = !isSingleItem;
156
+
155
157
  return html`
156
158
  <div class="item-type-row">
157
- <div class="item-label">${formattedType}:</div>
159
+ ${showTypeLabel
160
+ ? html`<div class="item-label">${formattedType}:</div>`
161
+ : html`<div></div>`}
158
162
  <div class="quantity-control ${this.disabled ? "unavailable" : ""}">
159
163
  <button
160
164
  class="quantity-button"
@@ -188,9 +192,11 @@ export class TableMatrixQtySelector extends LitElement {
188
192
  const types = this.itemTypes;
189
193
  if (!types.length) return html``;
190
194
 
195
+ const isSingleItem = types.length === 1;
196
+
191
197
  return html`
192
198
  <div class="matrix-container">
193
- ${types.map((type) => this.renderItemType(type))}
199
+ ${types.map((type) => this.renderItemType(type, isSingleItem))}
194
200
  </div>
195
201
  `;
196
202
  }
@@ -100,6 +100,6 @@ export class BuildingFeeView {
100
100
  }
101
101
 
102
102
  get hasMatrix(): boolean {
103
- return !!(this.pricingType === "custom" && this.customMatrixData);
103
+ return !!this.customMatrixData;
104
104
  }
105
105
  }