@wayke-se/ecom-web 1.7.3-beta.2 → 1.7.3
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/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var qr=Object.create;var Le=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var il=Object.getPrototypeOf,ol=Object.prototype.hasOwnProperty;var al=(o,t)=>{for(var e in t)Le(o,e,{get:t[e],enumerable:!0})},ia=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of tl(t))!ol.call(o,a)&&a!==e&&Le(o,a,{get:()=>t[a],enumerable:!(i=el(t,a))||i.enumerable});return o};var oa=(o,t,e)=>(e=o!=null?qr(il(o)):{},ia(t||!o||!o.__esModule?Le(e,"default",{value:o,enumerable:!0}):e,o)),sl=o=>ia(Le({},"__esModule",{value:!0}),o);var Bd={};al(Bd,{default:()=>Ed});module.exports=sl(Bd);var Mr=require("@wayke-se/ecom");var aa={name:"@wayke-se/ecom-web",version:"1.7.3
|
|
1
|
+
"use strict";var qr=Object.create;var Le=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var il=Object.getPrototypeOf,ol=Object.prototype.hasOwnProperty;var al=(o,t)=>{for(var e in t)Le(o,e,{get:t[e],enumerable:!0})},ia=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of tl(t))!ol.call(o,a)&&a!==e&&Le(o,a,{get:()=>t[a],enumerable:!(i=el(t,a))||i.enumerable});return o};var oa=(o,t,e)=>(e=o!=null?qr(il(o)):{},ia(t||!o||!o.__esModule?Le(e,"default",{value:o,enumerable:!0}):e,o)),sl=o=>ia(Le({},"__esModule",{value:!0}),o);var Bd={};al(Bd,{default:()=>Ed});module.exports=sl(Bd);var Mr=require("@wayke-se/ecom");var aa={name:"@wayke-se/ecom-web",version:"1.7.3",description:"Wayke Ecom Web",type:"module",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",homepage:"https://github.com/wayke-se/wayke-ecom-web",scripts:{start:"node ./esbuild/start.js",clip:"node ./esbuild/clip-ui.js && node ./clip-ui/start.js",build:"npm run clean && node ./esbuild/lib.js && node ./esbuild/cdn.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn",test:"npm run lint && npm run typecheck",typecheck:"tsc -noEmit","typecheck:watch":"tsc -noEmit -watch",lint:"npx @biomejs/biome check","lint:fix":"npx @biomejs/biome check --write",stylelint:"stylelint '**/*.scss'",prepare:"husky"},author:"Wayke",license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.3","@ourstudio/clip-ui":"^0.0.11","@types/node":"^22.7.6","@types/object-path":"^0.11.1","@types/sanitize-html":"^2.6.2","@types/showdown":"^2.0.6","@typescript-eslint/eslint-plugin":"^8.9.0","@typescript-eslint/parser":"^8.9.0",esbuild:"^0.24.0","esbuild-sass-plugin":"^3.2.0",husky:"^9.0.11","npm-dts":"^1.3.11",rimraf:"^6.0.1",stylelint:"^16.2.1","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^13.0.0",typescript:"^5.1.3"},dependencies:{"@wayke-se/ecom":"^4.5.0","object-path":"^0.11.8",redux:"^5.0.1","sanitize-html":"^2.7.0",showdown:"^2.1.0"},files:["dist"]};var Ge=o=>({costs:o.getCosts(),fees:o.getFees(),interests:o.getInterests(),durationSpec:o.getDurationSpec(),downPaymentSpec:o.getDownPaymentSpec(),residualValueSpec:o.getResidualValueSpec(),totalResidualValue:o.getTotalResidualValue(),publicURL:o.getPublicURL(),shouldUseCreditScoring:o.shouldUseCreditScoring(),financialProductCode:o.getFinancialProductCode(),price:o.getPrice(),creditAmount:o.getCreditAmount(),hasPrivacyPolicy:o.hasPrivacyPolicy(),privacyPolicyUrl:o.getPrivacyPolicyUrl(),moneyLaunderingInformationURL:o.getMoneyLaunderingInformationURL(),financialOptionId:o.getFinancialOptionId()}),sa=o=>({status:o.getStatus(),hasPendingSigning:o.hasPendingSigning(),hintCode:o.getHintCode(),signingMessage:o.getSigningMessage(),shouldRenewSigning:o.shouldRenewSigning(),isSigned:o.isSigned(),address:void 0,pendingScoring:o.hasPendingScoring(),isScored:o.isScored(),hasScoringError:o.hasScoringError(),scoringId:o.getScoringId(),recommendation:o.getRecommendation(),decision:o.getDecision(),isAccepted:o.isAccepted()}),_e=o=>({orderVehicle:o.getOrderVehicle(),accessories:o.getAccessories(),requiresDealerSelection:o.requiresDealerSelection(),dealerSites:o.getDealerSites(),paymentOptions:o.getPaymentOptions().map(e=>({...e,loanDetails:e.loanDetails?Ge(e.loanDetails):void 0})),deliveryOptions:o.getDeliveryOptions(),insuranceOption:o.getInsuranceOption(),orderConditions:o.getOrderConditions(),orderReturnConditions:o.getOrderReturnConditions(),conditionsPdfUri:o.getConditionsPdfUri(),contactInformation:o.getContactInformation(),allowsTradeIn:o.allowsTradeIn(),isUnavailable:o.isUnavailable(),isPaymentRequired:o.isPaymentRequired()}),na=o=>({vehicle:o.getVehicle()});var nt="RESET",ca=o=>t=>t({type:nt,id:o}),ct="SET_ORDER",Xe=(o,t)=>e=>e({type:ct,order:o,vehicle:t}),rt="SET_ID",ra=o=>t=>t({type:rt,id:o}),lt="SET_CONTACT_EMAIL_AND_PHONE",la=o=>t=>t({type:lt,value:o}),dt="SET_SOCIAL_ID_AND_ADDRESS",da=(o,t,e)=>i=>i({type:dt,socialId:o,address:t,lastStage:e}),mt="SET_HOME_DELIVERY",ma=(o,t)=>e=>e({type:mt,homeDelivery:o,lastStage:t}),pt="SET_DEALER",pa=(o,t)=>e=>e({type:pt,dealer:o,lastStage:t}),gt="INIT_TRADE_IN",ga=o=>t=>t({type:gt,lastStage:o}),It="SET_TRADE_IN",Ne=(o,t,e)=>i=>i({type:It,lastStage:o,tradeIn:t,tradeInVehicle:e}),ut="SET_FINANCIAL",Ia=(o,t)=>e=>e({type:ut,paymentType:o,lastStage:t}),yt="SET_PAYMENT_LOOKUP_RESPONSE",ua=o=>t=>t({type:yt,paymentLookupResponse:Ge(o)}),bt="RESET_PAYMENT_LOOKUP_RESPONSE",ya=()=>o=>o({type:bt}),ht="SET_DRIVING_DISTANCE",ba=o=>t=>t({type:ht,drivingDistance:o}),kt="COMPLETE_STAGE",K=o=>t=>t({type:kt,lastStage:o}),Ct="SET_OR_REMOVE_INSURANCE",me=o=>t=>t({type:Ct,insurance:o}),At="SET_OR_REMOVE_INSURANCE_ADDONS",ha=(o,t)=>e=>e({type:At,insurance:o,insuranceAddons:t}),vt="SET_OR_REMOVE_FREE_INSURANCE",ka=o=>t=>t({type:vt,freeInsurance:o}),wt="SET_OR_REMOVE_ACCESSORY",Ca=o=>t=>t({type:wt,accessory:o}),Gt="GO_TO",O=(o,t,e)=>i=>i({type:Gt,view:o,index:t,subStage:e}),Nt="SET_STAGES",Aa=o=>t=>t({type:Nt,stages:o}),ft="SET_CREATED_ORDER_ID",va=(o,t)=>e=>e({type:ft,id:o,payment:t}),xt="SET_CREDIT_ASSESSMENT_RESPONSE",pe=(o,t)=>e=>e({type:xt,caseId:o,creditAssessmentResponse:t}),Et="SET_STATE",wa=o=>t=>t({type:Et,state:o});var xa=require("redux");var fe=require("@wayke-se/ecom");var Bt=(o,t)=>o!==void 0&&t!==void 0?JSON.stringify(o).localeCompare(JSON.stringify(t))===0:o===t;var cl={};var Ga={view:"preview",stage:1,subStage:1},Na={id:"",topNavigation:{...Ga},navigation:{...Ga},customer:{email:"",phone:"",givenName:"",surname:"",socialId:""},homeDelivery:!1,accessories:[],drivingDistance:fe.DrivingDistance.Between0And1000,...cl},ce=(o,t)=>t?{view:"summary",stage:1,subStage:1}:{view:"main",stage:o+1,subStage:1},re=(o,t)=>t.view==="main"?o.stage<t.stage?t:b.topNavigation:{...o,stage:o.stage+1},Rt=o=>o&&o?.length===1&&o?.[0].type===fe.PaymentType.Cash?fe.PaymentType.Cash:void 0,b,St,rl=(o=Na,t)=>{let e,i;switch(b={...o},t.type){case nt:return{...Na,id:t.id};case Nt:return{...b,stages:t.stages};case rt:return{...b,id:t.id};case ct:return{...o,order:t.order,paymentType:Rt(t.order?.paymentOptions),vehicle:{...t.order.orderVehicle,...t.vehicle||{}}};case lt:let a={...b,customer:{...o.customer,email:t.value.email,phone:t.value.phone},navigation:{view:"main",stage:o.navigation.stage,subStage:2}};return delete a.wantTradeIn,delete a.tradeIn,delete a.tradeInVehicle,a.paymentType=Rt(o.order?.paymentOptions),delete a.paymentLookupResponse,delete a.insurance,delete a.insuranceAddOns,delete a.freeInsurance,delete a.dealer,a.accessories=[],a;case dt:return e=ce(b.navigation.stage,t.lastStage),i=re(b.topNavigation,e),b={...o,navigation:e,topNavigation:i,address:t.address,customer:{...o.customer,socialId:t.socialId}},b;case pt:return e=ce(o.navigation.stage,t.lastStage),i={...e},b={...o,navigation:e,topNavigation:i,dealer:t.dealer},delete b.wantTradeIn,delete b.tradeIn,delete b.tradeInVehicle,b.paymentType=Rt(o.order?.paymentOptions),delete b.paymentLookupResponse,delete b.insurance,delete b.insuranceAddOns,delete b.freeInsurance,b.accessories=[],b;case mt:return e=ce(o.navigation.stage,t.lastStage),i=re(b.topNavigation,e),b={...o,navigation:e,topNavigation:i,homeDelivery:t.homeDelivery},b;case gt:return e={view:"main",stage:o.navigation.stage,subStage:1},i=re(b.topNavigation,e),b={...o,navigation:e,wantTradeIn:!0,topNavigation:i,tradeIn:o.tradeIn||{registrationNumber:"",mileage:"",description:""}},b;case It:return e=ce(o.navigation.stage,t.lastStage),i=re(b.topNavigation,e),b={...o,navigation:e,topNavigation:i,wantTradeIn:!!t.tradeIn,tradeIn:t.tradeIn,tradeInVehicle:t.tradeInVehicle},b;case ut:return e=ce(o.navigation.stage,t.lastStage),i=re(b.topNavigation,e),{...b,navigation:e,topNavigation:i,paymentType:t.paymentType};case bt:return{...b,paymentLookupResponse:void 0};case yt:return{...b,paymentLookupResponse:t.paymentLookupResponse};case ht:return{...b,drivingDistance:t.drivingDistance};case kt:return e=ce(o.navigation.stage,t.lastStage),i=re(b.topNavigation,e),b={...o,navigation:e,topNavigation:i},b;case At:return b.insurance=t.insurance,b.insuranceAddOns={insurance:t.insurance.name,addOns:t.insuranceAddons},b;case Ct:return Bt(b.insurance,t.insurance)?b.insurance=void 0:b.insurance=t.insurance,b.insuranceAddOns?.insurance&&(b.insuranceAddOns=void 0),b;case vt:return Bt(b.freeInsurance,t.freeInsurance)?b.freeInsurance=void 0:b.freeInsurance=t.freeInsurance,b;case wt:return St=b.accessories.findIndex(s=>s.id===t.accessory.id),b.accessories=[...b.accessories],St>-1?b.accessories.splice(St,1):b.accessories.push(t.accessory),{...b,accessories:[...b.accessories]};case Gt:return{...o,navigation:{view:t.view,stage:t.index||1,subStage:t.subStage||1}};case ft:return t.payment?e={view:"main",stage:o.navigation.stage,subStage:2}:e=ce(o.navigation.stage,!0),i=re(b.topNavigation,e),b={...o,navigation:e,topNavigation:i,createdOrderId:t.id,payment:t.payment},b;case xt:return{...b,caseId:t.caseId,creditAssessmentResponse:t.creditAssessmentResponse};case Et:return{...t.state};default:return o}},fa=rl;var Ea=()=>(0,xa.createStore)(fa);var Ot=class{constructor(t,e){if(!t)throw"Missing element";if(!e){this.element=t,this.node=t;return}this.element=t;let i=e.id?this.element.querySelector(`#${e.id}`):void 0;if(i)i.className=e.className||"",e.attributes?.forEach(a=>{i.setAttribute(a.key,a.value)}),this.node=i;else{let a=document.createElement(e.htmlTag);e.id&&(a.id=e.id),a.className=e.className||"",e.attributes?.forEach(s=>{a.setAttribute(s.key,s.value)}),t.appendChild(a),this.node=a}}},c=Ot;var Ft=class extends c{constructor(t,{id:e}){super(t,{htmlTag:"div",className:"waykeecom-modal__body",id:e})}},Ba=Ft;var Lt=class extends c{constructor(t,{id:e}){super(t,{htmlTag:"div",className:"waykeecom-modal__center",id:e})}},Ra=Lt;var _t=class extends c{constructor(t,e){super(t),this.props=e,this.render()}render(){let{title:t,id:e,onClick:i}=this.props;this.node.innerHTML=`
|
|
2
2
|
<button
|
|
3
3
|
title="${t}"
|
|
4
4
|
${e?`id="${e}"`:""}
|