PageSourceSearch

https://ulegroup.com/cdn/shop/t/47/assets/special-order-global.js?v=180014938881574307801787665262

js ulegroup.com collected 2026-10-03 21:24:55 UTC 3,013 bytes, 2 lines download raw bytes

1(function(){"use strict";var PROP="_SpecialOrder",SECTION="special-order-data",cache={},syncing=!1,queued=!1;function getProductData(handle){return cache[handle]||(cache[handle]=fetch("/products/"+handle+"?section_id="+SECTION).then(function(r){return r.text()}).then(function(html){var doc=new DOMParser().parseFromString(html,"text/html"),el=doc.querySelector("[data-special-order-data]");return el?JSON.parse(el.textContent):null}).catch(function(){return null})),cache[handle]}function isSpecialOrder(data,variantId,quantity){if(!data||!data.valid_status)return!1;var v=(data.variants||[]).find(function(x){return Number(x.id)===Number(variantId)});return v?v.inventory_policy==="continue"&&v.available===!0&&Number(quantity)>Number(v.inventory_quantity||0):!1}function changeLine(key,quantity,properties){return fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({id:key,quantity:quantity,properties:properties})})}function sync(){return syncing?(queued=!0,Promise.resolve()):(syncing=!0,fetch("/cart.js",{headers:{Accept:"application/json"}}).then(function(r){return r.json()}).then(function(cart){var items=cart.items||[];return Promise.all(items.map(function(item){return getProductData(item.handle).then(function(data){return{item:item,want:isSpecialOrder(data,item.variant_id,item.quantity)}})}))}).then(function(results){return results.reduce(function(chain,r){return chain.then(function(changed){var props=Object.assign({},r.item.properties||{}),has=props[PROP]==="true"||props[PROP]===!0;return r.want===has?changed:(r.want?props[PROP]="true":delete props[PROP],changeLine(r.item.key,r.item.quantity,props).then(function(){return!0}))})},Promise.resolve(!1))}).then(function(changed){changed&&document.dispatchEvent(new CustomEvent("special-order:cart-updated"))}).catch(function(){}).then(function(){if(syncing=!1,queued)return queued=!1,sync()}))}function isCartWrite(url){return!url||(url=String(url),url.indexOf("/cart/change")>-1&&syncing)?!1:/\/cart\/(add|change|update|clear)(\.js)?/.test(url)}var _fetch=window.fetch;window.fetch=function(){var url=arguments[0]&&arguments[0].url?arguments[0].url:arguments[0],p=_fetch.apply(this,arguments);return isCartWrite(url)&&p.then(function(){setTimeout(sync,60)}).catch(function(){}),p};var _open=XMLHttpRequest.prototype.open,_send=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(m,u){return this.__soUrl=u,_open.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var self=this;return isCartWrite(this.__soUrl)&&this.addEventListener("load",function(){setTimeout(sync,60)}),_send.apply(self,arguments)};function boot(){setTimeout(sync,400)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",boot):boot(),window.addEventListener("pageshow",function(e){e.persisted&&sync()}),window.SpecialOrderSync=sync})();
2//# sourceMappingURL=/cdn/shop/t/47/assets/special-order-global.js.map?v=180014938881574307801787665262

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.