1import Alpine from"alpinejs";import focus from"@alpinejs/focus";import JustValidate from"just-validate";import{createIcons,Menu,ArrowRight,Globe,Download,LoaderCircle,Search,ClipboardCheck,Compass,BarChart3,Sprout,Zap,Cpu,Leaf,Flame,BatteryCharging,Mail}from"lucide";import collapse from"@alpinejs/collapse";import Swiper from"swiper";import{showValidationErrors}from"./validation_error.js";var COUNTRIES=["Afghanistan","Ã
land Islands","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua & Barbuda","Argentina","Armenia","Aruba","Ascension Island","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia & Herzegovina","Botswana","Brazil","British Indian Ocean Territory","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Canary Islands","Cape Verde","Caribbean Netherlands","Cayman Islands","Central African Republic","Ceuta & Melilla","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo - Brazzaville","Congo - Kinshasa","Cook Islands","Costa Rica","Côte dâIvoire","Croatia","Cuba","Curaçao","Cyprus","Czechia","Denmark","Diego Garcia","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Eurozone","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Korea","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Réunion","Romania","Russia","Rwanda","Samoa","San Marino","São Tomé & PrÃncipe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia & South Sandwich Islands","South Korea","South Sudan","Spain","Sri Lanka","St. Barthélemy","St. Helena","St. Kitts & Nevis","St. Lucia","St. Martin","St. Pierre & Miquelon","St. Vincent & Grenadines","Sudan","Suriname","Svalbard & Jan Mayen","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tokelau","Tonga","Trinidad & Tobago","Tristan da Cunha","Tunisia","Turkey","Turkmenistan","Turks & Caicos Islands","Tuvalu","U.S. Outlying Islands","U.S. Virgin Islands","Uganda","Ukraine","United Arab Emirates","United Kingdom","United Nations","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Wallis & Futuna","Western Sahara","Yemen","Zambia","Zimbabwe"];createIcons({icons:{Menu,ArrowRight,Globe,Download,LoaderCircle,Search,ClipboardCheck,Compass,BarChart3,Sprout,Zap,Cpu,Leaf,Flame,BatteryCharging,Mail}}),Alpine.plugin(focus),Alpine.plugin(collapse),Alpine.data("countrySelect",(e,t="country")=>({open:!1,search:e[t]||"",countries:COUNTRIES,filtered:[],init(){this.filtered=this.countries,this.$watch("search",n=>{e[t]=n})},filterCountries(){const e=this.search.toLowerCase();this.filtered=this.countries.filter(t=>t.toLowerCase().includes(e))},selectCountry(e){this.search=e,this.open=!1}})),Alpine.data("modal",()=>({notifications:[],displayDuration:8e3,soundEffect:!0,addNotification({variant:e="info",sender:t=null,title:n=null,message:s=null}){const o=Date.now(),i={id:o,variant:e,sender:t,title:n,message:s};if(this.notifications.length>=20&&this.notifications.splice(0,this.notifications.length-19),this.notifications.push(i),this.soundEffect){const e=new Audio("https://res.cloudinary.com/ds8pgw1pf/video/upload/v1728571480/penguinui/component-assets/sounds/ding.mp3");e.play().catch(e=>{console.error("Error playing the sound:",e)})}},removeNotification(e){setTimeout(()=>{this.notifications=this.notifications.filter(t=>t.id!==e)},1e3)}})),Alpine.data("formHandler",(e="")=>({formData:{firstName:"",lastName:"",companyName:"",jobTitle:"",country:"",phoneNumber:"",emailAddress:"",message:"",recaptcha:"",rfpFileIds:[],fromPage:e},uploadedFiles:[],isUploading:!1,responseMessage:"",isLoading:!1,isSuccess:!1,init(){this.validation=new JustValidate(this.$refs.form,{errorFieldCssClass:"is-invalid",successFieldCssClass:"is-valid",errorLabelCssClass:"text-red-500 text-sm mt-1",errorLabelStyle:{color:"#ff0000",fontSize:"12px"}}),this.validation.addField('input[name="firstName"]',[{rule:"required",errorMessage:"Le champ Prénom est obligatoire"}]).addField('input[name="lastName"]',[{rule:"required",errorMessage:"Le champ Nom est obligatoire"}]).addField('input[name="companyName"]',[{rule:"required",errorMessage:"Le champ Entreprise est obligatoire"}]).addField('input[name="jobTitle"]',[{rule:"required",errorMessage:"Le champ Fonction est obligatoire"}]).addField('input[name="country"]',[{rule:"required",errorMessage:"Le champ Pays est obligatoire"}]).addField('input[name="phoneNumber"]',[{rule:"required",errorMessage:"Le champ Numéro de téléphone est obligatoire"},{rule:"minLength",value:10,errorMessage:"Le numéro de téléphone doit contenir au moins 10 chiffres"}]).addField('input[name="emailAddress"]',[{rule:"required",errorMessage:"Le champ Adresse e-mail est obligatoire"},{rule:"email",errorMessage:"Veuillez saisir une adresse e-mail valide"},{rule:"customRegexp",value:/^[^\s@]+@(?!.*\b(gmail|yahoo|hotmail|outlook|icloud|aol|protonmail|zoho|rocketmail)\.[a-z]+\b)(?!.*\.(ru|by|ua)$).*$/i,errorMessage:"Veuillez utiliser une adresse e-mail professi"}]).addField('textarea[name="message"]',[{rule:"required",errorMessage:"Le champ Message est obligatoire"}])},async handleFile(e){const t=e.target.files;if(!t.length)return;this.isUploading=!0;for(const e of t){const n=new FormData;n.append("file",e);try{const s=await fetch("/upload-files",{method:"POST",body:n});if(!s.ok)throw new Error("Upload failed");const t=await s.json();this.uploadedFiles.push({id:t.id,name:e.name,url:t.url??null}),this.formData.rfpFileIds.push(t.id)}catch(e){console.error(e)}}this.isUploading=!1,this.$refs.fileInput.value=""},async removeFile(e,t){try{const n=await fetch(`/upload-files/${t.id}/delete`,{method:"DELETE"});if(!n.ok)throw new Error("Failed to remove file");this.uploadedFiles.splice(e,1),this.formData.rfpFileIds=this.uploadedFiles.map(e=>e.id)}catch(e){console.error(e)}},async validateForm(){const e=this,t=await this.validation.isValid;if(t){e.isLoading=!0;const t=document.documentElement.dataset.sitekey;
1grecaptcha.ready(function(){grecaptcha.execute(t,{action:"inquiry"}).then(function(t){e.formData.recaptcha=t;let n=e.$refs.form.action;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(e.formData)}).then(async t=>{const n=await t.json();t.ok?(e.$dispatch("notify",{variant:"success",title:"Merci!",message:"Merci pour votre message. Notre équipe vous recontactera dans les plus brefs délais."}),e.resetForm(),e.$refs.form.dataset.redirecturl&&(window.location.href=e.$refs.form.dataset.redirecturl)):n.errors&&showValidationErrors(e.validation,n.errors),e.isLoading=!1,e.isSuccess=t.ok}).catch(t=>{e.isLoading=!1,e.isSuccess=!1,e.$dispatch("notify",{variant:"danger",title:"Inquiry is failed to send",message:"Inquiry is not available right now. Please reach us through our email "})})})})}},resetForm(){this.formData={firstName:"",lastName:"",companyName:"",jobTitle:"",country:"",phoneNumber:"",emailAddress:"",message:"",recaptcha:"",rfpFileIds:[]},this.uploadedFiles=[],this.validation.destroy()}})),Alpine.data("expertSlider",()=>({swiperExpert:null,init(){this.swiperExpert=new Swiper(this.$refs.expertRef,{loop:!1,watchOverflow:!0,centeredSlides:!1,preventInteractionOnTransition:!0,centerInsufficientSlides:!0,noSwiping:!0,allowTouchMove:!1,breakpoints:{320:{slidesPerView:1,spaceBetween:0,grabCursor:!0},768:{slidesPerView:2,spaceBetween:24,grabCursor:!0},1024:{slidesPerView:4,spaceBetween:32}},navigation:{nextEl:".swiper-button-next-expert",prevEl:".swiper-button-prev-expert",disabledClass:"opacity-0",lockClass:"hidden"}})}})),window.Alpine=Alpine,Alpine.start()
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.