@wayke-se/ecom-web 1.5.1 → 1.5.2
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.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",version:"1.5.
|
|
1
|
+
import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",version:"1.5.2",description:"Wayke Ecom Web",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:"eslint --ext .ts,.js src","lint:fix":"eslint --ext .ts,.js 'src' --fix",stylelint:"stylelint '**/*.scss'",prepare:"husky install"},author:"Wayke",license:"ISC",devDependencies:{"@ourstudio/clip-ui":"^0.0.11","@types/marked":"^4.3.0","@types/node":"^17.0.18","@types/object-path":"^0.11.1","@types/sanitize-html":"^2.6.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0",esbuild:"^0.15.10","esbuild-sass-plugin":"2.3.3",eslint:"^8.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^8.0.1","npm-dts":"^1.3.11",prettier:"^2.5.1",rimraf:"^5.0.1",stylelint:"^15.2.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^9.0.0",typescript:"^5.1.3"},dependencies:{"@wayke-se/ecom":"^4.4.0",marked:"^4.3.0","object-path":"^0.11.8",redux:"^4.1.2","sanitize-html":"^2.7.0"},files:["dist"]};import{createStore as Vc}from"redux";import{DrivingDistance as Bc,PaymentType as ni}from"@wayke-se/ecom";var tt=(o,i)=>o!==void 0&&i!==void 0?JSON.stringify(o).localeCompare(JSON.stringify(i))===0:o===i;var _e=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()}),Vo=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()}),Le=o=>({orderVehicle:o.getOrderVehicle(),accessories:o.getAccessories(),requiresDealerSelection:o.requiresDealerSelection(),dealerSites:o.getDealerSites(),paymentOptions:o.getPaymentOptions().map(e=>({...e,loanDetails:e.loanDetails?_e(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()}),Go=o=>({vehicle:o.getVehicle()});var st="RESET",qo=o=>i=>i({type:st,id:o}),ot="SET_ORDER",Oe=(o,i)=>e=>e({type:ot,order:o,vehicle:i}),it="SET_ID",Wo=o=>i=>i({type:it,id:o}),at="SET_CONTACT_EMAIL_AND_PHONE",Yo=o=>i=>i({type:at,value:o}),nt="SET_SOCIAL_ID_AND_ADDRESS",Ko=(o,i,e)=>t=>t({type:nt,socialId:o,address:i,lastStage:e}),rt="SET_HOME_DELIVERY",jo=(o,i)=>e=>e({type:rt,homeDelivery:o,lastStage:i}),ct="SET_DEALER",Qo=(o,i)=>e=>e({type:ct,dealer:o,lastStage:i}),lt="INIT_TRADE_IN",zo=o=>i=>i({type:lt,lastStage:o}),dt="SET_TRADE_IN",Se=(o,i,e)=>t=>t({type:dt,lastStage:o,tradeIn:i,tradeInVehicle:e}),mt="SET_FINANCIAL",Jo=(o,i)=>e=>e({type:mt,paymentType:o,lastStage:i}),pt="SET_PAYMENT_LOOKUP_RESPONSE",Xo=o=>i=>i({type:pt,paymentLookupResponse:_e(o)}),ut="SET_DRIVING_DISTANCE",Zo=o=>i=>i({type:ut,drivingDistance:o}),ht="COMPLETE_STAGE",z=o=>i=>i({type:ht,lastStage:o}),kt="SET_OR_REMOVE_INSURANCE",le=o=>i=>i({type:kt,insurance:o}),yt="SET_OR_REMOVE_INSURANCE_ADDONS",ei=(o,i)=>e=>e({type:yt,insurance:o,insuranceAddons:i}),vt="SET_OR_REMOVE_FREE_INSURANCE",ti=o=>i=>i({type:vt,freeInsurance:o}),Et="SET_OR_REMOVE_ACCESSORY",si=o=>i=>i({type:Et,accessory:o}),It="GO_TO",R=(o,i,e)=>t=>t({type:It,view:o,index:i,subStage:e}),ft="SET_STAGES",oi=o=>i=>i({type:ft,stages:o}),gt="SET_CREATED_ORDER_ID",ii=(o,i)=>e=>e({type:gt,id:o,payment:i}),_t="SET_CREDIT_ASSESSMENT_RESPONSE",de=(o,i)=>e=>e({type:_t,caseId:o,creditAssessmentResponse:i}),St="SET_STATE",ai=o=>i=>i({type:St,state:o});var Fc={};var ri={view:"preview",stage:1,subStage:1},ci={id:"",topNavigation:{...ri},navigation:{...ri},customer:{email:"",phone:"",givenName:"",surname:"",socialId:""},homeDelivery:!1,accessories:[],drivingDistance:Bc.Between0And1000,...Fc},ie=(o,i)=>i?{view:"summary",stage:1,subStage:1}:{view:"main",stage:o+1,subStage:1},ae=(o,i)=>i.view==="main"?o.stage<i.stage?i:v.topNavigation:{...o,stage:o.stage+1},wt=o=>o&&o?.length===1&&o?.[0].type===ni.Cash?ni.Cash:void 0,v,Nt,Uc=(o=ci,i)=>{let e,t;switch(v={...o},i.type){case st:return{...ci,id:i.id};case ft:return{...v,stages:i.stages};case it:return{...v,id:i.id};case ot:return{...o,order:i.order,paymentType:wt(i.order?.paymentOptions),vehicle:{...i.order.orderVehicle,...i.vehicle||{}}};case at:let s={...v,customer:{...o.customer,email:i.value.email,phone:i.value.phone},navigation:{view:"main",stage:o.navigation.stage,subStage:2}};return delete s.wantTradeIn,delete s.tradeIn,delete s.tradeInVehicle,s.paymentType=wt(o.order?.paymentOptions),delete s.paymentLookupResponse,delete s.insurance,delete s.insuranceAddOns,delete s.freeInsurance,delete s.dealer,s.accessories=[],s;case nt:return e=ie(v.navigation.stage,i.lastStage),t=ae(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,address:i.address,customer:{...o.customer,socialId:i.socialId}},v;case ct:return e=ie(o.navigation.stage,i.lastStage),t={...e},v={...o,navigation:e,topNavigation:t,dealer:i.dealer},delete v.wantTradeIn,delete v.tradeIn,delete v.tradeInVehicle,v.paymentType=wt(o.order?.paymentOptions),delete v.paymentLookupResponse,delete v.insurance,delete v.insuranceAddOns,delete v.freeInsurance,v.accessories=[],v;case rt:return e=ie(o.navigation.stage,i.lastStage),t=ae(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,homeDelivery:i.homeDelivery},v;case lt:return e={view:"main",stage:o.navigation.stage,subStage:1},t=ae(v.topNavigation,e),v={...o,navigation:e,wantTradeIn:!0,topNavigation:t,tradeIn:o.tradeIn||{registrationNumber:"",mileage:"",description:""}},v;case dt:return e=ie(o.navigation.stage,i.lastStage),t=ae(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,wantTradeIn:!!i.tradeIn,tradeIn:i.tradeIn,tradeInVehicle:i.tradeInVehicle},v;case mt:return e=ie(o.navigation.stage,i.lastStage),t=ae(v.topNavigation,e),{...v,navigation:e,topNavigation:t,paymentType:i.paymentType};case pt:return{...v,paymentLookupResponse:i.paymentLookupResponse};case ut:return{...v,drivingDistance:i.drivingDistance};case ht:return e=ie(o.navigation.stage,i.lastStage),t=ae(v.topNavigation,e),v={...o,navigation:e,topNavigation:t},v;case yt:return v.insurance=i.insurance,v.insuranceAddOns={insurance:i.insurance.name,addOns:i.insuranceAddons},v;case kt:return tt(v.insurance,i.insurance)?v.insurance=void 0:v.insurance=i.insurance,v.insuranceAddOns?.insurance&&(v.insuranceAddOns=void 0),v;case vt:return tt(v.freeInsurance,i.freeInsurance)?v.freeInsurance=void 0:v.freeInsurance=i.freeInsurance,v;case Et:return Nt=v.accessories.findIndex(a=>a.id===i.accessory.id),v.accessories=[...v.accessories],Nt>-1?v.accessories.splice(Nt,1):v.accessories.push(i.accessory),{...v,accessories:[...v.accessories]};case It:return{...o,navigation:{view:i.view,stage:i.index||1,subStage:i.subStage||1}};case gt:return i.payment?e={view:"main",stage:o.navigation.stage,subStage:2}:e=ie(o.navigation.stage,!0),t=ae(v.topNavigation,e),v={...o,navigation:e,topNavigation:t,createdOrderId:i.id,payment:i.payment},v;case _t:return{...v,caseId:i.caseId,creditAssessmentResponse:i.creditAssessmentResponse};case St:return{...i.state};default:return o}},li=Uc;var di=()=>Vc(li);var Me=(o,i)=>{if(!i)return o;let e=new URL(o);return`${i}${e.pathname}`};var Gc=o=>o.toString().replace(/\s/g,""),qc=(o,i)=>{if(!i)return o;let e=Math.pow(10,i);return(Math.round(o*e)/e).toFixed(i)},k=(o,i)=>{if(o===void 0)return"???";let e=qc(o,i?.decimals!==void 0?i.decimals:0);return`${i?.prefix?`${i.prefix}`:""}${Gc(e).replace(/\B(?=(\d{3})+(?!\d))/g," ")}${i?.postfix?` ${i.postfix}`:""}`},Wc=(o,i)=>{let e=o.split(" "),t=i.split(" ").map(s=>s.toLowerCase());return e.filter(s=>!t.includes(s.toLowerCase())).join(" ")},me=o=>{if(!!o)return Wc(o.shortDescription||"",o.title||"")};var Yc=({vehicle:o,order:i,meta:e,cdnMedia:t})=>{let s=o?.imageUrls,a=o?.title,n=k(o?.price||NaN),l=i?.contactInformation?.name;return`
|
|
2
2
|
<div class="waykeecom-product-card">
|
|
3
3
|
${s?.length?`
|
|
4
4
|
<div class="waykeecom-product-card__media">
|
|
@@ -905,7 +905,7 @@ import{config as kd}from"@wayke-se/ecom";var Uo={name:"@wayke-se/ecom-web",versi
|
|
|
905
905
|
<div class="waykeecom-hstack__item">Varf\xF6r m\xE5ste jag svara p\xE5 allt detta?</div>
|
|
906
906
|
</div>`,description:`<div class="waykeecom-content">
|
|
907
907
|
<p class="waykeecom-content__p">${c?.name} m\xE5ste ta in uppgifterna av kunden f\xF6r att uppfylla best\xE4mmelser i Konsumentkreditlagen (2010:1846) och Lag (2017:630) om \xE5tg\xE4rder mot penningtv\xE4tt och finansiering av terrorism.</p>
|
|
908
|
-
<p class="waykeecom-content__p"><a href="
|
|
908
|
+
<p class="waykeecom-content__p"><a href="${c?.loanDetails?.privacyPolicyUrl}" title="" target="_blank" rel="noopener norefferer" class="waykeecom-link">L\xE4s mer om detta h\xE4r</a></p>
|
|
909
909
|
</div>`,onClick:()=>{d("MAIN","FINANCIAL_LOAN_KYC_INFORMATION_TOGGLE","FINANCIAL")}}),(e||this.caseError||this.bankidError)&&this.node.querySelector(`#${As}`)?.scrollIntoView()}}},dn=Cs;var Ds=class extends r{constructor(e,t){super(e);this.props=t,this.render()}update(e){this.props=e,this.node.querySelector(".waykeecom-pie-chart__chart-data")?.setAttribute("stroke-dasharray",`calc(${this.props.percentage} * 31.4 / 100) 31.4`)}render(){let{percentage:e}=this.props;this.node.innerHTML=`
|
|
910
910
|
<div class="waykeecom-pie-chart">
|
|
911
911
|
<svg height="20" width="20" viewBox="0 0 20 20" class="waykeecom-pie-chart__chart">
|