1const atcbVersion="1.10.1",isBrowser=new Function("try { return this===window; }catch(e){ return false; }"),isiOS=isBrowser()?new Function("if ((/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)){ return true; }else{ return false; }"):new Function("return false;");function atcb_init(){console.log("add-to-calendar button initialized (version "+atcbVersion+")"),console.log("See https://github.com/jekuer/add-to-calendar-button for details");const t=document.querySelectorAll(".atcb");if(0<t.length){var a,n=document.querySelectorAll(".atcb_initialized");for(let e=0;e<t.length;e++)t[parseInt(e)].classList.contains("atcb_initialized")||atcb_check_required(a=atcb_patch_config(a=JSON.parse(t[parseInt(e)].innerHTML.replace(/(\r\n|\n|\r)/g,"").replace(/(<(?!br)([^>]+)>)/gi,""))))&&atcb_validate(a=atcb_decorate_data(a))&&atcb_generate(t[parseInt(e)],e+n.length,a)}}function atcb_patch_config(t){const a={title:"name",dateStart:"startDate",dateEnd:"endDate",timeStart:"startTime",timeEnd:"endTime"};return Object.keys(a).forEach(e=>{null==t[a[""+e]]&&null!=t[""+e]&&(t[a[""+e]]=t[""+e])}),t}function atcb_decorate_data(e){if((e=atcb_date_cleanup(e)).startDate=atcb_date_calculation(e.startDate),e.endDate=atcb_date_calculation(e.endDate),!e.description||e.descriptionHtmlFree)return e;const t=Object.assign({},e);return t.description=t.description.replace(/<br\s*\/?>/gi,"\n"),t.descriptionHtmlFree=t.description.replace(/\[url\]/gi,"").replace(/\[\/url\]/gi,""),t.description=t.description.replace(/\[url\]([\w&$+.,:;=~!*'?@#\s\-()|/^%]*)\[\/url\]/gi,'<a href="$1" target="_blank" rel="noopener">$1</a>'),t}function atcb_check_required(t){if(null==t.options||t.options.length<1)return console.error("add-to-calendar button generation failed: no options set"),!1;return["name","startDate","endDate"].every(function(e){return null!=t[""+e]&&""!=t[""+e]||(console.error("add-to-calendar button generation failed: required setting missing ["+e+"]"),!1)})}function atcb_date_cleanup(n){return["start","end"].forEach(function(e){var t;if(null!=n[e+"Date"]&&(n[e+"Date"]=n[e+"Date"].replace(/\.\d{3}/,"").replace("Z",""),null!=(t=n[e+"Date"].split("T"))[1]&&(n[e+"Date"]=t[0],n[e+"Time"]=t[1])),null!=n[e+"Time"]&&8===n[e+"Time"].length){const a=n[e+"Time"];n[e+"Time"]=a.substring(0,a.length-3)}}),n}function atcb_date_calculation(e){const t=new Date;var a=t.getUTCMonth()+1+"-"+t.getUTCDate()+"-"+t.getUTCFullYear();const n=(e=e.replace(/today/gi,a)).split("+");a=n[0].split("-");let c=new Date(a[0],a[1]-1,a[2]);return a[0].length<4&&(c=new Date(a[2],a[0]-1,a[1])),null!=n[1]&&0<n[1]&&c.setDate(c.getDate()+parseInt(n[1])),c.getFullYear()+"-"+(c.getMonth()+1<10?"0":"")+(c.getMonth()+1)+"-"+(c.getDate()<10?"0":"")+c.getDate()}function atcb_validate(a){const t=["Apple","Google","iCal","Microsoft365","Outlook.com","MicrosoftTeams","Yahoo"];if(!a.options.every(function(e){e=e.split("|");return!!t.includes(e[0])||(console.error("add-to-calendar button generation failed: invalid option ["+e[0]+"]"),!1)}))return!1;const e=["startDate","endDate"],n=e;if(!e.every(function(e){if(10!==a[""+e].length)return console.error("add-to-calendar button generation failed: date misspelled [-> YYYY-MM-DD]"),!1;var t=a[""+e].split("-");return t.length<3||3<t.length?(console.error("add-to-calendar button generation failed: date misspelled ["+e+": "+a[""+e]+"]"),!1):(n[""+e]=new Date(t[0],t[1]-1,t[2]),!0)}))return!1;return!!["startTime","endTime"].every(function(e){if(null!=a[""+e]){if(5!==a[""+e].length)return console.error("add-to-calendar button generation failed: time misspelled [-> HH:MM]"),!1;var t=a[""+e].split(":");if(t.length<2||2<t.length)return console.error("add-to-calendar button generation failed: time misspelled ["+e+": "+a[""+e]+"]"),!1;if(23<t[0])return console.error("add-to-calendar button generation failed: time misspelled - hours number too high ["+e+": "+t[0]+"]"),!1;if(59<t[1])return console.error("add-to-calendar button generation failed: time misspelled - minutes number too high ["+e+": "+t[1]+"]"),!1;"startTime"==e&&(n.startDate=new Date(n.startDate.getTime()+36e5*t[0]+6e4*t[1])),"endTime"==e&&(n.endDate=new Date(n.endDate.getTime()+36e5*t[0]+6e4*t[1]))}return!0})&&(null!=a.startTime&&null==a.endTime||null==a.startTime&&null!=a.endTime?(console.error("add-to-calendar button generation failed: if you set a starting time, you also need to define an end time"),!1):!(n.endDate<n.startDate)||(console.error("add-to-calendar button generation failed: end date before start date"),!1))}function atcb_generate_label(e,t,a=!1,n=""){let c="";switch(t){case"Trigger":default:n=n||"Add to Calendar",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M81.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.7
17-2.12-5.77-4.73V4.73h0zm-3.65 76.03c1.83 0 3.32 1.49 3.32 3.32s-1.49 3.32-3.32 3.32l-12.95-.04-.04 12.93c0 1.83-1.49 3.32-3.32 3.32s-3.32-1.49-3.32-3.32l.04-12.94-12.93-.05c-1.83 0-3.32-1.49-3.32-3.32s1.49-3.32 3.32-3.32l12.94.04.04-12.93c0-1.83 1.49-3.32 3.32-3.32s3.32 1.49 3.32 3.32l-.04 12.95 12.94.04h0zM29.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.77-2.12-5.77-4.73V4.73h0zM6.4 45.32h110.08V21.47c0-.8-.33-1.53-.86-2.07-.53-.53-1.26-.86-2.07-.86H103c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h10.55c2.57 0 4.9 1.05 6.59 2.74s2.74 4.02 2.74 6.59v27.06 65.03c0 2.57-1.05 4.9-2.74 6.59s-4.02 2.74-6.59 2.74H9.33c-2.57 0-4.9-1.05-6.59-2.74-1.69-1.7-2.74-4.03-2.74-6.6V48.53 21.47c0-2.57 1.05-4.9 2.74-6.59s4.02-2.74 6.59-2.74H20.6c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H9.33c-.8 0-1.53.33-2.07.86-.53.53-.86 1.26-.86 2.07v23.85h0zm110.08 6.41H6.4v61.82c0 .8.33 1.53.86 2.07.53.53 1.26.86 2.07.86h104.22c.8 0 1.53-.33 2.07-.86.53-.53.86-1.26.86-2.07V51.73h0zM50.43 18.54c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h21.49c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H50.43h0z"/></svg>';break;case"Apple":n=n||"Apple",c='<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" viewBox="0 0 640 640"><path d="M494.782 340.02c-.803-81.025 66.084-119.907 69.072-121.832-37.595-54.993-96.167-62.552-117.037-63.402-49.843-5.032-97.242 29.362-122.565 29.362-25.253 0-64.277-28.607-105.604-27.85-54.32.803-104.4 31.594-132.403 80.245C29.81 334.457 71.81 479.58 126.816 558.976c26.87 38.882 58.914 82.56 100.997 81 40.512-1.594 55.843-26.244 104.848-26.244 48.993 0 62.753 26.245 105.64 25.406 43.606-.803 71.232-39.638 97.925-78.65 30.887-45.12 43.548-88.75 44.316-90.994-.969-.437-85.029-32.634-85.879-129.439l.118-.035zM414.23 102.178C436.553 75.095 451.636 37.5 447.514-.024c-32.162 1.311-71.163 21.437-94.253 48.485-20.729 24.012-38.836 62.28-33.993 99.036 35.918 2.8 72.591-18.248 94.926-45.272l.036-.047z"/></svg>';break;case"Google":n=n||"Google",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M93.78 29.1H29.1v64.68h64.68V29.1z" fill="#fff"/><path d="M93.78 122.88l29.1-29.1h-29.1v29.1z" fill="#f72a25"/><path d="M122.88 29.1h-29.1v64.68h29.1V29.1z" fill="#fbbc04"/><path d="M93.78 93.78H29.1v29.1h64.68v-29.1z" fill="#34a853"/><path d="M0 93.78v19.4c0 5.36 4.34 9.7 9.7 9.7h19.4v-29.1H0h0z" fill="#188038"/><path d="M122.88 29.1V9.7c0-5.36-4.34-9.7-9.7-9.7h-19.4v29.1h29.1 0z" fill="#1967d2"/><path d="M93.78 0H9.7C4.34 0 0 4.34 0 9.7v84.08h29.1V29.1h64.67V0h.01z" fill="#4285f4"/><path d="M42.37 79.27c-2.42-1.63-4.09-4.02-5-7.17l5.61-2.31c.51 1.94 1.4 3.44 2.67 4.51 1.26 1.07 2.8 1.59 4.59 1.59 1.84 0 3.41-.56 4.73-1.67 1.32-1.12 1.98-2.54 1.98-4.26 0-1.76-.7-3.2-2.09-4.32s-3.14-1.67-5.22-1.67H46.4v-5.55h2.91c1.79 0 3.31-.48 4.54-1.46 1.23-.97 1.84-2.3 1.84-3.99 0-1.5-.55-2.7-1.65-3.6s-2.49-1.35-4.18-1.35c-1.65 0-2.96.44-3.93 1.32s-1.7 2-2.12 3.24l-5.55-2.31c.74-2.09 2.09-3.93 4.07-5.52s4.51-2.39 7.58-2.39c2.27 0 4.32.44 6.13 1.32s3.23 2.1 4.26 3.65c1.03 1.56 1.54 3.31 1.54 5.25 0 1.98-.48 3.65-1.43 5.03-.95 1.37-2.13 2.43-3.52 3.16v.33c1.79.74 3.36 1.96 4.51 3.52 1.17 1.58 1.76 3.46 1.76 5.66s-.56 4.16-1.67 5.88c-1.12 1.72-2.66 3.08-4.62 4.07s-4.17 1.49-6.62 1.49c-2.84 0-5.46-.81-7.88-2.45h0 0zm34.46-27.84l-6.16 4.45-3.08-4.67 11.05-7.97h4.24v37.6h-6.05V51.43h0z" fill="#1a73e8"/></svg>';break;case"iCal":n=n||"iCal File",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M81.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.77-2.12-5.77-4.73V4.73h0zm-15.5 99.08c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zM15.85 67.09c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zm25.14 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H91.25h0zm-75.4 18.36c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zm25.14 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H91.25h0zm-75.4 18.36c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zM29.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.7
17-2.12-5.77-4.73V4.73h0zM6.4 45.32h110.07V21.47c0-.8-.33-1.53-.86-2.07-.53-.53-1.26-.86-2.07-.86H103c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h10.55c2.57 0 4.9 1.05 6.59 2.74s2.74 4.02 2.74 6.59v27.06 65.03c0 2.57-1.05 4.9-2.74 6.59s-4.02 2.74-6.59 2.74H9.33c-2.57 0-4.9-1.05-6.59-2.74-1.69-1.7-2.74-4.03-2.74-6.6V48.52 21.47c0-2.57 1.05-4.9 2.74-6.59s4.02-2.74 6.59-2.74H20.6c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H9.33c-.8 0-1.53.33-2.07.86-.53.53-.86 1.26-.86 2.07v23.85h0zm110.08 6.41H6.4v61.82c0 .8.33 1.53.86 2.07.53.53 1.26.86 2.07.86h104.22c.8 0 1.53-.33 2.07-.86.53-.53.86-1.26.86-2.07V51.73h0zM50.43 18.54c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h21.49c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H50.43h0z"/></svg>';break;case"MicrosoftTeams":n=n||"Microsoft Teams",c='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 2228.833 2073.333"><g fill="#5059c9"><path d="M1554.637 777.5h575.713c54.391 0 98.483 44.092 98.483 98.483v524.398c0 199.901-162.051 361.952-361.952 361.952h0-1.711c-199.901.028-361.975-162-362.004-361.901v-.052-571.409c.001-28.427 23.045-51.471 51.471-51.471h0z"/><circle cx="1943.75" cy="440.583" r="233.25"/></g><g fill="#7b83eb"><circle cx="1218.083" cy="336.917" r="336.917"/><path d="M1667.323 777.5H717.01c-53.743 1.33-96.257 45.931-95.01 99.676v598.105c-7.505 322.519 247.657 590.16 570.167 598.053 322.51-7.893 577.671-275.534 570.167-598.053V877.176c1.245-53.745-41.268-98.346-95.011-99.676z"/></g><path opacity=".1" d="M1244 777.5v838.145c-.258 38.435-23.549 72.964-59.09 87.598-11.316 4.787-23.478 7.254-35.765 7.257H667.613c-6.738-17.105-12.958-34.21-18.142-51.833-18.144-59.477-27.402-121.307-27.472-183.49V877.02c-1.246-53.659 41.198-98.19 94.855-99.52H1244z"/><path opacity=".2" d="M1192.167 777.5v889.978a91.84 91.84 0 0 1-7.257 35.765c-14.634 35.541-49.163 58.833-87.598 59.09H691.975c-8.812-17.105-17.105-34.21-24.362-51.833s-12.958-34.21-18.142-51.833a631.28 631.28 0 0 1-27.472-183.49V877.02c-1.246-53.659 41.198-98.19 94.855-99.52h475.313z"/><path opacity=".2" d="M1192.167 777.5v786.312c-.395 52.223-42.632 94.46-94.855 94.855h-447.84A631.28 631.28 0 0 1 622 1475.177V877.02c-1.246-53.659 41.198-98.19 94.855-99.52h475.312z"/><path opacity=".2" d="M1140.333 777.5v786.312c-.395 52.223-42.632 94.46-94.855 94.855H649.472A631.28 631.28 0 0 1 622 1475.177V877.02c-1.246-53.659 41.198-98.19 94.855-99.52h423.478z"/><path opacity=".1" d="M1244 509.522v163.275c-8.812.518-17.105 1.037-25.917 1.037s-17.105-.518-25.917-1.037c-17.496-1.161-34.848-3.937-51.833-8.293a336.92 336.92 0 0 1-233.25-198.003 288.02 288.02 0 0 1-16.587-51.833h258.648c52.305.198 94.657 42.549 94.856 94.854z"/><use xlink:href="#C" opacity=".2"/><use xlink:href="#C" opacity=".2"/><path opacity=".2" d="M1140.333 561.355v103.148A336.92 336.92 0 0 1 907.083 466.5h138.395c52.305.199 94.656 42.551 94.855 94.855z"/><linearGradient id="A" gradientUnits="userSpaceOnUse" x1="198.099" y1="392.261" x2="942.234" y2="1681.073"><stop offset="0" stop-color="#5a62c3"/><stop offset=".5" stop-color="#4d55bd"/><stop offset="1" stop-color="#3940ab"/></linearGradient><path fill="url(#A)" d="M95.01 466.5h950.312c52.473 0 95.01 42.538 95.01 95.01v950.312c0 52.473-42.538 95.01-95.01 95.01H95.01c-52.473 0-95.01-42.538-95.01-95.01V561.51c0-52.472 42.538-95.01 95.01-95.01z"/><path fill="#fff" d="M820.211,828.193H630.241v517.297H509.211V828.193H320.123V727.844h500.088V828.193z"/><defs ><path id="C" d="M1192.167 561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293a336.92 336.92 0 0 1-233.25-198.003h190.228c52.304.198 94.656 42.55 94.855 94.854z"/></defs></svg>';break;case"Microsoft365":n=n||"Microsoft 365",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 278050 333334" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd"><path fill="#ea3e23" d="M278050 305556l-29-16V28627L178807 0 448 66971l-448 87 22 200227 60865-23821V80555l117920-28193-17 239519L122 267285l178668 65976v73l99231-27462v-316z"/></svg>';break;case"Outlook.com":n=n||"Outlook.com",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.129793726981 0 33.251996719421 32" width="2500" height="2397"><path d="M28.596 2H11.404A1.404 1.404 0 0 0 10 3.404V5l9.69 3L30 5V3.404A1.404 1.404 0 0 0 28.596 2z" fill="#0364b8"/><path d="M31.65 17.405A11.341 11.341 0 0 0 32 16a.666.666 0 0 0-.333-.576l-.013-.008-.004-.002L20.812 9.24a1.499 1.499 0 0 0-1.479-.083 1.49 1.49 0 0 0-.145.082L8.35 15.415l-.004.002-.012.007A.666.666 0 0 0 8 16a11.344 11.344 0 0 0 .35 1.405l11.492 8.405z" fill="#0a2767"/><path d="M24 5h-7l-2.021 3L17 11l7 6h6v-6z" fill="#28a8ea"/><path d="M10 5h7v6h-7z" fill="#0078d4"/><path d="M24 5h6v6h-6z" fill="#50d9ff"/><path d="M24 17l-7-6h-7v6l7 6 10.832 1.768z" fill="#0364b8"/><path d="M17 11h7v6h-7z" fill="#0078d4"/><path d="M10 17h7v6h-7z" fill="#064a8c"/><path d="M24 17h6v6h-6z" fill="#0078d4"/><path d="M20.19 25.218l-11.793-8.6.495-.87 10.909 6.212a.528.528 0 0 0 .42-.012l10.933-6.23.496.869z" fill="#0a2767" opacity=".5"/><path d="M31.667 16.577l-.014.008-.003.002-10.838 6.174a1.497 1.497 0 0 1-1.46.091l3.774 5.061 8.254 1.797v.004A1.498 1.498 0 0 0 32 28.5V16a.666.666 0 0 1-.333.577z" fill="#1490df"/><path d="M32 28.5v-.738l-9.983-5.688-1.205.687a1.497 1.497 0 0 1-1.46.091l3.774 5.061 8.254 1.797v.004A1.498 1.498 0 0 0 32 28.5z" opacity=".05"/><path d="M31.95 28.883L21.007 22.65l-.195.11a1.497 1.497 0 0 1-1.46.092l3.774 5.061 8.254 1.797v.004a1.501 1.501 0 0 0 .57-.83z" opacity=".1"/><path d="M8.35 16.59v-.01h-.01l-.03-.02A.65.65 0 0 1 8 16v12.5A1.498 1.498 0 0 0 9.5 30h21a1.503 1.503 0 0 0 .37-.05.637.637 0 0 0 .18-.06.142.142 0 0 0 .06-.02 1.048 1.048 0 0 0 .23-.13c.02-.01.03-.01.04-.03z" fill="#28a8ea"/><path d="M18 24.667V8.333A1.337 1.337 0 0 0 16.667 7H10.03v7.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v10h8.667A1.337 1.337 0 0 0 18 24.667z" opacity=".1"/><path d="M17 25.667V9.333A1.337 1.337 0 0 0 15.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v11h7.667A1.337 1.337 0 0 0 17 25.667z" opacity=".2"/><path d="M17 23.667V9.333A1.337 1.337 0 0 0 15.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v9h7.667A1.337 1.337 0 0 0 17 23.667z" opacity=".2"/><path d="M16 23.667V9.333A1.337 1.337 0 0 0 14.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v9h6.667A1.337 1.337 0 0 0 16 23.667z" opacity=".2"/><path d="M1.333 8h13.334A1.333 1.333 0 0 1 16 9.333v13.334A1.333 1.333 0 0 1 14.667 24H1.333A1.333 1.333 0 0 1 0 22.667V9.333A1.333 1.333 0 0 1 1.333 8z" fill="#0078d4"/><path d="M3.867 13.468a4.181 4.181 0 0 1 1.642-1.814A4.965 4.965 0 0 1 8.119 11a4.617 4.617 0 0 1 2.413.62 4.14 4.14 0 0 1 1.598 1.733 5.597 5.597 0 0 1 .56 2.55 5.901 5.901 0 0 1-.577 2.666 4.239 4.239 0 0 1-1.645 1.794A4.8 4.8 0 0 1 7.963 21a4.729 4.729 0 0 1-2.468-.627 4.204 4.204 0 0 1-1.618-1.736 5.459 5.459 0 0 1-.567-2.519 6.055 6.055 0 0 1 .557-2.65zm1.75 4.258a2.716 2.716 0 0 0 .923 1.194 2.411 2.411 0 0 0 1.443.435 2.533 2.533 0 0 0 1.541-.449 2.603 2.603 0 0 0 .897-1.197 4.626 4.626 0 0 0 .286-1.665 5.063 5.063 0 0 0-.27-1.686 2.669 2.669 0 0 0-.866-1.24 2.387 2.387 0 0 0-1.527-.473 2.493 2.493 0 0 0-1.477.439 2.741 2.741 0 0 0-.944 1.203 4.776 4.776 0 0 0-.007 3.44z" fill="#fff"/></svg>';break;case"Yahoo":n=n||"Yahoo",c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3386.34 3010.5" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd"><path d="M0 732.88h645.84l376.07 962.1 380.96-962.1h628.76l-946.8 2277.62H451.98l259.19-603.53L.02 732.88zm2763.84 768.75h-704.26L2684.65 0l701.69.03-622.5 1501.6zm-519.78 143.72c216.09 0 391.25 175.17 391.25 391.22 0 216.06-175.16 391.23-391.25 391.23-216.06 0-391.19-175.17-391.19-391.23 0-216.05 175.16-391.22 391.19-391.22z" fill="#5f01d1" fill-rule="nonzero"/></svg>'}if(a){const l=document.createElement("span");l.classList.add("atcb_icon"),l.innerHTML=c,e.appendChild(l)}const o=document.createElement("span");o.classList.add("atcb_text"),o.textContent=n,e.appendChild(o)}function atcb_generate(e,t,a){if(e.textContent="",a.name&&a.location&&a.startDate){const o=document.createElement("script");o.setAttribute("type","application/ld+json"),o.textContent='{ "event": { "@context":"https://schema.org", "@type":"Event", ',o.textContent+='"name":"'+a.name+'", ',a.descriptionHtmlFree&&(o.textContent+='"description":"'+a.descriptionHtmlFree+'", '),o.textContent+='"startDate":"'+a.startDate,a.startTime&&(o.textContent+="T"+a.startTime.slice(0,5)),o.textContent+='", ',a.endDate&&(o.textContent+='"endDate":"'+a.endDate),a.endTime&&(o.textContent+="T"+a.endTime.slice(0,5)),o.textContent+='", ',a.location.startsWith("http")?(o.textContent+='"eventAttendanceMode":"https://schema.org/OnlineEventAttendanceMode", ',o.textContent+='"location": { "@type":"VirtualLocation", "url":"'+a.location+'" } '):o.textContent+='"location":"'+a.location+'" ',o.textContent+="} }",e.appendChild(o)}const n=document.createElement("div"),c=(n.classList.add("atcb_button_wrapper"),e.appendChild(n),document.createElement("button"));c.id="atcb_button_"+t,c.classList.add("atcb_button"),c.setAttribute("type","button"),n.appendChild(c),atcb_generate_label(c,"Trigger",!0,a.label),"click"==a.trigger?c.addEventListener("mousedown",()=>atcb_toggle(a,c,!1,!0)):(c.addEventListener("touchstart",()=>atcb_toggle(a,c,!1,!0),{passive:!0}),c.addEventListener("mouseenter",()=>atcb_open(a,c,!1,!0))),c.addEventListener("keydown",function(e){"Enter"==e.key&&atcb_toggle(a,c,!0,!0)}),e.classList.remove("atcb"),e.classList.add("atcb_initialized"),a.inline?e.style.display="inline-block":e.style.display="block",console.log("add-to-calendar button #"+(t+1)+" created")}function atcb_generate_dropdown_list(n){const c=document.createElement("div");return c.classList.add("atcb_list"),n.options.forEach(function(e){var t=e.split("|");const a=document.createElement("div");switch(a.classList.add("atcb_list_item"),a.tabIndex=0,c.appendChild(a),t[0]){case"Apple":atcb_generate_label(a,"Apple",!0,t[1]),a.addEventListener("click",function(){atcb_generate_ical(n),atcb_close()});break;case"Google":atcb_generate_label(a,"Google",!0,t[1]),a.addEventListener("click",function(){atcb_generate_google(n),atcb_close()});break;case"iCal":atcb_generate_label(a,"iCal",!0,t[1]),a.addEventListener("click",function(){atcb_generate_ical(n),atcb_close()});break;case"MicrosoftTeams":atcb_generate_label(a,"MicrosoftTeams",!0,t[1]),a.addEventListener("click",function(){atcb_generate_teams(n),atcb_close()});break;case"Microsoft365":atcb_generate_label(a,"Microsoft365",!0,t[1]),a.addEventListener("click",function(){atcb_generate_microsoft(n,"365"),atcb_close()});break;case"Outlook.com":atcb_generate_label(a,"Outlook.com",!0,t[1]),a.addEventListener("click",function(){atcb_generate_microsoft(n,"outlook"),atcb_close()});break;case"Yahoo":atcb_generate_label(a,"Yahoo",!0,t[1]),a.addEventListener("click",function(){atcb_generate_yahoo(n),atcb_close()})}a.addEventListener("keydown",function(e){"Enter"==e.key&&this.click()})}),c}function atcb_generate_bg_overlay(e){const t=document.createElement("div");t.classList.add("atcb_bgoverlay"),"modal"!==e.listStyle&&t.classList.add("atcb_animate_bg"),t.tabIndex=0,t.addEventListener("click",()=>atcb_close(!0));let a=!1;return t.addEventListener("touchstart",()=>a=!1,{passive:!0}),t.addEventListener("touchmove",()=>
1a=!0,{passive:!0}),t.addEventListener("touchend",function(){!1===a&&atcb_close(!0)},{passive:!0}),t.addEventListener("focus",()=>atcb_close(!1)),"click"!==e.trigger?t.addEventListener("mousemove",()=>atcb_close(!0)):t.classList.add("atcb_click"),t}function atcb_toggle(e,t,a=!0,n=!1){t.classList.contains("atcb_active")?atcb_close():atcb_open(e,t,a,n)}function atcb_open(e,t,a=!0,n=!1){if(!document.querySelector(".atcb_list")){const c=atcb_generate_dropdown_list(e);t?(t.classList.add("atcb_active"),"modal"===e.listStyle?(t.classList.add("atcb_modal_style"),c.classList.add("atcb_modal")):(t=t.getBoundingClientRect(),c.style.width=t.width+"px",c.style.top=t.bottom+window.scrollY-3+"px",c.style.left=t.left+"px",c.classList.add("atcb_dropdown"),n&&c.classList.add("atcb_generated_button"))):(e.listStyle="modal",c.classList.add("atcb_modal")),document.body.appendChild(c),document.body.appendChild(atcb_generate_bg_overlay(e)),a&&c.firstChild.focus()}}function atcb_close(e=!1){if(!e){let e=document.querySelector(".atcb_active");e&&e.focus()}
1Array.from(document.querySelectorAll(".atcb_active")).forEach(e=>{e.classList.remove("atcb_active")}),Array.from(document.querySelectorAll(".atcb_list")).concat(Array.from(document.querySelectorAll(".atcb_bgoverlay"))).forEach(e=>e.remove())}function atcb_action(e,t,a=!0){if(!atcb_check_required(e))throw new Error("data missing; see logs");if(!atcb_validate(e=atcb_decorate_data(e)))throw new Error("Invalid data; see logs");atcb_open(e,t,a)}function atcb_generate_google(e){let t="https://calendar.google.com/calendar/render?action=TEMPLATE";var a=atcb_generate_time(e,"clean","google");t+="&dates="+a.start+"%2F"+a.end,null!=e.name&&""!=e.name&&(t+="&text="+encodeURIComponent(e.name));let n="";null!=e.description&&""!=e.description&&(n=e.description),null!=e.location&&""!=e.location&&(t+="&location="+encodeURIComponent(e.location),isiOS()&&(""!=n&&(n+="<br><br>"),n+="📍: "+e.location)),""!=n&&(t+="&details="+encodeURIComponent(n)),null!=e.recurrence&&""!=e.recurrence&&(t+="&recur="+encodeURIComponent(e.recurrence)),atcb_secure_url(t)&&window.open(t,"_blank").focus()}function atcb_generate_yahoo(e){let t="https://calendar.yahoo.com/?v=60";var a=atcb_generate_time(e,"clean");t+="&st="+a.start+"&et="+a.end,a.allday&&(t+="&dur=allday"),null!=e.name&&""!=e.name&&(t+="&title="+encodeURIComponent(e.name)),null!=e.location&&""!=e.location&&(t+="&in_loc="+encodeURIComponent(e.location)),null!=e.descriptionHtmlFree&&""!=e.descriptionHtmlFree&&(t+="&desc="+encodeURIComponent(e.description)),null!=e.recurrence&&""!=e.recurrence&&(t+="&recur="+encodeURIComponent(e.recurrence)),atcb_secure_url(t)&&window.open(t,"_blank").focus()}function atcb_generate_microsoft(e,t="365"){let a="https://";a+="outlook"==t?"outlook.live.com":"outlook.office.com",a+="/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent";t=atcb_generate_time(e,"delimiters","microsoft");a+="&startdt="+t.start+"&enddt="+t.end,t.allday&&(a+="&allday=true"),null!=e.name&&""!=e.name&&(a+="&subject="+encodeURIComponent(e.name)),null!=e.location&&""!=e.location&&(a+="&location="+encodeURIComponent(e.location)),null!=e.description&&""!=e.description&&(a+="&body="+encodeURIComponent(e.description.replace(/\n/g,"<br>"))),atcb_secure_url(a)&&window.open(a,"_blank").focus()}function atcb_generate_teams(e){let t="https://teams.microsoft.com/l/meeting/new?";var a=atcb_generate_time(e,"delimiters","microsoft");t+="&startTime="+a.start+"&endTime="+a.end;let n="";null!=e.name&&""!=e.name&&(t+="&subject="+encodeURIComponent(e.name)),null!=e.location&&""!=e.location&&(n=encodeURIComponent(e.location),t+="&location="+n,n+=" // "),null!=e.descriptionHtmlFree&&""!=e.descriptionHtmlFree&&(t+="&content="+n+encodeURIComponent(e.descriptionHtmlFree)),atcb_secure_url(t)&&window.open(t,"_blank").focus()}function atcb_generate_ical(e){let t=new Date;t=t.toISOString();var a=atcb_generate_time(e,"clean","ical");let n="";a.allday&&(n=";VALUE=DATE");const c=["BEGIN:VCALENDAR","VERSION:2.0"];c.push("PRODID:-// github.com/jekuer/add-to-calendar-button // atcb v"+atcbVersion+" //EN"),c.push("CALSCALE:GREGORIAN"),c.push("BEGIN:VEVENT"),c.push("UID:"+t+"@add-to-calendar-button"),c.push("DTSTAMP:"+a.start,"DTSTART"+n+":"+a.start,"DTEND"+n+":"+a.end,"SUMMARY:"+e.name.replace(/.{65}/g,"$&\r\n ")),null!=e.descriptionHtmlFree&&""!=e.descriptionHtmlFree&&c.push("DESCRIPTION:"+e.descriptionHtmlFree.replace(/\n/g,"\\n").replace(/.{60}/g,"$&\r\n ")),null!=e.location&&""!=e.location&&c.push("LOCATION:"+e.location),null!=e.recurrence&&""!=e.recurrence&&c.push(e.recurrence),t=t.replace(/\.\d{3}/g,"").replace(/[^a-z\d]/gi,""),c.push("STATUS:CONFIRMED","LAST-MODIFIED:"+t,"SEQUENCE:0","END:VEVENT","END:VCALENDAR");a="data:text/calendar;charset=utf-8,"+encodeURIComponent(c.join("\r\n")),e=e.iCalFileName||"event-to-save-in-my-calendar";try{if(window.ActiveXObject){if(window.ActiveXObject&&document.execCommand){const l=window.open(a,"_blank");l.document.close(),l.document.execCommand("SaveAs",!0,e||a),l.close()}}else{const i=document.createElement("a");i.href=a,i.target="_blank",i.download=e;var o=new MouseEvent("click",{view:window,button:0,bubbles:!0,cancelable:!1});i.dispatchEvent(o),(window.URL||window.webkitURL).revokeObjectURL(i.href)}}catch(e){console.error(e)}}function atcb_generate_time(e,a="delimiters",n="general"){var c=e.startDate.split("-"),o=e.endDate.split("-");let l="",i="",r=!1;if(null!=e.startTime&&null!=e.endTime){if(null!=e.timeZoneOffset&&""!=e.timeZoneOffset)l=new Date(c[0]+"-"+c[1]+"-"+c[2]+"T"+e.startTime+":00.000"+e.timeZoneOffset),i=new Date(o[0]+"-"+o[1]+"-"+o[2]+"T"+e.endTime+":00.000"+e.timeZoneOffset);else if(l=new Date(c[0]+"-"+c[1]+"-"+c[2]+"T"+e.startTime+":00.000+00:00"),i=new Date(o[0]+"-"+o[1]+"-"+o[2]+"T"+e.endTime+":00.000+00:00"),null!=e.timeZone&&""!=e.timeZone){const t=new Date(l.toLocaleStr
1ing("en-US",{timeZone:"UTC"})),s=("currentBrowser"==e.timeZone&&(e.timeZone=Intl.DateTimeFormat().resolvedOptions().timeZone),new Date(l.toLocaleString("en-US",{timeZone:e.timeZone})));e=t.getTime()-s.getTime();l.setTime(l.getTime()+e),i.setTime(i.getTime()+e)}l=l.toISOString().replace(".000",""),i=i.toISOString().replace(".000",""),"clean"==a&&(l=l.replace(/-/g,"").replace(/:/g,""),i=i.replace(/-/g,"").replace(/:/g,""))}else{r=!0,l=new Date(Date.UTC(c[0],c[1]-1,c[2]));let e=l.toISOString().replace(/T(.+)Z/g,""),t=(i=new Date(Date.UTC(o[0],o[1]-1,o[2])),"google"!=n&&"microsoft"!=n&&"ical"!=n||i.setDate(i.getDate()+1),i.toISOString().replace(/T(.+)Z/g,""));"clean"==a&&(e=e.replace(/-/g,""),t=t.replace(/-/g,"")),l=e,i=t}return{start:l,end:i,allday:r}}function atcb_secure_url(e){return!e.match(/((\.\.\/)|(\.\.\\)|(%2e%2e%2f)|(%252e%252e%252f)|(%2e%2e\/)|(%252e%252e\/)|(\.\.%2f)|(\.\.%252f)|(%2e%2e%5c)|(%252e%252e%255c)|(%2e%2e\\)|(%252e%252e\\)|(\.\.%5c)|(\.\.%255c)|(\.\.%c0%af)|(\.\.%25c0%25af)|(\.\.%c1%9c)|(\.\.%25c1%259c))/gi)||(console.error("Seems like the generated URL includes at least one security issue and got blocked. Please check the calendar button parameters!"),!1)}if(isBrowser()){document.addEventListener("keydown",e=>{"Escape"===e.key&&atcb_close()});let e=window.innerWidth;window.addEventListener("resize",()=>{window.innerWidth!=e&&(e=window.innerWidth,atcb_close(!0))})}isBrowser()&&document.addEventListener("DOMContentLoaded",atcb_init,!1); 2//# sourceMappingURL=atcb.min.js.map 3/**! 4 * @fileOverview Kickass library to create and place poppers near their reference elements. 5 * @version 1.16.1 6 * @license 7 * Copyright (c) 2016 Federico Zivolo and contributors 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a copy 10 * of this software and associated documentation files (the "Software"), to deal 11 * in the Software without restriction, including without limitation the rights 12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 * copies of the Software, and to permit persons to whom the Software is 14 * furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included in all 17 * copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 * SOFTWARE. 26 */ 27(function (global, factory) { 28 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 29 typeof define === 'function' && define.amd ? define(factory) : 30 (global.Popper = factory()); 31}(this, (function () { 'use strict';
vendor: 12,004 bytes, lines 32-456
32 33var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 34 35var timeoutDuration = function () { 36 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 37 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 38 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 39 return 1; 40 } 41 } 42 return 0; 43}(); 44 45function microtaskDebounce(fn) { 46 var called = false; 47 return function () { 48 if (called) { 49 return; 50 } 51 called = true; 52 window.Promise.resolve().then(function () { 53 called = false; 54 fn(); 55 }); 56 }; 57} 58 59function taskDebounce(fn) { 60 var scheduled = false; 61 return function () { 62 if (!scheduled) { 63 scheduled = true; 64 setTimeout(function () { 65 scheduled = false; 66 fn(); 67 }, timeoutDuration); 68 } 69 }; 70} 71 72var supportsMicroTasks = isBrowser && window.Promise; 73 74/** 75* Create a debounced version of a method, that's asynchronously deferred 76* but called in the minimum time possible. 77* 78* @method 79* @memberof Popper.Utils 80* @argument {Function} fn 81* @returns {Function} 82*/ 83var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 84 85/** 86 * Check if the given variable is a function 87 * @method 88 * @memberof Popper.Utils 89 * @argument {Any} functionToCheck - variable to check 90 * @returns {Boolean} answer to: is a function? 91 */ 92function isFunction(functionToCheck) { 93 var getType = {}; 94 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 95} 96 97/** 98 * Get CSS computed property of the given element 99 * @method 100 * @memberof Popper.Utils 101 * @argument {Eement} element 102 * @argument {String} property 103 */ 104function getStyleComputedProperty(element, property) { 105 if (element.nodeType !== 1) { 106 return []; 107 } 108 // NOTE: 1 DOM access here 109 var window = element.ownerDocument.defaultView; 110 var css = window.getComputedStyle(element, null); 111 return property ? css[property] : css; 112} 113 114/** 115 * Returns the parentNode or the host of the element 116 * @method 117 * @memberof Popper.Utils 118 * @argument {Element} element 119 * @returns {Element} parent 120 */ 121function getParentNode(element) { 122 if (element.nodeName === 'HTML') { 123 return element; 124 } 125 return element.parentNode || element.host; 126} 127 128/** 129 * Returns the scrolling parent of the given element 130 * @method 131 * @memberof Popper.Utils 132 * @argument {Element} element 133 * @returns {Element} scroll parent 134 */ 135function getScrollParent(element) { 136 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 137 if (!element) { 138 return document.body; 139 } 140 141 switch (element.nodeName) { 142 case 'HTML': 143 case 'BODY': 144 return element.ownerDocument.body; 145 case '#document': 146 return element.body; 147 } 148 149 // Firefox want us to check `-x` and `-y` variations as well 150 151 var _getStyleComputedProp = getStyleComputedProperty(element), 152 overflow = _getStyleComputedProp.overflow, 153 overflowX = _getStyleComputedProp.overflowX, 154 overflowY = _getStyleComputedProp.overflowY; 155 156 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 157 return element; 158 } 159 160 return getScrollParent(getParentNode(element)); 161} 162 163/** 164 * Returns the reference node of the reference object, or the reference object itself. 165 * @method 166 * @memberof Popper.Utils 167 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 168 * @returns {Element} parent 169 */ 170function getReferenceNode(reference) { 171 return reference && reference.referenceNode ? reference.referenceNode : reference; 172} 173 174var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 175var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 176 177/** 178 * Determines if the browser is Internet Explorer 179 * @method 180 * @memberof Popper.Utils 181 * @param {Number} version to check 182 * @returns {Boolean} isIE 183 */ 184function isIE(version) { 185 if (version === 11) { 186 return isIE11; 187 } 188 if (version === 10) { 189 return isIE10; 190 } 191 return isIE11 || isIE10; 192} 193 194/** 195 * Returns the offset parent of the given element 196 * @method 197 * @memberof Popper.Utils 198 * @argument {Element} element 199 * @returns {Element} offset parent 200 */ 201function getOffsetParent(element) { 202 if (!element) { 203 return document.documentElement; 204 } 205 206 var noOffsetParent = isIE(10) ? document.body : null; 207 208 // NOTE: 1 DOM access here 209 var offsetParent = element.offsetParent || null; 210 // Skip hidden elements which don't have an offsetParent 211 while (offsetParent === noOffsetParent && element.nextElementSibling) { 212 offsetParent = (element = element.nextElementSibling).offsetParent; 213 } 214 215 var nodeName = offsetParent && offsetParent.nodeName; 216 217 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 218 return element ? element.ownerDocument.documentElement : document.documentElement; 219 } 220 221 // .offsetParent will return the closest TH, TD or TABLE in case 222 // no offsetParent is present, I hate this job... 223 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 224 return getOffsetParent(offsetParent); 225 } 226 227 return offsetParent; 228} 229 230function isOffsetContainer(element) { 231 var nodeName = element.nodeName; 232 233 if (nodeName === 'BODY') { 234 return false; 235 } 236 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 237} 238 239/** 240 * Finds the root node (document, shadowDOM root) of the given element 241 * @method 242 * @memberof Popper.Utils 243 * @argument {Element} node 244 * @returns {Element} root node 245 */ 246function getRoot(node) { 247 if (node.parentNode !== null) { 248 return getRoot(node.parentNode); 249 } 250 251 return node; 252} 253 254/** 255 * Finds the offset parent common to the two provided nodes 256 * @method 257 * @memberof Popper.Utils 258 * @argument {Element} element1 259 * @argument {Element} element2 260 * @returns {Element} common offset parent 261 */ 262function findCommonOffsetParent(element1, element2) { 263 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 264 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 265 return document.documentElement; 266 } 267 268 // Here we make sure to give as "start" the element that comes first in the DOM 269 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 270 var start = order ? element1 : element2; 271 var end = order ? element2 : element1; 272 273 // Get common ancestor container 274 var range = document.createRange(); 275 range.setStart(start, 0); 276 range.setEnd(end, 0); 277 var commonAncestorContainer = range.commonAncestorContainer; 278 279 // Both nodes are inside #document 280 281 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 282 if (isOffsetContainer(commonAncestorContainer)) { 283 return commonAncestorContainer; 284 } 285 286 return getOffsetParent(commonAncestorContainer); 287 } 288 289 // one of the nodes is inside shadowDOM, find which one 290 var element1root = getRoot(element1); 291 if (element1root.host) { 292 return findCommonOffsetParent(element1root.host, element2); 293 } else { 294 return findCommonOffsetParent(element1, getRoot(element2).host); 295 } 296} 297 298/** 299 * Gets the scroll value of the given element in the given side (top and left) 300 * @method 301 * @memberof Popper.Utils 302 * @argument {Element} element 303 * @argument {String} side `top` or `left` 304 * @returns {number} amount of scrolled pixels 305 */ 306function getScroll(element) { 307 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 308 309 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 310 var nodeName = element.nodeName; 311 312 if (nodeName === 'BODY' || nodeName === 'HTML') { 313 var html = element.ownerDocument.documentElement; 314 var scrollingElement = element.ownerDocument.scrollingElement || html; 315 return scrollingElement[upperSide]; 316 } 317 318 return element[upperSide]; 319} 320 321/* 322 * Sum or subtract the element scroll values (left and top) from a given rect object 323 * @method 324 * @memberof Popper.Utils 325 * @param {Object} rect - Rect object you want to change 326 * @param {HTMLElement} element - The element from the function reads the scroll values 327 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 328 * @return {Object} rect - The modifier rect object 329 */ 330function includeScroll(rect, element) { 331 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 332 333 var scrollTop = getScroll(element, 'top'); 334 var scrollLeft = getScroll(element, 'left'); 335 var modifier = subtract ? -1 : 1; 336 rect.top += scrollTop * modifier; 337 rect.bottom += scrollTop * modifier; 338 rect.left += scrollLeft * modifier; 339 rect.right += scrollLeft * modifier; 340 return rect; 341} 342 343/* 344 * Helper to detect borders of a given element 345 * @method 346 * @memberof Popper.Utils 347 * @param {CSSStyleDeclaration} styles 348 * Result of `getStyleComputedProperty` on the given element 349 * @param {String} axis - `x` or `y` 350 * @return {number} borders - The borders size of the given axis 351 */ 352 353function getBordersSize(styles, axis) { 354 var sideA = axis === 'x' ? 'Left' : 'Top'; 355 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 356 357 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 358} 359 360function getSize(axis, body, html, computedStyle) { 361 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 362} 363 364function getWindowSizes(document) { 365 var body = document.body; 366 var html = document.documentElement; 367 var computedStyle = isIE(10) && getComputedStyle(html); 368 369 return { 370 height: getSize('Height', body, html, computedStyle), 371 width: getSize('Width', body, html, computedStyle) 372 }; 373} 374 375var classCallCheck = function (instance, Constructor) { 376 if (!(instance instanceof Constructor)) { 377 throw new TypeError("Cannot call a class as a function"); 378 } 379}; 380 381var createClass = function () { 382 function defineProperties(target, props) { 383 for (var i = 0; i < props.length; i++) { 384 var descriptor = props[i]; 385 descriptor.enumerable = descriptor.enumerable || false; 386 descriptor.configurable = true; 387 if ("value" in descriptor) descriptor.writable = true; 388 Object.defineProperty(target, descriptor.key, descriptor); 389 } 390 } 391 392 return function (Constructor, protoProps, staticProps) { 393 if (protoProps) defineProperties(Constructor.prototype, protoProps); 394 if (staticProps) defineProperties(Constructor, staticProps); 395 return Constructor; 396 }; 397}(); 398 399 400 401 402 403var defineProperty = function (obj, key, value) { 404 if (key in obj) { 405 Object.defineProperty(obj, key, { 406 value: value, 407 enumerable: true, 408 configurable: true, 409 writable: true 410 }); 411 } else { 412 obj[key] = value; 413 } 414 415 return obj; 416}; 417 418var _extends = Object.assign || function (target) { 419 for (var i = 1; i < arguments.length; i++) { 420 var source = arguments[i]; 421 422 for (var key in source) { 423 if (Object.prototype.hasOwnProperty.call(source, key)) { 424 target[key] = source[key]; 425 } 426 } 427 } 428 429 return target; 430}; 431 432/** 433 * Given element offsets, generate an output similar to getBoundingClientRect 434 * @method 435 * @memberof Popper.Utils 436 * @argument {Object} offsets 437 * @returns {Object} ClientRect like output 438 */ 439function getClientRect(offsets) { 440 return _extends({}, offsets, { 441 right: offsets.left + offsets.width, 442 bottom: offsets.top + offsets.height 443 }); 444} 445 446/** 447 * Get bounding client rect of given element 448 * @method 449 * @memberof Popper.Utils 450 * @param {HTMLElement} element 451 * @return {Object} client rect 452 */ 453function getBoundingClientRect(element) { 454 var rect = {}; 455 456 // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 4,625 bytes, lines 457-586
457 // considered in DOM in some circumstances... 458 // This isn't reproducible in IE10 compatibility mode of IE11 459 try { 460 if (isIE(10)) { 461 rect = element.getBoundingClientRect(); 462 var scrollTop = getScroll(element, 'top'); 463 var scrollLeft = getScroll(element, 'left'); 464 rect.top += scrollTop; 465 rect.left += scrollLeft; 466 rect.bottom += scrollTop; 467 rect.right += scrollLeft; 468 } else { 469 rect = element.getBoundingClientRect(); 470 } 471 } catch (e) {} 472 473 var result = { 474 left: rect.left, 475 top: rect.top, 476 width: rect.right - rect.left, 477 height: rect.bottom - rect.top 478 }; 479 480 // subtract scrollbar size from sizes 481 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 482 var width = sizes.width || element.clientWidth || result.width; 483 var height = sizes.height || element.clientHeight || result.height; 484 485 var horizScrollbar = element.offsetWidth - width; 486 var vertScrollbar = element.offsetHeight - height; 487 488 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 489 // we make this check conditional for performance reasons 490 if (horizScrollbar || vertScrollbar) { 491 var styles = getStyleComputedProperty(element); 492 horizScrollbar -= getBordersSize(styles, 'x'); 493 vertScrollbar -= getBordersSize(styles, 'y'); 494 495 result.width -= horizScrollbar; 496 result.height -= vertScrollbar; 497 } 498 499 return getClientRect(result); 500} 501 502function getOffsetRectRelativeToArbitraryNode(children, parent) { 503 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 504 505 var isIE10 = isIE(10); 506 var isHTML = parent.nodeName === 'HTML'; 507 var childrenRect = getBoundingClientRect(children); 508 var parentRect = getBoundingClientRect(parent); 509 var scrollParent = getScrollParent(children); 510 511 var styles = getStyleComputedProperty(parent); 512 var borderTopWidth = parseFloat(styles.borderTopWidth); 513 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 514 515 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 516 if (fixedPosition && isHTML) { 517 parentRect.top = Math.max(parentRect.top, 0); 518 parentRect.left = Math.max(parentRect.left, 0); 519 } 520 var offsets = getClientRect({ 521 top: childrenRect.top - parentRect.top - borderTopWidth, 522 left: childrenRect.left - parentRect.left - borderLeftWidth, 523 width: childrenRect.width, 524 height: childrenRect.height 525 }); 526 offsets.marginTop = 0; 527 offsets.marginLeft = 0; 528 529 // Subtract margins of documentElement in case it's being used as parent 530 // we do this only on HTML because it's the only element that behaves 531 // differently when margins are applied to it. The margins are included in 532 // the box of the documentElement, in the other cases not. 533 if (!isIE10 && isHTML) { 534 var marginTop = parseFloat(styles.marginTop); 535 var marginLeft = parseFloat(styles.marginLeft); 536 537 offsets.top -= borderTopWidth - marginTop; 538 offsets.bottom -= borderTopWidth - marginTop; 539 offsets.left -= borderLeftWidth - marginLeft; 540 offsets.right -= borderLeftWidth - marginLeft; 541 542 // Attach marginTop and marginLeft because in some circumstances we may need them 543 offsets.marginTop = marginTop; 544 offsets.marginLeft = marginLeft; 545 } 546 547 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 548 offsets = includeScroll(offsets, parent); 549 } 550 551 return offsets; 552} 553 554function getViewportOffsetRectRelativeToArtbitraryNode(element) { 555 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 556 557 var html = element.ownerDocument.documentElement; 558 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 559 var width = Math.max(html.clientWidth, window.innerWidth || 0); 560 var height = Math.max(html.clientHeight, window.innerHeight || 0); 561 562 var scrollTop = !excludeScroll ? getScroll(html) : 0; 563 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 564 565 var offset = { 566 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 567 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 568 width: width, 569 height: height 570 }; 571 572 return getClientRect(offset); 573} 574 575/** 576 * Check if the given element is fixed or is inside a fixed parent 577 * @method 578 * @memberof Popper.Utils 579 * @argument {Element} element 580 * @argument {Element} customContainer 581 * @returns {Boolean} answer to "isFixed?" 582 */ 583function isFixed(element) { 584 var nodeName = element.nodeName; 585 if (nodeName === 'BODY' || nodeName === 'HTML') { 586 return false;
vendor: 51,450 bytes, lines 587-2085
587 } 588 if (getStyleComputedProperty(element, 'position') === 'fixed') { 589 return true; 590 } 591 var parentNode = getParentNode(element); 592 if (!parentNode) { 593 return false; 594 } 595 return isFixed(parentNode); 596} 597 598/** 599 * Finds the first parent of an element that has a transformed property defined 600 * @method 601 * @memberof Popper.Utils 602 * @argument {Element} element 603 * @returns {Element} first transformed parent or documentElement 604 */ 605 606function getFixedPositionOffsetParent(element) { 607 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 608 if (!element || !element.parentElement || isIE()) { 609 return document.documentElement; 610 } 611 var el = element.parentElement; 612 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 613 el = el.parentElement; 614 } 615 return el || document.documentElement; 616} 617 618/** 619 * Computed the boundaries limits and return them 620 * @method 621 * @memberof Popper.Utils 622 * @param {HTMLElement} popper 623 * @param {HTMLElement} reference 624 * @param {number} padding 625 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 626 * @param {Boolean} fixedPosition - Is in fixed position mode 627 * @returns {Object} Coordinates of the boundaries 628 */ 629function getBoundaries(popper, reference, padding, boundariesElement) { 630 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 631 632 // NOTE: 1 DOM access here 633 634 var boundaries = { top: 0, left: 0 }; 635 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 636 637 // Handle viewport case 638 if (boundariesElement === 'viewport') { 639 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 640 } else { 641 // Handle other cases based on DOM element used as boundaries 642 var boundariesNode = void 0; 643 if (boundariesElement === 'scrollParent') { 644 boundariesNode = getScrollParent(getParentNode(reference)); 645 if (boundariesNode.nodeName === 'BODY') { 646 boundariesNode = popper.ownerDocument.documentElement; 647 } 648 } else if (boundariesElement === 'window') { 649 boundariesNode = popper.ownerDocument.documentElement; 650 } else { 651 boundariesNode = boundariesElement; 652 } 653 654 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 655 656 // In case of HTML, we need a different computation 657 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 658 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 659 height = _getWindowSizes.height, 660 width = _getWindowSizes.width; 661 662 boundaries.top += offsets.top - offsets.marginTop; 663 boundaries.bottom = height + offsets.top; 664 boundaries.left += offsets.left - offsets.marginLeft; 665 boundaries.right = width + offsets.left; 666 } else { 667 // for all the other DOM elements, this one is good 668 boundaries = offsets; 669 } 670 } 671 672 // Add paddings 673 padding = padding || 0; 674 var isPaddingNumber = typeof padding === 'number'; 675 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 676 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 677 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 678 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 679 680 return boundaries; 681} 682 683function getArea(_ref) { 684 var width = _ref.width, 685 height = _ref.height; 686 687 return width * height; 688} 689 690/** 691 * Utility used to transform the `auto` placement to the placement with more 692 * available space. 693 * @method 694 * @memberof Popper.Utils 695 * @argument {Object} data - The data object generated by update method 696 * @argument {Object} options - Modifiers configuration and options 697 * @returns {Object} The data object, properly modified 698 */ 699function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 700 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 701 702 if (placement.indexOf('auto') === -1) { 703 return placement; 704 } 705 706 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 707 708 var rects = { 709 top: { 710 width: boundaries.width, 711 height: refRect.top - boundaries.top 712 }, 713 right: { 714 width: boundaries.right - refRect.right, 715 height: boundaries.height 716 }, 717 bottom: { 718 width: boundaries.width, 719 height: boundaries.bottom - refRect.bottom 720 }, 721 left: { 722 width: refRect.left - boundaries.left, 723 height: boundaries.height 724 } 725 }; 726 727 var sortedAreas = Object.keys(rects).map(function (key) { 728 return _extends({ 729 key: key 730 }, rects[key], { 731 area: getArea(rects[key]) 732 }); 733 }).sort(function (a, b) { 734 return b.area - a.area; 735 }); 736 737 var filteredAreas = sortedAreas.filter(function (_ref2) { 738 var width = _ref2.width, 739 height = _ref2.height; 740 return width >= popper.clientWidth && height >= popper.clientHeight; 741 }); 742 743 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 744 745 var variation = placement.split('-')[1]; 746 747 return computedPlacement + (variation ? '-' + variation : ''); 748} 749 750/** 751 * Get offsets to the reference element 752 * @method 753 * @memberof Popper.Utils 754 * @param {Object} state 755 * @param {Element} popper - the popper element 756 * @param {Element} reference - the reference element (the popper will be relative to this) 757 * @param {Element} fixedPosition - is in fixed position mode 758 * @returns {Object} An object containing the offsets which will be applied to the popper 759 */ 760function getReferenceOffsets(state, popper, reference) { 761 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 762 763 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 764 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 765} 766 767/** 768 * Get the outer sizes of the given element (offset size + margins) 769 * @method 770 * @memberof Popper.Utils 771 * @argument {Element} element 772 * @returns {Object} object containing width and height properties 773 */ 774function getOuterSizes(element) { 775 var window = element.ownerDocument.defaultView; 776 var styles = window.getComputedStyle(element); 777 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 778 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 779 var result = { 780 width: element.offsetWidth + y, 781 height: element.offsetHeight + x 782 }; 783 return result; 784} 785 786/** 787 * Get the opposite placement of the given one 788 * @method 789 * @memberof Popper.Utils 790 * @argument {String} placement 791 * @returns {String} flipped placement 792 */ 793function getOppositePlacement(placement) { 794 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 795 return placement.replace(/left|right|bottom|top/g, function (matched) { 796 return hash[matched]; 797 }); 798} 799 800/** 801 * Get offsets to the popper 802 * @method 803 * @memberof Popper.Utils 804 * @param {Object} position - CSS position the Popper will get applied 805 * @param {HTMLElement} popper - the popper element 806 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 807 * @param {String} placement - one of the valid placement options 808 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 809 */ 810function getPopperOffsets(popper, referenceOffsets, placement) { 811 placement = placement.split('-')[0]; 812 813 // Get popper node sizes 814 var popperRect = getOuterSizes(popper); 815 816 // Add position, width and height to our offsets object 817 var popperOffsets = { 818 width: popperRect.width, 819 height: popperRect.height 820 }; 821 822 // depending by the popper placement we have to compute its offsets slightly differently 823 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 824 var mainSide = isHoriz ? 'top' : 'left'; 825 var secondarySide = isHoriz ? 'left' : 'top'; 826 var measurement = isHoriz ? 'height' : 'width'; 827 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 828 829 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 830 if (placement === secondarySide) { 831 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 832 } else { 833 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 834 } 835 836 return popperOffsets; 837} 838 839/** 840 * Mimics the `find` method of Array 841 * @method 842 * @memberof Popper.Utils 843 * @argument {Array} arr 844 * @argument prop 845 * @argument value 846 * @returns index or -1 847 */ 848function find(arr, check) { 849 // use native find if supported 850 if (Array.prototype.find) { 851 return arr.find(check); 852 } 853 854 // use `filter` to obtain the same behavior of `find` 855 return arr.filter(check)[0]; 856} 857 858/** 859 * Return the index of the matching object 860 * @method 861 * @memberof Popper.Utils 862 * @argument {Array} arr 863 * @argument prop 864 * @argument value 865 * @returns index or -1 866 */ 867function findIndex(arr, prop, value) { 868 // use native findIndex if supported 869 if (Array.prototype.findIndex) { 870 return arr.findIndex(function (cur) { 871 return cur[prop] === value; 872 }); 873 } 874 875 // use `find` + `indexOf` if `findIndex` isn't supported 876 var match = find(arr, function (obj) { 877 return obj[prop] === value; 878 }); 879 return arr.indexOf(match); 880} 881 882/** 883 * Loop trough the list of modifiers and run them in order, 884 * each of them will then edit the data object. 885 * @method 886 * @memberof Popper.Utils 887 * @param {dataObject} data 888 * @param {Array} modifiers 889 * @param {String} ends - Optional modifier name used as stopper 890 * @returns {dataObject} 891 */ 892function runModifiers(modifiers, data, ends) { 893 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 894 895 modifiersToRun.forEach(function (modifier) { 896 if (modifier['function']) { 897 // eslint-disable-line dot-notation 898 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 899 } 900 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 901 if (modifier.enabled && isFunction(fn)) { 902 // Add properties to offsets to make them a complete clientRect object 903 // we do this before each modifier to make sure the previous one doesn't 904 // mess with these values 905 data.offsets.popper = getClientRect(data.offsets.popper); 906 data.offsets.reference = getClientRect(data.offsets.reference); 907 908 data = fn(data, modifier); 909 } 910 }); 911 912 return data; 913} 914 915/** 916 * Updates the position of the popper, computing the new offsets and applying 917 * the new style.<br /> 918 * Prefer `scheduleUpdate` over `update` because of performance reasons. 919 * @method 920 * @memberof Popper 921 */ 922function update() { 923 // if popper is destroyed, don't perform any further update 924 if (this.state.isDestroyed) { 925 return; 926 } 927 928 var data = { 929 instance: this, 930 styles: {}, 931 arrowStyles: {}, 932 attributes: {}, 933 flipped: false, 934 offsets: {} 935 }; 936 937 // compute reference element offsets 938 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 939 940 // compute auto placement, store placement inside the data object, 941 // modifiers will be able to edit `placement` if needed 942 // and refer to originalPlacement to know the original value 943 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 944 945 // store the computed placement inside `originalPlacement` 946 data.originalPlacement = data.placement; 947 948 data.positionFixed = this.options.positionFixed; 949 950 // compute the popper offsets 951 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 952 953 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 954 955 // run the modifiers 956 data = runModifiers(this.modifiers, data); 957 958 // the first `update` will call `onCreate` callback 959 // the other ones will call `onUpdate` callback 960 if (!this.state.isCreated) { 961 this.state.isCreated = true; 962 this.options.onCreate(data); 963 } else { 964 this.options.onUpdate(data); 965 } 966} 967 968/** 969 * Helper used to know if the given modifier is enabled. 970 * @method 971 * @memberof Popper.Utils 972 * @returns {Boolean} 973 */ 974function isModifierEnabled(modifiers, modifierName) { 975 return modifiers.some(function (_ref) { 976 var name = _ref.name, 977 enabled = _ref.enabled; 978 return enabled && name === modifierName; 979 }); 980} 981 982/** 983 * Get the prefixed supported property name 984 * @method 985 * @memberof Popper.Utils 986 * @argument {String} property (camelCase) 987 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 988 */ 989function getSupportedPropertyName(property) { 990 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 991 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 992 993 for (var i = 0; i < prefixes.length; i++) { 994 var prefix = prefixes[i]; 995 var toCheck = prefix ? '' + prefix + upperProp : property; 996 if (typeof document.body.style[toCheck] !== 'undefined') { 997 return toCheck; 998 } 999 } 1000 return null; 1001} 1002 1003/** 1004 * Destroys the popper. 1005 * @method 1006 * @memberof Popper 1007 */ 1008function destroy() { 1009 this.state.isDestroyed = true; 1010 1011 // touch DOM only if `applyStyle` modifier is enabled 1012 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 1013 this.popper.removeAttribute('x-placement'); 1014 this.popper.style.position = ''; 1015 this.popper.style.top = ''; 1016 this.popper.style.left = ''; 1017 this.popper.style.right = ''; 1018 this.popper.style.bottom = ''; 1019 this.popper.style.willChange = ''; 1020 this.popper.style[getSupportedPropertyName('transform')] = ''; 1021 } 1022 1023 this.disableEventListeners(); 1024 1025 // remove the popper if user explicitly asked for the deletion on destroy 1026 // do not use `remove` because IE11 doesn't support it 1027 if (this.options.removeOnDestroy) { 1028 this.popper.parentNode.removeChild(this.popper); 1029 } 1030 return this; 1031} 1032 1033/** 1034 * Get the window associated with the element 1035 * @argument {Element} element 1036 * @returns {Window} 1037 */ 1038function getWindow(element) { 1039 var ownerDocument = element.ownerDocument; 1040 return ownerDocument ? ownerDocument.defaultView : window; 1041} 1042 1043function attachToScrollParents(scrollParent, event, callback, scrollParents) { 1044 var isBody = scrollParent.nodeName === 'BODY'; 1045 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 1046 target.addEventListener(event, callback, { passive: true }); 1047 1048 if (!isBody) { 1049 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 1050 } 1051 scrollParents.push(target); 1052} 1053 1054/** 1055 * Setup needed event listeners used to update the popper position 1056 * @method 1057 * @memberof Popper.Utils 1058 * @private 1059 */ 1060function setupEventListeners(reference, options, state, updateBound) { 1061 // Resize event listener on window 1062 state.updateBound = updateBound; 1063 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 1064 1065 // Scroll event listener on scroll parents 1066 var scrollElement = getScrollParent(reference); 1067 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 1068 state.scrollElement = scrollElement; 1069 state.eventsEnabled = true; 1070 1071 return state; 1072} 1073 1074/** 1075 * It will add resize/scroll events and start recalculating 1076 * position of the popper element when they are triggered. 1077 * @method 1078 * @memberof Popper 1079 */ 1080function enableEventListeners() { 1081 if (!this.state.eventsEnabled) { 1082 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 1083 } 1084} 1085 1086/** 1087 * Remove event listeners used to update the popper position 1088 * @method 1089 * @memberof Popper.Utils 1090 * @private 1091 */ 1092function removeEventListeners(reference, state) { 1093 // Remove resize event listener on window 1094 getWindow(reference).removeEventListener('resize', state.updateBound); 1095 1096 // Remove scroll event listener on scroll parents 1097 state.scrollParents.forEach(function (target) { 1098 target.removeEventListener('scroll', state.updateBound); 1099 }); 1100 1101 // Reset state 1102 state.updateBound = null; 1103 state.scrollParents = []; 1104 state.scrollElement = null; 1105 state.eventsEnabled = false; 1106 return state; 1107} 1108 1109/** 1110 * It will remove resize/scroll events and won't recalculate popper position 1111 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 1112 * unless you call `update` method manually. 1113 * @method 1114 * @memberof Popper 1115 */ 1116function disableEventListeners() { 1117 if (this.state.eventsEnabled) { 1118 cancelAnimationFrame(this.scheduleUpdate); 1119 this.state = removeEventListeners(this.reference, this.state); 1120 } 1121} 1122 1123/** 1124 * Tells if a given input is a number 1125 * @method 1126 * @memberof Popper.Utils 1127 * @param {*} input to check 1128 * @return {Boolean} 1129 */ 1130function isNumeric(n) { 1131 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 1132} 1133 1134/** 1135 * Set the style to the given popper 1136 * @method 1137 * @memberof Popper.Utils 1138 * @argument {Element} element - Element to apply the style to 1139 * @argument {Object} styles 1140 * Object with a list of properties and values which will be applied to the element 1141 */ 1142function setStyles(element, styles) { 1143 Object.keys(styles).forEach(function (prop) { 1144 var unit = ''; 1145 // add unit if the value is numeric and is one of the following 1146 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 1147 unit = 'px'; 1148 } 1149 element.style[prop] = styles[prop] + unit; 1150 }); 1151} 1152 1153/** 1154 * Set the attributes to the given popper 1155 * @method 1156 * @memberof Popper.Utils 1157 * @argument {Element} element - Element to apply the attributes to 1158 * @argument {Object} styles 1159 * Object with a list of properties and values which will be applied to the element 1160 */ 1161function setAttributes(element, attributes) { 1162 Object.keys(attributes).forEach(function (prop) { 1163 var value = attributes[prop]; 1164 if (value !== false) { 1165 element.setAttribute(prop, attributes[prop]); 1166 } else { 1167 element.removeAttribute(prop); 1168 } 1169 }); 1170} 1171 1172/** 1173 * @function 1174 * @memberof Modifiers 1175 * @argument {Object} data - The data object generated by `update` method 1176 * @argument {Object} data.styles - List of style properties - values to apply to popper element 1177 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 1178 * @argument {Object} options - Modifiers configuration and options 1179 * @returns {Object} The same data object 1180 */ 1181function applyStyle(data) { 1182 // any property present in `data.styles` will be applied to the popper, 1183 // in this way we can make the 3rd party modifiers add custom styles to it 1184 // Be aware, modifiers could override the properties defined in the previous 1185 // lines of this modifier! 1186 setStyles(data.instance.popper, data.styles); 1187 1188 // any property present in `data.attributes` will be applied to the popper, 1189 // they will be set as HTML attributes of the element 1190 setAttributes(data.instance.popper, data.attributes); 1191 1192 // if arrowElement is defined and arrowStyles has some properties 1193 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 1194 setStyles(data.arrowElement, data.arrowStyles); 1195 } 1196 1197 return data; 1198} 1199 1200/** 1201 * Set the x-placement attribute before everything else because it could be used 1202 * to add margins to the popper margins needs to be calculated to get the 1203 * correct popper offsets. 1204 * @method 1205 * @memberof Popper.modifiers 1206 * @param {HTMLElement} reference - The reference element used to position the popper 1207 * @param {HTMLElement} popper - The HTML element used as popper 1208 * @param {Object} options - Popper.js options 1209 */ 1210function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 1211 // compute reference element offsets 1212 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 1213 1214 // compute auto placement, store placement inside the data object, 1215 // modifiers will be able to edit `placement` if needed 1216 // and refer to originalPlacement to know the original value 1217 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 1218 1219 popper.setAttribute('x-placement', placement); 1220 1221 // Apply `position` to popper before anything else because 1222 // without the position applied we can't guarantee correct computations 1223 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 1224 1225 return options; 1226} 1227 1228/** 1229 * @function 1230 * @memberof Popper.Utils 1231 * @argument {Object} data - The data object generated by `update` method 1232 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 1233 * @returns {Object} The popper's position offsets rounded 1234 * 1235 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 1236 * good as it can be within reason. 1237 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 1238 * 1239 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 1240 * as well on High DPI screens). 1241 * 1242 * Firefox prefers no rounding for positioning and does not have blurriness on 1243 * high DPI screens. 1244 * 1245 * Only horizontal placement and left/right values need to be considered. 1246 */ 1247function getRoundedOffsets(data, shouldRound) { 1248 var _data$offsets = data.offsets, 1249 popper = _data$offsets.popper, 1250 reference = _data$offsets.reference; 1251 var round = Math.round, 1252 floor = Math.floor; 1253 1254 var noRound = function noRound(v) { 1255 return v; 1256 }; 1257 1258 var referenceWidth = round(reference.width); 1259 var popperWidth = round(popper.width); 1260 1261 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 1262 var isVariation = data.placement.indexOf('-') !== -1; 1263 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 1264 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 1265 1266 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 1267 var verticalToInteger = !shouldRound ? noRound : round; 1268 1269 return { 1270 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 1271 top: verticalToInteger(popper.top), 1272 bottom: verticalToInteger(popper.bottom), 1273 right: horizontalToInteger(popper.right) 1274 }; 1275} 1276 1277var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 1278 1279/** 1280 * @function 1281 * @memberof Modifiers 1282 * @argument {Object} data - The data object generated by `update` method 1283 * @argument {Object} options - Modifiers configuration and options 1284 * @returns {Object} The data object, properly modified 1285 */ 1286function computeStyle(data, options) { 1287 var x = options.x, 1288 y = options.y; 1289 var popper = data.offsets.popper; 1290 1291 // Remove this legacy support in Popper.js v2 1292 1293 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 1294 return modifier.name === 'applyStyle'; 1295 }).gpuAcceleration; 1296 if (legacyGpuAccelerationOption !== undefined) { 1297 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 1298 } 1299 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 1300 1301 var offsetParent = getOffsetParent(data.instance.popper); 1302 var offsetParentRect = getBoundingClientRect(offsetParent); 1303 1304 // Styles 1305 var styles = { 1306 position: popper.position 1307 }; 1308 1309 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 1310 1311 var sideA = x === 'bottom' ? 'top' : 'bottom'; 1312 var sideB = y === 'right' ? 'left' : 'right'; 1313 1314 // if gpuAcceleration is set to `true` and transform is supported, 1315 // we use `translate3d` to apply the position to the popper we 1316 // automatically use the supported prefixed version if needed 1317 var prefixedProperty = getSupportedPropertyName('transform'); 1318 1319 // now, let's make a step back and look at this code closely (wtf?) 1320 // If the content of the popper grows once it's been positioned, it 1321 // may happen that the popper gets misplaced because of the new content 1322 // overflowing its reference element 1323 // To avoid this problem, we provide two options (x and y), which allow 1324 // the consumer to define the offset origin. 1325 // If we position a popper on top of a reference element, we can set 1326 // `x` to `top` to make the popper grow towards its top instead of 1327 // its bottom. 1328 var left = void 0, 1329 top = void 0; 1330 if (sideA === 'bottom') { 1331 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 1332 // and not the bottom of the html element 1333 if (offsetParent.nodeName === 'HTML') { 1334 top = -offsetParent.clientHeight + offsets.bottom; 1335 } else { 1336 top = -offsetParentRect.height + offsets.bottom; 1337 } 1338 } else { 1339 top = offsets.top; 1340 } 1341 if (sideB === 'right') { 1342 if (offsetParent.nodeName === 'HTML') { 1343 left = -offsetParent.clientWidth + offsets.right; 1344 } else { 1345 left = -offsetParentRect.width + offsets.right; 1346 } 1347 } else { 1348 left = offsets.left; 1349 } 1350 if (gpuAcceleration && prefixedProperty) { 1351 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 1352 styles[sideA] = 0; 1353 styles[sideB] = 0; 1354 styles.willChange = 'transform'; 1355 } else { 1356 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 1357 var invertTop = sideA === 'bottom' ? -1 : 1; 1358 var invertLeft = sideB === 'right' ? -1 : 1; 1359 styles[sideA] = top * invertTop; 1360 styles[sideB] = left * invertLeft; 1361 styles.willChange = sideA + ', ' + sideB; 1362 } 1363 1364 // Attributes 1365 var attributes = { 1366 'x-placement': data.placement 1367 }; 1368 1369 // Update `data` attributes, styles and arrowStyles 1370 data.attributes = _extends({}, attributes, data.attributes); 1371 data.styles = _extends({}, styles, data.styles); 1372 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 1373 1374 return data; 1375} 1376 1377/** 1378 * Helper used to know if the given modifier depends from another one.<br /> 1379 * It checks if the needed modifier is listed and enabled. 1380 * @method 1381 * @memberof Popper.Utils 1382 * @param {Array} modifiers - list of modifiers 1383 * @param {String} requestingName - name of requesting modifier 1384 * @param {String} requestedName - name of requested modifier 1385 * @returns {Boolean} 1386 */ 1387function isModifierRequired(modifiers, requestingName, requestedName) { 1388 var requesting = find(modifiers, function (_ref) { 1389 var name = _ref.name; 1390 return name === requestingName; 1391 }); 1392 1393 var isRequired = !!requesting && modifiers.some(function (modifier) { 1394 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 1395 }); 1396 1397 if (!isRequired) { 1398 var _requesting = '`' + requestingName + '`'; 1399 var requested = '`' + requestedName + '`'; 1400 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 1401 } 1402 return isRequired; 1403} 1404 1405/** 1406 * @function 1407 * @memberof Modifiers 1408 * @argument {Object} data - The data object generated by update method 1409 * @argument {Object} options - Modifiers configuration and options 1410 * @returns {Object} The data object, properly modified 1411 */ 1412function arrow(data, options) { 1413 var _data$offsets$arrow; 1414 1415 // arrow depends on keepTogether in order to work 1416 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 1417 return data; 1418 } 1419 1420 var arrowElement = options.element; 1421 1422 // if arrowElement is a string, suppose it's a CSS selector 1423 if (typeof arrowElement === 'string') { 1424 arrowElement = data.instance.popper.querySelector(arrowElement); 1425 1426 // if arrowElement is not found, don't run the modifier 1427 if (!arrowElement) { 1428 return data; 1429 } 1430 } else { 1431 // if the arrowElement isn't a query selector we must check that the 1432 // provided DOM node is child of its popper node 1433 if (!data.instance.popper.contains(arrowElement)) { 1434 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 1435 return data; 1436 } 1437 } 1438 1439 var placement = data.placement.split('-')[0]; 1440 var _data$offsets = data.offsets, 1441 popper = _data$offsets.popper, 1442 reference = _data$offsets.reference; 1443 1444 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 1445 1446 var len = isVertical ? 'height' : 'width'; 1447 var sideCapitalized = isVertical ? 'Top' : 'Left'; 1448 var side = sideCapitalized.toLowerCase(); 1449 var altSide = isVertical ? 'left' : 'top'; 1450 var opSide = isVertical ? 'bottom' : 'right'; 1451 var arrowElementSize = getOuterSizes(arrowElement)[len]; 1452 1453 // 1454 // extends keepTogether behavior making sure the popper and its 1455 // reference have enough pixels in conjunction 1456 // 1457 1458 // top/left side 1459 if (reference[opSide] - arrowElementSize < popper[side]) { 1460 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 1461 } 1462 // bottom/right side 1463 if (reference[side] + arrowElementSize > popper[opSide]) { 1464 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 1465 } 1466 data.offsets.popper = getClientRect(data.offsets.popper); 1467 1468 // compute center of the popper 1469 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 1470 1471 // Compute the sideValue using the updated popper offsets 1472 // take popper margin in account because we don't have this info available 1473 var css = getStyleComputedProperty(data.instance.popper); 1474 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 1475 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 1476 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 1477 1478 // prevent arrowElement from being placed not contiguously to its popper 1479 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 1480 1481 data.arrowElement = arrowElement; 1482 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 1483 1484 return data; 1485} 1486 1487/** 1488 * Get the opposite placement variation of the given one 1489 * @method 1490 * @memberof Popper.Utils 1491 * @argument {String} placement variation 1492 * @returns {String} flipped placement variation 1493 */ 1494function getOppositeVariation(variation) { 1495 if (variation === 'end') { 1496 return 'start'; 1497 } else if (variation === 'start') { 1498 return 'end'; 1499 } 1500 return variation; 1501} 1502 1503/** 1504 * List of accepted placements to use as values of the `placement` option.<br /> 1505 * Valid placements are: 1506 * - `auto` 1507 * - `top` 1508 * - `right` 1509 * - `bottom` 1510 * - `left` 1511 * 1512 * Each placement can have a variation from this list: 1513 * - `-start` 1514 * - `-end` 1515 * 1516 * Variations are interpreted easily if you think of them as the left to right 1517 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 1518 * is right.<br /> 1519 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 1520 * 1521 * Some valid examples are: 1522 * - `top-end` (on top of reference, right aligned) 1523 * - `right-start` (on right of reference, top aligned) 1524 * - `bottom` (on bottom, centered) 1525 * - `auto-end` (on the side with more space available, alignment depends by placement) 1526 * 1527 * @static 1528 * @type {Array} 1529 * @enum {String} 1530 * @readonly 1531 * @method placements 1532 * @memberof Popper 1533 */ 1534var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 1535 1536// Get rid of `auto` `auto-start` and `auto-end` 1537var validPlacements = placements.slice(3); 1538 1539/** 1540 * Given an initial placement, returns all the subsequent placements 1541 * clockwise (or counter-clockwise). 1542 * 1543 * @method 1544 * @memberof Popper.Utils 1545 * @argument {String} placement - A valid placement (it accepts variations) 1546 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 1547 * @returns {Array} placements including their variations 1548 */ 1549function clockwise(placement) { 1550 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 1551 1552 var index = validPlacements.indexOf(placement); 1553 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 1554 return counter ? arr.reverse() : arr; 1555} 1556 1557var BEHAVIORS = { 1558 FLIP: 'flip', 1559 CLOCKWISE: 'clockwise', 1560 COUNTERCLOCKWISE: 'counterclockwise' 1561}; 1562 1563/** 1564 * @function 1565 * @memberof Modifiers 1566 * @argument {Object} data - The data object generated by update method 1567 * @argument {Object} options - Modifiers configuration and options 1568 * @returns {Object} The data object, properly modified 1569 */ 1570function flip(data, options) { 1571 // if `inner` modifier is enabled, we can't use the `flip` modifier 1572 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 1573 return data; 1574 } 1575 1576 if (data.flipped && data.placement === data.originalPlacement) { 1577 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 1578 return data; 1579 } 1580 1581 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 1582 1583 var placement = data.placement.split('-')[0]; 1584 var placementOpposite = getOppositePlacement(placement); 1585 var variation = data.placement.split('-')[1] || ''; 1586 1587 var flipOrder = []; 1588 1589 switch (options.behavior) { 1590 case BEHAVIORS.FLIP: 1591 flipOrder = [placement, placementOpposite]; 1592 break; 1593 case BEHAVIORS.CLOCKWISE: 1594 flipOrder = clockwise(placement); 1595 break; 1596 case BEHAVIORS.COUNTERCLOCKWISE: 1597 flipOrder = clockwise(placement, true); 1598 break; 1599 default: 1600 flipOrder = options.behavior; 1601 } 1602 1603 flipOrder.forEach(function (step, index) { 1604 if (placement !== step || flipOrder.length === index + 1) { 1605 return data; 1606 } 1607 1608 placement = data.placement.split('-')[0]; 1609 placementOpposite = getOppositePlacement(placement); 1610 1611 var popperOffsets = data.offsets.popper; 1612 var refOffsets = data.offsets.reference; 1613 1614 // using floor because the reference offsets may contain decimals we are not going to consider here 1615 var floor = Math.floor; 1616 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 1617 1618 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 1619 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 1620 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 1621 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 1622 1623 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 1624 1625 // flip the variation if required 1626 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 1627 1628 // flips variation if reference element overflows boundaries 1629 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 1630 1631 // flips variation if popper content overflows boundaries 1632 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 1633 1634 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 1635 1636 if (overlapsRef || overflowsBoundaries || flippedVariation) { 1637 // this boolean to detect any flip loop 1638 data.flipped = true; 1639 1640 if (overlapsRef || overflowsBoundaries) { 1641 placement = flipOrder[index + 1]; 1642 } 1643 1644 if (flippedVariation) { 1645 variation = getOppositeVariation(variation); 1646 } 1647 1648 data.placement = placement + (variation ? '-' + variation : ''); 1649 1650 // this object contains `position`, we want to preserve it along with 1651 // any additional property we may add in the future 1652 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 1653 1654 data = runModifiers(data.instance.modifiers, data, 'flip'); 1655 } 1656 }); 1657 return data; 1658} 1659 1660/** 1661 * @function 1662 * @memberof Modifiers 1663 * @argument {Object} data - The data object generated by update method 1664 * @argument {Object} options - Modifiers configuration and options 1665 * @returns {Object} The data object, properly modified 1666 */ 1667function keepTogether(data) { 1668 var _data$offsets = data.offsets, 1669 popper = _data$offsets.popper, 1670 reference = _data$offsets.reference; 1671 1672 var placement = data.placement.split('-')[0]; 1673 var floor = Math.floor; 1674 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 1675 var side = isVertical ? 'right' : 'bottom'; 1676 var opSide = isVertical ? 'left' : 'top'; 1677 var measurement = isVertical ? 'width' : 'height'; 1678 1679 if (popper[side] < floor(reference[opSide])) { 1680 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 1681 } 1682 if (popper[opSide] > floor(reference[side])) { 1683 data.offsets.popper[opSide] = floor(reference[side]); 1684 } 1685 1686 return data; 1687} 1688 1689/** 1690 * Converts a string containing value + unit into a px value number 1691 * @function 1692 * @memberof {modifiers~offset} 1693 * @private 1694 * @argument {String} str - Value + unit string 1695 * @argument {String} measurement - `height` or `width` 1696 * @argument {Object} popperOffsets 1697 * @argument {Object} referenceOffsets 1698 * @returns {Number|String} 1699 * Value in pixels, or original string if no values were extracted 1700 */ 1701function toValue(str, measurement, popperOffsets, referenceOffsets) { 1702 // separate value from unit 1703 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 1704 var value = +split[1]; 1705 var unit = split[2]; 1706 1707 // If it's not a number it's an operator, I guess 1708 if (!value) { 1709 return str; 1710 } 1711 1712 if (unit.indexOf('%') === 0) { 1713 var element = void 0; 1714 switch (unit) { 1715 case '%p': 1716 element = popperOffsets; 1717 break; 1718 case '%': 1719 case '%r': 1720 default: 1721 element = referenceOffsets; 1722 } 1723 1724 var rect = getClientRect(element); 1725 return rect[measurement] / 100 * value; 1726 } else if (unit === 'vh' || unit === 'vw') { 1727 // if is a vh or vw, we calculate the size based on the viewport 1728 var size = void 0; 1729 if (unit === 'vh') { 1730 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 1731 } else { 1732 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 1733 } 1734 return size / 100 * value; 1735 } else { 1736 // if is an explicit pixel unit, we get rid of the unit and keep the value 1737 // if is an implicit unit, it's px, and we return just the value 1738 return value; 1739 } 1740} 1741 1742/** 1743 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 1744 * @function 1745 * @memberof {modifiers~offset} 1746 * @private 1747 * @argument {String} offset 1748 * @argument {Object} popperOffsets 1749 * @argument {Object} referenceOffsets 1750 * @argument {String} basePlacement 1751 * @returns {Array} a two cells array with x and y offsets in numbers 1752 */ 1753function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 1754 var offsets = [0, 0]; 1755 1756 // Use height if placement is left or right and index is 0 otherwise use width 1757 // in this way the first offset will use an axis and the second one 1758 // will use the other one 1759 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 1760 1761 // Split the offset string to obtain a list of values and operands 1762 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 1763 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 1764 return frag.trim(); 1765 }); 1766 1767 // Detect if the offset string contains a pair of values or a single one 1768 // they could be separated by comma or space 1769 var divider = fragments.indexOf(find(fragments, function (frag) { 1770 return frag.search(/,|\s/) !== -1; 1771 })); 1772 1773 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 1774 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 1775 } 1776 1777 // If divider is found, we divide the list of values and operands to divide 1778 // them by ofset X and Y. 1779 var splitRegex = /\s*,\s*|\s+/; 1780 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 1781 1782 // Convert the values with units to absolute pixels to allow our computations 1783 ops = ops.map(function (op, index) { 1784 // Most of the units rely on the orientation of the popper 1785 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 1786 var mergeWithPrevious = false; 1787 return op 1788 // This aggregates any `+` or `-` sign that aren't considered operators 1789 // e.g.: 10 + +5 => [10, +, +5] 1790 .reduce(function (a, b) { 1791 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 1792 a[a.length - 1] = b; 1793 mergeWithPrevious = true; 1794 return a; 1795 } else if (mergeWithPrevious) { 1796 a[a.length - 1] += b; 1797 mergeWithPrevious = false; 1798 return a; 1799 } else { 1800 return a.concat(b); 1801 } 1802 }, []) 1803 // Here we convert the string values into number values (in px) 1804 .map(function (str) { 1805 return toValue(str, measurement, popperOffsets, referenceOffsets); 1806 }); 1807 }); 1808 1809 // Loop trough the offsets arrays and execute the operations 1810 ops.forEach(function (op, index) { 1811 op.forEach(function (frag, index2) { 1812 if (isNumeric(frag)) { 1813 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 1814 } 1815 }); 1816 }); 1817 return offsets; 1818} 1819 1820/** 1821 * @function 1822 * @memberof Modifiers 1823 * @argument {Object} data - The data object generated by update method 1824 * @argument {Object} options - Modifiers configuration and options 1825 * @argument {Number|String} options.offset=0 1826 * The offset value as described in the modifier description 1827 * @returns {Object} The data object, properly modified 1828 */ 1829function offset(data, _ref) { 1830 var offset = _ref.offset; 1831 var placement = data.placement, 1832 _data$offsets = data.offsets, 1833 popper = _data$offsets.popper, 1834 reference = _data$offsets.reference; 1835 1836 var basePlacement = placement.split('-')[0]; 1837 1838 var offsets = void 0; 1839 if (isNumeric(+offset)) { 1840 offsets = [+offset, 0]; 1841 } else { 1842 offsets = parseOffset(offset, popper, reference, basePlacement); 1843 } 1844 1845 if (basePlacement === 'left') { 1846 popper.top += offsets[0]; 1847 popper.left -= offsets[1]; 1848 } else if (basePlacement === 'right') { 1849 popper.top += offsets[0]; 1850 popper.left += offsets[1]; 1851 } else if (basePlacement === 'top') { 1852 popper.left += offsets[0]; 1853 popper.top -= offsets[1]; 1854 } else if (basePlacement === 'bottom') { 1855 popper.left += offsets[0]; 1856 popper.top += offsets[1]; 1857 } 1858 1859 data.popper = popper; 1860 return data; 1861} 1862 1863/** 1864 * @function 1865 * @memberof Modifiers 1866 * @argument {Object} data - The data object generated by `update` method 1867 * @argument {Object} options - Modifiers configuration and options 1868 * @returns {Object} The data object, properly modified 1869 */ 1870function preventOverflow(data, options) { 1871 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 1872 1873 // If offsetParent is the reference element, we really want to 1874 // go one step up and use the next offsetParent as reference to 1875 // avoid to make this modifier completely useless and look like broken 1876 if (data.instance.reference === boundariesElement) { 1877 boundariesElement = getOffsetParent(boundariesElement); 1878 } 1879 1880 // NOTE: DOM access here 1881 // resets the popper's position so that the document size can be calculated excluding 1882 // the size of the popper element itself 1883 var transformProp = getSupportedPropertyName('transform'); 1884 var popperStyles = data.instance.popper.style; // assignment to help minification 1885 var top = popperStyles.top, 1886 left = popperStyles.left, 1887 transform = popperStyles[transformProp]; 1888 1889 popperStyles.top = ''; 1890 popperStyles.left = ''; 1891 popperStyles[transformProp] = ''; 1892 1893 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 1894 1895 // NOTE: DOM access here 1896 // restores the original style properties after the offsets have been computed 1897 popperStyles.top = top; 1898 popperStyles.left = left; 1899 popperStyles[transformProp] = transform; 1900 1901 options.boundaries = boundaries; 1902 1903 var order = options.priority; 1904 var popper = data.offsets.popper; 1905 1906 var check = { 1907 primary: function primary(placement) { 1908 var value = popper[placement]; 1909 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 1910 value = Math.max(popper[placement], boundaries[placement]); 1911 } 1912 return defineProperty({}, placement, value); 1913 }, 1914 secondary: function secondary(placement) { 1915 var mainSide = placement === 'right' ? 'left' : 'top'; 1916 var value = popper[mainSide]; 1917 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 1918 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 1919 } 1920 return defineProperty({}, mainSide, value); 1921 } 1922 }; 1923 1924 order.forEach(function (placement) { 1925 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 1926 popper = _extends({}, popper, check[side](placement)); 1927 }); 1928 1929 data.offsets.popper = popper; 1930 1931 return data; 1932} 1933 1934/** 1935 * @function 1936 * @memberof Modifiers 1937 * @argument {Object} data - The data object generated by `update` method 1938 * @argument {Object} options - Modifiers configuration and options 1939 * @returns {Object} The data object, properly modified 1940 */ 1941function shift(data) { 1942 var placement = data.placement; 1943 var basePlacement = placement.split('-')[0]; 1944 var shiftvariation = placement.split('-')[1]; 1945 1946 // if shift shiftvariation is specified, run the modifier 1947 if (shiftvariation) { 1948 var _data$offsets = data.offsets, 1949 reference = _data$offsets.reference, 1950 popper = _data$offsets.popper; 1951 1952 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 1953 var side = isVertical ? 'left' : 'top'; 1954 var measurement = isVertical ? 'width' : 'height'; 1955 1956 var shiftOffsets = { 1957 start: defineProperty({}, side, reference[side]), 1958 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 1959 }; 1960 1961 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 1962 } 1963 1964 return data; 1965} 1966 1967/** 1968 * @function 1969 * @memberof Modifiers 1970 * @argument {Object} data - The data object generated by update method 1971 * @argument {Object} options - Modifiers configuration and options 1972 * @returns {Object} The data object, properly modified 1973 */ 1974function hide(data) { 1975 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 1976 return data; 1977 } 1978 1979 var refRect = data.offsets.reference; 1980 var bound = find(data.instance.modifiers, function (modifier) { 1981 return modifier.name === 'preventOverflow'; 1982 }).boundaries; 1983 1984 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 1985 // Avoid unnecessary DOM access if visibility hasn't changed 1986 if (data.hide === true) { 1987 return data; 1988 } 1989 1990 data.hide = true; 1991 data.attributes['x-out-of-boundaries'] = ''; 1992 } else { 1993 // Avoid unnecessary DOM access if visibility hasn't changed 1994 if (data.hide === false) { 1995 return data; 1996 } 1997 1998 data.hide = false; 1999 data.attributes['x-out-of-boundaries'] = false; 2000 } 2001 2002 return data; 2003} 2004 2005/** 2006 * @function 2007 * @memberof Modifiers 2008 * @argument {Object} data - The data object generated by `update` method 2009 * @argument {Object} options - Modifiers configuration and options 2010 * @returns {Object} The data object, properly modified 2011 */ 2012function inner(data) { 2013 var placement = data.placement; 2014 var basePlacement = placement.split('-')[0]; 2015 var _data$offsets = data.offsets, 2016 popper = _data$offsets.popper, 2017 reference = _data$offsets.reference; 2018 2019 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 2020 2021 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 2022 2023 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 2024 2025 data.placement = getOppositePlacement(placement); 2026 data.offsets.popper = getClientRect(popper); 2027 2028 return data; 2029} 2030 2031/** 2032 * Modifier function, each modifier can have a function of this type assigned 2033 * to its `fn` property.<br /> 2034 * These functions will be called on each update, this means that you must 2035 * make sure they are performant enough to avoid performance bottlenecks. 2036 * 2037 * @function ModifierFn 2038 * @argument {dataObject} data - The data object generated by `update` method 2039 * @argument {Object} options - Modifiers configuration and options 2040 * @returns {dataObject} The data object, properly modified 2041 */ 2042 2043/** 2044 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 2045 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 2046 * needed by the library. 2047 * 2048 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 2049 * All the other properties are configurations that could be tweaked. 2050 * @namespace modifiers 2051 */ 2052var modifiers = { 2053 /** 2054 * Modifier used to shift the popper on the start or end of its reference 2055 * element.<br /> 2056 * It will read the variation of the `placement` property.<br /> 2057 * It can be one either `-end` or `-start`. 2058 * @memberof modifiers 2059 * @inner 2060 */ 2061 shift: { 2062 /** @prop {number} order=100 - Index used to define the order of execution */ 2063 order: 100, 2064 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2065 enabled: true, 2066 /** @prop {ModifierFn} */ 2067 fn: shift 2068 }, 2069 2070 /** 2071 * The `offset` modifier can shift your popper on both its axis. 2072 * 2073 * It accepts the following units: 2074 * - `px` or unit-less, interpreted as pixels 2075 * - `%` or `%r`, percentage relative to the length of the reference element 2076 * - `%p`, percentage relative to the length of the popper element 2077 * - `vw`, CSS viewport width unit 2078 * - `vh`, CSS viewport height unit 2079 * 2080 * For length is intended the main axis relative to the placement of the popper.<br /> 2081 * This means that if the placement is `top` or `bottom`, the length will be the 2082 * `width`. In case of `left` or `right`, it will be the `height`. 2083 * 2084 * You can provide a single value (as `Number` or `String`), or a pair of values 2085 * as `String` divided by a comma or one (or more) white space
vendor: 9,957 bytes, lines 2085-2357
2085s.<br /> 2086 * The latter is a deprecated method because it leads to confusion and will be 2087 * removed in v2.<br /> 2088 * Additionally, it accepts additions and subtractions between different units. 2089 * Note that multiplications and divisions aren't supported. 2090 * 2091 * Valid examples are: 2092 * ``` 2093 * 10 2094 * '10%' 2095 * '10, 10' 2096 * '10%, 10' 2097 * '10 + 10%' 2098 * '10 - 5vh + 3%' 2099 * '-10px + 5vh, 5px - 6%' 2100 * ``` 2101 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 2102 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 2103 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 2104 * 2105 * @memberof modifiers 2106 * @inner 2107 */ 2108 offset: { 2109 /** @prop {number} order=200 - Index used to define the order of execution */ 2110 order: 200, 2111 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2112 enabled: true, 2113 /** @prop {ModifierFn} */ 2114 fn: offset, 2115 /** @prop {Number|String} offset=0 2116 * The offset value as described in the modifier description 2117 */ 2118 offset: 0 2119 }, 2120 2121 /** 2122 * Modifier used to prevent the popper from being positioned outside the boundary. 2123 * 2124 * A scenario exists where the reference itself is not within the boundaries.<br /> 2125 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 2126 * In this case we need to decide whether the popper should either: 2127 * 2128 * - detach from the reference and remain "trapped" in the boundaries, or 2129 * - if it should ignore the boundary and "escape with its reference" 2130 * 2131 * When `escapeWithReference` is set to`true` and reference is completely 2132 * outside its boundaries, the popper will overflow (or completely leave) 2133 * the boundaries in order to remain attached to the edge of the reference. 2134 * 2135 * @memberof modifiers 2136 * @inner 2137 */ 2138 preventOverflow: { 2139 /** @prop {number} order=300 - Index used to define the order of execution */ 2140 order: 300, 2141 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2142 enabled: true, 2143 /** @prop {ModifierFn} */ 2144 fn: preventOverflow, 2145 /** 2146 * @prop {Array} [priority=['left','right','top','bottom']] 2147 * Popper will try to prevent overflow following these priorities by default, 2148 * then, it could overflow on the left and on top of the `boundariesElement` 2149 */ 2150 priority: ['left', 'right', 'top', 'bottom'], 2151 /** 2152 * @prop {number} padding=5 2153 * Amount of pixel used to define a minimum distance between the boundaries 2154 * and the popper. This makes sure the popper always has a little padding 2155 * between the edges of its container 2156 */ 2157 padding: 5, 2158 /** 2159 * @prop {String|HTMLElement} boundariesElement='scrollParent' 2160 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 2161 * `viewport` or any DOM element. 2162 */ 2163 boundariesElement: 'scrollParent' 2164 }, 2165 2166 /** 2167 * Modifier used to make sure the reference and its popper stay near each other 2168 * without leaving any gap between the two. Especially useful when the arrow is 2169 * enabled and you want to ensure that it points to its reference element. 2170 * It cares only about the first axis. You can still have poppers with margin 2171 * between the popper and its reference element. 2172 * @memberof modifiers 2173 * @inner 2174 */ 2175 keepTogether: { 2176 /** @prop {number} order=400 - Index used to define the order of execution */ 2177 order: 400, 2178 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2179 enabled: true, 2180 /** @prop {ModifierFn} */ 2181 fn: keepTogether 2182 }, 2183 2184 /** 2185 * This modifier is used to move the `arrowElement` of the popper to make 2186 * sure it is positioned between the reference element and its popper element. 2187 * It will read the outer size of the `arrowElement` node to detect how many 2188 * pixels of conjunction are needed. 2189 * 2190 * It has no effect if no `arrowElement` is provided. 2191 * @memberof modifiers 2192 * @inner 2193 */ 2194 arrow: { 2195 /** @prop {number} order=500 - Index used to define the order of execution */ 2196 order: 500, 2197 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2198 enabled: true, 2199 /** @prop {ModifierFn} */ 2200 fn: arrow, 2201 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 2202 element: '[x-arrow]' 2203 }, 2204 2205 /** 2206 * Modifier used to flip the popper's placement when it starts to overlap its 2207 * reference element. 2208 * 2209 * Requires the `preventOverflow` modifier before it in order to work. 2210 * 2211 * **NOTE:** this modifier will interrupt the current update cycle and will 2212 * restart it if it detects the need to flip the placement. 2213 * @memberof modifiers 2214 * @inner 2215 */ 2216 flip: { 2217 /** @prop {number} order=600 - Index used to define the order of execution */ 2218 order: 600, 2219 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2220 enabled: true, 2221 /** @prop {ModifierFn} */ 2222 fn: flip, 2223 /** 2224 * @prop {String|Array} behavior='flip' 2225 * The behavior used to change the popper's placement. It can be one of 2226 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 2227 * placements (with optional variations) 2228 */ 2229 behavior: 'flip', 2230 /** 2231 * @prop {number} padding=5 2232 * The popper will flip if it hits the edges of the `boundariesElement` 2233 */ 2234 padding: 5, 2235 /** 2236 * @prop {String|HTMLElement} boundariesElement='viewport' 2237 * The element which will define the boundaries of the popper position. 2238 * The popper will never be placed outside of the defined boundaries 2239 * (except if `keepTogether` is enabled) 2240 */ 2241 boundariesElement: 'viewport', 2242 /** 2243 * @prop {Boolean} flipVariations=false 2244 * The popper will switch placement variation between `-start` and `-end` when 2245 * the reference element overlaps its boundaries. 2246 * 2247 * The original placement should have a set variation. 2248 */ 2249 flipVariations: false, 2250 /** 2251 * @prop {Boolean} flipVariationsByContent=false 2252 * The popper will switch placement variation between `-start` and `-end` when 2253 * the popper element overlaps its reference boundaries. 2254 * 2255 * The original placement should have a set variation. 2256 */ 2257 flipVariationsByContent: false 2258 }, 2259 2260 /** 2261 * Modifier used to make the popper flow toward the inner of the reference element. 2262 * By default, when this modifier is disabled, the popper will be placed outside 2263 * the reference element. 2264 * @memberof modifiers 2265 * @inner 2266 */ 2267 inner: { 2268 /** @prop {number} order=700 - Index used to define the order of execution */ 2269 order: 700, 2270 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 2271 enabled: false, 2272 /** @prop {ModifierFn} */ 2273 fn: inner 2274 }, 2275 2276 /** 2277 * Modifier used to hide the popper when its reference element is outside of the 2278 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 2279 * be used to hide with a CSS selector the popper when its reference is 2280 * out of boundaries. 2281 * 2282 * Requires the `preventOverflow` modifier before it in order to work. 2283 * @memberof modifiers 2284 * @inner 2285 */ 2286 hide: { 2287 /** @prop {number} order=800 - Index used to define the order of execution */ 2288 order: 800, 2289 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2290 enabled: true, 2291 /** @prop {ModifierFn} */ 2292 fn: hide 2293 }, 2294 2295 /** 2296 * Computes the style that will be applied to the popper element to gets 2297 * properly positioned. 2298 * 2299 * Note that this modifier will not touch the DOM, it just prepares the styles 2300 * so that `applyStyle` modifier can apply it. This separation is useful 2301 * in case you need to replace `applyStyle` with a custom implementation. 2302 * 2303 * This modifier has `850` as `order` value to maintain backward compatibility 2304 * with previous versions of Popper.js. Expect the modifiers ordering method 2305 * to change in future major versions of the library. 2306 * 2307 * @memberof modifiers 2308 * @inner 2309 */ 2310 computeStyle: { 2311 /** @prop {number} order=850 - Index used to define the order of execution */ 2312 order: 850, 2313 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2314 enabled: true, 2315 /** @prop {ModifierFn} */ 2316 fn: computeStyle, 2317 /** 2318 * @prop {Boolean} gpuAcceleration=true 2319 * If true, it uses the CSS 3D transformation to position the popper. 2320 * Otherwise, it will use the `top` and `left` properties 2321 */ 2322 gpuAcceleration: true, 2323 /** 2324 * @prop {string} [x='bottom'] 2325 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 2326 * Change this if your popper should grow in a direction different from `bottom` 2327 */ 2328 x: 'bottom', 2329 /** 2330 * @prop {string} [x='left'] 2331 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 2332 * Change this if your popper should grow in a direction different from `right` 2333 */ 2334 y: 'right' 2335 }, 2336 2337 /** 2338 * Applies the computed styles to the popper element. 2339 * 2340 * All the DOM manipulations are limited to this modifier. This is useful in case 2341 * you want to integrate Popper.js inside a framework or view library and you 2342 * want to delegate all the DOM manipulations to it. 2343 * 2344 * Note that if you disable this modifier, you must make sure the popper element 2345 * has its position set to `absolute` before Popper.js can do its work! 2346 * 2347 * Just disable this modifier and define your own to achieve the desired effect. 2348 * 2349 * @memberof modifiers 2350 * @inner 2351 */ 2352 applyStyle: { 2353 /** @prop {number} order=900 - Index used to define the order of execution */ 2354 order: 900, 2355 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2356 enabled: true, 2357 /** @prop {ModifierFn} */
vendor: 9,127 bytes, lines 2358-2622
2358 fn: applyStyle, 2359 /** @prop {Function} */ 2360 onLoad: applyStyleOnLoad, 2361 /** 2362 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 2363 * @prop {Boolean} gpuAcceleration=true 2364 * If true, it uses the CSS 3D transformation to position the popper. 2365 * Otherwise, it will use the `top` and `left` properties 2366 */ 2367 gpuAcceleration: undefined 2368 } 2369}; 2370 2371/** 2372 * The `dataObject` is an object containing all the information used by Popper.js. 2373 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 2374 * @name dataObject 2375 * @property {Object} data.instance The Popper.js instance 2376 * @property {String} data.placement Placement applied to popper 2377 * @property {String} data.originalPlacement Placement originally defined on init 2378 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 2379 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 2380 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 2381 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 2382 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 2383 * @property {Object} data.boundaries Offsets of the popper boundaries 2384 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 2385 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 2386 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 2387 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 2388 */ 2389 2390/** 2391 * Default options provided to Popper.js constructor.<br /> 2392 * These can be overridden using the `options` argument of Popper.js.<br /> 2393 * To override an option, simply pass an object with the same 2394 * structure of the `options` object, as the 3rd argument. For example: 2395 * ``` 2396 * new Popper(ref, pop, { 2397 * modifiers: { 2398 * preventOverflow: { enabled: false } 2399 * } 2400 * }) 2401 * ``` 2402 * @type {Object} 2403 * @static 2404 * @memberof Popper 2405 */ 2406var Defaults = { 2407 /** 2408 * Popper's placement. 2409 * @prop {Popper.placements} placement='bottom' 2410 */ 2411 placement: 'bottom', 2412 2413 /** 2414 * Set this to true if you want popper to position it self in 'fixed' mode 2415 * @prop {Boolean} positionFixed=false 2416 */ 2417 positionFixed: false, 2418 2419 /** 2420 * Whether events (resize, scroll) are initially enabled. 2421 * @prop {Boolean} eventsEnabled=true 2422 */ 2423 eventsEnabled: true, 2424 2425 /** 2426 * Set to true if you want to automatically remove the popper when 2427 * you call the `destroy` method. 2428 * @prop {Boolean} removeOnDestroy=false 2429 */ 2430 removeOnDestroy: false, 2431 2432 /** 2433 * Callback called when the popper is created.<br /> 2434 * By default, it is set to no-op.<br /> 2435 * Access Popper.js instance with `data.instance`. 2436 * @prop {onCreate} 2437 */ 2438 onCreate: function onCreate() {}, 2439 2440 /** 2441 * Callback called when the popper is updated. This callback is not called 2442 * on the initialization/creation of the popper, but only on subsequent 2443 * updates.<br /> 2444 * By default, it is set to no-op.<br /> 2445 * Access Popper.js instance with `data.instance`. 2446 * @prop {onUpdate} 2447 */ 2448 onUpdate: function onUpdate() {}, 2449 2450 /** 2451 * List of modifiers used to modify the offsets before they are applied to the popper. 2452 * They provide most of the functionalities of Popper.js. 2453 * @prop {modifiers} 2454 */ 2455 modifiers: modifiers 2456}; 2457 2458/** 2459 * @callback onCreate 2460 * @param {dataObject} data 2461 */ 2462 2463/** 2464 * @callback onUpdate 2465 * @param {dataObject} data 2466 */ 2467 2468// Utils 2469// Methods 2470var Popper = function () { 2471 /** 2472 * Creates a new Popper.js instance. 2473 * @class Popper 2474 * @param {Element|referenceObject} reference - The reference element used to position the popper 2475 * @param {Element} popper - The HTML / XML element used as the popper 2476 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 2477 * @return {Object} instance - The generated Popper.js instance 2478 */ 2479 function Popper(reference, popper) { 2480 var _this = this; 2481 2482 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 2483 classCallCheck(this, Popper); 2484 2485 this.scheduleUpdate = function () { 2486 return requestAnimationFrame(_this.update); 2487 }; 2488 2489 // make update() debounced, so that it only runs at most once-per-tick 2490 this.update = debounce(this.update.bind(this)); 2491 2492 // with {} we create a new object with the options inside it 2493 this.options = _extends({}, Popper.Defaults, options); 2494 2495 // init state 2496 this.state = { 2497 isDestroyed: false, 2498 isCreated: false, 2499 scrollParents: [] 2500 }; 2501 2502 // get reference and popper elements (allow jQuery wrappers) 2503 this.reference = reference && reference.jquery ? reference[0] : reference; 2504 this.popper = popper && popper.jquery ? popper[0] : popper; 2505 2506 // Deep merge modifiers options 2507 this.options.modifiers = {}; 2508 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 2509 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 2510 }); 2511 2512 // Refactoring modifiers' list (Object => Array) 2513 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 2514 return _extends({ 2515 name: name 2516 }, _this.options.modifiers[name]); 2517 }) 2518 // sort the modifiers by order 2519 .sort(function (a, b) { 2520 return a.order - b.order; 2521 }); 2522 2523 // modifiers have the ability to execute arbitrary code when Popper.js get inited 2524 // such code is executed in the same order of its modifier 2525 // they could add new properties to their options configuration 2526 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 2527 this.modifiers.forEach(function (modifierOptions) { 2528 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 2529 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 2530 } 2531 }); 2532 2533 // fire the first update to position the popper in the right place 2534 this.update(); 2535 2536 var eventsEnabled = this.options.eventsEnabled; 2537 if (eventsEnabled) { 2538 // setup event listeners, they will take care of update the position in specific situations 2539 this.enableEventListeners(); 2540 } 2541 2542 this.state.eventsEnabled = eventsEnabled; 2543 } 2544 2545 // We can't use class properties because they don't get listed in the 2546 // class prototype and break stuff like Sinon stubs 2547 2548 2549 createClass(Popper, [{ 2550 key: 'update', 2551 value: function update$$1() { 2552 return update.call(this); 2553 } 2554 }, { 2555 key: 'destroy', 2556 value: function destroy$$1() { 2557 return destroy.call(this); 2558 } 2559 }, { 2560 key: 'enableEventListeners', 2561 value: function enableEventListeners$$1() { 2562 return enableEventListeners.call(this); 2563 } 2564 }, { 2565 key: 'disableEventListeners', 2566 value: function disableEventListeners$$1() { 2567 return disableEventListeners.call(this); 2568 } 2569 2570 /** 2571 * Schedules an update. It will run on the next UI update available. 2572 * @method scheduleUpdate 2573 * @memberof Popper 2574 */ 2575 2576 2577 /** 2578 * Collection of utilities useful when writing custom modifiers. 2579 * Starting from version 1.7, this method is available only if you 2580 * include `popper-utils.js` before `popper.js`. 2581 * 2582 * **DEPRECATION**: This way to access PopperUtils is deprecated 2583 * and will be removed in v2! Use the PopperUtils module directly instead. 2584 * Due to the high instability of the methods contained in Utils, we can't 2585 * guarantee them to follow semver. Use them at your own risk! 2586 * @static 2587 * @private 2588 * @type {Object} 2589 * @deprecated since version 1.8 2590 * @member Utils 2591 * @memberof Popper 2592 */ 2593 2594 }]); 2595 return Popper; 2596}(); 2597 2598/** 2599 * The `referenceObject` is an object that provides an interface compatible with Popper.js 2600 * and lets you use it as replacement of a real DOM node.<br /> 2601 * You can use this method to position a popper relatively to a set of coordinates 2602 * in case you don't have a DOM node to use as reference. 2603 * 2604 * ``` 2605 * new Popper(referenceObject, popperNode); 2606 * ``` 2607 * 2608 * NB: This feature isn't supported in Internet Explorer 10. 2609 * @name referenceObject 2610 * @property {Function} data.getBoundingClientRect 2611 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 2612 * @property {number} data.clientWidth 2613 * An ES6 getter that will return the width of the virtual reference element. 2614 * @property {number} data.clientHeight 2615 * An ES6 getter that will return the height of the virtual reference element. 2616 */ 2617 2618 2619Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 2620Popper.placements = placements; 2621Popper.Defaults = Defaults; 2622
vendor: 2,163 bytes, lines 2623-2686
2623return Popper; 2624 2625}))); 2626//# sourceMappingURL=popper.js.map 2627 2628/*! 2629 * Bootstrap v4.5.0 (https://getbootstrap.com/) 2630 * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 2631 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2632 */ 2633(function (global, factory) { 2634 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) : 2635 typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) : 2636 (global = global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper)); 2637}(this, (function (exports, $, Popper) { 'use strict'; 2638 2639 $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $; 2640 Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper; 2641 2642 function _defineProperties(target, props) { 2643 for (var i = 0; i < props.length; i++) { 2644 var descriptor = props[i]; 2645 descriptor.enumerable = descriptor.enumerable || false; 2646 descriptor.configurable = true; 2647 if ("value" in descriptor) descriptor.writable = true; 2648 Object.defineProperty(target, descriptor.key, descriptor); 2649 } 2650 } 2651 2652 function _createClass(Constructor, protoProps, staticProps) { 2653 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 2654 if (staticProps) _defineProperties(Constructor, staticProps); 2655 return Constructor; 2656 } 2657 2658 function _defineProperty(obj, key, value) { 2659 if (key in obj) { 2660 Object.defineProperty(obj, key, { 2661 value: value, 2662 enumerable: true, 2663 configurable: true, 2664 writable: true 2665 }); 2666 } else { 2667 obj[key] = value; 2668 } 2669 2670 return obj; 2671 } 2672 2673 function ownKeys(object, enumerableOnly) { 2674 var keys = Object.keys(object); 2675 2676 if (Object.getOwnPropertySymbols) { 2677 var symbols = Object.getOwnPropertySymbols(object); 2678 if (enumerableOnly) symbols = symbols.filter(function (sym) { 2679 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 2680 }); 2681 keys.push.apply(keys, symbols); 2682 } 2683 2684 return keys; 2685 } 2686
2687 function _objectSpread2(target) { 2688 for (var i = 1; i < arguments.length; i++) { 2689 var source = arguments[i] != null ? arguments[i] : {}; 2690 2691 if (i % 2) { 2692 ownKeys(Object(source), true).forEach(function (key) { 2693 _defineProperty(target, key, source[key]); 2694 }); 2695 } else if (Object.getOwnPropertyDescriptors) { 2696 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 2697 } else { 2698 ownKeys(Object(source)).forEach(function (key) { 2699 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 2700 }); 2701 } 2702 } 2703 2704 return target; 2705 } 2706 2707 function _inheritsLoose(subClass, superClass) { 2708 subClass.prototype = Object.create(superClass.prototype); 2709 subClass.prototype.constructor = subClass; 2710 subClass.__proto__ = superClass; 2711 } 2712 2713 /** 2714 * -------------------------------------------------------------------------- 2715 * Bootstrap (v4.5.0): util.js 2716 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2717 * -------------------------------------------------------------------------- 2718 */ 2719 /** 2720 * ------------------------------------------------------------------------ 2721 * Private TransitionEnd Helpers 2722 * ------------------------------------------------------------------------ 2723 */ 2724 2725 var TRANSITION_END = 'transitionend'; 2726 var MAX_UID = 1000000; 2727 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 2728 2729 function toType(obj) { 2730 if (obj === null || typeof obj === 'undefined') { 2731 return "" + obj; 2732 } 2733 2734 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 2735 } 2736 2737 function getSpecialTransitionEndEvent() { 2738 return { 2739 bindType: TRANSITION_END, 2740 delegateType: TRANSITION_END, 2741 handle: function handle(event) { 2742 if ($(event.target).is(this)) { 2743 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 2744 } 2745 2746 return undefined; 2747 } 2748 }; 2749 } 2750 2751 function transitionEndEmulator(duration) { 2752 var _this = this; 2753 2754 var called = false; 2755 $(this).one(Util.TRANSITION_END, function () { 2756 called = true; 2757 }); 2758 setTimeout(function () { 2759 if (!called) { 2760 Util.triggerTransitionEnd(_this); 2761 } 2762 }, duration); 2763 return this; 2764 } 2765 2766 function setTransitionEndSupport() { 2767 $.fn.emulateTransitionEnd = transitionEndEmulator; 2768 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 2769 } 2770 /** 2771 * -------------------------------------------------------------------------- 2772 * Public Util Api 2773 * -------------------------------------------------------------------------- 2774 */ 2775 2776 2777 var Util = { 2778 TRANSITION_END: 'bsTransitionEnd', 2779 getUID: function getUID(prefix) { 2780 do { 2781 // eslint-disable-next-line no-bitwise 2782 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 2783 } while (document.getElementById(prefix)); 2784 2785 return prefix; 2786 }, 2787 getSelectorFromElement: function getSelectorFromElement(element) { 2788 var selector = element.getAttribute('data-target'); 2789 2790 if (!selector || selector === '#') { 2791 var hrefAttr = element.getAttribute('href'); 2792 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 2793 } 2794 2795 try { 2796 return document.querySelector(selector) ? selector : null; 2797 } catch (err) { 2798 return null; 2799 } 2800 }, 2801 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 2802 if (!element) { 2803 return 0; 2804 } // Get transition-duration of the element 2805 2806 2807 var transitionDuration = $(element).css('transition-duration'); 2808 var transitionDelay = $(element).css('transition-delay'); 2809 var floatTransitionDuration = parseFloat(transitionDuration); 2810 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 2811 2812 if (!floatTransitionDuration && !floatTransitionDelay) { 2813 return 0; 2814 } // If multiple durations are defined, take the first 2815 2816 2817 transitionDuration = transitionDuration.split(',')[0]; 2818 transitionDelay = transitionDelay.split(',')[0]; 2819 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 2820 }, 2821 reflow: function reflow(element) { 2822 return element.offsetHeight; 2823 }, 2824 triggerTransitionEnd: function triggerTransitionEnd(element) { 2825 $(element).trigger(TRANSITION_END); 2826 }, 2827 // TODO: Remove in v5 2828 supportsTransitionEnd: function supportsTransitionEnd() { 2829 return Boolean(TRANSITION_END); 2830 }, 2831 isElement: function isElement(obj) { 2832 return (obj[0] || obj).nodeType; 2833 }, 2834 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 2835 for (var property in configTypes) { 2836 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 2837 var expectedTypes = configTypes[property]; 2838 var value = config[property]; 2839 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 2840 2841 if (!new RegExp(expectedTypes).test(valueType)) { 2842 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 2843 } 2844 } 2845 } 2846 }, 2847 findShadowRoot: function findShadowRoot(element) { 2848 if (!document.documentElement.attachShadow) { 2849 return null; 2850 } // Can find the shadow root otherwise it'll return the document 2851 2852 2853 if (typeof element.getRootNode === 'function') { 2854 var root = element.getRootNode(); 2855 return root instanceof ShadowRoot ? root : null; 2856 } 2857 2858 if (element instanceof ShadowRoot) { 2859 return element; 2860 } // when we don't find a shadow root 2861 2862 2863 if (!element.parentNode) { 2864 return null; 2865 } 2866 2867 return Util.findShadowRoot(element.parentNode); 2868 }, 2869 jQueryDetection: function jQueryDetection() { 2870 if (typeof $ === 'undefined') { 2871 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 2872 } 2873 2874 var version = $.fn.jquery.split(' ')[0].split('.'); 2875 var minMajor = 1; 2876 var ltMajor = 2; 2877 var minMinor = 9; 2878 var minPatch = 1; 2879 var maxMajor = 4; 2880 2881 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
2881= maxMajor) { 2882 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 2883 } 2884 } 2885 }; 2886 Util.jQueryDetection(); 2887 setTransitionEndSupport(); 2888 2889 /** 2890 * ------------------------------------------------------------------------ 2891 * Constants 2892 * ------------------------------------------------------------------------ 2893 */ 2894 2895 var NAME = 'alert'; 2896 var VERSION = '4.5.0'; 2897 var DATA_KEY = 'bs.alert'; 2898 var EVENT_KEY = "." + DATA_KEY; 2899 var DATA_API_KEY = '.data-api'; 2900 var JQUERY_NO_CONFLICT = $.fn[NAME]; 2901 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 2902 var EVENT_CLOSE = "close" + EVENT_KEY; 2903 var EVENT_CLOSED = "closed" + EVENT_KEY; 2904 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY; 2905 var CLASS_NAME_ALERT = 'alert'; 2906 var CLASS_NAME_FADE = 'fade'; 2907 var CLASS_NAME_SHOW = 'show'; 2908 /** 2909 * ------------------------------------------------------------------------ 2910 * Class Definition 2911 * ------------------------------------------------------------------------ 2912 */ 2913 2914 var Alert = /*#__PURE__*/function () { 2915 function Alert(element) { 2916 this._element = element; 2917 } // Getters 2918 2919 2920 var _proto = Alert.prototype; 2921 2922 // Public 2923 _proto.close = function close(element) { 2924 var rootElement = this._element; 2925 2926 if (element) { 2927 rootElement = this._getRootElement(element); 2928 } 2929 2930 var customEvent = this._triggerCloseEvent(rootElement); 2931 2932 if (customEvent.isDefaultPrevented()) { 2933 return; 2934 } 2935 2936 this._removeElement(rootElement); 2937 }; 2938 2939 _proto.dispose = function dispose() { 2940 $.removeData(this._element, DATA_KEY); 2941 this._element = null; 2942 } // Private 2943 ; 2944 2945 _proto._getRootElement = function _getRootElement(element) { 2946 var selector = Util.getSelectorFromElement(element); 2947 var parent = false; 2948 2949 if (selector) { 2950 parent = document.querySelector(selector); 2951 } 2952 2953 if (!parent) { 2954 parent = $(element).closest("." + CLASS_NAME_ALERT)[0]; 2955 } 2956 2957 return parent; 2958 }; 2959 2960 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 2961 var closeEvent = $.Event(EVENT_CLOSE); 2962 $(element).trigger(closeEvent); 2963 return closeEvent; 2964 }; 2965 2966 _proto._removeElement = function _removeElement(element) { 2967 var _this = this; 2968 2969 $(element).removeClass(CLASS_NAME_SHOW); 2970 2971 if (!$(element).hasClass(CLASS_NAME_FADE)) { 2972 this._destroyElement(element); 2973 2974 return; 2975 } 2976 2977 var transitionDuration = Util.getTransitionDurationFromElement(element); 2978 $(element).one(Util.TRANSITION_END, function (event) { 2979 return _this._destroyElement(element, event); 2980 }).emulateTransitionEnd(transitionDuration); 2981 }; 2982 2983 _proto._destroyElement = function _destroyElement(element) { 2984 $(element).detach().trigger(EVENT_CLOSED).remove(); 2985 } // Static 2986 ; 2987 2988 Alert._jQueryInterface = function _jQueryInterface(config) { 2989 return this.each(function () { 2990 var $element = $(this); 2991 var data = $element.data(DATA_KEY); 2992 2993 if (!data) { 2994 data = new Alert(this); 2995 $element.data(DATA_KEY, data); 2996 } 2997 2998 if (config === 'close') { 2999 data[config](this); 3000 } 3001 }); 3002 }; 3003 3004 Alert._handleDismiss = function _handleDismiss(alertInstance) { 3005 return function (event) { 3006 if (event) { 3007 event.preventDefault(); 3008 } 3009 3010 alertInstance.close(this); 3011 }; 3012 }; 3013 3014 _createClass(Alert, null, [{ 3015 key: "VERSION", 3016 get: function get() { 3017 return VERSION; 3018 } 3019 }]); 3020 3021 return Alert; 3022 }(); 3023 /** 3024 * ------------------------------------------------------------------------ 3025 * Data Api implementation 3026 * ------------------------------------------------------------------------ 3027 */ 3028 3029 3030 $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 3031 /** 3032 * ------------------------------------------------------------------------ 3033 * jQuery 3034 * ------------------------------------------------------------------------ 3035 */ 3036 3037 $.fn[NAME] = Alert._jQueryInterface; 3038 $.fn[NAME].Constructor = Alert; 3039 3040 $.fn[NAME].noConflict = function () { 3041 $.fn[NAME] = JQUERY_NO_CONFLICT; 3042 return Alert._jQueryInterface; 3043 }; 3044 3045 /** 3046 * ------------------------------------------------------------------------ 3047 * Constants 3048 * ------------------------------------------------------------------------ 3049 */ 3050 3051 var NAME$1 = 'button'; 3052 var VERSION$1 = '4.5.0'; 3053 var DATA_KEY$1 = 'bs.button'; 3054 var EVENT_KEY$1 = "." + DATA_KEY$1; 3055 var DATA_API_KEY$1 = '.data-api'; 3056 var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; 3057 var CLASS_NAME_ACTIVE = 'active'; 3058 var CLASS_NAME_BUTTON = 'btn'; 3059 var CLASS_NAME_FOCUS = 'focus'; 3060 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 3061 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 3062 var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'; 3063 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 3064 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 3065 var SELECTOR_ACTIVE = '.active'; 3066 var SELECTOR_BUTTON = '.btn'; 3067 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1; 3068 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1); 3069 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1; 3070 /** 3071 * ------------------------------------------------------------------------ 3072 * Class Definition 3073 * ------------------------------------------------------------------------ 3074 */ 3075 3076 var Button = /*#__PURE__*/function () { 3077 function Button(element) { 3078 this._element = element; 3079 } // Getters 3080 3081 3082 var _proto = Button.prototype; 3083 3084 // Public
3085 _proto.toggle = function toggle() { 3086 var triggerChangeEvent = true; 3087 var addAriaPressed = true; 3088 var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 3089 3090 if (rootElement) { 3091 var input = this._element.querySelector(SELECTOR_INPUT); 3092 3093 if (input) { 3094 if (input.type === 'radio') { 3095 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) { 3096 triggerChangeEvent = false; 3097 } else { 3098 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE); 3099 3100 if (activeElement) { 3101 $(activeElement).removeClass(CLASS_NAME_ACTIVE); 3102 } 3103 } 3104 } 3105 3106 if (triggerChangeEvent) { 3107 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 3108 if (input.type === 'checkbox' || input.type === 'radio') { 3109 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE); 3110 } 3111 3112 $(input).trigger('change'); 3113 } 3114 3115 input.focus(); 3116 addAriaPressed = false; 3117 } 3118 } 3119 3120 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 3121 if (addAriaPressed) { 3122 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE)); 3123 } 3124 3125 if (triggerChangeEvent) { 3126 $(this._element).toggleClass(CLASS_NAME_ACTIVE); 3127 } 3128 } 3129 }; 3130 3131 _proto.dispose = function dispose() { 3132 $.removeData(this._element, DATA_KEY$1); 3133 this._element = null; 3134 } // Static 3135 ; 3136 3137 Button._jQueryInterface = function _jQueryInterface(config) { 3138 return this.each(function () { 3139 var data = $(this).data(DATA_KEY$1); 3140 3141 if (!data) { 3142 data = new Button(this); 3143 $(this).data(DATA_KEY$1, data); 3144 } 3145 3146 if (config === 'toggle') { 3147 data[config](); 3148 } 3149 }); 3150 }; 3151 3152 _createClass(Button, null, [{ 3153 key: "VERSION", 3154 get: function get() { 3155 return VERSION$1; 3156 } 3157 }]); 3158 3159 return Button; 3160 }(); 3161 /** 3162 * ------------------------------------------------------------------------ 3163 * Data Api implementation 3164 * ------------------------------------------------------------------------ 3165 */ 3166 3167 3168 $(document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 3169 var button = event.target; 3170 var initialButton = button; 3171 3172 if (!$(button).hasClass(CLASS_NAME_BUTTON)) { 3173 button = $(button).closest(SELECTOR_BUTTON)[0]; 3174 } 3175 3176 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 3177 event.preventDefault(); // work around Firefox bug #1540995 3178 } else { 3179 var inputBtn = button.querySelector(SELECTOR_INPUT); 3180 3181 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 3182 event.preventDefault(); // work around Firefox bug #1540995 3183 3184 return; 3185 } 3186 3187 if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') { 3188 event.preventDefault(); // work around event sent to label and input 3189 } 3190 3191 Button._jQueryInterface.call($(button), 'toggle'); 3192 } 3193 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 3194 var button = $(event.target).closest(SELECTOR_BUTTON)[0]; 3195 $(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 3196 }); 3197 $(window).on(EVENT_LOAD_DATA_API, function () { 3198 // ensure correct active class is set to match the controls' actual values/states 3199 // find all checkboxes/readio buttons inside data-toggle groups 3200 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 3201 3202 for (var i = 0, len = buttons.length; i < len; i++) { 3203 var button = buttons[i]; 3204 var input = button.querySelector(SELECTOR_INPUT); 3205 3206 if (input.checked || input.hasAttribute('checked')) { 3207 button.classList.add(CLASS_NAME_ACTIVE); 3208 } else { 3209 button.classList.remove(CLASS_NAME_ACTIVE); 3210 } 3211 } // find all button toggles 3212 3213 3214 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE)); 3215 3216 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 3217 var _button = buttons[_i]; 3218 3219 if (_button.getAttribute('aria-pressed') === 'true') { 3220 _button.classList.add(CLASS_NAME_ACTIVE); 3221 } else { 3222 _button.classList.remove(CLASS_NAME_ACTIVE); 3223 } 3224 } 3225 }); 3226 /** 3227 * ------------------------------------------------------------------------ 3228 * jQuery 3229 * ------------------------------------------------------------------------ 3230 */ 3231 3232 $.fn[NAME$1] = Button._jQueryInterface; 3233 $.fn[NAME$1].Constructor = Button; 3234 3235 $.fn[NAME$1].noConflict = function () { 3236 $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 3237 return Button._jQueryInterface; 3238 }; 3239 3240 /** 3241 * ------------------------------------------------------------------------ 3242 * Constants 3243 * ------------------------------------------------------------------------ 3244 */ 3245 3246 var NAME$2 = 'carousel'; 3247 var VERSION$2 = '4.5.0'; 3248 var DATA_KEY$2 = 'bs.carousel'; 3249 var EVENT_KEY$2 = "." + DATA_KEY$2; 3250 var DATA_API_KEY$2 = '.data-api'; 3251 var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; 3252 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 3253 3254 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 3255 3256 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 3257 3258 var SWIPE_THRESHOLD = 40; 3259 var Default = { 3260 interval: 5000, 3261 keyboard: true, 3262 slide: false, 3263 pause: 'hover', 3264 wrap: true, 3265 touch: true 3266 }; 3267 var DefaultType = { 3268 interval: '(number|boolean)', 3269 keyboard: 'boolean', 3270 slide: '(boolean|string)', 3271 pause: '(string|boolean)', 3272 wrap: 'boolean', 3273 touch: 'boolean' 3274 }; 3275 var DIRECTION_NEXT = 'next'; 3276 var DIRECTION_PREV = 'prev'; 3277 var DIRECTION_LEFT = 'left'; 3278 var DIRECTION_RIGHT = 'right'; 3279 var EVENT_SLIDE = "slide" + EVENT_KEY$2; 3280 var EVENT_SLID = "slid" + EVENT_KEY$2; 3281 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2; 3282 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2; 3283 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2; 3284 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2; 3285 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2; 3286 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2; 3287 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2; 3288 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2; 3289 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2; 3290 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2; 3291 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2; 3292 var CLASS_NAME_CAROUSEL = 'carousel'; 3293 var CLASS_NAME_ACTIVE$1 = 'active'; 3294 var CLASS_NAME_SLIDE = 'slide'; 3295 var CLASS_NAME_RIGHT = 'carousel-item-right'; 3296 var CLASS_NAME_LEFT = 'carousel-item-left'; 3297 var CLASS_NAME_NEXT = 'carousel-item-next'; 3298 var CLASS_NAME_PREV = 'carousel-item-prev'; 3299 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 3300 var SELECTOR_ACTIVE$1 = '.active'; 3301 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
3302 var SELECTOR_ITEM = '.carousel-item'; 3303 var SELECTOR_ITEM_IMG = '.carousel-item img'; 3304 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 3305 var SELECTOR_INDICATORS = '.carousel-indicators'; 3306 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 3307 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 3308 var PointerType = { 3309 TOUCH: 'touch', 3310 PEN: 'pen' 3311 }; 3312 /** 3313 * ------------------------------------------------------------------------ 3314 * Class Definition 3315 * ------------------------------------------------------------------------ 3316 */ 3317 3318 var Carousel = /*#__PURE__*/function () { 3319 function Carousel(element, config) { 3320 this._items = null; 3321 this._interval = null; 3322 this._activeElement = null; 3323 this._isPaused = false; 3324 this._isSliding = false; 3325 this.touchTimeout = null; 3326 this.touchStartX = 0; 3327 this.touchDeltaX = 0; 3328 this._config = this._getConfig(config); 3329 this._element = element; 3330 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 3331 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 3332 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 3333 3334 this._addEventListeners(); 3335 } // Getters 3336 3337 3338 var _proto = Carousel.prototype; 3339 3340 // Public 3341 _proto.next = function next() { 3342 if (!this._isSliding) { 3343 this._slide(DIRECTION_NEXT); 3344 } 3345 }; 3346 3347 _proto.nextWhenVisible = function nextWhenVisible() { 3348 // Don't call next when the page isn't visible 3349 // or the carousel or its parent isn't visible 3350 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 3351 this.next(); 3352 } 3353 }; 3354 3355 _proto.prev = function prev() { 3356 if (!this._isSliding) { 3357 this._slide(DIRECTION_PREV); 3358 } 3359 }; 3360 3361 _proto.pause = function pause(event) { 3362 if (!event) { 3363 this._isPaused = true; 3364 } 3365 3366 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 3367 Util.triggerTransitionEnd(this._element); 3368 this.cycle(true); 3369 } 3370 3371 clearInterval(this._interval); 3372 this._interval = null; 3373 }; 3374 3375 _proto.cycle = function cycle(event) { 3376 if (!event) { 3377 this._isPaused = false; 3378 } 3379 3380 if (this._interval) { 3381 clearInterval(this._interval); 3382 this._interval = null; 3383 } 3384 3385 if (this._config.interval && !this._isPaused) { 3386 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 3387 } 3388 }; 3389 3390 _proto.to = function to(index) { 3391 var _this = this; 3392 3393 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 3394 3395 var activeIndex = this._getItemIndex(this._activeElement); 3396 3397 if (index > this._items.length - 1 || index < 0) { 3398 return; 3399 } 3400 3401 if (this._isSliding) { 3402 $(this._element).one(EVENT_SLID, function () { 3403 return _this.to(index); 3404 }); 3405 return; 3406 } 3407 3408 if (activeIndex === index) { 3409 this.pause(); 3410 this.cycle(); 3411 return; 3412 } 3413 3414 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 3415 3416 this._slide(direction, this._items[index]); 3417 }; 3418 3419 _proto.dispose = function dispose() { 3420 $(this._element).off(EVENT_KEY$2); 3421 $.removeData(this._element, DATA_KEY$2); 3422 this._items = null; 3423 this._config = null; 3424 this._element = null; 3425 this._interval = null; 3426 this._isPaused = null; 3427 this._isSliding = null; 3428 this._activeElement = null; 3429 this._indicatorsElement = null; 3430 } // Private 3431 ; 3432 3433 _proto._getConfig = function _getConfig(config) { 3434 config = _objectSpread2(_objectSpread2({}, Default), config); 3435 Util.typeCheckConfig(NAME$2, config, DefaultType); 3436 return config; 3437 }; 3438 3439 _proto._handleSwipe = function _handleSwipe() { 3440 var absDeltax = Math.abs(this.touchDeltaX); 3441 3442 if (absDeltax <= SWIPE_THRESHOLD) { 3443 return; 3444 } 3445 3446 var direction = absDeltax / this.touchDeltaX; 3447 this.touchDeltaX = 0; // swipe left 3448 3449 if (direction > 0) { 3450 this.prev(); 3451 } // swipe right 3452 3453 3454 if (direction < 0) { 3455 this.next(); 3456 } 3457 }; 3458 3459 _proto._addEventListeners = function _addEventListeners() { 3460 var _this2 = this; 3461 3462 if (this._config.keyboard) { 3463 $(this._element).on(EVENT_KEYDOWN, function (event) { 3464 return _this2._keydown(event); 3465 }); 3466 } 3467 3468 if (this._config.pause === 'hover') { 3469 $(this._element).on(EVENT_MOUSEENTER, function (event) { 3470 return _this2.pause(event); 3471 }).on(EVENT_MOUSELEAVE, function (event) { 3472 return _this2.cycle(event); 3473 }); 3474 } 3475 3476 if (this._config.touch) { 3477 this._addTouchEventListeners(); 3478 } 3479 }; 3480 3481 _proto._addTouchEventListeners = function _addTouchEventListeners() { 3482 var _this3 = this; 3483 3484 if (!this._touchSupported) { 3485 return; 3486 } 3487 3488 var start = function start(event) { 3489 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 3490 _this3.touchStartX = event.originalEvent.clientX; 3491 } else if (!_this3._pointerEvent) { 3492 _this3.touchStartX = event.originalEvent.touches[0].clientX; 3493 } 3494 }; 3495 3496 var move = function move(event) { 3497 // ensure swiping with one touch and not pinching 3498 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 3499 _this3.touchDeltaX = 0; 3500 } else { 3501 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 3502 } 3503 }; 3504 3505 var end = function end(event) { 3506 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 3507 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 3508 } 3509 3510 _this3._handleSwipe(); 3511 3512 if (_this3._config.pause === 'hover') {
3513 // If it's a touch-enabled device, mouseenter/leave are fired as 3514 // part of the mouse compatibility events on first tap - the carousel 3515 // would stop cycling until user tapped out of it; 3516 // here, we listen for touchend, explicitly pause the carousel 3517 // (as if it's the second time we tap on it, mouseenter compat event 3518 // is NOT fired) and after a timeout (to allow for mouse compatibility 3519 // events to fire) we explicitly restart cycling 3520 _this3.pause(); 3521 3522 if (_this3.touchTimeout) { 3523 clearTimeout(_this3.touchTimeout); 3524 } 3525 3526 _this3.touchTimeout = setTimeout(function (event) { 3527 return _this3.cycle(event); 3528 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 3529 } 3530 }; 3531 3532 $(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 3533 return e.preventDefault(); 3534 }); 3535 3536 if (this._pointerEvent) { 3537 $(this._element).on(EVENT_POINTERDOWN, function (event) { 3538 return start(event); 3539 }); 3540 $(this._element).on(EVENT_POINTERUP, function (event) { 3541 return end(event); 3542 }); 3543 3544 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 3545 } else { 3546 $(this._element).on(EVENT_TOUCHSTART, function (event) { 3547 return start(event); 3548 }); 3549 $(this._element).on(EVENT_TOUCHMOVE, function (event) { 3550 return move(event); 3551 }); 3552 $(this._element).on(EVENT_TOUCHEND, function (event) { 3553 return end(event); 3554 }); 3555 } 3556 }; 3557 3558 _proto._keydown = function _keydown(event) { 3559 if (/input|textarea/i.test(event.target.tagName)) { 3560 return; 3561 } 3562 3563 switch (event.which) { 3564 case ARROW_LEFT_KEYCODE: 3565 event.preventDefault(); 3566 this.prev(); 3567 break; 3568 3569 case ARROW_RIGHT_KEYCODE: 3570 event.preventDefault(); 3571 this.next(); 3572 break; 3573 } 3574 }; 3575 3576 _proto._getItemIndex = function _getItemIndex(element) { 3577 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 3578 return this._items.indexOf(element); 3579 }; 3580 3581 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 3582 var isNextDirection = direction === DIRECTION_NEXT; 3583 var isPrevDirection = direction === DIRECTION_PREV; 3584 3585 var activeIndex = this._getItemIndex(activeElement); 3586 3587 var lastItemIndex = this._items.length - 1; 3588 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 3589 3590 if (isGoingToWrap && !this._config.wrap) { 3591 return activeElement; 3592 } 3593 3594 var delta = direction === DIRECTION_PREV ? -1 : 1; 3595 var itemIndex = (activeIndex + delta) % this._items.length; 3596 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 3597 }; 3598 3599 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 3600 var targetIndex = this._getItemIndex(relatedTarget); 3601 3602 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 3603 3604 var slideEvent = $.Event(EVENT_SLIDE, { 3605 relatedTarget: relatedTarget, 3606 direction: eventDirectionName, 3607 from: fromIndex, 3608 to: targetIndex 3609 }); 3610 $(this._element).trigger(slideEvent); 3611 return slideEvent; 3612 }; 3613 3614 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 3615 if (this._indicatorsElement) { 3616 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 3617 $(indicators).removeClass(CLASS_NAME_ACTIVE$1); 3618 3619 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 3620 3621 if (nextIndicator) { 3622 $(nextIndicator).addClass(CLASS_NAME_ACTIVE$1); 3623 } 3624 } 3625 }; 3626 3627 _proto._slide = function _slide(direction, element) { 3628 var _this4 = this; 3629 3630 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 3631 3632 var activeElementIndex = this._getItemIndex(activeElement); 3633 3634 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 3635 3636 var nextElementIndex = this._getItemIndex(nextElement); 3637 3638 var isCycling = Boolean(this._interval); 3639 var directionalClassName; 3640 var orderClassName; 3641 var eventDirectionName; 3642 3643 if (direction === DIRECTION_NEXT) { 3644 directionalClassName = CLASS_NAME_LEFT; 3645 orderClassName = CLASS_NAME_NEXT; 3646 eventDirectionName = DIRECTION_LEFT; 3647 } else { 3648 directionalClassName = CLASS_NAME_RIGHT; 3649 orderClassName = CLASS_NAME_PREV; 3650 eventDirectionName = DIRECTION_RIGHT; 3651 } 3652 3653 if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE$1)) { 3654 this._isSliding = false;
3655 return; 3656 } 3657 3658 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 3659 3660 if (slideEvent.isDefaultPrevented()) { 3661 return; 3662 } 3663 3664 if (!activeElement || !nextElement) { 3665 // Some weirdness is happening, so we bail 3666 return; 3667 } 3668 3669 this._isSliding = true; 3670 3671 if (isCycling) { 3672 this.pause(); 3673 } 3674 3675 this._setActiveIndicatorElement(nextElement); 3676 3677 var slidEvent = $.Event(EVENT_SLID, { 3678 relatedTarget: nextElement, 3679 direction: eventDirectionName, 3680 from: activeElementIndex, 3681 to: nextElementIndex 3682 }); 3683 3684 if ($(this._element).hasClass(CLASS_NAME_SLIDE)) { 3685 $(nextElement).addClass(orderClassName); 3686 Util.reflow(nextElement); 3687 $(activeElement).addClass(directionalClassName); 3688 $(nextElement).addClass(directionalClassName); 3689 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 3690 3691 if (nextElementInterval) { 3692 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 3693 this._config.interval = nextElementInterval; 3694 } else { 3695 this._config.interval = this._config.defaultInterval || this._config.interval; 3696 } 3697 3698 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 3699 $(activeElement).one(Util.TRANSITION_END, function () { 3700 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1); 3701 $(activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName); 3702 _this4._isSliding = false; 3703 setTimeout(function () { 3704 return $(_this4._element).trigger(slidEvent); 3705 }, 0); 3706 }).emulateTransitionEnd(transitionDuration); 3707 } else { 3708 $(activeElement).removeClass(CLASS_NAME_ACTIVE$1); 3709 $(nextElement).addClass(CLASS_NAME_ACTIVE$1); 3710 this._isSliding = false; 3711 $(this._element).trigger(slidEvent); 3712 } 3713 3714 if (isCycling) { 3715 this.cycle(); 3716 } 3717 } // Static 3718 ; 3719 3720 Carousel._jQueryInterface = function _jQueryInterface(config) { 3721 return this.each(function () { 3722 var data = $(this).data(DATA_KEY$2); 3723 3724 var _config = _objectSpread2(_objectSpread2({}, Default), $(this).data()); 3725 3726 if (typeof config === 'object') { 3727 _config = _objectSpread2(_objectSpread2({}, _config), config); 3728 } 3729 3730 var action = typeof config === 'string' ? config : _config.slide; 3731 3732 if (!data) { 3733 data = new Carousel(this, _config); 3734 $(this).data(DATA_KEY$2, data); 3735 } 3736 3737 if (typeof config === 'number') { 3738 data.to(config); 3739 } else if (typeof action === 'string') { 3740 if (typeof data[action] === 'undefined') { 3741 throw new TypeError("No method named \"" + action + "\""); 3742 } 3743 3744 data[action](); 3745 } else if (_config.interval && _config.ride) { 3746 data.pause(); 3747 data.cycle(); 3748 } 3749 }); 3750 }; 3751 3752 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 3753 var selector = Util.getSelectorFromElement(this); 3754 3755 if (!selector) { 3756 return; 3757 } 3758 3759 var target = $(selector)[0]; 3760 3761 if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) { 3762 return; 3763 } 3764 3765 var config = _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data()); 3766 3767 var slideIndex = this.getAttribute('data-slide-to'); 3768 3769 if (slideIndex) { 3770 config.interval = false; 3771 } 3772 3773 Carousel._jQueryInterface.call($(target), config); 3774 3775 if (slideIndex) { 3776 $(target).data(DATA_KEY$2).to(slideIndex); 3777 } 3778 3779 event.preventDefault(); 3780 }; 3781 3782 _createClass(Carousel, null, [{ 3783 key: "VERSION", 3784 get: function get() { 3785 return VERSION$2; 3786 } 3787 }, { 3788 key: "Default", 3789 get: function get() { 3790 return Default; 3791 } 3792 }]); 3793 3794 return Carousel; 3795 }(); 3796 /** 3797 * ------------------------------------------------------------------------ 3798 * Data Api implementation 3799 * ------------------------------------------------------------------------ 3800 */ 3801 3802 3803 $(document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 3804 $(window).on(EVENT_LOAD_DATA_API$1, function () { 3805 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 3806 3807 for (var i = 0, len = carousels.length; i < len; i++) {
3808 var $carousel = $(carousels[i]); 3809 3810 Carousel._jQueryInterface.call($carousel, $carousel.data()); 3811 } 3812 }); 3813 /** 3814 * ------------------------------------------------------------------------ 3815 * jQuery 3816 * ------------------------------------------------------------------------ 3817 */ 3818 3819 $.fn[NAME$2] = Carousel._jQueryInterface; 3820 $.fn[NAME$2].Constructor = Carousel; 3821 3822 $.fn[NAME$2].noConflict = function () { 3823 $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 3824 return Carousel._jQueryInterface; 3825 }; 3826 3827 /** 3828 * ------------------------------------------------------------------------ 3829 * Constants 3830 * ------------------------------------------------------------------------ 3831 */ 3832 3833 var NAME$3 = 'collapse'; 3834 var VERSION$3 = '4.5.0'; 3835 var DATA_KEY$3 = 'bs.collapse'; 3836 var EVENT_KEY$3 = "." + DATA_KEY$3; 3837 var DATA_API_KEY$3 = '.data-api'; 3838 var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; 3839 var Default$1 = { 3840 toggle: true, 3841 parent: '' 3842 }; 3843 var DefaultType$1 = { 3844 toggle: 'boolean', 3845 parent: '(string|element)' 3846 }; 3847 var EVENT_SHOW = "show" + EVENT_KEY$3; 3848 var EVENT_SHOWN = "shown" + EVENT_KEY$3; 3849 var EVENT_HIDE = "hide" + EVENT_KEY$3; 3850 var EVENT_HIDDEN = "hidden" + EVENT_KEY$3; 3851 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3; 3852 var CLASS_NAME_SHOW$1 = 'show'; 3853 var CLASS_NAME_COLLAPSE = 'collapse'; 3854 var CLASS_NAME_COLLAPSING = 'collapsing'; 3855 var CLASS_NAME_COLLAPSED = 'collapsed'; 3856 var DIMENSION_WIDTH = 'width'; 3857 var DIMENSION_HEIGHT = 'height'; 3858 var SELECTOR_ACTIVES = '.show, .collapsing'; 3859 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]'; 3860 /** 3861 * ------------------------------------------------------------------------ 3862 * Class Definition 3863 * ------------------------------------------------------------------------ 3864 */ 3865 3866 var Collapse = /*#__PURE__*/function () { 3867 function Collapse(element, config) { 3868 this._isTransitioning = false; 3869 this._element = element; 3870 this._config = this._getConfig(config); 3871 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 3872 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1)); 3873 3874 for (var i = 0, len = toggleList.length; i < len; i++) { 3875 var elem = toggleList[i]; 3876 var selector = Util.getSelectorFromElement(elem); 3877 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 3878 return foundElem === element; 3879 }); 3880 3881 if (selector !== null && filterElement.length > 0) { 3882 this._selector = selector; 3883 3884 this._triggerArray.push(elem); 3885 } 3886 } 3887 3888 this._parent = this._config.parent ? this._getParent() : null; 3889 3890 if (!this._config.parent) { 3891 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 3892 } 3893 3894 if (this._config.toggle) { 3895 this.toggle(); 3896 } 3897 } // Getters 3898 3899 3900 var _proto = Collapse.prototype; 3901 3902 // Public 3903 _proto.toggle = function toggle() { 3904 if ($(this._element).hasClass(CLASS_NAME_SHOW$1)) { 3905 this.hide(); 3906 } else { 3907 this.show(); 3908 } 3909 }; 3910 3911 _proto.show = function show() { 3912 var _this = this; 3913 3914 if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW$1)) { 3915 return; 3916 } 3917 3918 var actives; 3919 var activesData; 3920 3921 if (this._parent) { 3922 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 3923 if (typeof _this._config.parent === 'string') { 3924 return elem.getAttribute('data-parent') === _this._config.parent; 3925 } 3926 3927 return elem.classList.contains(CLASS_NAME_COLLAPSE); 3928 }); 3929 3930 if (actives.length === 0) { 3931 actives = null; 3932 } 3933 } 3934 3935 if (actives) { 3936 activesData = $(actives).not(this._selector).data(DATA_KEY$3); 3937 3938 if (activesData && activesData._isTransitioning) { 3939 return; 3940 } 3941 } 3942 3943 var startEvent = $.Event(EVENT_SHOW); 3944 $(this._element).trigger(startEvent); 3945 3946 if (startEvent.isDefaultPrevented()) { 3947 return; 3948 } 3949 3950 if (actives) { 3951 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 3952 3953 if (!activesData) { 3954 $(actives).data(DATA_KEY$3, null); 3955 } 3956 } 3957 3958 var dimension = this._getDimension(); 3959 3960 $(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 3961 this._element.style[dimension] = 0; 3962 3963 if (this._triggerArray.length) { 3964 $(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 3965 } 3966 3967 this.setTransitioning(true); 3968 3969 var complete = function complete() { 3970 $(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 3971 _this._element.style[dimension] = ''; 3972 3973 _this.setTransitioning(false); 3974 3975 $(_this._element).trigger(EVENT_SHOWN); 3976 }; 3977 3978 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 3979 var scrollSize = "scroll" + capitalizedDimension; 3980 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 3981 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3982 this._element.style[dimension] = this._element[scrollSize] + "px"; 3983 }; 3984 3985 _proto.hide = function hide() { 3986 var _this2 = this; 3987 3988 if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW$1)) { 3989 return; 3990 } 3991 3992 var startEvent = $.Event(EVENT_HIDE); 3993 $(this._element).trigger(startEvent); 3994 3995 if (startEvent.isDefaultPrevented()) { 3996 return; 3997 } 3998 3999 var dimension = this._getDimension(); 4000 4001 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 4002 Util.reflow(this._element); 4003 $(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 4004 var triggerArrayLength = this._triggerArray.length; 4005 4006 if (triggerArrayLength > 0) { 4007 for (var i = 0; i < triggerArrayLength; i++) { 4008 var trigger = this._triggerArray[i]; 4009 var selector = Util.getSelectorFromElement(trigger); 4010 4011 if (selector !== null) { 4012 var $elem = $([].slice.call(document.querySelectorAll(selector))); 4013 4014 if (!$elem.hasClass(CLASS_NAME_SHOW$1)) { 4015 $(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 4016 } 4017 } 4018 } 4019 } 4020 4021 this.setTransitioning(true); 4022 4023 var complete = function complete() { 4024 _this2.setTransitioning(false); 4025 4026 $(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN); 4027 }; 4028 4029 this._element.style[dimension] = ''; 4030 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4031 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4032 }; 4033 4034 _proto.setTransitioning = function setTransitioning(isTransitioning) { 4035 this._isTransitioning = isTransitioning; 4036 }; 4037 4038 _proto.dispose = function dispose() { 4039 $.removeData(this._element, DATA_KEY$3); 4040 this._config = null; 4041 this._parent = null; 4042 this._element = null; 4043 this._triggerArray = null; 4044 this._isTransitioning = null; 4045 } // Private 4046 ; 4047 4048 _proto._getConfig = function _getConfig(config) {
4049 config = _objectSpread2(_objectSpread2({}, Default$1), config); 4050 config.toggle = Boolean(config.toggle); // Coerce string values 4051 4052 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 4053 return config; 4054 }; 4055 4056 _proto._getDimension = function _getDimension() { 4057 var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH); 4058 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 4059 }; 4060 4061 _proto._getParent = function _getParent() { 4062 var _this3 = this; 4063 4064 var parent; 4065 4066 if (Util.isElement(this._config.parent)) { 4067 parent = this._config.parent; // It's a jQuery object 4068 4069 if (typeof this._config.parent.jquery !== 'undefined') { 4070 parent = this._config.parent[0]; 4071 } 4072 } else { 4073 parent = document.querySelector(this._config.parent); 4074 } 4075 4076 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 4077 var children = [].slice.call(parent.querySelectorAll(selector)); 4078 $(children).each(function (i, element) { 4079 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 4080 }); 4081 return parent; 4082 }; 4083 4084 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 4085 var isOpen = $(element).hasClass(CLASS_NAME_SHOW$1); 4086 4087 if (triggerArray.length) { 4088 $(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 4089 } 4090 } // Static 4091 ; 4092 4093 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 4094 var selector = Util.getSelectorFromElement(element); 4095 return selector ? document.querySelector(selector) : null; 4096 }; 4097 4098 Collapse._jQueryInterface = function _jQueryInterface(config) { 4099 return this.each(function () { 4100 var $this = $(this); 4101 var data = $this.data(DATA_KEY$3); 4102 4103 var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$1), $this.data()), typeof config === 'object' && config ? config : {}); 4104 4105 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 4106 _config.toggle = false; 4107 } 4108 4109 if (!data) { 4110 data = new Collapse(this, _config); 4111 $this.data(DATA_KEY$3, data); 4112 } 4113 4114 if (typeof config === 'string') { 4115 if (typeof data[config] === 'undefined') { 4116 throw new TypeError("No method named \"" + config + "\""); 4117 } 4118 4119 data[config](); 4120 } 4121 }); 4122 }; 4123 4124 _createClass(Collapse, null, [{ 4125 key: "VERSION", 4126 get: function get() { 4127 return VERSION$3; 4128 } 4129 }, { 4130 key: "Default", 4131 get: function get() { 4132 return Default$1; 4133 } 4134 }]); 4135 4136 return Collapse; 4137 }(); 4138 /** 4139 * ------------------------------------------------------------------------ 4140 * Data Api implementation 4141 * ------------------------------------------------------------------------ 4142 */ 4143 4144 4145 $(document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) { 4146 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 4147 if (event.currentTarget.tagName === 'A') { 4148 event.preventDefault(); 4149 } 4150 4151 var $trigger = $(this); 4152 var selector = Util.getSelectorFromElement(this); 4153 var selectors = [].slice.call(document.querySelectorAll(selector)); 4154 $(selectors).each(function () { 4155 var $target = $(this); 4156 var data = $target.data(DATA_KEY$3); 4157 var config = data ? 'toggle' : $trigger.data(); 4158 4159 Collapse._jQueryInterface.call($target, config); 4160 }); 4161 }); 4162 /** 4163 * ------------------------------------------------------------------------ 4164 * jQuery 4165 * ------------------------------------------------------------------------ 4166 */ 4167 4168 $.fn[NAME$3] = Collapse._jQueryInterface; 4169 $.fn[NAME$3].Constructor = Collapse; 4170 4171 $.fn[NAME$3].noConflict = function () { 4172 $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 4173 return Collapse._jQueryInterface; 4174 }; 4175 4176 /** 4177 * ------------------------------------------------------------------------ 4178 * Constants 4179 * ------------------------------------------------------------------------ 4180 */ 4181 4182 var NAME$4 = 'dropdown'; 4183 var VERSION$4 = '4.5.0'; 4184 var DATA_KEY$4 = 'bs.dropdown'; 4185 var EVENT_KEY$4 = "." + DATA_KEY$4; 4186 var DATA_API_KEY$4 = '.data-api'; 4187 var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; 4188 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 4189 4190 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 4191 4192 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 4193 4194 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 4195 4196 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 4197 4198 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 4199 4200 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 4201 var EVENT_HIDE$1 = "hide" + EVENT_KEY$4; 4202 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4; 4203 var EVENT_SHOW$1 = "show" + EVENT_KEY$4; 4204 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4; 4205 var EVENT_CLICK = "click" + EVENT_KEY$4; 4206 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4; 4207 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4; 4208 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4; 4209 var CLASS_NAME_DISABLED = 'disabled'; 4210 var CLASS_NAME_SHOW$2 = 'show'; 4211 var CLASS_NAME_DROPUP = 'dropup'; 4212 var CLASS_NAME_DROPRIGHT = 'dropright'; 4213 var CLASS_NAME_DROPLEFT = 'dropleft'; 4214 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 4215 var CLASS_NAME_POSITION_STATIC = 'position-static'; 4216 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 4217 var SELECTOR_FORM_CHILD = '.dropdown form'; 4218 var SELECTOR_MENU = '.dropdown-menu'; 4219 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 4220 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 4221 var PLACEMENT_TOP = 'top-start'; 4222 var PLACEMENT_TOPEND = 'top-end'; 4223 var PLACEMENT_BOTTOM = 'bottom-start'; 4224 var PLACEMENT_BOTTOMEND = 'bottom-end'; 4225 var PLACEMENT_RIGHT = 'right-start'; 4226 var PLACEMENT_LEFT = 'left-start'; 4227 var Default$2 = { 4228 offset: 0, 4229 flip: true, 4230 boundary: 'scrollParent', 4231 reference: 'toggle', 4232 display: 'dynamic', 4233 popperConfig: null 4234 }; 4235 var DefaultType$2 = { 4236 offset: '(number|string|function)', 4237 flip: 'boolean', 4238 boundary: '(string|element)', 4239 reference: '(string|element)', 4240 display: 'string', 4241 popperConfig: '(null|object)' 4242 }; 4243 /** 4244 * ------------------------------------------------------------------------ 4245 * Class Definition 4246 * ------------------------------------------------------------------------ 4247 */ 4248 4249 var Dropdown = /*#__PURE__*/function () { 4250 function Dropdown(element, config) { 4251 this._element = element; 4252 this._popper = null; 4253 this._config = this._getConfig(config); 4254 this._menu = this._getMenuElement(); 4255 this._inNavbar = this._detectNavbar(); 4256 4257 this._addEventListeners(); 4258 } // Getters 4259 4260 4261 var _proto = Dropdown.prototype; 4262 4263 // Public
4264 _proto.toggle = function toggle() { 4265 if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) { 4266 return; 4267 } 4268 4269 var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW$2); 4270 4271 Dropdown._clearMenus(); 4272 4273 if (isActive) { 4274 return; 4275 } 4276 4277 this.show(true); 4278 }; 4279 4280 _proto.show = function show(usePopper) { 4281 if (usePopper === void 0) { 4282 usePopper = false; 4283 } 4284 4285 if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW$2)) { 4286 return; 4287 } 4288 4289 var relatedTarget = { 4290 relatedTarget: this._element 4291 }; 4292 var showEvent = $.Event(EVENT_SHOW$1, relatedTarget); 4293 4294 var parent = Dropdown._getParentFromElement(this._element); 4295 4296 $(parent).trigger(showEvent); 4297 4298 if (showEvent.isDefaultPrevented()) { 4299 return; 4300 } // Disable totally Popper.js for Dropdown in Navbar 4301 4302 4303 if (!this._inNavbar && usePopper) { 4304 /** 4305 * Check for Popper dependency 4306 * Popper - https://popper.js.org 4307 */ 4308 if (typeof Popper === 'undefined') { 4309 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 4310 } 4311 4312 var referenceElement = this._element; 4313 4314 if (this._config.reference === 'parent') { 4315 referenceElement = parent; 4316 } else if (Util.isElement(this._config.reference)) { 4317 referenceElement = this._config.reference; // Check if it's jQuery element 4318 4319 if (typeof this._config.reference.jquery !== 'undefined') { 4320 referenceElement = this._config.reference[0]; 4321 } 4322 } // If boundary is not `scrollParent`, then set position to `static` 4323 // to allow the menu to "escape" the scroll parent's boundaries 4324 // https://github.com/twbs/bootstrap/issues/24251 4325 4326 4327 if (this._config.boundary !== 'scrollParent') { 4328 $(parent).addClass(CLASS_NAME_POSITION_STATIC); 4329 } 4330 4331 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 4332 } // If this is a touch-enabled device we add extra 4333 // empty mouseover listeners to the body's immediate children; 4334 // only needed because of broken event delegation on iOS 4335 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4336 4337 4338 if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 4339 $(document.body).children().on('mouseover', null, $.noop); 4340 } 4341 4342 this._element.focus(); 4343 4344 this._element.setAttribute('aria-expanded', true); 4345 4346 $(this._menu).toggleClass(CLASS_NAME_SHOW$2); 4347 $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_SHOWN$1, relatedTarget)); 4348 }; 4349 4350 _proto.hide = function hide() { 4351 if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW$2)) { 4352 return; 4353 } 4354 4355 var relatedTarget = { 4356 relatedTarget: this._element 4357 }; 4358 var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget); 4359 4360 var parent = Dropdown._getParentFromElement(this._element); 4361 4362 $(parent).trigger(hideEvent); 4363 4364 if (hideEvent.isDefaultPrevented()) { 4365 return; 4366 } 4367 4368 if (this._popper) { 4369 this._popper.destroy(); 4370 } 4371 4372 $(this._menu).toggleClass(CLASS_NAME_SHOW$2); 4373 $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget)); 4374 }; 4375 4376 _proto.dispose = function dispose() { 4377 $.removeData(this._element, DATA_KEY$4); 4378 $(this._element).off(EVENT_KEY$4); 4379 this._element = null; 4380 this._menu = null; 4381 4382 if (this._popper !== null) { 4383 this._popper.destroy(); 4384 4385 this._popper = null; 4386 } 4387 }; 4388 4389 _proto.update = function update() { 4390 this._inNavbar = this._detectNavbar(); 4391 4392 if (this._popper !== null) { 4393 this._popper.scheduleUpdate(); 4394 } 4395 } // Private 4396 ; 4397 4398 _proto._addEventListeners = function _addEventListeners() { 4399 var _this = this; 4400 4401 $(this._element).on(EVENT_CLICK, function (event) { 4402 event.preventDefault(); 4403 event.stopPropagation(); 4404 4405 _this.toggle(); 4406 }); 4407 }; 4408 4409 _proto._getConfig = function _getConfig(config) {
4410 config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), $(this._element).data()), config); 4411 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 4412 return config; 4413 }; 4414 4415 _proto._getMenuElement = function _getMenuElement() { 4416 if (!this._menu) { 4417 var parent = Dropdown._getParentFromElement(this._element); 4418 4419 if (parent) { 4420 this._menu = parent.querySelector(SELECTOR_MENU); 4421 } 4422 } 4423 4424 return this._menu; 4425 }; 4426 4427 _proto._getPlacement = function _getPlacement() { 4428 var $parentDropdown = $(this._element.parentNode); 4429 var placement = PLACEMENT_BOTTOM; // Handle dropup 4430 4431 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 4432 placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 4433 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 4434 placement = PLACEMENT_RIGHT; 4435 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 4436 placement = PLACEMENT_LEFT; 4437 } else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 4438 placement = PLACEMENT_BOTTOMEND; 4439 } 4440 4441 return placement; 4442 }; 4443 4444 _proto._detectNavbar = function _detectNavbar() { 4445 return $(this._element).closest('.navbar').length > 0; 4446 }; 4447 4448 _proto._getOffset = function _getOffset() { 4449 var _this2 = this; 4450 4451 var offset = {}; 4452 4453 if (typeof this._config.offset === 'function') { 4454 offset.fn = function (data) { 4455 data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {}); 4456 return data; 4457 }; 4458 } else { 4459 offset.offset = this._config.offset; 4460 } 4461 4462 return offset; 4463 }; 4464 4465 _proto._getPopperConfig = function _getPopperConfig() { 4466 var popperConfig = { 4467 placement: this._getPlacement(), 4468 modifiers: { 4469 offset: this._getOffset(), 4470 flip: { 4471 enabled: this._config.flip 4472 }, 4473 preventOverflow: { 4474 boundariesElement: this._config.boundary 4475 } 4476 } 4477 }; // Disable Popper.js if we have a static display 4478 4479 if (this._config.display === 'static') { 4480 popperConfig.modifiers.applyStyle = { 4481 enabled: false 4482 }; 4483 } 4484 4485 return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig); 4486 } // Static 4487 ; 4488 4489 Dropdown._jQueryInterface = function _jQueryInterface(config) { 4490 return this.each(function () { 4491 var data = $(this).data(DATA_KEY$4); 4492 4493 var _config = typeof config === 'object' ? config : null; 4494 4495 if (!data) { 4496 data = new Dropdown(this, _config); 4497 $(this).data(DATA_KEY$4, data); 4498 } 4499 4500 if (typeof config === 'string') { 4501 if (typeof data[config] === 'undefined') { 4502 throw new TypeError("No method named \"" + config + "\""); 4503 } 4504 4505 data[config](); 4506 } 4507 }); 4508 }; 4509 4510 Dropdown._clearMenus = function _clearMenus(event) { 4511 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 4512 return; 4513 } 4514 4515 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 4516 4517 for (var i = 0, len = toggles.length; i < len; i++) { 4518 var parent = Dropdown._getParentFromElement(toggles[i]); 4519 4520 var context = $(toggles[i]).data(DATA_KEY$4); 4521 var relatedTarget = { 4522 relatedTarget: toggles[i] 4523 }; 4524 4525 if (event && event.type === 'click') { 4526 relatedTarget.clickEvent = event; 4527 } 4528 4529 if (!context) { 4530 continue; 4531 } 4532 4533 var dropdownMenu = context._menu; 4534 4535 if (!$(parent).hasClass(CLASS_NAME_SHOW$2)) { 4536 continue; 4537 } 4538 4539 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 4540 continue; 4541 } 4542 4543 var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget); 4544 $(parent).trigger(hideEvent); 4545 4546 if (hideEvent.isDefaultPrevented()) { 4547 continue; 4548 } // If this is a touch-enabled device we remove the extra 4549 // empty mouseover listeners we added for iOS support 4550 4551 4552 if ('ontouchstart' in document.documentElement) { 4553 $(document.body).children().off('mouseover', null, $.noop); 4554 } 4555 4556 toggles[i].setAttribute('aria-expanded', 'false'); 4557 4558 if (context._popper) { 4559 context._popper.destroy(); 4560 } 4561 4562 $(dropdownMenu).removeClass(CLASS_NAME_SHOW$2); 4563 $(parent).removeClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget)); 4564 } 4565 }; 4566 4567 Dropdown._getParentFromElement = function _getParentFromElement(element) { 4568 var parent; 4569 var selector = Util.getSelectorFromElement(element); 4570 4571 if (selector) { 4572 parent = document.querySelector(selector); 4573 } 4574 4575 return parent || element.parentNode; 4576 } // eslint-disable-next-line complexity 4577 ; 4578 4579 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 4580 // If not input/textarea: 4581 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 4582 // If input/textarea: 4583 // - If space key => not a dropdown command 4584 // - If key is other than escape 4585 // - If key is not up or down => not a dropdown command 4586 // - If trigger inside the menu =>
4586 not a dropdown command 4587 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 4588 return; 4589 } 4590 4591 if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) { 4592 return; 4593 } 4594 4595 var parent = Dropdown._getParentFromElement(this); 4596 4597 var isActive = $(parent).hasClass(CLASS_NAME_SHOW$2); 4598 4599 if (!isActive && event.which === ESCAPE_KEYCODE) { 4600 return; 4601 } 4602 4603 event.preventDefault(); 4604 event.stopPropagation(); 4605 4606 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 4607 if (event.which === ESCAPE_KEYCODE) { 4608 $(parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 4609 } 4610 4611 $(this).trigger('click'); 4612 return; 4613 } 4614 4615 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 4616 return $(item).is(':visible'); 4617 }); 4618 4619 if (items.length === 0) { 4620 return; 4621 } 4622 4623 var index = items.indexOf(event.target); 4624 4625 if (event.which === ARROW_UP_KEYCODE && index > 0) { 4626 // Up 4627 index--; 4628 } 4629 4630 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 4631 // Down 4632 index++; 4633 } 4634 4635 if (index < 0) { 4636 index = 0; 4637 } 4638 4639 items[index].focus(); 4640 }; 4641 4642 _createClass(Dropdown, null, [{ 4643 key: "VERSION", 4644 get: function get() { 4645 return VERSION$4; 4646 } 4647 }, { 4648 key: "Default", 4649 get: function get() { 4650 return Default$2; 4651 } 4652 }, { 4653 key: "DefaultType", 4654 get: function get() { 4655 return DefaultType$2; 4656 } 4657 }]); 4658 4659 return Dropdown; 4660 }(); 4661 /** 4662 * ------------------------------------------------------------------------ 4663 * Data Api implementation 4664 * ------------------------------------------------------------------------ 4665 */ 4666 4667 4668 $(document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) { 4669 event.preventDefault(); 4670 event.stopPropagation(); 4671 4672 Dropdown._jQueryInterface.call($(this), 'toggle'); 4673 }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) { 4674 e.stopPropagation(); 4675 }); 4676 /** 4677 * ------------------------------------------------------------------------ 4678 * jQuery 4679 * ------------------------------------------------------------------------ 4680 */ 4681 4682 $.fn[NAME$4] = Dropdown._jQueryInterface; 4683 $.fn[NAME$4].Constructor = Dropdown; 4684 4685 $.fn[NAME$4].noConflict = function () { 4686 $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 4687 return Dropdown._jQueryInterface; 4688 }; 4689 4690 /** 4691 * ------------------------------------------------------------------------ 4692 * Constants 4693 * ------------------------------------------------------------------------ 4694 */ 4695 4696 var NAME$5 = 'modal'; 4697 var VERSION$5 = '4.5.0'; 4698 var DATA_KEY$5 = 'bs.modal'; 4699 var EVENT_KEY$5 = "." + DATA_KEY$5; 4700 var DATA_API_KEY$5 = '.data-api'; 4701 var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; 4702 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 4703 4704 var Default$3 = { 4705 backdrop: true, 4706 keyboard: true, 4707 focus: true, 4708 show: true 4709 }; 4710 var DefaultType$3 = { 4711 backdrop: '(boolean|string)', 4712 keyboard: 'boolean', 4713 focus: 'boolean', 4714 show: 'boolean' 4715 }; 4716 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 4717 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 4718 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 4719 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 4720 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 4721 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 4722 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 4723 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5; 4724 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 4725 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 4726 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 4727 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5; 4728 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 4729 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 4730 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 4731 var CLASS_NAME_OPEN = 'modal-open'; 4732 var CLASS_NAME_FADE$1 = 'fade'; 4733 var CLASS_NAME_SHOW$3 = 'show'; 4734 var CLASS_NAME_STATIC = 'modal-static'; 4735 var SELECTOR_DIALOG = '.modal-dialog'; 4736 var SELECTOR_MODAL_BODY = '.modal-body'; 4737 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]'; 4738 var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]'; 4739 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 4740 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 4741 /** 4742 * ------------------------------------------------------------------------ 4743 * Class Definition 4744 * ------------------------------------------------------------------------ 4745 */ 4746 4747 var Modal = /*#__PURE__*/function () { 4748 function Modal(element, config) { 4749 this._config = this._getConfig(config); 4750 this._element = element; 4751 this._dialog = element.querySelector(SELECTOR_DIALOG); 4752 this._backdrop = null; 4753 this._isShown = false;
4754 this._isBodyOverflowing = false; 4755 this._ignoreBackdropClick = false; 4756 this._isTransitioning = false; 4757 this._scrollbarWidth = 0; 4758 } // Getters 4759 4760 4761 var _proto = Modal.prototype; 4762 4763 // Public 4764 _proto.toggle = function toggle(relatedTarget) { 4765 return this._isShown ? this.hide() : this.show(relatedTarget); 4766 }; 4767 4768 _proto.show = function show(relatedTarget) { 4769 var _this = this; 4770 4771 if (this._isShown || this._isTransitioning) { 4772 return; 4773 } 4774 4775 if ($(this._element).hasClass(CLASS_NAME_FADE$1)) { 4776 this._isTransitioning = true; 4777 } 4778 4779 var showEvent = $.Event(EVENT_SHOW$2, { 4780 relatedTarget: relatedTarget 4781 }); 4782 $(this._element).trigger(showEvent); 4783 4784 if (this._isShown || showEvent.isDefaultPrevented()) { 4785 return; 4786 } 4787 4788 this._isShown = true; 4789 4790 this._checkScrollbar(); 4791 4792 this._setScrollbar(); 4793 4794 this._adjustDialog(); 4795 4796 this._setEscapeEvent(); 4797 4798 this._setResizeEvent(); 4799 4800 $(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) { 4801 return _this.hide(event); 4802 }); 4803 $(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 4804 $(_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 4805 if ($(event.target).is(_this._element)) { 4806 _this._ignoreBackdropClick = true; 4807 } 4808 }); 4809 }); 4810 4811 this._showBackdrop(function () { 4812 return _this._showElement(relatedTarget); 4813 }); 4814 }; 4815 4816 _proto.hide = function hide(event) { 4817 var _this2 = this; 4818 4819 if (event) { 4820 event.preventDefault(); 4821 } 4822 4823 if (!this._isShown || this._isTransitioning) { 4824 return; 4825 } 4826 4827 var hideEvent = $.Event(EVENT_HIDE$2); 4828 $(this._element).trigger(hideEvent); 4829 4830 if (!this._isShown || hideEvent.isDefaultPrevented()) { 4831 return; 4832 } 4833 4834 this._isShown = false; 4835 var transition = $(this._element).hasClass(CLASS_NAME_FADE$1); 4836 4837 if (transition) { 4838 this._isTransitioning = true; 4839 } 4840 4841 this._setEscapeEvent(); 4842 4843 this._setResizeEvent(); 4844 4845 $(document).off(EVENT_FOCUSIN); 4846 $(this._element).removeClass(CLASS_NAME_SHOW$3); 4847 $(this._element).off(EVENT_CLICK_DISMISS); 4848 $(this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 4849 4850 if (transition) { 4851 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4852 $(this._element).one(Util.TRANSITION_END, function (event) { 4853 return _this2._hideModal(event); 4854 }).emulateTransitionEnd(transitionDuration); 4855 } else { 4856 this._hideModal(); 4857 } 4858 }; 4859 4860 _proto.dispose = function dispose() { 4861 [window, this._element, this._dialog].forEach(function (htmlElement) { 4862 return $(htmlElement).off(EVENT_KEY$5); 4863 }); 4864 /** 4865 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 4866 * Do not move `document` in `htmlElements` array 4867 * It will remove `EVENT_CLICK_DATA_API` event that should remain 4868 */ 4869 4870 $(document).off(EVENT_FOCUSIN); 4871 $.removeData(this._element, DATA_KEY$5); 4872 this._config = null; 4873 this._element = null; 4874 this._dialog = null; 4875 this._backdrop = null; 4876 this._isShown = null; 4877 this._isBodyOverflowing = null; 4878 this._ignoreBackdropClick = null; 4879 this._isTransitioning = null; 4880 this._scrollbarWidth = null; 4881 }; 4882 4883 _proto.handleUpdate = function handleUpdate() { 4884 this._adjustDialog(); 4885 } // Private 4886 ; 4887 4888 _proto._getConfig = function _getConfig(config) { 4889 config = _objectSpread2(_objectSpread2({}, Default$3), config); 4890 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 4891 return config; 4892 }; 4893 4894 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 4895 var _this3 = this; 4896 4897 if (this._config.backdrop === 'static') { 4898 var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED); 4899 $(this._element).trigger(hideEventPrevented); 4900 4901 if (hideEventPrevented.defaultPrevented) { 4902 return; 4903 } 4904 4905 this._element.classList.add(CLASS_NAME_STATIC); 4906 4907 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element); 4908 $(this._element).one(Util.TRANSITION_END, function () { 4909 _this3._element.classList.remove(CLASS_NAME_STATIC); 4910 }).emulateTransitionEnd(modalTransitionDuration); 4911 4912 this._element.focus(); 4913 } else { 4914 this.hide(); 4915 } 4916 }; 4917 4918 _proto._showElement = function _showElement(relatedTarget) { 4919 var _this4 = this; 4920 4921 var transition = $(this._element).hasClass(CLASS_NAME_FADE$1); 4922 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 4923 4924 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4925 // Don't move modal's DOM position 4926 document.body.appendChild(this._element); 4927 } 4928 4929 this._element.style.display = 'block'; 4930 4931 this._element.removeAttribute('aria-hidden'); 4932 4933 this._element.setAttribute('aria-modal', true); 4934 4935 if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 4936 modalBody.scrollTop = 0; 4937 } else { 4938 this._element.scrollTop = 0; 4939 } 4940 4941 if (transition) { 4942 Util.reflow(this._element); 4943 } 4944 4945 $(this._element).addClass(CLASS_NAME_SHOW$3); 4946 4947 if (this._config.focus) { 4948 this._enforceFocus(); 4949 } 4950 4951 var shownEvent = $.Event(EVENT_SHOWN$2, { 4952 relatedTarget: relatedTarget 4953 }); 4954 4955 var transitionComplete = function transitionComplete() { 4956 if (_this4._config.focus) { 4957 _this4._element.focus(); 4958 } 4959 4960 _this4._isTransitioning = false;
4961 $(_this4._element).trigger(shownEvent); 4962 }; 4963 4964 if (transition) { 4965 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4966 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 4967 } else { 4968 transitionComplete(); 4969 } 4970 }; 4971 4972 _proto._enforceFocus = function _enforceFocus() { 4973 var _this5 = this; 4974 4975 $(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 4976 .on(EVENT_FOCUSIN, function (event) { 4977 if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) { 4978 _this5._element.focus(); 4979 } 4980 }); 4981 }; 4982 4983 _proto._setEscapeEvent = function _setEscapeEvent() { 4984 var _this6 = this; 4985 4986 if (this._isShown) { 4987 $(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 4988 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 4989 event.preventDefault(); 4990 4991 _this6.hide(); 4992 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 4993 _this6._triggerBackdropTransition(); 4994 } 4995 }); 4996 } else if (!this._isShown) { 4997 $(this._element).off(EVENT_KEYDOWN_DISMISS); 4998 } 4999 }; 5000 5001 _proto._setResizeEvent = function _setResizeEvent() { 5002 var _this7 = this; 5003 5004 if (this._isShown) { 5005 $(window).on(EVENT_RESIZE, function (event) { 5006 return _this7.handleUpdate(event); 5007 }); 5008 } else { 5009 $(window).off(EVENT_RESIZE); 5010 } 5011 }; 5012 5013 _proto._hideModal = function _hideModal() { 5014 var _this8 = this; 5015 5016 this._element.style.display = 'none'; 5017 5018 this._element.setAttribute('aria-hidden', true); 5019 5020 this._element.removeAttribute('aria-modal'); 5021 5022 this._isTransitioning = false; 5023 5024 this._showBackdrop(function () { 5025 $(document.body).removeClass(CLASS_NAME_OPEN); 5026 5027 _this8._resetAdjustments(); 5028 5029 _this8._resetScrollbar(); 5030 5031 $(_this8._element).trigger(EVENT_HIDDEN$2); 5032 }); 5033 }; 5034 5035 _proto._removeBackdrop = function _removeBackdrop() { 5036 if (this._backdrop) { 5037 $(this._backdrop).remove(); 5038 this._backdrop = null; 5039 } 5040 }; 5041 5042 _proto._showBackdrop = function _showBackdrop(callback) { 5043 var _this9 = this; 5044 5045 var animate = $(this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : ''; 5046 5047 if (this._isShown && this._config.backdrop) { 5048 this._backdrop = document.createElement('div'); 5049 this._backdrop.className = CLASS_NAME_BACKDROP; 5050 5051 if (animate) { 5052 this._backdrop.classList.add(animate); 5053 } 5054 5055 $(this._backdrop).appendTo(document.body); 5056 $(this._element).on(EVENT_CLICK_DISMISS, function (event) { 5057 if (_this9._ignoreBackdropClick) { 5058 _this9._ignoreBackdropClick = false; 5059 return; 5060 } 5061 5062 if (event.target !== event.currentTarget) { 5063 return; 5064 } 5065 5066 _this9._triggerBackdropTransition(); 5067 }); 5068 5069 if (animate) { 5070 Util.reflow(this._backdrop); 5071 } 5072 5073 $(this._backdrop).addClass(CLASS_NAME_SHOW$3); 5074 5075 if (!callback) { 5076 return; 5077 } 5078 5079 if (!animate) { 5080 callback(); 5081 return; 5082 } 5083 5084 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 5085 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 5086 } else if (!this._isShown && this._backdrop) { 5087 $(this._backdrop).removeClass(CLASS_NAME_SHOW$3); 5088 5089 var callbackRemove = function callbackRemove() { 5090 _this9._removeBackdrop(); 5091 5092 if (callback) { 5093 callback(); 5094 } 5095 }; 5096 5097 if ($(this._element).hasClass(CLASS_NAME_FADE$1)) { 5098 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 5099 5100 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 5101 } else { 5102 callbackRemove(); 5103 } 5104 } else if (callback) { 5105 callback(); 5106 } 5107 } // ---------------------------------------------------------------------- 5108 // the following methods are used to handle overflowing modals 5109 // todo (fat): these should probably be refactored out of modal.js 5110 // ---------------------------------------------------------------------- 5111 ; 5112
5113 _proto._adjustDialog = function _adjustDialog() { 5114 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 5115 5116 if (!this._isBodyOverflowing && isModalOverflowing) { 5117 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 5118 } 5119 5120 if (this._isBodyOverflowing && !isModalOverflowing) { 5121 this._element.style.paddingRight = this._scrollbarWidth + "px"; 5122 } 5123 }; 5124 5125 _proto._resetAdjustments = function _resetAdjustments() { 5126 this._element.style.paddingLeft = ''; 5127 this._element.style.paddingRight = ''; 5128 }; 5129 5130 _proto._checkScrollbar = function _checkScrollbar() { 5131 var rect = document.body.getBoundingClientRect(); 5132 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 5133 this._scrollbarWidth = this._getScrollbarWidth(); 5134 }; 5135 5136 _proto._setScrollbar = function _setScrollbar() { 5137 var _this10 = this; 5138 5139 if (this._isBodyOverflowing) { 5140 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 5141 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 5142 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 5143 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 5144 5145 $(fixedContent).each(function (index, element) { 5146 var actualPadding = element.style.paddingRight; 5147 var calculatedPadding = $(element).css('padding-right'); 5148 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 5149 }); // Adjust sticky content margin 5150 5151 $(stickyContent).each(function (index, element) { 5152 var actualMargin = element.style.marginRight; 5153 var calculatedMargin = $(element).css('margin-right'); 5154 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 5155 }); // Adjust body padding 5156 5157 var actualPadding = document.body.style.paddingRight; 5158 var calculatedPadding = $(document.body).css('padding-right'); 5159 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 5160 } 5161 5162 $(document.body).addClass(CLASS_NAME_OPEN); 5163 }; 5164 5165 _proto._resetScrollbar = function _resetScrollbar() { 5166 // Restore fixed content padding 5167 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 5168 $(fixedContent).each(function (index, element) { 5169 var padding = $(element).data('padding-right'); 5170 $(element).removeData('padding-right'); 5171 element.style.paddingRight = padding ? padding : ''; 5172 }); // Restore sticky content 5173 5174 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 5175 $(elements).each(function (index, element) { 5176 var margin = $(element).data('margin-right'); 5177 5178 if (typeof margin !== 'undefined') { 5179 $(element).css('margin-right', margin).removeData('margin-right'); 5180 } 5181 }); // Restore body padding 5182 5183 var padding = $(document.body).data('padding-right'); 5184 $(document.body).removeData('padding-right'); 5185 document.body.style.paddingRight = padding ? padding : ''; 5186 }; 5187 5188 _proto._getScrollbarWidth = function _getScrollbarWidth() { 5189 // thx d.walsh 5190 var scrollDiv = document.createElement('div'); 5191 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 5192 document.body.appendChild(scrollDiv); 5193 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 5194 document.body.removeChild(scrollDiv); 5195 return scrollbarWidth; 5196 } // Static 5197 ; 5198 5199 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 5200 return this.each(function () { 5201 var data = $(this).data(DATA_KEY$5); 5202
5203 var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$3), $(this).data()), typeof config === 'object' && config ? config : {}); 5204 5205 if (!data) { 5206 data = new Modal(this, _config); 5207 $(this).data(DATA_KEY$5, data); 5208 } 5209 5210 if (typeof config === 'string') { 5211 if (typeof data[config] === 'undefined') { 5212 throw new TypeError("No method named \"" + config + "\""); 5213 } 5214 5215 data[config](relatedTarget); 5216 } else if (_config.show) { 5217 data.show(relatedTarget); 5218 } 5219 }); 5220 }; 5221 5222 _createClass(Modal, null, [{ 5223 key: "VERSION", 5224 get: function get() { 5225 return VERSION$5; 5226 } 5227 }, { 5228 key: "Default", 5229 get: function get() { 5230 return Default$3; 5231 } 5232 }]); 5233 5234 return Modal; 5235 }(); 5236 /** 5237 * ------------------------------------------------------------------------ 5238 * Data Api implementation 5239 * ------------------------------------------------------------------------ 5240 */ 5241 5242 5243 $(document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) { 5244 var _this11 = this; 5245 5246 var target; 5247 var selector = Util.getSelectorFromElement(this); 5248 5249 if (selector) { 5250 target = document.querySelector(selector); 5251 } 5252 5253 var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data()); 5254 5255 if (this.tagName === 'A' || this.tagName === 'AREA') { 5256 event.preventDefault(); 5257 } 5258 5259 var $target = $(target).one(EVENT_SHOW$2, function (showEvent) { 5260 if (showEvent.isDefaultPrevented()) { 5261 // Only register focus restorer if modal will actually get shown 5262 return; 5263 } 5264 5265 $target.one(EVENT_HIDDEN$2, function () { 5266 if ($(_this11).is(':visible')) { 5267 _this11.focus(); 5268 } 5269 }); 5270 }); 5271 5272 Modal._jQueryInterface.call($(target), config, this); 5273 }); 5274 /** 5275 * ------------------------------------------------------------------------ 5276 * jQuery 5277 * ------------------------------------------------------------------------ 5278 */ 5279 5280 $.fn[NAME$5] = Modal._jQueryInterface; 5281 $.fn[NAME$5].Constructor = Modal; 5282 5283 $.fn[NAME$5].noConflict = function () { 5284 $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 5285 return Modal._jQueryInterface; 5286 }; 5287 5288 /** 5289 * -------------------------------------------------------------------------- 5290 * Bootstrap (v4.5.0): tools/sanitizer.js 5291 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5292 * -------------------------------------------------------------------------- 5293 */ 5294 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 5295 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5296 var DefaultWhitelist = { 5297 // Global attributes allowed on any supplied element below. 5298 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5299 a: ['target', 'href', 'title', 'rel'], 5300 area: [], 5301 b: [], 5302 br: [], 5303 col: [], 5304 code: [], 5305 div: [], 5306 em: [], 5307 hr: [], 5308 h1: [], 5309 h2: [], 5310 h3: [], 5311 h4: [], 5312 h5: [], 5313 h6: [], 5314 i: [], 5315 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 5316 li: [], 5317 ol: [], 5318 p: [], 5319 pre: [], 5320 s: [], 5321 small: [], 5322 span: [], 5323 sub: [], 5324 sup: [], 5325 strong: [], 5326 u: [], 5327 ul: [] 5328 }; 5329 /** 5330 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5331 * 5332 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5333 */ 5334 5335 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi; 5336 /** 5337 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5338 * 5339 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5340 */ 5341 5342 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 5343 5344 function allowedAttribute(attr, allowedAttributeList) { 5345 var attrName = attr.nodeName.toLowerCase(); 5346 5347 if (allowedAttributeList.indexOf(attrName) !== -1) { 5348 if (uriAttrs.indexOf(attrName) !== -1) { 5349 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 5350 } 5351 5352 return true; 5353 } 5354 5355 var regExp = allowedAttributeList.filter(function (attrRegex) {
5356 return attrRegex instanceof RegExp; 5357 }); // Check if a regular expression validates the attribute. 5358 5359 for (var i = 0, len = regExp.length; i < len; i++) { 5360 if (attrName.match(regExp[i])) { 5361 return true; 5362 } 5363 } 5364 5365 return false; 5366 } 5367 5368 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 5369 if (unsafeHtml.length === 0) { 5370 return unsafeHtml; 5371 } 5372 5373 if (sanitizeFn && typeof sanitizeFn === 'function') { 5374 return sanitizeFn(unsafeHtml); 5375 } 5376 5377 var domParser = new window.DOMParser(); 5378 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5379 var whitelistKeys = Object.keys(whiteList); 5380 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 5381 5382 var _loop = function _loop(i, len) { 5383 var el = elements[i]; 5384 var elName = el.nodeName.toLowerCase(); 5385 5386 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 5387 el.parentNode.removeChild(el); 5388 return "continue"; 5389 } 5390 5391 var attributeList = [].slice.call(el.attributes); 5392 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 5393 attributeList.forEach(function (attr) { 5394 if (!allowedAttribute(attr, whitelistedAttributes)) { 5395 el.removeAttribute(attr.nodeName); 5396 } 5397 }); 5398 }; 5399 5400 for (var i = 0, len = elements.length; i < len; i++) { 5401 var _ret = _loop(i); 5402 5403 if (_ret === "continue") continue; 5404 } 5405 5406 return createdDocument.body.innerHTML; 5407 } 5408 5409 /** 5410 * ------------------------------------------------------------------------ 5411 * Constants 5412 * ------------------------------------------------------------------------ 5413 */ 5414 5415 var NAME$6 = 'tooltip'; 5416 var VERSION$6 = '4.5.0'; 5417 var DATA_KEY$6 = 'bs.tooltip'; 5418 var EVENT_KEY$6 = "." + DATA_KEY$6; 5419 var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; 5420 var CLASS_PREFIX = 'bs-tooltip'; 5421 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 5422 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 5423 var DefaultType$4 = { 5424 animation: 'boolean', 5425 template: 'string', 5426 title: '(string|element|function)', 5427 trigger: 'string', 5428 delay: '(number|object)', 5429 html: 'boolean', 5430 selector: '(string|boolean)', 5431 placement: '(string|function)', 5432 offset: '(number|string|function)', 5433 container: '(string|element|boolean)', 5434 fallbackPlacement: '(string|array)', 5435 boundary: '(string|element)', 5436 sanitize: 'boolean', 5437 sanitizeFn: '(null|function)', 5438 whiteList: 'object', 5439 popperConfig: '(null|object)' 5440 }; 5441 var AttachmentMap = { 5442 AUTO: 'auto', 5443 TOP: 'top', 5444 RIGHT: 'right', 5445 BOTTOM: 'bottom', 5446 LEFT: 'left' 5447 }; 5448 var Default$4 = { 5449 animation: true, 5450 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 5451 trigger: 'hover focus', 5452 title: '', 5453 delay: 0, 5454 html: false, 5455 selector: false, 5456 placement: 'top', 5457 offset: 0, 5458 container: false, 5459 fallbackPlacement: 'flip', 5460 boundary: 'scrollParent', 5461 sanitize: true, 5462 sanitizeFn: null, 5463 whiteList: DefaultWhitelist, 5464 popperConfig: null 5465 }; 5466 var HOVER_STATE_SHOW = 'show'; 5467 var HOVER_STATE_OUT = 'out'; 5468 var Event = { 5469 HIDE: "hide" + EVENT_KEY$6, 5470 HIDDEN: "hidden" + EVENT_KEY$6, 5471 SHOW: "show" + EVENT_KEY$6, 5472 SHOWN: "shown" + EVENT_KEY$6, 5473 INSERTED: "inserted" + EVENT_KEY$6, 5474 CLICK: "click" + EVENT_KEY$6, 5475 FOCUSIN: "focusin" + EVENT_KEY$6, 5476 FOCUSOUT: "focusout" + EVENT_KEY$6, 5477 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 5478 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 5479 }; 5480 var CLASS_NAME_FADE$2 = 'fade'; 5481 var CLASS_NAME_SHOW$4 = 'show'; 5482 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 5483 var SELECTOR_ARROW = '.arrow'; 5484 var TRIGGER_HOVER = 'hover'; 5485 var TRIGGER_FOCUS = 'focus'; 5486 var TRIGGER_CLICK = 'click'; 5487 var TRIGGER_MANUAL = 'manual'; 5488 /** 5489 * ------------------------------------------------------------------------ 5490 * Class Definition 5491 * ------------------------------------------------------------------------ 5492 */ 5493 5494 var Tooltip = /*#__PURE__*/function () { 5495 function Tooltip(element, config) { 5496 if (typeof Popper === 'undefined') { 5497 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 5498 } // private 5499 5500 5501 this._isEnabled = true; 5502 this._timeout = 0; 5503 this._hoverState = ''; 5504 this._activeTrigger = {}; 5505 this._popper = null; // Protected 5506 5507 this.element = element; 5508 this.config = this._getConfig(config); 5509 this.tip = null; 5510 5511 this._setListeners(); 5512 } // Getters 5513 5514 5515 var _proto = Tooltip.prototype; 5516 5517 // Public 5518 _proto.enable = function enable() { 5519 this._isEnabled = true; 5520 }; 5521 5522 _proto.disable = function disable() { 5523 this._isEnabled = false;
5524 }; 5525 5526 _proto.toggleEnabled = function toggleEnabled() { 5527 this._isEnabled = !this._isEnabled; 5528 }; 5529 5530 _proto.toggle = function toggle(event) { 5531 if (!this._isEnabled) { 5532 return; 5533 } 5534 5535 if (event) { 5536 var dataKey = this.constructor.DATA_KEY; 5537 var context = $(event.currentTarget).data(dataKey); 5538 5539 if (!context) { 5540 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5541 $(event.currentTarget).data(dataKey, context); 5542 } 5543 5544 context._activeTrigger.click = !context._activeTrigger.click; 5545 5546 if (context._isWithActiveTrigger()) { 5547 context._enter(null, context); 5548 } else { 5549 context._leave(null, context); 5550 } 5551 } else { 5552 if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) { 5553 this._leave(null, this); 5554 5555 return; 5556 } 5557 5558 this._enter(null, this); 5559 } 5560 }; 5561 5562 _proto.dispose = function dispose() { 5563 clearTimeout(this._timeout); 5564 $.removeData(this.element, this.constructor.DATA_KEY); 5565 $(this.element).off(this.constructor.EVENT_KEY); 5566 $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 5567 5568 if (this.tip) { 5569 $(this.tip).remove(); 5570 } 5571 5572 this._isEnabled = null; 5573 this._timeout = null; 5574 this._hoverState = null; 5575 this._activeTrigger = null; 5576 5577 if (this._popper) { 5578 this._popper.destroy(); 5579 } 5580 5581 this._popper = null; 5582 this.element = null; 5583 this.config = null; 5584 this.tip = null; 5585 }; 5586 5587 _proto.show = function show() { 5588 var _this = this; 5589 5590 if ($(this.element).css('display') === 'none') { 5591 throw new Error('Please use show on visible elements'); 5592 } 5593 5594 var showEvent = $.Event(this.constructor.Event.SHOW); 5595 5596 if (this.isWithContent() && this._isEnabled) { 5597 $(this.element).trigger(showEvent); 5598 var shadowRoot = Util.findShadowRoot(this.element); 5599 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 5600 5601 if (showEvent.isDefaultPrevented() || !isInTheDom) { 5602 return; 5603 } 5604 5605 var tip = this.getTipElement(); 5606 var tipId = Util.getUID(this.constructor.NAME);
5607 tip.setAttribute('id', tipId); 5608 this.element.setAttribute('aria-describedby', tipId); 5609 this.setContent(); 5610 5611 if (this.config.animation) { 5612 $(tip).addClass(CLASS_NAME_FADE$2); 5613 } 5614 5615 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 5616 5617 var attachment = this._getAttachment(placement); 5618 5619 this.addAttachmentClass(attachment); 5620 5621 var container = this._getContainer(); 5622 5623 $(tip).data(this.constructor.DATA_KEY, this); 5624 5625 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 5626 $(tip).appendTo(container); 5627 } 5628 5629 $(this.element).trigger(this.constructor.Event.INSERTED); 5630 this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment)); 5631 $(tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra 5632 // empty mouseover listeners to the body's immediate children; 5633 // only needed because of broken event delegation on iOS 5634 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5635 5636 if ('ontouchstart' in document.documentElement) { 5637 $(document.body).children().on('mouseover', null, $.noop); 5638 } 5639 5640 var complete = function complete() { 5641 if (_this.config.animation) { 5642 _this._fixTransition(); 5643 } 5644 5645 var prevHoverState = _this._hoverState; 5646 _this._hoverState = null; 5647 $(_this.element).trigger(_this.constructor.Event.SHOWN); 5648 5649 if (prevHoverState === HOVER_STATE_OUT) { 5650 _this._leave(null, _this); 5651 } 5652 }; 5653 5654 if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) { 5655 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 5656 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5657 } else { 5658 complete(); 5659 } 5660 } 5661 }; 5662 5663 _proto.hide = function hide(callback) { 5664 var _this2 = this; 5665 5666 var tip = this.getTipElement(); 5667 var hideEvent = $.Event(this.constructor.Event.HIDE); 5668 5669 var complete = function complete() { 5670 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 5671 tip.parentNode.removeChild(tip); 5672 } 5673 5674 _this2._cleanTipClass(); 5675 5676 _this2.element.removeAttribute('aria-describedby'); 5677 5678 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 5679 5680 if (_this2._popper !== null) { 5681 _this2._popper.destroy(); 5682 } 5683 5684 if (callback) { 5685 callback(); 5686 } 5687 }; 5688 5689 $(this.element).trigger(hideEvent); 5690 5691 if (hideEvent.isDefaultPrevented()) { 5692 return; 5693 } 5694 5695 $(tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra 5696 // empty mouseover listeners we added for iOS support 5697 5698 if ('ontouchstart' in document.documentElement) { 5699 $(document.body).children().off('mouseover', null, $.noop); 5700 } 5701 5702 this._activeTrigger[TRIGGER_CLICK] = false; 5703 this._activeTrigger[TRIGGER_FOCUS] = false; 5704 this._activeTrigger[TRIGGER_HOVER] = false; 5705 5706 if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) { 5707 var transitionDuration = Util.getTransitionDurationFromElement(tip); 5708 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5709 } else { 5710 complete(); 5711 } 5712 5713 this._hoverState = ''; 5714 }; 5715 5716 _proto.update = function update() { 5717 if (this._popper !== null) { 5718 this._popper.scheduleUpdate(); 5719 } 5720 } // Protected 5721 ; 5722 5723 _proto.isWithContent = function isWithContent() { 5724 return Boolean(this.getTitle()); 5725 }; 5726 5727 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 5728 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 5729 }; 5730 5731 _proto.getTipElement = function getTipElement() { 5732 this.tip = this.tip || $(this.config.template)[0]; 5733 return this.tip; 5734 }; 5735 5736 _proto.setContent = function setContent() { 5737 var tip = this.getTipElement(); 5738 this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 5739 $(tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4); 5740 }; 5741 5742 _proto.setElementContent = function setElementContent($element, content) { 5743 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 5744 // Content is a DOM node or a jQuery 5745 if (this.config.html) { 5746 if (!$(content).parent().is($element)) { 5747 $element.empty().append(content); 5748 } 5749 } else { 5750 $element.text($(content).text()); 5751 } 5752 5753 return; 5754 } 5755 5756 if (this.config.html) { 5757 if (this.config.sanitize) { 5758 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 5759 } 5760 5761 $element.html(content); 5762 } else { 5763 $element.text(content); 5764 } 5765 }; 5766 5767 _proto.getTitle = function getTitle() { 5768 var title = this.element.getAttribute('data-original-title'); 5769 5770 if (!title) { 5771 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 5772 } 5773 5774 return title; 5775 } // Private 5776 ; 5777 5778 _proto._getPopperConfig = function _getPopperConfig(attachment) { 5779 var _this3 = this; 5780 5781 var defaultBsConfig = { 5782 placement: attachment, 5783 modifiers: { 5784 offset: this._getOffset(), 5785 flip: { 5786 behavior: this.config.fallbackPlacement 5787 }, 5788 arrow: { 5789 element: SELECTOR_ARROW 5790 }, 5791 preventOverflow: {
5792 boundariesElement: this.config.boundary 5793 } 5794 }, 5795 onCreate: function onCreate(data) { 5796 if (data.originalPlacement !== data.placement) { 5797 _this3._handlePopperPlacementChange(data); 5798 } 5799 }, 5800 onUpdate: function onUpdate(data) { 5801 return _this3._handlePopperPlacementChange(data); 5802 } 5803 }; 5804 return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig); 5805 }; 5806 5807 _proto._getOffset = function _getOffset() { 5808 var _this4 = this; 5809 5810 var offset = {}; 5811 5812 if (typeof this.config.offset === 'function') { 5813 offset.fn = function (data) { 5814 data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {}); 5815 return data; 5816 }; 5817 } else { 5818 offset.offset = this.config.offset; 5819 } 5820 5821 return offset; 5822 }; 5823 5824 _proto._getContainer = function _getContainer() { 5825 if (this.config.container === false) { 5826 return document.body; 5827 } 5828 5829 if (Util.isElement(this.config.container)) { 5830 return $(this.config.container); 5831 } 5832 5833 return $(document).find(this.config.container); 5834 }; 5835 5836 _proto._getAttachment = function _getAttachment(placement) { 5837 return AttachmentMap[placement.toUpperCase()]; 5838 }; 5839 5840 _proto._setListeners = function _setListeners() { 5841 var _this5 = this; 5842 5843 var triggers = this.config.trigger.split(' '); 5844 triggers.forEach(function (trigger) { 5845 if (trigger === 'click') { 5846 $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 5847 return _this5.toggle(event); 5848 }); 5849 } else if (trigger !== TRIGGER_MANUAL) { 5850 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 5851 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 5852 $(_this5.element).on(eventIn, _this5.config.selector, function (event) { 5853 return _this5._enter(event); 5854 }).on(eventOut, _this5.config.selector, function (event) { 5855 return _this5._leave(event); 5856 }); 5857 } 5858 }); 5859 5860 this._hideModalHandler = function () { 5861 if (_this5.element) { 5862 _this5.hide(); 5863 } 5864 }; 5865 5866 $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 5867 5868 if (this.config.selector) { 5869 this.config = _objectSpread2(_objectSpread2({}, this.config), {}, { 5870 trigger: 'manual', 5871 selector: '' 5872 }); 5873 } else { 5874 this._fixTitle(); 5875 } 5876 }; 5877 5878 _proto._fixTitle = function _fixTitle() { 5879 var titleType = typeof this.element.getAttribute('data-original-title'); 5880 5881 if (this.element.getAttribute('title') || titleType !== 'string') { 5882 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 5883 this.element.setAttribute('title', ''); 5884 } 5885 }; 5886 5887 _proto._enter = function _enter(event, context) { 5888 var dataKey = this.constructor.DATA_KEY; 5889 context = context || $(event.currentTarget).data(dataKey); 5890 5891 if (!context) { 5892 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5893 $(event.currentTarget).data(dataKey, context); 5894 } 5895 5896 if (event) { 5897 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 5898 } 5899 5900 if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) { 5901 context._hoverState = HOVER_STATE_SHOW; 5902 return; 5903 } 5904 5905 clearTimeout(context._timeout); 5906 context._hoverState = HOVER_STATE_SHOW; 5907 5908 if (!context.config.delay || !context.config.delay.show) { 5909 context.show(); 5910 return; 5911 } 5912 5913 context._timeout = setTimeout(function () { 5914 if (context._hoverState === HOVER_STATE_SHOW) { 5915 context.show(); 5916 } 5917 }, context.config.delay.show); 5918 }; 5919 5920 _proto._leave = function _leave(event, context) { 5921 var dataKey = this.constructor.DATA_KEY; 5922 context = context || $(event.currentTarget).data(dataKey); 5923 5924 if (!context) { 5925 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5926 $(event.currentTarget).data(dataKey, context); 5927 } 5928 5929 if (event) { 5930 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
5931 } 5932 5933 if (context._isWithActiveTrigger()) { 5934 return; 5935 } 5936 5937 clearTimeout(context._timeout); 5938 context._hoverState = HOVER_STATE_OUT; 5939 5940 if (!context.config.delay || !context.config.delay.hide) { 5941 context.hide(); 5942 return; 5943 } 5944 5945 context._timeout = setTimeout(function () { 5946 if (context._hoverState === HOVER_STATE_OUT) { 5947 context.hide(); 5948 } 5949 }, context.config.delay.hide); 5950 }; 5951 5952 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 5953 for (var trigger in this._activeTrigger) { 5954 if (this._activeTrigger[trigger]) { 5955 return true; 5956 } 5957 } 5958 5959 return false; 5960 }; 5961 5962 _proto._getConfig = function _getConfig(config) { 5963 var dataAttributes = $(this.element).data(); 5964 Object.keys(dataAttributes).forEach(function (dataAttr) { 5965 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 5966 delete dataAttributes[dataAttr]; 5967 } 5968 }); 5969 config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {}); 5970 5971 if (typeof config.delay === 'number') { 5972 config.delay = { 5973 show: config.delay, 5974 hide: config.delay 5975 }; 5976 } 5977 5978 if (typeof config.title === 'number') { 5979 config.title = config.title.toString(); 5980 } 5981 5982 if (typeof config.content === 'number') { 5983 config.content = config.content.toString(); 5984 } 5985 5986 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 5987 5988 if (config.sanitize) { 5989 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 5990 } 5991 5992 return config; 5993 }; 5994 5995 _proto._getDelegateConfig = function _getDelegateConfig() { 5996 var config = {}; 5997 5998 if (this.config) { 5999 for (var key in this.config) { 6000 if (this.constructor.Default[key] !== this.config[key]) { 6001 config[key] = this.config[key]; 6002 } 6003 } 6004 } 6005 6006 return config; 6007 }; 6008 6009 _proto._cleanTipClass = function _cleanTipClass() { 6010 var $tip = $(this.getTipElement()); 6011 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 6012 6013 if (tabClass !== null && tabClass.length) { 6014 $tip.removeClass(tabClass.join('')); 6015 } 6016 }; 6017 6018 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 6019 this.tip = popperData.instance.popper; 6020 6021 this._cleanTipClass(); 6022 6023 this.addAttachmentClass(this._getAttachment(popperData.placement)); 6024 }; 6025 6026 _proto._fixTransition = function _fixTransition() { 6027 var tip = this.getTipElement(); 6028 var initConfigAnimation = this.config.animation; 6029 6030 if (tip.getAttribute('x-placement') !== null) { 6031 return; 6032 } 6033 6034 $(tip).removeClass(CLASS_NAME_FADE$2); 6035 this.config.animation = false; 6036 this.hide(); 6037 this.show(); 6038 this.config.animation = initConfigAnimation; 6039 } // Static 6040 ; 6041 6042 Tooltip._jQueryInterface = function _jQueryInterface(config) { 6043 return this.each(function () { 6044 var data = $(this).data(DATA_KEY$6); 6045 6046 var _config = typeof config === 'object' && config; 6047 6048 if (!data && /dispose|hide/.test(config)) { 6049 return; 6050 } 6051 6052 if (!data) { 6053 data = new Tooltip(this, _config); 6054 $(this).data(DATA_KEY$6, data); 6055 } 6056 6057 if (typeof config === 'string') { 6058 if (typeof data[config] === 'undefined') { 6059 throw new TypeError("No method named \"" + config + "\""); 6060 } 6061 6062 data[config](); 6063 } 6064 }); 6065 }; 6066 6067 _createClass(Tooltip, null, [{ 6068 key: "VERSION", 6069 get: function get() { 6070 return VERSION$6; 6071 } 6072 }, { 6073 key: "Default", 6074 get: function get() { 6075 return Default$4; 6076 } 6077 }, { 6078 key: "NAME", 6079 get: function get() { 6080 return NAME$6; 6081 } 6082 }, { 6083 key: "DATA_KEY", 6084 get: function get() { 6085 return DATA_KEY$6; 6086 } 6087 }, { 6088 key: "Event", 6089 get: function get() { 6090 return Event; 6091 } 6092 }, {
6093 key: "EVENT_KEY", 6094 get: function get() { 6095 return EVENT_KEY$6; 6096 } 6097 }, { 6098 key: "DefaultType", 6099 get: function get() { 6100 return DefaultType$4; 6101 } 6102 }]); 6103 6104 return Tooltip; 6105 }(); 6106 /** 6107 * ------------------------------------------------------------------------ 6108 * jQuery 6109 * ------------------------------------------------------------------------ 6110 */ 6111 6112 6113 $.fn[NAME$6] = Tooltip._jQueryInterface; 6114 $.fn[NAME$6].Constructor = Tooltip; 6115 6116 $.fn[NAME$6].noConflict = function () { 6117 $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 6118 return Tooltip._jQueryInterface; 6119 }; 6120 6121 /** 6122 * ------------------------------------------------------------------------ 6123 * Constants 6124 * ------------------------------------------------------------------------ 6125 */ 6126 6127 var NAME$7 = 'popover'; 6128 var VERSION$7 = '4.5.0'; 6129 var DATA_KEY$7 = 'bs.popover'; 6130 var EVENT_KEY$7 = "." + DATA_KEY$7; 6131 var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7]; 6132 var CLASS_PREFIX$1 = 'bs-popover'; 6133 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 6134 6135 var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, { 6136 placement: 'right', 6137 trigger: 'click', 6138 content: '', 6139 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 6140 }); 6141 6142 var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, { 6143 content: '(string|element|function)' 6144 }); 6145 6146 var CLASS_NAME_FADE$3 = 'fade'; 6147 var CLASS_NAME_SHOW$5 = 'show'; 6148 var SELECTOR_TITLE = '.popover-header'; 6149 var SELECTOR_CONTENT = '.popover-body'; 6150 var Event$1 = { 6151 HIDE: "hide" + EVENT_KEY$7, 6152 HIDDEN: "hidden" + EVENT_KEY$7, 6153 SHOW: "show" + EVENT_KEY$7, 6154 SHOWN: "shown" + EVENT_KEY$7, 6155 INSERTED: "inserted" + EVENT_KEY$7, 6156 CLICK: "click" + EVENT_KEY$7, 6157 FOCUSIN: "focusin" + EVENT_KEY$7, 6158 FOCUSOUT: "focusout" + EVENT_KEY$7, 6159 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 6160 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 6161 }; 6162 /** 6163 * ------------------------------------------------------------------------ 6164 * Class Definition 6165 * ------------------------------------------------------------------------ 6166 */ 6167 6168 var Popover = /*#__PURE__*/function (_Tooltip) { 6169 _inheritsLoose(Popover, _Tooltip); 6170 6171 function Popover() { 6172 return _Tooltip.apply(this, arguments) || this; 6173 } 6174 6175 var _proto = Popover.prototype; 6176 6177 // Overrides 6178 _proto.isWithContent = function isWithContent() { 6179 return this.getTitle() || this._getContent(); 6180 }; 6181 6182 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 6183 $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 6184 }; 6185 6186 _proto.getTipElement = function getTipElement() { 6187 this.tip = this.tip || $(this.config.template)[0]; 6188 return this.tip; 6189 }; 6190 6191 _proto.setContent = function setContent() { 6192 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 6193 6194 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 6195 6196 var content = this._getContent(); 6197 6198 if (typeof content === 'function') { 6199 content = content.call(this.element); 6200 } 6201 6202 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 6203 $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5); 6204 } // Private 6205 ; 6206 6207 _proto._getContent = function _getContent() { 6208 return this.element.getAttribute('data-content') || this.config.content; 6209 }; 6210 6211 _proto._cleanTipClass = function _cleanTipClass() { 6212 var $tip = $(this.getTipElement()); 6213 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 6214 6215 if (tabClass !== null && tabClass.length > 0) { 6216 $tip.removeClass(tabClass.join('')); 6217 } 6218 } // Static 6219 ; 6220 6221 Popover._jQueryInterface = function _jQueryInterface(config) { 6222 return this.each(function () { 6223 var data = $(this).data(DATA_KEY$7); 6224 6225 var _config = typeof config === 'object' ? config : null; 6226 6227 if (!data && /dispose|hide/.test(config)) { 6228 return; 6229 } 6230 6231 if (!data) { 6232 data = new Popover(this, _config); 6233 $(this).data(DATA_KEY$7, data); 6234 } 6235 6236 if (typeof config === 'string') { 6237 if (typeof data[config] === 'undefined') {
6238 throw new TypeError("No method named \"" + config + "\""); 6239 } 6240 6241 data[config](); 6242 } 6243 }); 6244 }; 6245 6246 _createClass(Popover, null, [{ 6247 key: "VERSION", 6248 // Getters 6249 get: function get() { 6250 return VERSION$7; 6251 } 6252 }, { 6253 key: "Default", 6254 get: function get() { 6255 return Default$5; 6256 } 6257 }, { 6258 key: "NAME", 6259 get: function get() { 6260 return NAME$7; 6261 } 6262 }, { 6263 key: "DATA_KEY", 6264 get: function get() { 6265 return DATA_KEY$7; 6266 } 6267 }, { 6268 key: "Event", 6269 get: function get() { 6270 return Event$1; 6271 } 6272 }, { 6273 key: "EVENT_KEY", 6274 get: function get() { 6275 return EVENT_KEY$7; 6276 } 6277 }, { 6278 key: "DefaultType", 6279 get: function get() { 6280 return DefaultType$5; 6281 } 6282 }]); 6283 6284 return Popover; 6285 }(Tooltip); 6286 /** 6287 * ------------------------------------------------------------------------ 6288 * jQuery 6289 * ------------------------------------------------------------------------ 6290 */ 6291 6292 6293 $.fn[NAME$7] = Popover._jQueryInterface; 6294 $.fn[NAME$7].Constructor = Popover; 6295 6296 $.fn[NAME$7].noConflict = function () { 6297 $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 6298 return Popover._jQueryInterface; 6299 }; 6300 6301 /** 6302 * ------------------------------------------------------------------------ 6303 * Constants 6304 * ------------------------------------------------------------------------ 6305 */ 6306 6307 var NAME$8 = 'scrollspy'; 6308 var VERSION$8 = '4.5.0'; 6309 var DATA_KEY$8 = 'bs.scrollspy'; 6310 var EVENT_KEY$8 = "." + DATA_KEY$8; 6311 var DATA_API_KEY$6 = '.data-api'; 6312 var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; 6313 var Default$6 = { 6314 offset: 10, 6315 method: 'auto', 6316 target: '' 6317 }; 6318 var DefaultType$6 = { 6319 offset: 'number', 6320 method: 'string', 6321 target: '(string|element)' 6322 }; 6323 var EVENT_ACTIVATE = "activate" + EVENT_KEY$8; 6324 var EVENT_SCROLL = "scroll" + EVENT_KEY$8; 6325 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6; 6326 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 6327 var CLASS_NAME_ACTIVE$2 = 'active'; 6328 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 6329 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 6330 var SELECTOR_NAV_LINKS = '.nav-link'; 6331 var SELECTOR_NAV_ITEMS = '.nav-item'; 6332 var SELECTOR_LIST_ITEMS = '.list-group-item'; 6333 var SELECTOR_DROPDOWN = '.dropdown'; 6334 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 6335 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 6336 var METHOD_OFFSET = 'offset'; 6337 var METHOD_POSITION = 'position'; 6338 /** 6339 * ------------------------------------------------------------------------ 6340 * Class Definition 6341 * ------------------------------------------------------------------------ 6342 */ 6343 6344 var ScrollSpy = /*#__PURE__*/function () { 6345 function ScrollSpy(element, config) { 6346 var _this = this; 6347 6348 this._element = element; 6349 this._scrollElement = element.tagName === 'BODY' ? window : element; 6350 this._config = this._getConfig(config); 6351 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 6352 this._offsets = []; 6353 this._targets = []; 6354 this._activeTarget = null; 6355 this._scrollHeight = 0; 6356 $(this._scrollElement).on(EVENT_SCROLL, function (event) { 6357 return _this._process(event); 6358 }); 6359 this.refresh(); 6360 6361 this._process(); 6362 } // Getters 6363 6364 6365 var _proto = ScrollSpy.prototype; 6366 6367 // Public 6368 _proto.refresh = function refresh() { 6369 var _this2 = this; 6370 6371 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 6372 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 6373 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 6374 this._offsets = []; 6375 this._targets = []; 6376 this._scrollHeight = this._getScrollHeight(); 6377 var targets = [].slice.call(document.querySelectorAll(this._selector)); 6378 targets.map(function (element) { 6379 var target; 6380 var targetSelector = Util.getSelectorFromElement(element); 6381
6382 if (targetSelector) { 6383 target = document.querySelector(targetSelector); 6384 } 6385 6386 if (target) { 6387 var targetBCR = target.getBoundingClientRect(); 6388 6389 if (targetBCR.width || targetBCR.height) { 6390 // TODO (fat): remove sketch reliance on jQuery position/offset 6391 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 6392 } 6393 } 6394 6395 return null; 6396 }).filter(function (item) { 6397 return item; 6398 }).sort(function (a, b) { 6399 return a[0] - b[0]; 6400 }).forEach(function (item) { 6401 _this2._offsets.push(item[0]); 6402 6403 _this2._targets.push(item[1]); 6404 }); 6405 }; 6406 6407 _proto.dispose = function dispose() { 6408 $.removeData(this._element, DATA_KEY$8); 6409 $(this._scrollElement).off(EVENT_KEY$8); 6410 this._element = null; 6411 this._scrollElement = null; 6412 this._config = null; 6413 this._selector = null; 6414 this._offsets = null; 6415 this._targets = null; 6416 this._activeTarget = null; 6417 this._scrollHeight = null; 6418 } // Private 6419 ; 6420 6421 _proto._getConfig = function _getConfig(config) { 6422 config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {}); 6423 6424 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 6425 var id = $(config.target).attr('id'); 6426 6427 if (!id) { 6428 id = Util.getUID(NAME$8); 6429 $(config.target).attr('id', id); 6430 } 6431 6432 config.target = "#" + id; 6433 } 6434 6435 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 6436 return config; 6437 }; 6438 6439 _proto._getScrollTop = function _getScrollTop() { 6440 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 6441 }; 6442 6443 _proto._getScrollHeight = function _getScrollHeight() { 6444 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 6445 }; 6446 6447 _proto._getOffsetHeight = function _getOffsetHeight() { 6448 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 6449 }; 6450 6451 _proto._process = function _process() { 6452 var scrollTop = this._getScrollTop() + this._config.offset; 6453 6454 var scrollHeight = this._getScrollHeight(); 6455 6456 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 6457 6458 if (this._scrollHeight !== scrollHeight) { 6459 this.refresh(); 6460 } 6461 6462 if (scrollTop >= maxScroll) { 6463 var target = this._targets[this._targets.length - 1]; 6464 6465 if (this._activeTarget !== target) { 6466 this._activate(target); 6467 } 6468 6469 return; 6470 } 6471 6472 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 6473 this._activeTarget = null; 6474 6475 this._clear(); 6476 6477 return; 6478 } 6479 6480 for (var i = this._offsets.length; i--;) { 6481 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 6482 6483 if (isActiveTarget) { 6484 this._activate(this._targets[i]); 6485 } 6486 } 6487 }; 6488 6489 _proto._activate = function _activate(target) { 6490 this._activeTarget = target; 6491 6492 this._clear(); 6493 6494 var queries = this._selector.split(',').map(function (selector) { 6495 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 6496 }); 6497 6498 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 6499 6500 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 6501 $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2); 6502 $link.addClass(CLASS_NAME_ACTIVE$2); 6503 } else { 6504 // Set triggered link as active 6505 $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active 6506 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6507 6508 $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item 6509 6510 $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2); 6511 } 6512 6513 $(this._scrollElement).trigger(EVENT_ACTIVATE, { 6514 relatedTarget: target 6515 }); 6516 }; 6517 6518 _proto._clear = function _clear() { 6519 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 6520 return node.classList.contains(CLASS_NAME_ACTIVE$2); 6521 }
6521).forEach(function (node) { 6522 return node.classList.remove(CLASS_NAME_ACTIVE$2); 6523 }); 6524 } // Static 6525 ; 6526 6527 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 6528 return this.each(function () { 6529 var data = $(this).data(DATA_KEY$8); 6530 6531 var _config = typeof config === 'object' && config; 6532 6533 if (!data) { 6534 data = new ScrollSpy(this, _config); 6535 $(this).data(DATA_KEY$8, data); 6536 } 6537 6538 if (typeof config === 'string') { 6539 if (typeof data[config] === 'undefined') { 6540 throw new TypeError("No method named \"" + config + "\""); 6541 } 6542 6543 data[config](); 6544 } 6545 }); 6546 }; 6547 6548 _createClass(ScrollSpy, null, [{ 6549 key: "VERSION", 6550 get: function get() { 6551 return VERSION$8; 6552 } 6553 }, { 6554 key: "Default", 6555 get: function get() { 6556 return Default$6; 6557 } 6558 }]); 6559 6560 return ScrollSpy; 6561 }(); 6562 /** 6563 * ------------------------------------------------------------------------ 6564 * Data Api implementation 6565 * ------------------------------------------------------------------------ 6566 */ 6567 6568 6569 $(window).on(EVENT_LOAD_DATA_API$2, function () { 6570 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 6571 var scrollSpysLength = scrollSpys.length; 6572 6573 for (var i = scrollSpysLength; i--;) { 6574 var $spy = $(scrollSpys[i]); 6575 6576 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 6577 } 6578 }); 6579 /** 6580 * ------------------------------------------------------------------------ 6581 * jQuery 6582 * ------------------------------------------------------------------------ 6583 */ 6584 6585 $.fn[NAME$8] = ScrollSpy._jQueryInterface; 6586 $.fn[NAME$8].Constructor = ScrollSpy; 6587 6588 $.fn[NAME$8].noConflict = function () { 6589 $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 6590 return ScrollSpy._jQueryInterface; 6591 }; 6592 6593 /** 6594 * ------------------------------------------------------------------------ 6595 * Constants 6596 * ------------------------------------------------------------------------ 6597 */ 6598 6599 var NAME$9 = 'tab'; 6600 var VERSION$9 = '4.5.0'; 6601 var DATA_KEY$9 = 'bs.tab'; 6602 var EVENT_KEY$9 = "." + DATA_KEY$9; 6603 var DATA_API_KEY$7 = '.data-api'; 6604 var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; 6605 var EVENT_HIDE$3 = "hide" + EVENT_KEY$9; 6606 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9; 6607 var EVENT_SHOW$3 = "show" + EVENT_KEY$9; 6608 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9; 6609 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7; 6610 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 6611 var CLASS_NAME_ACTIVE$3 = 'active'; 6612 var CLASS_NAME_DISABLED$1 = 'disabled'; 6613 var CLASS_NAME_FADE$4 = 'fade'; 6614 var CLASS_NAME_SHOW$6 = 'show'; 6615 var SELECTOR_DROPDOWN$1 = '.dropdown'; 6616 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 6617 var SELECTOR_ACTIVE$2 = '.active'; 6618 var SELECTOR_ACTIVE_UL = '> li > .active'; 6619 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 6620 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 6621 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 6622 /** 6623 * ------------------------------------------------------------------------ 6624 * Class Definition 6625 * ------------------------------------------------------------------------ 6626 */ 6627 6628 var Tab = /*#__PURE__*/function () { 6629 function Tab(element) { 6630 this._element = element; 6631 } // Getters 6632 6633 6634 var _proto = Tab.prototype; 6635 6636 // Public 6637 _proto.show = function show() { 6638 var _this = this; 6639 6640 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE$3) || $(this._element).hasClass(CLASS_NAME_DISABLED$1)) { 6641 return; 6642 } 6643 6644 var target; 6645 var previous; 6646 var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0]; 6647 var selector = Util.getSelectorFromElement(this._element); 6648 6649 if (listElement) { 6650 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2; 6651 previous = $.makeArray($(listElement).find(itemSelector)); 6652 previous = previous[previous.length - 1]; 6653 } 6654 6655 var hideEvent = $.Event(EVENT_HIDE$3, { 6656 relatedTarget: this._element 6657 }); 6658 var showEvent = $.Event(EVENT_SHOW$3, { 6659 relatedTarget: previous 6660 }); 6661 6662 if (previous) { 6663 $(previous).trigger(hideEvent); 6664 } 6665 6666 $(this._element).trigger(showEvent); 6667 6668 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 6669 return; 6670 } 6671 6672 if (selector) { 6673 target = document.querySelector(selector); 6674 } 6675 6676 this._activate(this._element, listElement); 6677 6678 var complete = function complete() { 6679 var hiddenEvent = $.Event(EVENT_HIDDEN$3, { 6680 relatedTarget: _this._element 6681 }); 6682 var shownEvent = $.Event(EVENT_SHOWN$3, { 6683 relatedTarget: previous 6684 }); 6685 $(previous).trigger(hiddenEvent); 6686 $(_this._element).trigger(shownEvent); 6687 }; 6688 6689 if (target) { 6690 this._activate(target, target.parentNode, complete); 6691 } else { 6692 complete(); 6693 } 6694 }; 6695 6696 _proto.dispose = function dispose() { 6697 $.removeData(this._element, DATA_KEY$9); 6698 this._element = null; 6699 } // Private 6700 ; 6701 6702 _proto._activate = function _activate(element, container, callback) { 6703 var _this2 = this; 6704 6705 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE$2); 6706 var active = activeElements[0]; 6707 var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE$4); 6708 6709 var complete = function complete() { 6710 return _this2._transitionComplete(element, active, callback); 6711 }; 6712 6713 if (active && isTransitioning) { 6714 var transitionDuration = Util.getTransitionDurationFromElement(active); 6715 $(active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6716 } else { 6717 complete(); 6718 } 6719 }; 6720 6721 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 6722 if (active) { 6723 $(active).removeClass(CLASS_NAME_ACTIVE$3);
6724 var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 6725 6726 if (dropdownChild) { 6727 $(dropdownChild).removeClass(CLASS_NAME_ACTIVE$3); 6728 } 6729 6730 if (active.getAttribute('role') === 'tab') { 6731 active.setAttribute('aria-selected', false); 6732 } 6733 } 6734 6735 $(element).addClass(CLASS_NAME_ACTIVE$3); 6736 6737 if (element.getAttribute('role') === 'tab') { 6738 element.setAttribute('aria-selected', true); 6739 } 6740 6741 Util.reflow(element); 6742 6743 if (element.classList.contains(CLASS_NAME_FADE$4)) { 6744 element.classList.add(CLASS_NAME_SHOW$6); 6745 } 6746 6747 if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 6748 var dropdownElement = $(element).closest(SELECTOR_DROPDOWN$1)[0]; 6749 6750 if (dropdownElement) { 6751 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1)); 6752 $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3); 6753 } 6754 6755 element.setAttribute('aria-expanded', true); 6756 } 6757 6758 if (callback) { 6759 callback(); 6760 } 6761 } // Static 6762 ; 6763 6764 Tab._jQueryInterface = function _jQueryInterface(config) { 6765 return this.each(function () { 6766 var $this = $(this); 6767 var data = $this.data(DATA_KEY$9); 6768 6769 if (!data) { 6770 data = new Tab(this); 6771 $this.data(DATA_KEY$9, data); 6772 } 6773 6774 if (typeof config === 'string') { 6775 if (typeof data[config] === 'undefined') { 6776 throw new TypeError("No method named \"" + config + "\""); 6777 } 6778 6779 data[config](); 6780 } 6781 }); 6782 }; 6783 6784 _createClass(Tab, null, [{ 6785 key: "VERSION", 6786 get: function get() { 6787 return VERSION$9; 6788 } 6789 }]); 6790 6791 return Tab; 6792 }(); 6793 /** 6794 * ------------------------------------------------------------------------ 6795 * Data Api implementation 6796 * ------------------------------------------------------------------------ 6797 */ 6798 6799 6800 $(document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) { 6801 event.preventDefault(); 6802 6803 Tab._jQueryInterface.call($(this), 'show'); 6804 }); 6805 /** 6806 * ------------------------------------------------------------------------ 6807 * jQuery 6808 * ------------------------------------------------------------------------ 6809 */ 6810 6811 $.fn[NAME$9] = Tab._jQueryInterface; 6812 $.fn[NAME$9].Constructor = Tab; 6813 6814 $.fn[NAME$9].noConflict = function () { 6815 $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 6816 return Tab._jQueryInterface; 6817 }; 6818 6819 /** 6820 * ------------------------------------------------------------------------ 6821 * Constants 6822 * ------------------------------------------------------------------------ 6823 */ 6824 6825 var NAME$a = 'toast'; 6826 var VERSION$a = '4.5.0'; 6827 var DATA_KEY$a = 'bs.toast'; 6828 var EVENT_KEY$a = "." + DATA_KEY$a; 6829 var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; 6830 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a; 6831 var EVENT_HIDE$4 = "hide" + EVENT_KEY$a; 6832 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a; 6833 var EVENT_SHOW$4 = "show" + EVENT_KEY$a; 6834 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a; 6835 var CLASS_NAME_FADE$5 = 'fade'; 6836 var CLASS_NAME_HIDE = 'hide'; 6837 var CLASS_NAME_SHOW$7 = 'show'; 6838 var CLASS_NAME_SHOWING = 'showing'; 6839 var DefaultType$7 = { 6840 animation: 'boolean', 6841 autohide: 'boolean', 6842 delay: 'number' 6843 }; 6844 var Default$7 = { 6845 animation: true, 6846 autohide: true, 6847 delay: 500 6848 }; 6849 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]'; 6850 /** 6851 * ------------------------------------------------------------------------ 6852 * Class Definition 6853 * ------------------------------------------------------------------------ 6854 */ 6855 6856 var Toast = /*#__PURE__*/function () { 6857 function Toast(element, config) { 6858 this._element = element; 6859 this._config = this._getConfig(config); 6860 this._timeout = null; 6861 6862 this._setListeners(); 6863 } // Getters 6864 6865 6866 var _proto = Toast.prototype; 6867 6868 // Public 6869 _proto.show = function show() { 6870 var _this = this; 6871 6872 var showEvent = $.Event(EVENT_SHOW$4); 6873 $(this._element).trigger(showEvent); 6874 6875 if (showEvent.isDefaultPrevented()) { 6876 return; 6877 } 6878 6879 if (this._config.animation) { 6880 this._element.classList.add(CLASS_NAME_FADE$5); 6881 } 6882 6883 var complete = function complete() { 6884 _this._element.classList.remove(CLASS_NAME_SHOWING); 6885 6886 _this._element.classList.add(CLASS_NAME_SHOW$7); 6887 6888 $(_this._element).trigger(EVENT_SHOWN$4); 6889 6890 if (_this._config.autohide) { 6891 _this._timeout = setTimeout(function () { 6892 _this.hide(); 6893 }, _this._config.delay); 6894 } 6895 }; 6896 6897 this._element.classList.remove(CLASS_NAME_HIDE); 6898 6899 Util.reflow(this._element); 6900 6901 this._element.classList.add(CLASS_NAME_SHOWING); 6902 6903 if (this._config.animation) { 6904 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6905 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6906 } else { 6907 complete(); 6908 } 6909 }; 6910 6911 _proto.hide = function hide() { 6912 if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) { 6913 return; 6914 } 6915 6916 var hideEvent = $.Event(EVENT_HIDE$4); 6917 $(this._element).trigger(hideEvent); 6918 6919 if (hideEvent.isDefaultPrevented()) { 6920 return; 6921 } 6922 6923 this._close(); 6924 }; 6925 6926 _proto.dispose = function dispose() { 6927 clearTimeout(this._timeout); 6928 this._timeout = null; 6929 6930 if (this._element.classList.contains(CLASS_NAME_SHOW$7)) { 6931 this._element.classList.remove(CLASS_NAME_SHOW$7); 6932 } 6933 6934 $(this._element).off(EVENT_CLICK_DISMISS$1); 6935 $.removeData(this._element, DATA_KEY$a); 6936 this._element = null; 6937 this._config = null; 6938 } // Private 6939 ; 6940 6941 _proto._getConfig = function _getConfig(config) {
6942 config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$7), $(this._element).data()), typeof config === 'object' && config ? config : {}); 6943 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 6944 return config; 6945 }; 6946 6947 _proto._setListeners = function _setListeners() { 6948 var _this2 = this; 6949 6950 $(this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () { 6951 return _this2.hide(); 6952 }); 6953 }; 6954 6955 _proto._close = function _close() { 6956 var _this3 = this; 6957 6958 var complete = function complete() { 6959 _this3._element.classList.add(CLASS_NAME_HIDE); 6960 6961 $(_this3._element).trigger(EVENT_HIDDEN$4); 6962 }; 6963 6964 this._element.classList.remove(CLASS_NAME_SHOW$7); 6965 6966 if (this._config.animation) { 6967 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6968 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6969 } else { 6970 complete(); 6971 } 6972 } // Static 6973 ; 6974 6975 Toast._jQueryInterface = function _jQueryInterface(config) { 6976 return this.each(function () { 6977 var $element = $(this); 6978 var data = $element.data(DATA_KEY$a); 6979 6980 var _config = typeof config === 'object' && config; 6981 6982 if (!data) { 6983 data = new Toast(this, _config); 6984 $element.data(DATA_KEY$a, data); 6985 } 6986 6987 if (typeof config === 'string') { 6988 if (typeof data[config] === 'undefined') { 6989 throw new TypeError("No method named \"" + config + "\""); 6990 } 6991 6992 data[config](this); 6993 } 6994 }); 6995 }; 6996 6997 _createClass(Toast, null, [{ 6998 key: "VERSION", 6999 get: function get() { 7000 return VERSION$a; 7001 } 7002 }, { 7003 key: "DefaultType", 7004 get: function get() { 7005 return DefaultType$7; 7006 } 7007 }, { 7008 key: "Default", 7009 get: function get() { 7010 return Default$7; 7011 } 7012 }]); 7013 7014 return Toast; 7015 }(); 7016 /** 7017 * ------------------------------------------------------------------------ 7018 * jQuery 7019 * ------------------------------------------------------------------------ 7020 */ 7021 7022 7023 $.fn[NAME$a] = Toast._jQueryInterface; 7024 $.fn[NAME$a].Constructor = Toast; 7025 7026 $.fn[NAME$a].noConflict = function () { 7027 $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 7028 return Toast._jQueryInterface; 7029 }; 7030 7031 exports.Alert = Alert; 7032 exports.Button = Button; 7033 exports.Carousel = Carousel; 7034 exports.Collapse = Collapse; 7035 exports.Dropdown = Dropdown; 7036 exports.Modal = Modal; 7037 exports.Popover = Popover; 7038 exports.Scrollspy = ScrollSpy; 7039 exports.Tab = Tab; 7040 exports.Toast = Toast; 7041 exports.Tooltip = Tooltip; 7042 exports.Util = Util; 7043 7044 Object.defineProperty(exports, '__esModule', { value: true }); 7045 7046}))); 7047//# sourceMappingURL=bootstrap.js.map 7048 7049/* 7050 _ _ _ _ 7051 ___| (_) ___| | __ (_)___ 7052/ __| | |/ __| |/ / | / __| 7053\__ \ | | (__| < _ | \__ \ 7054|___/_|_|\___|_|\_(_)/ |___/ 7055 |__/ 7056 7057 Version: 1.8.1 7058 Author: Ken Wheeler 7059 Website: http://kenwheeler.github.io 7060 Docs: http://kenwheeler.github.io/slick 7061 Repo: http://github.com/kenwheeler/slick 7062 Issues: http://github.com/kenwheeler/slick/issues 7063 7064 */ 7065/* global window, document, define, jQuery, setInterval, clearInterval */ 7066;(function(factory) { 7067 'use strict'; 7068 if (typeof define === 'function' && define.amd) { 7069 define(['jquery'], factory); 7070 } else if (typeof exports !== 'undefined') { 7071 module.exports = factory(require('jquery')); 7072 } else { 7073 factory(jQuery); 7074 } 7075 7076}(function($) { 7077 'use strict'; 7078 var Slick = window.Slick || {}; 7079 7080 Slick = (function() { 7081 7082 var instanceUid = 0; 7083 7084 function Slick(element, settings) { 7085 7086 var _ = this, dataSettings; 7087 7088 _.defaults = { 7089 accessibility: true, 7090 adaptiveHeight: false, 7091 appendArrows: $(element), 7092 appendDots: $(element), 7093 arrows: true, 7094 asNavFor: null, 7095 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 7096 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 7097 autoplay: false, 7098 autoplaySpeed: 3000, 7099 centerMode: false, 7100 centerPadding: '50px', 7101 cssEase: 'ease', 7102 customPaging: function(slider, i) { 7103 return $('<button type="button" />').text(i + 1); 7104 }, 7105 dots: false, 7106 dotsClass: 'slick-dots', 7107 draggable: true, 7108 easing: 'linear', 7109 edgeFriction: 0.35, 7110 fade: false, 7111 focusOnSelect: false, 7112 focusOnChange: false, 7113 infinite: true, 7114 initialSlide: 0, 7115 lazyLoad: 'ondemand', 7116 mobileFirst: false, 7117 pauseOnHover: true, 7118 pauseOnFocus: true, 7119 pauseOnDotsHover: false, 7120 respondTo: 'window', 7121 responsive: null, 7122 rows: 1, 7123 rtl: false, 7124 slide: '', 7125 slidesPerRow: 1, 7126 slidesToShow: 1, 7127 slidesToScroll: 1, 7128 speed: 500, 7129 swipe: true, 7130 swipeToSlide: false, 7131 touchMove: true, 7132 touchThreshold: 5, 7133 useCSS: true, 7134 useTransform: true, 7135 variableWidth: false, 7136 vertical: false, 7137 verticalSwiping: false, 7138 waitForAnimate: true, 7139 zIndex: 1000 7140 }; 7141 7142 _.initials = { 7143 animating: false, 7144 dragging: false, 7145 autoPlayTimer: null, 7146 currentDirection: 0, 7147 currentLeft: null, 7148 currentSlide: 0, 7149 direction: 1, 7150 $dots: null, 7151 listWidth: null, 7152 listHeight: null, 7153 loadIndex: 0, 7154 $nextArrow: null, 7155 $prevArrow: null, 7156 scrolling: false, 7157 slideCount: null, 7158 slideWidth: null, 7159 $slideTrack: null, 7160 $slides: null, 7161 sliding: false, 7162 slideOffset: 0, 7163 swipeLeft: null, 7164 swiping: false, 7165 $list: null, 7166 touchObject: {}, 7167 transformsEnabled: false,
vendor: 6,160 bytes, lines 7168-7360
7168 unslicked: false 7169 }; 7170 7171 $.extend(_, _.initials); 7172 7173 _.activeBreakpoint = null; 7174 _.animType = null; 7175 _.animProp = null; 7176 _.breakpoints = []; 7177 _.breakpointSettings = []; 7178 _.cssTransitions = false; 7179 _.focussed = false; 7180 _.interrupted = false; 7181 _.hidden = 'hidden'; 7182 _.paused = true; 7183 _.positionProp = null; 7184 _.respondTo = null; 7185 _.rowCount = 1; 7186 _.shouldClick = true; 7187 _.$slider = $(element); 7188 _.$slidesCache = null; 7189 _.transformType = null; 7190 _.transitionType = null; 7191 _.visibilityChange = 'visibilitychange'; 7192 _.windowWidth = 0; 7193 _.windowTimer = null; 7194 7195 dataSettings = $(element).data('slick') || {}; 7196 7197 _.options = $.extend({}, _.defaults, settings, dataSettings); 7198 7199 _.currentSlide = _.options.initialSlide; 7200 7201 _.originalSettings = _.options; 7202 7203 if (typeof document.mozHidden !== 'undefined') { 7204 _.hidden = 'mozHidden'; 7205 _.visibilityChange = 'mozvisibilitychange'; 7206 } else if (typeof document.webkitHidden !== 'undefined') { 7207 _.hidden = 'webkitHidden'; 7208 _.visibilityChange = 'webkitvisibilitychange'; 7209 } 7210 7211 _.autoPlay = $.proxy(_.autoPlay, _); 7212 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 7213 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 7214 _.changeSlide = $.proxy(_.changeSlide, _); 7215 _.clickHandler = $.proxy(_.clickHandler, _); 7216 _.selectHandler = $.proxy(_.selectHandler, _); 7217 _.setPosition = $.proxy(_.setPosition, _); 7218 _.swipeHandler = $.proxy(_.swipeHandler, _); 7219 _.dragHandler = $.proxy(_.dragHandler, _); 7220 _.keyHandler = $.proxy(_.keyHandler, _); 7221 7222 _.instanceUid = instanceUid++; 7223 7224 // A simple way to check for HTML strings 7225 // Strict HTML recognition (must start with <) 7226 // Extracted from jQuery v1.11 source 7227 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 7228 7229 7230 _.registerBreakpoints(); 7231 _.init(true); 7232 7233 } 7234 7235 return Slick; 7236 7237 }()); 7238 7239 Slick.prototype.activateADA = function() { 7240 var _ = this; 7241 7242 _.$slideTrack.find('.slick-active').attr({ 7243 'aria-hidden': 'false' 7244 }).find('a, input, button, select').attr({ 7245 'tabindex': '0' 7246 }); 7247 7248 }; 7249 7250 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 7251 7252 var _ = this; 7253 7254 if (typeof(index) === 'boolean') { 7255 addBefore = index; 7256 index = null; 7257 } else if (index < 0 || (index >= _.slideCount)) { 7258 return false; 7259 } 7260 7261 _.unload(); 7262 7263 if (typeof(index) === 'number') { 7264 if (index === 0 && _.$slides.length === 0) { 7265 $(markup).appendTo(_.$slideTrack); 7266 } else if (addBefore) { 7267 $(markup).insertBefore(_.$slides.eq(index)); 7268 } else { 7269 $(markup).insertAfter(_.$slides.eq(index)); 7270 } 7271 } else { 7272 if (addBefore === true) { 7273 $(markup).prependTo(_.$slideTrack); 7274 } else { 7275 $(markup).appendTo(_.$slideTrack); 7276 } 7277 } 7278 7279 _.$slides = _.$slideTrack.children(this.options.slide); 7280 7281 _.$slideTrack.children(this.options.slide).detach(); 7282 7283 _.$slideTrack.append(_.$slides); 7284 7285 _.$slides.each(function(index, element) { 7286 $(element).attr('data-slick-index', index); 7287 }); 7288 7289 _.$slidesCache = _.$slides; 7290 7291 _.reinit(); 7292 7293 }; 7294 7295 Slick.prototype.animateHeight = function() { 7296 var _ = this; 7297 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 7298 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 7299 _.$list.animate({ 7300 height: targetHeight 7301 }, _.options.speed); 7302 } 7303 }; 7304 7305 Slick.prototype.animateSlide = function(targetLeft, callback) { 7306 7307 var animProps = {}, 7308 _ = this; 7309 7310 _.animateHeight(); 7311 7312 if (_.options.rtl === true && _.options.vertical === false) { 7313 targetLeft = -targetLeft; 7314 } 7315 if (_.transformsEnabled === false) { 7316 if (_.options.vertical === false) { 7317 _.$slideTrack.animate({ 7318 left: targetLeft 7319 }, _.options.speed, _.options.easing, callback); 7320 } else { 7321 _.$slideTrack.animate({ 7322 top: targetLeft 7323 }, _.options.speed, _.options.easing, callback); 7324 } 7325 7326 } else { 7327 7328 if (_.cssTransitions === false) { 7329 if (_.options.rtl === true) { 7330 _.currentLeft = -(_.currentLeft); 7331 } 7332 $({ 7333 animStart: _.currentLeft 7334 }).animate({ 7335 animStart: targetLeft 7336 }, { 7337 duration: _.options.speed, 7338 easing: _.options.easing, 7339 step: function(now) { 7340 now = Math.ceil(now); 7341 if (_.options.vertical === false) { 7342 animProps[_.animType] = 'translate(' + 7343 now + 'px, 0px)'; 7344 _.$slideTrack.css(animProps); 7345 } else { 7346 animProps[_.animType] = 'translate(0px,' + 7347 now + 'px)'; 7348 _.$slideTrack.css(animProps); 7349 } 7350 }, 7351 complete: function() { 7352 if (callback) { 7353 callback.call(); 7354 } 7355 } 7356 }); 7357 7358 } else { 7359 7360 _.applyTransition();
7361 targetLeft = Math.ceil(targetLeft); 7362 7363 if (_.options.vertical === false) { 7364 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 7365 } else { 7366 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 7367 } 7368 _.$slideTrack.css(animProps); 7369 7370 if (callback) { 7371 setTimeout(function() { 7372 7373 _.disableTransition(); 7374 7375 callback.call(); 7376 }, _.options.speed); 7377 } 7378 7379 } 7380 7381 } 7382 7383 }; 7384 7385 Slick.prototype.getNavTarget = function() { 7386 7387 var _ = this, 7388 asNavFor = _.options.asNavFor; 7389 7390 if ( asNavFor && asNavFor !== null ) { 7391 asNavFor = $(asNavFor).not(_.$slider); 7392 } 7393 7394 return asNavFor; 7395 7396 }; 7397 7398 Slick.prototype.asNavFor = function(index) { 7399 7400 var _ = this, 7401 asNavFor = _.getNavTarget(); 7402 7403 if ( asNavFor !== null && typeof asNavFor === 'object' ) { 7404 asNavFor.each(function() { 7405 var target = $(this).slick('getSlick'); 7406 if(!target.unslicked) { 7407 target.slideHandler(index, true); 7408 } 7409 }); 7410 } 7411 7412 }; 7413 7414 Slick.prototype.applyTransition = function(slide) { 7415 7416 var _ = this, 7417 transition = {}; 7418 7419 if (_.options.fade === false) { 7420 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 7421 } else { 7422 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 7423 } 7424 7425 if (_.options.fade === false) { 7426 _.$slideTrack.css(transition); 7427 } else { 7428 _.$slides.eq(slide).css(transition); 7429 } 7430 7431 }; 7432 7433 Slick.prototype.autoPlay = function() { 7434 7435 var _ = this; 7436 7437 _.autoPlayClear(); 7438 7439 if ( _.slideCount > _.options.slidesToShow ) { 7440 _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); 7441 } 7442 7443 }; 7444 7445 Slick.prototype.autoPlayClear = function() { 7446 7447 var _ = this; 7448 7449 if (_.autoPlayTimer) { 7450 clearInterval(_.autoPlayTimer); 7451 } 7452 7453 }; 7454 7455 Slick.prototype.autoPlayIterator = function() { 7456 7457 var _ = this, 7458 slideTo = _.currentSlide + _.options.slidesToScroll; 7459 7460 if ( !_.paused && !_.interrupted && !_.focussed ) { 7461 7462 if ( _.options.infinite === false ) { 7463 7464 if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { 7465 _.direction = 0; 7466 } 7467 7468 else if ( _.direction === 0 ) { 7469 7470 slideTo = _.currentSlide - _.options.slidesToScroll; 7471 7472 if ( _.currentSlide - 1 === 0 ) { 7473 _.direction = 1; 7474 } 7475 7476 } 7477 7478 } 7479 7480 _.slideHandler( slideTo ); 7481 7482 } 7483 7484 }; 7485 7486 Slick.prototype.buildArrows = function() { 7487 7488 var _ = this; 7489 7490 if (_.options.arrows === true ) { 7491 7492 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 7493 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 7494 7495 if( _.slideCount > _.options.slidesToShow ) { 7496 7497 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 7498 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 7499 7500 if (_.htmlExpr.test(_.options.prevArrow)) { 7501 _.$prevArrow.prependTo(_.options.appendArrows); 7502 } 7503 7504 if (_.htmlExpr.test(_.options.nextArrow)) { 7505 _.$nextArrow.appendTo(_.options.appendArrows); 7506 } 7507 7508 if (_.options.infinite !== true) { 7509 _.$prevArrow 7510 .addClass('slick-disabled') 7511 .attr('aria-disabled', 'true'); 7512 } 7513 7514 } else { 7515 7516 _.$prevArrow.add( _.$nextArrow ) 7517 7518 .addClass('slick-hidden') 7519 .attr({ 7520 'aria-disabled': 'true', 7521 'tabindex': '-1' 7522 }); 7523 7524 } 7525 7526 } 7527 7528 }; 7529 7530 Slick.prototype.buildDots = function() { 7531 7532 var _ = this, 7533 i, dot; 7534 7535 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 7536 7537 _.$slider.addClass('slick-dotted'); 7538 7539 dot = $('<ul />').addClass(_.options.dotsClass); 7540 7541 for (i = 0; i <= _.getDotCount(); i += 1) { 7542 dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); 7543 } 7544 7545 _.$dots = dot.appendTo(_.options.appendDots); 7546 7547 _.$dots.find('li').first().addClass('slick-active'); 7548 7549 } 7550 7551 }; 7552 7553 Slick.prototype.buildOut = function() { 7554 7555 var _ = this; 7556 7557 _.$slides = 7558 _.$slider 7559 .children( _.options.slide + ':not(.slick-cloned)') 7560 .addClass('slick-slide'); 7561 7562 _.slideCount = _.$slides.length; 7563 7564 _.$slides.each(function(index, element) { 7565 $(element) 7566 .attr('data-slick-index', index) 7567 .data('originalStyling', $(element).attr('style') || ''); 7568 }); 7569 7570 _.$slider.addClass('slick-slider'); 7571 7572 _.$slideTrack = (_.slideCount === 0) ? 7573 $('<div class="slick-track"/>').appendTo(_.$slider) : 7574 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 7575 7576 _.$list = _.$slideTrack.wrap( 7577 '<div class="slick-list"/>').parent(); 7578 _.$slideTrack.css('opacity', 0); 7579 7580 if (_.options.centerMode === true || _.options.swipeToSlide === true) {
7581 _.options.slidesToScroll = 1; 7582 } 7583 7584 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 7585 7586 _.setupInfinite(); 7587 7588 _.buildArrows(); 7589 7590 _.buildDots(); 7591 7592 _.updateDots(); 7593 7594 7595 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 7596 7597 if (_.options.draggable === true) { 7598 _.$list.addClass('draggable'); 7599 } 7600 7601 }; 7602 7603 Slick.prototype.buildRows = function() { 7604 7605 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; 7606 7607 newSlides = document.createDocumentFragment(); 7608 originalSlides = _.$slider.children(); 7609 7610 if(_.options.rows > 0) { 7611 7612 slidesPerSection = _.options.slidesPerRow * _.options.rows; 7613 numOfSlides = Math.ceil( 7614 originalSlides.length / slidesPerSection 7615 ); 7616 7617 for(a = 0; a < numOfSlides; a++){ 7618 var slide = document.createElement('div'); 7619 for(b = 0; b < _.options.rows; b++) { 7620 var row = document.createElement('div'); 7621 for(c = 0; c < _.options.slidesPerRow; c++) { 7622 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 7623 if (originalSlides.get(target)) { 7624 row.appendChild(originalSlides.get(target)); 7625 } 7626 } 7627 slide.appendChild(row); 7628 } 7629 newSlides.appendChild(slide); 7630 } 7631 7632 _.$slider.empty().append(newSlides); 7633 _.$slider.children().children().children() 7634 .css({ 7635 'width':(100 / _.options.slidesPerRow) + '%', 7636 'display': 'inline-block' 7637 }); 7638 7639 } 7640 7641 }; 7642 7643 Slick.prototype.checkResponsive = function(initial, forceUpdate) { 7644 7645 var _ = this, 7646 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 7647 var sliderWidth = _.$slider.width(); 7648 var windowWidth = window.innerWidth || $(window).width(); 7649 7650 if (_.respondTo === 'window') { 7651 respondToWidth = windowWidth; 7652 } else if (_.respondTo === 'slider') { 7653 respondToWidth = sliderWidth; 7654 } else if (_.respondTo === 'min') { 7655 respondToWidth = Math.min(windowWidth, sliderWidth); 7656 } 7657 7658 if ( _.options.responsive && 7659 _.options.responsive.length && 7660 _.options.responsive !== null) { 7661 7662 targetBreakpoint = null; 7663 7664 for (breakpoint in _.breakpoints) { 7665 if (_.breakpoints.hasOwnProperty(breakpoint)) { 7666 if (_.originalSettings.mobileFirst === false) { 7667 if (respondToWidth < _.breakpoints[breakpoint]) { 7668 targetBreakpoint = _.breakpoints[breakpoint]; 7669 } 7670 } else { 7671 if (respondToWidth > _.breakpoints[breakpoint]) { 7672 targetBreakpoint = _.breakpoints[breakpoint]; 7673 } 7674 } 7675 } 7676 } 7677 7678 if (targetBreakpoint !== null) { 7679 if (_.activeBreakpoint !== null) { 7680 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 7681 _.activeBreakpoint = 7682 targetBreakpoint; 7683 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 7684 _.unslick(targetBreakpoint); 7685 } else { 7686 _.options = $.extend({}, _.originalSettings, 7687 _.breakpointSettings[ 7688 targetBreakpoint]); 7689 if (initial === true) { 7690 _.currentSlide = _.options.initialSlide; 7691 } 7692 _.refresh(initial); 7693 }
7694 triggerBreakpoint = targetBreakpoint; 7695 } 7696 } else { 7697 _.activeBreakpoint = targetBreakpoint; 7698 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 7699 _.unslick(targetBreakpoint); 7700 } else { 7701 _.options = $.extend({}, _.originalSettings, 7702 _.breakpointSettings[ 7703 targetBreakpoint]); 7704 if (initial === true) { 7705 _.currentSlide = _.options.initialSlide; 7706 } 7707 _.refresh(initial); 7708 } 7709 triggerBreakpoint = targetBreakpoint; 7710 } 7711 } else { 7712 if (_.activeBreakpoint !== null) { 7713 _.activeBreakpoint = null; 7714 _.options = _.originalSettings; 7715 if (initial === true) { 7716 _.currentSlide = _.options.initialSlide; 7717 } 7718 _.refresh(initial); 7719 triggerBreakpoint = targetBreakpoint; 7720 } 7721 } 7722 7723 // only trigger breakpoints during an actual break. not on initialize. 7724 if( !initial && triggerBreakpoint !== false ) { 7725 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 7726 } 7727 } 7728 7729 }; 7730 7731 Slick.prototype.changeSlide = function(event, dontAnimate) { 7732 7733 var _ = this, 7734 $target = $(event.currentTarget), 7735 indexOffset, slideOffset, unevenOffset; 7736 7737 // If target is a link, prevent default action. 7738 if($target.is('a')) { 7739 event.preventDefault(); 7740 } 7741 7742 // If target is not the <li> element (ie: a child), find the <li>. 7743 if(!$target.is('li')) { 7744 $target = $target.closest('li'); 7745 } 7746 7747 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 7748 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 7749 7750 switch (event.data.message) { 7751 7752 case 'previous': 7753 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 7754 if (_.slideCount > _.options.slidesToShow) { 7755 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 7756 } 7757 break; 7758 7759 case 'next': 7760 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 7761 if (_.slideCount > _.options.slidesToShow) { 7762 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 7763 } 7764 break; 7765 7766 case 'index': 7767 var index = event.data.index === 0 ? 0 : 7768 event.data.index || $target.index() * _.options.slidesToScroll; 7769 7770 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 7771 $target.children().trigger('focus'); 7772 break; 7773 7774 default: 7775 return; 7776 } 7777 7778 }; 7779 7780 Slick.prototype.checkNavigable = function(index) { 7781 7782 var _ = this, 7783 navigables, prevNavigable; 7784 7785 navigables = _.getNavigableIndexes(); 7786 prevNavigable = 0; 7787 if (index > navigables[navigables.length - 1]) { 7788 index = navigables[navigables.length - 1]; 7789 } else { 7790 for (var n in navigables) { 7791 if (index < navigables[n]) { 7792 index = prevNavigable; 7793 break; 7794 } 7795 prevNavigable = navigables[n]; 7796 } 7797 } 7798 7799 return index; 7800 }; 7801 7802 Slick.prototype.cleanUpEvents = function() { 7803 7804 var _ = this; 7805 7806 if (_.options.dots && _.$dots !== null) { 7807 7808 $('li', _.$dots) 7809 .off('click.slick', _.changeSlide) 7810 .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) 7811 .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 7812 7813 if (_.options.accessibility === true) { 7814 _.$dots.off('keydown.slick', _.keyHandler); 7815 } 7816 } 7817 7818 _.$slider.off('focus.slick blur.slick'); 7819 7820 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 7821 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 7822 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 7823 7824 if (_.options.accessibility === true) { 7825 _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); 7826 _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); 7827 } 7828 } 7829 7830 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 7831 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 7832 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
vendor: 5,094 bytes, lines 7833-8040
7833 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 7834 7835 _.$list.off('click.slick', _.clickHandler); 7836 7837 $(document).off(_.visibilityChange, _.visibility); 7838 7839 _.cleanUpSlideEvents(); 7840 7841 if (_.options.accessibility === true) { 7842 _.$list.off('keydown.slick', _.keyHandler); 7843 } 7844 7845 if (_.options.focusOnSelect === true) { 7846 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 7847 } 7848 7849 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 7850 7851 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 7852 7853 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 7854 7855 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 7856 7857 }; 7858 7859 Slick.prototype.cleanUpSlideEvents = function() { 7860 7861 var _ = this; 7862 7863 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 7864 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 7865 7866 }; 7867 7868 Slick.prototype.cleanUpRows = function() { 7869 7870 var _ = this, originalSlides; 7871 7872 if(_.options.rows > 0) { 7873 originalSlides = _.$slides.children().children(); 7874 originalSlides.removeAttr('style'); 7875 _.$slider.empty().append(originalSlides); 7876 } 7877 7878 }; 7879 7880 Slick.prototype.clickHandler = function(event) { 7881 7882 var _ = this; 7883 7884 if (_.shouldClick === false) { 7885 event.stopImmediatePropagation(); 7886 event.stopPropagation(); 7887 event.preventDefault(); 7888 } 7889 7890 }; 7891 7892 Slick.prototype.destroy = function(refresh) { 7893 7894 var _ = this; 7895 7896 _.autoPlayClear(); 7897 7898 _.touchObject = {}; 7899 7900 _.cleanUpEvents(); 7901 7902 $('.slick-cloned', _.$slider).detach(); 7903 7904 if (_.$dots) { 7905 _.$dots.remove(); 7906 } 7907 7908 if ( _.$prevArrow && _.$prevArrow.length ) { 7909 7910 _.$prevArrow 7911 .removeClass('slick-disabled slick-arrow slick-hidden') 7912 .removeAttr('aria-hidden aria-disabled tabindex') 7913 .css('display',''); 7914 7915 if ( _.htmlExpr.test( _.options.prevArrow )) { 7916 _.$prevArrow.remove(); 7917 } 7918 } 7919 7920 if ( _.$nextArrow && _.$nextArrow.length ) { 7921 7922 _.$nextArrow 7923 .removeClass('slick-disabled slick-arrow slick-hidden') 7924 .removeAttr('aria-hidden aria-disabled tabindex') 7925 .css('display',''); 7926 7927 if ( _.htmlExpr.test( _.options.nextArrow )) { 7928 _.$nextArrow.remove(); 7929 } 7930 } 7931 7932 7933 if (_.$slides) { 7934 7935 _.$slides 7936 .removeClass('slick-slide slick-active slick-center slick-visible slick-current') 7937 .removeAttr('aria-hidden') 7938 .removeAttr('data-slick-index') 7939 .each(function(){ 7940 $(this).attr('style', $(this).data('originalStyling')); 7941 }); 7942 7943 _.$slideTrack.children(this.options.slide).detach(); 7944 7945 _.$slideTrack.detach(); 7946 7947 _.$list.detach(); 7948 7949 _.$slider.append(_.$slides); 7950 } 7951 7952 _.cleanUpRows(); 7953 7954 _.$slider.removeClass('slick-slider'); 7955 _.$slider.removeClass('slick-initialized'); 7956 _.$slider.removeClass('slick-dotted'); 7957 7958 _.unslicked = true; 7959 7960 if(!refresh) { 7961 _.$slider.trigger('destroy', [_]); 7962 } 7963 7964 }; 7965 7966 Slick.prototype.disableTransition = function(slide) { 7967 7968 var _ = this, 7969 transition = {}; 7970 7971 transition[_.transitionType] = ''; 7972 7973 if (_.options.fade === false) { 7974 _.$slideTrack.css(transition); 7975 } else { 7976 _.$slides.eq(slide).css(transition); 7977 } 7978 7979 }; 7980 7981 Slick.prototype.fadeSlide = function(slideIndex, callback) { 7982 7983 var _ = this; 7984 7985 if (_.cssTransitions === false) { 7986 7987 _.$slides.eq(slideIndex).css({ 7988 zIndex: _.options.zIndex 7989 }); 7990 7991 _.$slides.eq(slideIndex).animate({ 7992 opacity: 1 7993 }, _.options.speed, _.options.easing, callback); 7994 7995 } else { 7996 7997 _.applyTransition(slideIndex); 7998 7999 _.$slides.eq(slideIndex).css({ 8000 opacity: 1, 8001 zIndex: _.options.zIndex 8002 }); 8003 8004 if (callback) { 8005 setTimeout(function() { 8006 8007 _.disableTransition(slideIndex); 8008 8009 callback.call(); 8010 }, _.options.speed); 8011 } 8012 8013 } 8014 8015 }; 8016 8017 Slick.prototype.fadeSlideOut = function(slideIndex) { 8018 8019 var _ = this; 8020 8021 if (_.cssTransitions === false) { 8022 8023 _.$slides.eq(slideIndex).animate({ 8024 opacity: 0, 8025 zIndex: _.options.zIndex - 2 8026 }, _.options.speed, _.options.easing); 8027 8028 } else { 8029 8030 _.applyTransition(slideIndex); 8031 8032 _.$slides.eq(slideIndex).css({ 8033 opacity: 0, 8034 zIndex: _.options.zIndex - 2 8035 }); 8036 8037 } 8038 8039 }; 8040
8041 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 8042 8043 var _ = this; 8044 8045 if (filter !== null) { 8046 8047 _.$slidesCache = _.$slides; 8048 8049 _.unload(); 8050 8051 _.$slideTrack.children(this.options.slide).detach(); 8052 8053 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 8054 8055 _.reinit(); 8056 8057 } 8058 8059 }; 8060 8061 Slick.prototype.focusHandler = function() { 8062 8063 var _ = this; 8064 8065 _.$slider 8066 .off('focus.slick blur.slick') 8067 .on('focus.slick blur.slick', '*', function(event) { 8068 8069 event.stopImmediatePropagation(); 8070 var $sf = $(this); 8071 8072 setTimeout(function() { 8073 8074 if( _.options.pauseOnFocus ) { 8075 _.focussed = $sf.is(':focus'); 8076 _.autoPlay(); 8077 } 8078 8079 }, 0); 8080 8081 }); 8082 }; 8083 8084 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 8085 8086 var _ = this; 8087 return _.currentSlide; 8088 8089 }; 8090 8091 Slick.prototype.getDotCount = function() { 8092 8093 var _ = this; 8094 8095 var breakPoint = 0; 8096 var counter = 0; 8097 var pagerQty = 0; 8098 8099 if (_.options.infinite === true) { 8100 if (_.slideCount <= _.options.slidesToShow) { 8101 ++pagerQty; 8102 } else { 8103 while (breakPoint < _.slideCount) { 8104 ++pagerQty; 8105 breakPoint = counter + _.options.slidesToScroll; 8106 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 8107 } 8108 } 8109 } else if (_.options.centerMode === true) { 8110 pagerQty = _.slideCount; 8111 } else if(!_.options.asNavFor) { 8112 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 8113 }else { 8114 while (breakPoint < _.slideCount) { 8115 ++pagerQty; 8116 breakPoint = counter + _.options.slidesToScroll; 8117 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 8118 } 8119 } 8120 8121 return pagerQty - 1; 8122 8123 }; 8124 8125 Slick.prototype.getLeft = function(slideIndex) { 8126 8127 var _ = this, 8128 targetLeft, 8129 verticalHeight, 8130 verticalOffset = 0, 8131 targetSlide, 8132 coef; 8133 8134 _.slideOffset = 0; 8135 verticalHeight = _.$slides.first().outerHeight(true); 8136 8137 if (_.options.infinite === true) { 8138 if (_.slideCount > _.options.slidesToShow) { 8139 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 8140 coef = -1 8141 8142 if (_.options.vertical === true && _.options.centerMode === true) { 8143 if (_.options.slidesToShow === 2) { 8144 coef = -1.5; 8145 } else if (_.options.slidesToShow === 1) { 8146 coef = -2 8147 } 8148 } 8149 verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; 8150 } 8151 if (_.slideCount % _.options.slidesToScroll !== 0) { 8152 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 8153 if (slideIndex > _.slideCount) { 8154 _.slideOffset = ((_.options.slidesToShow - (sl
8154ideIndex - _.slideCount)) * _.slideWidth) * -1; 8155 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 8156 } else { 8157 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 8158 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 8159 } 8160 } 8161 } 8162 } else { 8163 if (slideIndex + _.options.slidesToShow > _.slideCount) { 8164 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 8165 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 8166 } 8167 } 8168 8169 if (_.slideCount <= _.options.slidesToShow) { 8170 _.slideOffset = 0; 8171 verticalOffset = 0; 8172 } 8173 8174 if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { 8175 _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); 8176 } else if (_.options.centerMode === true && _.options.infinite === true) { 8177 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 8178 } else if (_.options.centerMode === true) { 8179 _.slideOffset = 0; 8180 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 8181 } 8182 8183 if (_.options.vertical === false) { 8184 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 8185 } else { 8186 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 8187 } 8188 8189 if (_.options.variableWidth === true) { 8190
8191 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 8192 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 8193 } else { 8194 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 8195 } 8196 8197 if (_.options.rtl === true) { 8198 if (targetSlide[0]) { 8199 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 8200 } else { 8201 targetLeft = 0; 8202 } 8203 } else { 8204 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 8205 } 8206 8207 if (_.options.centerMode === true) { 8208 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 8209 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 8210 } else { 8211 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 8212 } 8213 8214 if (_.options.rtl === true) { 8215 if (targetSlide[0]) { 8216 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 8217 } else { 8218 targetLeft = 0; 8219 } 8220 } else { 8221 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 8222 } 8223 8224 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 8225 } 8226 } 8227 8228 return targetLeft; 8229 8230 }; 8231 8232 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 8233 8234 var _ = this; 8235 8236 return _.options[option]; 8237 8238 }; 8239 8240 Slick.prototype.getNavigableIndexes = function() { 8241 8242 var _ = this, 8243 breakPoint = 0, 8244 counter = 0, 8245 indexes = [], 8246 max; 8247 8248 if (_.options.infinite === false) { 8249 max = _.slideCount; 8250 } else { 8251 breakPoint = _.options.slidesToScroll * -1; 8252 counter = _.options.slidesToScroll * -1; 8253 max = _.slideCount * 2; 8254 } 8255 8256 while (breakPoint < max) { 8257 indexes.push(breakPoint); 8258 breakPoint = counter + _.options.slidesToScroll; 8259 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 8260 } 8261 8262 return indexes; 8263 8264 }; 8265 8266 Slick.prototype.getSlick = function() { 8267 8268 return this; 8269 8270 }; 8271 8272 Slick.prototype.getSlideCount = function() { 8273 8274 var _ = this, 8275 slidesTraversed, swipedSlide, centerOffset; 8276 8277 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 8278 8279 if (_.options.swipeToSlide === true) { 8280 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 8281 if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { 8282 swipedSlide = slide; 8283 return false; 8284 } 8285 }); 8286 8287 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 8288 8289 return slidesTraversed; 8290 8291 } else { 8292 return _.options.slidesToScroll; 8293 } 8294 8295 }; 8296 8297 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 8298 8299 var _ = this; 8300 8301 _.changeSlide({ 8302 data: { 8303 message: 'index', 8304 index: parseInt(slide) 8305 } 8306 }, dontAnimate); 8307 8308 }; 8309 8310 Slick.prototype.init = function(creation) { 8311 8312 var _ = this; 8313 8314 if (!$(_.$slider).hasClass('slick-initialized')) { 8315 8316 $(_.$slider).addClass('slick-initialized'); 8317 8318 _.buildRows(); 8319 _.buildOut(); 8320 _.setProps(); 8321 _.startLoad(); 8322 _.loadSlider(); 8323 _.initializeEvents(); 8324 _.updateArrows(); 8325 _.updateDots(); 8326 _.checkResponsive(true); 8327 _.focusHandler(); 8328 8329 } 8330 8331 if (creation) { 8332 _.$slider.trigger('init', [_]); 8333 } 8334 8335 if (_.options.accessibility === true) { 8336 _.initADA(); 8337 } 8338 8339 if ( _.options.autoplay ) { 8340 8341 _.paused = false;
8342 _.autoPlay(); 8343 8344 } 8345 8346 }; 8347 8348 Slick.prototype.initADA = function() { 8349 var _ = this, 8350 numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), 8351 tabControlIndexes = _.getNavigableIndexes().filter(function(val) { 8352 return (val >= 0) && (val < _.slideCount); 8353 }); 8354 8355 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 8356 'aria-hidden': 'true', 8357 'tabindex': '-1' 8358 }).find('a, input, button, select').attr({ 8359 'tabindex': '-1' 8360 }); 8361 8362 if (_.$dots !== null) { 8363 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { 8364 var slideControlIndex = tabControlIndexes.indexOf(i); 8365 8366 $(this).attr({ 8367 'role': 'tabpanel', 8368 'id': 'slick-slide' + _.instanceUid + i, 8369 'tabindex': -1 8370 }); 8371 8372 if (slideControlIndex !== -1) { 8373 var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex 8374 if ($('#' + ariaButtonControl).length) { 8375 $(this).attr({ 8376 'aria-describedby': ariaButtonControl 8377 }); 8378 } 8379 } 8380 }); 8381 8382 _.$dots.attr('role', 'tablist').find('li').each(function(i) { 8383 var mappedSlideIndex = tabControlIndexes[i]; 8384 8385 $(this).attr({ 8386 'role': 'presentation' 8387 }); 8388 8389 $(this).find('button').first().attr({ 8390 'role': 'tab', 8391 'id': 'slick-slide-control' + _.instanceUid + i, 8392 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 8393 'aria-label': (i + 1) + ' of ' + numDotGroups, 8394 'aria-selected': null, 8395 'tabindex': '-1' 8396 }); 8397 8398 }).eq(_.currentSlide).find('button').attr({ 8399 'aria-selected': 'true', 8400 'tabindex': '0' 8401 }).end(); 8402 } 8403 8404 for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { 8405 if (_.options.focusOnChange) { 8406 _.$slides.eq(i).attr({'tabindex': '0'}); 8407 } else { 8408 _.$slides.eq(i).removeAttr('tabindex'); 8409 } 8410 } 8411 8412 _.activateADA(); 8413 8414 }; 8415 8416 Slick.prototype.initArrowEvents = function() { 8417 8418 var _ = this; 8419 8420 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 8421 _.$prevArrow 8422 .off('click.slick') 8423 .on('click.slick', { 8424 message: 'previous' 8425 }, _.changeSlide); 8426 _.$nextArrow 8427 .off('click.slick') 8428 .on('click.slick', { 8429 message: 'next' 8430 }, _.changeSlide); 8431 8432 if (_.options.accessibility === true) { 8433 _.$prevArrow.on('keydown.slick', _.keyHandler); 8434 _.$nextArrow.on('keydown.slick', _.keyHandler); 8435 } 8436 } 8437 8438 }; 8439 8440 Slick.prototype.initDotEvents = function() { 8441 8442 var _ = this; 8443 8444 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 8445 $('li', _.$dots).on('click.slick', { 8446 message: 'index' 8447 }, _.changeSlide); 8448 8449 if (_.options.accessibility === true) { 8450 _.$dots.on('keydown.slick', _.keyHandler); 8451 } 8452 } 8453 8454 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { 8455 8456 $('li', _.$dots) 8457 .on('mouseenter.slick', $.proxy(_.interrupt, _, true)) 8458 .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 8459 8460 } 8461 8462 }; 8463 8464 Slick.prototype.initSlideEvents = function() { 8465 8466 var _ = this; 8467 8468 if ( _.options.pauseOnHover ) { 8469 8470 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
vendor: 5,107 bytes, lines 8471-8630
8471 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 8472 8473 } 8474 8475 }; 8476 8477 Slick.prototype.initializeEvents = function() { 8478 8479 var _ = this; 8480 8481 _.initArrowEvents(); 8482 8483 _.initDotEvents(); 8484 _.initSlideEvents(); 8485 8486 _.$list.on('touchstart.slick mousedown.slick', { 8487 action: 'start' 8488 }, _.swipeHandler); 8489 _.$list.on('touchmove.slick mousemove.slick', { 8490 action: 'move' 8491 }, _.swipeHandler); 8492 _.$list.on('touchend.slick mouseup.slick', { 8493 action: 'end' 8494 }, _.swipeHandler); 8495 _.$list.on('touchcancel.slick mouseleave.slick', { 8496 action: 'end' 8497 }, _.swipeHandler); 8498 8499 _.$list.on('click.slick', _.clickHandler); 8500 8501 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 8502 8503 if (_.options.accessibility === true) { 8504 _.$list.on('keydown.slick', _.keyHandler); 8505 } 8506 8507 if (_.options.focusOnSelect === true) { 8508 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 8509 } 8510 8511 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 8512 8513 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 8514 8515 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 8516 8517 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 8518 $(_.setPosition); 8519 8520 }; 8521 8522 Slick.prototype.initUI = function() { 8523 8524 var _ = this; 8525 8526 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 8527 8528 _.$prevArrow.show(); 8529 _.$nextArrow.show(); 8530 8531 } 8532 8533 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 8534 8535 _.$dots.show(); 8536 8537 } 8538 8539 }; 8540 8541 Slick.prototype.keyHandler = function(event) { 8542 8543 var _ = this; 8544 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 8545 if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 8546 if (event.keyCode === 37 && _.options.accessibility === true) { 8547 _.changeSlide({ 8548 data: { 8549 message: _.options.rtl === true ? 'next' : 'previous' 8550 } 8551 }); 8552 } else if (event.keyCode === 39 && _.options.accessibility === true) { 8553 _.changeSlide({ 8554 data: { 8555 message: _.options.rtl === true ? 'previous' : 'next' 8556 } 8557 }); 8558 } 8559 } 8560 8561 }; 8562 8563 Slick.prototype.lazyLoad = function() { 8564 8565 var _ = this, 8566 loadRange, cloneRange, rangeStart, rangeEnd; 8567 8568 function loadImages(imagesScope) { 8569 8570 $('img[data-lazy]', imagesScope).each(function() { 8571 8572 var image = $(this), 8573 imageSource = $(this).attr('data-lazy'), 8574 imageSrcSet = $(this).attr('data-srcset'), 8575 imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), 8576 imageToLoad = document.createElement('img'); 8577 8578 imageToLoad.onload = function() { 8579 8580 image 8581 .animate({ opacity: 0 }, 100, function() { 8582 8583 if (imageSrcSet) { 8584 image 8585 .attr('srcset', imageSrcSet ); 8586 8587 if (imageSizes) { 8588 image 8589 .attr('sizes', imageSizes ); 8590 } 8591 } 8592 8593 image 8594 .attr('src', imageSource) 8595 .animate({ opacity: 1 }, 200, function() { 8596 image 8597 .removeAttr('data-lazy data-srcset data-sizes') 8598 .removeClass('slick-loading'); 8599 }); 8600 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 8601 }); 8602 8603 }; 8604 8605 imageToLoad.onerror = function() { 8606 8607 image 8608 .removeAttr( 'data-lazy' ) 8609 .removeClass( 'slick-loading' ) 8610 .addClass( 'slick-lazyload-error' ); 8611 8612 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 8613 8614 }; 8615 8616 imageToLoad.src = imageSource; 8617 8618 }); 8619 8620 } 8621 8622 if (_.options.centerMode === true) { 8623 if (_.options.infinite === true) { 8624 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 8625 rangeEnd = rangeStart + _.options.slidesToShow + 2; 8626 } else { 8627 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 8628 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 8629 } 8630 } else {
8631 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 8632 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 8633 if (_.options.fade === true) { 8634 if (rangeStart > 0) rangeStart--; 8635 if (rangeEnd <= _.slideCount) rangeEnd++; 8636 } 8637 } 8638 8639 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 8640 8641 if (_.options.lazyLoad === 'anticipated') { 8642 var prevSlide = rangeStart - 1, 8643 nextSlide = rangeEnd, 8644 $slides = _.$slider.find('.slick-slide'); 8645 8646 for (var i = 0; i < _.options.slidesToScroll; i++) { 8647 if (prevSlide < 0) prevSlide = _.slideCount - 1; 8648 loadRange = loadRange.add($slides.eq(prevSlide)); 8649 loadRange = loadRange.add($slides.eq(nextSlide)); 8650 prevSlide--; 8651 nextSlide++; 8652 } 8653 } 8654 8655 loadImages(loadRange); 8656 8657 if (_.slideCount <= _.options.slidesToShow) { 8658 cloneRange = _.$slider.find('.slick-slide'); 8659 loadImages(cloneRange); 8660 } else 8661 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 8662 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 8663 loadImages(cloneRange); 8664 } else if (_.currentSlide === 0) { 8665 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 8666 loadImages(cloneRange); 8667 } 8668 8669 }; 8670 8671 Slick.prototype.loadSlider = function() { 8672 8673 var _ = this; 8674 8675 _.setPosition(); 8676 8677 _.$slideTrack.css({ 8678 opacity: 1 8679 }); 8680 8681 _.$slider.removeClass('slick-loading'); 8682 8683 _.initUI(); 8684 8685 if (_.options.lazyLoad === 'progressive') { 8686 _.progressiveLazyLoad(); 8687 } 8688 8689 }; 8690 8691 Slick.prototype.next = Slick.prototype.slickNext = function() { 8692 8693 var _ = this; 8694 8695 _.changeSlide({ 8696 data: { 8697 message: 'next' 8698 } 8699 }); 8700 8701 }; 8702 8703 Slick.prototype.orientationChange = function() { 8704 8705 var _ = this; 8706 8707 _.checkResponsive(); 8708 _.setPosition(); 8709 8710 }; 8711 8712 Slick.prototype.pause = Slick.prototype.slickPause = function() { 8713 8714 var _ = this; 8715 8716 _.autoPlayClear(); 8717 _.paused = true; 8718 8719 }; 8720 8721 Slick.prototype.play = Slick.prototype.slickPlay = function() { 8722 8723 var _ = this; 8724 8725 _.autoPlay(); 8726 _.options.autoplay = true; 8727 _.paused = false; 8728 _.focussed = false; 8729 _.interrupted = false; 8730 8731 }; 8732 8733 Slick.prototype.postSlide = function(index) { 8734 8735 var _ = this; 8736 8737 if( !_.unslicked ) { 8738 8739 _.$slider.trigger('afterChange', [_, index]); 8740 8741 _.animating = false; 8742 8743 if (_.slideCount > _.options.slidesToShow) { 8744 _.setPosition(); 8745 } 8746 8747 _.swipeLeft = null; 8748 8749 if ( _.options.autoplay ) { 8750 _.autoPlay(); 8751 } 8752 8753 if (_.options.accessibility === true) { 8754 _.initADA(); 8755 8756 if (_.options.focusOnChange) { 8757 var $currentSlide = $(_.$slides.get(_.currentSlide)); 8758 $currentSlide.attr('tabindex', 0).focus(); 8759 } 8760 } 8761 8762 } 8763 8764 }; 8765 8766 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 8767 8768 var _ = this; 8769 8770 _.changeSlide({ 8771 data: { 8772 message: 'previous' 8773 } 8774 }); 8775 8776 }; 8777 8778 Slick.prototype.preventDefault = function(event) { 8779 8780 event.preventDefault(); 8781 8782 }; 8783 8784 Slick.prototype.progressiveLazyLoad = function( tryCount ) { 8785 8786 tryCount = tryCount || 1; 8787 8788 var _ = this, 8789 $imgsToLoad = $( 'img[data-lazy]', _.$slider ), 8790 image, 8791 imageSource, 8792 imageSrcSet, 8793 imageSizes, 8794 imageToLoad; 8795 8796 if ( $imgsToLoad.length ) { 8797 8798 image = $imgsToLoad.first(); 8799 imageSource = image.attr('data-lazy'); 8800 imageSrcSet = image.attr('data-srcset'); 8801 imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); 8802 imageToLoad = document.createElement('img'); 8803 8804 imageToLoad.onload = function() { 8805 8806 if (imageSrcSet) { 8807 image 8808 .attr('srcset', imageSrcSet ); 8809 8810 if (imageSizes) { 8811 image 8812 .attr('sizes', imageSizes ); 8813 } 8814 } 8815 8816 image 8817 .attr( 'src', imageSource ) 8818 .removeAttr('data-lazy data-srcset data-sizes') 8819 .removeClass('slick-loading'); 8820 8821 if ( _.options.adaptiveHeight === true ) { 8822 _.setPosition(); 8823 } 8824 8825 _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); 8826 _.progressiveLazyLoad(); 8827 8828 }; 8829 8830 imageToLoad.onerror = function() { 8831 8832 if ( tryCount < 3 ) { 8833 8834 /** 8835 * try to load the image 3 times, 8836 * leave a slight delay so we don't get 8837 * servers blocking the request. 8838 */ 8839 setTimeout( function() { 8840 _.progressiveLazyLoad( tryCount + 1 ); 8841 }, 500 ); 8842 8843 } else { 8844 8845 image 8846 .removeAttr( 'data-lazy' ) 8847 .removeClass( 'slick-loading' ) 8848 .addClass( 'slick-lazyload-error' ); 8849 8850 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 8851 8852 _.progressiveLazyLoad(); 8853 8854 } 8855 8856 }; 8857 8858 imageToLoad.src = imageSource; 8859 8860 } else { 8861 8862 _.$slider.trigger('allImagesLoaded', [ _ ]); 8863 8864 } 8865 8866 }; 8867 8868 Slick.prototype.refresh = function( initializing ) { 8869 8870 var _ = this, currentSlide, lastVisibleIndex; 8871 8872 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 8873 8874 // in non-infinite sliders, we don't want to go past the 8875 // last visible index. 8876 if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { 8877 _.currentSlide = lastVisibleIndex; 8878 } 8879 8880 // if less slides than to show, go to start. 8881 if ( _.slideCount <= _.options.slidesToShow ) { 8882 _.currentSlide = 0; 8883 8884 } 8885 8886 currentSlide = _.currentSlide; 8887 8888 _.destroy(true); 8889 8890 $.extend(_, _.initials, { currentSlide: currentSlide }); 8891
8892 _.init(); 8893 8894 if( !initializing ) { 8895 8896 _.changeSlide({ 8897 data: { 8898 message: 'index', 8899 index: currentSlide 8900 } 8901 }, false); 8902 8903 } 8904 8905 }; 8906 8907 Slick.prototype.registerBreakpoints = function() { 8908 8909 var _ = this, breakpoint, currentBreakpoint, l, 8910 responsiveSettings = _.options.responsive || null; 8911 8912 if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { 8913 8914 _.respondTo = _.options.respondTo || 'window'; 8915 8916 for ( breakpoint in responsiveSettings ) { 8917 8918 l = _.breakpoints.length-1; 8919 8920 if (responsiveSettings.hasOwnProperty(breakpoint)) { 8921 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 8922 8923 // loop through the breakpoints and cut out any existing 8924 // ones with the same breakpoint number, we don't want dupes. 8925 while( l >= 0 ) { 8926 if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { 8927 _.breakpoints.splice(l,1); 8928 } 8929 l--; 8930 } 8931 8932 _.breakpoints.push(currentBreakpoint); 8933 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 8934 8935 } 8936 8937 } 8938 8939 _.breakpoints.sort(function(a, b) { 8940 return ( _.options.mobileFirst ) ? a-b : b-a; 8941 }); 8942 8943 } 8944 8945 }; 8946 8947 Slick.prototype.reinit = function() { 8948 8949 var _ = this; 8950 8951 _.$slides = 8952 _.$slideTrack 8953 .children(_.options.slide) 8954 .addClass('slick-slide'); 8955 8956 _.slideCount = _.$slides.length; 8957 8958 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 8959 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 8960 } 8961 8962 if (_.slideCount <= _.options.slidesToShow) { 8963 _.currentSlide = 0; 8964 } 8965 8966 _.registerBreakpoints(); 8967 8968 _.setProps(); 8969 _.setupInfinite(); 8970 _.buildArrows(); 8971 _.updateArrows(); 8972 _.initArrowEvents(); 8973 _.buildDots(); 8974 _.updateDots(); 8975 _.initDotEvents(); 8976 _.cleanUpSlideEvents(); 8977 _.initSlideEvents(); 8978 8979 _.checkResponsive(false, true); 8980 8981 if (_.options.focusOnSelect === true) { 8982 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 8983 } 8984 8985 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 8986 8987 _.setPosition(); 8988 _.focusHandler(); 8989 8990 _.paused = !_.options.autoplay; 8991 _.autoPlay(); 8992 8993 _.$slider.trigger('reInit', [_]); 8994 8995 }; 8996 8997 Slick.prototype.resize = function() { 8998 8999 var _ = this; 9000 9001 if ($(window).width() !== _.windowWidth) { 9002 clearTimeout(_.windowDelay); 9003 _.windowDelay = window.setTimeout(function() { 9004 _.windowWidth = $(window).width(); 9005 _.checkResponsive(); 9006 if( !_.unslicked ) { _.setPosition(); } 9007 }, 50); 9008 } 9009 }; 9010 9011 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 9012 9013 var _ = this; 9014 9015 if (typeof(index) === 'boolean') { 9016 removeBefore = index; 9017 index = removeBefore === true ? 0 : _.slideCount - 1; 9018 } else { 9019 index = removeBefore === true ? --index : index; 9020 } 9021 9022 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 9023 return false; 9024 } 9025 9026 _.unload(); 9027 9028 if (removeAll === true) { 9029 _.$slideTrack.children().remove(); 9030 } else { 9031 _.$slideTrack.children(this.options.slide).eq(index).remove(); 9032 } 9033 9034 _.$slides = _.$slideTrack.children(this.options.slide); 9035 9036 _.$slideTrack.children(this.options.slide).detach(); 9037 9038 _.$slideTrack.append(_.$slides); 9039 9040 _.$slidesCache = _.$slides; 9041 9042 _.reinit(); 9043 9044 }; 9045 9046 Slick.prototype.setCSS = function(position) { 9047 9048 var _ = this, 9049 positionProps = {}, 9050 x, y; 9051 9052 if (_.options.rtl === true) { 9053 position = -position; 9054 } 9055 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 9056 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 9057 9058 positionProps[_.positionProp] = position; 9059 9060 if (_.transformsEnabled === false) { 9061 _.$slideTrack.css(positionProps); 9062 } else { 9063 positionProps = {}; 9064 if (_.cssTransitions === false) { 9065 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 9066 _.$slideTrack.css(positionProps); 9067 } else { 9068 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 9069 _.$slideTrack.css(positionProps); 9070 } 9071 } 9072 9073 }; 9074 9075 Slick.prototype.setDimensions = function() { 9076 9077 var _ = this; 9078 9079 if (_.options.vertical === false) { 9080 if (_.options.centerMode === true) { 9081 _.$list.css({ 9082 padding: ('0px ' + _.options.centerPadding) 9083 }); 9084 } 9085 } else { 9086 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 9087 if (_.options.centerMode === true) { 9088 _.$list.css({ 9089 padding: (_.options.centerPadding + ' 0px') 9090 }); 9091 } 9092 } 9093 9094 _.listWidth = _.$list.width(); 9095 _.listHeight = _.$list.height(); 9096 9097 9098 if (_.options.vertical === false && _.options.variableWidth === false) { 9099 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 9100 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 9101 9102 } else if (_.options.variableWidth === true) { 9103 _.$slideTrack.width(5000 * _.slideCount); 9104 } else { 9105 _.slideWidth = Math.ceil(_.listWidth); 9106 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 9107 } 9108 9109 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 9110 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 9111 9112 }; 9113 9114 Slick.prototype.setFade = function() { 9115 9116 var _ = this, 9117 targetLeft; 9118 9119 _.$slides.each(function(index, element) { 9120 targetLeft = (_.slideWidth * index) * -1; 9121 if (_.options.rtl === true) { 9122 $(element).css({ 9123 position: 'relative', 9124 right: targetLeft, 9125 top: 0, 9126 zIndex: _.options.zIndex - 2, 9127 opacity: 0 9128 }); 9129 } else { 9130 $(element).css({ 9131 position: 'relative', 9132 left: targetLeft, 9133 top: 0, 9134 zIndex: _.options.zIndex - 2, 9135 opacity: 0 9136 }); 9137 } 9138 }); 9139 9140 _.$slides.eq(_.currentSlide).css({ 9141 zIndex: _.options.zIndex - 1, 9142 opacity: 1 9143 }); 9144 9145 }; 9146 9147 Slick.prototype.setHeight = function() { 9148 9149 var _ = this; 9150 9151 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 9152 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 9153 _.$list.css('height', targetHeight); 9154 } 9155 9156 }; 9157 9158 Slick.prototype.setOption = 9159 Slick.prototype.slickSetOption = function() { 9160 9161 /** 9162 * accepts arguments in format of: 9163 * 9164 * - for changing a single option's value: 9165 * .slick("setOption", option, value, refresh ) 9166 * 9167 * - for changing a set of responsive options: 9168 * .slick("setOption", 'responsive', [{}, ...], refresh ) 9169 * 9170 * - for updating multiple values at once (not responsive) 9171 * .slick("setOption", { 'option': value, ... }, refresh ) 9172 */ 9173 9174 var _ = this, l, item, option, value, refresh = false, t
9174ype; 9175 9176 if( $.type( arguments[0] ) === 'object' ) { 9177 9178 option = arguments[0]; 9179 refresh = arguments[1]; 9180 type = 'multiple'; 9181 9182 } else if ( $.type( arguments[0] ) === 'string' ) { 9183 9184 option = arguments[0]; 9185 value = arguments[1]; 9186 refresh = arguments[2]; 9187 9188 if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { 9189 9190 type = 'responsive'; 9191 9192 } else if ( typeof arguments[1] !== 'undefined' ) { 9193 9194 type = 'single'; 9195 9196 } 9197 9198 } 9199 9200 if ( type === 'single' ) { 9201 9202 _.options[option] = value; 9203 9204 9205 } else if ( type === 'multiple' ) { 9206 9207 $.each( option , function( opt, val ) { 9208 9209 _.options[opt] = val; 9210 9211 }); 9212 9213 9214 } else if ( type === 'responsive' ) { 9215 9216 for ( item in value ) { 9217 9218 if( $.type( _.options.responsive ) !== 'array' ) { 9219 9220 _.options.responsive = [ value[item] ]; 9221 9222 } else { 9223 9224 l = _.options.responsive.length-1; 9225 9226 // loop through the responsive object and splice out duplicates. 9227 while( l >= 0 ) { 9228 9229 if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { 9230 9231 _.options.responsive.splice(l,1); 9232 9233 } 9234 9235 l--; 9236 9237 } 9238 9239 _.options.responsive.push( value[item] ); 9240 9241 } 9242 9243 } 9244 9245 } 9246 9247 if ( refresh ) { 9248 9249 _.unload(); 9250 _.reinit(); 9251 9252 } 9253 9254 }; 9255 9256 Slick.prototype.setPosition = function() { 9257 9258 var _ = this; 9259 9260 _.setDimensions(); 9261 9262 _.setHeight(); 9263 9264 if (_.options.fade === false) { 9265 _.setCSS(_.getLeft(_.currentSlide)); 9266 } else { 9267 _.setFade(); 9268 } 9269 9270 _.$slider.trigger('setPosition', [_]); 9271 9272 }; 9273 9274 Slick.prototype.setProps = function() { 9275 9276 var _ = this, 9277 bodyStyle = document.body.style; 9278 9279 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 9280 9281 if (_.positionProp === 'top') { 9282 _.$slider.addClass('slick-vertical'); 9283 } else { 9284 _.$slider.removeClass('slick-vertical'); 9285 } 9286 9287 if (bodyStyle.WebkitTransition !== undefined || 9288 bodyStyle.MozTransition !== undefined || 9289 bodyStyle.msTransition !== undefined) { 9290 if (_.options.useCSS === true) { 9291 _.cssTransitions = true; 9292 } 9293 } 9294 9295 if ( _.options.fade ) { 9296 if ( typeof _.options.zIndex === 'number' ) { 9297 if( _.options.zIndex < 3 ) { 9298 _.options.zIndex = 3; 9299 } 9300 } else { 9301 _.options.zIndex = _.defaults.zIndex; 9302 } 9303 } 9304 9305 if (bodyStyle.OTransform !== undefined) { 9306 _.animType = 'OTransform'; 9307 _.transformType = '-o-transform'; 9308 _.transitionType = 'OTransition'; 9309 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
9310 } 9311 if (bodyStyle.MozTransform !== undefined) { 9312 _.animType = 'MozTransform'; 9313 _.transformType = '-moz-transform'; 9314 _.transitionType = 'MozTransition'; 9315 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 9316 } 9317 if (bodyStyle.webkitTransform !== undefined) { 9318 _.animType = 'webkitTransform'; 9319 _.transformType = '-webkit-transform'; 9320 _.transitionType = 'webkitTransition'; 9321 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 9322 } 9323 if (bodyStyle.msTransform !== undefined) { 9324 _.animType = 'msTransform'; 9325 _.transformType = '-ms-transform'; 9326 _.transitionType = 'msTransition'; 9327 if (bodyStyle.msTransform === undefined) _.animType = false; 9328 } 9329 if (bodyStyle.transform !== undefined && _.animType !== false) { 9330 _.animType = 'transform'; 9331 _.transformType = 'transform'; 9332 _.transitionType = 'transition'; 9333 } 9334 _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); 9335 }; 9336 9337 9338 Slick.prototype.setSlideClasses = function(index) { 9339 9340 var _ = this, 9341 centerOffset, allSlides, indexOffset, remainder; 9342 9343 allSlides = _.$slider 9344 .find('.slick-slide') 9345 .removeClass('slick-active slick-center slick-current') 9346 .attr('aria-hidden', 'true'); 9347 9348 _.$slides 9349 .eq(index) 9350 .addClass('slick-current'); 9351 9352 if (_.options.centerMode === true) { 9353 9354 var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; 9355 9356 centerOffset = Math.floor(_.options.slidesToShow / 2); 9357 9358 if (_.options.infinite === true) { 9359 9360 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 9361 _.$slides 9362 .slice(index - centerOffset + evenCoef, index + centerOffset + 1) 9363 .addClass('slick-active') 9364 .attr('aria-hidden', 'false'); 9365 9366 } else { 9367 9368 indexOffset = _.options.slidesToShow + index; 9369 allSlides 9370 .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) 9371 .addClass('slick-active') 9372 .attr('aria-hidden', 'false'); 9373 9374 } 9375 9376 if (index === 0) { 9377 9378 allSlides 9379 .eq(allSlides.length - 1 - _.options.slidesToShow) 9380 .addClass('slick-center'); 9381 9382 } else if (index === _.slideCount - 1) { 9383 9384 allSlides 9385 .eq(_.options.slidesToShow) 9386 .addClass('slick-center'); 9387 9388 } 9389 9390 } 9391 9392 _.$slides 9393 .eq(index) 9394 .addClass('slick-center'); 9395 9396 } else { 9397 9398 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 9399 9400 _.$slides 9401 .slice(index, index + _.options.slidesToShow) 9402 .addClass('slick-active') 9403 .attr('aria-hidden', 'false'); 9404 9405 } else if (allSlides.length <= _.options.slidesToShow) { 9406 9407 allSlides 9408 .addClass('slick-active') 9409 .attr('aria-hidden', 'false'); 9410 9411 } else { 9412 9413 remainder = _.slideCount % _.options.slidesToShow; 9414 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 9415 9416 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 9417 9418 allSlides 9419 .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) 9420 .addClass('slick-active') 9421 .attr('aria-hidden', 'false'); 9422 9423 } else { 9424 9425 allSlides 9426 .slice(indexOffset, indexOffset + _.options.slidesToShow) 9427 .addClass('slick-active') 9428 .attr('aria-hidden', 'false'); 9429 9430 } 9431 9432 } 9433 9434 } 9435 9436 if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { 9437 _.lazyLoad(); 9438 } 9439 }; 9440 9441 Slick.prototype.setupInfinite = function() { 9442 9443 var _ = this, 9444 i, slideIndex, infiniteCount; 9445 9446 if (_.options.fade === true) {
9447 _.options.centerMode = false; 9448 } 9449 9450 if (_.options.infinite === true && _.options.fade === false) { 9451 9452 slideIndex = null; 9453 9454 if (_.slideCount > _.options.slidesToShow) { 9455 9456 if (_.options.centerMode === true) { 9457 infiniteCount = _.options.slidesToShow + 1; 9458 } else { 9459 infiniteCount = _.options.slidesToShow; 9460 } 9461 9462 for (i = _.slideCount; i > (_.slideCount - 9463 infiniteCount); i -= 1) { 9464 slideIndex = i - 1; 9465 $(_.$slides[slideIndex]).clone(true).attr('id', '') 9466 .attr('data-slick-index', slideIndex - _.slideCount) 9467 .prependTo(_.$slideTrack).addClass('slick-cloned'); 9468 } 9469 for (i = 0; i < infiniteCount + _.slideCount; i += 1) { 9470 slideIndex = i; 9471 $(_.$slides[slideIndex]).clone(true).attr('id', '') 9472 .attr('data-slick-index', slideIndex + _.slideCount) 9473 .appendTo(_.$slideTrack).addClass('slick-cloned'); 9474 } 9475 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 9476 $(this).attr('id', ''); 9477 }); 9478 9479 } 9480 9481 } 9482 9483 }; 9484 9485 Slick.prototype.interrupt = function( toggle ) { 9486 9487 var _ = this; 9488 9489 if( !toggle ) { 9490 _.autoPlay(); 9491 } 9492 _.interrupted = toggle; 9493 9494 }; 9495 9496 Slick.prototype.selectHandler = function(event) { 9497 9498 var _ = this; 9499 9500 var targetElement = 9501 $(event.target).is('.slick-slide') ? 9502 $(event.target) : 9503 $(event.target).parents('.slick-slide'); 9504 9505 var index = parseInt(targetElement.attr('data-slick-index')); 9506 9507 if (!index) index = 0; 9508 9509 if (_.slideCount <= _.options.slidesToShow) { 9510 9511 _.slideHandler(index, false, true); 9512 return; 9513 9514 } 9515 9516 _.slideHandler(index); 9517 9518 }; 9519 9520 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 9521 9522 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 9523 _ = this, navTarget; 9524 9525 sync = sync || false; 9526 9527 if (_.animating === true && _.options.waitForAnimate === true) { 9528 return; 9529 } 9530 9531 if (_.options.fade === true && _.currentSlide === index) { 9532 return; 9533 } 9534 9535 if (sync === false) { 9536 _.asNavFor(index); 9537 } 9538 9539 targetSlide = index; 9540 targetLeft = _.getLeft(targetSlide); 9541 slideLeft = _.getLeft(_.currentSlide); 9542 9543 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 9544 9545 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 9546 if (_.options.fade === false) { 9547 targetSlide = _.currentSlide; 9548 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 9549 _.animateSlide(slideLeft, function() { 9550 _.postSlide(targetSlide); 9551 }); 9552 } else { 9553 _.postSlide(targetSlide); 9554 } 9555 } 9556 return; 9557 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 9558 if (_.options.fade === false) { 9559 targetSlide = _.currentSlide; 9560 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 9561 _.animateSlide(slideLeft, function() { 9562 _.postSlide(targetSlide); 9563 }); 9564 } else { 9565 _.postSlide(targetSlide); 9566 } 9567 } 9568 return; 9569 } 9570 9571 if ( _.options.autoplay ) { 9572 clearInterval(_.autoPlayTimer); 9573 } 9574 9575 if (targetSlide < 0) { 9576 if (_.slideCount % _.options.slidesToScroll !== 0) { 9577 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 9578 } else { 9579 animSlide = _.slideCount + targetSlide; 9580 } 9581 }
9581 else if (targetSlide >= _.slideCount) { 9582 if (_.slideCount % _.options.slidesToScroll !== 0) { 9583 animSlide = 0; 9584 } else { 9585 animSlide = targetSlide - _.slideCount; 9586 } 9587 } else { 9588 animSlide = targetSlide; 9589 } 9590 9591 _.animating = true; 9592 9593 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 9594 9595 oldSlide = _.currentSlide; 9596 _.currentSlide = animSlide; 9597 9598 _.setSlideClasses(_.currentSlide); 9599 9600 if ( _.options.asNavFor ) { 9601 9602 navTarget = _.getNavTarget(); 9603 navTarget = navTarget.slick('getSlick'); 9604 9605 if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { 9606 navTarget.setSlideClasses(_.currentSlide); 9607 } 9608 9609 } 9610 9611 _.updateDots(); 9612 _.updateArrows(); 9613 9614 if (_.options.fade === true) { 9615 if (dontAnimate !== true) { 9616 9617 _.fadeSlideOut(oldSlide); 9618 9619 _.fadeSlide(animSlide, function() { 9620 _.postSlide(animSlide); 9621 }); 9622 9623 } else { 9624 _.postSlide(animSlide); 9625 } 9626 _.animateHeight(); 9627 return; 9628 } 9629 9630 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 9631 _.animateSlide(targetLeft, function() { 9632 _.postSlide(animSlide); 9633 }); 9634 } else { 9635 _.postSlide(animSlide); 9636 } 9637 9638 }; 9639 9640 Slick.prototype.startLoad = function() { 9641 9642 var _ = this; 9643 9644 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 9645 9646 _.$prevArrow.hide(); 9647 _.$nextArrow.hide(); 9648 9649 } 9650 9651 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 9652 9653 _.$dots.hide(); 9654 9655 } 9656 9657 _.$slider.addClass('slick-loading'); 9658 9659 }; 9660 9661 Slick.prototype.swipeDirection = function() { 9662 9663 var xDist, yDist, r, swipeAngle, _ = this; 9664 9665 xDist = _.touchObject.startX - _.touchObject.curX; 9666 yDist = _.touchObject.startY - _.touchObject.curY; 9667 r = Math.atan2(yDist, xDist); 9668 9669 swipeAngle = Math.round(r * 180 / Math.PI); 9670 if (swipeAngle < 0) { 9671 swipeAngle = 360 - Math.abs(swipeAngle); 9672 } 9673 9674 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 9675 return (_.options.rtl === false ? 'left' : 'right'); 9676 } 9677 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 9678 return (_.options.rtl === false ? 'left' : 'right'); 9679 } 9680 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 9681 return (_.options.rtl === false ? 'right' : 'left'); 9682 } 9683 if (_.options.verticalSwiping === true) { 9684 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 9685 return 'down'; 9686 } else { 9687 return 'up'; 9688 } 9689 } 9690 9691 return 'vertical'; 9692 9693 }; 9694 9695 Slick.prototype.swipeEnd = function(event) { 9696 9697 var _ = this, 9698 slideCount, 9699 direction; 9700 9701 _.dragging = false; 9702 _.swiping = false; 9703 9704 if (_.scrolling) { 9705 _.scrolling = false; 9706 return false; 9707 } 9708 9709 _.interrupted = false; 9710 _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; 9711 9712 if ( _.touchObject.curX === undefined ) { 9713 return false; 9714 } 9715 9716 if ( _.touchObject.edgeHit === true ) { 9717 _.$slider.trigger('edge', [_, _.swipeDirection() ]); 9718 } 9719 9720 if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { 9721 9722 direction = _.swipeDirection(); 9723 9724 switch ( direction ) { 9725 9726 case 'left': 9727 case 'down': 9728 9729 slideCount = 9730 _.options.swipeToSlide ? 9731 _.checkNavigable( _.currentSlide + _.getSlideCount() ) : 9732 _.currentSlide + _.getSlideCount(); 9733 9734 _.currentDirection = 0; 9735 9736 break; 9737 9738 case 'right': 9739 case 'up': 9740 9741 slideCount =
9742 _.options.swipeToSlide ? 9743 _.checkNavigable( _.currentSlide - _.getSlideCount() ) : 9744 _.currentSlide - _.getSlideCount(); 9745 9746 _.currentDirection = 1; 9747 9748 break; 9749 9750 default: 9751 9752 9753 } 9754 9755 if( direction != 'vertical' ) { 9756 9757 _.slideHandler( slideCount ); 9758 _.touchObject = {}; 9759 _.$slider.trigger('swipe', [_, direction ]); 9760 9761 } 9762 9763 } else { 9764 9765 if ( _.touchObject.startX !== _.touchObject.curX ) { 9766 9767 _.slideHandler( _.currentSlide ); 9768 _.touchObject = {}; 9769 9770 } 9771 9772 } 9773 9774 }; 9775 9776 Slick.prototype.swipeHandler = function(event) { 9777 9778 var _ = this; 9779 9780 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 9781 return; 9782 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 9783 return; 9784 } 9785 9786 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 9787 event.originalEvent.touches.length : 1; 9788 9789 _.touchObject.minSwipe = _.listWidth / _.options 9790 .touchThreshold; 9791 9792 if (_.options.verticalSwiping === true) { 9793 _.touchObject.minSwipe = _.listHeight / _.options 9794 .touchThreshold; 9795 } 9796 9797 switch (event.data.action) { 9798 9799 case 'start': 9800 _.swipeStart(event); 9801 break; 9802 9803 case 'move': 9804 _.swipeMove(event); 9805 break; 9806 9807 case 'end': 9808 _.swipeEnd(event); 9809 break; 9810 9811 } 9812 9813 }; 9814 9815 Slick.prototype.swipeMove = function(event) { 9816 9817 var _ = this, 9818 edgeWasHit = false, 9819 curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; 9820 9821 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 9822 9823 if (!_.dragging || _.scrolling || touches && touches.length !== 1) { 9824 return false; 9825 } 9826 9827 curLeft = _.getLeft(_.currentSlide); 9828 9829 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 9830 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 9831 9832 _.touchObject.swipeLength = Math.round(Math.sqrt( 9833 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 9834 9835 verticalSwipeLength = Math.round(Math.sqrt( 9836 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 9837 9838 if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { 9839 _.scrolling = true; 9840 return false; 9841 } 9842 9843 if (_.options.verticalSwiping === true) { 9844 _.touchObject.swipeLength = verticalSwipeLength; 9845 } 9846 9847 swipeDirection = _.swipeDirection(); 9848 9849 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 9850 _.swiping = true; 9851 event.preventDefault(); 9852 } 9853 9854 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 9855 if (_.options.verticalSwiping === true) { 9856 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 9857 } 9858 9859 9860 swipeLength = _.touchObject.swipeLength; 9861 9862 _.touchObject.edgeHit = false; 9863 9864 if (_.options.infinite === false) { 9865 if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { 9866 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 9867 _.touchObject.edgeHit = true; 9868 } 9869 } 9870 9871 if (_.options.vertical === false) { 9872 _.swipeLeft = curLeft + swipeLength * positionOffset; 9873 } else { 9874 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 9875 } 9876 if (_.options.verticalSwiping === true) { 9877 _.swipeLeft = curLeft + swipeLength * positionOffset; 9878 } 9879 9880 if (_.options.fade === true || _.options.touchMove === false) { 9881 return false;
9882 } 9883 9884 if (_.animating === true) { 9885 _.swipeLeft = null; 9886 return false; 9887 } 9888 9889 _.setCSS(_.swipeLeft); 9890 9891 }; 9892 9893 Slick.prototype.swipeStart = function(event) { 9894 9895 var _ = this, 9896 touches; 9897 9898 _.interrupted = true; 9899 9900 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 9901 _.touchObject = {}; 9902 return false; 9903 } 9904 9905 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 9906 touches = event.originalEvent.touches[0]; 9907 } 9908 9909 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 9910 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 9911 9912 _.dragging = true; 9913 9914 }; 9915 9916 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 9917 9918 var _ = this; 9919 9920 if (_.$slidesCache !== null) { 9921 9922 _.unload(); 9923 9924 _.$slideTrack.children(this.options.slide).detach(); 9925 9926 _.$slidesCache.appendTo(_.$slideTrack); 9927 9928 _.reinit(); 9929 9930 } 9931 9932 }; 9933 9934 Slick.prototype.unload = function() { 9935 9936 var _ = this; 9937 9938 $('.slick-cloned', _.$slider).remove(); 9939 9940 if (_.$dots) { 9941 _.$dots.remove(); 9942 } 9943 9944 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 9945 _.$prevArrow.remove(); 9946 } 9947 9948 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 9949 _.$nextArrow.remove(); 9950 } 9951 9952 _.$slides 9953 .removeClass('slick-slide slick-active slick-visible slick-current') 9954 .attr('aria-hidden', 'true') 9955 .css('width', ''); 9956 9957 }; 9958 9959 Slick.prototype.unslick = function(fromBreakpoint) { 9960 9961 var _ = this; 9962 _.$slider.trigger('unslick', [_, fromBreakpoint]); 9963 _.destroy(); 9964 9965 }; 9966 9967 Slick.prototype.updateArrows = function() { 9968 9969 var _ = this, 9970 centerOffset; 9971 9972 centerOffset = Math.floor(_.options.slidesToShow / 2); 9973 9974 if ( _.options.arrows === true && 9975 _.slideCount > _.options.slidesToShow && 9976 !_.options.infinite ) { 9977 9978 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 9979 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 9980 9981 if (_.currentSlide === 0) { 9982 9983 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 9984 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 9985 9986 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 9987 9988 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 9989 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 9990 9991 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 9992 9993 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 9994 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 9995 9996 } 9997 9998 } 9999 10000 }; 10001 10002 Slick.prototype.updateDots = function() { 10003 10004 var _ = this; 10005 10006 if (_.$dots !== null) { 10007 10008 _.$dots 10009 .find('li') 10010 .removeClass('slick-active') 10011 .end(); 10012 10013 _.$dots 10014 .find('li') 10015 .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) 10016 .addClass('slick-active'); 10017 10018 } 10019 10020 }; 10021 10022 Slick.prototype.visibility = function() { 10023 10024 var _ = this; 10025 10026 if ( _.options.autoplay ) { 10027 10028 if ( document[_.hidden] ) { 10029 10030 _.interrupted = true; 10031 10032 } else { 10033 10034 _.interrupted = false; 10035 10036 } 10037 10038 } 10039 10040 }; 10041 10042 $.fn.slick = function() { 10043 var _ = this, 10044 opt = arguments[0], 10045 args = Array.prototype.slice.call(arguments, 1), 10046 l = _.length, 10047 i, 10048 ret; 10049 for (i = 0; i < l; i++) { 10050 if (typeof opt == 'object' || typeof opt == 'undefined') 10051 _[i].slick = new Slick(_[i], opt); 10052 else 10053 ret = _[i].slick[opt].apply(_[i].slick, args); 10054 if (typeof ret != 'undefined') return ret; 10055 } 10056 return _; 10057 }; 10058 10059})); 10060 10061/*! 10062 * OverlayScrollbars 10063 * https://github.com/KingSora/OverlayScrollbars 10064 * 10065 * Version: 1.13.0 10066 * 10067 * Copyright KingSora | Rene Haas. 10068 * https://github.com/KingSora 10069 * 10070 * Released under the MIT license. 10071 * Date: 02.08.2020 10072 */ 10073!function(t,r){"function"==typeof define&&define.amd?define(["jquery"],function(n){return r(t,t.document,undefined,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r(t,t.document,undefined,require("jquery")):r(t,t.document,undefined,t.jQuery)}("undefined"!=typeof window?window:this,function(vi,di,hi,n){"use strict";var o,l,f,a,pi="object",bi="function",yi="array",mi="string",gi="boolean",wi="number",t="null",xi={c:"class",s:"style",i:"id",l:"length",p:"prototype",ti:"tabindex",oH:"offsetHeight",cH:"clientHeight",sH:"scrollHeight",oW:"offsetWidth",cW:"clientWidth",sW:"scrollWidth",hOP:"hasOwnProperty",bCR:"getBoundingClientRect"},_i=(o={},l={},{e:f=["-webkit-","-moz-","-o-","-ms-"],o:a=["WebKit","Moz","O","MS"],u:function(n){var t=l[n];if(l[xi.hOP](n))return t;for(var r,e,i,o=c(n),a=di.createElement("div")[xi.s],u=0;u<f.length;u++)for(i=f[u].replace(/-/g,""),r=[n,f[u]+n,i+o,c(i)+o],e=0;e<r[xi.l];e++)if(a[r[e]]!==hi){t=r[e];break}return l[n]=t},v:function(n,t,r){var e=n+" "+t,i=l[e];
10073if(l[xi.hOP](e))return i;for(var o,a=di.createElement("div")[xi.s],u=t.split(" "),f=r||"",c=0,s=-1;c<u[xi.l];c++)for(;s<_i.e[xi.l];s++)if(o=s<0?u[c]:_i.e[s]+u[c],a.cssText=n+":"+o+f,a[xi.l]){i=o;break}return l[e]=i},d:function(n,t,r){var e=0,i=o[n];if(!o[xi.hOP](n)){for(i=vi[n];e<a[xi.l];e++)i=i||vi[(t?a[e]:a[e].toLowerCase())+c(n)];o[n]=i}return i||r}});function c(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Si={wW:e(r,0,!0),wH:e(r,0),mO:e(_i.d,0,"MutationObserver",!0),rO:e(_i.d,0,"ResizeObserver",!0),rAF:e(_i.d,0,"requestAnimationFrame",!1,function(n){return vi.setTimeout(n,1e3/60)}),cAF:e(_i.d,0,"cancelAnimationFrame",!1,function(n){return vi.clearTimeout(n)}),now:function(){return Date.now&&Date.now()||(new Date).getTime()},stpP:function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},prvD:function(n){n.preventDefault&&n.cancelable?n.preventDefault():n.returnValue=!1},page:function(n){var t=((n=n.originalEvent||n).target||n.srcElement||di).ownerDocument||di,r=t.documentElement,e=t.body;if(n.touches===hi)return!n.pageX&&n.clientX&&null!=n.clientX?{x:n.clientX+(r&&r.scrollLeft||e&&e.scrollLeft||0)-(r&&r.clientLeft||e&&e.clientLeft||0),y:n.clientY+(r&&r.scrollTop||e&&e.scrollTop||0)-(r&&r.clientTop||e&&e.clientTop||0)}:{x:n.pageX,y:n.pageY};var i=n.touches[0];return{x:i.pageX,y:i.pageY}},mBtn:function(n){var t=n.button;return n.which||t===hi?n.which:1&t?1:2&t?3:4&t?2:0},inA:function(n,t){for(var r=0;r<t[xi.l];r++)try{if(t[r]===n)return r}catch(e){}return-1},isA:function(n){var t=Array.isArray;return t?t(n):this.type(n)==yi},type:function(n){return n===hi||null===n?n+"":Object[xi.p].toString.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()},bind:e};function r(n){return n?vi.innerWidth||di.documentElement[xi.cW]||di.body[xi.cW]:vi.innerHeight||di.documentElement[xi.cH]||di.body[xi.cH]}function e(n,t){if(typeof n!=bi)throw"Can't bind function!";var r=xi.p,e=Array[r].slice.call(arguments,2),i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array[r].slice.call(arguments)))};return n[r]&&(i[r]=n[r]),o[r]=new i,o}var i,u,zi,s,v,L,N,d,h,p,b,y,m,g,Ti,Oi=Math,ki=n,Ci=(n.easing,n),Ai=(i=[],u="__overlayScrollbars__",function(n,t){var r=arguments[xi.l];if(r<1)return i;if(t)n[u]=t,i.push(n);else{var e=Si.inA(n,i);if(-1<e){if(!(1<r))return i[e][u];delete n[u],i.splice(e,1)}}}),w=(g=[],L=Si.type,y={className:["os-theme-dark",[t,mi]],resize:["none","n:none b:both h:horizontal v:vertical"],sizeAutoCapable:d=[!0,gi],clipAlways:d,normalizeRTL:d,paddingAbsolute:h=[!(N=[gi,wi,mi,yi,pi,bi,t]),gi],autoUpdate:[null,[t,gi]],autoUpdateInterval:[33,wi],updateOnLoad:[["img"],[mi,yi,t]],nativeScrollbarsOverlaid:{showNativeScrollbars:h,initialize:d},overflowBehavior:{x:["scroll",b="v-h:visible-hidden v-s:visible-scroll s:scroll h:hidden"],y:["scroll",b]},scrollbars:{visibility:["auto","v:visible h:hidden a:auto"],autoHide:["never","n:never s:scroll l:leave m:move"],autoHideDelay:[800,wi],dragScrolling:d,clickScrolling:h,touchSupport:d,snapHandle:h},textarea:{dynWidth:h,dynHeight:h,inheritedAttrs:[["style","class"],[mi,yi,t]]},callbacks:{onInitialized:p=[null,[t,bi]],onInitializationWithdrawn:p,onDestroyed:p,onScrollStart:p,onScroll:p,onScrollStop:p,onOverflowChanged:p,onOverflowAmountChanged:p,onDirectionChanged:p,onContentSizeChanged:p,onHostSizeChanged:p,onUpdated:p}},Ti={m:(m=function(i){var o=function(n){var t,r,e;for(t in n)n[xi.hOP](t)&&(r=n[t],(e=L(r))==yi?n[t]=r[i?1:0]:e==pi&&(n[t]=o(r)));return n};return o(Ci.extend(!0,{},y))})(),g:m(!0),_:function(n,t,C,r){var e={},i={},o=Ci.extend(!0,{},n),A=Ci.inArray,H=Ci.isEmptyObject,R=function(n,t,r,e,i,o){for(var a in t)if(t[xi.hOP](a)&&n[xi.hOP](a)){var u,f,c,s,l,v,d,h,p=!1,b=!1,y=t[a],m=L(y),g=m==pi,w=Si.isA(y)?y:[y],x=r[a],_=n[a],S=L(_),z=o?o+".":"",T='The option "'+z+a+"\" wasn't set, because",O=[],k=[];if(x=x===hi?{}:x,g&&S==pi)e[a]={},i[a]={},R(_,y,x,e[a],i[a],z+a),Ci.each([n,e,i],function(n,t){H(t[a])&&delete t[a]});else if(!g){for(v=0;v<w[xi.l];v++)if(l=w[v],c=(m=L(l))==mi&&-1===A(l,N))for(O.push(mi),u=l.split(" "),k=k.concat(u),d=0;d<u[xi.l];d++){for(s=(f=u[d].split(":"))[0],h=0;h<f[xi.l];h++)if(_===f[h]){p=!0;break}if(p)break}else if(O.push(l),S===l){p=!0;break}
10073p?((b=_!==x)&&(e[a]=_),(c?A(x,f)<0:b)&&(i[a]=c?s:_)):C&&console.warn(T+" it doesn't accept the type [ "+S.toUpperCase()+' ] with the value of "'+_+'".\r\nAccepted types are: [ '+O.join(", ").toUpperCase()+" ]."+(0<k[length]?"\r\nValid strings are: [ "+k.join(", ").split(":").join(", ")+" ].":"")),delete n[a]}}};return R(o,t,r||{},e,i),!H(o)&&C&&console.warn("The following options are discarded due to invalidity:\r\n"+vi.JSON.stringify(o,null,2)),{S:e,z:i}}},(zi=vi.OverlayScrollbars=function(n,r,e){if(0===arguments[xi.l])return this;var i,t,o=[],a=Ci.isPlainObject(r);return n?(n=n[xi.l]!=hi?n:[n[0]||n],x(),0<n[xi.l]&&(a?Ci.each(n,function(n,t){(i=t)!==hi&&o.push(z(i,r,e,s,v))}):Ci.each(n,function(n,t){i=Ai(t),("!"===r&&zi.valid(i)||Si.type(r)==bi&&r(t,i)||r===hi)&&o.push(i)}),t=1===o[xi.l]?o[0]:o),t):a||!r?t:o}).globals=function(){x();var n=Ci.extend(!0,{},s);return delete n.msie,n},zi.defaultOptions=function(n){x();var t=s.defaultOptions;if(n===hi)return Ci.extend(!0,{},t);s.defaultOptions=Ci.extend(!0,{},t,Ti._(n,Ti.g,!0,t).S)},zi.valid=function(n){return n instanceof zi&&!n.getState().destroyed},zi.extension=function(n,t,r){var e=Si.type(n)==mi,i=arguments[xi.l],o=0;if(i<1||!e)return Ci.extend(!0,{length:g[xi.l]},g);if(e)if(Si.type(t)==bi)g.push({name:n,extensionFactory:t,defaultOptions:r});else for(;o<g[xi.l];o++)if(g[o].name===n){if(!(1<i))return Ci.extend(!0,{},g[o]);g.splice(o,1)}},zi);function x(){s=s||new _(Ti.m),v=v||new S(s)}function _(n){var _=this,i="overflow",S=Ci("body"),z=Ci('<div id="os-dummy-scrollbar-size"><div></div></div>'),o=z[0],e=Ci(z.children("div").eq(0));S.append(z),z.hide().show();var t,r,a,u,f,c,s,l,v,d=T(o),h={x:0===d.x,y:0===d.y},p=(r=vi.navigator.userAgent,u="substring",f=r[a="indexOf"]("MSIE "),c=r[a]("Trident/"),s=r[a]("Edge/"),l=r[a]("rv:"),v=parseInt,0<f?t=v(r[u](f+5,r[a](".",f)),10):0<c?t=v(r[u](l+3,r[a](".",l)),10):0<s&&(t=v(r[u](s+5,r[a](".",s)),10)),t);function T(n){return{x:n[xi.oH]-n[xi.cH],y:n[xi.oW]-n[xi.cW]}}Ci.extend(_,{defaultOptions:n,msie:p,autoUpdateLoop:!1,autoUpdateRecommended:!Si.mO(),nativeScrollbarSize:d,nativeScrollbarIsOverlaid:h,nativeScrollbarStyling:function(){var n=!1;z.addClass("os-viewport-native-scrollbars-invisible");try{n="none"===z.css("scrollbar-width")&&(9<p||!p)||"none"===vi.getComputedStyle(o,"::-webkit-scrollbar").getPropertyValue("display")}catch(t){}return n}(),overlayScrollbarDummySize:{x:30,y:30},cssCalc:_i.v("width","calc","(1px)")||null,restrictedMeasuring:function(){z.css(i,"hidden");var n=o[xi.sW],t=o[xi.sH];z.css(i,"visible");var r=o[xi.sW],e=o[xi.sH];return n-r!=0||t-e!=0}(),rtlScrollBehavior:function(){z.css({"overflow-y":"hidden","overflow-x":"scroll",direction:"rtl"}).scrollLeft(0);var n=z.offset(),t=e.offset();z.scrollLeft(-999);var r=e.offset();return{i:n.left===t.left,n:t.left!==r.left}}(),supportTransform:!!_i.u("transform"),supportTransition:!!_i.u("transition"),supportPassiveEvents:function(){var n=!1;try{vi.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){n=!0}}))}catch(t){}return n}(),supportResizeObserver:!!Si.rO(),supportMutationObserver:!!Si.mO()}),z.removeAttr(xi.s).remove(),function(){if(!h.x||!h.y){var y=Oi.abs,m=Si.wW(),g=Si.wH(),w=x();Ci(vi).on("resize",function(){if(0<Ai().length){var n=Si.wW(),t=Si.wH(),r=n-m,e=t-g;if(0==r&&0==e)return;var i,o=Oi.round(n/(m/100)),a=Oi.round(t/(g/100)),u=y(r),f=y(e),c=y(o),s=y(a),l=x(),v=2<u&&2<f,d=!function b(n,t){var r=y(n),e=y(t);return r!==e&&r+1!==e&&r-1!==e}(c,s),h=v&&d&&(l!==w&&0<w),p=_.nativeScrollbarSize;h&&(S.append(z),i=_.nativeScrollbarSize=T(z[0]),z.remove(),p.x===i.x&&p.y===i.y||Ci.each(Ai(),function(){Ai(this)&&Ai(this).update("zoom")})),m=n,g=t,w=l}})}function x(){var n=vi.screen.deviceXDPI||0,t=vi.screen.logicalXDPI||1;return vi.devicePixelRatio||n/t}}()}function S(r){var c,e=Ci.inArray,s=Si.now,l="autoUpdate",v=xi.l,d=[],h=[],p=!1,b=33,y=s(),m=function(){if(0<d[v]&&p){c=Si.rAF()(function(){m()});var n,t,r,e,i,o,a=s(),u=a-y;if(b<u){y=a-u%b,n=33;for(var f=0;f<d[v];f++)(t=d[f])!==hi&&(e=(r=t.options())[l],i=Oi.max(1,r.autoUpdateInterval),o=s(),(!0===e||null===e)&&o-
10073h[f]>i&&(t.update("auto"),h[f]=new Date(o+=i)),n=Oi.max(1,Oi.min(n,i)));b=n}}else b=33};this.add=function(n){-1===e(n,d)&&(d.push(n),h.push(s()),0<d[v]&&!p&&(p=!0,r.autoUpdateLoop=p,m()))},this.remove=function(n){var t=e(n,d);-1<t&&(h.splice(t,1),d.splice(t,1),0===d[v]&&p&&(p=!1,r.autoUpdateLoop=p,c!==hi&&(Si.cAF()(c),c=-1)))}}function z(r,n,t,xt,_t){var cn=Si.type,sn=Ci.inArray,d=Ci.each,St=new zi,e=Ci[xi.p];if(dt(r)){if(Ai(r)){var i=Ai(r);return i.options(n),i}var zt,Tt,Ot,kt,I,Ct,At,Ht,j,ln,g,A,h,Rt,Lt,Nt,Wt,w,p,Dt,Mt,Et,It,jt,Ft,Pt,Ut,Vt,$t,o,a,qt,Bt,Xt,u,F,c,P,Yt,Kt,Gt,Jt,Qt,Zt,nr,tr,rr,er,ir,f,s,l,v,b,y,x,H,or,ar,ur,R,fr,cr,sr,lr,vr,dr,hr,pr,br,yr,mr,gr,wr,xr,_r,L,Sr,zr,Tr,Or,kr,Cr,Ar,Hr,m,_,Rr,Lr,Nr,Wr,Dr,Mr,Er,Ir,jr,Fr,Pr,Ur,Vr,$r,S,z,T,O,qr,Br,k,C,Xr,Yr,Kr,Gr,Jr,U,V,Qr,Zr,ne,te,re={},vn={},dn={},ee={},ie={},N="-hidden",oe="margin-",ae="padding-",ue="border-",fe="top",ce="right",se="bottom",le="left",ve="min-",de="max-",he="width",pe="height",be="float",ye="",me="auto",hn="sync",ge="scroll",we="100%",pn="x",bn="y",W=".",xe=" ",D="scrollbar",M="-horizontal",E="-vertical",_e=ge+"Left",Se=ge+"Top",$="mousedown touchstart",q="mouseup touchend touchcancel",B="mousemove touchmove",X="mouseenter",Y="mouseleave",K="keydown",G="keyup",J="selectstart",Q="transitionend webkitTransitionEnd oTransitionEnd",Z="__overlayScrollbarsRO__",nn="os-",tn="os-html",rn="os-host",en=rn+"-foreign",on=rn+"-textarea",an=rn+"-"+D+M+N,un=rn+"-"+D+E+N,fn=rn+"-transition",ze=rn+"-rtl",Te=rn+"-resize-disabled",Oe=rn+"-scrolling",ke=rn+"-overflow",Ce=(ke=rn+"-overflow")+"-x",Ae=ke+"-y",yn="os-textarea",mn=yn+"-cover",gn="os-padding",wn="os-viewport",He=wn+"-native-scrollbars-invisible",xn=wn+"-native-scrollbars-overlaid",_n="os-content",Re="os-content-arrange",Le="os-content-glue",Ne="os-size-auto-observer",Sn="os-resize-observer",zn="os-resize-observer-item",Tn=zn+"-final",On="os-text-inherit",kn=nn+D,Cn=kn+"-track",An=Cn+"-off",Hn=kn+"-handle",Rn=Hn+"-off",Ln=kn+"-unusable",Nn=kn+"-"+me+N,Wn=kn+"-corner",We=Wn+"-resize",De=We+"-both",Me=We+M,Ee=We+E,Dn=kn+M,Mn=kn+E,En="os-dragging",Ie="os-theme-none",In=[He,xn,An,Rn,Ln,Nn,We,De,Me,Ee,En].join(xe),jn=[],Fn=[xi.ti],Pn={},je={},Fe=42,Un="load",Vn=[],$n={},qn=["wrap","cols","rows"],Bn=[xi.i,xi.c,xi.s,"open"].concat(Fn),Xn=[];return St.sleep=function(){$t=!0},St.update=function(n){var t,r,e,i,o;if(!Lt)return cn(n)==mi?n===me?(t=function a(){if(!$t&&!qr){var r,e,i,o=[],n=[{T:Kt,O:Bn.concat(":visible")},{T:Nt?Yt:hi,O:qn}];return d(n,function(n,t){(r=t.T)&&d(t.O,function(n,t){e=":"===t.charAt(0)?r.is(t):r.attr(t),i=$n[t],ui(e,i)&&o.push(t),$n[t]=e})}),it(o),0<o[xi.l]}}(),r=function f(){if($t)return!1;var n,t,r,e,i=oi(),o=Nt&&br&&!jr?Yt.val().length:0,a=!qr&&br&&!Nt,u={};return a&&(n=nr.css(be),u[be]=Vt?ce:le,u[he]=me,nr.css(u)),e={w:i[xi.sW]+o,h:i[xi.sH]+o},a&&(u[be]=n,u[he]=we,nr.css(u)),t=qe(),r=ui(e,m),m=e,r||t}(),(e=t||r)&&Xe({k:r,C:Rt?hi:qt})):n===hn?qr?(i=T(S.takeRecords()),o=O(z.takeRecords())):i=St.update(me):"zoom"===n&&Xe({A:!0,k:!0}):(n=$t||n,$t=!1,St.update(hn)&&!n||Xe({H:n})),Ye(),e||i||o},St.options=function(n,t){var r,e={};if(Ci.isEmptyObject(n)||!Ci.isPlainObject(n)){if(cn(n)!=mi)return a;if(!(1<arguments.length))return bt(a,n);!function f(n,t,r){for(var e=t.split(W),i=e.length,o=0,a={},u=a;o<i;o++)a=a[e[o]]=o+1<i?{}:r;Ci.extend(n,u,!0)}(e,n,t),r=ot(e)}else r=ot(n);Ci.isEmptyObject(r)||Xe({C:r})},St.destroy=function(){if(!Lt){for(var n in _t.remove(St),Ve(),Pe(Jt),Pe(Gt),Pn)St.removeExt(n);for(;0<Xn[xi.l];)Xn.pop()();$e(!0),rr&&mt(rr),tr&&mt(tr),Mt&&mt(Gt),ft(!0),st(!0),at(!0);for(var t=0;t<Vn[xi.l];t++)Ci(Vn[t]).off(Un,rt);Vn=hi,$t=Lt=!0,Ai(r,0),ti("onDestroyed")}},St.scroll=function(n,t,r,e){if(0===arguments.length||n===hi){var i=Mr&&Vt&&Ot.i,o=Mr&&Vt&&Ot.n,a=vn.R,u=vn.L,f=vn.N;return u=i?1-u:u,a=i?f-a:a,f*=o?-1:1,{position:{x:a*=o?-1:1,y:dn.R},ratio:{x:u,y:dn.L},max:{x:f,y:dn.N},handleOffset:{x:vn.W,y:dn.W},handleLength:{x:vn.D,y:dn.D},handleLengthRatio:{x:vn.M,y:dn.M},trackLength:{x:vn.I,y:dn.I},snappedHandleOffset:{x:vn.j,y:dn.j},isRTL:Vt,isRTLNormalized:Mr}}St.update(hn);var c,s,l,v,d,m,g,h,p,w=Mr,b=[pn,le,"l"],y=[bn,fe,"t"],x=["+=","-=","*=","/="],_=cn(t)==pi,S=_?t.complete:e,z={},T={},O="begin",k="nearest",C="never",A="ifneeded",H=xi.l,R=[pn,bn,"xy","yx"],L=[O,"end","center",k],N=["always",C,A],W=n[xi.hOP]("el"),D=W?n.el:n,M=!!(D instanceof Ci||ki)&&D instanceof ki,E=!M&&dt(D),I=function(){s&&Qe(!0),l&&Qe(!1)},j=cn(S)!=bi?hi:function(){I(),S()};function F(n,t){for(c=0;c<t[H];c++)if(n===t[c])return 1}function P(n,t){var r=n?b:y;if(t=cn(t)==mi||cn(t)==wi?[t,t]:t,Si.isA(t))return n?t[0]:t[1];if(cn(t)==pi)for(c=0;c<r[H];c++)if(r[c]in t)return t[r[c]]}function U(n,t){var r,e,i,o,a=cn(t)==mi,u=n?vn:dn,f=u.R,c=u.N,s=Vt&&n,l=s&&Ot.n&&!w,v="replace",d=eval;if((e=a?(2<t[H]&&(o=t.substr(0,2),-1<sn(o,x)&&(r=o)),t=(t=r?t.substr(2):t)[v](/min/g,0)[v](/</g,0)[v](/max/g,(l?"-":ye)+we)[v](/>/g,(l?"-":ye)+we)[v](/px/g,ye)[v](/%/g," * "+c*(s&&Ot.n?-1:1)/100)[v](/vw/g," * "+ee.w)[v](/vh/g," * "+ee.h),ii(isNaN(t)?ii(d(t),!0).toFixed():t)):t)!==hi&&!isNaN(e)&&cn(e)==wi){var h=w&&s,p=f*(h&&Ot.n?-1:1),b=h&&Ot.i,y=h&&Ot.n;switch(p=b?c-p:p,r){case"+=":i=p+e;break;case"-=":i=p-e;break;case"*=":i=p*e;break;case"/=":i=p/e;break;default:i=e}i=b?c-i:i,i*=y?-1:1,i=s&&Ot.n?Oi.min(0,Oi.max(c,i)):Oi.max(0,Oi.min(c,i))}return i===f?hi:i}function V(n,t,r,e){var i,o,a=[r,r],u=cn(n);if(u==t)n=[n,n];else if(u==yi){if(2<(i=n[H])||i<1)n=a;else for(1===i&&(n[1]=r),c=0;c<i;c++)if(o=n[c],cn(o)!=t||!F(o,e)){n=a;break}}
10073else n=u==pi?[n[pn]||r,n[bn]||r]:a;return{x:n[0],y:n[1]}}function $(n){var t,r,e=[],i=[fe,ce,se,le];for(c=0;c<n[H]&&c!==i[H];c++)t=n[c],(r=cn(t))==gi?e.push(t?ii(p.css(oe+i[c])):0):e.push(r==wi?t:0);return e}if(M||E){var q,B=W?n.margin:0,X=W?n.axis:0,Y=W?n.scroll:0,K=W?n.block:0,G=[0,0,0,0],J=cn(B);if(0<(p=M?D:Ci(D))[H]){B=J==wi||J==gi?$([B,B,B,B]):J==yi?2===(q=B[H])?$([B[0],B[1],B[0],B[1]]):4<=q?$(B):G:J==pi?$([B[fe],B[ce],B[se],B[le]]):G,d=F(X,R)?X:"xy",m=V(Y,mi,"always",N),g=V(K,mi,O,L),h=B;var Q=vn.R,Z=dn.R,nn=Qt.offset(),tn=p.offset(),rn={x:m.x==C||d==bn,y:m.y==C||d==pn};tn[fe]-=h[0],tn[le]-=h[3];var en={x:Oi.round(tn[le]-nn[le]+Q),y:Oi.round(tn[fe]-nn[fe]+Z)};if(Vt&&(Ot.n||Ot.i||(en.x=Oi.round(nn[le]-tn[le]+Q)),Ot.n&&w&&(en.x*=-1),Ot.i&&w&&(en.x=Oi.round(nn[le]-tn[le]+(vn.N-Q)))),g.x!=O||g.y!=O||m.x==A||m.y==A||Vt){var on=p[0],an=ln?on[xi.bCR]():{width:on[xi.oW],height:on[xi.oH]},un={w:an[he]+h[3]+h[1],h:an[pe]+h[0]+h[2]},fn=function(n){var t=ni(n),r=t.F,e=t.P,i=t.U,o=g[i]==(n&&Vt?O:"end"),a="center"==g[i],u=g[i]==k,f=m[i]==C,c=m[i]==A,s=ee[r],l=nn[e],v=un[r],d=tn[e],h=a?2:1,p=d+v/2,b=l+s/2,y=v<=s&&l<=d&&d+v<=l+s;f?rn[i]=!0:rn[i]||((u||c)&&(rn[i]=c&&y,o=v<s?b<p:p<b),en[i]-=o||a?(s/h-v/h)*(n&&Vt&&w?-1:1):0)};fn(!0),fn(!1)}rn.y&&delete en.y,rn.x&&delete en.x,n=en}}z[_e]=U(!0,P(!0,n)),z[Se]=U(!1,P(!1,n)),s=z[_e]!==hi,l=z[Se]!==hi,(s||l)&&(0<t||_)?_?(t.complete=j,Zt.animate(z,t)):(v={duration:t,complete:j},Si.isA(r)||Ci.isPlainObject(r)?(T[_e]=r[0]||r.x,T[Se]=r[1]||r.y,v.specialEasing=T):v.easing=r,Zt.animate(z,v)):(s&&Zt[_e](z[_e]),l&&Zt[Se](z[Se]),I())},St.scrollStop=function(n,t,r){return Zt.stop(n,t,r),St},St.getElements=function(n){var t={target:or,host:ar,padding:fr,viewport:cr,content:sr,scrollbarHorizontal:{scrollbar:f[0],track:s[0],handle:l[0]},scrollbarVertical:{scrollbar:v[0],track:b[0],handle:y[0]},scrollbarCorner:ir[0]};return cn(n)==mi?bt(t,n):t},St.getState=function(n){function t(n){if(!Ci.isPlainObject(n))return n;var r=fi({},n),t=function(n,t){r[xi.hOP](n)&&(r[t]=r[n],delete r[n])};return t("w",he),t("h",pe),delete r.c,r}var r={destroyed:!!t(Lt),sleeping:!!t($t),autoUpdate:t(!qr),widthAuto:t(br),heightAuto:t(yr),padding:t(gr),overflowAmount:t(kr),hideOverflow:t(pr),hasOverflow:t(hr),contentScrollSize:t(vr),viewportSize:t(ee),hostSize:t(lr),documentMixed:t(w)};return cn(n)==mi?bt(r,n):r},St.ext=function(n){var t,r="added removed on contract".split(" "),e=0;if(cn(n)==mi){if(Pn[xi.hOP](n))for(t=fi({},Pn[n]);e<r.length;e++)delete t[r[e]]}else for(e in t={},Pn)t[e]=fi({},St.ext(e));return t},St.addExt=function(n,t){var r,e,i,o,a=zi.extension(n),u=!0;if(a){if(Pn[xi.hOP](n))return St.ext(n);if((r=a.extensionFactory.call(St,fi({},a.defaultOptions),Ci,Si))&&(i=r.contract,cn(i)==bi&&(o=i(vi),u=cn(o)==gi?o:u),u))return e=(Pn[n]=r).added,cn(e)==bi&&e(t),St.ext(n)}else console.warn('A extension with the name "'+n+"\" isn't registered.")},St.removeExt=function(n){var t,r=Pn[n];return!!r&&(delete Pn[n],t=r.removed,cn(t)==bi&&t(),!0)},zi.valid(function wt(n,t,r){var e,i;return o=xt.defaultOptions,Ct=xt.nativeScrollbarStyling,Ht=fi({},xt.nativeScrollbarSize),zt=fi({},xt.nativeScrollbarIsOverlaid),Tt=fi({},xt.overlayScrollbarDummySize),Ot=fi({},xt.rtlScrollBehavior),ot(fi({},o,t)),At=xt.cssCalc,I=xt.msie,kt=xt.autoUpdateRecommended,j=xt.supportTransition,ln=xt.supportTransform,g=xt.supportPassiveEvents,A=xt.supportResizeObserver,h=xt.supportMutationObserver,xt.restrictedMeasuring,F=Ci(n.ownerDocument),H=F[0],u=Ci(H.defaultView||H.parentWindow),x=u[0],c=gt(F,"html"),P=gt(c,"body"),Yt=Ci(n),or=Yt[0],Nt=Yt.is("textarea"),Wt=Yt.is("body"),w=H!==di,p=Nt?Yt.hasClass(yn)&&Yt.parent().hasClass(_n):Yt.hasClass(rn)&&Yt.children(W+gn)[xi.l],zt.x&&zt.y&&!qt.nativeScrollbarsOverlaid.initialize?(ti("onInitializationWithdrawn"),p&&(at(!0),ft(!0),st(!0)),$t=Lt=!0):(Wt&&((e={}).l=Oi.max(Yt[_e](),c[_e](),u[_e]()),e.t=Oi.max(Yt[Se](),c[Se](),u[Se]()),i=function(){Zt.removeAttr(xi.ti),Yn(Zt,$,i,!0,!0)}),at(),ft(),st(),ut(),ct(!0),ct(!1),function s(){var r,t=x.top!==x,e={},i={},o={};function a(n){if(f(n)){var t=c(n),r={};(ne||Zr)&&(r[he]=i.w+(t.x-e.x)*o.x),(te||Zr)&&(r[pe]=i.h+(t.y-e.y)*o.y),Kt.css(r),Si.stpP(n)}else u(n)}function u(n){var t=n!==hi;
10073Yn(F,[J,B,q],[tt,a,u],!0),si(P,En),ir.releaseCapture&&ir.releaseCapture(),t&&(r&&Ue(),St.update(me)),r=!1}function f(n){var t=(n.originalEvent||n).touches!==hi;return!$t&&!Lt&&(1===Si.mBtn(n)||t)}function c(n){return I&&t?{x:n.screenX,y:n.screenY}:Si.page(n)}Kn(ir,$,function(n){f(n)&&!Qr&&(qr&&(r=!0,Ve()),e=c(n),i.w=ar[xi.oW]-(Dt?0:Et),i.h=ar[xi.oH]-(Dt?0:It),o=vt(),Yn(F,[J,B,q],[tt,a,u]),ci(P,En),ir.setCapture&&ir.setCapture(),Si.prvD(n),Si.stpP(n))})}(),Gn(),Pe(Jt,Jn),Wt&&(Zt[_e](e.l)[Se](e.t),di.activeElement==n&&cr.focus&&(Zt.attr(xi.ti,"-1"),cr.focus(),Yn(Zt,$,i,!1,!0))),St.update(me),Rt=!0,ti("onInitialized"),d(jn,function(n,t){ti(t.n,t.a)}),jn=[],cn(r)==mi&&(r=[r]),Si.isA(r)?d(r,function(n,t){St.addExt(t)}):Ci.isPlainObject(r)&&d(r,function(n,t){St.addExt(n,t)}),setTimeout(function(){j&&!Lt&&ci(Kt,fn)},333)),St}(r,n,t))&&Ai(r,St),St}function Yn(n,t,r,e,i){var o=Si.isA(t)&&Si.isA(r),a=e?"removeEventListener":"addEventListener",u=e?"off":"on",f=!o&&t.split(xe),c=0,s=Ci.isPlainObject(i),l=g&&(s?i.V:i)||!1,v=s&&(i.$||!1),d=g?{passive:l,capture:v}:v;if(o)for(;c<t[xi.l];c++)Yn(n,t[c],r[c],e,i);else for(;c<f[xi.l];c++)g?n[0][a](f[c],r,d):n[u](f[c],r)}function Kn(n,t,r,e){Yn(n,t,r,!1,e),Xn.push(Si.bind(Yn,0,n,t,r,!0,e))}function Pe(n,t){if(n){var r=Si.rO(),e="animationstart mozAnimationStart webkitAnimationStart MSAnimationStart",i="childNodes",o=3333333,a=function(){n[Se](o)[_e](Vt?Ot.n?-o:Ot.i?0:o:o),t()};if(t){if(A)((k=n.addClass("observed").append(ai(Sn)).contents()[0])[Z]=new r(a)).observe(k);else if(9<I||!kt){n.prepend(ai(Sn,ai({c:zn,dir:"ltr"},ai(zn,ai(Tn))+ai(zn,ai({c:Tn,style:"width: 200%; height: 200%"})))));var u,f,c,s,l=n[0][i][0][i][0],v=Ci(l[i][1]),d=Ci(l[i][0]),h=Ci(d[0][i][0]),p=l[xi.oW],b=l[xi.oH],y=xt.nativeScrollbarSize,m=function(){d[_e](o)[Se](o),v[_e](o)[Se](o)},g=function(){f=0,u&&(p=c,b=s,a())},w=function(n){return c=l[xi.oW],s=l[xi.oH],u=c!=p||s!=b,n&&u&&!f?(Si.cAF()(f),f=Si.rAF()(g)):n||g(),m(),n&&(Si.prvD(n),Si.stpP(n)),!1},x={},_={};ri(_,ye,[-2*(y.y+1),-2*y.x,-2*y.y,-2*(y.x+1)]),Ci(l).css(_),d.on(ge,w),v.on(ge,w),n.on(e,function(){w(!1)}),x[he]=o,x[pe]=o,h.css(x),m()}else{var S=H.attachEvent,z=I!==hi;if(S)n.prepend(ai(Sn)),gt(n,W+Sn)[0].attachEvent("onresize",a);else{var T=H.createElement(pi);T.setAttribute(xi.ti,"-1"),T.setAttribute(xi.c,Sn),T.onload=function(){var n=this.contentDocument.defaultView;n.addEventListener("resize",a),n.document.documentElement.style.display="none"},T.type="text/html",z&&n.prepend(T),T.data="about:blank",z||n.prepend(T),n.on(e,a)}}if(n[0]===R){var O=function(){var n=Kt.css("direction"),t={},r=0,e=!1;return n!==L&&(r="ltr"===n?(t[le]=0,t[ce]=me,o):(t[le]=me,t[ce]=0,Ot.n?-o:Ot.i?0:o),Jt.children().eq(0).css(t),Jt[_e](r)[Se](o),L=n,e=!0),e};O(),Kn(n,ge,function(n){return O()&&Xe(),Si.prvD(n),Si.stpP(n),!1})}}else if(A){var k,C=(k=n.contents()[0])[Z];C&&(C.disconnect(),delete k[Z])}else mt(n.children(W+Sn).eq(0))}}function Gn(){if(h){var o,a,u,f,c,s,r,e,i,l,n=Si.mO(),v=Si.now();O=function(n){var t=!1;return Rt&&!$t&&(d(n,function(){return!(t=function o(n){var t=n.attributeName,r=n.target,e=n.type,i="closest";if(r===sr)return null===t;if("attributes"===e&&(t===xi.c||t===xi.s)&&!Nt){if(t===xi.c&&Ci(r).hasClass(rn))return et(n.oldValue,r.className);if(typeof r[i]!=bi)return!0;if(null!==r[i](W+Sn)||null!==r[i](W+kn)||null!==r[i](W+Wn))return!1}return!0}(this))}),t&&(e=Si.now(),i=yr||br,l=function(){Lt||(v=e,Nt&&Be(),i?Xe():St.update(me))},clearTimeout(r),11<e-v||!i?l():r=setTimeout(l,11))),t},S=new n(T=function(n){var t,r=!1,e=!1,i=[];return Rt&&!$t&&(d(n,function(){o=(t=this).target,a=t.attributeName,u=a===xi.c,f=t.oldValue,c=o.className,p&&u&&!e&&-1<f.indexOf(en)&&c.indexOf(en)<0&&(s=lt(!0),ar.className=c.split(xe).concat(f.split(xe).filter(function(n){return n.match(s)})).join(xe),r=e=!0),r=r||(u?et(f,c):a!==xi.s||f!==o[xi.s].cssText),i.push(a)}),it(i),r&&St.update(e||me)),r}),z=new n(O)}}function Ue(){h&&!qr&&(S.observe(ar,{attributes:!0,attributeOldValue:!0,attributeFilter:Bn}),z.observe(Nt?or:sr,{attributes:!0,attributeOldValue:!0,subtree:!Nt,childList:!Nt,characterData:!Nt,attributeFilter:Nt?qn:Bn}),qr=!0)}function Ve(){h&&qr&&(S.disconnect(),z.disconnect(),qr=!1)}function Jn(){if(!$t){var n,t={w:R[xi.sW],h:R[xi.sH]};n=ui(t,_),_=t,n&&Xe({A:!0})}}function Qn(){Jr&&Ge(!0)}function Zn(){Jr&&!P.hasClass(En)&&Ge(!1)}function nt(){Gr&&(Ge(!0),clearTimeout(C),C=setTimeout(function(){Gr&&!Lt&&Ge(!1)},100))}function tt(n){return Si.prvD(n),!1}function rt(n){var r=Ci(n.target);yt(function(n,t){r.is(t)&&Xe({k:!0})})}function $e(n){n||$e(!0),Yn(Kt,B.split(xe)[0],nt,!Gr||n,!0),Yn(Kt,[X,Y],[Qn,Zn],!Jr||n,!0),Rt||n||Kt.one("mouseover",Qn)}function qe(){var n={};return Wt&&tr&&(n.w=ii(tr.css(ve+he)),n.h=ii(tr.css(ve+pe)),n.c=ui(n,$r),n.f=!0),!!($r=n).c}function et(n,t){var r,e,i=typeof t==mi?t.split(xe):[],o=function u(n,t){var r,e,i=[],o=[];for(r=0;r<n.length;r++)i[n[r]]=!0;for(r=0;r<t.length;r++)i[t[r]]?delete i[t[r]]:i[t[r]]=!0;for(e in i)o.push(e);return o}(typeof n==mi?n.split(xe):[],i),a=sn(Ie,o);if(-1<a&&o.splice(a,1),0<o[xi.l])for(e=lt(!0,!0),r=0;r<o.length;r++)if(!o[r].match(e))return!0;return!1}function it(n){d(n=n||Fn,function(n,t){if(-1<Si.inA(t,Fn)){var r=Yt.attr(t);
10073cn(r)==mi?Zt.attr(t,r):Zt.removeAttr(t)}})}function Be(){if(!$t){var n,t,r,e,i=!jr,o=ee.w,a=ee.h,u={},f=br||i;return u[ve+he]=ye,u[ve+pe]=ye,u[he]=me,Yt.css(u),n=or[xi.oW],t=f?Oi.max(n,or[xi.sW]-1):1,u[he]=br?me:we,u[ve+he]=we,u[pe]=me,Yt.css(u),r=or[xi.oH],e=Oi.max(r,or[xi.sH]-1),u[he]=t,u[pe]=e,er.css(u),u[ve+he]=o,u[ve+pe]=a,Yt.css(u),{q:n,B:r,X:t,Y:e}}}function Xe(n){clearTimeout(Xt),n=n||{},je.A|=n.A,je.k|=n.k,je.H|=n.H;var t,r=Si.now(),e=!!je.A,i=!!je.k,o=!!je.H,a=n.C,u=0<Fe&&Rt&&!Lt&&!o&&!a&&r-Bt<Fe&&!yr&&!br;if(u&&(Xt=setTimeout(Xe,Fe)),!(Lt||u||$t&&!a||Rt&&!o&&(t=Kt.is(":hidden"))||"inline"===Kt.css("display"))){Bt=r,je={},!Ct||zt.x&&zt.y?Ht=fi({},xt.nativeScrollbarSize):(Ht.x=0,Ht.y=0),ie={x:3*(Ht.x+(zt.x?0:3)),y:3*(Ht.y+(zt.y?0:3))},a=a||{};var f=function(){return ui.apply(this,[].slice.call(arguments).concat([o]))},c={x:Zt[_e](),y:Zt[Se]()},s=qt.scrollbars,l=qt.textarea,v=s.visibility,d=f(v,Rr),h=s.autoHide,p=f(h,Lr),b=s.clickScrolling,y=f(b,Nr),m=s.dragScrolling,g=f(m,Wr),w=qt.className,x=f(w,Er),_=qt.resize,S=f(_,Dr)&&!Wt,z=qt.paddingAbsolute,T=f(z,Sr),O=qt.clipAlways,k=f(O,zr),C=qt.sizeAutoCapable&&!Wt,A=f(C,Hr),H=qt.nativeScrollbarsOverlaid.showNativeScrollbars,R=f(H,Cr),L=qt.autoUpdate,N=f(L,Ar),W=qt.overflowBehavior,D=f(W,Or,o),M=l.dynWidth,E=f(Vr,M),I=l.dynHeight,j=f(Ur,I);if(Yr="n"===h,Kr="s"===h,Gr="m"===h,Jr="l"===h,Xr=s.autoHideDelay,Ir=Er,Qr="n"===_,Zr="b"===_,ne="h"===_,te="v"===_,Mr=qt.normalizeRTL,H=H&&zt.x&&zt.y,Rr=v,Lr=h,Nr=b,Wr=m,Er=w,Dr=_,Sr=z,zr=O,Hr=C,Cr=H,Ar=L,Or=fi({},W),Vr=M,Ur=I,hr=hr||{x:!1,y:!1},x&&(si(Kt,Ir+xe+Ie),ci(Kt,w!==hi&&null!==w&&0<w.length?w:Ie)),N&&(!0===L||null===L&&kt?(Ve(),_t.add(St)):(_t.remove(St),Ue())),A)if(C)if(rr?rr.show():(rr=Ci(ai(Le)),Qt.before(rr)),Mt)Gt.show();else{Gt=Ci(ai(Ne)),ur=Gt[0],rr.before(Gt);var F={w:-1,h:-1};Pe(Gt,function(){var n={w:ur[xi.oW],h:ur[xi.oH]};ui(n,F)&&(Rt&&yr&&0<n.h||br&&0<n.w||Rt&&!yr&&0===n.h||!br&&0===n.w)&&Xe(),F=n}),Mt=!0,null!==At&&Gt.css(pe,At+"(100% + 1px)")}else Mt&&Gt.hide(),rr&&rr.hide();o&&(Jt.find("*").trigger(ge),Mt&&Gt.find("*").trigger(ge)),t=t===hi?Kt.is(":hidden"):t;var P,U=!!Nt&&"off"!==Yt.attr("wrap"),V=f(U,jr),$=Kt.css("direction"),q=f($,_r),B=Kt.css("box-sizing"),X=f(B,mr),Y=ei(ae);try{P=Mt?ur[xi.bCR]():null}catch(gt){return}Dt="border-box"===B;var K=(Vt="rtl"===$)?le:ce,G=Vt?ce:le,J=!1,Q=!(!Mt||"none"===Kt.css(be))&&(0===Oi.round(P.right-P.left)&&(!!z||0<ar[xi.cW]-Et));if(C&&!Q){var Z=ar[xi.oW],nn=rr.css(he);rr.css(he,me);var tn=ar[xi.oW];rr.css(he,nn),(J=Z!==tn)||(rr.css(he,Z+1),tn=ar[xi.oW],rr.css(he,nn),J=Z!==tn)}var rn=(Q||J)&&C&&!t,en=f(rn,br),on=!rn&&br,an=!(!Mt||!C||t)&&0===Oi.round(P.bottom-P.top),un=f(an,yr),fn=!an&&yr,cn=ei(ue,"-"+he,!(rn&&Dt||!Dt),!(an&&Dt||!Dt)),sn=ei(oe),ln={},vn={},dn=function(){return{w:ar[xi.cW],h:ar[xi.cH]}},hn=function(){return{w:fr[xi.oW]+Oi.max(0,sr[xi.cW]-sr[xi.sW]),h:fr[xi.oH]+Oi.max(0,sr[xi.cH]-sr[xi.sH])}},pn=Et=Y.l+Y.r,bn=It=Y.t+Y.b;if(pn*=z?1:0,bn*=z?1:0,Y.c=f(Y,gr),jt=cn.l+cn.r,Ft=cn.t+cn.b,cn.c=f(cn,wr),Pt=sn.l+sn.r,Ut=sn.t+sn.b,sn.c=f(sn,xr),jr=U,_r=$,mr=B,br=rn,yr=an,gr=Y,wr=cn,xr=sn,q&&Mt&&Gt.css(be,G),Y.c||q||T||en||un||X||A){var yn={},mn={},gn=[Y.t,Y.r,Y.b,Y.l];ri(vn,oe,[-Y.t,-Y.r,-Y.b,-Y.l]),z?(ri(yn,ye,gn),ri(Nt?mn:ln,ae)):(ri(yn,ye),ri(Nt?mn:ln,ae,gn)),Qt.css(yn),Yt.css(mn)}ee=hn();var wn=!!Nt&&Be(),xn=Nt&&f(wn,Pr),_n=Nt&&wn?{w:M?wn.X:wn.q,h:I?wn.Y:wn.B}:{};if(Pr=wn,an&&(un||T||X||Y.c||cn.c)?ln[pe]=me:(un||T)&&(ln[pe]=we),rn&&(en||T||X||Y.c||cn.c||q)?(ln[he]=me,vn[de+he]=we):(en||T)&&(ln[he]=we,ln[be]=ye,vn[de+he]=ye),rn?(vn[he]=me,ln[he]=_i.v(he,"max-content intrinsic")||me,ln[be]=G):vn[he]=ye,vn[pe]=an?_n.h||sr[xi.cH]:ye,C&&rr.css(vn),nr.css(ln),ln={},vn={},e||i||xn||q||X||T||en||rn||un||an||R||D||k||S||d||p||g||y||E||j||V){var Sn="overflow",zn=Sn+"-x",Tn=Sn+"-y";if(!Ct){var On={},kn=hr.y&&pr.ys&&!H?zt.y?Zt.css(K):-Ht.y:0,Cn=hr.x&&pr.xs&&!H?zt.x?Zt.css(se):-Ht.x:0;ri(On,ye),Zt.css(On)}var An=oi(),Hn={w:_n.w||An[xi.cW],h:_n.h||An[xi.cH]},Rn=An[xi.sW],Ln=An[xi.sH];Ct||(On[se]=fn?ye:Cn,On[K]=on?ye:kn,Zt.css(On)),ee=hn();var Nn=dn(),Wn={w:Nn.w-Pt-jt-(Dt?0:Et),h:Nn.h-Ut-Ft-(Dt?0:It)},Dn={w:Oi.max((rn?Hn.w:Rn)+pn,Wn.w),h:Oi.max((an?Hn.h:Ln)+bn,Wn.h)};if(Dn.c=f(Dn,Tr),Tr=Dn,C){(Dn.c||an||rn)&&(vn[he]=Dn.w,vn[pe]=Dn.h,Nt||(Hn={w:An[xi.cW],h:An[xi.
10073cH]}));var Mn={},En=function(n){var t=ni(n),r=t.F,e=t.K,i=n?rn:an,o=n?jt:Ft,a=n?Et:It,u=n?Pt:Ut,f=ee[r]-o-u-(Dt?0:a);i&&(i||!cn.c)||(vn[e]=Wn[r]-1),!(i&&Hn[r]<f)||n&&Nt&&U||(Nt&&(Mn[e]=ii(er.css(e))-1),--vn[e]),0<Hn[r]&&(vn[e]=Oi.max(1,vn[e]))};En(!0),En(!1),Nt&&er.css(Mn),rr.css(vn)}rn&&(ln[he]=we),!rn||Dt||qr||(ln[be]="none"),nr.css(ln),ln={};var In={w:An[xi.sW],h:An[xi.sH]};In.c=i=f(In,vr),vr=In,ee=hn(),e=f(Nn=dn(),lr),lr=Nn;var jn=Nt&&(0===ee.w||0===ee.h),Fn=kr,Pn={},Un={},Vn={},$n={},qn={},Bn={},Xn={},Yn=fr[xi.bCR](),Kn=function(n){var t=ni(n),r=ni(!n).U,e=t.U,i=t.F,o=t.K,a=ge+t.G+"Max",u=Yn[o]?Oi.abs(Yn[o]-ee[i]):0,f=Fn&&0<Fn[e]&&0===cr[a];Pn[e]="v-s"===W[e],Un[e]="v-h"===W[e],Vn[e]="s"===W[e],$n[e]=Oi.max(0,Oi.round(100*(In[i]-ee[i]))/100),$n[e]*=jn||f&&0<u&&u<1?0:1,qn[e]=0<$n[e],Bn[e]=Pn[e]||Un[e]?qn[r]&&!Pn[r]&&!Un[r]:qn[e],Bn[e+"s"]=!!Bn[e]&&(Vn[e]||Pn[e]),Xn[e]=qn[e]&&Bn[e+"s"]};if(Kn(!0),Kn(!1),$n.c=f($n,kr),kr=$n,qn.c=f(qn,hr),hr=qn,Bn.c=f(Bn,pr),pr=Bn,zt.x||zt.y){var Gn,Jn={},Qn={},Zn=o;(qn.x||qn.y)&&(Qn.w=zt.y&&qn.y?In.w+Tt.y:ye,Qn.h=zt.x&&qn.x?In.h+Tt.x:ye,Zn=f(Qn,dr),dr=Qn),(qn.c||Bn.c||In.c||q||en||un||rn||an||R)&&(ln[oe+G]=ln[ue+G]=ye,Gn=function(n){var t=ni(n),r=ni(!n),e=t.U,i=n?se:K,o=n?an:rn;zt[e]&&qn[e]&&Bn[e+"s"]?(ln[oe+i]=!o||H?ye:Tt[e],ln[ue+i]=n&&o||H?ye:Tt[e]+"px solid transparent"):(Qn[r.F]=ln[oe+i]=ln[ue+i]=ye,Zn=!0)},Ct?li(Zt,He,!H):(Gn(!0),Gn(!1))),H&&(Qn.w=Qn.h=ye,Zn=!0),Zn&&!Ct&&(Jn[he]=Bn.y?Qn.w:ye,Jn[pe]=Bn.x?Qn.h:ye,tr||(tr=Ci(ai(Re)),Zt.prepend(tr)),tr.css(Jn)),nr.css(ln)}var nt,tt={};yn={};if((e||qn.c||Bn.c||In.c||D||X||R||q||k||un)&&(tt[G]=ye,(nt=function(n){var t=ni(n),r=ni(!n),e=t.U,i=t.J,o=n?se:K,a=function(){tt[o]=ye,re[r.F]=0};qn[e]&&Bn[e+"s"]?(tt[Sn+i]=ge,H||Ct?a():(tt[o]=-(zt[e]?Tt[e]:Ht[e]),re[r.F]=zt[e]?Tt[r.U]:0)):(tt[Sn+i]=ye,a())})(!0),nt(!1),!Ct&&(ee.h<ie.x||ee.w<ie.y)&&(qn.x&&Bn.x&&!zt.x||qn.y&&Bn.y&&!zt.y)?(tt[ae+fe]=ie.x,tt[oe+fe]=-ie.x,tt[ae+G]=ie.y,tt[oe+G]=-ie.y):tt[ae+fe]=tt[oe+fe]=tt[ae+G]=tt[oe+G]=ye,tt[ae+K]=tt[oe+K]=ye,qn.x&&Bn.x||qn.y&&Bn.y||jn?Nt&&jn&&(yn[zn]=yn[Tn]="hidden"):(!O||Un.x||Pn.x||Un.y||Pn.y)&&(Nt&&(yn[zn]=yn[Tn]=ye),tt[zn]=tt[Tn]="visible"),Qt.css(yn),Zt.css(tt),tt={},(qn.c||X||en||un)&&(!zt.x||!zt.y))){var rt=sr[xi.s];rt.webkitTransform="scale(1)",rt.display="run-in",sr[xi.oH],rt.display=ye,rt.webkitTransform=ye}if(ln={},q||en||un)if(Vt&&rn){var et=nr.css(be),it=Oi.round(nr.css(be,ye).css(le,ye).position().left);nr.css(be,et),it!==Oi.round(nr.position().left)&&(ln[le]=it)}else ln[le]=ye;if(nr.css(ln),Nt&&i){var ot=function wt(){var n=or.selectionStart;if(n===hi)return;var t,r,e=Yt.val(),i=e[xi.l],o=e.split("\n"),a=o[xi.l],u=e.substr(0,n).split("\n"),f=0,c=0,s=u[xi.l],l=u[u[xi.l]-1][xi.l];for(r=0;r<o[xi.l];r++)t=o[r][xi.l],c<t&&(f=r+1,c=t);return{Q:s,Z:l,nn:a,tn:c,rn:f,en:n,"in":i}}();if(ot){var at=Fr===hi||ot.nn!==Fr.nn,ut=ot.Q,ft=ot.Z,ct=ot.rn,st=ot.nn,lt=ot.tn,vt=ot.en,dt=ot["in"]<=vt&&Br,ht={x:U||ft!==lt||ut!==ct?-1:kr.x,y:(U?dt||at&&Fn&&c.y===Fn.y:(dt||at)&&ut===st)?kr.y:-1};c.x=-1<ht.x?Vt&&Mr&&Ot.i?0:ht.x:c.x,c.y=-1<ht.y?ht.y:c.y}Fr=ot}Vt&&Ot.i&&zt.y&&qn.x&&Mr&&(c.x+=re.w||0),rn&&Kt[_e](0),an&&Kt[Se](0),Zt[_e](c.x)[Se](c.y);var pt="v"===v,bt="h"===v,yt="a"===v,mt=function(n,t){t=t===hi?n:t,Ke(!0,n,Xn.x),Ke(!1,t,Xn.y)};li(Kt,ke,Bn.x||Bn.y),li(Kt,Ce,Bn.x),li(Kt,Ae,Bn.y),q&&!Wt&&li(Kt,ze,Vt),Wt&&ci(Kt,Te),S&&(li(Kt,Te,Qr),li(ir,We,!Qr),li(ir,De,Zr),li(ir,Me,ne),li(ir,Ee,te)),(d||D||Bn.c||qn.c||R)&&(H?R&&(si(Kt,Oe),H&&mt(!1)):yt?mt(Xn.x,Xn.y):pt?mt(!0):bt&&mt(!1)),(p||R)&&($e(!Jr&&!Gr),Ge(Yr,!Yr)),(e||$n.c||un||en||S||X||T||R||q)&&(Je(!0),Qe(!0),Je(!1),Qe(!1)),y&&Ze(!0,b),g&&Ze(!1,m),ti("onDirectionChanged",{isRTL:Vt,dir:$},q),ti("onHostSizeChanged",{width:lr.w,height:lr.h},e),ti("onContentSizeChanged",{width:vr.w,height:vr.h},i),ti("onOverflowChanged",{x:qn.x,y:qn.y,xScrollable:Bn.xs,yScrollable:Bn.ys,clipped:Bn.x||Bn.y},qn.c||Bn.c),ti("onOverflowAmountChanged",{x:$n.x,y:$n.y},$n.c)}Wt&&$r&&(hr.c||$r.c)&&($r.f||qe(),zt.y&&hr.x&&nr.css(ve+he,$r.w+Tt.y),zt.x&&hr.y&&nr.css(ve+pe,$r.h+Tt.x),$r.c=!1),Rt&&a.updateOnLoad&&Ye(),ti("onUpdated",{forced:o})}}function Ye(){Nt||yt(function(n,t){nr.find(t).each(function(n,t){Si.inA(t,Vn)<0&&(Vn.push(t),Ci(t).off(Un,rt).on(Un,rt))})})}function ot(n){var t=Ti._(n,Ti.g,!0,a);return a=fi({},a,t.S),qt=fi({},qt,t.z),t.z}
10073function at(e){var n="parent",t=yn+xe+On,r=Nt?xe+On:ye,i=qt.textarea.inheritedAttrs,o={},a=function(){var r=e?Yt:Kt;d(o,function(n,t){cn(t)==mi&&(n==xi.c?r.addClass(t):r.attr(n,t))})},u=[rn,en,on,Te,ze,an,un,fn,Oe,ke,Ce,Ae,Ie,yn,On,Er].join(xe),f={};Kt=Kt||(Nt?p?Yt[n]()[n]()[n]()[n]():Ci(ai(on)):Yt),nr=nr||pt(_n+r),Zt=Zt||pt(wn+r),Qt=Qt||pt(gn+r),Jt=Jt||pt("os-resize-observer-host"),er=er||(Nt?pt(mn):hi),p&&ci(Kt,en),e&&si(Kt,u),i=cn(i)==mi?i.split(xe):i,Si.isA(i)&&Nt&&d(i,function(n,t){cn(t)==mi&&(o[t]=e?Kt.attr(t):Yt.attr(t))}),e?(p&&Rt?(Jt.children().remove(),d([Qt,Zt,nr,er],function(n,t){t&&si(t.removeAttr(xi.s),In)}),ci(Kt,Nt?on:rn)):(mt(Jt),nr.contents().unwrap().unwrap().unwrap(),Nt&&(Yt.unwrap(),mt(Kt),mt(er),a())),Nt&&Yt.removeAttr(xi.s),Wt&&si(c,tn)):(Nt&&(qt.sizeAutoCapable||(f[he]=Yt.css(he),f[pe]=Yt.css(pe)),p||Yt.addClass(On).wrap(Kt),Kt=Yt[n]().css(f)),p||(ci(Yt,Nt?t:rn),Kt.wrapInner(nr).wrapInner(Zt).wrapInner(Qt).prepend(Jt),nr=gt(Kt,W+_n),Zt=gt(Kt,W+wn),Qt=gt(Kt,W+gn),Nt&&(nr.prepend(er),a())),Ct&&ci(Zt,He),zt.x&&zt.y&&ci(Zt,xn),Wt&&ci(c,tn),R=Jt[0],ar=Kt[0],fr=Qt[0],cr=Zt[0],sr=nr[0],it())}function ut(){var r,t,e=[112,113,114,115,116,117,118,119,120,121,123,33,34,37,38,39,40,16,17,18,19,20,144],i=[],n="focus";function o(n){Be(),St.update(me),n&&kt&&clearInterval(r)}Nt?(9<I||!kt?Kn(Yt,"input",o):Kn(Yt,[K,G],[function a(n){var t=n.keyCode;sn(t,e)<0&&(i[xi.l]||(o(),r=setInterval(o,1e3/60)),sn(t,i)<0&&i.push(t))},function u(n){var t=n.keyCode,r=sn(t,i);sn(t,e)<0&&(-1<r&&i.splice(r,1),i[xi.l]||o(!0))}]),Kn(Yt,[ge,"drop",n,n+"out"],[function f(n){return Yt[_e](Ot.i&&Mr?9999999:0),Yt[Se](0),Si.prvD(n),Si.stpP(n),!1},function c(n){setTimeout(function(){Lt||o()},50)},function s(){Br=!0,ci(Kt,n)},function l(){Br=!1,i=[],si(Kt,n),o(!0)}])):Kn(nr,Q,function v(n){!0!==Ar&&function l(n){if(!Rt)return 1;var t="flex-grow",r="flex-shrink",e="flex-basis",i=[he,ve+he,de+he,oe+le,oe+ce,le,ce,"font-weight","word-spacing",t,r,e],o=[ae+le,ae+ce,ue+le+he,ue+ce+he],a=[pe,ve+pe,de+pe,oe+fe,oe+se,fe,se,"line-height",t,r,e],u=[ae+fe,ae+se,ue+fe+he,ue+se+he],f="s"===Or.x||"v-s"===Or.x,c=!1,s=function(n,t){for(var r=0;r<n[xi.l];r++)if(n[r]===t)return!0;return!1};return("s"===Or.y||"v-s"===Or.y)&&((c=s(a,n))||Dt||(c=s(u,n))),f&&!c&&((c=s(i,n))||Dt||(c=s(o,n))),c}((n=n.originalEvent||n).propertyName)&&St.update(me)}),Kn(Zt,ge,function d(n){$t||(t!==hi?clearTimeout(t):((Kr||Gr)&&Ge(!0),ht()||ci(Kt,Oe),ti("onScrollStart",n)),V||(Qe(!0),Qe(!1)),ti("onScroll",n),t=setTimeout(function(){Lt||(clearTimeout(t),t=hi,(Kr||Gr)&&Ge(!1),ht()||si(Kt,Oe),ti("onScrollStop",n))},175))},!0)}function ft(i){var n,t,o=function(n){var t=pt(kn+xe+(n?Dn:Mn),!0),r=pt(Cn,t),e=pt(Hn,t);return p||i||(t.append(r),r.append(e)),{an:t,un:r,cn:e}};function r(n){var t=ni(n),r=t.an,e=t.un,i=t.cn;p&&Rt?d([r,e,i],function(n,t){si(t.removeAttr(xi.s),In)}):mt(r||o(n).an)}i?(r(!0),r()):(n=o(!0),t=o(),f=n.an,s=n.un,l=n.cn,v=t.an,b=t.un,y=t.cn,p||(Qt.after(v),Qt.after(f)))}function ct(z){var T,i,O,k,e=ni(z),C=e.sn,t=x.top!==x,A=e.U,r=e.J,H=ge+e.G,o="active",a="snapHandle",u="click",R=1,f=[
1007316,17];function c(n){return I&&t?n["screen"+r]:Si.page(n)[A]}function s(n){return qt.scrollbars[n]}function l(){R=.5}function v(){R=1}function d(n){Si.stpP(n)}function L(n){-1<sn(n.keyCode,f)&&l()}function N(n){-1<sn(n.keyCode,f)&&v()}function W(n){var t=(n.originalEvent||n).touches!==hi;return!($t||Lt||ht()||!Wr||t&&!s("touchSupport"))&&(1===Si.mBtn(n)||t)}function h(n){if(W(n)){var t=C.I,r=C.D,e=C.N*((c(n)-O)*k/(t-r));e=isFinite(e)?e:0,Vt&&z&&!Ot.i&&(e*=-1),Zt[H](Oi.round(i+e)),V&&Qe(z,i+e),g||Si.prvD(n)}else D(n)}function D(n){if(n=n||n.originalEvent,Yn(F,[B,q,K,G,J],[h,D,L,N,tt],!0),Si.rAF()(function(){Yn(F,u,d,!0,{$:!0})}),V&&Qe(z,!0),V=!1,si(P,En),si(e.cn,o),si(e.un,o),si(e.an,o),k=1,v(),T!==(O=i=hi)&&(St.scrollStop(),clearTimeout(T),T=hi),n){var t=ar[xi.bCR]();n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Zn(),(Kr||Gr)&&Ge(!1)}}function M(n){i=Zt[H](),i=isNaN(i)?0:i,(Vt&&z&&!Ot.n||!Vt)&&(i=i<0?0:i),k=vt()[A],O=c(n),V=!s(a),ci(P,En),ci(e.cn,o),ci(e.an,o),Yn(F,[B,q,J],[h,D,tt]),Si.rAF()(function(){Yn(F,u,d,!1,{$:!0})}),!I&&w||Si.prvD(n),Si.stpP(n)}Kn(e.cn,$,function p(n){W(n)&&M(n)}),Kn(e.un,[$,X,Y],[function E(n){if(W(n)){var d,t=e.sn.D/Math.round(Oi.min(1,ee[e.F]/vr[e.F])*e.sn.I),h=Oi.round(ee[e.F]*t),p=270*t,b=400*t,y=e.un.offset()[e.P],r=n.ctrlKey,m=n.shiftKey,g=m&&r,w=!0,x=function(n){V&&Qe(z,n)},_=function(){x(),M(n)},S=function(){if(!Lt){var n=(O-y)*k,t=C.W,r=C.I,e=C.D,i=C.N,o=C.R,a=p*R,u=w?Oi.max(b,a):a,f=i*((n-e/2)/(r-e)),c=Vt&&z&&(!Ot.i&&!Ot.n||Mr),s=c?t<n:n<t,l={},v={easing:"linear",step:function(n){V&&(Zt[H](n),Qe(z,n))}};f=isFinite(f)?f:0,f=Vt&&z&&!Ot.i?i-f:f,m?(Zt[H](f),g?(f=Zt[H](),Zt[H](o),f=c&&Ot.i?i-f:f,f=c&&Ot.n?-f:f,l[A]=f,St.scroll(l,fi(v,{duration:130,complete:_}))):_()):(d=w?s:d,(c?d?n<=t+e:t<=n:d?t<=n:n<=t+e)?(clearTimeout(T),St.scrollStop(),T=hi,x(!0)):(T=setTimeout(S,u),l[A]=(d?"-=":"+=")+h,St.scroll(l,fi(v,{duration:a}))),w=!1)}};r&&l(),k=vt()[A],O=Si.page(n)[A],V=!s(a),ci(P,En),ci(e.un,o),ci(e.an,o),Yn(F,[q,K,G,J],[D,L,N,tt]),S(),Si.prvD(n),Si.stpP(n)}},function b(n){U=!0,(Kr||Gr)&&Ge(!0)},function y(n){U=!1,(Kr||Gr)&&Ge(!1)}]),Kn(e.an,$,function m(n){Si.stpP(n)}),j&&Kn(e.an,Q,function(n){n.target===e.an[0]&&(Je(z),Qe(z))})}function Ke(n,t,r){var e=n?f:v;li(Kt,n?an:un,!t),li(e,Ln,!r)}function Ge(n,t){if(clearTimeout(k),n)si(f,Nn),si(v,Nn);else{var r,e=function(){U||Lt||(!(r=l.hasClass("active")||y.hasClass("active"))&&(Kr||Gr||Jr)&&ci(f,Nn),!r&&(Kr||Gr||Jr)&&ci(v,Nn))};0<Xr&&!0!==t?k=setTimeout(e,Xr):e()}}function Je(n){var t={},r=ni(n),e=r.sn,i=Oi.min(1,ee[r.F]/vr[r.F]);t[r.K]=Oi.floor(100*i*1e6)/1e6+"%",ht()||r.cn.css(t),e.D=r.cn[0]["offset"+r.ln],e.M=i}function Qe(n,t){var r,e,i=cn(t)==gi,o=Vt&&n,a=ni(n),u=a.sn,f="translate(",c=_i.u("transform"),s=_i.u("transition"),l=n?Zt[_e]():Zt[Se](),v=t===hi||i?l:t,d=u.D,h=a.un[0]["offset"+a.ln],p=h-d,b={},y=(cr[ge+a.ln]-cr["client"+a.ln])*(Ot.n&&o?-1:1),m=function(n){return isNaN(n/y)?0:Oi.max(0,Oi.min(1,n/y))},g=function(n){var t=p*n;return t=isNaN(t)?0:t,t=o&&!Ot.i?h-d-t:t,t=Oi.max(0,t)},w=m(l),x=g(m(v)),_=g(w);u.N=y,u.R=l,u.L=w,ln?(r=o?-(h-d-x):x,e=n?f+r+"px, 0)":f+"0, "+r+"px)",b[c]=e,j&&(b[s]=i&&1<Oi.abs(x-u.W)?function S(n){var t=_i.u("transition"),r=n.css(t);if(r)return r;for(var e,i,o,a="\\s*(([^,(]+(\\(.+?\\))?)+)[\\s,]*",u=new RegExp(a),f=new RegExp("^("+a+")+$"),c="property duration timing-function delay".split(" "),s=[],l=0,v=function(n){if(e=[],!n.match(f))return n;for(;n.match(u);)e.push(RegExp.$1),n=n.replace(u,ye);return e};l<c[xi.l];l++)for(i=v(n.css(t+"-"+c[l])),o=0;o<i[xi.l];o++)s[o]=(s[o]?s[o]+xe:ye)+i[o];return s.join(", ")}(a.cn)+", "+(c+xe+250)+"ms":ye)):b[a.P]=x,ht()||(a.cn.css(b),ln&&j&&i&&a.cn.one(Q,function(){Lt||a.cn.css(s,ye)})),u.W=x,u.j=_,u.I=h}function Ze(n,t){var r=t?"removeClass":"addClass",e=n?b:y,i=n?An:Rn;(n?s:l)[r](i),e[r](i)}function ni(n){return{K:n?he:pe,ln:n?"Width":"Height",P:n?le:fe,G:n?"Left":"Top",U:n?pn:bn,J:n?"X":"Y",F:n?"w":"h",vn:n?"l":"t",un:n?s:b,cn:n?l:y,an:n?f:v,sn:n?vn:dn}}function st(n){ir=ir||pt(Wn,!0),n?p&&Rt?si(ir.removeAttr(xi.s),In):mt(ir):p||Kt.append(ir)}function ti(n,t,r){if(!1!==r)if(Rt){var e,i=qt.callbacks[n],o=n;"on"===o.substr(0,2)&&(o=o.substr(2,1).toLowerCase()+o.substr(3)),cn(i)==bi&&i.call(St,t),d(Pn,function(){cn((e=this).on)==bi&&e.on(o,t)})}else Lt||jn.push({n:n,a:t})}function ri(n,t,r){r=r||[ye,ye,ye,ye],n[(t=t||ye)+fe]=r[0],n[t+ce]=r[1],n[t+se]=r[2],n[t+le]=r[3]}function ei(n,t,r,e){return t=t||ye,n=n||ye,{t:e?0:ii(Kt.css(n+fe+t)),r:r?0:ii(Kt.css(n+ce+t)),b:e?0:ii(Kt.css(n+se+t)),l:r?0:ii(Kt.css(n+le+t))}}function lt(n,t){var r,e,i,o=function(n,t){if(i="",t&&typeof n==mi)for(e=n.split(xe),r=0;r<e[xi.l];r++)i+="|"+e[r]+"$";return i};return new RegExp("(^"+rn+"([-_].+|)$)"+o(Er,n)+o(Ir,t),"g")}function vt(){var n=fr[xi.bCR]();
10073return{x:ln&&1/(Oi.round(n.width)/fr[xi.oW])||1,y:ln&&1/(Oi.round(n.height)/fr[xi.oH])||1}}function dt(n){var t="ownerDocument",r="HTMLElement",e=n&&n[t]&&n[t].parentWindow||vi;return typeof e[r]==pi?n instanceof e[r]:n&&typeof n==pi&&null!==n&&1===n.nodeType&&typeof n.nodeName==mi}function ii(n,t){var r=t?parseFloat(n):parseInt(n,10);return isNaN(r)?0:r}function ht(){return Cr&&zt.x&&zt.y}function oi(){return Nt?er[0]:sr}function ai(r,n){return"<div "+(r?cn(r)==mi?'class="'+r+'"':function(){var n,t=ye;if(Ci.isPlainObject(r))for(n in r)t+=("c"===n?"class":n)+'="'+r[n]+'" ';return t}():ye)+">"+(n||ye)+"</div>"}function pt(n,t){var r=cn(t)==gi,e=!r&&t||Kt;return p&&!e[xi.l]?null:p?e[r?"children":"find"](W+n.replace(/\s/g,W)).eq(0):Ci(ai(n))}function bt(n,t){for(var r,e=t.split(W),i=0;i<e.length;i++){if(!n[xi.hOP](e[i]))return;r=n[e[i]],i<e.length&&cn(r)==pi&&(n=r)}return r}function yt(n){var t=qt.updateOnLoad;t=cn(t)==mi?t.split(xe):t,Si.isA(t)&&!Lt&&d(t,n)}function ui(n,t,r){if(r)return r;if(cn(n)!=pi||cn(t)!=pi)return n!==t;for(var e in n)if("c"!==e){if(!n[xi.hOP](e)||!t[xi.hOP](e))return!0;if(ui(n[e],t[e]))return!0}return!1}function fi(){return Ci.extend.apply(this,[!0].concat([].slice.call(arguments)))}function ci(n,t){return e.addClass.call(n,t)}function si(n,t){return e.removeClass.call(n,t)}function li(n,t,r){return(r?ci:si)(n,t)}function mt(n){return e.remove.call(n)}function gt(n,t){return e.find.call(n,t).eq(0)}}return ki&&ki.fn&&(ki.fn.overlayScrollbars=function(n,t){return ki.isPlainObject(n)?(ki.each(this,function(){w(this,n,t)}),this):w(this,n)}),w}); 10074/* 10075 A simple jQuery modal (http://github.com/kylefox/jquery-modal) 10076 Version 0.9.2 10077*/ 10078!function(o){"object"==typeof module&&"object"==typeof module.exports?o(require("jquery"),window,document):o(jQuery,window,document)}(function(o,t,i,e){var s=[],l=function(){return s.length?s[s.length-1]:null},n=function(){var o,t=!1;for(o=s.length-1;o>=0;o--)s[o].$blocker&&(s[o].$blocker.toggleClass("current",!t).toggleClass("behind",t),t=!0)};o.modal=function(t,i){var e,n;if(this.$body=o("body"),this.options=o.extend({},o.modal.defaults,i),this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10)),this.$blocker=null,this.options.closeExisting)for(;o.modal.isActive();)o.modal.close();if(s.push(this),t.is("a"))if(n=t.attr("href"),this.anchor=t,/^#/.test(n)){if(this.$elm=o(n),1!==this.$elm.length)return null;this.$body.append(this.$elm),this.open()}else this.$elm=o("<div>"),this.$body.append(this.$elm),e=function(o,t){t.elm.remove()},this.showSpinner(),t.trigger(o.modal.AJAX_SEND),o.get(n).done(function(i){if(o.modal.isActive()){t.trigger(o.modal.AJAX_SUCCESS);var s=l();s.$elm.empty().append(i).on(o.modal.CLOSE,e),s.hideSpinner(),s.open(),t.trigger(o.modal.AJAX_COMPLETE)}}).fail(function(){t.trigger(o.modal.AJAX_FAIL);var i=l();i.hideSpinner(),s.pop(),t.trigger(o.modal.AJAX_COMPLETE)});else this.$elm=t,this.anchor=t,this.$body.append(this.$elm),this.open()},o.modal.prototype={constructor:o.modal,open:function(){var t=this;this.block(),this.anchor.blur(),this.options.doFade?setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay):this.show(),o(i).off("keydown.modal").on("keydown.modal",function(o){var t=l();27===o.which&&t.options.escapeClose&&t.close()}),this.options.clickClose&&this.$blocker.click(function(t){t.target===this&&o.modal.close()})},close:function(){s.pop(),this.unblock(),this.hide(),o.modal.isActive()||o(i).off("keydown.modal")},block:function(){this.$elm.trigger(o.modal.BEFORE_BLOCK,[this._ctx()]),this.$body.css("overflow","hidden"),this.$blocker=o('<div class="'+this.options.blockerClass+' blocker current"></div>').appendTo(this.$body),n(),this.options.doFade&&this.$blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(o.modal.BLOCK,[this._ctx()])},unblock:function(t){!t&&this.options.doFade?this.$blocker.fadeOut(this.options.fadeDuration,this.unblock.bind(this,!0)):(this.$blocker.children().appendTo(this.$body),this.$blocker.remove(),this.$blocker=null,n(),o.modal.isActive()||this.$body.css("overflow",""))},show:function(){this.$elm.trigger(o.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=o('<a href="#close-modal" rel="modal:close" class="close-modal '+this.options.closeClass+'">'+this.options.closeText+"</a>"),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker),this.options.doFade?this.$elm.css({opacity:0,display:"inline-block"}).animate({opacity:1},this.options.fadeDuration):this.$elm.css("display","inline-block"),this.$elm.trigger(o.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(o.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove();var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(o.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||o('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,$elm:this.$elm,$blocker:this.$blocker,options:this.options,$anchor:this.anchor}}},o.modal.close=function(t){if(o.modal.isActive()){t&&t.preventDefault();var i=l();return i.close(),i.$elm}},o.modal.isActive=function(){return s.length>0},o.modal.getCurrent=l,o.modal.defaults={closeExisting:!0,escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",blockerClass:"jquery-modal",spinnerHtml:'<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>',showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},o.modal.BEFORE_BLOCK="modal:before-block",o.modal.BLOCK="modal:block",o.modal.BEFORE_OPEN="modal:before-open",o.modal.OPEN="modal:open",o.modal.BEFORE_CLOSE="modal:before-close",o.modal.CLOSE="modal:close",o.modal.AFTER_CLOSE="modal:after-close",o.modal.AJAX_SEND="modal:ajax:send",o.modal.AJAX_SUCCESS="modal:ajax:success",o.modal.AJAX_FAIL="modal:ajax:fail",o.modal.AJAX_COMPLETE="modal:ajax:complete",o.fn.modal=function(t){return 1===this.length&&new o.modal(this,t),this},o(i).on("click.modal",'a[rel~="modal:close"]',o.modal.close),o(i).on("click.modal",'a[rel~="modal:open"]',function(t){t.preventDefault(),o(this).modal()})});
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.