1"use strict";(self.webpackChunkariadna=self.webpackChunkariadna||[]).push([["default-src_app_shared_components_content-chooser_content-chooser_component_ts-src_template_s-e756fa"],{67641:(D,f,e)=>{e.d(f,{y:()=>v});var t=e(54438),h=e(89417),C=e(84572),g=e(96354),p=e(23294),I=e(25558),a=e(7673),d=e(73955),i=e(27659),_=e(6922),l=e(23971),y=e(89079),M=e(48125),E=e.n(M),L=e(90693),n=e(59640),s=e(31576);function r(m,B){if(1&m){const o=t.RV6();t.j41(0,"ardn-select2-optional-input",2),t.nI1(1,"translate"),t.bIt("ngModelChange",function(O){t.eBV(o);const P=t.XpG();return t.Njj(P.valueChanged(O))}),t.k0s()}if(2&m){const o=t.XpG();t.Y8G("data",o.orderContents)("complementaryOptionLabel",o.customContentLabel)("placeholder",t.bMT(1,5,"COMMON.SELECT_SHIPMENT_CONTENT_PLACEHOLDER"))("ngModel",o.value),t.BMQ("id",o.id())}}function u(m,B){1&m&&t.nrm(0,"div",1)}let v=(()=>{class m{constructor(o,c,O,P,R){this.orderContentService=o,this.changeDetectionRef=c,this.store=O,this.countryService=P,this.translateService=R,this.id=(0,t.hFB)(null),this.productId=(0,t.hFB)(null),this.senderCountryId=(0,t.hFB)(null),this.receiverCountryId=(0,t.hFB)(null),this.allowCustomContent=(0,t.hFB)(!0),this.customContentLabel=null,this.destroyRef=(0,t.WQX)(t.abz),this.propagateChange=()=>{},this.propagateTouched=()=>{}}ngOnInit(){(0,C.z)([this.store.select(l.qS),this.store.select(l.ji),this.store.select(l.Nz)]).pipe((0,g.T)(([o,c,O])=>[this.productId()??o,this.senderCountryId()??c,this.receiverCountryId()??O]),(0,p.F)(E()),(0,I.n)(([o,c,O])=>(0,C.z)([(0,a.of)(o),this.countryService.getCountryByCountryId(c),this.countryService.getCountryByCountryId(O)])),(0,I.n)(([o,c,O])=>this.orderContentService.getOrderContents({productId:o,senderCountry:c?.isoCode,receiverCountry:O?.isoCode})),(0,y.pQ)(this.destroyRef)).subscribe(o=>{this.definitions=o.contentDefinitions,this.orderContents=this.definitions.map(c=>({label:c.label,canonical:c.canonical})),this.isOtherContentAllowed=o.allowOtherContent,this.customContentLabel=this.isOtherContentAllowed&&this.allowCustomContent()?this.translateService.instant("ORDER.CONTENT_OTHER_LABEL"):null,this.resolveValue(),this.changeDetectionRef.markForCheck()})}valueChanged(o){const c=(0,_.k)(this.definitions,o);if(c)return this.pendingValue=c.canonical,this.value=c.label,void this.propagate(c.canonical);this.pendingValue=o,this.value=this.customContentLabel,this.propagate(o||null)}registerOnChange(o){this.propagateChange=o}registerOnTouched(o){this.propagateTouched=o}writeValue(o){this.pendingValue=o,this.lastPropagatedValue=o,this.resolveValue()}resolveValue(){if(!this.definitions)return;if(!this.pendingValue)return void(this.value=null);const o=(0,_.k)(this.definitions,this.pendingValue);if(o)return this.value=o.label,void this.propagate(o.canonical);this.customContentLabel?this.value=this.customContentLabel:(this.value=null,this.propagate(null))}propagate(o){o!==this.lastPropagatedValue&&(this.lastPropagatedValue=o,this.prop
1agateChange(o))}static{this.\u0275fac=function(c){return new(c||m)(t.rXU(L.z),t.rXU(t.gRc),t.rXU(n.il),t.rXU(s.o),t.rXU(d.c$))}}static{this.\u0275cmp=t.VBU({type:m,selectors:[["ardn-content-chooser"]],inputs:{id:[1,"id"],productId:[1,"productId"],senderCountryId:[1,"senderCountryId"],receiverCountryId:[1,"receiverCountryId"],allowCustomContent:[1,"allowCustomContent"]},standalone:!0,features:[t.Jv_([{provide:h.kq,useExisting:(0,t.Rfq)(()=>m),multi:!0}]),t.aNF],decls:2,vars:1,consts:[[3,"data","complementaryOptionLabel","placeholder","ngModel"],[1,"skeleton"],[3,"ngModelChange","data","complementaryOptionLabel","placeholder","ngModel"]],template:function(c,O){1&c&&t.DNE(0,r,2,7,"ardn-select2-optional-input",0)(1,u,1,0,"div",1),2&c&&t.vxM(O.orderContents?0:1)},dependencies:[d.h,d.D9,i.e,h.YN,h.BC,h.vS],styles:[".skeleton[_ngcontent-%COMP%]{height:46px;border-radius:8px;background:linear-gradient(90deg,#fafafa 25%,#f0f0f0,#fafafa 75%);background-size:200% 100%;animation:_ngcontent-%COMP%_skeleton-shimmer 1.4s ease-in-out infinite}@keyframes _ngcontent-%COMP%_skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}"],changeDetection:0})}}return m})()},27659:(D,f,e)=>{e.d(f,{e:()=>M});var t=e(54438),h=e(89417),C=e(21413),g=e(18359),p=e(70152),I=e(23294),a=e(60177),d=e(38171),i=e(5942),_=e(73199);const l=["inputElement"];function y(E,L){if(1&E){const n=t.RV6();t.j41(0,"ardn-drop-down",3),t.bIt("ngModelChange",function(r){t.eBV(n);const u=t.XpG();return t.Njj(u.selectionChanged(r))})("currentSearchValue",function(r){t.eBV(n);const u=t.XpG();return t.Njj(u.setCurrentContentSearchValue(r))}),t.k0s()}if(2&E){const n=t.XpG();t.Y8G("dataSource",n.dataSource)("ngModel",n.initOption)("searchEnabled",!0)("complementaryOption",n.complementaryOption)("placeholder",n.placeholder())("displayCountSummary",!1)("zIndex","17000000")("parentName","select2-optional-input")}}let M=(()=>{class E{constructor(n,s,r){this.changeDetector=n,this.dataSourceArray=s,this.platformId=r,this.placeholder=(0,t.hFB)(),this.data=(0,t.hFB)(),this.complementaryOptionLabel=(0,t.hFB)(),this.value=null,this.inputValue="",this.showInput=!1,this.complementaryOption=null,this.otherInputKeyUp=new C.B,this.subs=new g.yU,this.propagateChange=()=>{},this.propagateTouched=()=>{},this.subs.add(this.otherInputKeyUp.pipe((0,p.B)(500),(0,I.F)()).subscribe(u=>{if((0,a.UE)(this.platformId)){const v=u.target.value;this.storeCustomContentText(v),this.propagateChange(v),this.propagateTouched()}}))}ngOnDestroy(){this.subs.unsubscribe()}ngOnChanges(n){!this.data()||!n.data||(this.complementaryOptionLabel()&&!this.findComplementaryOption()&&this.data().push({label:this.complementaryOptionLabel()}),this.complementaryOption=this.complementaryOptionLabel()?this.findComplementaryOption():null,this.dataSource=this.dataSourceArray.create(this.data(),"label"),this.initOption=null,this.value&&this.writeValue(this.value))}findComplementaryOption(){return this.data().find(n=>n.label===this.complementaryOptionLabel())}selectionChanged(n){this.propagateTouched(),n.label!==this.complementaryOptionLabel()?this.selectionChangedToCommonOption(n.label):this.selectionChangedToComplementaryOption(),this.changeDetector.markForCheck();const s=localStorage.getItem(d.B),r=JSON.parse(s);if((0,a.UE)(this.platformId)){const u=n.canonical??null;r?(r.label=n.label,r.canonical=u,localStorage.setItem(d.B,JSON.stringify(r))):localStorage.setItem(d.B,JSON.stringify({label:n.label,canonical:u,text:""}))}}selectionChangedToCommonOption(n){this.showInput=!1,this.writeAndPropagateValue(n)}selectionChangedToComplementaryOption(){this.showInput=!0,this.writeValue(this.complementaryOptionLabel()),setTimeout(()=>{this.inputElement.nativeElement.focus()},0)}writeAndPropagateValue(n){this.writeValue(n),this.propagateChange(n)}registerOnChange(n){this.propagateChange=n}writeValue(n){if(!n)return this.initOption=null,this.value=null,this.showInput=!1,void this.changeDetector.markForCheck();const s=this.data()?.find(v=>v.label===n);if(!s)return;if(this.initOption=s,this.value=n,s.label!==this.complementaryOptionLabel())return void(this.showInput=!1);this.showInput=!0;const r=localStorage?.getItem(d.B),u=JSON.parse(r);u&&void 0!==u.text&&u.text.length&&(this.inputValue=u.text),setTimeout(()=>
1{this.propagateChange(this.inputValue)},0)}setCurrentContentSearchValue(n){this.inputValue=n,this.storeCustomContentText(n),this.changeDetector.markForCheck()}storeCustomContentText(n){if(!(0,a.UE)(this.platformId))return;const s=JSON.parse(localStorage.getItem(d.B))??{label:this.complementaryOptionLabel(),canonical:null,text:""};s.text=n,localStorage.setItem(d.B,JSON.stringify(s))}registerOnTouched(n){this.propagateTouched=n}static{this.\u0275fac=function(s){return new(s||E)(t.rXU(t.gRc),t.rXU(_.m),t.rXU(t.Agw))}}static{this.\u0275cmp=t.VBU({type:E,selectors:[["ardn-select2-optional-input"]],viewQuery:function(s,r){if(1&s&&t.GBs(l,7),2&s){let u;t.mGM(u=t.lsd())&&(r.inputElement=u.first)}},inputs:{placeholder:[1,"placeholder"],data:[1,"data"],complementaryOptionLabel:[1,"complementaryOptionLabel"]},standalone:!0,features:[t.Jv_([{provide:h.kq,useExisting:(0,t.Rfq)(()=>E),multi:!0}]),t.OA$,t.aNF],decls:3,vars:4,consts:[["inputElement",""],["ngClass","select2dropdown--small","displayField","label",3,"dataSource","ngModel","searchEnabled","complementaryOption","placeholder","displayCountSummary","zIndex","parentName"],["id","input",1,"input","optional-input",3,"keyup","placeholder","hidden","value"],["ngClass","select2dropdown--small","displayField","label",3,"ngModelChange","currentSearchValue","dataSource","ngModel","searchEnabled","complementaryOption","placeholder","displayCountSummary","zIndex","parentName"]],template:function(s,r){if(1&s){const u=t.RV6();t.DNE(0,y,1,8,"ardn-drop-down",1),t.j41(1,"input",2,0),t.bIt("keyup",function(m){return t.eBV(u),t.Njj(r.otherInputKeyUp.next(m))}),t.k0s()}2&s&&(t.vxM(r.dataSource?0:-1),t.R7$(),t.Y8G("placeholder",r.complementaryOptionLabel())("hidden",!r.showInput)("value",r.inputValue))},dependencies:[h.YN,h.BC,h.vS,i.v],styles:[".input[_ngcontent-%COMP%]{margin-top:5px}"],changeDetection:0})}}return E})()},6922:(D,f,e)=>{function t(h,C){const g=C?.trim();return g&&h?.length?h.find(p=>p?.canonical?.trim()===g)??h.find(p=>p?.label?.trim()===g)??null:null}e.d(f,{k:()=>t})},90693:(D,f,e)=>{e.d(f,{z:()=>g});var t=e(96354),h=e(54438),C=e(18286);let g=(()=>{class p{constructor(a){this.apiClientService=a}getOrderContents(a){return this.apiClientService.get("order/content",!0,{...a}).pipe((0,t.T)(d=>this.normalize(d)))}normalize(a){const d=a?.contents??[];return{contents:d,allowOtherContent:a?.allowOtherContent??!1,contentDefinitions:a?.contentDefinitions?.length?a.contentDefinitions:d.map(i=>({label:i,canonical:i}))}}static{this.\u0275fac=function(d){return new(d||p)(h.KVO(C.f))}}static{this.\u0275prov=h.jDH({token:p,factory:p.\u0275fac,providedIn:"root"})}}return p})()},83074:(D,f,e)=>{e.d(f,{O:()=>I});var t=e(96354),h=function(a){return a.PRODUCT_UNAVAILABLE="PRODUCT_UNAVAILABLE",a.CARRIER_DISABLED="CARRIER_DISABLED",a.NO_PRICE="NO_PRICE",a.PARAMETERS="PARAMETERS",a}(h||{}),C=e(54438),g=e(18286),p=e(11166);let I=(()=>{class a{constructor(i,_){this.apiClientService=i,this.dateParser=_}getResults(i){return this.apiClientService.get("order/productTemplate",!0,i).pipe((0,t.T)(_=>({..._,results:_.results.map(l=>({...l,length:parseFloat(l.length),width:parseFloat(l.width),height:parseFloat(l.height),weight:parseFloat(l.weight),id:parseFloat(l.id),productId:parseFloat(l.productId),quantity:parseFloat(l.quantity),receiverCountryId:parseFloat(l.receiverCountryId),senderCountryId:parseFloat(l.senderCountryId),carrierName:l.carrierName??null,created:this.dateParser.parse(l.created),isActive:l.isActive??!0,outdatedReason:this.resolveOutdatedReason(l),isHidden:l.isHidden??!1}))})))}addTemplate(i){return this.apiClientService.post("order/productTemplate",!0,i)}resolveOutdatedReason(i){if(i.isActive??1)return null;const _=i.outdatedReason;return _&&Object.values(h).includes(_)?_:h.PRODUCT_UNAVAILABLE}hideTemplate(i){return this.apiClientService.post(`order/productTemplate/hide?id=${i}`,!0,{},void 0,!1,"text")}unhideTemplate(i){return this.apiClientService.post(`order/productTemplate/unhide?id=${i}`,!0,{},void 0,!1,"text")}deleteTemplate(i){return this.apiClientService.delete("order/productTemplate",!0,{id:i},!1,"text")}static{this.\u0275fac=function(_){return new(_||a)(C.KVO(g.f),C.KVO(p.l))}}static{this.\u0275prov=C.jDH({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})()}}]);
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.