PageSourceSearch

https://www.marhabaservices.com/on/demandware.static/Sites-dnata-U…/v1790215282271/js/app/global/CountBlock.js

js marhabaservices.com collected 2026-09-24 23:13:56 UTC 12,547 bytes, 1 lines download raw bytes

1(self.webpackChunkapp_dnata=self.webpackChunkapp_dnata||[]).push([[4565],{61141:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return b}});var r=n(70491),s=n(20058),o=n(92076),i=n(95153),c=n(4008);function a(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,d(r.key),r)}}function d(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}function h(t,e,n){return e=p(e),function(t,e){if(e&&("object"==u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,n||[],p(t).constructor):e.apply(t,n))}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}var b=function(t){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r={maxTotalCount:1/0,minTotalCount:1,service:""};return h(this,e,[t,(0,o.$)(r,n)])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(e,t),n=e,(r=[{key:"initCache",value:function(){this.classes={},this.classes.disabled="m-disabled",this.classes.hidden="hidden",this.classes.countField="js-count_field",this.classes.countBlock="js-count_block",this.classes.caption="js-caption",this.classes.addCountArrow="js-count_add",this.classes.subtractCountArrow="js-count_subtract",this.selectors.countersError=this.element.querySelector(".js-counters-error"),this.selectors.countBlocks=this.element.querySelectorAll(".".concat(this.classes.countBlock)),this.selectors.addCountArrows=this.element.querySelectorAll(".".concat(this.classes.addCountArrow)),this.selectors.subtractCountArrows=this.element.querySelectorAll(".".concat(this.classes.subtractCountArrow)),this.selectors.countFields=this.element.querySelectorAll(".".concat(this.classes.countField))}},{key:"initState",value:function(){this.initArrows()}},{key:"initArrows",value:function(){var t=this;this.selectors.countBlocks.forEach(function(e){var n=e.querySelector(".".concat(t.classes.countField));if(n){var r=parseInt(n.value);r>=parseInt(n.max)&&e.querySelector(".".concat(t.classes.addCountArrow)).classList.add(t.classes.disabled),r<=parseInt(n.min)&&e.querySelector(".".concat(t.classes.subtractCountArrow)).classList.add(t.classes.disabled)}})}},{key:"bindEvents",value:function(){(0,s.on)("click",this.selectors.addCountArrows,this.addCount.bind(this)),(0,s.on)("click",this.selectors.subtractCountArrows,this.subtractCount.bind(this)),c.Event.on("countBlock.update",this.update,this),c.Event.on("countBlock.checkQuantity",this.checkQuantity,this)}},{key:"update",value:function(t){var e=this;this.options.service=t.service,Object.keys(t.config).forEach(function(n){var r=t.config[n];if("maxCount"===n)e.options.maxTotalCount=t.config.maxCount;else if("minCount"===n)e.options.minTotalCount=t.config.minCount;else if("object"===u(r)){var s=e.element.querySelector(".".concat(e.classes.countBlock,'[data-id="').concat(n,'"]'));if(s){var o=s.querySelector(".".concat(e.classes.caption));o&&(o.innerHTML=r.caption||""),"enabled"in r&&(r.enabled||(s.querySelector(".".concat(e.classes.countField)).value=0),s.classList.toggle(e.classes.disabled,!r.enabled))}}})}},{key:"checkQuantity",value:function(){var t=this.getTotalCount();t===this.options.maxTotalCount?(this.selectors.countersError.innerHTML=i.dw(this.options.maxError,{service:this.options.service}),this.selectors.countersError.classList.remove(this.classes.hidden),this.toggleAddArrows(!1),c.Event.emit("pdp.passengersChanged",!0)):t>this.options.maxTotalCount?(this.selectors.countersError.innerHTML=i.dw(this.options.excessError,{service:this.options.service}),this.selectors.countersError.classList.remove(this.classes.hidden),this.toggleAddArrows(!1),c.Event.emit("pdp.passengersChanged",!1)):t<this.options.minTotalCount?(this.selectors.countersError.innerHTML=i.dw(this.options.minError,{service:this.options.service}),this.selectors.countersError.classList.remove(this.classes.hidden),this.toggleAddArrows(!0),c.Event.emit("pdp.passengersChanged",!1)):(this.toggleAddArrows(!0),this.selectors.countersError.classList.add(this.classes.hidden),c.Event.emit("pdp.passengersChanged",!0))}},{key:"toggleAddArrows",value:function(t){var e=this;this.selectors.addCountArrows.forEach(function(n){var r=n.closest(".".concat(e.classes.countBlock)).querySelector(".".concat(e.classes.countField));t?Number(r.max)>Number(r.value)&&n.classList.remove(e.classes.disabled):n.classList.add(e.classes.disabled)})}},{key:"subtractCount",value:function(t){var e=t.currentTarget.closest(".".concat(this.classes.countBlock)),n=e.querySelector(".".concat(this.classes.countField));if(!e.classList.contains(this.classes.disabled)&&n){var r=Number(n.value),s=e.querySelector(".".concat(this.classes.addCountArrow));n.min<r&&(n.value=isNaN(r)?0:--r,this.toggleAddArrows(!0),s.classList.remove(this.classes.disabled),+n.min===r&&t.currentTarget.classList.add(this.classes.disabled))}}},{key:"addCount",value:function(t){var e=this,n=t.currentTarget.closest(".".concat(this.classes.countBlock)),r=n.querySelector(".".concat(this.classes.countField)),s=this.getTotalCount();if(!n.classList.contains(this.classes.disabled)&&r){var o=Number(r.value),i=n.querySelector(".".concat(this.classes.subtractCountArrow));r.max>o&&(this.options.maxTotalCount>s&&(r.value=isNaN(o)?0:++o,i.classList.remove(this.classes.disabled),+r.max===o&&t.currentTarget.classList.add(this.classes.disabled)),this.options.maxTotalCount===s+1&&this.selectors.addCountArrows.forEach(function(t){t.classList.add(e.classes.disabled)}))}}},{key:"getTotalCount",value:function(){return a(this.selectors.countFields).reduce(function(t,e){var n=+e.value;return t+=isNaN(n)?0:n},0)}}])&&f(n.prototype,r),l&&f(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,l}(r.A)},95153:function(t,e,n){"use strict";n.r(e),n.d(e,{A8:function(){return O},F:function(){return m},H:function(){return r},H5:function(){return F},Hh:function(){return R},Jc:function(){return T},Jx:function(){return C},K3:function(){return k},P:function(){return s},VB:function(){return L},Wx:function(){return x},YZ:function(){return E},dw:function(){return j},nK:function(){return u},xl:function(){return P}});var r={},s={},o=/{{ *?(?:(?:([\w$]+) *?\((.*?)\) *?([\w$]*))|(?:([\w$]+) *?\((.*?)\) *?\/)|(?:([\w$@].*?) *?((?:\| *?[\w$]+ *)*))|(?:\/ *?([\w$]+))|(?:# *?([\w$]+))|(?:!\-\-[^]+?\-\-)) *?}}\n?/g,i={s:"{{",e:"}}"},c=/@(?:((?:\.\.\/)+)|([\w$]+):)?/g,a=o,l=i;function u(t){f(t[0],t[1]),o=a,i=l}function f(t,e){var n=t+a.source.slice(l.s.length,0-(l.e.length+3))+e+"\\n?",r=a.lastIndex;l={s:t,e:e},(a=RegExp(n,"g")).lastIndex=r}function d(t,e,n){return t.replace(c,function(t,r,s){return"hvals"+(r&&r.length?e[n-r.length/3-1].id:s||"")+"."})}var h={if:{helperStart:function(t){return"if("+t+"){"},helperEnd:function(){return"}"},blocks:{else:function(){return"}else{"}}},each:{helperStart:function(t,e){return"for(var i=0;
1i<"+t+".length; i++){tR+=(function(hvals){var tR='';var hvals"+e+"=hvals;"},helperEnd:function(t){return"return tR})({this:"+t+"[i],index:i})};"}},foreach:{helperStart:function(t,e){return"for(var key in "+t+"){if(!"+t+".hasOwnProperty(key)) continue;tR+=(function(hvals){var tR='';var hvals"+e+"=hvals;"},helperEnd:function(t){return"return tR})({this:"+t+"[key], key: key})};"}},log:{selfClosing:function(t){return"console.log("+t+");"}},tags:{selfClosing:function(t){return f(t.slice(0,t.indexOf(",")).trim(),t.slice(t.indexOf(",")+1).trim()),""}},js:{selfClosing:function(t){return t+";"}}},v={"&":"&amp;","<":"&lt;",'"':"&quot;","'":"&#39;"};function p(t){return v[t]}var y=/[&<"']/g,b=/[&<"']/,m={e:function(t){var e=String(t);return b.test(e)?e.replace(y,p):e}},g={},w={start:"",end:""};function C(t){if("clear"===t)g={};else for(var e in t)t.hasOwnProperty(e)&&(g[e]=t[e]);!function(){for(var t in w={start:"",end:""},g)g.hasOwnProperty(t)&&g[t]&&(w.start+="Sqrl.F."+t+"(",w.end+=")")}()}var S=!0;function k(t){return S=t}function A(t,e){var n,r=!1,s="",o="";if(e&&""!==e){n=e.split("|");for(var i=0;i<n.length;i++)n[i]=n[i].trim(),""!==n[i]&&("safe"!==n[i]?(s="Sqrl.F."+n[i]+"("+s,o+=")"):r=!0)}return s+=w.start,o+=w.end,!r&&S&&(s+="Sqrl.F.e(",o+=")"),s+t+o}function x(t){var e,n=0,r="var tR='';",c=[],u=-1,f=0,v={};function p(e){n!==e&&(r+="tR+='"+t.slice(n,e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"';")}function y(t,e){var n=d(t,c,u);return"@"===t[0]?A(n,e):A("options."+n,e)}for(l=i,(a=o).lastIndex=0;null!==(e=a.exec(t));)if(p(e.index),n=e[0].length+e.index,e[1]){var b=e[3];""!==b&&null!==b||(b=f,f++);var m=h.hasOwnProperty(e[1]);u+=1;var g=e[2]||"";g=d(g,c,u),m||(g="["+g+"]");var w={name:e[1],id:b,params:g,native:m};c[u]=w,m?(r+=h[e[1]].helperStart(g,b),n=a.lastIndex):r+="tR+=Sqrl.H."+e[1]+"("+g+",function(hvals){var hvals"+b+"=hvals;var tR='';"}else if(e[4]){var C=e[5]||"";if(C=d(C,c,u),"include"===e[4]){var S=t.slice(0,e.index),k=t.slice(e.index+e[0].length),x=C.replace(/'|"/g,""),E=s[x];t=S+E+k,n=a.lastIndex=e.index}else h.hasOwnProperty(e[4])&&h[e[4]].hasOwnProperty("selfClosing")?(r+=h[e[4]].selfClosing(C),n=a.lastIndex):r+="tR+=Sqrl.H."+e[4]+"("+C+");"}else if(e[6])r+="tR+="+y(e[6],e[7])+";";else if(e[8]){var O=c[u];O&&O.name===e[8]?(u-=1,!0===O.native?r+=h[O.name].helperEnd(O.params,O.id):v[O.id]?r+="return tR}});":r+="return tR});"):console.error("Helper beginning & end don't match.")}else if(e[9]){var T=c[u];if(T.native){var j=h[T.name];j.blocks&&j.blocks[e[9]]?(r+=j.blocks[e[9]](T.id),n=a.lastIndex):console.warn("Native helper '%s' doesn't accept that block.",T.name)}else v[T.id]?r+="return tR},"+e[9]+":function(hvals){var hvals"+T.id+"=hvals;var tR='';":(r+="return tR},{"+e[9]+":function(hvals){var hvals"+T.id+"=hvals;var tR='';",v[T.id]=!0)}return p(t.length),r+="return tR",new Function("options","Sqrl",r.replace(/\n/g,"\\n").replace(/\r/g,"\\r"))}function E(t,e){m[t]=e}function O(t,e){r[t]=e}function T(t,e){h[t]=e}function j(t,e){return"function"==typeof t?t(e,{H:r,F:m,P:s}):"string"==typeof t?R(e,t)(e,{H:r,F:m,P:s}):void 0}function P(t,e){s[t]=e}var q={};function R(t,e){var r=t.$file,s=t.$name,o=t.$cache;if(r){var i=n(85504);return!1!==o?(q.hasOwnProperty(r)||(q[r]=x(i.readFileSync(r,"utf8"))),q[r]):x(i.readFileSync(r,"utf8"))}return"string"==typeof e?s&&!1!==o?(q.hasOwnProperty(s)||(q[s]=x(e)),q[s]):!0===o?(q.hasOwnProperty(e)||(q[e]=x(e)),q[e]):x(e):s&&!1!==o&&q.hasOwnProperty(s)?q[s]:"No template"}function L(t,e){return e.$file=t,R(e)(e,{H:r,F:m,P:s})}function F(t,e,n){return n(null,L(t,e))}},85504:function(){}}]);

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.