1this.BX=this.BX||{},this.BX.Citrus=this.BX.Citrus||{},this.BX.Citrus.Vue=this.BX.Citrus.Vue||{},function(a){'use strict';let b={name:"CitrusLocationSelector",data(){return{parameters:{defaultLocations:[],locationSize:6,searchLength:3},query:"",locations:[],listSize:10,loading:!1,submitError:!1,showMessage:"",cancelRequest:!1,startSearch:!1,isDifferent:!1}},created(){this.parameters.hasOwnProperty("defaultLocations")||(this.parameters.defaultLocations=[]),this.setDefault(!0)},computed:{loc(){return BX.Vue.getFilteredPhrases("CT_CITRUS_LOCATION_SELECTOR_")},hasNext(){return 1<Math.ceil(this.locations.length/this.listSize)}},watch:{query(a,b){return a=(a+"").trim(),b=(b+"").trim(),this.isDifferent=a===b,0>=a.length||a.length<this.parameters.searchLength?void this.setDefault(!0):void(a.length>=this.parameters.searchLength&&!this.isDifferent&&this.searchLocation(a))}},methods:{setDefault(a){this.submitError=!1,this.showMessage="",this.listSize=this.parameters.locationSize,!0===a&&(this.locations=this.parameters.defaultLocations)},checkRequest(a){return!(200!==a.status)||void(this.submitError=!0,this.showMessage=this.loc.CT_CITRUS_LOCATION_SELECTOR_UNKNOWN_ERROR)},searchLocation(a){if(!0===this.startSearch)return!1;let b="string"==typeof a?a:(this.query+"").trim();BX.rest.callMethod("citrus.location.search",{version:2,phrase:b},a=>{a.answer.hasOwnProperty("result")&&Array.isArray(a.answer.result)&&(this.locations=a.answer.result,0>=this.locations.length&&(this.showMessage=this.loc.CT_CITRUS_LOCATION_SELECTOR_EMPTY_LIST))},a=>{this.loading=!0,this.startSearch=!0,this.setDefault(!1),a.onloadend=a=>{let b=a.hasOwnProperty("currentTarget")?a.currentTarget:a.target;this.checkRequest(b),this.loading=!1,this.startSearch=!1,!0===this.isDifferent&&this.searchLocation()}})},onChangeCity(a){BX.rest.callMethod("citrus.location.set",a,b=>{b.answer.hasOwnProperty("result")&&!0===b.answer.result&&(this.setDefault(!0),BX.onCustomEvent("Citrus.City:onSelect",[a.DISPLAY]))},a=>{this.loading=!0,a.onloadend=a=>{let b=a.hasOwnProperty("currentTarget")?a.currentTarget:a.target;this.checkRequest(b),this.loading=!1}})},onNextPage(){return!0!==this.loading&&!0===this.hasNext&&void(this.listSize+=this.parameters.locationSize)},onClearSearch(){this.query=""}}};a.Selector=b,a.default={Selector:b}}(this.BX.Citrus.Vue.Location=this.BX.Citrus.Vue.Location||{},BX); 2//# sourceMappingURL=script.js.map
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.