PageSourceSearch

https://shop.post.ch/chunk-55FTXL7V.js

js post.ch collected 2026-09-24 08:36:50 UTC 35,310 bytes, 1 lines download raw bytes

1import{a as tt,b as nt}from"./chunk-NXWP4CC7.js";import{c as Ji,d as Xi}from"./chunk-EIDWWB7U.js";import{c as ct}from"./chunk-GSFAET7D.js";import"./chunk-OVBHRGUO.js";import"./chunk-K5CCRYM5.js";import"./chunk-DYVI65OG.js";import"./chunk-RLDL2HLR.js";import"./chunk-OZTPXAGB.js";import"./chunk-LIUZVM5V.js";import"./chunk-QN23J37R.js";import{h as lt}from"./chunk-47FPBB3Q.js";import"./chunk-IQS4GO26.js";import{a as et,b as it}from"./chunk-6EEQDEPT.js";import"./chunk-7JCC46KM.js";import"./chunk-2CGTP4EQ.js";import{w as q}from"./chunk-4CLUHGBI.js";import"./chunk-FIZCBRH5.js";import"./chunk-CRSFTUXJ.js";import{k as oe,l as Se,m as Le}from"./chunk-AF6QGJYL.js";import"./chunk-G7FM3C5V.js";import"./chunk-ZRWAUB6T.js";import{h as rt,l as at}from"./chunk-N3XCJBRC.js";import{D as Qi,E as Wi,Ea as ot,Fa as fe,H as Zi,c as Ui,e as M,g as Gi,h as ji,q as zi,u as Hi,v as Yi,w as Ki,x as $i,y as qi}from"./chunk-2MMWGSE4.js";import{a as A}from"./chunk-RQS2SBUU.js";import{Ba as ne,Dc as O,Ec as R,Ka as me,Sa as Ri,f as De,qc as Ai}from"./chunk-YKZCSAGE.js";import{$a as Ci,Ab as pe,Ac as yi,Bc as _i,Bd as Ni,Cc as ee,Da as gi,Eb as o,Gc as S,Gd as Bi,Jd as we,K as U,Kd as te,Mc as _,Oc as s,Pa as F,Qa as E,Qb as bi,Rb as y,Sc as Pi,Tc as xi,Td as B,Uc as Ii,Wb as P,X as pi,Xb as vi,Yc as N,Zb as hi,_c as Ti,a as si,ac as K,bd as b,cd as L,dd as x,ea as ui,ed as ie,fd as Fi,hd as Ei,id as wi,jd as Di,kc as D,ke as V,lc as Z,mc as g,o as di,oc as C,oe as Vi,pe as ue,qd as Si,rc as J,re as Oi,sa as mi,sc as X,sd as $,ta as fi,tc as d,td as Li,uc as a,ud as Mi,vc as l,w as T,wa as Y,wc as h,wd as p,xd as u,yd as ki}from"./chunk-WFCS7BX7.js";import{a as z,b as H,e as wt,f as Dt}from"./chunk-NMDLJX5Q.js";var st=wt((Me,ke)=>{"use strict";(function(t,i){typeof Me=="object"&&typeof ke<"u"?ke.exports=i():typeof define=="function"&&define.amd?define(i):(t=typeof globalThis<"u"?globalThis:t||self).filesize=i()})(Me,function(){"use strict";function t(G){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},t(G)}var i="array",e="bits",n="byte",r="bytes",c="",k="exponent",ye="function",ae="iec",ft="Invalid number",gt="Invalid rounding method",le="jedec",Ct="object",Oe=".",bt="round",vt="kbit",ht="string",_e={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function Pe(G){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Re=f.bits,W=Re!==void 0&&Re,Ae=f.pad,yt=Ae!==void 0&&Ae,Ue=f.base,w=Ue===void 0?-1:Ue,Ge=f.round,xe=Ge===void 0?2:Ge,je=f.locale,Ie=je===void 0?c:je,ze=f.localeOptions,_t=ze===void 0?{}:ze,He=f.separator,Te=He===void 0?c:He,Ye=f.spacer,Pt=Ye===void 0?" ":Ye,Ke=f.symbols,xt=Ke===void 0?{}:Ke,$e=f.standard,I=$e===void 0?c:$e,qe=f.output,Fe=qe===void 0?ht:qe,Qe=f.fullform,It=Qe!==void 0&&Qe,We=f.fullforms,Ze=We===void 0?[]:We,Je=f.exponent,Xe=Je===void 0?-1:Je,ei=f.roundingMethod,Tt=ei===void 0?bt:ei,ii=f.precision,ce=ii===void 0?0:ii,v=Xe,j=Number(G),m=[],se=0,Ee=c;w===-1&&I.length===0?(w=10,I=le):w===-1&&I.length>0?w=(I=I===ae?ae:le)===ae?2:10:I=(w=w===2?2:10)==10||I===le?le:ae;var de=w===10?1e3:1024,Ft=It===!0,ti=j<0,ni=Math[Tt];if(isNaN(G))throw new TypeError(ft);if(t(ni)!==ye)throw new TypeError(gt);if(ti&&(j=-j),(v===-1||isNaN(v))&&(v=Math.floor(Math.log(j)/Math.log(de)))<0&&(v=0),v>8&&(ce>0&&(ce+=8-v),v=8),Fe===k)return v;if(j===0)m[0]=0,Ee=m[1]=_e.symbol[I][W?e:r][v];else{se=j/(w===2?Math.pow(2,10*v):Math.pow(1e3,v)),W&&(se*=8)>=de&&v<8&&(se/=de,v++);var oi=Math.pow(10,v>0?xe:0);m[0]=ni(se*oi)/oi,m[0]===de&&v<8&&Xe===-1&&(m[0]=1,v++),Ee=m[1]=w===10&&v===1?W?vt:"kB":_e.symbol[I][W?e:r][v]}if(ti&&(m[0]=-m[0]),ce>0&&(m[0]=m[0].toPrecision(ce)),m[1]=xt[m[1]]||m[1],Ie===!0?m[0]=m[0].toLocaleStr
1ing():Ie.length>0?m[0]=m[0].toLocaleString(Ie,_t):Te.length>0&&(m[0]=m[0].toString().replace(Oe,Te)),yt&&Number.isInteger(m[0])===!1&&xe>0){var ri=Te||Oe,ai=m[0].toString().split(ri),li=ai[1]||c,ci=li.length,Et=xe-ci;m[0]="".concat(ai[0]).concat(ri).concat(li.padEnd(ci+Et,"0"))}return Ft&&(m[1]=Ze[v]?Ze[v]:_e.fullform[I][v]+(W?"bit":n)+(m[0]===1?c:"s")),Fe===i?m:Fe===Ct?{value:m[0],symbol:m[1],exponent:v,unit:Ee}:m.join(Pt)}return Pe.partial=function(G){return function(f){return Pe(f,G)}},Pe})});var dt=Dt(st(),1),pt=(()=>{class t{static transformOne(e,n){return(0,dt.default)(e,n)}transform(e,n){return Array.isArray(e)?e.map(r=>t.transformOne(r,n)):t.transformOne(e,n)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=hi({name:"filesize",type:t,pure:!0,standalone:!1}),t})(),ut=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=vi({type:t}),t.\u0275inj=gi({}),t})();var Lt=["fileInputRef"],Mt=t=>({"bg-light":t});function kt(t,i){if(t&1){let e=S();a(0,"div",6),_("click",function(){F(e),s();let r=N(2);return E(r.click())}),a(1,"span"),b(2),l(),h(3,"post-icon",7),l()}if(t&2){let e=s();o(2),L(e.fileDropContentLabel)}}function Nt(t,i){if(t&1){let e=S();a(0,"div",8),_("click",function(r){F(e);let c=s();return E(c.cancelUpload(r))}),a(1,"div",9),h(2,"ngb-progressbar",10),a(3,"div",11)(4,"span",12),b(5),l(),a(6,"span",12),b(7),p(8,"filesize"),l()()(),h(9,"post-icon",13),l()}if(t&2){let e=s();o(2),d("showValue",!1)("value",e.fileUploadProgressPercentage)("max",100),o(3),L(e.uploadingFileName),o(2),x(" ",e.fileUploadProgressPercentage+"% "+e.fileDropProgressLabelOf+" "+u(8,5,e.uploadingFileSize)," ")}}function Bt(t,i){if(t&1){let e=S();a(0,"div",5),h(1,"img",14),a(2,"span",15),b(3),l(),a(4,"post-icon",16),p(5,"cxTranslate"),_("click",function(r){F(e);let c=s();return E(c.onFileDeleteClick(r))}),l()()}if(t&2){let e=s();o(),d("src",e.getUploadedImageUrl(e.uploadedFileName),pe)("alt",e.uploadingFileName),o(2),L(e.uploadingFileName),o(),D("aria-label",u(5,4,"common.remove-file"))}}var ge=class t{constructor(i,e,n){this.cdr=i;this.renderer=e;this.occEndpoint=n;this.globalDragStartListener=e.listen("document","dragstart",()=>{this.globalDraggingInProgress=!0}),this.globalDragEndListener=e.listen("document","dragend",()=>{this.globalDraggingInProgress=!1})}cdr;renderer;occEndpoint;uploadedFileNameChange=we();uploadedFileName;uploadFile;uploadFileError=we();accept="*";fileDropContentLabel;fileDropProgressLabelOf;hasError=!1;fileSelector;currentUploadSub=null;draggingInProgress=!1;fileUploadProgressPercentage=0;globalDraggingInProgress=!1;useDragEnter=!1;uploadingFileName=null;uploadingFileSize=0;fileUploadInProgress=!1;globalDragStartListener;globalDragEndListener;helperFormEl=null;fileInputPlaceholderEl=null;ngOnDestroy(){this.globalDragStartListener(),this.globalDragEndListener()}onDragOver(i){this.useDragEnter?(t.preventAndStop(i),i.dataTransfer&&(i.dataTransfer.dropEffect="copy")):!this.isDropzoneDisabled()&&!this.useDragEnter&&i.dataTransfer&&(this.draggingInProgress||(this.draggingInProgress=!0),t.preventAndStop(i),i.dataTransfer.dropEffect="copy")}onDragEnter(i){!this.isDropzoneDisabled()&&this.useDragEnter&&(this.draggingInProgress||(this.draggingInProgress=!0),t.preventAndStop(i))}onDragLeave(i){this.isDropzoneDisabled()||(this.draggingInProgress&&(this.draggingInProgress=!1),t.preventAndStop(i))}dropFiles(i){if(!this.isDropzoneDisabled()&&(this.draggingInProgress=!1,i.dataTransfer)){let e;i.dataTransfer.items?e=i.dataTransfer.items:e=i.dataTransfer.files,t.preventAndStop(i),this.checkFiles(e)}}onFileInputChange(i){if(!this.isDropzoneDisabled()&&i.target){let e=i.target.files||[];this.checkFiles(e),this.resetFileInput()}}cancelUpload(i){i.preventDefault(),i.stopPropagation(),this.currentUploadSub&&this.currentUploadSub.unsubscribe(),this.resetInternalState()}resetInternalState(){this.uploadedFileNameChange.emit(null),this.uploadingFileName=null,this.uploadingFileSize=0,this.fileUploadInProgress=!1,this.currentUploadSub=null,this.resetFileInput(),this.cdr.detectChanges()}onFileDeleteClick(i){i.preventDefault(),i.stopPropagation(),this.resetInternalState()}getUploadedImageUrl(i){return this.occEndpoint.buildUrl("getImage",{urlParam
1s:{filename:i}})}checkFiles(i){let e=i[0],n=null;t.canGetAsEntry(e)&&(n=e.webkitGetAsEntry()),!n&&e?this.uploadFileInternal(e):n?.isFile&&n.file(r=>{this.uploadFileInternal(r)})}uploadFileInternal(i){this.fileUploadInProgress=!0,this.uploadingFileSize=i.size,this.uploadingFileName=i.name,this.currentUploadSub=this.uploadFile(i).pipe(T(e=>{switch(e.type){case De.UploadProgress:this.fileUploadProgressPercentage=Math.round(e.loaded*100/e.total),this.cdr.detectChanges();break;case De.Response:return e}return null}),ui(()=>{this.fileUploadInProgress=!1,this.cdr.detectChanges()}),U(e=>e!=null)).subscribe({next:e=>this.uploadedFileNameChange.emit(e?.body?.filename??this.uploadingFileName),error:e=>{this.resetInternalState(),e&&this.uploadFileError.emit(e)}})}isDropzoneDisabled(){return this.globalDraggingInProgress||this.uploadedFileName!==null&&this.uploadedFileName!==""}resetFileInput(){if(this.fileSelector?.nativeElement){let i=this.fileSelector.nativeElement,e=i.parentElement,n=this.getHelperFormElement(),r=this.getFileInputPlaceholderElement();e!==n&&(this.renderer.insertBefore(e,r,i),this.renderer.appendChild(n,i),n.reset(),this.renderer.insertBefore(e,i,r),this.renderer.removeChild(e,r))}}getHelperFormElement(){return this.helperFormEl??=this.renderer.createElement("form"),this.helperFormEl}getFileInputPlaceholderElement(){return this.fileInputPlaceholderEl??=this.renderer.createElement("div"),this.fileInputPlaceholderEl}static preventAndStop(i){i.stopPropagation(),i.preventDefault()}static canGetAsEntry(i){return!!i.webkitGetAsEntry}static \u0275fac=function(e){return new(e||t)(y(B),y(bi),y(me))};static \u0275cmp=P({type:t,selectors:[["swisspost-onlineshop-file-drop"]],viewQuery:function(e,n){if(e&1&&Pi(Lt,7),e&2){let r;xi(r=Ii())&&(n.fileSelector=r.first)}},inputs:{uploadedFileName:"uploadedFileName",uploadFile:"uploadFile",accept:"accept",fileDropContentLabel:"fileDropContentLabel",fileDropProgressLabelOf:"fileDropProgressLabelOf",hasError:"hasError"},outputs:{uploadedFileNameChange:"uploadedFileNameChange",uploadFileError:"uploadFileError"},decls:6,vars:9,consts:[["fileInputRef",""],["type","button",1,"btn","btn-secondary","w-100","p-0",3,"dragenter","dragleave","dragover","drop","ngClass"],["type","file","hidden","true","multiple","false",1,"d-none",3,"change","accept"],[1,"file-drop-zone-text-container","w-100","d-flex","flex-row","justify-content-between","mx-3"],[1,"d-flex","flex-grow-1","m-3","gap-3","align-items-center"],[1,"flex-grow-1","d-flex","justify-content-between","align-items-center","m-3","gap-3"],[1,"file-drop-zone-text-container","w-100","d-flex","flex-row","justify-content-between","mx-3",3,"click"],["name","2066",1,"fs-large"],[1,"d-flex","flex-grow-1","m-3","gap-3","align-items-center",3,"click"],[1,"d-flex","flex-grow-1","flex-column"],["type","info","height","4px",3,"showValue","value","max"],[1,"d-flex","justify-content-between","mt-1"],[1,"fs-small"],["name","2043",1,"fs-large"],[1,"w-25",3,"src","alt"],[1,"flex-grow-1","m-0","text-start"],["role","button","name","2015",1,"fs-large",3,"click"]],template:function(e,n){e&1&&(a(0,"button",1),_("dragenter",function(c){return n.onDragEnter(c)})("dragleave",function(c){return n.onDragLeave(c)})("dragover",function(c){return n.onDragOver(c)})("drop",function(c){return n.dropFiles(c)}),a(1,"input",2,0),_("change",function(c){return n.onFileInputChange(c)}),l(),g(3,kt,4,1,"div",3),g(4,Nt,10,7,"div",4),g(5,Bt,6,6,"div",5),l()),e&2&&(Ti("has-error",n.hasError),d("ngClass",$(7,Mt,n.draggingInProgress)),o(),d("accept",n.accept),o(2),C(!n.fileUploadInProgress&&!n.uploadedFileName?3:-1),o(),C(n.fileUploadInProgress&&!n.uploadedFileName?4:-1),o(),C(n.uploadedFileName&&!n.fileUploadInProgress?5:-1))},dependencies:[V,nt,tt,ut,R,A,pt,O],encapsulation:2,changeDetection:0})};var Ve=t=>({"is-invalid":t}),Ot=(t,i)=>({"is-invalid":t,"form-select-empty":i});function Rt(t,i){t&1&&ee(0)}function At(t,i){if(t&1){let e=S();a(0,"div",3),h(1,"input",5,1),p(3,"async"),a(4,"label",6),b(5),p(6,"cxTranslate"),p(7,"cxTranslate"),p(8,"cxTranslate"),l(),a(9,"button",7),_("click",function(){F(e);let r=N(2);
1return E(r.toggle())}),a(10,"span",8),b(11),p(12,"cxTranslate"),l(),h(13,"post-icon",9),l(),K(14,Rt,1,0,"ng-container",10),l()}if(t&2){let e=s(3),n=N(2);o(),d("formControlName",e.getLabel())("id",e.getLabel())("ngClass",$(23,Ve,e.isInvalidAndTouched()))("placeholder",u(3,13,e.getPlaceholder(e.configurationInfo.renderingType))),D("aria-describedby",e.isInvalidAndTouched()?"feedback-"+e.getLabel():null)("aria-invalid",e.isInvalidAndTouched())("aria-required",!e.isOptional()),o(3),d("for",e.getLabel()),o(),Fi(" ",u(6,15,"product.configuration."+e.getLabel())," ",e.isOptional()?"("+u(7,17,"product.configuration.optional")+")":""," ",e.isOptional()?"":"("+u(8,19,"product.configuration.date-format")+")"," "),o(6),L(u(12,21,"product.configuration.open-calendar")),o(3),d("ngTemplateOutlet",n)}}function Ut(t,i){t&1&&ee(0)}function Gt(t,i){if(t&1&&(a(0,"div",3),h(1,"input",11),p(2,"async"),a(3,"label",6),b(4),p(5,"cxTranslate"),p(6,"cxTranslate"),l(),K(7,Ut,1,0,"ng-container",10),l()),t&2){let e=s(3),n=N(2);o(),d("formControlName",e.getLabel())("id",e.getLabel())("maxlength",e.configurationInfo.maxLength)("ngClass",$(22,Ve,e.isInvalidAndTouched()))("placeholder",u(2,16,e.getPlaceholder(e.configurationInfo.renderingType)))("type",e.configurationInfo.validationType===e.ProductConfigurationValidationType.Price?"number":"text"),D("aria-describedby",e.isInvalidAndTouched()?"feedback-"+e.getLabel():null)("aria-invalid",e.isInvalidAndTouched())("aria-required",!e.isOptional())("max",e.configurationInfo.validationType===e.ProductConfigurationValidationType.Price?e.maxPrice==null?null:e.maxPrice.value:null)("min",e.configurationInfo.validationType===e.ProductConfigurationValidationType.Price?e.minPrice==null?null:e.minPrice.value:null)("step",e.configurationInfo.validationType===e.ProductConfigurationValidationType.Price?.01:null),o(2),d("for",e.getLabel()),o(),ie(" ",u(5,18,"product.configuration."+e.getLabel())," ",e.isOptional()?"("+u(6,20,"product.configuration.optional")+")":""," "),o(3),d("ngTemplateOutlet",n)}}function jt(t,i){if(t&1&&(a(0,"p",4),b(1),p(2,"cxTranslate"),l()),t&2){let e=s(3);o(),L(u(2,1,"product.configuration."+e.getLabel()))}}function zt(t,i){t&1&&ee(0)}function Ht(t,i){if(t&1&&(a(0,"div",3),h(1,"textarea",12),p(2,"async"),a(3,"label",6),b(4),p(5,"cxTranslate"),p(6,"cxTranslate"),l(),K(7,zt,1,0,"ng-container",10),l()),t&2){let e=s(3),n=N(2);o(),d("formControlName",e.getLabel())("id",e.getLabel())("maxlength",e.configurationInfo.maxLength)("ngClass",$(18,Ve,e.isInvalidAndTouched()))("placeholder",u(2,12,e.getPlaceholder(e.configurationInfo.renderingType))),D("aria-describedby",e.isInvalidAndTouched()?"feedback-"+e.getLabel():null)("aria-invalid",e.isInvalidAndTouched())("aria-required",!e.isOptional()),o(2),d("for",e.getLabel()),o(),ie(" ",u(5,14,"product.configuration."+e.getLabel())," ",e.isOptional()?"("+u(6,16,"product.configuration.optional")+")":""," "),o(3),d("ngTemplateOutlet",n)}}function Yt(t,i){if(t&1&&(g(0,At,15,25,"div",3),g(1,Gt,8,24,"div",3),g(2,jt,3,3,"p",4),g(3,Ht,8,20,"div",3)),t&2){let e=s(2);C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Date?0:-1),o(),C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Text||e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Price?1:-1),o(),C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Paragraph?2:-1),o(),C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Area?3:-1)}}function Kt(t,i){if(t&1&&(a(0,"div",15),b(1),p(2,"cxTranslate"),l()),t&2){let e=s(3);d("id","feedback-"+e.getLabel()),o(),x(" ",u(2,2,e.fileUploadFeedbackLabel)," ")}}function $t(t,i){if(t&1){let e=S();a(0,"p",13),b(1),p(2,"cxTranslate"),p(3,"cxTranslate"),l(),a(4,"swisspost-onlineshop-file-drop",14),p(5,"cxTranslate"),p(6,"cxTranslate"),Di("uploadedFileNameChange",function(r){F(e);let c=s(2);return wi(c.imageUploadedFilename,r)||(c.imageUploadedFilename=r),E(r)}),_("uploadFileError",function(){F(e);let r=s(2);return E(r.onImageUploadError())}),l(),g(7,Kt,3,4,"div",15)}if(t&2){let e=s(2);o(),ie(" ",u(2,8,"product.configuration."+e.getLabel())," ",e.isOptional()?"("+u(3,10,"product.configuration.optional")+")":""," "),o(3),Ei("uploadedFileName",e.imageUploadedFilename),d("fileDropContentLabel",u(5,12,"product.configuration.file-upload"))("fileDropProgressLabelOf",u(6,14,"product.configuration.file-upload-of"))("uploadFile",e.uploadImageFile)("hasError",e.fileUploadFeedbackLabel!==void 0),o(3),C(e.fileUploadFeedbackLabel?7:-1)}}function qt(t,i){t&1&&h(0,"option")}function Qt(t,i){if(t&1&&(a(0,"option",17),b(1),p(2,"cxTranslate"),l()),t&2){let e=i.$implicit,n=s(4);d("value",e.code),o(),x(" ",u(2,2,"product.configuration."+n.getSanitizedLabel(e.name))," ")}}function Wt(t,i){t&1&&ee(0)}function Zt(t,i){if(t&1&&(a(0,"div",3)(1,"select",16),g(2,qt,1,0,"option"),J(3,Qt,3,4,"option",17,Z().trackByCode,!0),l(),a(5,"label",6),b(6),p(7,"cxTranslate"),p(8,"cxTranslate"),l(),K(9,Wt,1,0,"ng-container",10),l()),t&2){let e=s(3),n=N(2);o(),d("formControlName",e.getLabel())("id",e.getLabel())("ngClass",Li(15,Ot,e.isInvalidAndTouched(),e.isValueEmpty())),D("aria-describedby",e.isInvalidAndTouched()?"feedback-"+e.getLabel():null)("aria-invalid",e.isInvalidAndTouched())("aria-required",!e.isOptional()),o(),C(e.isOptional()||e.isValueEmpty()?2:-1),o(),X(e.configurationInfo.valuesLabesMap),o(2),d("for",e.getLabel()),o(),ie(" ",u(7,11,"product.configuration."+e.getLabel())," ",e.isOptional()?"("+u(8,13,"product.configuration.optional")+")":""," "),o(3),d("ngTemplateOutlet",n)}}function Jt(t,i){if(t&1&&(a(0,"div",18),h(1,"input",19),a(2,"label",20),b(3),p(4,"cxTranslate"),l()()),t&2){let e=i.$implicit,n=s(4);o(),d("formControlName",n.getLabel())("id",n.getLabel()+"-"+e.code)("value",e.code),o(),d("for",n.getLabel()+"-"+e.code),o(),x(" ",u(4,5,"product.configuration."+e.name)," ")}}function Xt(t,i){if(t&1&&J(0,Jt,5,7,"div",18,Z().trackByCode,!0),t&2){let e=s(3);X(e.configurationInfo.valuesLabesMap)}}function en(t,i){if(t&1&&(g(0,Zt,10,18,"div",3),g(1,Xt,2,0)),t&2){let e=s(2);C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Listbox&&(e.configurationInfo.valuesLabesMap!=null&&e.configurationInfo.valuesLabesMap.length)?0:-1),o(),C(e.configurationInfo.renderingType===e.ProductConfigurationRenderingType.Radio&&(e.configurationInfo.valuesLabesMap!=null&&e.configurationInfo.valuesLabesMap.length)?1:-1)}}function tn(t,i){if(t&1&&(a(0,"div",2),g(1,Yt,4,4)(2,$t,8,16)(3,en,2,2),l()),t&2){let e,n=s();d("formGroup",n.form),o(),C((e=n.configurationInfo.configuratorType)===n.ProductConfigurationType.Text?1:e===n.ProductConfigurationType.File?2:e===n.ProductConfigurationType.Radio?3:-1)}}function nn(t,i){if(t&1&&(b(0),p(1,"cxTranslate")),t&2){let e=s(2);x(" ",u(1,1,e.getConfigurationError.messageKey)," ")}}function on(t,i){if(t&1&&b(0),t&2){let e=s(2);x(" ",e.getConfigurationError.message," ")}}function rn(t,i){if(t&1&&(a(0,"div",21)(1,"span"),g(2,nn,2,3)(3,on,1,1),l()()),t&2){let e=s();d("id","feedback-"+e.getLabel()),o(2),C(e.getConfigurationError.technicalError?3:2)}}
1var Ce=class t{constructor(i,e,n,r){this.cdr=i;this.eventService=e;this.productFeaturesService=n;this.translationService=r;this._subscriptions.push(this.registerEventSubscription(rt),this.registerEventSubscription(at))}cdr;eventService;productFeaturesService;translationService;form;configurationInfo;minPrice;maxPrice;ProductConfigurationType=Se;ProductConfigurationValidationType=Le;ProductConfigurationRenderingType=oe;_subscriptions=[];_fileUploadHttpError=!1;ngOnDestroy(){this._subscriptions.forEach(i=>i.unsubscribe())}isValueEmpty(){return this.getControl()?.value===void 0||this.getControl()?.value===""}get value(){return this.getControl()?.value}get imageUploadedFilename(){return this.value}set imageUploadedFilename(i){this.getControl()?.setValue(i),this.cdr.detectChanges()}get fileUploadFeedbackLabel(){if(this._fileUploadHttpError)return"product.configuration.file-upload-error";if(this.isInvalidAndTouched())return"product.configuration.validation.required"}uploadImageFile=i=>(this._fileUploadHttpError=!1,this.productFeaturesService.uploadImage(i).pipe(T(e=>e)));isInvalidAndTouched(){return(this.getControl()?.invalid&&this.getControl()?.touched)??!1}isOptional(){return!this.getControl()?.hasValidator(M.required)}getLabel(){return this.configurationInfo?.configurationLabel??""}get getConfigurationError(){let i=this.getControl()?.errors,e={technicalError:!1};return i?.technicalError?{technicalError:!0,message:i?.message}:i?.min||i?.max?H(z({},e),{messageKey:"product.configuration.validation.outside-allowed-values"}):i?.email?H(z({},e),{messageKey:"product.configuration.validation.email"}):i?.pattern&&this.configurationInfo?.validationType==="DIRREFILL"?H(z({},e),{messageKey:"product.configuration.validation.phone-number"}):i?.pattern&&this.configurationInfo?.validationType==="REGEX"?H(z({},e),{messageKey:"product.configuration.validation.invalid-format"}):H(z({},e),{messageKey:"product.configuration.validation.required"})}getSanitizedLabel(i){return i?i.includes("language.")?i.replace("language.",""):i.includes(".anrede.frau")?i.replace(".anrede.frau",".a-frau"):i.includes(".anrede.herr")?i.replace(".anrede.herr",".a-herr"):i:""}onImageUploadError(){this._fileUploadHttpError=!0,this.cdr.detectChanges()}trackByCode(i,e){return`${e.code}_${e.name}`}getPlaceholder(i){return this.configurationInfo?.placeHolder?di(this.configurationInfo.placeHolder):i==="DATE"?this.translationService.translate("product.configuration."+this.getLabel()).pipe(fi(e=>this.isOptional()?e:this.translationService.translate("product.configuration.date-format").pipe(T(n=>`${e} (${n})`)))):this.translationService.translate("product.configuration."+this.getLabel())}getControl(){return this.form?.controls[this.getLabel()]}registerEventSubscription(i){return this.eventService.get(i).pipe(U(ne),T(e=>e.error),T(e=>this.getTechnicalMessageFromLabel(e.details)),U(ne),Y(e=>{let n=this.getControl();n?.setErrors({technicalError:!0,message:e}),n?.markAsTouched()})).subscribe()}getTechnicalMessageFromLabel(i){if(!(i===void 0||i.length===0)){for(let e of i)if(e.field!==void 0&&e.field===this.getLabel())return e.message}}static \u0275fac=function(e){return new(e||t)(y(B),y(Ri),y(lt),y(Ai))};static \u0275cmp=P({type:t,selectors:[["swisspost-onlineshop-product-configuration-input"]],hostAttrs:["ngSkipHydration","true"],inputs:{form:"form",configurationInfo:"configurationInfo",minPrice:"minPrice",maxPrice:"maxPrice"},decls:3,vars:1,consts:[["invalidFeedback",""],["datePicker","ngbDatepicker"],[3,"formGroup"],[1,"form-floating"],[1,"my-2"],["maxlength","10","ngbDatepicker","",1,"form-control","form-control-lg",3,"formControlName","id","ngClass","placeholder"],[1,"form-label",3,"for"],["type","button",1,"ngb-dp-open","d-flex","align-items-center","justify-content-center","btn","btn-tertiary","me-2",3,"click"],[1,"visually-hidden"],["name","3203",1,"fs-large"],[4,"ngTemplateOutlet"],[1,"form-control","form-control-lg",3,"formControlName","id","maxlength","ngClass","placeholder","type"],["cols","30","rows","5",1,"form-control","form-control-lg",3,"formControlName","id","maxlength","ngClass","placeholder"],[1,"mb-1","fw-normal","fs-regular","text-secondary"],["accept",".png,.jpg,.jpeg,.gif",3,"uploadedFileNameChange","uploadFileError","uploadedFileName","fileDropContentLabel","fileDropProgressLabelOf","uploadFile","hasError"],[1,"invalid-feedback","d-block",3,"id"],[1,"form-select","form-select-lg",3,"formControlName","id","ngClass"],[3,"value"],[1,"form-check","align-items-center"],["type","radio",1,"form-check-input",3,"formControlName","id","value"],[1,"form-check-label","fw-light","fs-bigger-regular",3,"for"],[1,"invalid-feedback",3,"id"]],template:function(e,n){e&1&&(g(0,tn,4,2,"div",2),K(1,rn,4,2,"ng-template",null,0,Ni)),e&2&&C(n.form&&n.configurationInfo?0:-1)},dependencies:[Zi,$i,qi,Ui,Ki,zi,Gi,ji,Qi,Yi,Hi,V,R,Xi,Ji,ge,A,Vi,ue,O],encapsulation:2})};var an=(t,i,e)=>({"mb-3":t,"mb-1":i,"d-none":e});function ln(t,i){if(t&1&&(a(0,"div",0),h(1,"swisspost-onlineshop-product-configuration-input",1),l()),t&2){let e=i.$implicit,n=i.$index,r=i.$count,c=s(2);d("ngClass",Mi(5,an,n<r-1&&e.renderingType!==c.ProductConfigurationRenderingType.Paragraph,n<r-1&&e.renderingType===c.ProductConfigurationRenderingType.Paragraph,c.shouldBeHidden(e))),o(),d("configurationInfo",e)("form",c.configurationValuesFormGroup())("minPrice",c.minPrice())("maxPrice",c.maxPrice())}}function cn(t,i){if(t&1&&J(0,ln,2,9,"div",0,Z().trackByLabel,!0),t&2){let e=s();X(e.configurationInfos())}}var be=class t{constructor(i){this.cdr=i;Ci(()=>{let e=this.configurationValuesFormGroup();if(this.recipientSubscription?.unsubscribe(),e){let n=e.controls[q.recipientControlId];n&&(this.sendEmailSwitch(n.value),this.recipientSubscription=n.valueChanges.pipe(Y(r=>this.sendEmailSwitch(r))).subscribe())}})}cdr;configurationValuesFormGroup=te();configurationInfos=te([]);minPrice=te();maxPrice=te();ProductConfigurationRenderingType=oe;recipientSubscription;controlsToHide=Bi(()=>{let i=this.configurationValuesFormGroup();return i?Object.keys(i.controls).filter(e=>q.recipientControlToHideIds.includes(e)).map(e=>
1i.controls[e]).filter(Boolean):[]});hiddenControls=[];ngOnDestroy(){this.recipientSubscription?.unsubscribe()}trackByLabel(i,e){return e.configurationLabel}shouldBeHidden(i){let e=this.configurationValuesFormGroup()?.controls[i.configurationLabel];return e?this.hiddenControls.includes(e):!1}sendEmailSwitch(i){i==="recipient"?this.showRecipientControls():this.hideRecipientControls()}hideRecipientControls(){this.controlsToHide().forEach(i=>i.disable()),this.hiddenControls=this.controlsToHide(),this.cdr.detectChanges()}showRecipientControls(){this.controlsToHide().forEach(i=>i.enable()),this.hiddenControls=[],this.cdr.detectChanges()}static \u0275fac=function(e){return new(e||t)(y(B))};static \u0275cmp=P({type:t,selectors:[["swisspost-onlineshop-product-configuration"]],inputs:{configurationValuesFormGroup:[1,"configurationValuesFormGroup"],configurationInfos:[1,"configurationInfos"],minPrice:[1,"minPrice"],maxPrice:[1,"maxPrice"]},decls:1,vars:1,consts:[[3,"ngClass"],[3,"configurationInfo","form","minPrice","maxPrice"]],template:function(e,n){e&1&&g(0,cn,2,0),e&2&&C(n.configurationValuesFormGroup()&&n.configurationInfos().length?0:-1)},dependencies:[V,Ce],encapsulation:2})};function sn(t,i){if(t&1&&(a(0,"div",6)(1,"div",7)(2,"div",8),b(3),p(4,"date"),l()(),a(5,"div",9),h(6,"img",10),l()()),t&2){let e=s();o(),d("ngClass",e.getClass(e.language)),o(2),x(" ",ki(4,4,e.currentDate,"dd.MM.yyyy")," "),o(3),d("src",e.getUploadedImageUrl(e.image),pe)("alt",e.image)}}var ve=class t{constructor(i,e){this.activeModal=i;this.occEndpoint=e;this.currentDate=new Date}activeModal;occEndpoint;language;image;currentDate;closeModal(){this.activeModal.close()}getClass(i){switch(i){case"fr":return"gelbIdPreviewTopfr";case"it":return"gelbIdPreviewTopit";default:return"gelbIdPreviewTopde"}}getUploadedImageUrl(i){return this.occEndpoint.buildUrl("getImage",{urlParams:{filename:i}})}static \u0275fac=function(e){return new(e||t)(y(et),y(me))};static \u0275cmp=P({type:t,selectors:[["swisspost-onlineshop-yellow-identification-preview"]],inputs:{language:"language",image:"image"},decls:10,vars:7,consts:[[1,"mx-4","mt-3","mb-4"],[1,"row","mx-2"],[1,"col-12","mb-3","d-flex","justify-content-end","pe-0"],["id","search-modal-close",1,"btn","btn-tertiary","overflow-visible","p-0","text-secondary",3,"click"],["name","2043",1,"fs-big"],[1,"col-12","d-flex","justify-content-center"],["id","previewImage","tabindex","-1",2,"max-height","1161px"],["id","gelbIdPreviewTop",3,"ngClass"],[1,"yellowIdSysdate"],["id","gelbIdPreviewBottom"],[1,"logoYellowID",3,"src","alt"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),p(4,"cxTranslate"),_("click",function(){return n.closeModal()}),b(5),p(6,"cxTranslate"),h(7,"post-icon",4),l()(),a(8,"div",5),g(9,sn,7,7,"div",6),l()()()),e&2&&(o(3),D("aria-label",u(4,3,"common.close")),o(2),x(" ",u(6,5,"common.close")," "),o(4),C(n.language&&n.image?9:-1))},dependencies:[R,V,A,O,Oi],styles:["#previewImage[_ngcontent-%COMP%]{width:786px;position:relative}.gelbIdPreviewTopit[_ngcontent-%COMP%]{background-image:url(/yellowid/it.jpeg);height:918px}.gelbIdPreviewTopde[_ngcontent-%COMP%]{background-image:url(/yellowid/de.jpeg);height:918px}.gelbIdPreviewTopfr[_ngcontent-%COMP%]{background-image:url(/yellowid/fr.jpeg);height:918px}.yellowIdSysdate[_ngcontent-%COMP%]{position:absolute;top:396px;left:282px;font-size:.75rem;font-weight:700;padding-left:10px;background-color:#c4ccdf}.logoYellowID[_ngcontent-%COMP%]{position:absolute;bottom:40px;left:65px;max-height:50px}"]})};function dn(t,i){if(t&1){let e=S();a(0,"button",1),_("click",function(){let r=F(e),c=s();return E(c.openYellowIdentificationPreview(r))}),a(1,"div",2)(2,"p",3),b(3),p(4,"cxTranslate"),l(),h(5,"post-icon",4),l()()}t&2&&(o(3),L(u(4,1,"product.configuration.open-gid-preview")))}var he=class t{constructor(i){this.modalService=i}modalService;static _logoKey="voucher.logo";static _languageKey="voucher.gid.language";static _companyKey="voucher.gelbeId.companyname";values$;set addToCartForm(i){i&&(this.values$=i.valueChanges.pipe(mi(i.value),T(e=>e.configurationValues),U(ne),T(e=>{if(t.isProductYellowId(e)&&t.isLogoAvailable(e))return e})))}openYellowIdentificationPreview(i){let e=i[t._logoKey],n=i[t._languageKey],r=this.modalService.open(ve,{animation:!0,size:"lg",modalDialogClass:"mt-0",windowClass:"modal-holder"});r.componentInstance.image=e,r.componentInstance.language=n}static isProductYellowId(i){return this._languageKey in i&&this._companyKey in i}static isLogoAvailable(i){return this._logoKey in i?i[this._logoKey]?.includes(".")??!1:!1}static \u0275fac=function(e){return new(e||t)(y(it))};static \u0275cmp=P({type:t,selectors:[["swisspost-onlineshop-yellow-identification-preview-button"]],inputs:{addToCartForm:"addToCartForm"},decls:2,vars:3,consts:[["type","button",1,"btn","btn-secondary","w-100","mt-3","px-3"],["type","button",1,"btn","btn-secondary","w-100","mt-3","px-3",3,"click"],[1,"w-100","d-flex","flex-row","justify-content-between","align-items-center"],[1,"fs-small","fw-normal","m-0"],["name","2114",1,"fs-large"]],template:function(e,n){if(e&1&&(g(0,dn,6,3,"button",0),p(1,"async")),e&2){let r;C((r=u(1,1,n.values$))?0:-1,r)}},dependencies:[R,A,ue,O],encapsulation:2,changeDetection:0})};function pn(t,i){if(t&1&&h(0,"swisspost-onlineshop-product-configuration",2),t&2){let e=s(2);d("configurationValuesFormGroup",e.configurationValuesFormGroup)("configurationInfos",e.visibleConfigurations)("minPrice",e.data.minPrice)("maxPrice",e.data.maxPrice)}}function un(t,i){if(t&1&&(yi(0,1),g(1,pn,1,4,"swisspost-onlineshop-product-configuration",2),h(2,"swisspost-onlineshop-yellow-identification-preview-button",3),_i()),t&2){let e=s();o(),C(e.configurationValuesFormGroup&&e.visibleConfigurations.length?1:-1),o(),d("addToCartForm",e.data.addToCartForm)}}
1var mt=class t{constructor(i,e,n){this.cdr=i;this.formBuilder=e;this.siteContextComponentService=n}cdr;formBuilder;siteContextComponentService;static languageSelectorControlIds=["voucher.gid.language"];data;configurationValuesFormGroup;visibleConfigurations=[];defaultConfigurationValues={};subscription=new si;ngOnDestroy(){this.subscription.unsubscribe()}resetConfigurationForm(){this.configurationValuesFormGroup?.reset(this.defaultConfigurationValues)}updateData(i){this.data=i;let e=i.configurationResponse?.configurationInfos??[],n=Object.keys(this.configurationValuesFormGroup?.controls??{}),r=q.getVisibleProductConfigurations(e).map(k=>k.configurationLabel);(n.length!==r.length||r.some((k,ye)=>k!==n[ye]))&&this.buildConfigurationForm(i)}buildConfigurationForm(i){let e=i.configurationResponse?.configurationInfos;if(!e?.length||!i.addToCartForm){this.configurationValuesFormGroup=void 0,this.visibleConfigurations=[];return}this.visibleConfigurations=q.getVisibleProductConfigurations(e),this.subscription.add(this.siteContextComponentService.getActiveItem(ot.LANGUAGE).pipe(pi(1),Y(n=>{let r={};this.defaultConfigurationValues={},this.visibleConfigurations.forEach(c=>{let k=this.getFormControl(n,c);r[c.configurationLabel]=k,this.defaultConfigurationValues[c.configurationLabel]=k.value}),this.configurationValuesFormGroup=this.formBuilder.group(r),i.addToCartForm.setControl("configurationValues",this.configurationValuesFormGroup),this.cdr.markForCheck()})).subscribe())}getFormControl(i,e){let n;switch(e.configuratorType){case"TEXTFIELD":{n=this.getTextControl(e);break}case"RADIOBUTTON":{n=this.getRadioControl(i,e);break}default:break}return n??=this.formBuilder.control(e.configurationValue),e.notNull&&n.addValidators(M.required),n}getTextControl(i){switch(i.validationType){case"DIRREFILL":return this.formBuilder.control(i.configurationValue,M.pattern(/(\b(0041|0)|\B\+41)(\s?\(0\))?(\s)?[1-9]{2}(\s)?\d{3}(\s)?\d{2}(\s)?\d{2}\b/));case"PRICE":{let e=this.data?.price;e&&(e.value=i.configurationValue===void 0?e?.value:Number(i.configurationValue));let n=this.getMinPrice(e?.value),r=this.formBuilder.control(n);return this.data?.minPrice?.value&&r.addValidators(M.min(this.data.minPrice.value)),this.data?.maxPrice?.value&&r.addValidators(M.max(this.data.maxPrice.value)),r}case"EMAIL":return this.formBuilder.control(i.configurationValue,M.email);case"REGEX":if(i.validationSetting)return this.formBuilder.control(i.configurationValue,M.pattern(i.validationSetting))}}getRadioControl(i,e){let n;switch(e.renderingType){case"RADIO":{let r=e.configurationValue??e.valuesLabesMap?.[0]?.code;n=this.formBuilder.control(r);break}case"LISTBOX":{t.languageSelectorControlIds.includes(e.configurationLabel)&&(n=this.formBuilder.control(e.configurationValue??t.getActiveLanguage(i)));break}}return n}getMinPrice(i){return i?this.data?.minPrice?.value?i>this.data.minPrice.value?i:this.data?.minPrice?.value??0:i??0:this.data?.minPrice?.value??0}static getActiveLanguage(i){return i==="en"?"de":i}static \u0275fac=function(e){return new(e||t)(y(B),y(Wi),y(fe))};static \u0275cmp=P({type:t,selectors:[["ng-component"]],features:[Si([fe])],decls:2,vars:1,consts:[["location","product_page",3,"data","formReset"],["configuration",""],[3,"configurationValuesFormGroup","configurationInfos","minPrice","maxPrice"],[3,"addToCartForm"]],template:function(e,n){e&1&&(a(0,"swisspost-onlineshop-add-to-cart",0),_("data",function(c){return n.updateData(c)})("formReset",function(){return n.resetConfigurationForm()}),g(1,un,3,2,"ng-container",1),l()),e&2&&(o(),C(n.data?1:-1))},dependencies:[ct,be,he],encapsulation:2,changeDetection:0})};export{mt as ProductAddToCartComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.